dev:changes in player ajax call
Showing
4 changed files
with
95 additions
and
10 deletions
... | @@ -104,7 +104,38 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -104,7 +104,38 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
104 | str +=seconds; | 104 | str +=seconds; |
105 | str +=" secs in this video.</font>"; | 105 | str +=" secs in this video.</font>"; |
106 | 106 | ||
107 | params['notestime'] = str; | 107 | var rootPath = M.cfg.wwwroot; |
108 | $.ajax({ | ||
109 | url: rootPath + "/blocks/mynotes/timerajax.php", | ||
110 | type: 'POST', | ||
111 | data: { notestime: str}, | ||
112 | success: function(data){ | ||
113 | |||
114 | |||
115 | } | ||
116 | }); | ||
117 | |||
118 | |||
119 | // if ( url.includes('/mod/page/view.php') ){ | ||
120 | |||
121 | $.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){ | ||
122 | if(result){ | ||
123 | var JSONObject = JSON.parse(result); | ||
124 | var profile_field=JSONObject.profile2; | ||
125 | |||
126 | console.log("***************"); | ||
127 | console.log(profile_field); | ||
128 | console.log("***************"); | ||
129 | // $('.'+profile_field).show(); | ||
130 | } | ||
131 | }}); | ||
132 | // } | ||
133 | |||
134 | |||
135 | |||
136 | // params['notestime'] = str; | ||
137 | |||
138 | // console.log(str); | ||
108 | }) | 139 | }) |
109 | // | 140 | // |
110 | 141 | ... | ... |
... | @@ -104,7 +104,38 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -104,7 +104,38 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
104 | str +=seconds; | 104 | str +=seconds; |
105 | str +=" secs in this video.</font>"; | 105 | str +=" secs in this video.</font>"; |
106 | 106 | ||
107 | params['notestime'] = str; | 107 | var rootPath = M.cfg.wwwroot; |
108 | $.ajax({ | ||
109 | url: rootPath + "/blocks/mynotes/timerajax.php", | ||
110 | type: 'POST', | ||
111 | data: { notestime: str}, | ||
112 | success: function(data){ | ||
113 | |||
114 | |||
115 | } | ||
116 | }); | ||
117 | |||
118 | |||
119 | // if ( url.includes('/mod/page/view.php') ){ | ||
120 | |||
121 | $.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){ | ||
122 | if(result){ | ||
123 | var JSONObject = JSON.parse(result); | ||
124 | var profile_field=JSONObject.profile2; | ||
125 | |||
126 | console.log("***************"); | ||
127 | console.log(profile_field); | ||
128 | console.log("***************"); | ||
129 | // $('.'+profile_field).show(); | ||
130 | } | ||
131 | }}); | ||
132 | // } | ||
133 | |||
134 | |||
135 | |||
136 | // params['notestime'] = str; | ||
137 | |||
138 | // console.log(str); | ||
108 | }) | 139 | }) |
109 | // | 140 | // |
110 | 141 | ... | ... |
... | @@ -15,18 +15,20 @@ define(['jquery'], function($) { | ... | @@ -15,18 +15,20 @@ define(['jquery'], function($) { |
15 | console.log(player); | 15 | console.log(player); |
16 | $('#mynotepencil').click(function(){ | 16 | $('#mynotepencil').click(function(){ |
17 | 17 | ||
18 | 18 | setTimeout(function(){ | |
19 | player.getCurrentTime().then(function(seconds) { | 19 | player.getCurrentTime().then(function(seconds) { |
20 | // console.log(seconds); | 20 | |
21 | // console.log("seconds"); | 21 | var str = "</br><br><div style='display: none !important;'> You have taken notes at "; |
22 | // mynotestime=seconds; | 22 | str +=seconds; |
23 | var self=seconds; | 23 | str +=" in this video.</div>" |
24 | var $mynotestime=seconds; | 24 | // var result = str.fontcolor("green"); |
25 | // $("#id_mynotecontent-54").val(str); | ||
26 | |||
25 | }) | 27 | }) |
26 | // console.log($mynotestime); | 28 | // console.log($mynotestime); |
27 | // console.log(self); | 29 | // console.log(self); |
28 | 30 | ||
29 | // setTimeout(function(){ | 31 | // |
30 | 32 | ||
31 | 33 | ||
32 | // var str = "<div> You have taken notes at "; | 34 | // var str = "<div> You have taken notes at "; |
... | @@ -35,7 +37,7 @@ define(['jquery'], function($) { | ... | @@ -35,7 +37,7 @@ define(['jquery'], function($) { |
35 | // var result = str.fontcolor("green"); | 37 | // var result = str.fontcolor("green"); |
36 | // $("#id_mynotecontent-258").val(result); | 38 | // $("#id_mynotecontent-258").val(result); |
37 | 39 | ||
38 | // }, 1000); | 40 | }, 1000); |
39 | 41 | ||
40 | }); | 42 | }); |
41 | 43 | ... | ... |
timerajax.php
0 → 100644
1 | <?php | ||
2 | require_once('/../../config.php'); | ||
3 | require_once($CFG->dirroot.'/user/profile/lib.php'); | ||
4 | require_once($CFG->dirroot.'/course/lib.php'); | ||
5 | require_once($CFG->dirroot . '/blocks/mynotes/lib.php'); | ||
6 | global $USER,$DB; | ||
7 | |||
8 | if (!isloggedin()) { | ||
9 | echo json_encode(array('error' => 'require_login')); | ||
10 | die(); | ||
11 | } | ||
12 | |||
13 | $timertext = optional_param('notestime', '', PARAM_TEXT); | ||
14 | |||
15 | // $myuser=profile_user_record($USER->id); | ||
16 | |||
17 | if ($timertext){ | ||
18 | |||
19 | echo json_encode($timertext); | ||
20 | |||
21 | } |
-
Please register or sign in to post a comment