mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Pick up 'summary' parameter from URL to use as initial edit summary"
This commit is contained in:
commit
7492cc7949
|
@ -48,7 +48,7 @@ ve.init.mw.ViewPageTarget = function VeInitMwViewPageTarget() {
|
|||
this.scrollTop = null;
|
||||
this.currentUri = currentUri;
|
||||
this.section = currentUri.query.vesection;
|
||||
this.initialEditSummary = '';
|
||||
this.initialEditSummary = new mw.Uri().query.summary;
|
||||
this.namespaceName = mw.config.get( 'wgCanonicalNamespace' );
|
||||
this.viewUri = new mw.Uri( mw.util.getUrl( this.pageName ) );
|
||||
this.veEditUri = this.viewUri.clone().extend( { veaction: 'edit' } );
|
||||
|
@ -336,7 +336,7 @@ ve.init.mw.ViewPageTarget.prototype.cancel = function () {
|
|||
|
||||
this.clearState();
|
||||
this.docToSave = null;
|
||||
this.initialEditSummary = '';
|
||||
this.initialEditSummary = new mw.Uri().query.summary;
|
||||
|
||||
this.deactivating = false;
|
||||
|
||||
|
|
|
@ -1437,7 +1437,7 @@ ve.init.mw.Target.prototype.restoreEditSection = function () {
|
|||
$section = $documentNode.find( 'h1, h2, h3, h4, h5, h6' ).eq( this.section - 1 ),
|
||||
headingNode = $section.data( 'view' );
|
||||
|
||||
if ( $section.length ) {
|
||||
if ( $section.length && new mw.Uri().query.summary === undefined ) {
|
||||
this.initialEditSummary = '/* ' +
|
||||
ve.graphemeSafeSubstring( $section.text(), 0, 244 ) + ' */ ';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue