jruby_activiti 1.2.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG +6 -0
  5. data/Jarfile +5 -0
  6. data/Jarfile.lock +52 -13
  7. data/README.md +21 -9
  8. data/java/build.md +3 -0
  9. data/java/mapping.md +20 -0
  10. data/java/pom.xml +30 -0
  11. data/java/src/main/java/jrubyactiviti/Modeler.java +95 -0
  12. data/java/src/main/java/jrubyactiviti/ProcessDiagram.java +491 -0
  13. data/java/src/main/java/jrubyactiviti/ProcessInstanceHighlights.java +237 -0
  14. data/java/src/main/java/jrubyactiviti/StencilsetResource.java +16 -0
  15. data/java/src/main/resources/stencilset.json +1339 -0
  16. data/jruby_activiti.gemspec +3 -2
  17. data/lib/generators/jruby_activiti/install_generator.rb +4 -0
  18. data/lib/jar/jrubyactiviti-2.0.jar +0 -0
  19. data/lib/jruby_activiti/version.rb +1 -1
  20. data/lib/jruby_activiti/web.rb +81 -0
  21. data/lib/jruby_activiti.rb +28 -20
  22. data/test/{base_test.rb → activiti_test.rb} +1 -3
  23. data/test/instance_hights_test.rb +18 -0
  24. data/test/modeler_test.rb +35 -0
  25. data/test/process_diagram_test.rb +33 -0
  26. data/test/resources/model_init_editor_source.json +1 -0
  27. data/test/resources/model_json_xml.json +278 -0
  28. data/test/resources/model_svg_xml.xml +66 -0
  29. data/test/stencilset_test.rb +7 -0
  30. data/test/test_helper.rb +2 -0
  31. data/web/public/diagram-viewer/images/bg.png +0 -0
  32. data/web/public/diagram-viewer/images/breadcrumbs.png +0 -0
  33. data/web/public/diagram-viewer/images/checker-bg.png +0 -0
  34. data/web/public/diagram-viewer/images/deployer/blue/message_catch.png +0 -0
  35. data/web/public/diagram-viewer/images/deployer/business_rule.png +0 -0
  36. data/web/public/diagram-viewer/images/deployer/error_catch.png +0 -0
  37. data/web/public/diagram-viewer/images/deployer/error_throw.png +0 -0
  38. data/web/public/diagram-viewer/images/deployer/manual.png +0 -0
  39. data/web/public/diagram-viewer/images/deployer/message_catch.png +0 -0
  40. data/web/public/diagram-viewer/images/deployer/message_throw.png +0 -0
  41. data/web/public/diagram-viewer/images/deployer/receive.png +0 -0
  42. data/web/public/diagram-viewer/images/deployer/script.png +0 -0
  43. data/web/public/diagram-viewer/images/deployer/send.png +0 -0
  44. data/web/public/diagram-viewer/images/deployer/service.png +0 -0
  45. data/web/public/diagram-viewer/images/deployer/signal_catch.png +0 -0
  46. data/web/public/diagram-viewer/images/deployer/signal_throw.png +0 -0
  47. data/web/public/diagram-viewer/images/deployer/timer.png +0 -0
  48. data/web/public/diagram-viewer/images/deployer/user.png +0 -0
  49. data/web/public/diagram-viewer/index.html +130 -0
  50. data/web/public/diagram-viewer/js/ActivitiRest.js +74 -0
  51. data/web/public/diagram-viewer/js/ActivityImpl.js +1 -0
  52. data/web/public/diagram-viewer/js/Color.js +603 -0
  53. data/web/public/diagram-viewer/js/LineBreakMeasurer.js +270 -0
  54. data/web/public/diagram-viewer/js/Polyline.js +387 -0
  55. data/web/public/diagram-viewer/js/ProcessDiagramCanvas.js +2172 -0
  56. data/web/public/diagram-viewer/js/ProcessDiagramGenerator.js +1087 -0
  57. data/web/public/diagram-viewer/js/jquery/jquery.asyncqueue.js +125 -0
  58. data/web/public/diagram-viewer/js/jquery/jquery.js +9266 -0
  59. data/web/public/diagram-viewer/js/jquery/jquery.progressbar.js +131 -0
  60. data/web/public/diagram-viewer/js/jstools.js +23 -0
  61. data/web/public/diagram-viewer/js/raphael.2.1.1.js +10 -0
  62. data/web/public/diagram-viewer/js/raphael.js +10 -0
  63. data/web/public/diagram-viewer/js/raphael_uncompressed.js +5815 -0
  64. data/web/public/diagram-viewer/js/textlayout.js +441 -0
  65. data/web/public/diagram-viewer/style.css +1 -0
  66. data/web/public/editor-app/app-cfg.js +25 -0
  67. data/web/public/editor-app/app.js +432 -0
  68. data/web/public/editor-app/configuration/properties/assignment-display-template.html +4 -0
  69. data/web/public/editor-app/configuration/properties/assignment-popup.html +44 -0
  70. data/web/public/editor-app/configuration/properties/assignment-write-template.html +4 -0
  71. data/web/public/editor-app/configuration/properties/boolean-property-template.html +4 -0
  72. data/web/public/editor-app/configuration/properties/condition-expression-display-template.html +2 -0
  73. data/web/public/editor-app/configuration/properties/condition-expression-popup.html +29 -0
  74. data/web/public/editor-app/configuration/properties/condition-expression-write-template.html +4 -0
  75. data/web/public/editor-app/configuration/properties/default-value-display-template.html +4 -0
  76. data/web/public/editor-app/configuration/properties/event-listeners-display-template.html +3 -0
  77. data/web/public/editor-app/configuration/properties/event-listeners-popup.html +115 -0
  78. data/web/public/editor-app/configuration/properties/event-listeners-write-template.html +4 -0
  79. data/web/public/editor-app/configuration/properties/execution-listeners-display-template.html +3 -0
  80. data/web/public/editor-app/configuration/properties/execution-listeners-popup.html +101 -0
  81. data/web/public/editor-app/configuration/properties/execution-listeners-write-template.html +4 -0
  82. data/web/public/editor-app/configuration/properties/feedback-popup.html +17 -0
  83. data/web/public/editor-app/configuration/properties/fields-display-template.html +3 -0
  84. data/web/public/editor-app/configuration/properties/fields-popup.html +61 -0
  85. data/web/public/editor-app/configuration/properties/fields-write-template.html +4 -0
  86. data/web/public/editor-app/configuration/properties/form-properties-display-template.html +3 -0
  87. data/web/public/editor-app/configuration/properties/form-properties-popup.html +93 -0
  88. data/web/public/editor-app/configuration/properties/form-properties-write-template.html +4 -0
  89. data/web/public/editor-app/configuration/properties/in-parameters-display-template.html +3 -0
  90. data/web/public/editor-app/configuration/properties/in-parameters-popup.html +53 -0
  91. data/web/public/editor-app/configuration/properties/in-parameters-write-template.html +4 -0
  92. data/web/public/editor-app/configuration/properties/message-definitions-display-template.html +2 -0
  93. data/web/public/editor-app/configuration/properties/message-definitions-popup.html +50 -0
  94. data/web/public/editor-app/configuration/properties/message-definitions-write-template.html +3 -0
  95. data/web/public/editor-app/configuration/properties/message-property-write-template.html +4 -0
  96. data/web/public/editor-app/configuration/properties/multiinstance-property-write-template.html +8 -0
  97. data/web/public/editor-app/configuration/properties/out-parameters-display-template.html +3 -0
  98. data/web/public/editor-app/configuration/properties/out-parameters-popup.html +53 -0
  99. data/web/public/editor-app/configuration/properties/out-parameters-write-template.html +4 -0
  100. data/web/public/editor-app/configuration/properties/sequenceflow-order-display-template.html +3 -0
  101. data/web/public/editor-app/configuration/properties/sequenceflow-order-popup.html +47 -0
  102. data/web/public/editor-app/configuration/properties/sequenceflow-order-write-template.html +4 -0
  103. data/web/public/editor-app/configuration/properties/signal-definitions-display-template.html +3 -0
  104. data/web/public/editor-app/configuration/properties/signal-definitions-popup.html +58 -0
  105. data/web/public/editor-app/configuration/properties/signal-definitions-write-template.html +4 -0
  106. data/web/public/editor-app/configuration/properties/signal-property-write-template.html +4 -0
  107. data/web/public/editor-app/configuration/properties/string-property-write-mode-template.html +8 -0
  108. data/web/public/editor-app/configuration/properties/subprocess-reference-display-template.html +3 -0
  109. data/web/public/editor-app/configuration/properties/subprocess-reference-popup.html +43 -0
  110. data/web/public/editor-app/configuration/properties/subprocess-reference-write-template.html +4 -0
  111. data/web/public/editor-app/configuration/properties/task-listeners-display-template.html +3 -0
  112. data/web/public/editor-app/configuration/properties/task-listeners-popup.html +102 -0
  113. data/web/public/editor-app/configuration/properties/task-listeners-write-template.html +4 -0
  114. data/web/public/editor-app/configuration/properties/text-popup.html +17 -0
  115. data/web/public/editor-app/configuration/properties/text-property-write-template.html +4 -0
  116. data/web/public/editor-app/configuration/properties-assignment-controller.js +150 -0
  117. data/web/public/editor-app/configuration/properties-condition-expression-controller.js +58 -0
  118. data/web/public/editor-app/configuration/properties-custom-controllers.js +18 -0
  119. data/web/public/editor-app/configuration/properties-default-controllers.js +115 -0
  120. data/web/public/editor-app/configuration/properties-event-listeners-controller.js +266 -0
  121. data/web/public/editor-app/configuration/properties-execution-listeners-controller.js +326 -0
  122. data/web/public/editor-app/configuration/properties-fields-controller.js +192 -0
  123. data/web/public/editor-app/configuration/properties-form-properties-controller.js +192 -0
  124. data/web/public/editor-app/configuration/properties-in-parameters-controller.js +158 -0
  125. data/web/public/editor-app/configuration/properties-message-definitions-controller.js +137 -0
  126. data/web/public/editor-app/configuration/properties-message-scope-controller.js +48 -0
  127. data/web/public/editor-app/configuration/properties-multiinstance-controller.js +34 -0
  128. data/web/public/editor-app/configuration/properties-out-parameters-controller.js +158 -0
  129. data/web/public/editor-app/configuration/properties-sequenceflow-order-controller.js +130 -0
  130. data/web/public/editor-app/configuration/properties-signal-definitions-controller.js +136 -0
  131. data/web/public/editor-app/configuration/properties-signal-scope-controller.js +47 -0
  132. data/web/public/editor-app/configuration/properties-task-listeners-controller.js +325 -0
  133. data/web/public/editor-app/configuration/properties.js +99 -0
  134. data/web/public/editor-app/configuration/toolbar-custom-actions.js +18 -0
  135. data/web/public/editor-app/configuration/toolbar-default-actions.js +429 -0
  136. data/web/public/editor-app/configuration/toolbar.js +175 -0
  137. data/web/public/editor-app/configuration/url-config.js +34 -0
  138. data/web/public/editor-app/css/style-common.css +1518 -0
  139. data/web/public/editor-app/css/style-editor.css +639 -0
  140. data/web/public/editor-app/css/style.css +471 -0
  141. data/web/public/editor-app/editor/css/editor.css +202 -0
  142. data/web/public/editor-app/editor/i18n/translation_de.js +383 -0
  143. data/web/public/editor-app/editor/i18n/translation_en_us.js +423 -0
  144. data/web/public/editor-app/editor/i18n/translation_signavio_de.js +106 -0
  145. data/web/public/editor-app/editor/i18n/translation_signavio_en_us.js +108 -0
  146. data/web/public/editor-app/editor/oryx.debug.js +24510 -0
  147. data/web/public/editor-app/editor/oryx.js +30 -0
  148. data/web/public/editor-app/editor-config.js +32 -0
  149. data/web/public/editor-app/editor-controller.js +65 -0
  150. data/web/public/editor-app/editor-utils.js +135 -0
  151. data/web/public/editor-app/editor.html +136 -0
  152. data/web/public/editor-app/eventbus.js +133 -0
  153. data/web/public/editor-app/fonts/activiti-admin-webfont.eot +0 -0
  154. data/web/public/editor-app/fonts/activiti-admin-webfont.svg +43 -0
  155. data/web/public/editor-app/fonts/activiti-admin-webfont.ttf +0 -0
  156. data/web/public/editor-app/fonts/activiti-admin-webfont.woff +0 -0
  157. data/web/public/editor-app/fonts/glyphicons-halflings-regular.eot +0 -0
  158. data/web/public/editor-app/fonts/glyphicons-halflings-regular.svg +229 -0
  159. data/web/public/editor-app/fonts/glyphicons-halflings-regular.ttf +0 -0
  160. data/web/public/editor-app/fonts/glyphicons-halflings-regular.woff +0 -0
  161. data/web/public/editor-app/header-controller.js +31 -0
  162. data/web/public/editor-app/i18n/en.json +286 -0
  163. data/web/public/editor-app/images/bpmn-error.png +0 -0
  164. data/web/public/editor-app/images/bpmn-warning.png +0 -0
  165. data/web/public/editor-app/images/datadefinition.png +0 -0
  166. data/web/public/editor-app/images/delete.png +0 -0
  167. data/web/public/editor-app/images/loading.gif +0 -0
  168. data/web/public/editor-app/images/logo-2x.png +0 -0
  169. data/web/public/editor-app/images/logo.png +0 -0
  170. data/web/public/editor-app/images/nw-handle-dark.gif +0 -0
  171. data/web/public/editor-app/images/se-handle-dark.gif +0 -0
  172. data/web/public/editor-app/images/shapemenu_highlight.png +0 -0
  173. data/web/public/editor-app/images/wrench.png +0 -0
  174. data/web/public/editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js +8 -0
  175. data/web/public/editor-app/libs/angular-cookies_1.2.13/angular-cookies.min.js.map +8 -0
  176. data/web/public/editor-app/libs/angular-dragdrop.min-1.0.3.js +9 -0
  177. data/web/public/editor-app/libs/angular-dragdrop_1.0.7/angular-dragdrop.min.js +29 -0
  178. data/web/public/editor-app/libs/angular-mocks_1.2.13/angular-mocks.js +2136 -0
  179. data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.js +596 -0
  180. data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.min.js +13 -0
  181. data/web/public/editor-app/libs/angular-resource_1.2.13/angular-resource.min.js.map +8 -0
  182. data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.js +921 -0
  183. data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.min.js +14 -0
  184. data/web/public/editor-app/libs/angular-route_1.2.13/angular-route.min.js.map +8 -0
  185. data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.js +625 -0
  186. data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js +14 -0
  187. data/web/public/editor-app/libs/angular-sanitize_1.2.13/angular-sanitize.min.js.map +8 -0
  188. data/web/public/editor-app/libs/angular-scroll_0.5.7/angular-scroll.min.js +1 -0
  189. data/web/public/editor-app/libs/angular-strap_2.0.5/angular-strap.min.js +9 -0
  190. data/web/public/editor-app/libs/angular-strap_2.0.5/angular-strap.tpl.min.js +8 -0
  191. data/web/public/editor-app/libs/angular-translate-loader-static-files/.bower.json +19 -0
  192. data/web/public/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.js +31 -0
  193. data/web/public/editor-app/libs/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js +6 -0
  194. data/web/public/editor-app/libs/angular-translate-storage-cookie/.bower.json +20 -0
  195. data/web/public/editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.js +19 -0
  196. data/web/public/editor-app/libs/angular-translate-storage-cookie/angular-translate-storage-cookie.min.js +6 -0
  197. data/web/public/editor-app/libs/angular-translate_2.4.2/angular-translate.js +960 -0
  198. data/web/public/editor-app/libs/angular-translate_2.4.2/angular-translate.min.js +6 -0
  199. data/web/public/editor-app/libs/angular_1.2.13/angular-animate.min.js +27 -0
  200. data/web/public/editor-app/libs/angular_1.2.13/angular.min.js +204 -0
  201. data/web/public/editor-app/libs/bootstrap-daterangepicker_1.3.7/daterangepicker-bs3.css +267 -0
  202. data/web/public/editor-app/libs/bootstrap-daterangepicker_1.3.7/daterangepicker.js +1026 -0
  203. data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.css +347 -0
  204. data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.css.map +1 -0
  205. data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap-theme.min.css +7 -0
  206. data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.css +5785 -0
  207. data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.css.map +1 -0
  208. data/web/public/editor-app/libs/bootstrap_3.1.1/css/bootstrap.min.css +7 -0
  209. data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.eot +0 -0
  210. data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.svg +229 -0
  211. data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.ttf +0 -0
  212. data/web/public/editor-app/libs/bootstrap_3.1.1/fonts/glyphicons-halflings-regular.woff +0 -0
  213. data/web/public/editor-app/libs/bootstrap_3.1.1/js/bootstrap.js +1951 -0
  214. data/web/public/editor-app/libs/bootstrap_3.1.1/js/bootstrap.min.js +6 -0
  215. data/web/public/editor-app/libs/es5-shim-15.3.4.5/.bower.json +14 -0
  216. data/web/public/editor-app/libs/es5-shim-15.3.4.5/.gitignore +2 -0
  217. data/web/public/editor-app/libs/es5-shim-15.3.4.5/CHANGES +93 -0
  218. data/web/public/editor-app/libs/es5-shim-15.3.4.5/CONTRIBUTORS.md +25 -0
  219. data/web/public/editor-app/libs/es5-shim-15.3.4.5/LICENSE +19 -0
  220. data/web/public/editor-app/libs/es5-shim-15.3.4.5/README.md +161 -0
  221. data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.js +444 -0
  222. data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.map +1 -0
  223. data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-sham.min.js +4 -0
  224. data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.js +1314 -0
  225. data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.map +1 -0
  226. data/web/public/editor-app/libs/es5-shim-15.3.4.5/es5-shim.min.js +4 -0
  227. data/web/public/editor-app/libs/es5-shim-15.3.4.5/package.json +34 -0
  228. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h-kill.js +64 -0
  229. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h-matchers.js +34 -0
  230. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/helpers/h.js +3 -0
  231. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/index.html +64 -0
  232. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/index.min.html +63 -0
  233. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine-html.js +190 -0
  234. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine.css +166 -0
  235. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine.js +2477 -0
  236. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/jasmine_favicon.png +0 -0
  237. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/lib/json2.js +478 -0
  238. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-array.js +1223 -0
  239. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-date.js +152 -0
  240. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-function.js +147 -0
  241. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-number.js +14 -0
  242. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-object.js +181 -0
  243. data/web/public/editor-app/libs/es5-shim-15.3.4.5/tests/spec/s-string.js +204 -0
  244. data/web/public/editor-app/libs/jquery-ui-1.10.3.custom.min.js +6 -0
  245. data/web/public/editor-app/libs/jquery.autogrow-textarea.js +61 -0
  246. data/web/public/editor-app/libs/jquery_1.11.0/jquery.js +9789 -0
  247. data/web/public/editor-app/libs/jquery_1.11.0/jquery.min.js +4 -0
  248. data/web/public/editor-app/libs/jquery_1.11.0/jquery.min.map +1 -0
  249. data/web/public/editor-app/libs/json3_3.2.6/LICENSE +20 -0
  250. data/web/public/editor-app/libs/json3_3.2.6/lib/json3.js +861 -0
  251. data/web/public/editor-app/libs/json3_3.2.6/lib/json3.min.js +18 -0
  252. data/web/public/editor-app/libs/momentjs_2.5.1/momentjs.min.js +6 -0
  253. data/web/public/editor-app/libs/mousetrap-1.4.5.min.js +9 -0
  254. data/web/public/editor-app/libs/ng-grid-2.0.7-min.js +2 -0
  255. data/web/public/editor-app/libs/ng-grid-2.0.7.min.css +1 -0
  256. data/web/public/editor-app/libs/path_parser.js +30 -0
  257. data/web/public/editor-app/libs/prototype-1.5.1.js +3272 -0
  258. data/web/public/editor-app/libs/ui-utils.min-0.0.4.js +7 -0
  259. data/web/public/editor-app/partials/root-stencil-item-template.html +11 -0
  260. data/web/public/editor-app/partials/stencil-item-template.html +27 -0
  261. data/web/public/editor-app/plugins.xml +58 -0
  262. data/web/public/editor-app/popups/icon-template.html +3 -0
  263. data/web/public/editor-app/popups/save-model.html +41 -0
  264. data/web/public/editor-app/popups/select-shape.html +20 -0
  265. data/web/public/editor-app/popups/unsaved-changes.html +22 -0
  266. data/web/public/editor-app/select-shape-controller.js +314 -0
  267. data/web/public/editor-app/stencil-controller.js +1421 -0
  268. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.collapsed.png +0 -0
  269. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/event.subprocess.png +0 -0
  270. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/expanded.subprocess.png +0 -0
  271. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.business.rule.png +0 -0
  272. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.camel.png +0 -0
  273. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.manual.png +0 -0
  274. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.mule.png +0 -0
  275. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.receive.png +0 -0
  276. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.script.png +0 -0
  277. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.send.png +0 -0
  278. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.service.png +0 -0
  279. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.shell.png +0 -0
  280. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/list/type.user.png +0 -0
  281. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/subprocess.png +0 -0
  282. data/web/public/editor-app/stencilsets/bpmn2.0/icons/activity/task.png +0 -0
  283. data/web/public/editor-app/stencilsets/bpmn2.0/icons/artifact/text.annotation.png +0 -0
  284. data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/cancel.png +0 -0
  285. data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/compensation.png +0 -0
  286. data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/error.png +0 -0
  287. data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/message.png +0 -0
  288. data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/signal.png +0 -0
  289. data/web/public/editor-app/stencilsets/bpmn2.0/icons/catching/timer.png +0 -0
  290. data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/association.undirected.png +0 -0
  291. data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/association.unidirectional.png +0 -0
  292. data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/messageflow.png +0 -0
  293. data/web/public/editor-app/stencilsets/bpmn2.0/icons/connector/sequenceflow.png +0 -0
  294. data/web/public/editor-app/stencilsets/bpmn2.0/icons/dataobject/data.store.png +0 -0
  295. data/web/public/editor-app/stencilsets/bpmn2.0/icons/diagram.png +0 -0
  296. data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/cancel.png +0 -0
  297. data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/error.png +0 -0
  298. data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/none.png +0 -0
  299. data/web/public/editor-app/stencilsets/bpmn2.0/icons/endevent/terminate.png +0 -0
  300. data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/eventbased.png +0 -0
  301. data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/exclusive.databased.png +0 -0
  302. data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/inclusive.png +0 -0
  303. data/web/public/editor-app/stencilsets/bpmn2.0/icons/gateway/parallel.png +0 -0
  304. data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/error.png +0 -0
  305. data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/message.png +0 -0
  306. data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/none.png +0 -0
  307. data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/signal.png +0 -0
  308. data/web/public/editor-app/stencilsets/bpmn2.0/icons/startevent/timer.png +0 -0
  309. data/web/public/editor-app/stencilsets/bpmn2.0/icons/swimlane/lane.png +0 -0
  310. data/web/public/editor-app/stencilsets/bpmn2.0/icons/swimlane/pool.png +0 -0
  311. data/web/public/editor-app/stencilsets/bpmn2.0/icons/throwing/none.png +0 -0
  312. data/web/public/editor-app/stencilsets/bpmn2.0/icons/throwing/signal.png +0 -0
  313. data/web/public/editor-app/toolbar-controller.js +162 -0
  314. data/web/public/modeler.html +140 -0
  315. data/web/views/models/index.erb +32 -0
  316. data/web/views/models/new.erb +15 -0
  317. metadata +334 -10
