{I" class:EFI"ProcessedAsset;FI"logical_path;FI"*ckeditor/plugins/codemirror/plugin.js;TI" pathname;FI"i/Users/bricker/websites/kpcc/outpost/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-03-20T19:59:05-07:00;FI" length;FiÂ8I" digest;F"%06dd1f509b429c3119352821f96ef72dI" source;FI"Â8/* * 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', { icons: 'AutoFormat,CommentSelectedRange,UncommentSelectedRange', 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; // Default Config var defaultConfig = { theme: 'default', matchBrackets: true, lineNumbers: true, lineWrapping: true, autoCloseTags: false, enableSearchTools: true, enableCodeFolding: true, enableCodeFormatting: true, autoFormatOnStart: true, autoFormatOnModeChange: true, autoFormatOnUncomment: true, highlightActiveLine: true, highlightMatches: true, showTabs: false, showFormatButton: true, showCommentButton: true, showUncommentButton: true }; // Get Config & Lang var config = CKEDITOR.tools.extend(defaultConfig, editor.config.codemirror || {}, true); var lang = editor.lang.codemirror; CKEDITOR.document.appendStyleSheet(rootPath + 'css/codemirror.css'); if (config.theme.length && config.theme != 'default') { CKEDITOR.document.appendStyleSheet(rootPath + 'theme/' + config.theme + '.css'); } if (config.showTabs) { CKEDITOR.document.appendStyleSheet(rootPath + 'js/addon/edit/showtabs.css'); } if (config.enableSearchTools) { CKEDITOR.document.appendStyleSheet(rootPath + 'js/addon/dialog/dialog.css'); } CKEDITOR.scriptLoader.load(rootPath + 'js/codemirror.js', function (success) { CKEDITOR.scriptLoader.load(getCodeMirrorScripts()); }); // 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) { if (typeof (CodeMirror) == 'undefined') { CKEDITOR.scriptLoader.load([rootPath + 'js/codemirror.js'].concat(getCodeMirrorScripts()), function (success) { loadCodeMirror (editor); callback(); }); } else { loadCodeMirror (editor); callback(); } }); function getCodeMirrorScripts() { var scriptFiles = [ rootPath + 'js/xml.js', rootPath + 'js/javascript.js', rootPath + 'js/css.js', rootPath + 'js/htmlmixed.js' ]; if (config.autoCloseTags) scriptFiles.push(rootPath + 'js/addon/edit/closetag.js'); if (config.highlightMatches) scriptFiles.push(rootPath + 'js/addon/edit/match-highlighter.js'); if (config.enableSearchTools) { scriptFiles.push(rootPath + 'js/addon/dialog/dialog.js'); scriptFiles.push(rootPath + 'js/addon/search/search.js'); scriptFiles.push(rootPath + 'js/addon/search/searchcursor.js'); } if (config.enableCodeFolding) scriptFiles.push(rootPath + 'js/addon/edit/foldcode.js'); if (config.enableCodeFormatting) scriptFiles.push(rootPath + 'js/addon/format/formatting.js'); return scriptFiles; } function loadCodeMirror (editor) { var contentsSpace = editor.ui.space('contents'), textarea = contentsSpace.getDocument().createElement('textarea'); textarea.setStyles( CKEDITOR.tools.extend({ // IE7 has overflow the