Save real tabs and allow configuration by users via JS hook

Bug: 39616
Change-Id: I64c3b9b53f1265f5b9c19edb480040113fa85590
This commit is contained in:
Krenair 2013-08-25 15:43:55 +01:00
parent 7adc7b1a8b
commit 7a9b6a5168
2 changed files with 9 additions and 0 deletions

4
hooks.txt Normal file
View file

@ -0,0 +1,4 @@
== JS hooks ==
'codeEditor.configure' is fired during the set up of the ACE editor
Params:
* {object} session ACE editor session

View file

@ -165,10 +165,15 @@ context.fn = $.extend( context.fn, {
box.closest('form').submit( context.evt.codeEditorSubmit ); box.closest('form').submit( context.evt.codeEditorSubmit );
var session = context.codeEditor.getSession(); var session = context.codeEditor.getSession();
// Use proper tabs
session.setUseSoftTabs( false );
// Bug 47235: Update text field for LivePreview // Bug 47235: Update text field for LivePreview
if ( mw.hook ) { if ( mw.hook ) {
// New style hook // New style hook
mw.hook( 'LivePreviewPrepare' ).add( context.evt.codeEditorSubmit ); mw.hook( 'LivePreviewPrepare' ).add( context.evt.codeEditorSubmit );
mw.hook( 'codeEditor.configure' ).fire( session );
} }
// Old, deprecated style for backwards compat // Old, deprecated style for backwards compat
// Do this even if mw.hook exists, because the caller wasn't // Do this even if mw.hook exists, because the caller wasn't