ElEditors, Interface administrators, Administrators
70,888
edits
No edit summary |
No edit summary |
||
Line 491: | Line 491: | ||
} | } | ||
genSetRandDARTNumber(); | genSetRandDARTNumber(); | ||
// Fix scripts literally disappearing when clicking "save changes" in VE | |||
ve.init.mw.ArticleTarget.prototype.saveComplete = function (data) { | |||
this.editSummaryValue = null; | |||
this.initialEditSummary = null; | |||
this.saveDeferred.resolve(); | |||
this.emit('save', data); | |||
var target = this; | |||
if (!this.pageExists || this.restoring) { | |||
this.teardown().then(function () { | |||
var newUrlParams = data.newrevid === undefined ? {} : { | |||
venotify: target.restoring ? 'restored' : 'created' | |||
}; | |||
if (data.isRedirect) { | |||
newUrlParams.redirect = 'no'; | |||
} | |||
location.href = target.viewUri.extend(newUrlParams); | |||
}); | |||
} else { | |||
if (mw.loader.getState('mediawiki.page.watch.ajax') === 'ready') { | |||
mw.loader.using('mediawiki.page.watch.ajax', function () { | |||
var watch = mw.libs['mediawiki.page.watch.ajax']; | |||
if (watch) { | |||
watch.updatePageWatchStatus(data.watched, data.watchlistexpiry); | |||
} | |||
}); | |||
} | |||
this.restoring = false; | |||
this.requestedRevId = undefined; | |||
if (data.newrevid !== undefined) { | |||
mw.config.set({ | |||
wgCurRevisionId: data.newrevid, | |||
wgRevisionId: data.newrevid | |||
}); | |||
this.revid = data.newrevid; | |||
this.currentRevisionId = data.newrevid; | |||
} | |||
mw.config.set(data.jsconfigvars); | |||
mw.loader.load(data.modules); | |||
mw.config.set({ | |||
wgIsRedirect: !!data.isRedirect | |||
}); | |||
if (this.saveDialog) { | |||
this.saveDialog.reset(); | |||
} | |||
this.replacePageContent(data.content, data.categorieshtml, data.displayTitleHtml, data.lastModified, data.contentSub); | |||
this.tryTeardown(true); | |||
} | |||
doRoundEdges(); | |||
performIE(); | |||
enhancements(); | |||
} |