Widget:EditSandbox: Difference between revisions
Jump to navigation
Jump to search
Matt Pijoan (talk | contribs) No edit summary |
Matt Pijoan (talk | contribs) No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function execute(){ | function execute(){ | ||
addToQueue("Edit'd"); | |||
} | } | ||
Line 22: | Line 22: | ||
$title = $xml.find( "text" ); | $title = $xml.find( "text" ); | ||
var pageContent = $title.text(); | var pageContent = $title.text().split(','); | ||
pageContent.push(question); | pageContent.push(question); | ||
var token = getToken( | alert(pageContent.toString()); | ||
var token = getToken(pageContent.toString()); | |||
}}); | }}); | ||
return result; | return result; | ||
} | } | ||
function getToken( | function getToken(question){ | ||
var token; | var token; | ||
var api = new mw.Api(); | var api = new mw.Api(); | ||
Line 39: | Line 38: | ||
format: 'json', | format: 'json', | ||
intoken: 'edit', | intoken: 'edit', | ||
titles: | titles: "User:" + mw.user.name() + "/WBRQueue", | ||
async: false | async: false | ||
}, { | }, { | ||
Line 45: | Line 44: | ||
$.each(data.query.pages, function(index, value){ | $.each(data.query.pages, function(index, value){ | ||
var token = value.edittoken; | var token = value.edittoken; | ||
addNewSection( " | addNewSection( "User:" + mw.user.name() + "/WBRQueue",question, token ); | ||
})}}); | })}}); |