/**
 * CKEditor wrapped in a UI5 control
 * @version v1.0.0 - 2014-06-07
 * @link http://jasper07.github.io/openui5-ckeditor/
 * @author John Patterson <john.patterson@secondphase.com.au>
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */
jQuery.sap.registerResourcePath('ckeditor','./static/openui5/openui5-CKEditor/ckeditor/ckeditor'),window.CKEDITOR_BASEPATH='./static/openui5/openui5-CKEditor/ckeditor/',sap.ui.define(["jquery.sap.global","sap/ui/core/Control","openui5/CKEditorToolbar","ckeditor"],function(a,b,c,d){"use strict";d=window.CKEDITOR;var e=b.extend("openui5.CKEditor",{metadata:{properties:{value:{type:"string",group:"Data",bindable:"bindable",defaultValue:""},width:{type:"sap.ui.core.CSSSize",group:"Dimension",defaultValue:"100%"},height:{type:"sap.ui.core.CSSSize",group:"Dimension",defaultValue:"200px"},toolbar:{type:"string",defaultValue:"Full"},inline:{type:"boolean",group:"Misc",defaultValue:!1},editable:{type:"boolean",group:"Misc",defaultValue:!0},required:{type:"boolean",group:"Misc",defaultValue:!1},uiColor:{type:"string",defaultValue:"#FAFAFA"}},events:{change:{},ready:{}}},renderer:function(a,b){a.write("<textarea "),a.writeAttribute("id",b.getId()+"-textarea"),a.write(">"),a.write(b.getValue()),a.write("</textarea>")}});return e.prototype.init=function(){this.textAreaId=this.getId()+"-textarea"},e.prototype.setValue=function(a){this.setProperty("value",a,!0),this.editor&&a!==this.editor.getData()&&this.editor.setData(a)},e.prototype.getText=function(){return this.editor.document.getBody().getText()},e.prototype.setInline=function(a){this.setProperty("inline",a,!0)},e.prototype.setEditable=function(a){this.setProperty("editable",a,!0),this.editor&&this.editor.setReadOnly(!a)},e.prototype.onAfterRendering=function(){if(this._bEditorCreated){this.editor=d.instances[this.textAreaId];var a;this.editor&&(a=this.getValue())&&this.editor.setData(a)}else this.afterFirstRender()},e.prototype._getOptions=function(){var a={};return a.toolbar=c[this.getToolbar()],a.disableNativeSpellChecker=!1,a.uiColor=this.getUiColor(),a.height=this.getHeight(),a.width=this.getWidth(),a.toolbarStartupExpanded=!0,a.removePlugins="scayt,contextmenu,tabletools,liststyle",a.browserContextMenuOnCtrl=!0,a},e.prototype.afterFirstRender=function(){d.disableAutoInline=!0,this.editor=this.getInline()?d.inline(this.textAreaId,this._getOptions()):d.replace(this.textAreaId,this._getOptions()),this.editor.on("change",a.proxy(this.onEditorChange,this)),this.editor.on("blur",a.proxy(this.onEditorChange,this)),this.editor.on("mode",a.proxy(this.onModeChange,this)),this.editor.on("instanceReady",a.proxy(this.onInstanceReady,this)),this._bEditorCreated=!0},e.prototype.onEditorChange=function(){var a=this.getValue(),b=this.editor.getData();a!==b&&(this.setProperty("value",b,!0),this.fireChange({oldValue:a,newValue:b}))},e.prototype.onModeChange=function(){this.evtSource===!0&&this.editor.getCommand("source").state===d.TRISTATE_OFF&&this.onEditorChange(),this.evtSource="source"===this.editor.mode?!0:!1},e.prototype.onInstanceReady=function(){a.sap.byId(this.editor.id+"_top").css("background",this.editor.getUiColor()),a.sap.byId(this.editor.id+"_bottom").css("background",this.editor.getUiColor())},e.prototype.exit=function(){this.editor.destroy()},e},!0),sap.ui.define(["jquery.sap.global"],function(){"use strict";var a={Basic:[["Bold","Italic","-","NumberedList","BulletedList","-","Link","Unlink","-"]],Full:[{name:"basicstyles",items:["Bold","Italic","Strike","Underline"]},{name:"paragraph",items:["BulletedList","NumberedList","Blockquote"]},{name:"editing",items:["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"]},{name:"links",items:["Link","Unlink","Anchor"]},{name:"tools",items:["SpellChecker","Maximize"]},"/",{name:"styles",items:["Format","FontSize","TextColor","PasteText","PasteFromWord","RemoveFormat"]},{name:"insert",items:["Image","SpecialChar"]},{name:"forms",items:["Outdent","Indent"]},{name:"clipboard",items:["Undo","Redo"]},{name:"document",items:["PageBreak","Source"]}]};return a},!0);
console.log("loaded");
