From f6bf40a19add556f8d8a788b4fce2b4ec7fa3367 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Wed, 28 Jan 2015 13:10:22 -0800 Subject: [PATCH] Update permanent link and PDF download link oldids on save Bug: T74461 Change-Id: Ic66de6e685d23cac1c9870529f42e1aa6348ac7a --- modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index f1b3da98e3..3b71853e1d 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -549,6 +549,15 @@ ve.init.mw.ViewPageTarget.prototype.onSave = function ( lastModified, contentSub ); + + if ( newid !== undefined ) { + $( '#t-permalink a, #coll-download-as-rl a' ).each( function () { + var uri = new mw.Uri( $( this ).attr( 'href' ) ); + uri.query.oldid = newid; + $( this ).attr( 'href', uri.toString() ); + } ); + } + this.setupSectionEditLinks(); // Tear down the target now that we're done saving // Not passing trackMechanism because this isn't an abort action