function MirrorFrame(a,c,f,b,e){function g(f,b,a){a=document.createElement("input");a.type="button";a.value=f;h.home.appendChild(a);a.onclick=function(){h.mirror.execCommand(b)}}this.edit=document.createElement("div");this.home=document.createElement("div");this.home.setAttribute("class","CodeMirror-menu");this.edit.setAttribute("class","CodeMirror-editor");a.appendChild&&a.insertBefore&&a.firstChild?(a.insertBefore(this.home,a.firstChild),a.appendChild(this.edit)):a.appendChild?(a.appendChild(this.home),
a.appendChild(this.edit)):a(this.home);var h=this;a={};c.noButtons||(g(e.search,"find"),g(e.replace,"replace"),g(e.jump,"jump"),g(e.macro,"macro"),g(e.reindentall,"reindentall"));var d;this.mirror=new CodeMirror(this.edit,c);for(d in a)this.mirror.setCommand(d,a[d]);if(f)for(d in f)this.mirror.setCommand(d,f[d]);if(b)for(d in b)this.mirror.on(d,b[d]);h.refresh=function(){h.mirror.refresh.call(h.mirror)}}
(function(){CodeMirror.keyMap["default"].Tab=function(a){if(a.getOption("indentByTab")){var b=a.getCursor("head"),e=a.getCursor("anchor");a.operation(function(){for(var c=Math.min(b.line,e.line),d=Math.max(b.line,e.line);c<=d;c++)a.indentLine(c,"smart")})}else{if(a.getOption("indentWithTabs"))return CodeMirror.Pass;var c=Array(a.getOption("indentUnit")+1).join(" ");a.replaceSelection(c)}};var a={jump:function(a){var b=prompt("Jump to line:","");b&&!isNaN(Number(b-1))&&a.setCursor(Number(b-1));a.focus()},
macro:function(a){var b=prompt("Name your constructor:","");b&&a.replaceSelection("function "+b+"() {\n  \n}\n\n"+b+".prototype = {\n  \n};\n")},reindentall:function(a){for(var b=0;b<=a.lineCount();b++)a.indentLine(b,"smart")}},c;for(c in a)a.hasOwnProperty(c)&&(CodeMirror.commands[c]=a[c])})();
