Special:CollabPad supports importTitle parameter

This lets us begin the import from another page, for example an edit
tab or button.

If the CollabPad page already exists, it will be opened without
overwriting with freshly-imported page contents.

Change-Id: I89293b9b06253243826d8f8144a5e93d55856e7c
This commit is contained in:
Adam Wight 2022-05-06 11:37:54 +02:00
parent 0e77a51898
commit b189ce2825

View file

@ -237,7 +237,7 @@
history.pushState( { tag: 'collabTarget', title: title.toString() }, title.getMain(), specialTitle.getUrl() );
showPage( title, importTitle );
} else {
location.href = specialTitle.getUrl();
location.href = specialTitle.getUrl( { import: importTitle } );
}
}
@ -308,7 +308,10 @@
onImportChange();
if ( pageTitle ) {
showPage( pageTitle );
var uri = new mw.Uri( location.href ),
importTitleText = uri.query.import,
importTitleParam = ( importTitleText ? mw.Title.newFromText( importTitleText ) : null );
showPage( pageTitle, importTitleParam );
} else {
showForm();
}