Because it does caching and retry for token problems by itself.
Change-Id: Ic4e24f6c805de243225a23a3c445f578ed2d14ad
- function stashEdit( token ) {
- data = $form.serializeObject();
-
- pending = api.post( {
- action: 'stashedit',
- token: token,
- title: mw.config.get( 'wgPageName' ),
- section: data.wpSection,
- sectiontitle: '',
- text: data.wpTextbox1,
- contentmodel: data.model,
- contentformat: data.format,
- baserevid: data.parentRevId
- } );
- }
-
/* Has the edit body text changed since the last stashEdit() call? */
function isChanged() {
// Normalize line endings to CRLF, like $.fn.serializeObject does.
/* Has the edit body text changed since the last stashEdit() call? */
function isChanged() {
// Normalize line endings to CRLF, like $.fn.serializeObject does.
- api.getToken( 'edit' ).then( stashEdit );
+ data = $form.serializeObject();
+ pending = api.postWithToken( 'edit', {
+ action: 'stashedit',
+ title: mw.config.get( 'wgPageName' ),
+ section: data.wpSection,
+ sectiontitle: '',
+ text: data.wpTextbox1,
+ contentmodel: data.model,
+ contentformat: data.format,
+ baserevid: data.parentRevId
+ } );
}
function onKeyPress( e ) {
}
function onKeyPress( e ) {