cpee 2.0.30 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (351) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/config.json +1 -1
  3. data/cockpit/config.json.example +7 -0
  4. data/cockpit/js/instance.js +96 -26
  5. data/cockpit/js/wfadaptor.js +2 -0
  6. data/cockpit/templates.legacy/Async.xml +12 -12
  7. data/cockpit/templates.legacy/BCO.xml +9 -11
  8. data/cockpit/templates.legacy/BCS.xml +9 -11
  9. data/cockpit/templates.legacy/Centurio.xml +7 -7
  10. data/cockpit/templates.legacy/Concurrent.xml +7 -7
  11. data/cockpit/templates.legacy/Coopis Testset.xml +7 -7
  12. data/cockpit/templates.legacy/Endpoints and Data Manipulation.xml +6 -7
  13. data/cockpit/templates.legacy/ICSOC Testset.xml +7 -7
  14. data/cockpit/templates.legacy/Infinity.xml +7 -7
  15. data/cockpit/templates.legacy/Lego Boxer.xml +13 -13
  16. data/cockpit/templates.legacy/Lego Conveyor.xml +13 -13
  17. data/cockpit/templates.legacy/Lego Crane.xml +16 -16
  18. data/cockpit/templates.legacy/Lego Ejector.xml +16 -16
  19. data/cockpit/templates.legacy/Lego Full.xml +12 -12
  20. data/cockpit/templates.legacy/Lego Liddy.xml +13 -13
  21. data/cockpit/templates.legacy/Lego Plate.xml +13 -13
  22. data/cockpit/templates.legacy/Lego Transporter.xml +14 -14
  23. data/cockpit/templates.legacy/Lego_Part_1.xml +12 -12
  24. data/cockpit/templates.legacy/LgLinear.xml +7 -10
  25. data/cockpit/templates.legacy/Linear.xml +11 -14
  26. data/cockpit/templates.legacy/Log.xml +11 -12
  27. data/cockpit/templates.legacy/Mangler 1.xml +7 -7
  28. data/cockpit/templates.legacy/Mangler 2.xml +7 -7
  29. data/cockpit/templates.legacy/Manuel Labels.xml +11 -11
  30. data/cockpit/templates.legacy/Promise.xml +30 -30
  31. data/cockpit/templates.legacy/SOPROMO Test Sonification.xml +7 -7
  32. data/cockpit/templates.legacy/Subprocess.xml +15 -15
  33. data/cockpit/templates.legacy/Syncing P34 1.xml +8 -11
  34. data/cockpit/templates.legacy/Syncing P34 2.xml +8 -11
  35. data/cockpit/templates.legacy/Syncing P34 3.xml +8 -11
  36. data/cockpit/templates.legacy/Syncing P34.xml +8 -11
  37. data/cockpit/templates.legacy/TEST - Bad Loop.xml +7 -7
  38. data/cockpit/templates.legacy/TEST - Wrong Positions.xml +7 -7
  39. data/cockpit/templates.legacy/Take_5.xml +14 -14
  40. data/cockpit/templates.legacy/Update.xml +11 -11
  41. data/cockpit/templates.legacy/Worklist Parallel.xml +17 -17
  42. data/cockpit/templates.legacy/Worklist Test CPEE.xml +14 -14
  43. data/cockpit/templates.legacy/Worklist Test.xml +14 -14
  44. data/cockpit/templates.legacy/Worklist Test2.xml +14 -14
  45. data/cockpit/templates/Coopis 2010.xml +19 -11
  46. data/cockpit/templates/Coopis 2010.xml.active +1 -0
  47. data/cockpit/templates/Coopis 2010.xml.active-uuid +1 -0
  48. data/cockpit/templates/IUPC arXiv:1104.3609 P34 1.xml +13 -12
  49. data/cockpit/templates/IUPC arXiv:1104.3609 P34 2.xml +13 -12
  50. data/cockpit/templates/IUPC arXiv:1104.3609 P34 3.xml +13 -12
  51. data/cockpit/templates/Track Test Local.xml +3 -3
  52. data/cockpit/templates/Track Test.xml +2 -2
  53. data/cockpit/templates/UR-VUE 2020 Manual Adjust.xml +2 -2
  54. data/cockpit/templates/UR-VUE 2020 Solution Baseline.xml +2 -2
  55. data/cockpit/templates/UR-VUE 2020 Solution NN.xml +2 -2
  56. data/cockpit/templates/UR-VUE 2020 Solution View.xml +2 -2
  57. data/cockpit/templates/UR-VUE 2020.xml +4 -2
  58. data/cockpit/templates/Worklist.xml +19 -14
  59. data/cockpit/templates/instantiate.local/Take_Sub.xml +2 -2
  60. data/cockpit/templates/instantiate/Take_Perf.xml +1 -1
  61. data/cockpit/templates/instantiate/Take_Sub.xml +2 -2
  62. data/cockpit/templates/instantiate/Take_X.xml +2 -2
  63. data/cockpit/themes/compact/rngs/call.rng +17 -8
  64. data/cockpit/themes/compact/rngs/callmanipulate.rng +18 -9
  65. data/cockpit/themes/compact/rngs/start.rng +83 -0
  66. data/cockpit/themes/compact/symbols/start.svg +1 -1
  67. data/cockpit/themes/compact/theme.js +1 -1
  68. data/cockpit/themes/control/rngs/call.rng +17 -8
  69. data/cockpit/themes/control/rngs/callmanipulate.rng +18 -9
  70. data/cockpit/themes/control/rngs/start.rng +83 -0
  71. data/cockpit/themes/control/symbols/start.svg +1 -1
  72. data/cockpit/themes/default/rngs/call.rng +17 -8
  73. data/cockpit/themes/default/rngs/callmanipulate.rng +18 -9
  74. data/cockpit/themes/default/rngs/start.rng +83 -0
  75. data/cockpit/themes/default/symbols/start.svg +1 -1
  76. data/cockpit/themes/default/theme.js +1 -1
  77. data/cockpit/themes/extended/rngs/call.rng +17 -8
  78. data/cockpit/themes/extended/rngs/callmanipulate.rng +18 -9
  79. data/cockpit/themes/extended/rngs/start.rng +83 -0
  80. data/cockpit/themes/extended/symbols/start.svg +1 -1
  81. data/cockpit/themes/extended/theme.js +1 -1
  82. data/cockpit/themes/model/symbols/start.svg +1 -1
  83. data/cockpit/themes/packed/rngs/call.rng +17 -8
  84. data/cockpit/themes/packed/rngs/callmanipulate.rng +18 -9
  85. data/cockpit/themes/packed/rngs/start.rng +83 -0
  86. data/cockpit/themes/packed/symbols/start.svg +1 -1
  87. data/cockpit/themes/packed/theme.js +1 -1
  88. data/cockpit/themes/preset/rngs/call.rng +17 -8
  89. data/cockpit/themes/preset/rngs/callmanipulate.rng +18 -9
  90. data/cockpit/themes/preset/rngs/start.rng +83 -0
  91. data/cockpit/themes/preset/symbols/start.svg +1 -1
  92. data/cockpit/themes/preset/theme.js +1 -1
  93. data/cpee.gemspec +3 -3
  94. data/lib/cpee/attributes_helper.rb +14 -0
  95. data/lib/cpee/implementation.rb +10 -8
  96. data/lib/cpee/implementation_callbacks.rb +14 -0
  97. data/lib/cpee/implementation_notifications.rb +19 -5
  98. data/lib/cpee/implementation_properties.rb +128 -24
  99. data/lib/cpee/persistence.rb +0 -27
  100. data/lib/cpee/statemachine.rb +14 -0
  101. data/lib/cpee/value_helper.rb +14 -0
  102. data/lib/properties.xml +4 -4
  103. data/lib/properties/{handlerwrapper.rng → executionhandler.rng} +3 -3
  104. data/lib/properties/properties.rng +2 -2
  105. data/lib/properties/set-properties.rng +2 -2
  106. data/lib/properties/set-some-properties.rng +2 -2
  107. data/server/{resources → executionhandlers/ruby}/backend/README.md +0 -0
  108. data/server/{resources → executionhandlers/ruby}/backend/instance.template +2 -4
  109. data/server/{resources → executionhandlers/ruby}/backend/opts.yaml +2 -2
  110. data/server/executionhandlers/ruby/backend/run +37 -0
  111. data/server/{handlerwrappers/default.rb → executionhandlers/ruby/connection.rb} +3 -3
  112. data/server/executionhandlers/ruby/controller.rb +195 -0
  113. data/server/{resources/transformation_dslx.xsl → executionhandlers/ruby/dsl_to_dslx.xsl} +53 -8
  114. data/server/executionhandlers/ruby/execution.rb +81 -0
  115. data/server/resources/properties.empty +1 -1
  116. data/server/resources/properties.init +1 -1
  117. data/server/resources/topics.xml +2 -2
  118. data/server/routing/end.pid +1 -1
  119. data/server/routing/forward-events.pid +1 -1
  120. data/server/routing/forward-votes.pid +1 -1
  121. data/server/routing/persist.pid +1 -1
  122. data/server/routing/persist.rb +3 -3
  123. data/tools/cpee +16 -10
  124. data/tools/server/cpee +1 -1
  125. data/tools/server/resources/properties.init +1 -1
  126. metadata +25 -238
  127. data/cockpit/js_libs.zip +0 -0
  128. data/cockpit/templates.legacy/convert_cpee2.rb +0 -15
  129. data/lib/cpee/controller.rb +0 -199
  130. data/lib/cpee/transform.rb +0 -95
  131. data/lib/instantiation.xml +0 -125
  132. data/server/resources/backend/instance.rb +0 -23
  133. data/server/resources/backend/run +0 -33
  134. data/server/server.pid +0 -1
  135. data/tools/test/README +0 -4
  136. data/tools/test/config.json +0 -3
  137. data/tools/test/contrib/graph_example.svg +0 -1166
  138. data/tools/test/contrib/legend.svg +0 -817
  139. data/tools/test/contrib/symbols.svg +0 -224
  140. data/tools/test/contrib/transformation1.xsl +0 -264
  141. data/tools/test/contrib/transformation2.xsl +0 -10
  142. data/tools/test/contrib/tree_example.svg +0 -788
  143. data/tools/test/css/model.css +0 -24
  144. data/tools/test/css/track.css +0 -60
  145. data/tools/test/css/ui.css +0 -214
  146. data/tools/test/css/wfadaptor.css +0 -422
  147. data/tools/test/edit.html +0 -258
  148. data/tools/test/graph.html +0 -69
  149. data/tools/test/index.html +0 -258
  150. data/tools/test/js/details.js +0 -109
  151. data/tools/test/js/instance.js +0 -1344
  152. data/tools/test/js/model.js +0 -41
  153. data/tools/test/js/parameters.js +0 -82
  154. data/tools/test/js/track.js +0 -18
  155. data/tools/test/js/ui.js +0 -104
  156. data/tools/test/js/wfadaptor.js +0 -763
  157. data/tools/test/js_libs.zip +0 -0
  158. data/tools/test/js_libs/Makefile +0 -2
  159. data/tools/test/js_libs/ansi_up.js +0 -333
  160. data/tools/test/js_libs/console.js +0 -80
  161. data/tools/test/js_libs/custommenu.css +0 -84
  162. data/tools/test/js_libs/custommenu.js +0 -104
  163. data/tools/test/js_libs/experiments1/relaxngui.css +0 -185
  164. data/tools/test/js_libs/experiments1/relaxngui.js +0 -488
  165. data/tools/test/js_libs/experiments1/rngtest9.html +0 -60
  166. data/tools/test/js_libs/experiments1/rngtest9.rng +0 -35
  167. data/tools/test/js_libs/experiments1/rngtest9.xml +0 -8
  168. data/tools/test/js_libs/jquery-2.2.4.min.js +0 -4
  169. data/tools/test/js_libs/jquery-3.2.1.min.js +0 -4
  170. data/tools/test/js_libs/jquery-3.3.1.min.js +0 -2
  171. data/tools/test/js_libs/jquery.browser.js +0 -40
  172. data/tools/test/js_libs/jquery.caret.min.js +0 -10
  173. data/tools/test/js_libs/jquery.cookie.js +0 -117
  174. data/tools/test/js_libs/jquery.min.js +0 -1
  175. data/tools/test/js_libs/jquery.svg.min.js +0 -6
  176. data/tools/test/js_libs/jquery.svgdom.min.js +0 -6
  177. data/tools/test/js_libs/markdown.min.js +0 -1
  178. data/tools/test/js_libs/parsequery.js +0 -21
  179. data/tools/test/js_libs/printf.js +0 -368
  180. data/tools/test/js_libs/relaxngui.css +0 -213
  181. data/tools/test/js_libs/relaxngui.js +0 -543
  182. data/tools/test/js_libs/strftime.min.js +0 -1
  183. data/tools/test/js_libs/tests/dataelements.html +0 -59
  184. data/tools/test/js_libs/tests/dataelements.rng +0 -8
  185. data/tools/test/js_libs/tests/dataelements.xml +0 -3
  186. data/tools/test/js_libs/tests/relaxngui.css +0 -203
  187. data/tools/test/js_libs/tests/relaxngui.js +0 -502
  188. data/tools/test/js_libs/tests/rngtest1.html +0 -66
  189. data/tools/test/js_libs/tests/rngtest1.rng +0 -147
  190. data/tools/test/js_libs/tests/rngtest1.xml +0 -13
  191. data/tools/test/js_libs/tests/rngtest2.html +0 -60
  192. data/tools/test/js_libs/tests/rngtest2.rng +0 -6
  193. data/tools/test/js_libs/tests/rngtest2.xml +0 -3
  194. data/tools/test/js_libs/tests/rngtest3.html +0 -60
  195. data/tools/test/js_libs/tests/rngtest3.rng +0 -23
  196. data/tools/test/js_libs/tests/rngtest3.xml +0 -9
  197. data/tools/test/js_libs/tests/rngtest4.html +0 -60
  198. data/tools/test/js_libs/tests/rngtest4.rng +0 -19
  199. data/tools/test/js_libs/tests/rngtest4.xml +0 -12
  200. data/tools/test/js_libs/tests/rngtest5.html +0 -60
  201. data/tools/test/js_libs/tests/rngtest5.rng +0 -75
  202. data/tools/test/js_libs/tests/rngtest5.xml +0 -40
  203. data/tools/test/js_libs/tests/rngtest6.html +0 -60
  204. data/tools/test/js_libs/tests/rngtest6.rng +0 -24
  205. data/tools/test/js_libs/tests/rngtest6.xml +0 -6
  206. data/tools/test/js_libs/tests/rngtest8.html +0 -60
  207. data/tools/test/js_libs/tests/rngtest8.rng +0 -13
  208. data/tools/test/js_libs/tests/rngtest8.xml +0 -2
  209. data/tools/test/js_libs/tests/rngtest9.html +0 -60
  210. data/tools/test/js_libs/tests/rngtest9.rng +0 -31
  211. data/tools/test/js_libs/tests/rngtest9.xml +0 -8
  212. data/tools/test/js_libs/ui.css +0 -333
  213. data/tools/test/js_libs/ui.html +0 -168
  214. data/tools/test/js_libs/ui.js +0 -177
  215. data/tools/test/js_libs/underscore.min.js +0 -27
  216. data/tools/test/js_libs/util.js +0 -81
  217. data/tools/test/js_libs/vkbeautify.0.99.00.beta.js +0 -358
  218. data/tools/test/js_libs/vkbeautify.js +0 -1
  219. data/tools/test/js_libs/webcomponents.min.js +0 -196
  220. data/tools/test/model.html +0 -192
  221. data/tools/test/rngs/attributes.rng +0 -8
  222. data/tools/test/rngs/dataelements.rng +0 -8
  223. data/tools/test/rngs/endpoints.rng +0 -8
  224. data/tools/test/templates.legacy/Async.xml +0 -46
  225. data/tools/test/templates.legacy/BCO.xml +0 -70
  226. data/tools/test/templates.legacy/BCS.xml +0 -70
  227. data/tools/test/templates.legacy/Centurio.xml +0 -75
  228. data/tools/test/templates.legacy/Concurrent.xml +0 -40
  229. data/tools/test/templates.legacy/Coopis Testset.xml +0 -76
  230. data/tools/test/templates.legacy/Endpoints and Data Manipulation.xml +0 -30
  231. data/tools/test/templates.legacy/ICSOC Testset.xml +0 -95
  232. data/tools/test/templates.legacy/Infinity.xml +0 -28
  233. data/tools/test/templates.legacy/Lego Boxer.xml +0 -31
  234. data/tools/test/templates.legacy/Lego Conveyor.xml +0 -31
  235. data/tools/test/templates.legacy/Lego Crane.xml +0 -87
  236. data/tools/test/templates.legacy/Lego Ejector.xml +0 -55
  237. data/tools/test/templates.legacy/Lego Full.xml +0 -142
  238. data/tools/test/templates.legacy/Lego Liddy.xml +0 -40
  239. data/tools/test/templates.legacy/Lego Plate.xml +0 -31
  240. data/tools/test/templates.legacy/Lego Transporter.xml +0 -43
  241. data/tools/test/templates.legacy/Lego_Part_1.xml +0 -85
  242. data/tools/test/templates.legacy/LgLinear.xml +0 -65
  243. data/tools/test/templates.legacy/Linear.xml +0 -77
  244. data/tools/test/templates.legacy/Log.xml +0 -117
  245. data/tools/test/templates.legacy/Mangler 1.xml +0 -87
  246. data/tools/test/templates.legacy/Mangler 2.xml +0 -103
  247. data/tools/test/templates.legacy/Manuel Labels.xml +0 -55
  248. data/tools/test/templates.legacy/Promise.xml +0 -275
  249. data/tools/test/templates.legacy/SOPROMO Test Sonification.xml +0 -83
  250. data/tools/test/templates.legacy/Subprocess.xml +0 -56
  251. data/tools/test/templates.legacy/Syncing P34 1.xml +0 -77
  252. data/tools/test/templates.legacy/Syncing P34 2.xml +0 -77
  253. data/tools/test/templates.legacy/Syncing P34 3.xml +0 -77
  254. data/tools/test/templates.legacy/Syncing P34.xml +0 -77
  255. data/tools/test/templates.legacy/TEST - Bad Loop.xml +0 -173
  256. data/tools/test/templates.legacy/TEST - Wrong Positions.xml +0 -174
  257. data/tools/test/templates.legacy/Take_5.xml +0 -48
  258. data/tools/test/templates.legacy/Update.xml +0 -32
  259. data/tools/test/templates.legacy/Worklist Parallel.xml +0 -104
  260. data/tools/test/templates.legacy/Worklist Test CPEE.xml +0 -40
  261. data/tools/test/templates.legacy/Worklist Test.xml +0 -42
  262. data/tools/test/templates.legacy/Worklist Test2.xml +0 -43
  263. data/tools/test/templates.legacy/convert_cpee2.rb +0 -15
  264. data/tools/test/templates.legacy/convert_preset.rb +0 -32
  265. data/tools/test/templates.legacy/testsets.xml +0 -37
  266. data/tools/test/templates.legacy/transformations.xml +0 -4
  267. data/tools/test/templates/Coopis 2010.xml +0 -76
  268. data/tools/test/templates/IUPC arXiv:1104.3609 P34 1.xml +0 -77
  269. data/tools/test/templates/IUPC arXiv:1104.3609 P34 2.xml +0 -77
  270. data/tools/test/templates/IUPC arXiv:1104.3609 P34 3.xml +0 -77
  271. data/tools/test/templates/Track Test Local.xml +0 -82
  272. data/tools/test/templates/Track Test.xml +0 -82
  273. data/tools/test/templates/UR-VUE 2020 Manual Adjust.xml +0 -182
  274. data/tools/test/templates/UR-VUE 2020 Solution Baseline.xml +0 -203
  275. data/tools/test/templates/UR-VUE 2020 Solution NN.xml +0 -197
  276. data/tools/test/templates/UR-VUE 2020 Solution View.xml +0 -151
  277. data/tools/test/templates/UR-VUE 2020.xml +0 -26
  278. data/tools/test/templates/Worklist.xml +0 -42
  279. data/tools/test/templates/instantiate.local/Take_Sub.xml +0 -59
  280. data/tools/test/templates/instantiate/Take_Perf.xml +0 -46
  281. data/tools/test/templates/instantiate/Take_Sub.xml +0 -58
  282. data/tools/test/templates/instantiate/Take_X.xml +0 -48
  283. data/tools/test/themes/compact/theme.js +0 -1285
  284. data/tools/test/themes/diana/theme.js +0 -1650
  285. data/tools/test/themes/extended/theme.js +0 -1325
  286. data/tools/test/themes/model/rngs/alternative.rng +0 -1
  287. data/tools/test/themes/model/rngs/call.rng +0 -67
  288. data/tools/test/themes/model/rngs/callmanipulate.rng +0 -72
  289. data/tools/test/themes/model/rngs/choose.rng +0 -1
  290. data/tools/test/themes/model/rngs/critical.rng +0 -1
  291. data/tools/test/themes/model/rngs/escape.rng +0 -1
  292. data/tools/test/themes/model/rngs/group.rng +0 -1
  293. data/tools/test/themes/model/rngs/loop.rng +0 -1
  294. data/tools/test/themes/model/rngs/manipulate.rng +0 -1
  295. data/tools/test/themes/model/rngs/otherwise.rng +0 -1
  296. data/tools/test/themes/model/rngs/parallel.rng +0 -1
  297. data/tools/test/themes/model/rngs/parallel_branch.rng +0 -1
  298. data/tools/test/themes/model/rngs/scripts.rng +0 -7
  299. data/tools/test/themes/model/rngs/stop.rng +0 -1
  300. data/tools/test/themes/model/rngs/terminate.rng +0 -1
  301. data/tools/test/themes/model/theme.js +0 -1268
  302. data/tools/test/themes/packed/theme.js +0 -1286
  303. data/tools/test/themes/preset/rngs/alternative.rng +0 -25
  304. data/tools/test/themes/preset/rngs/call.rng +0 -122
  305. data/tools/test/themes/preset/rngs/callmanipulate.rng +0 -145
  306. data/tools/test/themes/preset/rngs/choose.rng +0 -14
  307. data/tools/test/themes/preset/rngs/closed_loop.rng +0 -62
  308. data/tools/test/themes/preset/rngs/closed_loop_cancel.rng +0 -5
  309. data/tools/test/themes/preset/rngs/closed_loop_control.rng +0 -31
  310. data/tools/test/themes/preset/rngs/closed_loop_measuring.rng +0 -12
  311. data/tools/test/themes/preset/rngs/critical.rng +0 -5
  312. data/tools/test/themes/preset/rngs/escape.rng +0 -1
  313. data/tools/test/themes/preset/rngs/group.rng +0 -3
  314. data/tools/test/themes/preset/rngs/loop.rng +0 -22
  315. data/tools/test/themes/preset/rngs/manipulate.rng +0 -9
  316. data/tools/test/themes/preset/rngs/otherwise.rng +0 -22
  317. data/tools/test/themes/preset/rngs/parallel.rng +0 -21
  318. data/tools/test/themes/preset/rngs/parallel_branch.rng +0 -8
  319. data/tools/test/themes/preset/rngs/scripts.rng +0 -23
  320. data/tools/test/themes/preset/rngs/stop.rng +0 -5
  321. data/tools/test/themes/preset/rngs/terminate.rng +0 -1
  322. data/tools/test/themes/preset/symbols/alternative.svg +0 -5
  323. data/tools/test/themes/preset/symbols/arrow.svg +0 -3
  324. data/tools/test/themes/preset/symbols/call.svg +0 -6
  325. data/tools/test/themes/preset/symbols/callmanipulate.svg +0 -8
  326. data/tools/test/themes/preset/symbols/choose.svg +0 -5
  327. data/tools/test/themes/preset/symbols/choose_exclusive.svg +0 -5
  328. data/tools/test/themes/preset/symbols/choose_inclusive.svg +0 -4
  329. data/tools/test/themes/preset/symbols/closed_loop.svg +0 -5
  330. data/tools/test/themes/preset/symbols/closed_loop_cancel.svg +0 -5
  331. data/tools/test/themes/preset/symbols/closed_loop_control.svg +0 -5
  332. data/tools/test/themes/preset/symbols/closed_loop_measuring.svg +0 -6
  333. data/tools/test/themes/preset/symbols/complex.svg +0 -8
  334. data/tools/test/themes/preset/symbols/critical.svg +0 -4
  335. data/tools/test/themes/preset/symbols/end.svg +0 -3
  336. data/tools/test/themes/preset/symbols/escape.svg +0 -5
  337. data/tools/test/themes/preset/symbols/event_end.svg +0 -3
  338. data/tools/test/themes/preset/symbols/loop.svg +0 -5
  339. data/tools/test/themes/preset/symbols/manipulate.svg +0 -4
  340. data/tools/test/themes/preset/symbols/otherwise.svg +0 -5
  341. data/tools/test/themes/preset/symbols/parallel.svg +0 -5
  342. data/tools/test/themes/preset/symbols/parallel_branch.svg +0 -5
  343. data/tools/test/themes/preset/symbols/parallel_branch_compact.svg +0 -4
  344. data/tools/test/themes/preset/symbols/parallel_branch_event.svg +0 -14
  345. data/tools/test/themes/preset/symbols/parallel_branch_normal.svg +0 -5
  346. data/tools/test/themes/preset/symbols/scripts.svg +0 -4
  347. data/tools/test/themes/preset/symbols/start.svg +0 -3
  348. data/tools/test/themes/preset/symbols/stop.svg +0 -5
  349. data/tools/test/themes/preset/symbols/terminate.svg +0 -4
  350. data/tools/test/themes/preset/theme.js +0 -1287
  351. data/tools/test/track.html +0 -142
