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
84ba169e
authored
2018-10-12 15:06:28 +0530
by
logesh
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
dev:changes in my notes plugin
1 parent
f38f6341
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
11 deletions
amd/build/mynotesblock.js
amd/src/mynotesblock.js
lib.php
amd/build/mynotesblock.js
View file @
84ba169
...
...
@@ -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
);
...
...
amd/src/mynotesblock.js
View file @
84ba169
...
...
@@ -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
);
...
...
lib.php
View file @
84ba169
...
...
@@ -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;
...
...
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