Htmleditor.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.Htmleditor", null, false);
  3. MWF.xApplication.cms.FormDesigner.Module.Htmleditor = MWF.CMSFCHtmleditor = new Class({
  4. Extends: MWF.FCHtmleditor,
  5. Implements : [MWF.CMSFCMI],
  6. loadCkeditor: function(config){
  7. COMMON.AjaxModule.load("ckeditor", function(){
  8. CKEDITOR.disableAutoInline = true;
  9. var editorDiv = new Element("div").inject(this.node);
  10. if (this.json.templateCode) editorDiv.set("html", this.json.templateCode);
  11. var height = this.node.getSize().y;
  12. var editorConfig = config || {};
  13. if (this.form.options.mode=="Mobile"){
  14. // if (!editorConfig.toolbar && !editorConfig.toolbarGroups){
  15. editorConfig.toolbar = [
  16. //{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
  17. //{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
  18. //{ name: 'links' },
  19. //{ name: 'insert' },
  20. //{ name: 'forms' },
  21. //{ name: 'tools' },
  22. //{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
  23. //{ name: 'others' },
  24. //'/',
  25. { name: 'paragraph', items: [ 'Bold', 'Italic', "-" , 'TextColor', "BGColor", 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', "-", 'Undo', 'Redo' ] },
  26. { name: 'basicstyles', items: [ 'Styles', 'FontSize']}
  27. //{ name: 'colors' },
  28. //{ name: 'about' }
  29. ];
  30. // }
  31. }
  32. // CKEDITOR.basePath = COMMON.contentPath+"/res/framework/htmleditor/ckeditor/";
  33. if( editorConfig.skin )editorConfig.skin = "moono-lisa";
  34. this.editor = CKEDITOR.replace(editorDiv, editorConfig);
  35. this.editor.on("dataReady", function(){
  36. this.editor.setReadOnly(true);
  37. }, this);
  38. }.bind(this));
  39. }
  40. });