(function(){var a;CKEDITOR.plugins.add('editingblock',{init:function(b){if(!b.config.editingBlock)return;b.on('themeSpace',function(c){if(c.data.space=='contents')c.data.html+='<br>';});b.on('themeLoaded',function(){b.fireOnce('editingBlockReady');});b.on('uiReady',function(){b.setMode(b.config.startupMode);});b.on('afterSetData',function(){if(!a){function c(){a=true;b.getMode().loadData(b.getData());a=false;};if(b.mode)c();else b.on('mode',function(){if(b.mode){c();b.removeListener('mode',arguments.callee);}});}});b.on('beforeGetData',function(){if(!a&&b.mode){a=true;b.setData(b.getMode().getData(),null,1);a=false;}});b.on('getSnapshot',function(c){if(b.mode)c.data=b.getMode().getSnapshotData();});b.on('loadSnapshot',function(c){if(b.mode)b.getMode().loadSnapshotData(c.data);});b.on('mode',function(c){c.removeListener();CKEDITOR.env.webkit&&b.container.on('focus',function(){b.focus();});if(b.config.startupFocus)b.focus();setTimeout(function(){b.fireOnce('instanceReady');CKEDITOR.fire('instanceReady',null,b);},0);});b.on('destroy',function(){var c=this;if(c.mode)c._.modes[c.mode].unload(c.getThemeSpace('contents'));});}});CKEDITOR.editor.prototype.mode='';CKEDITOR.editor.prototype.addMode=function(b,c){c.name=b;(this._.modes||(this._.modes={}))[b]=c;};CKEDITOR.editor.prototype.setMode=function(b){this.fire('beforeSetMode',{newMode:b});var c,d=this.getThemeSpace('contents'),e=this.checkDirty();if(this.mode){if(b==this.mode)return;this.fire('beforeModeUnload');var f=this.getMode();c=f.getData();f.unload(d);this.mode='';}d.setHtml('');var g=this.getMode(b);if(!g)throw '[CKEDITOR.editor.setMode] Unknown mode "'+b+'".';if(!e)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});g.load(d,typeof c!='string'?this.getData():c);};CKEDITOR.editor.prototype.getMode=function(b){return this._.modes&&this._.modes[b||this.mode];};CKEDITOR.editor.prototype.focus=function(){this.forceNextSelectionCheck();var b=this.getMode();if(b)b.focus();};})();CKEDITOR.config.startupMode='wysiwyg';CKEDITOR.config.editingBlock=true;
