dev:changes in my notes plugin
Showing
3 changed files
with
63 additions
and
13 deletions
... | @@ -81,7 +81,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -81,7 +81,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
81 | 81 | ||
82 | var url= $(location).attr('href'); | 82 | var url= $(location).attr('href'); |
83 | 83 | ||
84 | if(url.includes('/mod/page/view.php')){ | 84 | if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
85 | //notes player timer starts | 85 | //notes player timer starts |
86 | var iframe = document.querySelector('iframe'); | 86 | var iframe = document.querySelector('iframe'); |
87 | var player = new Vimeo.Player(iframe); | 87 | var player = new Vimeo.Player(iframe); |
... | @@ -159,7 +159,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -159,7 +159,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
159 | 159 | ||
160 | } | 160 | } |
161 | 161 | ||
162 | if(url.includes('/mod/page/view.php')){ | 162 | if((url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
163 | //notes player timer starts | 163 | //notes player timer starts |
164 | var iframe = document.querySelector('iframe'); | 164 | var iframe = document.querySelector('iframe'); |
165 | var player = new Vimeo.Player(iframe); | 165 | var player = new Vimeo.Player(iframe); |
... | @@ -231,6 +231,14 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -231,6 +231,14 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
231 | return false; | 231 | return false; |
232 | } | 232 | } |
233 | 233 | ||
234 | |||
235 | var url= $(location).attr('href'); | ||
236 | if(url.includes('/mod/scorm/player.php')){ | ||
237 | |||
238 | url=''; | ||
239 | } | ||
240 | |||
241 | |||
234 | var arg = { | 242 | var arg = { |
235 | contextid: CONFIG.contextid, | 243 | contextid: CONFIG.contextid, |
236 | content: ta.val(), | 244 | content: ta.val(), |
... | @@ -449,7 +457,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -449,7 +457,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
449 | }); | 457 | }); |
450 | $('body').delegate('#id_mynotecontent-' + CONFIG.instanceid, 'focus blur', function(e) { | 458 | $('body').delegate('#id_mynotecontent-' + CONFIG.instanceid, 'focus blur', function(e) { |
451 | var url= $(location).attr('href'); | 459 | var url= $(location).attr('href'); |
452 | if(url.includes('/mod/page/view.php')){ | 460 | if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
453 | //notes player timer starts | 461 | //notes player timer starts |
454 | var iframe = document.querySelector('iframe'); | 462 | var iframe = document.querySelector('iframe'); |
455 | var player = new Vimeo.Player(iframe); | 463 | var player = new Vimeo.Player(iframe); |
... | @@ -502,7 +510,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -502,7 +510,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
502 | displayDialogue: function(e) { | 510 | displayDialogue: function(e) { |
503 | 511 | ||
504 | var url= $(location).attr('href'); | 512 | var url= $(location).attr('href'); |
505 | if(url.includes('/mod/page/view.php')){ | 513 | if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
506 | //notes player timer starts | 514 | //notes player timer starts |
507 | var iframe = document.querySelector('iframe'); | 515 | var iframe = document.querySelector('iframe'); |
508 | var player = new Vimeo.Player(iframe); | 516 | var player = new Vimeo.Player(iframe); | ... | ... |
... | @@ -81,7 +81,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -81,7 +81,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
81 | 81 | ||
82 | var url= $(location).attr('href'); | 82 | var url= $(location).attr('href'); |
83 | 83 | ||
84 | if(url.includes('/mod/page/view.php')){ | 84 | if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
85 | //notes player timer starts | 85 | //notes player timer starts |
86 | var iframe = document.querySelector('iframe'); | 86 | var iframe = document.querySelector('iframe'); |
87 | var player = new Vimeo.Player(iframe); | 87 | var player = new Vimeo.Player(iframe); |
... | @@ -159,7 +159,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -159,7 +159,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
159 | 159 | ||
160 | } | 160 | } |
161 | 161 | ||
162 | if(url.includes('/mod/page/view.php')){ | 162 | if((url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
163 | //notes player timer starts | 163 | //notes player timer starts |
164 | var iframe = document.querySelector('iframe'); | 164 | var iframe = document.querySelector('iframe'); |
165 | var player = new Vimeo.Player(iframe); | 165 | var player = new Vimeo.Player(iframe); |
... | @@ -231,6 +231,14 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -231,6 +231,14 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
231 | return false; | 231 | return false; |
232 | } | 232 | } |
233 | 233 | ||
234 | |||
235 | var url= $(location).attr('href'); | ||
236 | if(url.includes('/mod/scorm/player.php')){ | ||
237 | |||
238 | url=''; | ||
239 | } | ||
240 | |||
241 | |||
234 | var arg = { | 242 | var arg = { |
235 | contextid: CONFIG.contextid, | 243 | contextid: CONFIG.contextid, |
236 | content: ta.val(), | 244 | content: ta.val(), |
... | @@ -449,7 +457,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -449,7 +457,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
449 | }); | 457 | }); |
450 | $('body').delegate('#id_mynotecontent-' + CONFIG.instanceid, 'focus blur', function(e) { | 458 | $('body').delegate('#id_mynotecontent-' + CONFIG.instanceid, 'focus blur', function(e) { |
451 | var url= $(location).attr('href'); | 459 | var url= $(location).attr('href'); |
452 | if(url.includes('/mod/page/view.php')){ | 460 | if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
453 | //notes player timer starts | 461 | //notes player timer starts |
454 | var iframe = document.querySelector('iframe'); | 462 | var iframe = document.querySelector('iframe'); |
455 | var player = new Vimeo.Player(iframe); | 463 | var player = new Vimeo.Player(iframe); |
... | @@ -502,7 +510,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -502,7 +510,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
502 | displayDialogue: function(e) { | 510 | displayDialogue: function(e) { |
503 | 511 | ||
504 | var url= $(location).attr('href'); | 512 | var url= $(location).attr('href'); |
505 | if(url.includes('/mod/page/view.php')){ | 513 | if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){ |
506 | //notes player timer starts | 514 | //notes player timer starts |
507 | var iframe = document.querySelector('iframe'); | 515 | var iframe = document.querySelector('iframe'); |
508 | var player = new Vimeo.Player(iframe); | 516 | var player = new Vimeo.Player(iframe); | ... | ... |
... | @@ -86,9 +86,15 @@ class block_mynotes_manager { | ... | @@ -86,9 +86,15 @@ class block_mynotes_manager { |
86 | $c->id = $u->mynoteid; | 86 | $c->id = $u->mynoteid; |
87 | $c->userid = $u->id; | 87 | $c->userid = $u->id; |
88 | if ($u->courseid != SITEID) { | 88 | if ($u->courseid != SITEID) { |
89 | // $c->coursename = html_writer::link(course_get_url($u->courseid), $u->coursename); | 89 | // $c->coursename = html_writer::link(course_get_url($u->courseid), $u->coursename); |
90 | $c->coursename = html_writer::link($u->notesurl, $u->coursename); | 90 | |
91 | } else { | 91 | if (! empty ( $u->notesurl )) { |
92 | $c->coursename = html_writer::link ( $u->notesurl, $u->coursename ); | ||
93 | } else { | ||
94 | |||
95 | $c->coursename = $u->coursename; | ||
96 | } | ||
97 | } else { | ||
92 | $c->coursename = ''; | 98 | $c->coursename = ''; |
93 | } | 99 | } |
94 | $c->content = $u->ccontent; | 100 | $c->content = $u->ccontent; |
... | @@ -210,7 +216,27 @@ class block_mynotes_manager { | ... | @@ -210,7 +216,27 @@ class block_mynotes_manager { |
210 | $newnote->timecreated = time(); | 216 | $newnote->timecreated = time(); |
211 | $newnote->notestime=$timer; | 217 | $newnote->notestime=$timer; |
212 | if (!empty($timer)){ | 218 | if (!empty($timer)){ |
213 | $newnote->notesurl=$activityUrl.'?resume='.$newnote->notestime.'?type=notes'; | 219 | // $s = 'Posted On April 6th By Some Dude'; |
220 | // $variable= strstr($s, 'By', true); | ||
221 | |||
222 | $variable = substr($activityUrl, 0, strpos($activityUrl, "&start=")); | ||
223 | |||
224 | // $newnote->notesurl=$activityUrl.'&resume='.$newnote->notestime.'&type=notes'; | ||
225 | |||
226 | // str_replace("start=","Peter",$activityUrl); | ||
227 | // | ||
228 | // $newnote->notesurl=$variable; | ||
229 | |||
230 | if ($variable){ | ||
231 | |||
232 | $newnote->notesurl=$variable.'&start='.$newnote->notestime.'&type=notes'; | ||
233 | |||
234 | }else{ | ||
235 | |||
236 | $newnote->notesurl=$activityUrl.'&start='.$newnote->notestime.'&type=notes'; | ||
237 | |||
238 | } | ||
239 | |||
214 | }else{ | 240 | }else{ |
215 | $newnote->notesurl=$activityUrl; | 241 | $newnote->notesurl=$activityUrl; |
216 | } | 242 | } |
... | @@ -224,7 +250,15 @@ class block_mynotes_manager { | ... | @@ -224,7 +250,15 @@ class block_mynotes_manager { |
224 | $newnote->notesurl = $newnote->notesurl; | 250 | $newnote->notesurl = $newnote->notesurl; |
225 | if (!empty($newnote->coursename)) { | 251 | if (!empty($newnote->coursename)) { |
226 | 252 | ||
227 | $newnote->coursename = html_writer::link($newnote->notesurl, $newnote->coursename); | 253 | if (!empty($newnote->notesurl)){ |
254 | |||
255 | $newnote->coursename = html_writer::link($newnote->notesurl, $newnote->coursename); | ||
256 | }else { | ||
257 | |||
258 | $newnote->coursename = $newnote->coursename; | ||
259 | } | ||
260 | |||
261 | // $newnote->coursename = html_writer::link($newnote->notesurl, $newnote->coursename); | ||
228 | 262 | ||
229 | // $newnote->coursename = html_writer::link($newnote->notesurl.'?notestime='.$timer, $newnote->coursename); | 263 | // $newnote->coursename = html_writer::link($newnote->notesurl.'?notestime='.$timer, $newnote->coursename); |
230 | // $newnote->coursename=$newnote->notesurl.'?notestime='.$timer,$newnote->coursename; | 264 | // $newnote->coursename=$newnote->notesurl.'?notestime='.$timer,$newnote->coursename; | ... | ... |
-
Please register or sign in to post a comment