mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Show <newarticletext> as surface placeholder, not an edit notice"
This commit is contained in:
commit
859f6daee6
|
@ -369,8 +369,9 @@ class ApiVisualEditor extends ApiBase {
|
|||
}
|
||||
|
||||
// New page notices
|
||||
$placeholder = null;
|
||||
if ( !$title->exists() ) {
|
||||
$notices[] = $this->msg(
|
||||
$placeholder = $this->msg(
|
||||
$user->isLoggedIn() ? 'newarticletext' : 'newarticletextanon',
|
||||
wfExpandUrl( Skin::makeInternalOrExternalUrl(
|
||||
$this->msg( 'helppage' )->inContentLanguage()->text()
|
||||
|
@ -519,6 +520,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
$result = array(
|
||||
'result' => 'success',
|
||||
'notices' => $notices,
|
||||
'placeholder' => $placeholder,
|
||||
'checkboxes' => $checkboxes,
|
||||
'links' => $links,
|
||||
'protectedClasses' => implode( ' ', $protectedClasses ),
|
||||
|
|
|
@ -313,6 +313,7 @@ ve.init.mw.Target.onLoad = function ( response ) {
|
|||
this.constructor.static.fixBase( this.doc );
|
||||
|
||||
this.remoteNotices = ve.getObjectValues( data.notices );
|
||||
this.placeholderText = $( $.parseHTML( data.placeholder ) ).text();
|
||||
this.protectedClasses = data.protectedClasses;
|
||||
this.$checkboxes = $( ve.getObjectValues( data.checkboxes ).join( '' ) );
|
||||
// Populate checkboxes with default values for minor and watch
|
||||
|
@ -1272,7 +1273,7 @@ ve.init.mw.Target.prototype.setupSurface = function ( doc, callback ) {
|
|||
|
||||
// Create ui.Surface (also creates ce.Surface and dm.Surface and builds CE tree)
|
||||
ve.track( 'trace.createSurface.enter' );
|
||||
var surface = target.addSurface( dmDoc ),
|
||||
var surface = target.addSurface( dmDoc, { placeholder: target.placeholderText } ),
|
||||
surfaceView = surface.getView(),
|
||||
$documentNode = surfaceView.getDocument().getDocumentNode().$element;
|
||||
ve.track( 'trace.createSurface.exit' );
|
||||
|
|
Loading…
Reference in a new issue