Calendar.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.Calendar = MWF.CMSFCCalendar = new Class({
  4. Extends: MWF.CMSFC$Element,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "/x_component_cms_FormDesigner/Module/Calendar/calendar.html"
  9. },
  10. initialize: function(form, options){
  11. this.setOptions(options);
  12. this.path = "/x_component_cms_FormDesigner/Module/Calendar/";
  13. this.cssPath = "/x_component_cms_FormDesigner/Module/Calendar/"+this.options.style+"/css.wcss";
  14. this._loadCss();
  15. this.moduleType = "element";
  16. this.moduleName = "calendar";
  17. this.form = form;
  18. this.container = null;
  19. this.containerNode = null;
  20. },
  21. _createMoveNode: function(){
  22. this.moveNode = new Element("div", {
  23. "MWFType": "calendar",
  24. "id": this.json.id,
  25. "styles": this.css.moduleNodeMove,
  26. "events": {
  27. "selectstart": function(){
  28. return false;
  29. }
  30. }
  31. }).inject(this.form.container);
  32. var icon = new Element("div", {
  33. "styles": this.css.personfieldIcon
  34. }).inject(this.moveNode);
  35. var text = new Element("div", {
  36. "styles": this.css.moduleText,
  37. "text": this.json.id
  38. }).inject(this.moveNode);
  39. },
  40. _loadNodeStyles: function(){
  41. var icon = this.node.getFirst("div");
  42. var text = this.node.getLast("div");
  43. icon.setStyles(this.css.personfieldIcon);
  44. text.setStyles(this.css.moduleText);
  45. },
  46. _getCopyNode: function(){
  47. if (!this.copyNode) this._createCopyNode();
  48. this.copyNode.setStyle("display", "inline-block");
  49. return this.copyNode;
  50. },
  51. _setEditStyle_custom: function(name){
  52. if (name=="id"){
  53. this.node.getLast().set("text", this.json.id);
  54. }
  55. }
  56. });