process_engine 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +37 -0
  4. data/app/assets/bower_components/process_engine/Snap.svg/CONTRIBUTING +3 -0
  5. data/app/assets/bower_components/process_engine/Snap.svg/Gruntfile.js +59 -0
  6. data/app/assets/bower_components/process_engine/Snap.svg/LICENSE +202 -0
  7. data/app/assets/bower_components/process_engine/Snap.svg/NOTICE +190 -0
  8. data/app/assets/bower_components/process_engine/Snap.svg/README.md +62 -0
  9. data/app/assets/bower_components/process_engine/Snap.svg/bower.json +25 -0
  10. data/app/assets/bower_components/process_engine/Snap.svg/component.json +13 -0
  11. data/app/assets/bower_components/process_engine/Snap.svg/dist/snap.svg-min.js +20 -0
  12. data/app/assets/bower_components/process_engine/Snap.svg/dist/snap.svg.js +7653 -0
  13. data/app/assets/bower_components/process_engine/Snap.svg/doc/css/dr.css +144 -0
  14. data/app/assets/bower_components/process_engine/Snap.svg/doc/css/main.css +508 -0
  15. data/app/assets/bower_components/process_engine/Snap.svg/doc/css/prism.css +168 -0
  16. data/app/assets/bower_components/process_engine/Snap.svg/doc/css/topcoat-desktop-light.css +3700 -0
  17. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.eot +0 -0
  18. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.svg +242 -0
  19. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.ttf +0 -0
  20. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcecodepro-regular-webfont.woff +0 -0
  21. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-light-webfont.eot +0 -0
  22. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-light-webfont.svg +243 -0
  23. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-light-webfont.ttf +0 -0
  24. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-light-webfont.woff +0 -0
  25. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.eot +0 -0
  26. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.svg +243 -0
  27. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.ttf +0 -0
  28. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-regular-webfont.woff +0 -0
  29. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.eot +0 -0
  30. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.svg +243 -0
  31. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.ttf +0 -0
  32. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/sourcesanspro-semibold-webfont.woff +0 -0
  33. data/app/assets/bower_components/process_engine/Snap.svg/doc/fonts/stylesheet.css +57 -0
  34. data/app/assets/bower_components/process_engine/Snap.svg/doc/img/search.svg +11 -0
  35. data/app/assets/bower_components/process_engine/Snap.svg/doc/img/search_dark.svg +16 -0
  36. data/app/assets/bower_components/process_engine/Snap.svg/doc/js/prism.js +9 -0
  37. data/app/assets/bower_components/process_engine/Snap.svg/doc/reference.html +13633 -0
  38. data/app/assets/bower_components/process_engine/Snap.svg/dr.json +33 -0
  39. data/app/assets/bower_components/process_engine/Snap.svg/history.md +31 -0
  40. data/app/assets/bower_components/process_engine/Snap.svg/package.json +22 -0
  41. data/app/assets/bower_components/process_engine/Snap.svg/template.dot +157 -0
  42. data/app/assets/bower_components/process_engine/Snap.svg/test.html +75 -0
  43. data/app/assets/bower_components/process_engine/bpmn-js/LICENSE +22 -0
  44. data/app/assets/bower_components/process_engine/bpmn-js/README.md +46 -0
  45. data/app/assets/bower_components/process_engine/bpmn-js/bower.json +28 -0
  46. data/app/assets/bower_components/process_engine/bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css +40 -0
  47. data/app/assets/bower_components/process_engine/bpmn-js/dist/assets/bpmn-font/font/bpmn.eot +0 -0
  48. data/app/assets/bower_components/process_engine/bpmn-js/dist/assets/bpmn-font/font/bpmn.svg +21 -0
  49. data/app/assets/bower_components/process_engine/bpmn-js/dist/assets/bpmn-font/font/bpmn.ttf +0 -0
  50. data/app/assets/bower_components/process_engine/bpmn-js/dist/assets/bpmn-font/font/bpmn.woff +0 -0
  51. data/app/assets/bower_components/process_engine/bpmn-js/dist/assets/diagram-js.css +355 -0
  52. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-modeler.js +21552 -0
  53. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-modeler.js.map +1 -0
  54. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-modeler.min.js +8 -0
  55. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-navigated-viewer.js +13542 -0
  56. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-navigated-viewer.js.map +1 -0
  57. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-navigated-viewer.min.js +5 -0
  58. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-viewer.js +13294 -0
  59. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-viewer.js.map +1 -0
  60. data/app/assets/bower_components/process_engine/bpmn-js/dist/bpmn-viewer.min.js +5 -0
  61. data/app/assets/bower_components/process_engine/hammerjs/CHANGELOG.md +30 -0
  62. data/app/assets/bower_components/process_engine/hammerjs/CONTRIBUTING.md +41 -0
  63. data/app/assets/bower_components/process_engine/hammerjs/Gruntfile.coffee +123 -0
  64. data/app/assets/bower_components/process_engine/hammerjs/LICENSE.md +21 -0
  65. data/app/assets/bower_components/process_engine/hammerjs/README.md +6 -0
  66. data/app/assets/bower_components/process_engine/hammerjs/bower.json +9 -0
  67. data/app/assets/bower_components/process_engine/hammerjs/component.json +8 -0
  68. data/app/assets/bower_components/process_engine/hammerjs/hammer.js +2463 -0
  69. data/app/assets/bower_components/process_engine/hammerjs/hammer.min.js +7 -0
  70. data/app/assets/bower_components/process_engine/hammerjs/hammer.min.map +1 -0
  71. data/app/assets/bower_components/process_engine/hammerjs/package.json +50 -0
  72. data/app/assets/bower_components/process_engine/jquery/MIT-LICENSE.txt +21 -0
  73. data/app/assets/bower_components/process_engine/jquery/bower.json +27 -0
  74. data/app/assets/bower_components/process_engine/jquery/dist/jquery.js +9205 -0
  75. data/app/assets/bower_components/process_engine/jquery/dist/jquery.min.js +5 -0
  76. data/app/assets/bower_components/process_engine/jquery/dist/jquery.min.map +1 -0
  77. data/app/assets/bower_components/process_engine/jquery/src/ajax/jsonp.js +89 -0
  78. data/app/assets/bower_components/process_engine/jquery/src/ajax/load.js +75 -0
  79. data/app/assets/bower_components/process_engine/jquery/src/ajax/parseJSON.js +13 -0
  80. data/app/assets/bower_components/process_engine/jquery/src/ajax/parseXML.js +28 -0
  81. data/app/assets/bower_components/process_engine/jquery/src/ajax/script.js +64 -0
  82. data/app/assets/bower_components/process_engine/jquery/src/ajax/var/nonce.js +5 -0
  83. data/app/assets/bower_components/process_engine/jquery/src/ajax/var/rquery.js +3 -0
  84. data/app/assets/bower_components/process_engine/jquery/src/ajax/xhr.js +136 -0
  85. data/app/assets/bower_components/process_engine/jquery/src/ajax.js +786 -0
  86. data/app/assets/bower_components/process_engine/jquery/src/attributes/attr.js +141 -0
  87. data/app/assets/bower_components/process_engine/jquery/src/attributes/classes.js +158 -0
  88. data/app/assets/bower_components/process_engine/jquery/src/attributes/prop.js +94 -0
  89. data/app/assets/bower_components/process_engine/jquery/src/attributes/support.js +35 -0
  90. data/app/assets/bower_components/process_engine/jquery/src/attributes/val.js +161 -0
  91. data/app/assets/bower_components/process_engine/jquery/src/attributes.js +11 -0
  92. data/app/assets/bower_components/process_engine/jquery/src/callbacks.js +205 -0
  93. data/app/assets/bower_components/process_engine/jquery/src/core/access.js +60 -0
  94. data/app/assets/bower_components/process_engine/jquery/src/core/init.js +123 -0
  95. data/app/assets/bower_components/process_engine/jquery/src/core/parseHTML.js +39 -0
  96. data/app/assets/bower_components/process_engine/jquery/src/core/ready.js +97 -0
  97. data/app/assets/bower_components/process_engine/jquery/src/core/var/rsingleTag.js +4 -0
  98. data/app/assets/bower_components/process_engine/jquery/src/core.js +497 -0
  99. data/app/assets/bower_components/process_engine/jquery/src/css/addGetHookIf.js +22 -0
  100. data/app/assets/bower_components/process_engine/jquery/src/css/curCSS.js +57 -0
  101. data/app/assets/bower_components/process_engine/jquery/src/css/defaultDisplay.js +70 -0
  102. data/app/assets/bower_components/process_engine/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  103. data/app/assets/bower_components/process_engine/jquery/src/css/support.js +96 -0
  104. data/app/assets/bower_components/process_engine/jquery/src/css/swap.js +28 -0
  105. data/app/assets/bower_components/process_engine/jquery/src/css/var/cssExpand.js +3 -0
  106. data/app/assets/bower_components/process_engine/jquery/src/css/var/getStyles.js +12 -0
  107. data/app/assets/bower_components/process_engine/jquery/src/css/var/isHidden.js +13 -0
  108. data/app/assets/bower_components/process_engine/jquery/src/css/var/rmargin.js +3 -0
  109. data/app/assets/bower_components/process_engine/jquery/src/css/var/rnumnonpx.js +5 -0
  110. data/app/assets/bower_components/process_engine/jquery/src/css.js +450 -0
  111. data/app/assets/bower_components/process_engine/jquery/src/data/Data.js +181 -0
  112. data/app/assets/bower_components/process_engine/jquery/src/data/accepts.js +20 -0
  113. data/app/assets/bower_components/process_engine/jquery/src/data/var/data_priv.js +5 -0
  114. data/app/assets/bower_components/process_engine/jquery/src/data/var/data_user.js +5 -0
  115. data/app/assets/bower_components/process_engine/jquery/src/data.js +178 -0
  116. data/app/assets/bower_components/process_engine/jquery/src/deferred.js +149 -0
  117. data/app/assets/bower_components/process_engine/jquery/src/deprecated.js +13 -0
  118. data/app/assets/bower_components/process_engine/jquery/src/dimensions.js +50 -0
  119. data/app/assets/bower_components/process_engine/jquery/src/effects/Tween.js +114 -0
  120. data/app/assets/bower_components/process_engine/jquery/src/effects/animatedSelector.js +13 -0
  121. data/app/assets/bower_components/process_engine/jquery/src/effects.js +648 -0
  122. data/app/assets/bower_components/process_engine/jquery/src/event/ajax.js +13 -0
  123. data/app/assets/bower_components/process_engine/jquery/src/event/alias.js +39 -0
  124. data/app/assets/bower_components/process_engine/jquery/src/event/support.js +9 -0
  125. data/app/assets/bower_components/process_engine/jquery/src/event.js +868 -0
  126. data/app/assets/bower_components/process_engine/jquery/src/exports/amd.js +24 -0
  127. data/app/assets/bower_components/process_engine/jquery/src/exports/global.js +32 -0
  128. data/app/assets/bower_components/process_engine/jquery/src/intro.js +44 -0
  129. data/app/assets/bower_components/process_engine/jquery/src/jquery.js +37 -0
  130. data/app/assets/bower_components/process_engine/jquery/src/manipulation/_evalUrl.js +18 -0
  131. data/app/assets/bower_components/process_engine/jquery/src/manipulation/support.js +32 -0
  132. data/app/assets/bower_components/process_engine/jquery/src/manipulation/var/rcheckableType.js +3 -0
  133. data/app/assets/bower_components/process_engine/jquery/src/manipulation.js +580 -0
  134. data/app/assets/bower_components/process_engine/jquery/src/offset.js +207 -0
  135. data/app/assets/bower_components/process_engine/jquery/src/outro.js +1 -0
  136. data/app/assets/bower_components/process_engine/jquery/src/queue/delay.js +22 -0
  137. data/app/assets/bower_components/process_engine/jquery/src/queue.js +142 -0
  138. data/app/assets/bower_components/process_engine/jquery/src/selector-native.js +172 -0
  139. data/app/assets/bower_components/process_engine/jquery/src/selector-sizzle.js +14 -0
  140. data/app/assets/bower_components/process_engine/jquery/src/selector.js +1 -0
  141. data/app/assets/bower_components/process_engine/jquery/src/serialize.js +111 -0
  142. data/app/assets/bower_components/process_engine/jquery/src/sizzle/dist/sizzle.js +2067 -0
  143. data/app/assets/bower_components/process_engine/jquery/src/sizzle/dist/sizzle.min.js +3 -0
  144. data/app/assets/bower_components/process_engine/jquery/src/sizzle/dist/sizzle.min.map +1 -0
  145. data/app/assets/bower_components/process_engine/jquery/src/traversing/findFilter.js +100 -0
  146. data/app/assets/bower_components/process_engine/jquery/src/traversing/var/rneedsContext.js +6 -0
  147. data/app/assets/bower_components/process_engine/jquery/src/traversing.js +199 -0
  148. data/app/assets/bower_components/process_engine/jquery/src/var/arr.js +3 -0
  149. data/app/assets/bower_components/process_engine/jquery/src/var/class2type.js +4 -0
  150. data/app/assets/bower_components/process_engine/jquery/src/var/concat.js +5 -0
  151. data/app/assets/bower_components/process_engine/jquery/src/var/hasOwn.js +5 -0
  152. data/app/assets/bower_components/process_engine/jquery/src/var/indexOf.js +5 -0
  153. data/app/assets/bower_components/process_engine/jquery/src/var/pnum.js +3 -0
  154. data/app/assets/bower_components/process_engine/jquery/src/var/push.js +5 -0
  155. data/app/assets/bower_components/process_engine/jquery/src/var/rnotwhite.js +3 -0
  156. data/app/assets/bower_components/process_engine/jquery/src/var/slice.js +5 -0
  157. data/app/assets/bower_components/process_engine/jquery/src/var/strundefined.js +3 -0
  158. data/app/assets/bower_components/process_engine/jquery/src/var/support.js +4 -0
  159. data/app/assets/bower_components/process_engine/jquery/src/var/toString.js +5 -0
  160. data/app/assets/bower_components/process_engine/jquery/src/wrap.js +79 -0
  161. data/app/assets/bower_components/process_engine/jquery-mousewheel/ChangeLog.md +141 -0
  162. data/app/assets/bower_components/process_engine/jquery-mousewheel/LICENSE.txt +20 -0
  163. data/app/assets/bower_components/process_engine/jquery-mousewheel/README.md +85 -0
  164. data/app/assets/bower_components/process_engine/jquery-mousewheel/bower.json +17 -0
  165. data/app/assets/bower_components/process_engine/jquery-mousewheel/jquery.mousewheel.js +221 -0
  166. data/app/assets/bower_components/process_engine/jquery-mousewheel/jquery.mousewheel.min.js +8 -0
  167. data/app/assets/bower_components/process_engine/lodash/LICENSE.txt +22 -0
  168. data/app/assets/bower_components/process_engine/lodash/bower.json +23 -0
  169. data/app/assets/bower_components/process_engine/lodash/dist/lodash.compat.js +7157 -0
  170. data/app/assets/bower_components/process_engine/lodash/dist/lodash.compat.min.js +61 -0
  171. data/app/assets/bower_components/process_engine/lodash/dist/lodash.js +6785 -0
  172. data/app/assets/bower_components/process_engine/lodash/dist/lodash.min.js +56 -0
  173. data/app/assets/bower_components/process_engine/lodash/dist/lodash.underscore.js +4979 -0
  174. data/app/assets/bower_components/process_engine/lodash/dist/lodash.underscore.min.js +39 -0
  175. data/app/assets/bower_components/process_engine/sax/AUTHORS +10 -0
  176. data/app/assets/bower_components/process_engine/sax/LICENSE +32 -0
  177. data/app/assets/bower_components/process_engine/sax/LICENSE-W3C.html +188 -0
  178. data/app/assets/bower_components/process_engine/sax/README.md +216 -0
  179. data/app/assets/bower_components/process_engine/sax/component.json +12 -0
  180. data/app/assets/bower_components/process_engine/sax/examples/big-not-pretty.xml +8002 -0
  181. data/app/assets/bower_components/process_engine/sax/examples/example.js +29 -0
  182. data/app/assets/bower_components/process_engine/sax/examples/get-products.js +58 -0
  183. data/app/assets/bower_components/process_engine/sax/examples/hello-world.js +4 -0
  184. data/app/assets/bower_components/process_engine/sax/examples/not-pretty.xml +8 -0
  185. data/app/assets/bower_components/process_engine/sax/examples/pretty-print.js +74 -0
  186. data/app/assets/bower_components/process_engine/sax/examples/shopping.xml +2 -0
  187. data/app/assets/bower_components/process_engine/sax/examples/strict.dtd +870 -0
  188. data/app/assets/bower_components/process_engine/sax/examples/test.html +15 -0
  189. data/app/assets/bower_components/process_engine/sax/examples/test.xml +1254 -0
  190. data/app/assets/bower_components/process_engine/sax/lib/sax.js +1410 -0
  191. data/app/assets/bower_components/process_engine/sax/package.json +12 -0
  192. data/app/assets/bower_components/process_engine/sax/test/attribute-name.js +33 -0
  193. data/app/assets/bower_components/process_engine/sax/test/attribute-no-space.js +75 -0
  194. data/app/assets/bower_components/process_engine/sax/test/buffer-overrun.js +26 -0
  195. data/app/assets/bower_components/process_engine/sax/test/case.js +50 -0
  196. data/app/assets/bower_components/process_engine/sax/test/cdata-chunked.js +11 -0
  197. data/app/assets/bower_components/process_engine/sax/test/cdata-end-split.js +15 -0
  198. data/app/assets/bower_components/process_engine/sax/test/cdata-fake-end.js +28 -0
  199. data/app/assets/bower_components/process_engine/sax/test/cdata-multiple.js +15 -0
  200. data/app/assets/bower_components/process_engine/sax/test/cdata.js +10 -0
  201. data/app/assets/bower_components/process_engine/sax/test/cyrillic.js +8 -0
  202. data/app/assets/bower_components/process_engine/sax/test/duplicate-attribute.js +13 -0
  203. data/app/assets/bower_components/process_engine/sax/test/emoji.js +12 -0
  204. data/app/assets/bower_components/process_engine/sax/test/end_empty_stream.js +5 -0
  205. data/app/assets/bower_components/process_engine/sax/test/entities.js +10 -0
  206. data/app/assets/bower_components/process_engine/sax/test/entity-mega.js +16 -0
  207. data/app/assets/bower_components/process_engine/sax/test/flush.js +13 -0
  208. data/app/assets/bower_components/process_engine/sax/test/index.js +86 -0
  209. data/app/assets/bower_components/process_engine/sax/test/issue-23.js +43 -0
  210. data/app/assets/bower_components/process_engine/sax/test/issue-30.js +24 -0
  211. data/app/assets/bower_components/process_engine/sax/test/issue-35.js +15 -0
  212. data/app/assets/bower_components/process_engine/sax/test/issue-47.js +12 -0
  213. data/app/assets/bower_components/process_engine/sax/test/issue-49.js +31 -0
  214. data/app/assets/bower_components/process_engine/sax/test/issue-84.js +13 -0
  215. data/app/assets/bower_components/process_engine/sax/test/parser-position.js +28 -0
  216. data/app/assets/bower_components/process_engine/sax/test/script-close-better.js +12 -0
  217. data/app/assets/bower_components/process_engine/sax/test/script.js +12 -0
  218. data/app/assets/bower_components/process_engine/sax/test/self-closing-child-strict.js +44 -0
  219. data/app/assets/bower_components/process_engine/sax/test/self-closing-child.js +44 -0
  220. data/app/assets/bower_components/process_engine/sax/test/self-closing-tag.js +25 -0
  221. data/app/assets/bower_components/process_engine/sax/test/stray-ending.js +17 -0
  222. data/app/assets/bower_components/process_engine/sax/test/trailing-attribute-no-value.js +10 -0
  223. data/app/assets/bower_components/process_engine/sax/test/trailing-non-whitespace.js +18 -0
  224. data/app/assets/bower_components/process_engine/sax/test/unclosed-root.js +11 -0
  225. data/app/assets/bower_components/process_engine/sax/test/unquoted.js +18 -0
  226. data/app/assets/bower_components/process_engine/sax/test/utf8-split.js +32 -0
  227. data/app/assets/bower_components/process_engine/sax/test/xmlns-as-tag-name.js +15 -0
  228. data/app/assets/bower_components/process_engine/sax/test/xmlns-issue-41.js +68 -0
  229. data/app/assets/bower_components/process_engine/sax/test/xmlns-rebinding.js +63 -0
  230. data/app/assets/bower_components/process_engine/sax/test/xmlns-strict.js +74 -0
  231. data/app/assets/bower_components/process_engine/sax/test/xmlns-unbound-element.js +33 -0
  232. data/app/assets/bower_components/process_engine/sax/test/xmlns-unbound.js +15 -0
  233. data/app/assets/bower_components/process_engine/sax/test/xmlns-xml-default-ns.js +31 -0
  234. data/app/assets/bower_components/process_engine/sax/test/xmlns-xml-default-prefix-attribute.js +36 -0
  235. data/app/assets/bower_components/process_engine/sax/test/xmlns-xml-default-prefix.js +21 -0
  236. data/app/assets/bower_components/process_engine/sax/test/xmlns-xml-default-redefine.js +41 -0
  237. data/app/assets/javascripts/process_engine/application.js +65 -0
  238. data/app/assets/stylesheets/process_engine/application.css +39 -0
  239. data/app/controllers/process_engine/application_controller.rb +28 -0
  240. data/app/controllers/process_engine/process_definitions_controller.rb +63 -0
  241. data/app/controllers/process_engine/process_instances_controller.rb +42 -0
  242. data/app/controllers/process_engine/process_tasks_controller.rb +23 -0
  243. data/app/helpers/process_engine/application_helper.rb +4 -0
  244. data/app/models/process_engine/consumer/consumer_task.rb +15 -0
  245. data/app/models/process_engine/error/false_task_state.rb +2 -0
  246. data/app/models/process_engine/listener/base.rb +49 -0
  247. data/app/models/process_engine/node_data_injection.rb +22 -0
  248. data/app/models/process_engine/parser/complex_gateway.rb +21 -0
  249. data/app/models/process_engine/parser/end_event.rb +23 -0
  250. data/app/models/process_engine/parser/exclusive_gateway.rb +25 -0
  251. data/app/models/process_engine/parser/extension/condition_expression.rb +39 -0
  252. data/app/models/process_engine/parser/extension/execution_listener.rb +15 -0
  253. data/app/models/process_engine/parser/extension/form_field.rb +50 -0
  254. data/app/models/process_engine/parser/extension/input_output.rb +28 -0
  255. data/app/models/process_engine/parser/extension/listener.rb +43 -0
  256. data/app/models/process_engine/parser/extension/property.rb +20 -0
  257. data/app/models/process_engine/parser/extension/task_listener.rb +15 -0
  258. data/app/models/process_engine/parser/extension/transitional_parameter.rb +53 -0
  259. data/app/models/process_engine/parser/inclusive_gateway.rb +25 -0
  260. data/app/models/process_engine/parser/parallel_gateway.rb +19 -0
  261. data/app/models/process_engine/parser/script_task.rb +37 -0
  262. data/app/models/process_engine/parser/sequence_flow.rb +36 -0
  263. data/app/models/process_engine/parser/start_event.rb +27 -0
  264. data/app/models/process_engine/parser/user_task.rb +36 -0
  265. data/app/models/process_engine/parser/xml_node.rb +125 -0
  266. data/app/models/process_engine/process_definition.rb +50 -0
  267. data/app/models/process_engine/process_instance.rb +72 -0
  268. data/app/models/process_engine/process_query.rb +52 -0
  269. data/app/models/process_engine/process_schema.rb +30 -0
  270. data/app/models/process_engine/process_task.rb +70 -0
  271. data/app/models/process_engine/schema/interceptor/exclusive_gateway.rb +39 -0
  272. data/app/models/process_engine/schema/node.rb +48 -0
  273. data/app/models/process_engine/schema/node_extension.rb +79 -0
  274. data/app/models/process_engine/schema/transition.rb +22 -0
  275. data/app/views/layouts/process_engine/application.html.erb +14 -0
  276. data/app/views/process_engine/layouts/_menu.html.haml +6 -0
  277. data/app/views/process_engine/layouts/application.html.haml +11 -0
  278. data/app/views/process_engine/process_definitions/_form.html.haml +6 -0
  279. data/app/views/process_engine/process_definitions/edit.html.haml +3 -0
  280. data/app/views/process_engine/process_definitions/index.html.haml +26 -0
  281. data/app/views/process_engine/process_definitions/new.html.haml +3 -0
  282. data/app/views/process_engine/process_definitions/show.html.haml +51 -0
  283. data/app/views/process_engine/process_instances/_form.html.haml +5 -0
  284. data/app/views/process_engine/process_instances/edit.html.haml +3 -0
  285. data/app/views/process_engine/process_instances/index.html.haml +29 -0
  286. data/app/views/process_engine/process_instances/show.html.haml +38 -0
  287. data/app/views/process_engine/process_tasks/index.html.haml +44 -0
  288. data/app/views/process_engine/share/_bpmn_canvas.html.haml +7 -0
  289. data/config/initializers/bower_rails.rb +16 -0
  290. data/config/initializers/simple_form.rb +166 -0
  291. data/config/initializers/simple_form_bootstrap.rb +135 -0
  292. data/config/locales/simple_form.en.yml +31 -0
  293. data/config/routes.rb +18 -0
  294. data/db/migrate/20150313063311_create_process_engine_process_definitions.rb +14 -0
  295. data/db/migrate/20150313063508_create_process_engine_process_instances.rb +15 -0
  296. data/db/migrate/20150313063633_create_process_engine_process_tasks.rb +30 -0
  297. data/lib/process_engine/engine.rb +12 -0
  298. data/lib/process_engine/version.rb +3 -0
  299. data/lib/process_engine.rb +8 -0
  300. data/lib/tasks/process_engine_tasks.rake +4 -0
  301. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  302. data/test/dummy/README.rdoc +28 -0
  303. data/test/dummy/Rakefile +6 -0
  304. data/test/dummy/app/assets/javascripts/application.js +13 -0
  305. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  306. data/test/dummy/app/controllers/application_controller.rb +5 -0
  307. data/test/dummy/app/helpers/application_helper.rb +2 -0
  308. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  309. data/test/dummy/bin/bundle +3 -0
  310. data/test/dummy/bin/rails +4 -0
  311. data/test/dummy/bin/rake +4 -0
  312. data/test/dummy/bin/setup +29 -0
  313. data/test/dummy/config/application.rb +26 -0
  314. data/test/dummy/config/boot.rb +5 -0
  315. data/test/dummy/config/database.yml +85 -0
  316. data/test/dummy/config/environment.rb +5 -0
  317. data/test/dummy/config/environments/development.rb +41 -0
  318. data/test/dummy/config/environments/production.rb +79 -0
  319. data/test/dummy/config/environments/test.rb +42 -0
  320. data/test/dummy/config/initializers/assets.rb +11 -0
  321. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  322. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  323. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  324. data/test/dummy/config/initializers/inflections.rb +16 -0
  325. data/test/dummy/config/initializers/mime_types.rb +4 -0
  326. data/test/dummy/config/initializers/session_store.rb +3 -0
  327. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  328. data/test/dummy/config/locales/en.yml +23 -0
  329. data/test/dummy/config/routes.rb +4 -0
  330. data/test/dummy/config/secrets.yml +22 -0
  331. data/test/dummy/config.ru +4 -0
  332. data/test/dummy/db/schema.rb +66 -0
  333. data/test/dummy/log/development.log +9722 -0
  334. data/test/dummy/public/404.html +67 -0
  335. data/test/dummy/public/422.html +67 -0
  336. data/test/dummy/public/500.html +66 -0
  337. data/test/dummy/public/favicon.ico +0 -0
  338. data/test/dummy/tmp/cache/assets/development/sass/8afee1847b645742b0d2535a7c32f4f22e7926ec/bootstrap.scssc +0 -0
  339. data/test/dummy/tmp/cache/assets/development/sass/b5911aa594334efca1023d6f01abce0758e9648a/bootstrap.scssc +0 -0
  340. data/test/dummy/tmp/cache/assets/development/sprockets/014d8413350c7d85a5429f5e2c9ac911 +0 -0
  341. data/test/dummy/tmp/cache/assets/development/sprockets/0cbd667d0fbf9e0e6f60b5ebf2f95fa3 +0 -0
  342. data/test/dummy/tmp/cache/assets/development/sprockets/0f7ba040a442530a6d4a5bc8307769c1 +0 -0
  343. data/test/dummy/tmp/cache/assets/development/sprockets/0fca2cc9aa38138660d8c7d492cf81e4 +0 -0
  344. data/test/dummy/tmp/cache/assets/development/sprockets/0ff24903c54f534941fbc96ff862e475 +0 -0
  345. data/test/dummy/tmp/cache/assets/development/sprockets/11100f87277a2892323fe5581af75a7b +0 -0
  346. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  347. data/test/dummy/tmp/cache/assets/development/sprockets/18a34084783e8b7f9bc871bc64b13eed +0 -0
  348. data/test/dummy/tmp/cache/assets/development/sprockets/1a3821ce28e0196075ed0830fcb45f38 +0 -0
  349. data/test/dummy/tmp/cache/assets/development/sprockets/1cf94b9a49ee68cb0f4065d48e9cbaf3 +0 -0
  350. data/test/dummy/tmp/cache/assets/development/sprockets/21a6373d6c40614fd05be57194c68248 +0 -0
  351. data/test/dummy/tmp/cache/assets/development/sprockets/26276ae8df51c046f3adc0b50a1521ba +0 -0
  352. data/test/dummy/tmp/cache/assets/development/sprockets/2eea4a8f4854d438cd03cb23a89b6d8c +0 -0
  353. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  354. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  355. data/test/dummy/tmp/cache/assets/development/sprockets/3993bcd8bae4771e550d8fc91d1debbc +0 -0
  356. data/test/dummy/tmp/cache/assets/development/sprockets/3ccc4edae36a9c4bd70fc330c9c83dc9 +0 -0
  357. data/test/dummy/tmp/cache/assets/development/sprockets/3e391b0f37505fffc40ba9ffa13330a2 +0 -0
  358. data/test/dummy/tmp/cache/assets/development/sprockets/42e258b77f5dd532dfb9344a2d766de6 +0 -0
  359. data/test/dummy/tmp/cache/assets/development/sprockets/43a5910cb7a330ece5856c0e9099efa2 +0 -0
  360. data/test/dummy/tmp/cache/assets/development/sprockets/4e65ec1149f01e749e1e372861210d4d +0 -0
  361. data/test/dummy/tmp/cache/assets/development/sprockets/501160bcee63ae68449a5a5eb78b6d41 +0 -0
  362. data/test/dummy/tmp/cache/assets/development/sprockets/517beb0bf366ec3c8649da9ac8a8a01e +0 -0
  363. data/test/dummy/tmp/cache/assets/development/sprockets/525a556b1eaacfa041722e1250d9859a +0 -0
  364. data/test/dummy/tmp/cache/assets/development/sprockets/56edbae38e4e0ff9f4b4fc576ae3d746 +0 -0
  365. data/test/dummy/tmp/cache/assets/development/sprockets/5b04f4a7058d92f88f89f2248bcc16b0 +0 -0
  366. data/test/dummy/tmp/cache/assets/development/sprockets/5c3c69f7c2520b57620931c150032d7e +0 -0
  367. data/test/dummy/tmp/cache/assets/development/sprockets/5d1f8f2111e14084ebf711412c9230d2 +0 -0
  368. data/test/dummy/tmp/cache/assets/development/sprockets/5f9833d6835900c56d0e76a1b2924cc2 +0 -0
  369. data/test/dummy/tmp/cache/assets/development/sprockets/67c653cc36eb639f7a7af5159e9f9de3 +0 -0
  370. data/test/dummy/tmp/cache/assets/development/sprockets/704b33432a5ba417bcd5962ad999c671 +0 -0
  371. data/test/dummy/tmp/cache/assets/development/sprockets/7301f83e8e67f30be13546a794a553ef +0 -0
  372. data/test/dummy/tmp/cache/assets/development/sprockets/7482c8f712712a79937caf41413bca15 +0 -0
  373. data/test/dummy/tmp/cache/assets/development/sprockets/761cb171e67ddca71e8b9c74f0220457 +0 -0
  374. data/test/dummy/tmp/cache/assets/development/sprockets/7e23bd4385e166267961b6d936363042 +0 -0
  375. data/test/dummy/tmp/cache/assets/development/sprockets/7e5100f290c9ba0d4c026e43b58d0d79 +0 -0
  376. data/test/dummy/tmp/cache/assets/development/sprockets/80743880e8d46958e9839ff9408c3113 +0 -0
  377. data/test/dummy/tmp/cache/assets/development/sprockets/8b8941aae968854bafb4638a86cad77b +0 -0
  378. data/test/dummy/tmp/cache/assets/development/sprockets/9c292f3b6b577a92970303c351e1d4a1 +0 -0
  379. data/test/dummy/tmp/cache/assets/development/sprockets/a3435b13cfa60fb7469a19703350bda7 +0 -0
  380. data/test/dummy/tmp/cache/assets/development/sprockets/a6ce1b2837383f1e8b62b7f1ddcc6820 +0 -0
  381. data/test/dummy/tmp/cache/assets/development/sprockets/a7e90acc68ba69b7cd5c0a7005467c4b +0 -0
  382. data/test/dummy/tmp/cache/assets/development/sprockets/be4d00fb7bf467b370f0fda7e453ec68 +0 -0
  383. data/test/dummy/tmp/cache/assets/development/sprockets/c4fbf44e63e40cbbf825fe750374728f +0 -0
  384. data/test/dummy/tmp/cache/assets/development/sprockets/c593bacb8d3f003125f91763a7b36b10 +0 -0
  385. data/test/dummy/tmp/cache/assets/development/sprockets/c5ae3bc69f7b1e1fdb51a667c9f3cdd6 +0 -0
  386. data/test/dummy/tmp/cache/assets/development/sprockets/cc843b336460771bf75c97cf0935301b +0 -0
  387. data/test/dummy/tmp/cache/assets/development/sprockets/ce3b6127737ed36f7b62a54acec06b3e +0 -0
  388. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  389. data/test/dummy/tmp/cache/assets/development/sprockets/d58931b13c55c146d21475e532b126ba +0 -0
  390. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  391. data/test/dummy/tmp/cache/assets/development/sprockets/dc6bbdc1e385c7bb2743011e9c2a7407 +0 -0
  392. data/test/dummy/tmp/cache/assets/development/sprockets/dd7270e11b484ae10f601e1dd014445a +0 -0
  393. data/test/dummy/tmp/cache/assets/development/sprockets/de86beefc60e0cd84dd1525af863e64d +0 -0
  394. data/test/dummy/tmp/cache/assets/development/sprockets/e0953e6e4a6c208e350f7f25d85bdce8 +0 -0
  395. data/test/dummy/tmp/cache/assets/development/sprockets/ec3b479833be43bf164a3deb119c3aee +0 -0
  396. data/test/dummy/tmp/cache/assets/development/sprockets/ef2cb0afc9a61a3d5819b4dfc84720ad +0 -0
  397. data/test/dummy/tmp/cache/assets/development/sprockets/f0511bbd6f6cd5530acddebb6d7e7044 +0 -0
  398. data/test/dummy/tmp/cache/assets/development/sprockets/f7009bba030498129042e0c542d4f264 +0 -0
  399. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  400. data/test/fixtures/process_engine/process_definitions.yml +17 -0
  401. data/test/fixtures/process_engine/process_instances.yml +11 -0
  402. data/test/fixtures/process_engine/process_tasks.yml +11 -0
  403. data/test/integration/navigation_test.rb +10 -0
  404. data/test/models/process_engine/process_definition_test.rb +9 -0
  405. data/test/models/process_engine/process_instance_test.rb +9 -0
  406. data/test/models/process_engine/process_task_test.rb +9 -0
  407. data/test/process_engine_test.rb +7 -0
  408. data/test/test_helper.rb +19 -0
  409. metadata +740 -0