@@ -0,0 +1,14 @@
1
+ /*
2
+ AngularJS v1.2.13
3
+ (c) 2010-2014 Google, Inc. http://angularjs.org
4
+ License: MIT
5
+ */
6
+ (function(h,e,A){'use strict';function u(w,q,k){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,n){function y(){l&&(l.$destroy(),l=null);g&&(k.leave(g),g=null)}function v(){var b=w.current&&w.current.locals;if(e.isDefined(b&&b.$template)){var b=a.$new(),f=w.current;g=n(b,function(d){k.enter(d,null,g||c,function(){!e.isDefined(t)||t&&!a.$eval(t)||q()});y()});l=f.scope=b;l.$emit("$viewContentLoaded");l.$eval(h)}else y()}var l,g,t=b.autoscroll,h=b.onload||"";
7
+ a.$on("$routeChangeSuccess",v);v()}}}function z(e,h,k){return{restrict:"ECA",priority:-400,link:function(a,c){var b=k.current,f=b.locals;c.html(f.$template);var n=e(c.contents());b.controller&&(f.$scope=a,f=h(b.controller,f),b.controllerAs&&(a[b.controllerAs]=f),c.data("$ngControllerController",f),c.children().data("$ngControllerController",f));n(a)}}}h=e.module("ngRoute",["ng"]).provider("$route",function(){function h(a,c){return e.extend(new (e.extend(function(){},{prototype:a})),c)}function q(a,
8
+ e){var b=e.caseInsensitiveMatch,f={originalPath:a,regexp:a},h=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,e,b,c){a="?"===c?c:null;c="*"===c?c:null;h.push({name:b,optional:!!a});e=e||"";return""+(a?"":e)+"(?:"+(a?e:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=RegExp("^"+a+"$",b?"i":"");return f}var k={};this.when=function(a,c){k[a]=e.extend({reloadOnSearch:!0},c,a&&q(a,c));if(a){var b="/"==a[a.length-1]?a.substr(0,a.length-
9
+ 1):a+"/";k[b]=e.extend({redirectTo:a},q(b,c))}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(a,c,b,f,n,q,v,l){function g(){var d=t(),m=r.current;if(d&&m&&d.$$route===m.$$route&&e.equals(d.pathParams,m.pathParams)&&!d.reloadOnSearch&&!x)m.params=d.params,e.copy(m.params,b),a.$broadcast("$routeUpdate",m);else if(d||m)x=!1,a.$broadcast("$routeChangeStart",d,m),(r.current=
10
+ d)&&d.redirectTo&&(e.isString(d.redirectTo)?c.path(u(d.redirectTo,d.params)).search(d.params).replace():c.url(d.redirectTo(d.pathParams,c.path(),c.search())).replace()),f.when(d).then(function(){if(d){var a=e.extend({},d.resolve),c,b;e.forEach(a,function(d,c){a[c]=e.isString(d)?n.get(d):n.invoke(d)});e.isDefined(c=d.template)?e.isFunction(c)&&(c=c(d.params)):e.isDefined(b=d.templateUrl)&&(e.isFunction(b)&&(b=b(d.params)),b=l.getTrustedResourceUrl(b),e.isDefined(b)&&(d.loadedTemplateUrl=b,c=q.get(b,
11
+ {cache:v}).then(function(a){return a.data})));e.isDefined(c)&&(a.$template=c);return f.all(a)}}).then(function(c){d==r.current&&(d&&(d.locals=c,e.copy(d.params,b)),a.$broadcast("$routeChangeSuccess",d,m))},function(c){d==r.current&&a.$broadcast("$routeChangeError",d,m,c)})}function t(){var a,b;e.forEach(k,function(f,k){var p;if(p=!b){var s=c.path();p=f.keys;var l={};if(f.regexp)if(s=f.regexp.exec(s)){for(var g=1,q=s.length;g<q;++g){var n=p[g-1],r="string"==typeof s[g]?decodeURIComponent(s[g]):s[g];
12
+ n&&r&&(l[n.name]=r)}p=l}else p=null;else p=null;p=a=p}p&&(b=h(f,{params:e.extend({},c.search(),a),pathParams:a}),b.$$route=f)});return b||k[null]&&h(k[null],{params:{},pathParams:{}})}function u(a,c){var b=[];e.forEach((a||"").split(":"),function(a,d){if(0===d)b.push(a);else{var e=a.match(/(\w+)(.*)/),f=e[1];b.push(c[f]);b.push(e[2]||"");delete c[f]}});return b.join("")}var x=!1,r={routes:k,reload:function(){x=!0;a.$evalAsync(g)}};a.$on("$locationChangeSuccess",g);return r}]});h.provider("$routeParams",
13
+ function(){this.$get=function(){return{}}});h.directive("ngView",u);h.directive("ngView",z);u.$inject=["$route","$anchorScroll","$animate"];z.$inject=["$compile","$controller","$route"]})(window,window.angular);
14
+ //# sourceMappingURL=angular-route.min.js.map
@@ -0,0 +1,8 @@
1
+ {
2
+ "version":3,
3
+ "file":"angular-route.min.js",
4
+ "lineCount":13,
5
+ "mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkBC,CAAlB,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AZ,CADF,KAEO,CACL,IAAIC,EAAeD,CAAAZ,MAAA,CAAc,WAAd,CAAnB,CACIxD,EAAMqE,CAAA,CAAa,CAAb,CACVH,EAAA9D,KAAA,CAAYY,CAAA,CAAOhB,CAAP,CAAZ,CACAkE,EAAA9D,KAAA,CAAYiE,CAAA,CAAa,CAAb,CAAZ,EAA+B,EAA/B,CACA,QAAOrD,CAAA,CAAOhB,CAAP,CALF,CAHqD,CAA9D,CAWA,OAAOkE,EAAAI,KAAA,CAAY,EAAZ,CAb4B,CA7VuD,IA8LxFpC,EAAc,CAAA,CA9L0E,CA+LxF7F,EAAS,QACCkE,CADD,QAeCgE,QAAQ,EAAG,CACjBrC,CAAA,CAAc,CAAA,CACdhB,EAAAsD,WAAA,CAAsB9C,CAAtB,CAFiB,CAfZ,CAqBbR,EAAA/C,IAAA,CAAe,wBAAf,CAAyCuD,CAAzC,CAEA,OAAOrF,EAtNqF,CARlF,CA5LW,CAlBL,CAqkBpByC,EAAAE,SAAA,CAAuB,cAAvB;AAoCAyF,QAA6B,EAAG,CAC9B,IAAAxD,KAAA,CAAYyD,QAAQ,EAAG,CAAE,MAAO,EAAT,CADO,CApChC,CAwCA5F,EAAA6F,UAAA,CAAwB,QAAxB,CAAkCvI,CAAlC,CACA0C,EAAA6F,UAAA,CAAwB,QAAxB,CAAkCvG,CAAlC,CAiLAhC,EAAAwI,QAAA,CAAwB,CAAC,QAAD,CAAW,eAAX,CAA4B,UAA5B,CAoExBxG,EAAAwG,QAAA,CAAmC,CAAC,UAAD,CAAa,aAAb,CAA4B,QAA5B,CAt3BG,CAArC,CAAA,CAm5BE3I,MAn5BF,CAm5BUA,MAAAC,QAn5BV;",
6
+ "sources":["angular-route.js"],
7
+ "names":["window","angular","undefined","ngViewFactory","$route","$anchorScroll","$animate","link","scope","$element","attr","ctrl","$transclude","cleanupLastView","currentScope","$destroy","currentElement","leave","update","locals","current","isDefined","$template","newScope","$new","clone","enter","onNgViewEnter","autoScrollExp","$eval","$emit","onloadExp","autoscroll","onload","$on","ngViewFillContentFactory","$compile","$controller","html","contents","controller","$scope","controllerAs","data","children","ngRouteModule","module","provider","$RouteProvider","inherit","parent","extra","extend","pathRegExp","path","opts","insensitive","caseInsensitiveMatch","ret","keys","replace","_","slash","key","option","optional","star","push","regexp","RegExp","routes","when","this.when","route","redirectPath","length","substr","otherwise","this.otherwise","params","$get","$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce","updateRoute","next","parseRoute","last","$$route","equals","pathParams","reloadOnSearch","forceReload","copy","$broadcast","redirectTo","isString","interpolate","search","url","then","resolve","template","templateUrl","forEach","value","get","invoke","isFunction","getTrustedResourceUrl","loadedTemplateUrl","response","all","error","match","m","exec","on","i","len","val","decodeURIComponent","name","string","result","split","segment","segmentMatch","join","reload","$evalAsync","$RouteParamsProvider","this.$get","directive","$inject"]
8
+ }
@@ -0,0 +1,625 @@
1
+ /**
2
+ * @license AngularJS v1.2.13
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
+ * License: MIT
5
+ */
6
+ (function(window, angular, undefined) {'use strict';
7
+
8
+ var $sanitizeMinErr = angular.$$minErr('$sanitize');
9
+
10
+ /**
11
+ * @ngdoc overview
12
+ * @name ngSanitize
13
+ * @description
14
+ *
15
+ * # ngSanitize
16
+ *
17
+ * The `ngSanitize` module provides functionality to sanitize HTML.
18
+ *
19
+ * {@installModule sanitize}
20
+ *
21
+ * <div doc-module-components="ngSanitize"></div>
22
+ *
23
+ * See {@link ngSanitize.$sanitize `$sanitize`} for usage.
24
+ */
25
+
26
+ /*
27
+ * HTML Parser By Misko Hevery (misko@hevery.com)
28
+ * based on: HTML Parser By John Resig (ejohn.org)
29
+ * Original code by Erik Arvidsson, Mozilla Public License
30
+ * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
31
+ *
32
+ * // Use like so:
33
+ * htmlParser(htmlString, {
34
+ * start: function(tag, attrs, unary) {},
35
+ * end: function(tag) {},
36
+ * chars: function(text) {},
37
+ * comment: function(text) {}
38
+ * });
39
+ *
40
+ */
41
+
42
+
43
+ /**
44
+ * @ngdoc service
45
+ * @name ngSanitize.$sanitize
46
+ * @function
47
+ *
48
+ * @description
49
+ * The input is sanitized by parsing the html into tokens. All safe tokens (from a whitelist) are
50
+ * then serialized back to properly escaped html string. This means that no unsafe input can make
51
+ * it into the returned string, however, since our parser is more strict than a typical browser
52
+ * parser, it's possible that some obscure input, which would be recognized as valid HTML by a
53
+ * browser, won't make it through the sanitizer.
54
+ * The whitelist is configured using the functions `aHrefSanitizationWhitelist` and
55
+ * `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider `$compileProvider`}.
56
+ *
57
+ * @param {string} html Html input.
58
+ * @returns {string} Sanitized html.
59
+ *
60
+ * @example
61
+ <doc:example module="ngSanitize">
62
+ <doc:source>
63
+ <script>
64
+ function Ctrl($scope, $sce) {
65
+ $scope.snippet =
66
+ '<p style="color:blue">an html\n' +
67
+ '<em onmouseover="this.textContent=\'PWN3D!\'">click here</em>\n' +
68
+ 'snippet</p>';
69
+ $scope.deliberatelyTrustDangerousSnippet = function() {
70
+ return $sce.trustAsHtml($scope.snippet);
71
+ };
72
+ }
73
+ </script>
74
+ <div ng-controller="Ctrl">
75
+ Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
76
+ <table>
77
+ <tr>
78
+ <td>Directive</td>
79
+ <td>How</td>
80
+ <td>Source</td>
81
+ <td>Rendered</td>
82
+ </tr>
83
+ <tr id="bind-html-with-sanitize">
84
+ <td>ng-bind-html</td>
85
+ <td>Automatically uses $sanitize</td>
86
+ <td><pre>&lt;div ng-bind-html="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
87
+ <td><div ng-bind-html="snippet"></div></td>
88
+ </tr>
89
+ <tr id="bind-html-with-trust">
90
+ <td>ng-bind-html</td>
91
+ <td>Bypass $sanitize by explicitly trusting the dangerous value</td>
92
+ <td>
93
+ <pre>&lt;div ng-bind-html="deliberatelyTrustDangerousSnippet()"&gt;
94
+ &lt;/div&gt;</pre>
95
+ </td>
96
+ <td><div ng-bind-html="deliberatelyTrustDangerousSnippet()"></div></td>
97
+ </tr>
98
+ <tr id="bind-default">
99
+ <td>ng-bind</td>
100
+ <td>Automatically escapes</td>
101
+ <td><pre>&lt;div ng-bind="snippet"&gt;<br/>&lt;/div&gt;</pre></td>
102
+ <td><div ng-bind="snippet"></div></td>
103
+ </tr>
104
+ </table>
105
+ </div>
106
+ </doc:source>
107
+ <doc:protractor>
108
+ it('should sanitize the html snippet by default', function() {
109
+ expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
110
+ toBe('<p>an html\n<em>click here</em>\nsnippet</p>');
111
+ });
112
+
113
+ it('should inline raw snippet if bound to a trusted value', function() {
114
+ expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).
115
+ toBe("<p style=\"color:blue\">an html\n" +
116
+ "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" +
117
+ "snippet</p>");
118
+ });
119
+
120
+ it('should escape snippet without any filter', function() {
121
+ expect(element(by.css('#bind-default div')).getInnerHtml()).
122
+ toBe("&lt;p style=\"color:blue\"&gt;an html\n" +
123
+ "&lt;em onmouseover=\"this.textContent='PWN3D!'\"&gt;click here&lt;/em&gt;\n" +
124
+ "snippet&lt;/p&gt;");
125
+ });
126
+
127
+ it('should update', function() {
128
+ element(by.model('snippet')).clear();
129
+ element(by.model('snippet')).sendKeys('new <b onclick="alert(1)">text</b>');
130
+ expect(element(by.css('#bind-html-with-sanitize div')).getInnerHtml()).
131
+ toBe('new <b>text</b>');
132
+ expect(element(by.css('#bind-html-with-trust div')).getInnerHtml()).toBe(
133
+ 'new <b onclick="alert(1)">text</b>');
134
+ expect(element(by.css('#bind-default div')).getInnerHtml()).toBe(
135
+ "new &lt;b onclick=\"alert(1)\"&gt;text&lt;/b&gt;");
136
+ });
137
+ </doc:protractor>
138
+ </doc:example>
139
+ */
140
+ function $SanitizeProvider() {
141
+ this.$get = ['$$sanitizeUri', function($$sanitizeUri) {
142
+ return function(html) {
143
+ var buf = [];
144
+ htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) {
145
+ return !/^unsafe/.test($$sanitizeUri(uri, isImage));
146
+ }));
147
+ return buf.join('');
148
+ };
149
+ }];
150
+ }
151
+
152
+ function sanitizeText(chars) {
153
+ var buf = [];
154
+ var writer = htmlSanitizeWriter(buf, angular.noop);
155
+ writer.chars(chars);
156
+ return buf.join('');
157
+ }
158
+
159
+
160
+ // Regular Expressions for parsing tags and attributes
161
+ var START_TAG_REGEXP =
162
+ /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,
163
+ END_TAG_REGEXP = /^<\s*\/\s*([\w:-]+)[^>]*>/,
164
+ ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,
165
+ BEGIN_TAG_REGEXP = /^</,
166
+ BEGING_END_TAGE_REGEXP = /^<\s*\//,
167
+ COMMENT_REGEXP = /<!--(.*?)-->/g,
168
+ DOCTYPE_REGEXP = /<!DOCTYPE([^>]*?)>/i,
169
+ CDATA_REGEXP = /<!\[CDATA\[(.*?)]]>/g,
170
+ // Match everything outside of normal chars and " (quote character)
171
+ NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;
172
+
173
+
174
+ // Good source of info about elements and attributes
175
+ // http://dev.w3.org/html5/spec/Overview.html#semantics
176
+ // http://simon.html5.org/html-elements
177
+
178
+ // Safe Void Elements - HTML5
179
+ // http://dev.w3.org/html5/spec/Overview.html#void-elements
180
+ var voidElements = makeMap("area,br,col,hr,img,wbr");
181
+
182
+ // Elements that you can, intentionally, leave open (and which close themselves)
183
+ // http://dev.w3.org/html5/spec/Overview.html#optional-tags
184
+ var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),
185
+ optionalEndTagInlineElements = makeMap("rp,rt"),
186
+ optionalEndTagElements = angular.extend({},
187
+ optionalEndTagInlineElements,
188
+ optionalEndTagBlockElements);
189
+
190
+ // Safe Block Elements - HTML5
191
+ var blockElements = angular.extend({}, optionalEndTagBlockElements, makeMap("address,article," +
192
+ "aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," +
193
+ "h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul"));
194
+
195
+ // Inline Elements - HTML5
196
+ var inlineElements = angular.extend({}, optionalEndTagInlineElements, makeMap("a,abbr,acronym,b," +
197
+ "bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," +
198
+ "samp,small,span,strike,strong,sub,sup,time,tt,u,var"));
199
+
200
+
201
+ // Special Elements (can contain anything)
202
+ var specialElements = makeMap("script,style");
203
+
204
+ var validElements = angular.extend({},
205
+ voidElements,
206
+ blockElements,
207
+ inlineElements,
208
+ optionalEndTagElements);
209
+
210
+ //Attributes that have href and hence need to be sanitized
211
+ var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap");
212
+ var validAttrs = angular.extend({}, uriAttrs, makeMap(
213
+ 'abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,'+
214
+ 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,'+
215
+ 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,'+
216
+ 'scope,scrolling,shape,size,span,start,summary,target,title,type,'+
217
+ 'valign,value,vspace,width'));
218
+
219
+ function makeMap(str) {
220
+ var obj = {}, items = str.split(','), i;
221
+ for (i = 0; i < items.length; i++) obj[items[i]] = true;
222
+ return obj;
223
+ }
224
+
225
+
226
+ /**
227
+ * @example
228
+ * htmlParser(htmlString, {
229
+ * start: function(tag, attrs, unary) {},
230
+ * end: function(tag) {},
231
+ * chars: function(text) {},
232
+ * comment: function(text) {}
233
+ * });
234
+ *
235
+ * @param {string} html string
236
+ * @param {object} handler
237
+ */
238
+ function htmlParser( html, handler ) {
239
+ var index, chars, match, stack = [], last = html;
240
+ stack.last = function() { return stack[ stack.length - 1 ]; };
241
+
242
+ while ( html ) {
243
+ chars = true;
244
+
245
+ // Make sure we're not in a script or style element
246
+ if ( !stack.last() || !specialElements[ stack.last() ] ) {
247
+
248
+ // Comment
249
+ if ( html.indexOf("<!--") === 0 ) {
250
+ // comments containing -- are not allowed unless they terminate the comment
251
+ index = html.indexOf("--", 4);
252
+
253
+ if ( index >= 0 && html.lastIndexOf("-->", index) === index) {
254
+ if (handler.comment) handler.comment( html.substring( 4, index ) );
255
+ html = html.substring( index + 3 );
256
+ chars = false;
257
+ }
258
+ // DOCTYPE
259
+ } else if ( DOCTYPE_REGEXP.test(html) ) {
260
+ match = html.match( DOCTYPE_REGEXP );
261
+
262
+ if ( match ) {
263
+ html = html.replace( match[0] , '');
264
+ chars = false;
265
+ }
266
+ // end tag
267
+ } else if ( BEGING_END_TAGE_REGEXP.test(html) ) {
268
+ match = html.match( END_TAG_REGEXP );
269
+
270
+ if ( match ) {
271
+ html = html.substring( match[0].length );
272
+ match[0].replace( END_TAG_REGEXP, parseEndTag );
273
+ chars = false;
274
+ }
275
+
276
+ // start tag
277
+ } else if ( BEGIN_TAG_REGEXP.test(html) ) {
278
+ match = html.match( START_TAG_REGEXP );
279
+
280
+ if ( match ) {
281
+ html = html.substring( match[0].length );
282
+ match[0].replace( START_TAG_REGEXP, parseStartTag );
283
+ chars = false;
284
+ }
285
+ }
286
+
287
+ if ( chars ) {
288
+ index = html.indexOf("<");
289
+
290
+ var text = index < 0 ? html : html.substring( 0, index );
291
+ html = index < 0 ? "" : html.substring( index );
292
+
293
+ if (handler.chars) handler.chars( decodeEntities(text) );
294
+ }
295
+
296
+ } else {
297
+ html = html.replace(new RegExp("(.*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'),
298
+ function(all, text){
299
+ text = text.replace(COMMENT_REGEXP, "$1").replace(CDATA_REGEXP, "$1");
300
+
301
+ if (handler.chars) handler.chars( decodeEntities(text) );
302
+
303
+ return "";
304
+ });
305
+
306
+ parseEndTag( "", stack.last() );
307
+ }
308
+
309
+ if ( html == last ) {
310
+ throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block " +
311
+ "of html: {0}", html);
312
+ }
313
+ last = html;
314
+ }
315
+
316
+ // Clean up any remaining tags
317
+ parseEndTag();
318
+
319
+ function parseStartTag( tag, tagName, rest, unary ) {
320
+ tagName = angular.lowercase(tagName);
321
+ if ( blockElements[ tagName ] ) {
322
+ while ( stack.last() && inlineElements[ stack.last() ] ) {
323
+ parseEndTag( "", stack.last() );
324
+ }
325
+ }
326
+
327
+ if ( optionalEndTagElements[ tagName ] && stack.last() == tagName ) {
328
+ parseEndTag( "", tagName );
329
+ }
330
+
331
+ unary = voidElements[ tagName ] || !!unary;
332
+
333
+ if ( !unary )
334
+ stack.push( tagName );
335
+
336
+ var attrs = {};
337
+
338
+ rest.replace(ATTR_REGEXP,
339
+ function(match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) {
340
+ var value = doubleQuotedValue
341
+ || singleQuotedValue
342
+ || unquotedValue
343
+ || '';
344
+
345
+ attrs[name] = decodeEntities(value);
346
+ });
347
+ if (handler.start) handler.start( tagName, attrs, unary );
348
+ }
349
+
350
+ function parseEndTag( tag, tagName ) {
351
+ var pos = 0, i;
352
+ tagName = angular.lowercase(tagName);
353
+ if ( tagName )
354
+ // Find the closest opened tag of the same type
355
+ for ( pos = stack.length - 1; pos >= 0; pos-- )
356
+ if ( stack[ pos ] == tagName )
357
+ break;
358
+
359
+ if ( pos >= 0 ) {
360
+ // Close all the open elements, up the stack
361
+ for ( i = stack.length - 1; i >= pos; i-- )
362
+ if (handler.end) handler.end( stack[ i ] );
363
+
364
+ // Remove the open elements from the stack
365
+ stack.length = pos;
366
+ }
367
+ }
368
+ }
369
+
370
+ var hiddenPre=document.createElement("pre");
371
+ var spaceRe = /^(\s*)([\s\S]*?)(\s*)$/;
372
+ /**
373
+ * decodes all entities into regular string
374
+ * @param value
375
+ * @returns {string} A string with decoded entities.
376
+ */
377
+ function decodeEntities(value) {
378
+ if (!value) { return ''; }
379
+
380
+ // Note: IE8 does not preserve spaces at the start/end of innerHTML
381
+ // so we must capture them and reattach them afterward
382
+ var parts = spaceRe.exec(value);
383
+ var spaceBefore = parts[1];
384
+ var spaceAfter = parts[3];
385
+ var content = parts[2];
386
+ if (content) {
387
+ hiddenPre.innerHTML=content.replace(/</g,"&lt;");
388
+ // innerText depends on styling as it doesn't display hidden elements.
389
+ // Therefore, it's better to use textContent not to cause unnecessary
390
+ // reflows. However, IE<9 don't support textContent so the innerText
391
+ // fallback is necessary.
392
+ content = 'textContent' in hiddenPre ?
393
+ hiddenPre.textContent : hiddenPre.innerText;
394
+ }
395
+ return spaceBefore + content + spaceAfter;
396
+ }
397
+
398
+ /**
399
+ * Escapes all potentially dangerous characters, so that the
400
+ * resulting string can be safely inserted into attribute or
401
+ * element text.
402
+ * @param value
403
+ * @returns escaped text
404
+ */
405
+ function encodeEntities(value) {
406
+ return value.
407
+ replace(/&/g, '&amp;').
408
+ replace(NON_ALPHANUMERIC_REGEXP, function(value){
409
+ return '&#' + value.charCodeAt(0) + ';';
410
+ }).
411
+ replace(/</g, '&lt;').
412
+ replace(/>/g, '&gt;');
413
+ }
414
+
415
+ /**
416
+ * create an HTML/XML writer which writes to buffer
417
+ * @param {Array} buf use buf.jain('') to get out sanitized html string
418
+ * @returns {object} in the form of {
419
+ * start: function(tag, attrs, unary) {},
420
+ * end: function(tag) {},
421
+ * chars: function(text) {},
422
+ * comment: function(text) {}
423
+ * }
424
+ */
425
+ function htmlSanitizeWriter(buf, uriValidator){
426
+ var ignore = false;
427
+ var out = angular.bind(buf, buf.push);
428
+ return {
429
+ start: function(tag, attrs, unary){
430
+ tag = angular.lowercase(tag);
431
+ if (!ignore && specialElements[tag]) {
432
+ ignore = tag;
433
+ }
434
+ if (!ignore && validElements[tag] === true) {
435
+ out('<');
436
+ out(tag);
437
+ angular.forEach(attrs, function(value, key){
438
+ var lkey=angular.lowercase(key);
439
+ var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background');
440
+ if (validAttrs[lkey] === true &&
441
+ (uriAttrs[lkey] !== true || uriValidator(value, isImage))) {
442
+ out(' ');
443
+ out(key);
444
+ out('="');
445
+ out(encodeEntities(value));
446
+ out('"');
447
+ }
448
+ });
449
+ out(unary ? '/>' : '>');
450
+ }
451
+ },
452
+ end: function(tag){
453
+ tag = angular.lowercase(tag);
454
+ if (!ignore && validElements[tag] === true) {
455
+ out('</');
456
+ out(tag);
457
+ out('>');
458
+ }
459
+ if (tag == ignore) {
460
+ ignore = false;
461
+ }
462
+ },
463
+ chars: function(chars){
464
+ if (!ignore) {
465
+ out(encodeEntities(chars));
466
+ }
467
+ }
468
+ };
469
+ }
470
+
471
+
472
+ // define ngSanitize module and register $sanitize service
473
+ angular.module('ngSanitize', []).provider('$sanitize', $SanitizeProvider);
474
+
475
+ /* global sanitizeText: false */
476
+
477
+ /**
478
+ * @ngdoc filter
479
+ * @name ngSanitize.filter:linky
480
+ * @function
481
+ *
482
+ * @description
483
+ * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and
484
+ * plain email address links.
485
+ *
486
+ * Requires the {@link ngSanitize `ngSanitize`} module to be installed.
487
+ *
488
+ * @param {string} text Input text.
489
+ * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in.
490
+ * @returns {string} Html-linkified text.
491
+ *
492
+ * @usage
493
+ <span ng-bind-html="linky_expression | linky"></span>
494
+ *
495
+ * @example
496
+ <doc:example module="ngSanitize">
497
+ <doc:source>
498
+ <script>
499
+ function Ctrl($scope) {
500
+ $scope.snippet =
501
+ 'Pretty text with some links:\n'+
502
+ 'http://angularjs.org/,\n'+
503
+ 'mailto:us@somewhere.org,\n'+
504
+ 'another@somewhere.org,\n'+
505
+ 'and one more: ftp://127.0.0.1/.';
506
+ $scope.snippetWithTarget = 'http://angularjs.org/';
507
+ }
508
+ </script>
509
+ <div ng-controller="Ctrl">
510
+ Snippet: <textarea ng-model="snippet" cols="60" rows="3"></textarea>
511
+ <table>
512
+ <tr>
513
+ <td>Filter</td>
514
+ <td>Source</td>
515
+ <td>Rendered</td>
516
+ </tr>
517
+ <tr id="linky-filter">
518
+ <td>linky filter</td>
519
+ <td>
520
+ <pre>&lt;div ng-bind-html="snippet | linky"&gt;<br>&lt;/div&gt;</pre>
521
+ </td>
522
+ <td>
523
+ <div ng-bind-html="snippet | linky"></div>
524
+ </td>
525
+ </tr>
526
+ <tr id="linky-target">
527
+ <td>linky target</td>
528
+ <td>
529
+ <pre>&lt;div ng-bind-html="snippetWithTarget | linky:'_blank'"&gt;<br>&lt;/div&gt;</pre>
530
+ </td>
531
+ <td>
532
+ <div ng-bind-html="snippetWithTarget | linky:'_blank'"></div>
533
+ </td>
534
+ </tr>
535
+ <tr id="escaped-html">
536
+ <td>no filter</td>
537
+ <td><pre>&lt;div ng-bind="snippet"&gt;<br>&lt;/div&gt;</pre></td>
538
+ <td><div ng-bind="snippet"></div></td>
539
+ </tr>
540
+ </table>
541
+ </doc:source>
542
+ <doc:protractor>
543
+ it('should linkify the snippet with urls', function() {
544
+ expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
545
+ toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' +
546
+ 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
547
+ expect(element.all(by.css('#linky-filter a')).count()).toEqual(4);
548
+ });
549
+
550
+ it('should not linkify snippet without the linky filter', function() {
551
+ expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()).
552
+ toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' +
553
+ 'another@somewhere.org, and one more: ftp://127.0.0.1/.');
554
+ expect(element.all(by.css('#escaped-html a')).count()).toEqual(0);
555
+ });
556
+
557
+ it('should update', function() {
558
+ element(by.model('snippet')).clear();
559
+ element(by.model('snippet')).sendKeys('new http://link.');
560
+ expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()).
561
+ toBe('new http://link.');
562
+ expect(element.all(by.css('#linky-filter a')).count()).toEqual(1);
563
+ expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText())
564
+ .toBe('new http://link.');
565
+ });
566
+
567
+ it('should work with the target property', function() {
568
+ expect(element(by.id('linky-target')).
569
+ element(by.binding("snippetWithTarget | linky:'_blank'")).getText()).
570
+ toBe('http://angularjs.org/');
571
+ expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank');
572
+ });
573
+ </doc:protractor>
574
+ </doc:example>
575
+ */
576
+ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {
577
+ var LINKY_URL_REGEXP =
578
+ /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>]/,
579
+ MAILTO_REGEXP = /^mailto:/;
580
+
581
+ return function(text, target) {
582
+ if (!text) return text;
583
+ var match;
584
+ var raw = text;
585
+ var html = [];
586
+ var url;
587
+ var i;
588
+ while ((match = raw.match(LINKY_URL_REGEXP))) {
589
+ // We can not end in these as they are sometimes found at the end of the sentence
590
+ url = match[0];
591
+ // if we did not match ftp/http/mailto then assume mailto
592
+ if (match[2] == match[3]) url = 'mailto:' + url;
593
+ i = match.index;
594
+ addText(raw.substr(0, i));
595
+ addLink(url, match[0].replace(MAILTO_REGEXP, ''));
596
+ raw = raw.substring(i + match[0].length);
597
+ }
598
+ addText(raw);
599
+ return $sanitize(html.join(''));
600
+
601
+ function addText(text) {
602
+ if (!text) {
603
+ return;
604
+ }
605
+ html.push(sanitizeText(text));
606
+ }
607
+
608
+ function addLink(url, text) {
609
+ html.push('<a ');
610
+ if (angular.isDefined(target)) {
611
+ html.push('target="');
612
+ html.push(target);
613
+ html.push('" ');
614
+ }
615
+ html.push('href="');
616
+ html.push(url);
617
+ html.push('">');
618
+ addText(text);
619
+ html.push('</a>');
620
+ }
621
+ };
622
+ }]);
623
+
624
+
625
+ })(window, window.angular);