Minor cleanups. Basic infrastructure for restoring video playback state (but unfinished)

This commit is contained in:
Piotr Mitros
2011-12-11 19:42:55 -05:00
parent 7b578b835a
commit 0a075b5e00
3 changed files with 21 additions and 6 deletions

View File

@@ -9,7 +9,7 @@
submit_data[value.id]=value.value;
});
if($('#check_${ id }').attr('value') == 'Check') {
if($('#check_${ id }').attr('value').substring(0,5) != 'Reset') {
$.getJSON('/modx/problem/${ id }/problem_check',
submit_data,
function(json) {
@@ -30,8 +30,6 @@
});
});
</script>
% if not done:
<input id="check_${ id }" type="button" value="Check" >
% else:
<input id="check_${ id }" type="button" value="Reset" >
% if check_button:
<input id="check_${ id }" type="button" value="${ check_button }" >
% endif

View File

@@ -1,3 +1,5 @@
// CRITICAL TODO: Namespace
var files=["",
%for t in items:
${t[1]['content']} ,
@@ -5,10 +7,17 @@ var files=["",
""
];
var functions=["",
%for t in items:
function(){ ${t[1]['js']} },
%endfor
""];
var loc;
function goto(i) {
$('#content').html(files[i]);
functions[i]()
loc=i;
}

View File

@@ -5,4 +5,12 @@ swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=y
var captions=0;
$("#slider").slider({slide:function(event,ui){seek_slide('slide',event.originalEvent,ui.value);},
stop:function(event,ui){seek_slide('stop',event.originalEvent,ui.value);}});
loadNewVideo('${id}');
function good() {
window['console'].log(ytplayer.getCurrentTime());
}
ajax_video=good;
loadNewVideo('${id}', ${ video_time });