@@ -0,0 +1,786 @@
1
+ define([
2
+ "./core",
3
+ "./var/rnotwhite",
4
+ "./ajax/var/nonce",
5
+ "./ajax/var/rquery",
6
+ "./core/init",
7
+ "./ajax/parseJSON",
8
+ "./ajax/parseXML",
9
+ "./deferred"
10
+ ], function( jQuery, rnotwhite, nonce, rquery ) {
11
+
12
+ var
13
+ rhash = /#.*$/,
14
+ rts = /([?&])_=[^&]*/,
15
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
16
+ // #7653, #8125, #8152: local protocol detection
17
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
18
+ rnoContent = /^(?:GET|HEAD)$/,
19
+ rprotocol = /^\/\//,
20
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
21
+
22
+ /* Prefilters
23
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
24
+ * 2) These are called:
25
+ * - BEFORE asking for a transport
26
+ * - AFTER param serialization (s.data is a string if s.processData is true)
27
+ * 3) key is the dataType
28
+ * 4) the catchall symbol "*" can be used
29
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
30
+ */
31
+ prefilters = {},
32
+
33
+ /* Transports bindings
34
+ * 1) key is the dataType
35
+ * 2) the catchall symbol "*" can be used
36
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
37
+ */
38
+ transports = {},
39
+
40
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
41
+ allTypes = "*/".concat( "*" ),
42
+
43
+ // Document location
44
+ ajaxLocation = window.location.href,
45
+
46
+ // Segment location into parts
47
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
48
+
49
+ // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
50
+ function addToPrefiltersOrTransports( structure ) {
51
+
52
+ // dataTypeExpression is optional and defaults to "*"
53
+ return function( dataTypeExpression, func ) {
54
+
55
+ if ( typeof dataTypeExpression !== "string" ) {
56
+ func = dataTypeExpression;
57
+ dataTypeExpression = "*";
58
+ }
59
+
60
+ var dataType,
61
+ i = 0,
62
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
63
+
64
+ if ( jQuery.isFunction( func ) ) {
65
+ // For each dataType in the dataTypeExpression
66
+ while ( (dataType = dataTypes[i++]) ) {
67
+ // Prepend if requested
68
+ if ( dataType[0] === "+" ) {
69
+ dataType = dataType.slice( 1 ) || "*";
70
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
71
+
72
+ // Otherwise append
73
+ } else {
74
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
75
+ }
76
+ }
77
+ }
78
+ };
79
+ }
80
+
81
+ // Base inspection function for prefilters and transports
82
+ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
83
+
84
+ var inspected = {},
85
+ seekingTransport = ( structure === transports );
86
+
87
+ function inspect( dataType ) {
88
+ var selected;
89
+ inspected[ dataType ] = true;
90
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
91
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
92
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
93
+ options.dataTypes.unshift( dataTypeOrTransport );
94
+ inspect( dataTypeOrTransport );
95
+ return false;
96
+ } else if ( seekingTransport ) {
97
+ return !( selected = dataTypeOrTransport );
98
+ }
99
+ });
100
+ return selected;
101
+ }
102
+
103
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
104
+ }
105
+
106
+ // A special extend for ajax options
107
+ // that takes "flat" options (not to be deep extended)
108
+ // Fixes #9887
109
+ function ajaxExtend( target, src ) {
110
+ var key, deep,
111
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
112
+
113
+ for ( key in src ) {
114
+ if ( src[ key ] !== undefined ) {
115
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
116
+ }
117
+ }
118
+ if ( deep ) {
119
+ jQuery.extend( true, target, deep );
120
+ }
121
+
122
+ return target;
123
+ }
124
+
125
+ /* Handles responses to an ajax request:
126
+ * - finds the right dataType (mediates between content-type and expected dataType)
127
+ * - returns the corresponding response
128
+ */
129
+ function ajaxHandleResponses( s, jqXHR, responses ) {
130
+
131
+ var ct, type, finalDataType, firstDataType,
132
+ contents = s.contents,
133
+ dataTypes = s.dataTypes;
134
+
135
+ // Remove auto dataType and get content-type in the process
136
+ while ( dataTypes[ 0 ] === "*" ) {
137
+ dataTypes.shift();
138
+ if ( ct === undefined ) {
139
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
140
+ }
141
+ }
142
+
143
+ // Check if we're dealing with a known content-type
144
+ if ( ct ) {
145
+ for ( type in contents ) {
146
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
147
+ dataTypes.unshift( type );
148
+ break;
149
+ }
150
+ }
151
+ }
152
+
153
+ // Check to see if we have a response for the expected dataType
154
+ if ( dataTypes[ 0 ] in responses ) {
155
+ finalDataType = dataTypes[ 0 ];
156
+ } else {
157
+ // Try convertible dataTypes
158
+ for ( type in responses ) {
159
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
160
+ finalDataType = type;
161
+ break;
162
+ }
163
+ if ( !firstDataType ) {
164
+ firstDataType = type;
165
+ }
166
+ }
167
+ // Or just use first one
168
+ finalDataType = finalDataType || firstDataType;
169
+ }
170
+
171
+ // If we found a dataType
172
+ // We add the dataType to the list if needed
173
+ // and return the corresponding response
174
+ if ( finalDataType ) {
175
+ if ( finalDataType !== dataTypes[ 0 ] ) {
176
+ dataTypes.unshift( finalDataType );
177
+ }
178
+ return responses[ finalDataType ];
179
+ }
180
+ }
181
+
182
+ /* Chain conversions given the request and the original response
183
+ * Also sets the responseXXX fields on the jqXHR instance
184
+ */
185
+ function ajaxConvert( s, response, jqXHR, isSuccess ) {
186
+ var conv2, current, conv, tmp, prev,
187
+ converters = {},
188
+ // Work with a copy of dataTypes in case we need to modify it for conversion
189
+ dataTypes = s.dataTypes.slice();
190
+
191
+ // Create converters map with lowercased keys
192
+ if ( dataTypes[ 1 ] ) {
193
+ for ( conv in s.converters ) {
194
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
195
+ }
196
+ }
197
+
198
+ current = dataTypes.shift();
199
+
200
+ // Convert to each sequential dataType
201
+ while ( current ) {
202
+
203
+ if ( s.responseFields[ current ] ) {
204
+ jqXHR[ s.responseFields[ current ] ] = response;
205
+ }
206
+
207
+ // Apply the dataFilter if provided
208
+ if ( !prev && isSuccess && s.dataFilter ) {
209
+ response = s.dataFilter( response, s.dataType );
210
+ }
211
+
212
+ prev = current;
213
+ current = dataTypes.shift();
214
+
215
+ if ( current ) {
216
+
217
+ // There's only work to do if current dataType is non-auto
218
+ if ( current === "*" ) {
219
+
220
+ current = prev;
221
+
222
+ // Convert response if prev dataType is non-auto and differs from current
223
+ } else if ( prev !== "*" && prev !== current ) {
224
+
225
+ // Seek a direct converter
226
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
227
+
228
+ // If none found, seek a pair
229
+ if ( !conv ) {
230
+ for ( conv2 in converters ) {
231
+
232
+ // If conv2 outputs current
233
+ tmp = conv2.split( " " );
234
+ if ( tmp[ 1 ] === current ) {
235
+
236
+ // If prev can be converted to accepted input
237
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
238
+ converters[ "* " + tmp[ 0 ] ];
239
+ if ( conv ) {
240
+ // Condense equivalence converters
241
+ if ( conv === true ) {
242
+ conv = converters[ conv2 ];
243
+
244
+ // Otherwise, insert the intermediate dataType
245
+ } else if ( converters[ conv2 ] !== true ) {
246
+ current = tmp[ 0 ];
247
+ dataTypes.unshift( tmp[ 1 ] );
248
+ }
249
+ break;
250
+ }
251
+ }
252
+ }
253
+ }
254
+
255
+ // Apply converter (if not an equivalence)
256
+ if ( conv !== true ) {
257
+
258
+ // Unless errors are allowed to bubble, catch and return them
259
+ if ( conv && s[ "throws" ] ) {
260
+ response = conv( response );
261
+ } else {
262
+ try {
263
+ response = conv( response );
264
+ } catch ( e ) {
265
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+
273
+ return { state: "success", data: response };
274
+ }
275
+
276
+ jQuery.extend({
277
+
278
+ // Counter for holding the number of active queries
279
+ active: 0,
280
+
281
+ // Last-Modified header cache for next request
282
+ lastModified: {},
283
+ etag: {},
284
+
285
+ ajaxSettings: {
286
+ url: ajaxLocation,
287
+ type: "GET",
288
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
289
+ global: true,
290
+ processData: true,
291
+ async: true,
292
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
293
+ /*
294
+ timeout: 0,
295
+ data: null,
296
+ dataType: null,
297
+ username: null,
298
+ password: null,
299
+ cache: null,
300
+ throws: false,
301
+ traditional: false,
302
+ headers: {},
303
+ */
304
+
305
+ accepts: {
306
+ "*": allTypes,
307
+ text: "text/plain",
308
+ html: "text/html",
309
+ xml: "application/xml, text/xml",
310
+ json: "application/json, text/javascript"
311
+ },
312
+
313
+ contents: {
314
+ xml: /xml/,
315
+ html: /html/,
316
+ json: /json/
317
+ },
318
+
319
+ responseFields: {
320
+ xml: "responseXML",
321
+ text: "responseText",
322
+ json: "responseJSON"
323
+ },
324
+
325
+ // Data converters
326
+ // Keys separate source (or catchall "*") and destination types with a single space
327
+ converters: {
328
+
329
+ // Convert anything to text
330
+ "* text": String,
331
+
332
+ // Text to html (true = no transformation)
333
+ "text html": true,
334
+
335
+ // Evaluate text as a json expression
336
+ "text json": jQuery.parseJSON,
337
+
338
+ // Parse text as xml
339
+ "text xml": jQuery.parseXML
340
+ },
341
+
342
+ // For options that shouldn't be deep extended:
343
+ // you can add your own custom options here if
344
+ // and when you create one that shouldn't be
345
+ // deep extended (see ajaxExtend)
346
+ flatOptions: {
347
+ url: true,
348
+ context: true
349
+ }
350
+ },
351
+
352
+ // Creates a full fledged settings object into target
353
+ // with both ajaxSettings and settings fields.
354
+ // If target is omitted, writes into ajaxSettings.
355
+ ajaxSetup: function( target, settings ) {
356
+ return settings ?
357
+
358
+ // Building a settings object
359
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
360
+
361
+ // Extending ajaxSettings
362
+ ajaxExtend( jQuery.ajaxSettings, target );
363
+ },
364
+
365
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
366
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
367
+
368
+ // Main method
369
+ ajax: function( url, options ) {
370
+
371
+ // If url is an object, simulate pre-1.5 signature
372
+ if ( typeof url === "object" ) {
373
+ options = url;
374
+ url = undefined;
375
+ }
376
+
377
+ // Force options to be an object
378
+ options = options || {};
379
+
380
+ var transport,
381
+ // URL without anti-cache param
382
+ cacheURL,
383
+ // Response headers
384
+ responseHeadersString,
385
+ responseHeaders,
386
+ // timeout handle
387
+ timeoutTimer,
388
+ // Cross-domain detection vars
389
+ parts,
390
+ // To know if global events are to be dispatched
391
+ fireGlobals,
392
+ // Loop variable
393
+ i,
394
+ // Create the final options object
395
+ s = jQuery.ajaxSetup( {}, options ),
396
+ // Callbacks context
397
+ callbackContext = s.context || s,
398
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
399
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
400
+ jQuery( callbackContext ) :
401
+ jQuery.event,
402
+ // Deferreds
403
+ deferred = jQuery.Deferred(),
404
+ completeDeferred = jQuery.Callbacks("once memory"),
405
+ // Status-dependent callbacks
406
+ statusCode = s.statusCode || {},
407
+ // Headers (they are sent all at once)
408
+ requestHeaders = {},
409
+ requestHeadersNames = {},
410
+ // The jqXHR state
411
+ state = 0,
412
+ // Default abort message
413
+ strAbort = "canceled",
414
+ // Fake xhr
415
+ jqXHR = {
416
+ readyState: 0,
417
+
418
+ // Builds headers hashtable if needed
419
+ getResponseHeader: function( key ) {
420
+ var match;
421
+ if ( state === 2 ) {
422
+ if ( !responseHeaders ) {
423
+ responseHeaders = {};
424
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
425
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
426
+ }
427
+ }
428
+ match = responseHeaders[ key.toLowerCase() ];
429
+ }
430
+ return match == null ? null : match;
431
+ },
432
+
433
+ // Raw string
434
+ getAllResponseHeaders: function() {
435
+ return state === 2 ? responseHeadersString : null;
436
+ },
437
+
438
+ // Caches the header
439
+ setRequestHeader: function( name, value ) {
440
+ var lname = name.toLowerCase();
441
+ if ( !state ) {
442
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
443
+ requestHeaders[ name ] = value;
444
+ }
445
+ return this;
446
+ },
447
+
448
+ // Overrides response content-type header
449
+ overrideMimeType: function( type ) {
450
+ if ( !state ) {
451
+ s.mimeType = type;
452
+ }
453
+ return this;
454
+ },
455
+
456
+ // Status-dependent callbacks
457
+ statusCode: function( map ) {
458
+ var code;
459
+ if ( map ) {
460
+ if ( state < 2 ) {
461
+ for ( code in map ) {
462
+ // Lazy-add the new callback in a way that preserves old ones
463
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
464
+ }
465
+ } else {
466
+ // Execute the appropriate callbacks
467
+ jqXHR.always( map[ jqXHR.status ] );
468
+ }
469
+ }
470
+ return this;
471
+ },
472
+
473
+ // Cancel the request
474
+ abort: function( statusText ) {
475
+ var finalText = statusText || strAbort;
476
+ if ( transport ) {
477
+ transport.abort( finalText );
478
+ }
479
+ done( 0, finalText );
480
+ return this;
481
+ }
482
+ };
483
+
484
+ // Attach deferreds
485
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
486
+ jqXHR.success = jqXHR.done;
487
+ jqXHR.error = jqXHR.fail;
488
+
489
+ // Remove hash character (#7531: and string promotion)
490
+ // Add protocol if not provided (prefilters might expect it)
491
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
492
+ // We also use the url parameter if available
493
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
494
+ .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
495
+
496
+ // Alias method option to type as per ticket #12004
497
+ s.type = options.method || options.type || s.method || s.type;
498
+
499
+ // Extract dataTypes list
500
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
501
+
502
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
503
+ if ( s.crossDomain == null ) {
504
+ parts = rurl.exec( s.url.toLowerCase() );
505
+ s.crossDomain = !!( parts &&
506
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
507
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
508
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
509
+ );
510
+ }
511
+
512
+ // Convert data if not already a string
513
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
514
+ s.data = jQuery.param( s.data, s.traditional );
515
+ }
516
+
517
+ // Apply prefilters
518
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
519
+
520
+ // If request was aborted inside a prefilter, stop there
521
+ if ( state === 2 ) {
522
+ return jqXHR;
523
+ }
524
+
525
+ // We can fire global events as of now if asked to
526
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
527
+ fireGlobals = jQuery.event && s.global;
528
+
529
+ // Watch for a new set of requests
530
+ if ( fireGlobals && jQuery.active++ === 0 ) {
531
+ jQuery.event.trigger("ajaxStart");
532
+ }
533
+
534
+ // Uppercase the type
535
+ s.type = s.type.toUpperCase();
536
+
537
+ // Determine if request has content
538
+ s.hasContent = !rnoContent.test( s.type );
539
+
540
+ // Save the URL in case we're toying with the If-Modified-Since
541
+ // and/or If-None-Match header later on
542
+ cacheURL = s.url;
543
+
544
+ // More options handling for requests with no content
545
+ if ( !s.hasContent ) {
546
+
547
+ // If data is available, append data to url
548
+ if ( s.data ) {
549
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
550
+ // #9682: remove data so that it's not used in an eventual retry
551
+ delete s.data;
552
+ }
553
+
554
+ // Add anti-cache in url if needed
555
+ if ( s.cache === false ) {
556
+ s.url = rts.test( cacheURL ) ?
557
+
558
+ // If there is already a '_' parameter, set its value
559
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
560
+
561
+ // Otherwise add one to the end
562
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
563
+ }
564
+ }
565
+
566
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
567
+ if ( s.ifModified ) {
568
+ if ( jQuery.lastModified[ cacheURL ] ) {
569
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
570
+ }
571
+ if ( jQuery.etag[ cacheURL ] ) {
572
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
573
+ }
574
+ }
575
+
576
+ // Set the correct header, if data is being sent
577
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
578
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
579
+ }
580
+
581
+ // Set the Accepts header for the server, depending on the dataType
582
+ jqXHR.setRequestHeader(
583
+ "Accept",
584
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
585
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
586
+ s.accepts[ "*" ]
587
+ );
588
+
589
+ // Check for headers option
590
+ for ( i in s.headers ) {
591
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
592
+ }
593
+
594
+ // Allow custom headers/mimetypes and early abort
595
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
596
+ // Abort if not done already and return
597
+ return jqXHR.abort();
598
+ }
599
+
600
+ // Aborting is no longer a cancellation
601
+ strAbort = "abort";
602
+
603
+ // Install callbacks on deferreds
604
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
605
+ jqXHR[ i ]( s[ i ] );
606
+ }
607
+
608
+ // Get transport
609
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
610
+
611
+ // If no transport, we auto-abort
612
+ if ( !transport ) {
613
+ done( -1, "No Transport" );
614
+ } else {
615
+ jqXHR.readyState = 1;
616
+
617
+ // Send global event
618
+ if ( fireGlobals ) {
619
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
620
+ }
621
+ // Timeout
622
+ if ( s.async && s.timeout > 0 ) {
623
+ timeoutTimer = setTimeout(function() {
624
+ jqXHR.abort("timeout");
625
+ }, s.timeout );
626
+ }
627
+
628
+ try {
629
+ state = 1;
630
+ transport.send( requestHeaders, done );
631
+ } catch ( e ) {
632
+ // Propagate exception as error if not done
633
+ if ( state < 2 ) {
634
+ done( -1, e );
635
+ // Simply rethrow otherwise
636
+ } else {
637
+ throw e;
638
+ }
639
+ }
640
+ }
641
+
642
+ // Callback for when everything is done
643
+ function done( status, nativeStatusText, responses, headers ) {
644
+ var isSuccess, success, error, response, modified,
645
+ statusText = nativeStatusText;
646
+
647
+ // Called once
648
+ if ( state === 2 ) {
649
+ return;
650
+ }
651
+
652
+ // State is "done" now
653
+ state = 2;
654
+
655
+ // Clear timeout if it exists
656
+ if ( timeoutTimer ) {
657
+ clearTimeout( timeoutTimer );
658
+ }
659
+
660
+ // Dereference transport for early garbage collection
661
+ // (no matter how long the jqXHR object will be used)
662
+ transport = undefined;
663
+
664
+ // Cache response headers
665
+ responseHeadersString = headers || "";
666
+
667
+ // Set readyState
668
+ jqXHR.readyState = status > 0 ? 4 : 0;
669
+
670
+ // Determine if successful
671
+ isSuccess = status >= 200 && status < 300 || status === 304;
672
+
673
+ // Get response data
674
+ if ( responses ) {
675
+ response = ajaxHandleResponses( s, jqXHR, responses );
676
+ }
677
+
678
+ // Convert no matter what (that way responseXXX fields are always set)
679
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
680
+
681
+ // If successful, handle type chaining
682
+ if ( isSuccess ) {
683
+
684
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
685
+ if ( s.ifModified ) {
686
+ modified = jqXHR.getResponseHeader("Last-Modified");
687
+ if ( modified ) {
688
+ jQuery.lastModified[ cacheURL ] = modified;
689
+ }
690
+ modified = jqXHR.getResponseHeader("etag");
691
+ if ( modified ) {
692
+ jQuery.etag[ cacheURL ] = modified;
693
+ }
694
+ }
695
+
696
+ // if no content
697
+ if ( status === 204 || s.type === "HEAD" ) {
698
+ statusText = "nocontent";
699
+
700
+ // if not modified
701
+ } else if ( status === 304 ) {
702
+ statusText = "notmodified";
703
+
704
+ // If we have data, let's convert it
705
+ } else {
706
+ statusText = response.state;
707
+ success = response.data;
708
+ error = response.error;
709
+ isSuccess = !error;
710
+ }
711
+ } else {
712
+ // Extract error from statusText and normalize for non-aborts
713
+ error = statusText;
714
+ if ( status || !statusText ) {
715
+ statusText = "error";
716
+ if ( status < 0 ) {
717
+ status = 0;
718
+ }
719
+ }
720
+ }
721
+
722
+ // Set data for the fake xhr object
723
+ jqXHR.status = status;
724
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
725
+
726
+ // Success/Error
727
+ if ( isSuccess ) {
728
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
729
+ } else {
730
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
731
+ }
732
+
733
+ // Status-dependent callbacks
734
+ jqXHR.statusCode( statusCode );
735
+ statusCode = undefined;
736
+
737
+ if ( fireGlobals ) {
738
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
739
+ [ jqXHR, s, isSuccess ? success : error ] );
740
+ }
741
+
742
+ // Complete
743
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
744
+
745
+ if ( fireGlobals ) {
746
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
747
+ // Handle the global AJAX counter
748
+ if ( !( --jQuery.active ) ) {
749
+ jQuery.event.trigger("ajaxStop");
750
+ }
751
+ }
752
+ }
753
+
754
+ return jqXHR;
755
+ },
756
+
757
+ getJSON: function( url, data, callback ) {
758
+ return jQuery.get( url, data, callback, "json" );
759
+ },
760
+
761
+ getScript: function( url, callback ) {
762
+ return jQuery.get( url, undefined, callback, "script" );
763
+ }
764
+ });
765
+
766
+ jQuery.each( [ "get", "post" ], function( i, method ) {
767
+ jQuery[ method ] = function( url, data, callback, type ) {
768
+ // Shift arguments if data argument was omitted
769
+ if ( jQuery.isFunction( data ) ) {
770
+ type = type || callback;
771
+ callback = data;
772
+ data = undefined;
773
+ }
774
+
775
+ return jQuery.ajax({
776
+ url: url,
777
+ type: method,
778
+ dataType: type,
779
+ data: data,
780
+ success: callback
781
+ });
782
+ };
783
+ });
784
+
785
+ return jQuery;
786
+ });