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
aaddd433
authored
2018-09-21 12:46:47 +0530
by
logesh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
changes in vimeo player ajax call
1 parent
6c86867b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
57 deletions
amd/build/mynotesblock.js
amd/build/script.min.js
amd/src/mynotesblock.js
timerajax.php
amd/build/mynotesblock.js
View file @
aaddd43
...
...
@@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
request
:
function
(
args
)
{
var
params
=
{};
var
scope
=
this
;
if
(
args
[
'scope'
])
{
scope
=
args
[
'scope'
];
}
params
[
'contextarea'
]
=
scope
.
currenttab
.
replace
(
CONFIG
.
prefix
,
''
);
params
[
'contextarea'
]
=
params
[
'contextarea'
].
replace
(
'#'
,
''
);
if
(
args
.
params
)
{
for
(
i
in
args
.
params
)
{
params
[
i
]
=
args
.
params
[
i
];
}
}
params
[
'sesskey'
]
=
M
.
cfg
.
sesskey
;
var
url
=
$
(
location
).
attr
(
'href'
);
//notes player time starts
$
(
'document'
).
ready
(
function
(){
...
...
@@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
var
iframe
=
document
.
querySelector
(
'iframe'
);
// console.log(iframe);
var
player
=
new
Vimeo
.
Player
(
iframe
);
console
.
log
(
"player"
);
console
.
log
(
player
);
player
.
pause
().
then
(
function
()
{
})
...
...
@@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
$
.
ajax
({
url
:
rootPath
+
"/blocks/mynotes/timerajax.php"
,
type
:
'POST'
,
data
:
{
notestime
:
str
},
data
:
{
notestime
:
'pollathavan'
},
success
:
function
(
data
){
}
});
// if ( url.includes('/mod/page/view.php') ){
$
.
ajax
({
url
:
rootPath
+
"/blocks/mynotes/timerajax.php"
,
success
:
function
(
result
){
...
...
@@ -132,26 +123,37 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
// }
// params['notestime'] = str;
// console.log(str);
})
//
// var result = str.fontcolor("green");
}
});
//notes player time ends
if
(
args
[
'scope'
])
{
scope
=
args
[
'scope'
];
}
params
[
'contextarea'
]
=
scope
.
currenttab
.
replace
(
CONFIG
.
prefix
,
''
);
params
[
'contextarea'
]
=
params
[
'contextarea'
].
replace
(
'#'
,
''
);
if
(
args
.
params
)
{
for
(
i
in
args
.
params
)
{
params
[
i
]
=
args
.
params
[
i
];
}
}
params
[
'sesskey'
]
=
M
.
cfg
.
sesskey
;
var
cfg
=
{
method
:
'POST'
,
on
:
{
...
...
amd/build/script.min.js
View file @
aaddd43
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
i
=
document
.
querySelector
(
"iframe"
),
t
=
new
Vimeo
.
Player
(
i
);
console
.
log
(
t
),
e
(
"#mynotepencil"
).
click
(
function
(){
t
.
getCurrentTime
().
then
(
function
(
e
){})})}})}}});
\ 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
);
console
.
log
(
i
),
e
(
"#mynotepencil"
).
click
(
function
(){
setTimeout
(
function
(){
i
.
getCurrentTime
().
then
(
function
(
e
){})},
1
e3
)})}})}}});
\ No newline at end of file
...
...
amd/src/mynotesblock.js
View file @
aaddd43
...
...
@@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
request
:
function
(
args
)
{
var
params
=
{};
var
scope
=
this
;
if
(
args
[
'scope'
])
{
scope
=
args
[
'scope'
];
}
params
[
'contextarea'
]
=
scope
.
currenttab
.
replace
(
CONFIG
.
prefix
,
''
);
params
[
'contextarea'
]
=
params
[
'contextarea'
].
replace
(
'#'
,
''
);
if
(
args
.
params
)
{
for
(
i
in
args
.
params
)
{
params
[
i
]
=
args
.
params
[
i
];
}
}
params
[
'sesskey'
]
=
M
.
cfg
.
sesskey
;
var
url
=
$
(
location
).
attr
(
'href'
);
//notes player time starts
$
(
'document'
).
ready
(
function
(){
...
...
@@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
var
iframe
=
document
.
querySelector
(
'iframe'
);
// console.log(iframe);
var
player
=
new
Vimeo
.
Player
(
iframe
);
console
.
log
(
"player"
);
console
.
log
(
player
);
player
.
pause
().
then
(
function
()
{
})
...
...
@@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
$
.
ajax
({
url
:
rootPath
+
"/blocks/mynotes/timerajax.php"
,
type
:
'POST'
,
data
:
{
notestime
:
str
},
data
:
{
notestime
:
'pollathavan'
},
success
:
function
(
data
){
}
});
// if ( url.includes('/mod/page/view.php') ){
$
.
ajax
({
url
:
rootPath
+
"/blocks/mynotes/timerajax.php"
,
success
:
function
(
result
){
...
...
@@ -132,26 +123,37 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
// }
// params['notestime'] = str;
// console.log(str);
})
//
// var result = str.fontcolor("green");
}
});
//notes player time ends
if
(
args
[
'scope'
])
{
scope
=
args
[
'scope'
];
}
params
[
'contextarea'
]
=
scope
.
currenttab
.
replace
(
CONFIG
.
prefix
,
''
);
params
[
'contextarea'
]
=
params
[
'contextarea'
].
replace
(
'#'
,
''
);
if
(
args
.
params
)
{
for
(
i
in
args
.
params
)
{
params
[
i
]
=
args
.
params
[
i
];
}
}
params
[
'sesskey'
]
=
M
.
cfg
.
sesskey
;
var
cfg
=
{
method
:
'POST'
,
on
:
{
...
...
timerajax.php
View file @
aaddd43
<?php
require_once
(
'/../../config.php'
);
require_once
(
$CFG
->
dirroot
.
'/user/profile/lib.php'
);
require_once
(
$CFG
->
dirroot
.
'/course/lib.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
();
}
//
if (!isloggedin()) {
//
echo json_encode(array('error' => 'require_login'));
//
die();
//
}
$timertext
=
optional_param
(
'notestime'
,
''
,
PARAM_TEXT
);
$timertext
=
optional_param
(
'notestime'
,
''
,
PARAM_TEXT
);
// $myuser=profile_user_record($USER->id);
if
(
$timertext
){
echo
json_encode
(
$timertext
)
;
echo
$timertext
;
}
else
{
echo
"value fromrhere"
;
}
...
...
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