TinyMCEEditor.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.TinyMCEEditor", null, false);
  3. MWF.xApplication.cms.FormDesigner.Module.TinyMCEEditor = MWF.CMSFCTinyMCEEditor = new Class({
  4. Extends: MWF.FCTinyMCEEditor,
  5. Implements : [MWF.CMSFCMI],
  6. _setEditStyle_custom: function(name){
  7. if (name=="editorProperties"){
  8. if (this.editor){
  9. Object.each(this.json.editorProperties, function(value, key){
  10. if (value=="true") this.json.editorProperties[key] = true;
  11. if (value=="false") this.json.editorProperties[key] = false;
  12. }.bind(this));
  13. this.distroyEditor();
  14. var config = Object.clone(this.json.editorProperties);
  15. if (this.json.config){
  16. if (this.json.config.code){
  17. var obj = MWF.Macro.exec(this.json.config.code, this);
  18. Object.each(obj, function(v, k){
  19. config[k] = v;
  20. });
  21. }
  22. }
  23. this.loadTinyMCEEditor(config);
  24. }
  25. }
  26. if (name=="templateCode"){
  27. if (this.editor) {
  28. this.editor.setContent(this.json.templateCode);
  29. }
  30. }
  31. },
  32. _initModule: function(){
  33. this.node.empty();
  34. var config = Object.clone(this.json.editorProperties);
  35. if (this.json.config){
  36. if (this.json.config.code){
  37. var obj = MWF.Macro.exec(this.json.config.code, this);
  38. Object.each(obj, function(v, k){
  39. config[k] = v;
  40. });
  41. }
  42. }
  43. this.loadTinyMCEEditor(config);
  44. this._setNodeProperty();
  45. if (!this.form.isSubform) this._createIconAction() ;
  46. this._setNodeEvent();
  47. }
  48. });