Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
6abee6fa
Commit
6abee6fa
authored
Sep 12, 2016
by
Andreas Valder
Browse files
made chapter suggestion use the current playback time of the video
parent
f2f2a130
Changes
1
Hide whitespace changes
Inline
Side-by-side
templates/lecture.html
View file @
6abee6fa
...
...
@@ -37,8 +37,19 @@ $(function() {
{
html
:
true
,
title
:
'
Kapitelmarkierung vorschlagen
'
,
content
:
'
<form method="post" action="{{url_for(
'
suggest_chapter
'
, ref=request.url, lectureid=lecture.id)}}"><input placeholder="00:00.000" name="time" type="text"><br><input placeholder="Kapitel" name="text" type="texz"><br><input type="submit" value="Vorschlagen"></form>
'
content
:
function
()
{
var
zeropad
=
function
(
num
,
places
)
{
var
zero
=
places
-
num
.
toString
().
length
+
1
;
return
Array
(
+
(
zero
>
0
&&
zero
)).
join
(
"
0
"
)
+
num
;
};
var
timestamp
=
$
(
'
.player video
'
)[
0
].
currentTime
var
h
=
zeropad
(
Math
.
trunc
(
timestamp
/
3600
),
2
);
var
m
=
zeropad
(
Math
.
trunc
((
timestamp
%
3600
)
/
60
),
2
);
var
s
=
zeropad
(
Math
.
trunc
(
timestamp
%
60
),
2
);
var
timeasstring
=
h
+
'
:
'
+
m
+
'
:
'
+
s
return
'
<form method="post" action="{{url_for(
'
suggest_chapter
'
, ref=request.url, lectureid=lecture.id)}}"><input placeholder="00:00.000" name="time" type="text" value="
'
+
timeasstring
+
'
"><br><input placeholder="Kapitel" name="text" type="texz"><br><input type="submit" value="Vorschlagen"></form>
'
}
})
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment