Log.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("cms.FormDesigner", "Module.$Element", null, false);
  3. MWF.xApplication.cms.FormDesigner.Module.Log = MWF.CMSFCLog = new Class({
  4. Extends: MWF.CMSFC$Element,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "/x_component_cms_FormDesigner/Module/Log/log.html"
  9. },
  10. initialize: function(form, options){
  11. this.setOptions(options);
  12. this.path = "/x_component_cms_FormDesigner/Module/Log/";
  13. this.cssPath = "/x_component_cms_FormDesigner/Module/Log/"+this.options.style+"/css.wcss";
  14. this._loadCss();
  15. this.moduleType = "element";
  16. this.moduleName = "log";
  17. this.form = form;
  18. this.container = null;
  19. this.containerNode = null;
  20. },
  21. load : function(json, node, parent){
  22. this.json = json;
  23. this.node= node;
  24. this.node.store("module", this);
  25. //this.node.empty();
  26. this.node.setStyles(this.css.moduleNode);
  27. this._loadNodeStyles();
  28. this._initModule();
  29. this._loadTreeNode(parent);
  30. this.setCustomStyles();
  31. this.parentContainer = this.treeNode.parentNode.module;
  32. this._setEditStyle_custom("id");
  33. this.parseModules();
  34. },
  35. _createMoveNode: function(){
  36. this.moveNode = new Element("div", {
  37. "MWFType": "log",
  38. "id": this.json.id,
  39. "styles": this.css.moduleNodeMove,
  40. "events": {
  41. "selectstart": function(){
  42. return false;
  43. }
  44. }
  45. }).inject(this.form.container);
  46. },
  47. _createNode: function(){
  48. this.node = this.moveNode.clone(true, true);
  49. this.node.setStyles(this.css.moduleNode);
  50. this.node.set("id", this.json.id);
  51. this.node.addEvent("selectstart", function(){
  52. return false;
  53. });
  54. this.iconNode = new Element("div", {
  55. "styles": this.css.iconNode
  56. }).inject(this.node);
  57. new Element("div", {
  58. "styles": this.css.iconNodeIcon
  59. }).inject(this.iconNode);
  60. new Element("div", {
  61. "styles": this.css.iconNodeText,
  62. "text": "LOG"
  63. }).inject(this.iconNode);
  64. },
  65. _loadNodeStyles: function(){
  66. this.iconNode = this.node.getElement("div").setStyles(this.css.iconNode);
  67. this.iconNode.getFirst("div").setStyles(this.css.iconNodeIcon);
  68. this.iconNode.getLast("div").setStyles(this.css.iconNodeText);
  69. }
  70. });