Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Logeshwaran
/
mynotes
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
8
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
6c86867b
authored
2018-09-21 11:20:33 +0530
by
logesh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
dev:changes in player ajax call
1 parent
0c363c29
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
10 deletions
amd/build/mynotesblock.js
amd/src/mynotesblock.js
amd/src/script.js
timerajax.php
amd/build/mynotesblock.js
View file @
6c86867
...
...
@@ -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);
})
//
...
...
amd/src/mynotesblock.js
View file @
6c86867
...
...
@@ -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);
})
//
...
...
amd/src/script.js
View file @
6c86867
...
...
@@ -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
);
});
...
...
timerajax.php
0 → 100644
View file @
6c86867
<?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
);
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment