jenkins-bot has submitted this change and it was merged.

Change subject: Save real tabs and allow configuration by users via JS hook
......................................................................


Save real tabs and allow configuration by users via JS hook

Bug: 39616
Change-Id: I64c3b9b53f1265f5b9c19edb480040113fa85590
---
A hooks.txt
M modules/jquery.codeEditor.js
2 files changed, 9 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/hooks.txt b/hooks.txt
new file mode 100644
index 0000000..531d9eb
--- /dev/null
+++ b/hooks.txt
@@ -0,0 +1,4 @@
+== JS hooks ==
+'codeEditor.configure' is fired during the set up of the ACE editor
+Params:
+* {object} session ACE editor session
diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js
index fccc850..2c320d9 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -165,10 +165,15 @@
                        box.closest('form').submit( 
context.evt.codeEditorSubmit );
                        var session = context.codeEditor.getSession();
 
+                       // Use proper tabs
+                       session.setUseSoftTabs( false );
+
                        // Bug 47235: Update text field for LivePreview
                        if ( mw.hook ) {
                                // New style hook
                                mw.hook( 'LivePreviewPrepare' ).add( 
context.evt.codeEditorSubmit );
+
+                               mw.hook( 'codeEditor.configure' ).fire( session 
);
                        }
                        // Old, deprecated style for backwards compat
                        // Do this even if mw.hook exists, because the caller 
wasn't

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I64c3b9b53f1265f5b9c19edb480040113fa85590
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Helder.wiki <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to