Merge "Pick up 'summary' parameter from URL to use as initial edit summary"

This commit is contained in:
jenkins-bot 2014-08-28 21:29:07 +00:00 committed by Gerrit Code Review
commit 7492cc7949
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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 ) + ' */ ';
}