Skip to content

Commit

Permalink
pressing p again will stop the preshow
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Jun 24, 2010
1 parent 9e982b2 commit ab84bab
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions public/js/showoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,24 +470,27 @@ var preshow_imagesTotal = 0;
var preshow_des;

function runPreShow() {
if(preshow_running) { return false }
var minutes = prompt("Minutes from now to start")
preshow_secondsLeft = parseFloat(minutes) * 60
toggleFooter()
$.getJSON("preshow_files", false, function(data) {
$('#preso').after("<div id='preshow'></div><div id='tips'></div><div id='preshow_timer'></div>")
$.each(data, function(i, n) {
if(n == "preshow.json") {
// has a descriptions file
$.getJSON("/file/_preshow/preshow.json", false, function(data) {
preshow_des = data
})
} else {
$('#preshow').append('<img ref="' + n + '" src="/file/_preshow/' + n + '"/>')
}
if(preshow_running) {
stopPreShow()
} else {
var minutes = prompt("Minutes from now to start")
preshow_secondsLeft = parseFloat(minutes) * 60
toggleFooter()
$.getJSON("preshow_files", false, function(data) {
$('#preso').after("<div id='preshow'></div><div id='tips'></div><div id='preshow_timer'></div>")
$.each(data, function(i, n) {
if(n == "preshow.json") {
// has a descriptions file
$.getJSON("/file/_preshow/preshow.json", false, function(data) {
preshow_des = data
})
} else {
$('#preshow').append('<img ref="' + n + '" src="/file/_preshow/' + n + '"/>')
}
})
startPreShow()
})
startPreShow()
})
}
}

function startPreShow() {
Expand Down

0 comments on commit ab84bab

Please sign in to comment.