6c86867b by logesh

dev:changes in player ajax call

1 parent 0c363c29
......@@ -104,7 +104,38 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
str +=seconds;
str +=" secs in this video.</font>";
params['notestime'] = str;
var rootPath = M.cfg.wwwroot;
$.ajax({
url: rootPath + "/blocks/mynotes/timerajax.php",
type: 'POST',
data: { notestime: str},
success: function(data){
}
});
// if ( url.includes('/mod/page/view.php') ){
$.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){
if(result){
var JSONObject = JSON.parse(result);
var profile_field=JSONObject.profile2;
console.log("***************");
console.log(profile_field);
console.log("***************");
// $('.'+profile_field).show();
}
}});
// }
// params['notestime'] = str;
// console.log(str);
})
//
......
......@@ -104,7 +104,38 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
str +=seconds;
str +=" secs in this video.</font>";
params['notestime'] = str;
var rootPath = M.cfg.wwwroot;
$.ajax({
url: rootPath + "/blocks/mynotes/timerajax.php",
type: 'POST',
data: { notestime: str},
success: function(data){
}
});
// if ( url.includes('/mod/page/view.php') ){
$.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){
if(result){
var JSONObject = JSON.parse(result);
var profile_field=JSONObject.profile2;
console.log("***************");
console.log(profile_field);
console.log("***************");
// $('.'+profile_field).show();
}
}});
// }
// params['notestime'] = str;
// console.log(str);
})
//
......
......@@ -15,18 +15,20 @@ define(['jquery'], function($) {
console.log(player);
$('#mynotepencil').click(function(){
setTimeout(function(){
player.getCurrentTime().then(function(seconds) {
// console.log(seconds);
// console.log("seconds");
// mynotestime=seconds;
var self=seconds;
var $mynotestime=seconds;
var str = "</br><br><div style='display: none !important;'> You have taken notes at ";
str +=seconds;
str +=" in this video.</div>"
// var result = str.fontcolor("green");
// $("#id_mynotecontent-54").val(str);
})
// console.log($mynotestime);
// console.log(self);
// setTimeout(function(){
//
// var str = "<div> You have taken notes at ";
......@@ -35,7 +37,7 @@ define(['jquery'], function($) {
// var result = str.fontcolor("green");
// $("#id_mynotecontent-258").val(result);
// }, 1000);
}, 1000);
});
......
<?php
require_once('/../../config.php');
require_once($CFG->dirroot.'/user/profile/lib.php');
require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot . '/blocks/mynotes/lib.php');
global $USER,$DB;
if (!isloggedin()) {
echo json_encode(array('error' => 'require_login'));
die();
}
$timertext = optional_param('notestime', '', PARAM_TEXT);
// $myuser=profile_user_record($USER->id);
if ($timertext){
echo json_encode($timertext);
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!