diff options
Diffstat (limited to 'phpBB/styles/prosilver/template/editor.js')
-rw-r--r-- | phpBB/styles/prosilver/template/editor.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index 0a749347ad..235cc0025b 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -394,3 +394,29 @@ function getCaretPosition(txtarea) { return caretPos; } + +/** +* Allow to use tab character when typing code +* Keep indentation of last line of code when typing code +*/ +(function($) { + $(document).ready(function() { + var doc, textarea; + + // find textarea, make sure browser supports necessary functions + if (document.forms[form_name]) { + doc = document; + } else { + doc = opener.document; + } + + if (!doc.forms[form_name]) { + return; + } + + textarea = doc.forms[form_name].elements[text_name]; + + phpbb.applyCodeEditor(textarea); + }); +})(jQuery); + |