TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/309288

Change subject: [Untested] Configure Ace with it's base path
......................................................................

[Untested] Configure Ace with it's base path

Configure the basePath of ace, so that its own loader knows where to
lazy load additional resources from. This enables all known modes and
the worker scripts for linting.

Bug: T124419
Change-Id: Ie71518917ab966743e8397b23ffb050ca47e9ff4
---
M modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/88/309288/1

diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
index 5889b78..63a37a8 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
@@ -99,6 +99,15 @@
  * @fires resize
  */
 ve.ui.MWAceEditorWidget.prototype.setupEditor = function () {
+       var basePath = mw.config.get( 'wgExtensionAssetsPath', '' );
+       if ( basePath.substring( 0, 2 ) === '//' ) {
+               // ACE uses web workers, which have importScripts, which don't 
like relative links.
+               basePath = window.location.protocol + basePath;
+       }
+       ace.config.set( 'basePath', basePath + '/CodeEditor/modules/ace' );
+       // Non-lazy loaded dependencies: Enable code completion
+       ace.require( 'ace/ext/language_tools' );
+
        this.$input.addClass( 'oo-ui-element-hidden' );
        this.editor = ace.edit( this.$ace[ 0 ] );
        this.setMinRows( this.minRows );

-- 
To view, visit https://gerrit.wikimedia.org/r/309288
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie71518917ab966743e8397b23ffb050ca47e9ff4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ <hartman.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to