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 |
||
Line 2: | Line 2: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function execute(){ | function execute(){ | ||
addToQueue(); | |||
} | } | ||
function addToQueue(){ | |||
alert(mw.user.getName()); | |||
} | |||
function readPage(pageTitle){ | function readPage(pageTitle){ | ||
var api = new mw.Api(); | var api = new mw.Api(); | ||
Line 41: | Line 44: | ||
})}}); | })}}); | ||
} | } | ||
function addNewSection( content, editToken ) { | function addNewSection( title, content, editToken ) { | ||
$.ajax({ | $.ajax({ | ||
url: mw.util.wikiScript( 'api' ), | url: mw.util.wikiScript( 'api' ), | ||
Line 47: | Line 50: | ||
format: 'json', | format: 'json', | ||
action: 'edit', | action: 'edit', | ||
title: | title: title, | ||
text: content, | |||
token: editToken | token: editToken | ||
}, | }, |