@@ -1,104 +0,0 @@
1
- /*
2
- This file is part of CPEE.
3
-
4
- CPEE is free software: you can redistribute it and/or modify it under the terms
5
- of the GNU General Public License as published by the Free Software Foundation,
6
- either version 3 of the License, or (at your option) any later version.
7
-
8
- CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
9
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10
- PARTICULAR PURPOSE. See the GNU General Public License for more details.
11
-
12
- You should have received a copy of the GNU General Public License along with
13
- CPEE (file COPYING in the main directory). If not, see
14
- <http://www.gnu.org/licenses/>.
15
- */
16
-
17
- function CustomMenu(e) {
18
- var target = $(e.target);
19
- var x = e.pageX;
20
- var y = e.pageY;
21
- var remove = function(event) {};
22
- this.remove = remove;
23
- e.stopPropagation();
24
-
25
- this.contextmenu = function(items) {
26
- remove = function(event) {
27
- if (!event) {
28
- $('.contextmenu:first').remove();
29
- $('body', document).unbind('mousedown',remove);
30
- return;
31
- }
32
-
33
- if($(event.target).parent('tr.contextmenuitem') && (event.button == 0)) { $(event.target).click(); }
34
- $('.contextmenu:first').remove();
35
- $('body', document).unbind('mousedown',remove);
36
- }
37
- $('body', document).bind('mousedown',remove);
38
-
39
- if($('div.contextmenu').length > 0) remove();
40
- var div = $('<div class="contextmenu"><table class="contextmenu"/></div>');
41
- for(head in items) {
42
- div.children(':first').append('<tr class="contextmenuheader"><td colspan="2">' + head + '</td></tr>');
43
- for(item in items[head]) {
44
- var icon = null;
45
- if(items[head][item].menu_icon) {
46
- icon = $X('<svg xmlns="http://www.w3.org/2000/svg" version="1.1">' +
47
- '<g transform="translate(1,1) scale(0.5, 0.5)"/>' +
48
- '</svg>');
49
- icon.children('g').append(items[head][item].menu_icon.clone().children());
50
- icon = icon.serializeXML();
51
- }
52
- if(items[head][item].text_icon) {
53
- icon = items[head][item].text_icon;
54
- }
55
- var row = $('<tr class="contextmenuitem"><td class="contextmenuicon"><div>' + (icon == null ? '' : icon) + '</div></td><td>' + items[head][item].label + '</td></tr>');
56
- div.children(':first').append(row);
57
- row.bind('click', items[head][item], function(event){
58
- event.data.function_call.apply(null, event.data.params);
59
- });
60
- }
61
- }
62
- div.css({'left':x+5,'top':y+5, 'display':'block'});
63
- $('body', document).append(div);
64
- if(($(window).height() < (y + div.height()))) { // contextmenu is position
65
- div.css({'top':$(window).height()-div.height()-5});
66
- }
67
- if((document.body.clientWidth < (x + div.width())) && (x-div.width()-5 >= 0)) { // contextmenu is position
68
- div.css({'left':x-div.width()-5});
69
- }
70
- }
71
-
72
- this.menu = function(menu,call) {
73
- remove = function(event) {
74
- if ($(event.target).parent('div.menu') && (event.button == 0)) { $(event.target).click(); }
75
- menu.hide();
76
- $('body', document).unbind('mousedown',remove);
77
- $("div.menuitem",$(menu)).each(function(ind,ele){
78
- $(ele).unbind('click',mitemclick);
79
- });
80
- }
81
-
82
- menu.show();
83
- var mitemclick = function(ele){
84
- $("div.menuitem[data-selected=selected]",$(menu)).each(function(ind,rem){ $(rem).removeAttr('data-selected'); });
85
- $(ele.target).attr('data-selected','selected');
86
- call(ele.target);
87
- };
88
- $('body', document).bind('mousedown',remove);
89
-
90
- $("div.menuitem",$(menu)).each(function(ind,ele){
91
- $(ele).bind('click',mitemclick);
92
- });
93
-
94
- var off = target.offset();
95
-
96
- menu.css({'left':off.left,'top':off.top+target.outerHeight() + 1,'min-width': target.width()});
97
- if(($(window).height() < (y + menu.height()))) {
98
- menu.css({'top':$(window).height()-menu.height()-5});
99
- }
100
- if((document.body.clientWidth < (x + menu.width())) && (x-menu.width()-5 >= 0)) {
101
- menu.css({'left':x-menu.width()-5});
102
- }
103
- }
104
- }
@@ -1,185 +0,0 @@
1
- /*
2
- This file is part of RelaxNGui.
3
-
4
- RelaxNGui is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU General Public License as published by the Free Software
6
- Foundation, either version 3 of the License, or (at your option) any later
7
- version.
8
-
9
- RelaxNGui is distributed in the hope that it will be useful, but WITHOUT ANY
10
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
-
13
- You should have received a copy of the GNU General Public License along with
14
- RelaxNGui (file COPYING in the main directory). If not, see
15
- <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- .relaxngui_table { }
19
- .relaxngui_table .relaxngui_table { }
20
-
21
- .relaxngui_table.closed > .relaxngui_table,
22
- .relaxngui_table.closed > .relaxngui_dyn,
23
- .relaxngui_table.closed > .relaxngui_row,
24
- .relaxngui_table.closed > .relaxngui_control {
25
- display: none;
26
- }
27
- .relaxngui_header.fold {
28
- cursor: pointer;
29
- }
30
- .relaxngui_table.closed .relaxngui_fold:after {
31
- content: "▶";
32
- font-weight: bold;
33
- vertical-align:top;
34
- margin-right: 0.5em;
35
- position: relative;
36
- top: -0.13em;
37
- }
38
- .relaxngui_table .relaxngui_fold:after {
39
- content: "▽";
40
- font-weight: bold;
41
- vertical-align:top;
42
- margin-right: 0.5em;
43
- position: relative;
44
- top: -0.13em;
45
- }
46
-
47
- .relaxngui_table > .relaxngui_table > .relaxngui_table {
48
- padding: 0;
49
- padding-top: 0.2em;
50
- padding-bottom: 0.5em;
51
- padding-left: 1em;
52
- }
53
- .relaxngui_dyn {
54
- margin: 0;
55
- padding: 0;
56
- display: flex;
57
- flex-direction: row;
58
- align-items: center;
59
- padding-bottom: 0.25em;
60
- padding-top: 0.25em;
61
- margin-left: 0.5em;
62
- }
63
- .relaxngui_dyn > *:nth-child(1) {
64
- margin: 0;
65
- padding: 0;
66
- font-size: 1em;
67
- margin-right: 0.2em;
68
- margin-left: 0.2em;
69
- vertical-align: baseline;
70
- cursor: pointer;
71
- display: inline-block;
72
- }
73
- .relaxngui_dyn > *:nth-child(2) {
74
- flex: 1 1 auto;
75
- }
76
-
77
- .relaxngui_dyn > .relaxngui_table { padding: 0; margin: 0; }
78
- .relaxngui_dyn:nth-child(even) { background-color: #fff; }
79
- .relaxngui_dyn:nth-child(odd) { background-color: #e9e9e9; }
80
- .relaxngui_table.even > .relaxngui_row:nth-child(even) { background-color: #fff; }
81
- .relaxngui_table.even > .relaxngui_row:nth-child(odd) { background-color: #e9e9e9; }
82
- .relaxngui_table.odd > .relaxngui_row:nth-child(even) { background-color: #e9e9e9; }
83
- .relaxngui_table.odd > .relaxngui_row:nth-child(odd) { background-color: #fff; }
84
- .relaxngui_table.even > .relaxngui_hint:nth-child(odd) { background-color: #fff; }
85
- .relaxngui_table.even > .relaxngui_hint:nth-child(even) { background-color: #e9e9e9; }
86
- .relaxngui_table.odd > .relaxngui_hint:nth-child(odd) { background-color: #e9e9e9; }
87
- .relaxngui_table.odd > .relaxngui_hint:nth-child(even) { background-color: #fff; }
88
-
89
- .relaxngui_dyn:nth-child(even) > .relaxngui_table > .relaxngui_row:nth-child(1):nth-last-child(1) {
90
- background-color: #fff;
91
- }
92
- .relaxngui_dyn:nth-child(odd) > .relaxngui_table > .relaxngui_row:nth-child(1):nth-last-child(1) {
93
- background-color: #e9e9e9;
94
- }
95
-
96
- .relaxngui_table.even { background-color: #e9e9e9; }
97
- .relaxngui_table.odd { background-color: #fff; }
98
-
99
- .relaxngui_row {
100
- width: 100%;
101
- display: flex;
102
- flex-direction: row;
103
- }
104
- .relaxngui_hint {
105
- padding-left: 0.2em;
106
- }
107
- .relaxngui_hint::before {
108
- content: "↳ ";
109
- }
110
- .relaxngui_header {
111
- margin: 0;
112
- padding: 0;
113
- padding-top: 0.7em;
114
- padding-bottom: 0.2em;
115
- padding-left: 0.1em;
116
- display: block;
117
- font-weight: bold;
118
- }
119
- .relaxngui_header[data-relaxngui-level="1"] {
120
- font-size: 1.2em;
121
- }
122
- .relaxngui_dyn .relaxngui_header {
123
- font-size: 1em;
124
- }
125
- button.relaxngui_control {
126
- margin: 0.5em 0;
127
- align-self: flex-start;
128
- }
129
-
130
- .relaxngui_cell { }
131
-
132
- .relaxngui_cell.optional { text-decoration: line-through; }
133
-
134
- .relaxngui_cell:nth-child(1), .relaxngui_cell:nth-child(2) {
135
- margin: 0;
136
- padding: 0.1em 0.2em;
137
- font-size: 1em;
138
- font-family: sans-serif;
139
- }
140
- input.relaxngui_cell:nth-child(1) {
141
- border: 0 none;
142
- background: none;
143
- }
144
- .relaxngui_cell:nth-child(3) {
145
- margin: 0;
146
- padding: 0.1em 0.2em;
147
- flex: 1 1 auto;
148
- font-size: 1em;
149
- font-family: sans-serif;
150
- }
151
- select.relaxngui_cell:nth-child(3) {
152
- -webkit-appearance: none; /*Removes default chrome and safari style*/
153
- -moz-appearance: none; /* Removes Default Firefox style*/
154
- padding: 0;
155
- }
156
- select.relaxngui_cell:nth-child(3), button.relaxngui_cell:nth-child(3), textarea.relaxngui_cell:nth-child(3), input.relaxngui_cell:nth-child(3), [contenteditable].relaxngui_cell:nth-child(3) {
157
- border: 0 none;
158
- background: none;
159
- }
160
-
161
- [contenteditable].relaxngui_cell:nth-child(3) {
162
- overflow-x: auto;
163
- overflow-wrap: normal;
164
- white-space: pre;
165
- font-family: monospace,monospace;
166
- }
167
- [contenteditable][data-relaxngui-wrap='true'].relaxngui_cell:nth-child(3) {
168
- white-space: normal;
169
- }
170
- [contenteditable].relaxngui_cell:focus {
171
- outline: 0px solid transparent;
172
- }
173
- [contenteditable].relaxngui_cell:empty:before {
174
- font-family: sans-serif;
175
- color: #a1a1a1;
176
- white-space: normal;
177
- content: attr(placeholder);
178
- display: block;
179
- }
180
-
181
- .relaxngui_template {
182
- display: none;
183
- }
184
-
185
- .relaxngui_hidden { display: none; }
@@ -1,488 +0,0 @@
1
- /*
2
- This file is part of RelaxNGui.
3
-
4
- RelaxNGui is free software: you can redistribute it and/or modify it under
5
- the terms of the GNU General Public License as published by the Free Software
6
- Foundation, either version 3 of the License, or (at your option) any later
7
- version.
8
-
9
- RelaxNGui is distributed in the hope that it will be useful, but WITHOUT ANY
10
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
-
13
- You should have received a copy of the GNU General Public License along with
14
- RelaxNGui (file COPYING in the main directory). If not, see
15
- <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- var RelaxNGui = function(rng,target,ceval,ignore=false) {
19
- if (!(rng instanceof XMLDocument)) { // rng has to be XMLDocument //{{{
20
- rng = $XR($(rng).serializeXML());
21
- } //}}}
22
-
23
- var lenextract = function(tag, lencount) { //{{{
24
- $.each(tag.attributes,function(k,v){
25
- if ((v.localName == 'label') && (v.namespaceURI == 'http://rngui.org')) { lencount = v.nodeValue.length > lencount ? v.nodeValue.length : lencount; }
26
- });
27
- return lencount;
28
- }; //}}}
29
-
30
- var labextract = function(type,tag) { //{{{
31
- var ret = { 'type': type, 'wrap': false, 'readonly': false, 'label': '', default: '' };
32
- $.each(tag.attributes,function(k,v){
33
- if ((v.localName == 'label') && (v.namespaceURI == 'http://rngui.org')) { ret['label'] = v.nodeValue; }
34
- if ((v.localName == 'readonly') && (v.namespaceURI == 'http://rngui.org')) { ret['readonly'] = v.nodeValue == 'true' ? true : false; }
35
- if ((v.localName == 'wrap') && (v.namespaceURI == 'http://rngui.org')) { ret['wrap'] = v.nodeValue == 'true' ? true : false; }
36
- });
37
- $.each(tag.children,function(k,v){
38
- if ((v.localName == 'param') && (v.namespaceURI == 'http://relaxng.org/ns/structure/1.0')) {
39
- $.each(v.attributes,function(l,w){
40
- if ((w.localName == 'name') && (w.nodeValue == 'minInclusive')) {
41
- ret['min'] = v.lastChild.nodeValue;
42
- }
43
- if ((w.localName == 'name') && (w.nodeValue == 'maxInclusive')) {
44
- ret['max'] = v.lastChild.nodeValue;
45
- }
46
- });
47
- }
48
- });
49
- return ret;
50
- }; //}}}
51
-
52
- var addelements = function(target,container) { //{{{
53
- var template = target.parent().find('> .relaxngui_template').clone(true,true);
54
- template.removeClass('relaxngui_template');
55
- template.find('[data-relaxngui-template]').each(function(j,t){
56
- $(t).attr('data-relaxngui-template',false);
57
- });
58
- template.find('.relaxngui_template [data-relaxngui-template]').each(function(j,t){
59
- $(t).attr('data-relaxngui-template',true);
60
- });
61
- template.addClass('relaxngui_dyn');
62
- template.on('click', '> *:first-child', function(ev){ delelements($(ev.target)); });
63
-
64
- if (container.find('> .relaxngui_dyn').length % 2 == 1) {
65
- var evens = template.find('.even');
66
- var odds = template.find('.odd');
67
- evens.each(function(k,v){
68
- $(v).removeClass('even');
69
- $(v).addClass('odd');
70
- });
71
- odds.each(function(k,v){
72
- $(v).removeClass('odd');
73
- $(v).addClass('even');
74
- });
75
- }
76
-
77
- container.append(template);
78
- }; //}}}
79
-
80
- var delelements = function(target) { //{{{
81
- var it = target.parent();
82
- var par = target.parent().parent();
83
- it.remove();
84
- par.trigger('relaxngui_remove');
85
- }; //}}}
86
-
87
- var recshow_header = function(tag,ret,level){ //{{{
88
- var header;
89
- var fold;
90
- $.each(tag.attributes,function(k,v){
91
- if ((v.localName == 'header') && (v.namespaceURI == 'http://rngui.org')) { header = v.nodeValue; }
92
- if ((v.localName == 'fold') && (v.namespaceURI == 'http://rngui.org')) { fold = v.nodeValue; }
93
- });
94
- if (header) {
95
- if (fold != undefined) {
96
- var xxx = $("<div data-relaxngui-level='" + level + "' class='relaxngui_header fold'>" + header + "</div>");
97
- xxx.prepend($("<span class='relaxngui_fold'></span>"));
98
- ret.append(xxx);
99
- if (fold == 'closed' || fold == 'closed_conditional') {
100
- ret.addClass('closed');
101
- }
102
- if (fold == 'closed_conditional') {
103
- ret.addClass(fold);
104
- }
105
- } else {
106
- ret.append($("<div data-relaxngui-level='" + level + "' class='relaxngui_header'>" + header + "</div>"));
107
- }
108
- }
109
- return fold;
110
- } //}}}
111
-
112
- var recshow_single = function(tag,ret,template,path,lencount,optional){ //{{{
113
- var node = $('<div class="relaxngui_row"/>');
114
- var name;
115
- var label;
116
- var labeltype;
117
- var second = {};
118
- var datalist = [];
119
- var defaul = '';
120
- var hint = '';
121
- var retcount = 0;
122
- $.each(tag.attributes,function(k,v){
123
- if ((v.localName == 'label') && (v.namespaceURI == 'http://rngui.org')) { label = v.nodeValue; }
124
- if ((v.localName == 'date') && (v.namespaceURI == 'http://rngui.org')) { label = v.nodeValue; }
125
- if ((v.localName == 'labeltype') && (v.namespaceURI == 'http://rngui.org')) { labeltype = v.nodeValue; }
126
- if ((v.localName == 'default') && (v.namespaceURI == 'http://rngui.org')) { defaul = v.nodeValue; }
127
- if ((v.localName == 'hint') && (v.namespaceURI == 'http://rngui.org')) { hint = v.nodeValue; }
128
- if (v.localName == 'name') { name = v.nodeValue.replace(/:/,'\\:'); }
129
- });
130
-
131
- $.each($(tag).children('data[type=string]'), function(k,v) { second = labextract('string',v); });
132
- $.each($(tag).children('data[type=integer]'), function(k,v) { second = labextract('integer',v); });
133
- $.each($(tag).children('data[type=nonNegativeInteger]'), function(k,v) { second = labextract('nonNegativeInteger',v); });
134
- $.each($(tag).children('data[type=positiveInteger]'), function(k,v) { second = labextract('positiveInteger',v); });
135
- $.each($(tag).children('data[type=float]'), function(k,v) { second = labextract('float',v); });
136
- $.each($(tag).children('data[type=date]'), function(k,v) { second = labextract('date',v); });
137
- $.each($(tag).children('text'), function(k,v) { second = labextract('text',v); });
138
- $.each($(tag).find('choice > value'), function(k,v) {
139
- second = labextract('datalist',$(v).parent()[0]);
140
- datalist.push([v.textContent,$(v).attr('id') ? $(v).attr('id') : v.textContent]);
141
- });
142
- if (name && label) {
143
- node.append($("<label class='relaxngui_cell" + (optional && defaul == '' ? " optional": "") + "' style='min-width: " + (lencount+1) + "ex' for=''>" + label + "</label><span class='relaxngui_cell'>⇒</span>"));
144
- } else if (name) {
145
- // a tag without information is ignored
146
- node.addClass('relaxngui_hidden');
147
- } else if (label) {
148
- if (labeltype == 'xml') {
149
- node.append($("<input data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + path + " > *[data-name]' class='relaxngui_cell' type='text' pattern='^[a-zA-Z_][a-zA-Z0-9_-]*$' id='' placeholder='" + label + "'></input><span class='relaxngui_cell'>⇒</span>"));
150
- } else {
151
- node.append($("<input data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + path + " > *[data-name]' class='relaxngui_cell' type='text' pattern='^[a-z_][a-zA-Z0-9_]*$' id='' placeholder='" + label + "'></input><span class='relaxngui_cell'>⇒</span>"));
152
- }
153
- }
154
-
155
- var tpath = ((typeof name === 'undefined') ? path + ' > *' : (tag.localName == 'element' ? path + ' > ' + name : path + '[' + name + ']'));
156
- if (label) {
157
- if (defaul && typeof defaul == 'string' && defaul.match(/^javascript:/)) {
158
- defaul = defaul.replace(/^javascript:/,'');
159
- defaul = ceval ? ceval(defaul) : eval(defaul);
160
- }
161
- var os = (optional ? " onkeyup='var sl = $(this).siblings(\"label\"); if ($(this).get_val() == \"\") { if (!sl.hasClass(\"optional\")) { sl.addClass(\"optional\") } } else { sl.removeClass(\"optional\") }' data-optional='true'" : " data-optional='false'");
162
- if (second.readonly)
163
- node.append($("<input " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' type='text' id='' readonly='readonly'" + os + "></input>"));
164
- else {
165
- if (second.type == 'string') {
166
- node.append($("<input " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' type='text' id='' placeholder='" + second.label + "'" + os + "></input>"));
167
- } else if (second.type == 'integer') {
168
- node.append($("<input " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' type='number' id='' placeholder='" + second.label + "'" + (second.min != undefined ? (" min='" + second.min + "'") : '') + (second.max != undefined ? (" max='" + second.max + "'") : '') + os + "></input>"));
169
- } else if (second.type == 'positiveInteger') {
170
- if (second.min == undefined) second.min = 1;
171
- node.append($("<input " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' type='number' id='' placeholder='" + second.label + "'" + (second.min != undefined ? (" min='" + second.min + "'") : '') + (second.max != undefined ? (" max='" + second.max + "'") : '') + os + "></input>"));
172
- } else if (second.type == 'nonNegativeInteger') {
173
- if (second.min == undefined) second.min = 0;
174
- node.append($("<input " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' type='number' id='' placeholder='" + second.label + "'" + (second.min != undefined ? (" min='" + second.min + "'") : '') + (second.max != undefined ? (" max='" + second.max + "'") : '') + os + "></input>"));
175
- } else if (second.type == 'date') {
176
- node.append($("<input " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' type='date' id='' placeholder='" + second.label + "'" + os + "></input>"));
177
- } else if (second.type == 'float') {
178
- node.append($("<input " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' type='number' step='any' id='' placeholder='" + second.label + "'" + (second.min != undefined ? (" min='" + second.min + "'") : '') + (second.max != undefined ? (" max='" + second.max + "'") : '') + os + "></input>"));
179
- } else if (second.type == 'text') {
180
- node.append($("<div contenteditable='true' data-relaxngui-wrap='" + second.wrap + "' " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' id='' placeholder='" + second.label + "'" + os + "></div>"));
181
- } else if (second.type == 'datalist') {
182
- var tnode = $("<select " + (defaul && typeof defaul == 'string' ? 'value="' + defaul + '"' : '') + " data-relaxngui-template='" + template + "' data-relaxngui-parent='" + path + "' data-relaxngui-path='" + tpath + "' class='relaxngui_cell' id='' size='1'" + os + "></select>");
183
- $.each(datalist,function(didx,dname){
184
- if (dname[1] == defaul)
185
- tnode.append('<option value="' + dname[1] + '" selected="selected">' + dname[0] + '</value>');
186
- else
187
- tnode.append('<option value="' + dname[1] + '">' + dname[0] + '</value>');
188
- });
189
- node.append(tnode);
190
- }
191
- }
192
- ret.append(node);
193
- retcount += 1;
194
- } else {
195
- if (tag.localName != 'element') { // its an attribute, simulate its empty-ness
196
- node.attr('data-relaxngui-template',template);
197
- node.attr('data-relaxngui-parent',path);
198
- node.attr('data-relaxngui-path',tpath);
199
- ret.append(node);
200
- retcount += 1;
201
- }
202
- }
203
- if (hint) {
204
- var n = $('<div class="relaxngui_hint"/>');
205
- var s1 = $('<em>Hint: </em>');
206
- var s2 = $('<span/>');
207
- s2.text(hint);
208
-
209
- n.append(s1);
210
- n.append(s2);
211
- ret.append(n);
212
- retcount += 1;
213
- }
214
- return retcount;
215
- } //}}}
216
-
217
- var recshow = function(elements,template,path,attr) { //{{{
218
- // delete all elements with relaxngui:ignore
219
- if (attr.ignore) {
220
- var tele = $.grep(elements,function(tagv){
221
- var include = true;
222
- $.each(tagv.attributes,function(k,v){
223
- if ((v.localName == 'ignore') && (v.namespaceURI == 'http://rngui.org')) {
224
- include = false;
225
- }
226
- });
227
- return include;
228
- });
229
- elements = $(tele);
230
- }
231
-
232
- var ret = $('<div/>');
233
-
234
- var lencount = 0;
235
- $.each(elements,function(k,v){
236
- var tag = $(v)[0];
237
- if ((tag.localName == 'element') && (tag.namespaceURI == 'http://relaxng.org/ns/structure/1.0')) {
238
- $(tag).children('attribute').each(function(l,w){
239
- lencount = lenextract($(w)[0],lencount);
240
- });
241
- lencount = lenextract(tag,lencount);
242
- }
243
- });
244
- $.each(elements,function(k,v){
245
- if (attr.mode == 'even') { attr.mode = 'odd' }
246
- else { attr.mode = 'even'; }
247
-
248
- var tag = $(v)[0];
249
- if ((tag.localName == 'element') && (tag.namespaceURI == 'http://relaxng.org/ns/structure/1.0')) {
250
- var xxx;
251
- if (template) {
252
- var yyy = $('<div class="relaxngui_table ' + attr.mode + '" data-relaxngui-template="true" data-relaxngui-parent="' + path + '" data-relaxngui-path="' + (path == '' ? ' > ' + (typeof elements.attr('name') === 'undefined' ? '*' : elements.attr('name')) : path + ' > ' + (typeof $(tag).attr('name') === 'undefined' ? '*' : $(tag).attr('name'))) + '[data-main]">');
253
- xxx = $('<div class="relaxngui_template"><span>✖</span></div>');
254
- xxx.append(yyy);
255
- ret.append(xxx);
256
- xxx = yyy;
257
- } else {
258
- xxx = $('<div class="relaxngui_table ' + attr.mode + '" data-relaxngui-template="false" data-relaxngui-parent="' + path + '" data-relaxngui-path="' + (path == '' ? ' > ' + elements.attr('name') : path + ' > ' + $(tag).attr('name')) + '[data-main]">');
259
- ret.append(xxx);
260
- }
261
-
262
- recshow_header(tag,xxx,attr.level);
263
- var rcount = 0;
264
- $(tag).children('attribute').each(function(l,w){
265
- var ttag = $(w)[0];
266
- rcount += recshow_single(ttag,xxx,template,path + ' > ' + $(tag).attr('name'),lencount,attr.optional ? true : false);
267
- });
268
- rcount += recshow_single(tag,xxx,template,path,lencount,attr.optional ? true : false);
269
-
270
- var sub;
271
- if (sub = recshow($(tag).children('element, zeroOrMore, optional, choice'),false,path + ' > ' + $(tag).attr('name'),{ ignore: attr.ignore, mode: (attr.mode == 'even' && rcount % 2 == 0 ? 'odd' : 'even' ), level: attr.level + 1 })) {
272
- var inode = xxx.append(sub);
273
- if (template) {
274
- inode.find('[data-relaxngui-template]').each(function(j,t){
275
- $(t).attr('data-relaxngui-template',true);
276
- });
277
- }
278
- }
279
- } else if ((tag.localName == 'zeroOrMore') && (tag.namespaceURI == 'http://relaxng.org/ns/structure/1.0')) {
280
- var label;
281
- $.each(tag.attributes,function(k,v){
282
- if ((v.localName == 'label') && (v.namespaceURI == 'http://rngui.org')) { label = v.nodeValue; }
283
- });
284
- var but = $('<button class="relaxngui_control">' + label + '</button>');
285
- but.on('click',function(ev){ addelements($(ev.target),$(ev.target).parent()); });
286
-
287
- ret.append(recshow($(tag).children(),true,path,{ ignore: attr.ignore, mode: attr.mode, level: attr.level }));
288
- ret.append(but);
289
- } else if ((tag.localName == 'optional') && (tag.namespaceURI == 'http://relaxng.org/ns/structure/1.0')) {
290
- ret.append(recshow($(tag).children('element, zeroOrMore'),false,path,{ ignore: attr.ignore, mode: (attr.mode == 'even' ? 'odd' : 'even'), optional: true, level: attr.level + 1 }));
291
- } else if ((tag.localName == 'choice') && (tag.namespaceURI == 'http://relaxng.org/ns/structure/1.0')) {
292
- if (!($(tag).children()[0].localName == 'value' && $(tag).children()[0].namespaceURI)) {
293
- $.each($(tag).children(),function(j,u){
294
- var label;
295
- $.each(u.attributes,function(k,v){
296
- if ((v.localName == 'label') && (v.namespaceURI == 'http://rngui.org')) { label = v.nodeValue; }
297
- });
298
- var but = $('<button class="relaxngui_control">' + label + '</button>');
299
- but.on('click',function(ev){ addelements($(ev.target),$(ev.target).parent().parent()); });
300
- var col = $('<span></span');
301
- col.append(recshow($(u).children(),true,path,{ ignore: attr.ignore, mode: attr.mode }));
302
- col.append(but);
303
- ret.append(col);
304
- });
305
- }
306
- }
307
- });
308
- return ret.children().length > 0 ? ret.children() : undefined;
309
- }; //}}}
310
-
311
- var serializeXML = function (xml) { //{{{
312
- var out = '';
313
- if (typeof XMLSerializer == 'function') {
314
- var xs = new XMLSerializer();
315
- $(xml).each(function() {
316
- out += xs.serializeToString(this);
317
- });
318
- } else if (xml && xml.xml != 'undefined') {
319
- $(xml).each(function() {
320
- out += this.xml;
321
- });
322
- }
323
- return out;
324
- }; //}}}
325
- this.save = function() { //{{{
326
- var xml;
327
- var curr;
328
- var tar = target.find('[data-relaxngui-path]:not([data-relaxngui-template=true])');
329
- for (var i = 0; i<tar.length;) {
330
- var path = $(tar[i]).attr('data-relaxngui-path');
331
- var parent_path = $(tar[i]).attr('data-relaxngui-parent');
332
- if (i == 0) {
333
- var par = path.replace(/\[data-main\]/,'').replace(/ > /,'');
334
- xml = $XR('<' + par + '/>');
335
- } else {
336
- var ma = path.match(/([^\s]+)$/)[1];
337
- var att;
338
- if (ma.match(/\*\[data-main\]/)) {
339
- // do nothing. seriously. explicitly.
340
- } else if (ma.match(/\[data-main\]/)) {
341
- var par = ma.replace(/\[data-main\]/,'');
342
- var curr = $($XR('<' + par + '/>').documentElement);
343
- $(parent_path,xml).last().append(curr);
344
- } else if (ma.match(/\[data-name\]/)) {
345
- if ($(tar[i]).get_val()) {
346
- var nn = $($XR('<' + $(tar[i]).get_val() + '/>').documentElement).text($(tar[i+1]).get_val());
347
- $(parent_path,xml).append(nn);
348
- }
349
- i+=1;
350
- } else if (att = ma.match(/\[([^\]]+)\]$/)) {
351
- att[1] = att[1].replace(/\\/,'');
352
- $(parent_path + ':last-child',xml).last().attr(att[1],$(tar[i]).get_val());
353
- } else {
354
- if ($(tar[i]).attr('data-optional') == 'true' && $(tar[i]).get_val() == '') {
355
- $(path + ':last-child',xml).last().remove();
356
- } else {
357
- $(path + ':last-child',xml).last().text($(tar[i]).get_val())
358
- }
359
- }
360
- }
361
- i+=1;
362
- }
363
- return xml;
364
- }; //}}}
365
- this.save_text = function() { //{{{
366
- return serializeXML(self.save());
367
- } //}}}
368
-
369
- this.content = function(data) { //{{{
370
- if (!(data instanceof XMLDocument)) { // data has to be XMLDocument //{{{
371
- data = $XR($(data).serializeXML());
372
- } //}}}
373
-
374
- if (data) {
375
- var x = $(data).serializePrettyXML();
376
- x = x.replace(/\s+xmlns(:[a-zA-Z0-9]+)?=\"[^\"]+\"/g, "");
377
- x = x.replace(/<\?[^>]+>/g, "");
378
- x = x.trim();
379
- y = $(self.save()).serializePrettyXML();
380
- if (x != y) {
381
- target.find('.relaxngui_dyn').remove();
382
- target.find('[data-relaxngui-path]').each(function(k,pa){
383
- var path = $(pa).attr('data-relaxngui-path');
384
- if (!path.match(/data-\w+\]$/)) {
385
- if ($(pa).attr('data-relaxngui-template') == 'true' && path.match(/\*$/)) {
386
- $(data).find(path).each(function(index,ele){
387
- $(target.find('[data-relaxngui-path="' + path + '[data-name]"][data-relaxngui-template="false"]').get(index)).set_val(ele.localName);
388
- $(target.find('[data-relaxngui-path="' + path + '"][data-relaxngui-template="false"]').get(index)).set_val($(ele).text());
389
- });
390
- } else if ($(pa).attr('data-relaxngui-template') == 'true' && !path.match(/\*$/)) {
391
- $(data).find(path).each(function(index,ele){
392
- var att;
393
- var val;
394
- if (att = path.match(/(.*)\[([^\]]+)\]$/)) {
395
- val = $(ele).attr(att[2]);
396
- } else {
397
- val = $(ele).text();
398
- }
399
- if (val && val != '') {
400
- $(target.find('[data-relaxngui-path="' + path + '"][data-relaxngui-template="false"]').get(index)).set_val(val);
401
- }
402
- });
403
- } else {
404
- var att;
405
- var val;
406
- if (att = path.match(/(.*)\[([^\]]+)\]$/)) {
407
- val = $(data).find(att[1]).attr(att[2]);
408
- } else {
409
- val = $(data).find(path).text();
410
- }
411
- if (val && val != '') {
412
- var t = target.find('[data-relaxngui-path="' + path + '"]');
413
- t.set_val(val);
414
- if (t.attr('data-optional') == 'true') {
415
- t.siblings('label').removeClass('optional');
416
- }
417
- }
418
- }
419
- } else {
420
- console.log('-----');
421
- console.log(path);
422
- if ($(pa).attr('data-relaxngui-template') == 'true') {
423
- var buts;
424
- var buts1 = target.find('.relaxngui_table[data-relaxngui-template="false"] > .relaxngui_template > [data-relaxngui-path="' + path + '"][data-relaxngui-template="true"]').parent().parent().find('> button');
425
- var buts2 = target.find('.relaxngui_table[data-relaxngui-template="false"] > span > .relaxngui_template > [data-relaxngui-path="' + path + '"][data-relaxngui-template="true"]').parent().parent().find('> button');
426
- if (buts1.length > 0) { buts = buts1; }
427
- if (buts2.length > 0) { buts = buts2; }
428
- if(!buts){ buts = $(); }
429
- console.log(buts);
430
- buts.each(function(_,b) {
431
- var but = $(b);
432
- var dpath = path.replace(/\[data-main\]$/,'');
433
- var par = undefined;
434
- var ind = -1;
435
- console.log('a');
436
-
437
- $(data).find(dpath).each(function(ke,ele){
438
- if (par != $(ele).parent()[0]) {
439
- ind += 1;
440
- par = $(ele).parent()[0];
441
- }
442
- console.log(but.get(ind));
443
- if ($(but.get(ind)).attr('disabled')) {
444
- $(but.get(ind)).removeAttr('disabled');
445
- but.get(ind).click();
446
- $(but.get(ind)).attr('disabled','disabled');
447
- } else {
448
- but.get(ind).click();
449
- }
450
- });
451
- });
452
- }
453
- }
454
- });
455
- self.set_checkpoint();
456
- }
457
- target.find('.relaxngui_table.closed_conditional').each(function(k,e) {
458
- $(e).find('input:not([readonly]), [contenteditable]:not([readonly])').each(function(l,f) {
459
- if ($(f).get_val() != '') {
460
- $(e).removeClass('closed');
461
- }
462
- });
463
- });
464
- }
465
- }; //}}}
466
-
467
- // stuff to determine if user changed something
468
- var orig = '';
469
- this.set_checkpoint = function() { //{{{
470
- orig = self.save_text();
471
- } //}}}
472
- this.has_changed = function() { //{{{
473
- if (orig != self.save_text()) {
474
- return true;
475
- } else {
476
- return false;
477
- }
478
- } //}}}
479
-
480
- target.append(recshow($(rng.documentElement),false,'',{ ignore: ignore, mode: 'even', level: 0}));
481
-
482
- var self = this;
483
-
484
- target.unbind('click.relaxngui');
485
- target.on('click.relaxngui','.relaxngui_header.fold',function(){
486
- $(this).parent().toggleClass('closed');
487
- });
488
- };