Widget:SandboxNew: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
(13 intermediate revisions by the same user not shown) | |||
Line 88: | Line 88: | ||
function loginCheck(exam) { | function loginCheck(exam) { | ||
var form = "<div id='Pat' class='noSelect WBRButton'><br /> | var form = "<div id='Pat' class='noSelect WBRButton'><br />USMLE Format</div><div id='Flash' class='noSelect WBRButton'><br />Flash Cards</div>"; | ||
$("#question").html | $("#question").html(form); | ||
$(".WBRButton").click(function () { | $(".WBRButton").click(function () { | ||
alert( | alert($(this).attr('id')); | ||
var form = "<div id='y' class='noSelect WBRButton'><br />Enable Timer</div><div id='n' class='noSelect WBRButton'><br />Disable Timer</div>"; | |||
var form = " | $("#question").html(form); | ||
$ | $(".WBRButton").click(function () { | ||
$(" | alert($(this).attr('id')); | ||
if ($( | if ($(this).attr('id') === 'y') { | ||
var | var form = "<div id='1' class='noSelect WBRButton'><br />1 Minute</div><div id='10' class='noSelect WBRButton'><br />10 Minute</div><div id='20' class='noSelect WBRButton'><br />20 Minutes</div><div id='40' class='noSelect WBRButton'><br />40 Minutes</div>" | ||
$("#question").html(form); | |||
$(" | $(".WBRButton").click(function () { | ||
countdownCurrent = parseInt($( | alert($(this).parent.attr('id')); | ||
countdownCurrent = parseInt($(this).attr('id')) * 6000; | |||
examHandler(exam); | examHandler(exam); | ||
Line 118: | Line 119: | ||
} | } | ||
function examHandler(exam) { | function examHandler(exam) { | ||
if ( | if (exam === 'Queue') { | ||
queueExam(); | queueExam(); | ||
} else | } else { | ||
selectExam(exam); | selectExam(exam); | ||
} | } | ||
Line 224: | Line 223: | ||
$xml = $(xmlDoc), | $xml = $(xmlDoc), | ||
$title = $xml.find("text"); | $title = $xml.find("text"); | ||
if ($title.text().indexOf('Placeholder,') == -1) { | if ($title.text().indexOf('Placeholder,') ==r-1) { | ||
addNewSection("User:" + mw.user.name() + "/WBRQueue", 'Placeholder,', mw.user.tokens.get('editToken')); | addNewSection("User:" + mw.user.name() + "/WBRQueue", 'Placeholder,', mw.user.tokens.get('editToken')); | ||
alert('First Timah!'); | alert('First Timah!'); |