Merge "Allow editor access to the full page's wikitext"
This commit is contained in:
commit
df9551bf12
|
@ -165,7 +165,7 @@
|
||||||
router.navigate( '#/editor/' + $( this ).data( 'section' ) );
|
router.navigate( '#/editor/' + $( this ).data( 'section' ) );
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
overlayManager.add( /^\/editor\/(\d+)$/, function ( sectionId ) {
|
overlayManager.add( /^\/editor\/(\d+|all)$/, function ( sectionId ) {
|
||||||
var
|
var
|
||||||
$content = $( '#mw-content-text' ),
|
$content = $( '#mw-content-text' ),
|
||||||
result = $.Deferred(),
|
result = $.Deferred(),
|
||||||
|
@ -224,7 +224,9 @@
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
editorOptions.sectionId = page.isWikiText() ? parseInt( sectionId, 10 ) : null;
|
if ( sectionId !== 'all' ) {
|
||||||
|
editorOptions.sectionId = page.isWikiText() ? +sectionId : null;
|
||||||
|
}
|
||||||
|
|
||||||
// Check whether VisualEditor should be loaded
|
// Check whether VisualEditor should be loaded
|
||||||
if ( isVisualEditorEnabled &&
|
if ( isVisualEditorEnabled &&
|
||||||
|
@ -317,11 +319,12 @@
|
||||||
editorOverride = 'SourceEditor';
|
editorOverride = 'SourceEditor';
|
||||||
}
|
}
|
||||||
// else: action=edit, for which we allow the default to take effect
|
// else: action=edit, for which we allow the default to take effect
|
||||||
fragment = '#/editor/' + ( mw.util.getParamValue( 'section' ) || '0' );
|
fragment = '#/editor/' + ( mw.util.getParamValue( 'section' ) || ( mw.util.getParamValue( 'action' ) === 'edit' && 'all' ) || '0' );
|
||||||
if ( window.history && history.pushState ) {
|
if ( window.history && history.pushState ) {
|
||||||
uri = mw.Uri();
|
uri = mw.Uri();
|
||||||
delete uri.query.action;
|
delete uri.query.action;
|
||||||
delete uri.query.veaction;
|
delete uri.query.veaction;
|
||||||
|
delete uri.query.section;
|
||||||
// Note: replaceState rather than pushState, because we're
|
// Note: replaceState rather than pushState, because we're
|
||||||
// just reformatting the URL to the equivalent-meaning for the
|
// just reformatting the URL to the equivalent-meaning for the
|
||||||
// mobile site.
|
// mobile site.
|
||||||
|
|
Loading…
Reference in New Issue