Script.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. MWF.xApplication = MWF.xApplication || {};
  2. MWF.xApplication.cms = MWF.xApplication.cms || {};
  3. MWF.xApplication.cms.FormDesigner = MWF.xApplication.cms.FormDesigner || {};
  4. MWF.xDesktop.requireApp("portal.PageDesigner", "Script", null, false);
  5. MWF.xApplication.cms.FormDesigner.Script = new Class({
  6. Extends : MWF.xApplication.portal.PageDesigner.Script,
  7. createModuleScript: function(v){
  8. switch (v.type){
  9. case "Button":
  10. this.loadButtonScript(v); break;
  11. case "Calendar":
  12. this.loadCalendarScript(v); break;
  13. case "Checkbox":
  14. this.loadCheckboxScript(v); break;
  15. case "Div":
  16. this.loadDivScript(v); break;
  17. // case "Html":
  18. // this.loadHtmlScript(v); break;
  19. case "Iframe":
  20. this.loadIframeScript(v); break;
  21. case "Image":
  22. this.loadImageScript(v); break;
  23. case "Label":
  24. this.loadLabelScript(v); break;
  25. case "Personfield":
  26. this.loadPersonfieldScript(v); break;
  27. case "Radio":
  28. this.loadRadioScript(v); break;
  29. case "Select":
  30. this.loadSelectScript(v); break;
  31. case "Source":
  32. this.loadSourceScript(v); break;
  33. case "SourceText":
  34. this.loadSourceTextScript(v); break;
  35. case "Stat":
  36. this.loadStatScript(v); break;
  37. case "SubSource":
  38. this.loadSubSourceScript(v); break;
  39. case "Tab$Content":
  40. this.loadTab$ContentScript(v); break;
  41. case "Tab$Page":
  42. this.loadTab$PageScript(v); break;
  43. case "Tab":
  44. this.loadTabScript(v); break;
  45. case "Table$Td":
  46. this.loadTable$TdScript(v); break;
  47. case "Table":
  48. this.loadTableScript(v); break;
  49. case "Textarea":
  50. this.loadTextareaScript(v); break;
  51. case "Textfield":
  52. this.loadTextfieldScript(v); break;
  53. case "Tree":
  54. this.loadTreeScript(v); break;
  55. case "View":
  56. this.loadViewScript(v); break;
  57. case "Actionbar":
  58. this.loadActionbarScript(v); break;
  59. case "Address":
  60. this.loadAddressScript(v); break;
  61. case "Attachment":
  62. this.loadAttachmentScript(v); break;
  63. case "Combox":
  64. this.loadComboxScript(v); break;
  65. case "Datagrid":
  66. this.loadDatagridScript(v); break;
  67. case "Datagrid$Data":
  68. this.loadDatagrid$DataScript(v); break;
  69. case "Datagrid$Title":
  70. this.loadDatagrid$TitleScript(v); break;
  71. case "Datatable":
  72. this.loadDatatableScript(v); break;
  73. case "Datatable$Data":
  74. this.loadDatatable$DataScript(v); break;
  75. case "Datatable$Title":
  76. this.loadDatatable$TitleScript(v); break;
  77. case "Datatemplate":
  78. this.loadDatatemplateScript(v); break;
  79. case "Htmleditor":
  80. this.loadHtmleditorScript(v); break;
  81. case "TinyMCEEditor":
  82. this.loadTinyMCEEditorScript(v); break;
  83. case "ImageClipper":
  84. this.loadImageClipperScript(v); break;
  85. case "WritingBoard":
  86. this.loadWritingBoardScript(v); break;
  87. case "Log":
  88. this.loadLogScript(v); break;
  89. case "Monitor":
  90. this.loadMonitorScript(v); break;
  91. case "Number":
  92. this.loadNumberScript(v); break;
  93. case "Currency":
  94. this.loadCurrencyScript(v); break;
  95. case "Office":
  96. this.loadOfficeScript(v); break;
  97. case "Opinion":
  98. this.loadOpinionScript(v); break;
  99. case "Orgfield":
  100. this.loadOrgfieldScript(v); break;
  101. case "Sidebar":
  102. this.loadSidebarScript(v); break;
  103. case "Subform":
  104. this.loadSubformScript(v); break;
  105. case "ViewSelector":
  106. this.loadViewSelectorScript(v); break;
  107. case "Authorfield":
  108. this.loadAuthorfieldScript(v); break;
  109. case "Readerfield":
  110. this.loadReaderfieldScript(v); break;
  111. case "Org":
  112. this.loadOrgScript(v); break;
  113. case "Author":
  114. this.loadAuthorScript(v); break;
  115. case "Reader":
  116. this.loadReaderScript(v); break;
  117. case "Statement":
  118. this.loadStatementScript(v); break;
  119. case "StatementSelector":
  120. this.loadStatementSelectorScript(v); break;
  121. case "Importer":
  122. this.loadImporterScript(v); break;
  123. case "Relatedlink":
  124. this.loadRelatedlinkScript(v); break;
  125. case "AssociatedDocument":
  126. this.loadAssociatedDocumentScript(v); break;
  127. case "WpsOffice":
  128. this.addScriptItem(v.readScript, "code", v, "readScript");
  129. this.loadEventsScript(v);
  130. break;
  131. case "YozoOffice":
  132. this.addScriptItem(v.readScript, "code", v, "readScript");
  133. this.loadEventsScript(v);
  134. break;
  135. case "Elautocomplete":
  136. this.loadVueElementScript(v, true);
  137. this.addScriptItem(v.itemScript, "code", v, "itemScript");
  138. break;
  139. case "Elbutton":
  140. this.loadVueElementScript(v); break;
  141. case "Elcheckbox":
  142. case "Elradio":
  143. this.loadVueElementScript(v, true);
  144. this.addScriptItem(v.itemScript, "code", v, "itemScript");
  145. break;
  146. case "Elcommon":
  147. this.addScriptItem(v.vueTemplate, "code", v, "vueTemplate");
  148. this.addScriptItem(v.vueApp, "code", v, "vueApp");
  149. this.addScriptItem(v.vueCss, "code", v, "vueCss");
  150. this.loadEventsScript(v);
  151. break;
  152. case "Elcontainer":
  153. case "Elcontainer$Main":
  154. case "Elcontainer$Aside":
  155. case "Elcontainer$Footer":
  156. case "Elcontainer$Header":
  157. case "Elicon":
  158. this.loadEventsScript(v); break;
  159. case "Elinput":
  160. case "Elnumber":
  161. this.loadVueElementScript(v, true); break;
  162. case "Elselect":
  163. this.loadVueElementScript(v);
  164. this.addScriptItem(v.itemScript, "code", v, "itemScript");
  165. this.addScriptItem(v.itemGroupScript, "code", v, "itemGroupScript");
  166. this.addScriptItem(v.filterMethod, "code", v, "filterMethod");
  167. this.addScriptItem(v.remoteMethod, "code", v, "remoteMethod");
  168. break;
  169. case "Elslider":
  170. this.loadVueElementScript(v, true);
  171. this.addScriptItem(v.marksScript, "code", v, "marksScript");
  172. this.addScriptItem(v.formatTooltip, "code", v, "formatTooltip");
  173. break;
  174. case "Elswitch":
  175. this.loadVueElementScript(v, true); break;
  176. case "Eltime":
  177. this.loadVueElementScript(v, true);
  178. this.addScriptItem(v.selectableRange, "code", v, "selectableRange");
  179. break;
  180. case "Eldate":
  181. this.loadVueElementScript(v, true);
  182. this.addScriptItem(v.disabledDate, "code", v, "disabledDate");
  183. break;
  184. case "Eldatetime":
  185. this.loadVueElementScript(v, true);
  186. this.addScriptItem(v.disabledDate, "code", v, "disabledDate");
  187. break;
  188. case "Elrate":
  189. this.loadVueElementScript(v, true);
  190. break;
  191. case "Elcolorpicker":
  192. this.loadVueElementScript(v, true);
  193. break;
  194. case "Eltree":
  195. this.loadVueElementScript(v, false);
  196. this.addScriptItem(v.currentNodeKey, "code", v, "currentNodeKey");
  197. this.addScriptItem(v.defaultExpandedKeys, "code", v, "defaultExpandedKeys");
  198. this.addScriptItem(v.defaultCheckedKeys, "code", v, "defaultCheckedKeys");
  199. this.addScriptItem(v.allowDrag, "code", v, "allowDrag");
  200. this.addScriptItem(v.allowDrop, "code", v, "allowDrop");
  201. break;
  202. case "Eldropdown":
  203. this.loadVueElementScript(v, false);
  204. break;
  205. case "Elcarousel":
  206. this.loadVueElementScript(v, false);
  207. this.addScriptItem(v.dataScript, "code", v, "dataScript");
  208. this.addScriptItem(v.filterScript, "code", v, "filterScript");
  209. this.addScriptItem(v.requestBody, "code", v, "requestBody");
  210. break;
  211. }
  212. this.bindDataId(v);
  213. },
  214. loadAuthorfieldScript: function(data){
  215. this.addScriptItem(data.defaultValue, "code", data, "defaultValue");
  216. this.addScriptItem(data.validation, "code", data, "validation");
  217. this.addScriptItem(data.rangeKey, "code", data, "rangeKey");
  218. this.addScriptItem(data.exclude, "code", data, "exclude");
  219. this.addScriptItem(data.rangeKey, "code", data, "sectionByScript");
  220. this.loadEventsScript(data);
  221. },
  222. loadReaderfieldScript: function(data){
  223. this.addScriptItem(data.defaultValue, "code", data, "defaultValue");
  224. this.addScriptItem(data.validation, "code", data, "validation");
  225. this.addScriptItem(data.rangeKey, "code", data, "rangeKey");
  226. this.addScriptItem(data.exclude, "code", data, "exclude");
  227. this.addScriptItem(data.rangeKey, "code", data, "sectionByScript");
  228. this.loadEventsScript(data);
  229. },
  230. loadAuthorScript: function(data){
  231. this.addScriptItem(data.defaultValue, "code", data, "defaultValue");
  232. this.addScriptItem(data.validation, "code", data, "validation");
  233. this.addScriptItem(data.identityRangeKey, "code", data, "identityRangeKey");
  234. this.addScriptItem(data.unitRangeKey, "code", data, "unitRangeKey");
  235. this.addScriptItem(data.rangeDutyKey, "code", data, "rangeDutyKey");
  236. this.addScriptItem(data.exclude, "code", data, "exclude");
  237. this.addScriptItem(data.rangeKey, "code", data, "sectionByScript");
  238. this.loadEventsScript(data);
  239. },
  240. loadReaderScript: function(data){
  241. this.addScriptItem(data.defaultValue, "code", data, "defaultValue");
  242. this.addScriptItem(data.validation, "code", data, "validation");
  243. this.addScriptItem(data.identityRangeKey, "code", data, "identityRangeKey");
  244. this.addScriptItem(data.unitRangeKey, "code", data, "unitRangeKey");
  245. this.addScriptItem(data.rangeDutyKey, "code", data, "rangeDutyKey");
  246. this.addScriptItem(data.exclude, "code", data, "exclude");
  247. this.addScriptItem(data.rangeKey, "code", data, "sectionByScript");
  248. this.loadEventsScript(data);
  249. }
  250. });