From ee5b80aeee5d0cf285e7fc46561132a0da78c814 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Mon, 19 Feb 2018 15:41:20 +0000 Subject: [PATCH] Avoid jQuery.parseHTML Bug: T187713 Change-Id: Ic156d6fb670fa2f79cf3c1d5fe0c6272b53b6440 --- modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js | 2 +- modules/ve-mw/init/ve.init.mw.ArticleTarget.js | 2 +- modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js | 2 +- modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index 1fef262062..0cd23f6450 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -186,7 +186,7 @@ ve.init.mw.DesktopArticleTarget.prototype.getEditableContent = function () { $editableContent = $( '#mw-imagepage-content' ); if ( !$editableContent.length ) { // No image content, file doesn't exist, or is on Commons? - $editableContent = $( '
' ); + $editableContent = $( '
' ).attr( 'id', 'mw-imagepage-content' ); $before = $( '.sharedUploadNotice, #mw-imagepage-nofile' ); if ( $before.length ) { $before.first().after( $editableContent ); diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index eb3175bcd7..3208b50b8a 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -1725,7 +1725,7 @@ ve.init.mw.ArticleTarget.prototype.submit = function ( wikitext, fields ) { } // Save DOM this.submitting = true; - $form = $( '
' ); + $form = $( '
' ).attr( { method: 'post', enctype: 'multipart/form-data' } ).addClass( 'oo-ui-element-hidden' ); params = ve.extendObject( { format: 'text/x-wiki', model: 'wikitext', diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js index fbbefe3ab1..8bddb5c53e 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js @@ -415,7 +415,7 @@ ve.ui.MWSaveDialog.prototype.showMessage = function ( name, message, options ) { if ( options.wrap === undefined ) { options.wrap = 'warning'; } - $message = $( '
' ); + $message = $( '
' ).addClass( 've-ui-mwSaveDialog-message' ); if ( options.wrap !== false ) { $message.append( $( '

' ).append( // visualeditor-savedialog-label-error diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js index b7826ada8b..052e50530e 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js @@ -37,7 +37,7 @@ ve.ui.MWAceEditorWidget = function VeUiMWAceEditorWidget( config ) { this.autocomplete = config.autocomplete || 'none'; this.autocompleteWordList = config.autocompleteWordList || null; - this.$ace = $( '

' ); + this.$ace = $( '
' ).attr( 'dir', 'ltr' ); this.editor = null; // Initialise to a rejected promise for the setValue call in the parent constructor this.loadingPromise = $.Deferred().reject().promise();