Widget:CurrentWBRQ: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) Created page with "<includeonly> <script type="text/javascript"> $('#changeslist').ready(function() { $.getScript("http://wikidoc.org/resources/mediawiki.api/mediawiki.api.js", function(){ var p..." |
Matt Pijoan (talk | contribs) No edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
$('#changeslist').ready(function() { | $('#changeslist').ready(function() { | ||
$.getScript("http://wikidoc.org/resources/mediawiki.api/mediawiki.api.js", function(){ | $.getScript("http://wikidoc.org/resources/mediawiki.api/mediawiki.api.js", function(){ | ||
var api = new mw.Api(); | |||
var pageString = "WBRCurrentQuestion"; | var pageString = "WBRCurrentQuestion"; | ||
api.get( { | api.get( { | ||
Line 16: | Line 17: | ||
$title = $xml.find( "text" ); | $title = $xml.find( "text" ); | ||
var curr = parseInt($title.text()); | var curr = parseInt($title.text()); | ||
document.getElementById('queslink').innerHTML = "<a href='http://www.wikidoc.org/index.php/Special:FormEdit/WBRQuestion/WBR | document.getElementById('queslink').innerHTML = "<a href='http://www.wikidoc.org/index.php/Special:FormEdit/WBRQuestion/WBR" + curr + "'><img src='http://static.wikidoc.org/5/54/Click_here_to_add_a_question.png</a>"; | ||
addNewSection( "WBRCurrentQuestion",parseInt(curr+1).toString(),mw.user.tokens.get( 'editToken' )); | |||
addNewSection( "WBRCurrentQuestion", | } | ||
}); | }); | ||
}); | }); | ||
Line 49: | Line 50: | ||
} | } | ||
}); | }); | ||
} | |||
</script> | </script> | ||
<div id="queslink"> | <div id="queslink"> |