/* * The "codemirror" plugin. It's indented to enhance the * "sourcearea" editing mode, which displays the xhtml source code with * syntax highlight and line numbers. * Licensed under the MIT license * jQuery Embed Plugin Embeds: http://code.google.com/p/jquery-oembed/ (MIT License) * Plugin for: http://ckeditor.com/license (GPL/LGPL/MPL: http://ckeditor.com/license) */ (function () { CKEDITOR.plugins.add('codemirror', { lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh', init: function (editor) { var rootPath = this.path; // Get Config var config = editor.config; var codeMirrorTheme = config.codemirror_theme != null ? config.codemirror_theme : 'default'; CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.css'); if (codeMirrorTheme.length && codeMirrorTheme != 'default') { // Load codemirror theme CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + codeMirrorTheme + '.css'); } CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.js', function (success) { CKEDITOR.scriptLoader.load([rootPath + 'js/xml.js', rootPath + 'js/javascript.js', rootPath + 'js/css.js', rootPath + 'js/htmlmixed.js']); }); // Source mode isn't available in inline mode yet. if (editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE) return; var sourcearea = CKEDITOR.plugins.sourcearea; editor.addMode('source', function (callback) { var contentsSpace = editor.ui.space('contents'), textarea = contentsSpace.getDocument().createElement('textarea'); textarea.setStyles( CKEDITOR.tools.extend({ // IE7 has overflow the