5ca8f561 by logesh

dev:changes in notes

1 parent f9077e02
define(["jquery"],function(e){return{init:function(){var o=e(location).attr("href");e("document").ready(function(){if(o.includes("/mod/page/view.php")){var n=document.querySelector("iframe"),t=new Vimeo.Player(n);t.on("play",function(){console.log("played the video!"),setTimeout(function(){t.getCurrentTime().then(function(e){console.log("time video played"),console.log(e)})},1500)}),t.getVideoId().then(function(e){console.log("video id"),console.log(e),console.log("*******")}),setTimeout(function(){t.getCurrentTime().then(function(e){console.log("time out function"),console.log(e)})},1500),e("#mynotepencil").click(function(){var o;t.getCurrentTime().then(function(e){o=e}),setTimeout(function(){console.log(o);var n="<div> You have taken notes at ";n+=o;var t=(n+=" in this video.</div>").fontcolor("green");e("#id_mynotecontent-258").val(t)},1e3)}),t.pause().then(function(){alert("the video was paused")})}})}}});
\ No newline at end of file
define(["jquery"],function(e){return{init:function(){var n=e(location).attr("href");e("document").ready(function(){if(n.includes("/mod/page/view.php")){var t=document.querySelector("iframe"),i=new Vimeo.Player(t);e("#mynotepencil").click(function(){var e;i.getCurrentTime().then(function(n){e=n}),setTimeout(function(){var n="<div> You have taken notes at ";n+=e;(n+=" in this video.</div>").fontcolor("green")},1e3)}),i.pause().then(function(){alert("the video was paused")})}})}}});
\ No newline at end of file
......
......@@ -12,35 +12,6 @@ define(['jquery'], function($) {
var player = new Vimeo.Player(iframe);
player.on("play", function() {
console.log('played the video!');
setTimeout(function(){
player.getCurrentTime().then(function(seconds) {
console.log("time video played");
console.log(seconds);
})
}, 1500);
});
player.getVideoId().then(function(id) {
// id = the video id
console.log("video id");
console.log(id);
console.log("*******")
})
setTimeout(function(){
player.getCurrentTime().then(function(seconds) {
console.log("time out function");
console.log(seconds);
})
}, 1500);
$('#mynotepencil').click(function(){
......@@ -52,30 +23,21 @@ define(['jquery'], function($) {
})
setTimeout(function(){
console.log(time);
var str = "<div> You have taken notes at ";
str +=time;
str +=" in this video.</div>"
var result = str.fontcolor("green");
$("#id_mynotecontent-258").val(result);
// var str = "<div> You have taken notes at ";
// str +=time;
// str +=" in this video.</div>"
// var result = str.fontcolor("green");
// $("#id_mynotecontent-258").val(result);
}, 1000);
});
player.pause().then(function() {
alert('the video was paused');
})
player.pause().then(function() {
alert('the video was paused');
})
/*.catch(function(error) {
// an error occurred
});*/
}
});
......
......@@ -147,9 +147,10 @@ class block_mynotes_manager {
*
* @return object of single mynote record if insert to DB else false
*/
public function addmynote($context, $contextarea, $course, $content, $format = FORMAT_MOODLE) {
public function addmynote($context, $contextarea, $course, $content,$timer, $format = FORMAT_MOODLE) {
global $CFG, $DB, $USER, $OUTPUT;
$content=$content.$timer;
// print_r($content);
$newnote = new stdClass;
$newnote->contextid = $context->id;
$newnote->contextarea = $contextarea;
......
......@@ -65,8 +65,10 @@ echo $OUTPUT->header(); //...send headers
switch ($action) {
case 'add':
$content = optional_param('content', '', PARAM_RAW);
$timer = optional_param('notestime', 0, PARAM_TEXT);
print_r($timer);
$manager = new block_mynotes_manager();
if ($note = $manager->addmynote($context, $contextarea, $course, $content)) {
if ($note = $manager->addmynote($context, $contextarea, $course, $content,$timer)) {
$options = new stdClass();
$options->page = $page;
$options->courseid = $course->id;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!