Monitor.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Element", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Monitor = MWF.FCMonitor = new Class({
  4. Extends: MWF.FC$Element,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Monitor/monitor.html"
  9. },
  10. initialize: function(form, options){
  11. this.setOptions(options);
  12. this.path = "../x_component_process_FormDesigner/Module/Monitor/";
  13. this.cssPath = "../x_component_process_FormDesigner/Module/Monitor/"+this.options.style+"/css.wcss";
  14. this._loadCss();
  15. this.moduleType = "element";
  16. this.moduleName = "monitor";
  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. this.json.moduleName = this.moduleName;
  35. },
  36. _createMoveNode: function(){
  37. this.moveNode = new Element("div", {
  38. "MWFType": "log",
  39. "id": this.json.id,
  40. "styles": this.css.moduleNodeMove,
  41. "events": {
  42. "selectstart": function(){
  43. return false;
  44. }
  45. }
  46. }).inject(this.form.container);
  47. },
  48. _createNode: function(){
  49. this.node = this.moveNode.clone(true, true);
  50. this.node.setStyles(this.css.moduleNode);
  51. this.node.set("id", this.json.id);
  52. this.node.addEvent("selectstart", function(){
  53. return false;
  54. });
  55. this.iconNode = new Element("div", {
  56. "styles": this.css.iconNode
  57. }).inject(this.node);
  58. new Element("div", {
  59. "styles": this.css.iconNodeIcon
  60. }).inject(this.iconNode);
  61. new Element("div", {
  62. "styles": this.css.iconNodeText,
  63. "text": "Monitor"
  64. }).inject(this.iconNode);
  65. },
  66. _loadNodeStyles: function(){
  67. this.iconNode = this.node.getElement("div").setStyles(this.css.iconNode);
  68. this.iconNode.getFirst("div").setStyles(this.css.iconNodeIcon);
  69. this.iconNode.getLast("div").setStyles(this.css.iconNodeText);
  70. }
  71. });