84ba169e by logesh

dev:changes in my notes plugin

1 parent f38f6341
......@@ -81,7 +81,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
var url= $(location).attr('href');
if(url.includes('/mod/page/view.php')){
if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......@@ -159,7 +159,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
}
if(url.includes('/mod/page/view.php')){
if((url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......@@ -231,6 +231,14 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
return false;
}
var url= $(location).attr('href');
if(url.includes('/mod/scorm/player.php')){
url='';
}
var arg = {
contextid: CONFIG.contextid,
content: ta.val(),
......@@ -449,7 +457,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
});
$('body').delegate('#id_mynotecontent-' + CONFIG.instanceid, 'focus blur', function(e) {
var url= $(location).attr('href');
if(url.includes('/mod/page/view.php')){
if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......@@ -502,7 +510,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
displayDialogue: function(e) {
var url= $(location).attr('href');
if(url.includes('/mod/page/view.php')){
if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......
......@@ -81,7 +81,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
var url= $(location).attr('href');
if(url.includes('/mod/page/view.php')){
if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......@@ -159,7 +159,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
}
if(url.includes('/mod/page/view.php')){
if((url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......@@ -231,6 +231,14 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
return false;
}
var url= $(location).attr('href');
if(url.includes('/mod/scorm/player.php')){
url='';
}
var arg = {
contextid: CONFIG.contextid,
content: ta.val(),
......@@ -449,7 +457,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
});
$('body').delegate('#id_mynotecontent-' + CONFIG.instanceid, 'focus blur', function(e) {
var url= $(location).attr('href');
if(url.includes('/mod/page/view.php')){
if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......@@ -502,7 +510,7 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
displayDialogue: function(e) {
var url= $(location).attr('href');
if(url.includes('/mod/page/view.php')){
if( (url.includes('/mod/page/view.php')) || (url.includes('/mod/externalvideo/view.php')) ){
//notes player timer starts
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
......
......@@ -86,8 +86,14 @@ class block_mynotes_manager {
$c->id = $u->mynoteid;
$c->userid = $u->id;
if ($u->courseid != SITEID) {
// $c->coursename = html_writer::link(course_get_url($u->courseid), $u->coursename);
$c->coursename = html_writer::link($u->notesurl, $u->coursename);
// $c->coursename = html_writer::link(course_get_url($u->courseid), $u->coursename);
if (! empty ( $u->notesurl )) {
$c->coursename = html_writer::link ( $u->notesurl, $u->coursename );
} else {
$c->coursename = $u->coursename;
}
} else {
$c->coursename = '';
}
......@@ -210,7 +216,27 @@ class block_mynotes_manager {
$newnote->timecreated = time();
$newnote->notestime=$timer;
if (!empty($timer)){
$newnote->notesurl=$activityUrl.'?resume='.$newnote->notestime.'?type=notes';
// $s = 'Posted On April 6th By Some Dude';
// $variable= strstr($s, 'By', true);
$variable = substr($activityUrl, 0, strpos($activityUrl, "&start="));
// $newnote->notesurl=$activityUrl.'&resume='.$newnote->notestime.'&type=notes';
// str_replace("start=","Peter",$activityUrl);
//
// $newnote->notesurl=$variable;
if ($variable){
$newnote->notesurl=$variable.'&start='.$newnote->notestime.'&type=notes';
}else{
$newnote->notesurl=$activityUrl.'&start='.$newnote->notestime.'&type=notes';
}
}else{
$newnote->notesurl=$activityUrl;
}
......@@ -224,7 +250,15 @@ class block_mynotes_manager {
$newnote->notesurl = $newnote->notesurl;
if (!empty($newnote->coursename)) {
if (!empty($newnote->notesurl)){
$newnote->coursename = html_writer::link($newnote->notesurl, $newnote->coursename);
}else {
$newnote->coursename = $newnote->coursename;
}
// $newnote->coursename = html_writer::link($newnote->notesurl, $newnote->coursename);
// $newnote->coursename = html_writer::link($newnote->notesurl.'?notestime='.$timer, $newnote->coursename);
// $newnote->coursename=$newnote->notesurl.'?notestime='.$timer,$newnote->coursename;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!