vapid 0.1.0

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 (433) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.gitmodules +6 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +133 -0
  6. data/.travis.yml +5 -0
  7. data/Gemfile +10 -0
  8. data/README.md +37 -0
  9. data/Rakefile +6 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/exe/vapid +7 -0
  13. data/lib/vapid.rb +24 -0
  14. data/lib/vapid/assets/javascripts/vapid/admin.coffee +2 -0
  15. data/lib/vapid/assets/stylesheets/vapid/admin.scss +72 -0
  16. data/lib/vapid/builder.rb +70 -0
  17. data/lib/vapid/cli.rb +96 -0
  18. data/lib/vapid/controllers/admin_controller.rb +282 -0
  19. data/lib/vapid/controllers/project_controller.rb +41 -0
  20. data/lib/vapid/db/migrate/20170202182310_create_groups.rb +12 -0
  21. data/lib/vapid/db/migrate/20170202183017_create_records.rb +11 -0
  22. data/lib/vapid/db/migrate/20170202185150_create_users.rb +11 -0
  23. data/lib/vapid/directive.rb +168 -0
  24. data/lib/vapid/directives.rb +30 -0
  25. data/lib/vapid/directives/audio.rb +27 -0
  26. data/lib/vapid/directives/group.rb +71 -0
  27. data/lib/vapid/directives/hide.rb +11 -0
  28. data/lib/vapid/directives/href.rb +11 -0
  29. data/lib/vapid/directives/image.rb +14 -0
  30. data/lib/vapid/directives/richtext.rb +15 -0
  31. data/lib/vapid/directives/show.rb +11 -0
  32. data/lib/vapid/directives/text.rb +24 -0
  33. data/lib/vapid/directives/video.rb +28 -0
  34. data/lib/vapid/generator_template/.gitignore +21 -0
  35. data/lib/vapid/generator_template/Gemfile.tt +13 -0
  36. data/lib/vapid/generator_template/README.md +0 -0
  37. data/lib/vapid/generator_template/assets/favicon.ico +0 -0
  38. data/lib/vapid/generator_template/assets/images/.keep +0 -0
  39. data/lib/vapid/generator_template/assets/javascripts/.keep +0 -0
  40. data/lib/vapid/generator_template/assets/stylesheets/.keep +0 -0
  41. data/lib/vapid/generator_template/assets/stylesheets/application.css +120 -0
  42. data/lib/vapid/generator_template/config.ru +3 -0
  43. data/lib/vapid/generator_template/config/database.yml +12 -0
  44. data/lib/vapid/generator_template/config/settings.yml.tt +11 -0
  45. data/lib/vapid/generator_template/templates/index.html.erb +25 -0
  46. data/lib/vapid/generator_template/templates/layouts/default.html.erb +22 -0
  47. data/lib/vapid/models.rb +18 -0
  48. data/lib/vapid/models/group.rb +36 -0
  49. data/lib/vapid/models/record.rb +30 -0
  50. data/lib/vapid/models/user.rb +16 -0
  51. data/lib/vapid/server.rb +93 -0
  52. data/lib/vapid/settings.rb +13 -0
  53. data/lib/vapid/template.rb +79 -0
  54. data/lib/vapid/template/node.rb +91 -0
  55. data/lib/vapid/template/parser.rb +50 -0
  56. data/lib/vapid/vendor/semantic-ui/.versions +4 -0
  57. data/lib/vapid/vendor/semantic-ui/LICENSE +22 -0
  58. data/lib/vapid/vendor/semantic-ui/README.md +7 -0
  59. data/lib/vapid/vendor/semantic-ui/components/accordion.css +252 -0
  60. data/lib/vapid/vendor/semantic-ui/components/accordion.js +610 -0
  61. data/lib/vapid/vendor/semantic-ui/components/accordion.min.css +9 -0
  62. data/lib/vapid/vendor/semantic-ui/components/accordion.min.js +10 -0
  63. data/lib/vapid/vendor/semantic-ui/components/ad.css +275 -0
  64. data/lib/vapid/vendor/semantic-ui/components/ad.min.css +10 -0
  65. data/lib/vapid/vendor/semantic-ui/components/api.js +1167 -0
  66. data/lib/vapid/vendor/semantic-ui/components/api.min.js +10 -0
  67. data/lib/vapid/vendor/semantic-ui/components/breadcrumb.css +124 -0
  68. data/lib/vapid/vendor/semantic-ui/components/breadcrumb.min.css +9 -0
  69. data/lib/vapid/vendor/semantic-ui/components/button.css +3450 -0
  70. data/lib/vapid/vendor/semantic-ui/components/button.min.css +9 -0
  71. data/lib/vapid/vendor/semantic-ui/components/card.css +964 -0
  72. data/lib/vapid/vendor/semantic-ui/components/card.min.css +9 -0
  73. data/lib/vapid/vendor/semantic-ui/components/checkbox.css +625 -0
  74. data/lib/vapid/vendor/semantic-ui/components/checkbox.js +831 -0
  75. data/lib/vapid/vendor/semantic-ui/components/checkbox.min.css +9 -0
  76. data/lib/vapid/vendor/semantic-ui/components/checkbox.min.js +10 -0
  77. data/lib/vapid/vendor/semantic-ui/components/colorize.js +274 -0
  78. data/lib/vapid/vendor/semantic-ui/components/colorize.min.js +11 -0
  79. data/lib/vapid/vendor/semantic-ui/components/comment.css +270 -0
  80. data/lib/vapid/vendor/semantic-ui/components/comment.min.css +9 -0
  81. data/lib/vapid/vendor/semantic-ui/components/container.css +147 -0
  82. data/lib/vapid/vendor/semantic-ui/components/container.min.css +9 -0
  83. data/lib/vapid/vendor/semantic-ui/components/dimmer.css +200 -0
  84. data/lib/vapid/vendor/semantic-ui/components/dimmer.js +708 -0
  85. data/lib/vapid/vendor/semantic-ui/components/dimmer.min.css +9 -0
  86. data/lib/vapid/vendor/semantic-ui/components/dimmer.min.js +10 -0
  87. data/lib/vapid/vendor/semantic-ui/components/divider.css +260 -0
  88. data/lib/vapid/vendor/semantic-ui/components/divider.min.css +9 -0
  89. data/lib/vapid/vendor/semantic-ui/components/dropdown.css +1442 -0
  90. data/lib/vapid/vendor/semantic-ui/components/dropdown.js +3767 -0
  91. data/lib/vapid/vendor/semantic-ui/components/dropdown.min.css +9 -0
  92. data/lib/vapid/vendor/semantic-ui/components/dropdown.min.js +11 -0
  93. data/lib/vapid/vendor/semantic-ui/components/embed.css +166 -0
  94. data/lib/vapid/vendor/semantic-ui/components/embed.js +696 -0
  95. data/lib/vapid/vendor/semantic-ui/components/embed.min.css +9 -0
  96. data/lib/vapid/vendor/semantic-ui/components/embed.min.js +10 -0
  97. data/lib/vapid/vendor/semantic-ui/components/feed.css +296 -0
  98. data/lib/vapid/vendor/semantic-ui/components/feed.min.css +9 -0
  99. data/lib/vapid/vendor/semantic-ui/components/flag.css +1031 -0
  100. data/lib/vapid/vendor/semantic-ui/components/flag.min.css +9 -0
  101. data/lib/vapid/vendor/semantic-ui/components/form.css +1067 -0
  102. data/lib/vapid/vendor/semantic-ui/components/form.js +1603 -0
  103. data/lib/vapid/vendor/semantic-ui/components/form.min.css +9 -0
  104. data/lib/vapid/vendor/semantic-ui/components/form.min.js +10 -0
  105. data/lib/vapid/vendor/semantic-ui/components/grid.css +2002 -0
  106. data/lib/vapid/vendor/semantic-ui/components/grid.min.css +9 -0
  107. data/lib/vapid/vendor/semantic-ui/components/header.css +721 -0
  108. data/lib/vapid/vendor/semantic-ui/components/header.min.css +9 -0
  109. data/lib/vapid/vendor/semantic-ui/components/icon.css +3292 -0
  110. data/lib/vapid/vendor/semantic-ui/components/icon.min.css +9 -0
  111. data/lib/vapid/vendor/semantic-ui/components/image.css +306 -0
  112. data/lib/vapid/vendor/semantic-ui/components/image.min.css +9 -0
  113. data/lib/vapid/vendor/semantic-ui/components/input.css +510 -0
  114. data/lib/vapid/vendor/semantic-ui/components/input.min.css +9 -0
  115. data/lib/vapid/vendor/semantic-ui/components/item.css +486 -0
  116. data/lib/vapid/vendor/semantic-ui/components/item.min.css +9 -0
  117. data/lib/vapid/vendor/semantic-ui/components/label.css +1307 -0
  118. data/lib/vapid/vendor/semantic-ui/components/label.min.css +9 -0
  119. data/lib/vapid/vendor/semantic-ui/components/list.css +951 -0
  120. data/lib/vapid/vendor/semantic-ui/components/list.min.css +9 -0
  121. data/lib/vapid/vendor/semantic-ui/components/loader.css +347 -0
  122. data/lib/vapid/vendor/semantic-ui/components/loader.min.css +9 -0
  123. data/lib/vapid/vendor/semantic-ui/components/menu.css +2002 -0
  124. data/lib/vapid/vendor/semantic-ui/components/menu.min.css +1 -0
  125. data/lib/vapid/vendor/semantic-ui/components/message.css +477 -0
  126. data/lib/vapid/vendor/semantic-ui/components/message.min.css +9 -0
  127. data/lib/vapid/vendor/semantic-ui/components/modal.css +502 -0
  128. data/lib/vapid/vendor/semantic-ui/components/modal.js +913 -0
  129. data/lib/vapid/vendor/semantic-ui/components/modal.min.css +9 -0
  130. data/lib/vapid/vendor/semantic-ui/components/modal.min.js +10 -0
  131. data/lib/vapid/vendor/semantic-ui/components/nag.css +147 -0
  132. data/lib/vapid/vendor/semantic-ui/components/nag.js +507 -0
  133. data/lib/vapid/vendor/semantic-ui/components/nag.min.css +9 -0
  134. data/lib/vapid/vendor/semantic-ui/components/nag.min.js +10 -0
  135. data/lib/vapid/vendor/semantic-ui/components/popup.css +733 -0
  136. data/lib/vapid/vendor/semantic-ui/components/popup.js +1475 -0
  137. data/lib/vapid/vendor/semantic-ui/components/popup.min.css +9 -0
  138. data/lib/vapid/vendor/semantic-ui/components/popup.min.js +10 -0
  139. data/lib/vapid/vendor/semantic-ui/components/progress.css +516 -0
  140. data/lib/vapid/vendor/semantic-ui/components/progress.js +931 -0
  141. data/lib/vapid/vendor/semantic-ui/components/progress.min.css +9 -0
  142. data/lib/vapid/vendor/semantic-ui/components/progress.min.js +10 -0
  143. data/lib/vapid/vendor/semantic-ui/components/rail.css +152 -0
  144. data/lib/vapid/vendor/semantic-ui/components/rail.min.css +9 -0
  145. data/lib/vapid/vendor/semantic-ui/components/rating.css +263 -0
  146. data/lib/vapid/vendor/semantic-ui/components/rating.js +508 -0
  147. data/lib/vapid/vendor/semantic-ui/components/rating.min.css +9 -0
  148. data/lib/vapid/vendor/semantic-ui/components/rating.min.js +10 -0
  149. data/lib/vapid/vendor/semantic-ui/components/reset.css +424 -0
  150. data/lib/vapid/vendor/semantic-ui/components/reset.min.css +9 -0
  151. data/lib/vapid/vendor/semantic-ui/components/reveal.css +284 -0
  152. data/lib/vapid/vendor/semantic-ui/components/reveal.min.css +9 -0
  153. data/lib/vapid/vendor/semantic-ui/components/search.css +408 -0
  154. data/lib/vapid/vendor/semantic-ui/components/search.js +1442 -0
  155. data/lib/vapid/vendor/semantic-ui/components/search.min.css +9 -0
  156. data/lib/vapid/vendor/semantic-ui/components/search.min.js +10 -0
  157. data/lib/vapid/vendor/semantic-ui/components/segment.css +798 -0
  158. data/lib/vapid/vendor/semantic-ui/components/segment.min.css +9 -0
  159. data/lib/vapid/vendor/semantic-ui/components/shape.css +157 -0
  160. data/lib/vapid/vendor/semantic-ui/components/shape.js +921 -0
  161. data/lib/vapid/vendor/semantic-ui/components/shape.min.css +9 -0
  162. data/lib/vapid/vendor/semantic-ui/components/shape.min.js +10 -0
  163. data/lib/vapid/vendor/semantic-ui/components/sidebar.css +634 -0
  164. data/lib/vapid/vendor/semantic-ui/components/sidebar.js +1036 -0
  165. data/lib/vapid/vendor/semantic-ui/components/sidebar.min.css +9 -0
  166. data/lib/vapid/vendor/semantic-ui/components/sidebar.min.js +10 -0
  167. data/lib/vapid/vendor/semantic-ui/components/site.css +160 -0
  168. data/lib/vapid/vendor/semantic-ui/components/site.js +487 -0
  169. data/lib/vapid/vendor/semantic-ui/components/site.min.css +9 -0
  170. data/lib/vapid/vendor/semantic-ui/components/site.min.js +10 -0
  171. data/lib/vapid/vendor/semantic-ui/components/state.js +708 -0
  172. data/lib/vapid/vendor/semantic-ui/components/state.min.js +10 -0
  173. data/lib/vapid/vendor/semantic-ui/components/statistic.css +569 -0
  174. data/lib/vapid/vendor/semantic-ui/components/statistic.min.css +9 -0
  175. data/lib/vapid/vendor/semantic-ui/components/step.css +623 -0
  176. data/lib/vapid/vendor/semantic-ui/components/step.min.css +9 -0
  177. data/lib/vapid/vendor/semantic-ui/components/sticky.css +78 -0
  178. data/lib/vapid/vendor/semantic-ui/components/sticky.js +942 -0
  179. data/lib/vapid/vendor/semantic-ui/components/sticky.min.css +9 -0
  180. data/lib/vapid/vendor/semantic-ui/components/sticky.min.js +10 -0
  181. data/lib/vapid/vendor/semantic-ui/components/tab.css +91 -0
  182. data/lib/vapid/vendor/semantic-ui/components/tab.js +952 -0
  183. data/lib/vapid/vendor/semantic-ui/components/tab.min.css +9 -0
  184. data/lib/vapid/vendor/semantic-ui/components/tab.min.js +10 -0
  185. data/lib/vapid/vendor/semantic-ui/components/table.css +1108 -0
  186. data/lib/vapid/vendor/semantic-ui/components/table.min.css +9 -0
  187. data/lib/vapid/vendor/semantic-ui/components/transition.css +1964 -0
  188. data/lib/vapid/vendor/semantic-ui/components/transition.js +1095 -0
  189. data/lib/vapid/vendor/semantic-ui/components/transition.min.css +9 -0
  190. data/lib/vapid/vendor/semantic-ui/components/transition.min.js +10 -0
  191. data/lib/vapid/vendor/semantic-ui/components/video.css +125 -0
  192. data/lib/vapid/vendor/semantic-ui/components/video.js +532 -0
  193. data/lib/vapid/vendor/semantic-ui/components/video.min.css +10 -0
  194. data/lib/vapid/vendor/semantic-ui/components/video.min.js +11 -0
  195. data/lib/vapid/vendor/semantic-ui/components/visibility.js +1288 -0
  196. data/lib/vapid/vendor/semantic-ui/components/visibility.min.js +10 -0
  197. data/lib/vapid/vendor/semantic-ui/components/visit.js +517 -0
  198. data/lib/vapid/vendor/semantic-ui/components/visit.min.js +11 -0
  199. data/lib/vapid/vendor/semantic-ui/package.js +34 -0
  200. data/lib/vapid/vendor/semantic-ui/package.json +20 -0
  201. data/lib/vapid/vendor/semantic-ui/semantic.css +36844 -0
  202. data/lib/vapid/vendor/semantic-ui/semantic.js +22617 -0
  203. data/lib/vapid/vendor/semantic-ui/semantic.min.css +364 -0
  204. data/lib/vapid/vendor/semantic-ui/semantic.min.js +19 -0
  205. data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.eot +0 -0
  206. data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.otf +0 -0
  207. data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.svg +2671 -0
  208. data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.ttf +0 -0
  209. data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.woff +0 -0
  210. data/lib/vapid/vendor/semantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
  211. data/lib/vapid/vendor/semantic-ui/themes/default/assets/images/flags.png +0 -0
  212. data/lib/vapid/vendor/trix/.blade.yml +45 -0
  213. data/lib/vapid/vendor/trix/.github/ISSUE_TEMPLATE.md +13 -0
  214. data/lib/vapid/vendor/trix/.gitignore +3 -0
  215. data/lib/vapid/vendor/trix/.ruby-version +1 -0
  216. data/lib/vapid/vendor/trix/.travis.yml +6 -0
  217. data/lib/vapid/vendor/trix/CONDUCT.md +79 -0
  218. data/lib/vapid/vendor/trix/Gemfile +17 -0
  219. data/lib/vapid/vendor/trix/Gemfile.lock +152 -0
  220. data/lib/vapid/vendor/trix/LICENSE +20 -0
  221. data/lib/vapid/vendor/trix/README.md +382 -0
  222. data/lib/vapid/vendor/trix/assets/index.html +55 -0
  223. data/lib/vapid/vendor/trix/assets/trix-core.coffee +2 -0
  224. data/lib/vapid/vendor/trix/assets/trix.coffee +3 -0
  225. data/lib/vapid/vendor/trix/assets/trix.scss +5 -0
  226. data/lib/vapid/vendor/trix/assets/trix/banner/index.coffee.erb +3 -0
  227. data/lib/vapid/vendor/trix/assets/trix/banner/index.scss.erb +3 -0
  228. data/lib/vapid/vendor/trix/assets/trix/banner/index.txt.erb +3 -0
  229. data/lib/vapid/vendor/trix/assets/trix/images/README.md +6 -0
  230. data/lib/vapid/vendor/trix/assets/trix/images/attach.svg +5 -0
  231. data/lib/vapid/vendor/trix/assets/trix/images/bold.svg +5 -0
  232. data/lib/vapid/vendor/trix/assets/trix/images/bullets.svg +5 -0
  233. data/lib/vapid/vendor/trix/assets/trix/images/code.svg +5 -0
  234. data/lib/vapid/vendor/trix/assets/trix/images/heading_1.svg +5 -0
  235. data/lib/vapid/vendor/trix/assets/trix/images/italic.svg +5 -0
  236. data/lib/vapid/vendor/trix/assets/trix/images/link.svg +6 -0
  237. data/lib/vapid/vendor/trix/assets/trix/images/nesting_level_decrease.svg +5 -0
  238. data/lib/vapid/vendor/trix/assets/trix/images/nesting_level_increase.svg +5 -0
  239. data/lib/vapid/vendor/trix/assets/trix/images/numbers.svg +5 -0
  240. data/lib/vapid/vendor/trix/assets/trix/images/quote.svg +5 -0
  241. data/lib/vapid/vendor/trix/assets/trix/images/redo.svg +5 -0
  242. data/lib/vapid/vendor/trix/assets/trix/images/remove.svg +4 -0
  243. data/lib/vapid/vendor/trix/assets/trix/images/strike.svg +6 -0
  244. data/lib/vapid/vendor/trix/assets/trix/images/trash.svg +5 -0
  245. data/lib/vapid/vendor/trix/assets/trix/images/undo.svg +5 -0
  246. data/lib/vapid/vendor/trix/assets/trix/stylesheets/attachments.scss +112 -0
  247. data/lib/vapid/vendor/trix/assets/trix/stylesheets/content.scss +88 -0
  248. data/lib/vapid/vendor/trix/assets/trix/stylesheets/editor.scss +8 -0
  249. data/lib/vapid/vendor/trix/assets/trix/stylesheets/icons.scss +14 -0
  250. data/lib/vapid/vendor/trix/assets/trix/stylesheets/media-queries.scss +7 -0
  251. data/lib/vapid/vendor/trix/assets/trix/stylesheets/toolbar.scss +194 -0
  252. data/lib/vapid/vendor/trix/bin/blade +16 -0
  253. data/lib/vapid/vendor/trix/bin/ci +21 -0
  254. data/lib/vapid/vendor/trix/bin/rackup +16 -0
  255. data/lib/vapid/vendor/trix/bin/rake +16 -0
  256. data/lib/vapid/vendor/trix/bin/release +139 -0
  257. data/lib/vapid/vendor/trix/bin/setup +69 -0
  258. data/lib/vapid/vendor/trix/bin/update-status-image +100 -0
  259. data/lib/vapid/vendor/trix/bower.json +34 -0
  260. data/lib/vapid/vendor/trix/config.ru +32 -0
  261. data/lib/vapid/vendor/trix/dist/trix-core.js +11 -0
  262. data/lib/vapid/vendor/trix/dist/trix.css +286 -0
  263. data/lib/vapid/vendor/trix/dist/trix.js +20 -0
  264. data/lib/vapid/vendor/trix/package.json +29 -0
  265. data/lib/vapid/vendor/trix/polyfills/polyfills.coffee +3 -0
  266. data/lib/vapid/vendor/trix/polyfills/set.coffee +24 -0
  267. data/lib/vapid/vendor/trix/polyfills/vendor/CustomElements.js +1029 -0
  268. data/lib/vapid/vendor/trix/polyfills/vendor/README.md +2 -0
  269. data/lib/vapid/vendor/trix/polyfills/vendor/promise.js +228 -0
  270. data/lib/vapid/vendor/trix/src/trix/VERSION +1 -0
  271. data/lib/vapid/vendor/trix/src/trix/config/block_attributes.coffee +37 -0
  272. data/lib/vapid/vendor/trix/src/trix/config/css.coffee +12 -0
  273. data/lib/vapid/vendor/trix/src/trix/config/file_size_formatting.coffee +22 -0
  274. data/lib/vapid/vendor/trix/src/trix/config/index.coffee +9 -0
  275. data/lib/vapid/vendor/trix/src/trix/config/lang.coffee +26 -0
  276. data/lib/vapid/vendor/trix/src/trix/config/selection_elements.coffee +26 -0
  277. data/lib/vapid/vendor/trix/src/trix/config/serialization.coffee +63 -0
  278. data/lib/vapid/vendor/trix/src/trix/config/text_attributes.coffee +25 -0
  279. data/lib/vapid/vendor/trix/src/trix/config/toolbar.coffee +41 -0
  280. data/lib/vapid/vendor/trix/src/trix/config/undo_interval.coffee +7 -0
  281. data/lib/vapid/vendor/trix/src/trix/controllers/attachment_editor_controller.coffee +104 -0
  282. data/lib/vapid/vendor/trix/src/trix/controllers/composition_controller.coffee +117 -0
  283. data/lib/vapid/vendor/trix/src/trix/controllers/controller.coffee +3 -0
  284. data/lib/vapid/vendor/trix/src/trix/controllers/editor_controller.coffee +369 -0
  285. data/lib/vapid/vendor/trix/src/trix/controllers/input/composition_input.coffee +57 -0
  286. data/lib/vapid/vendor/trix/src/trix/controllers/input_controller.coffee +473 -0
  287. data/lib/vapid/vendor/trix/src/trix/controllers/toolbar_controller.coffee +173 -0
  288. data/lib/vapid/vendor/trix/src/trix/core/basic_object.coffee +44 -0
  289. data/lib/vapid/vendor/trix/src/trix/core/collections/element_store.coffee +21 -0
  290. data/lib/vapid/vendor/trix/src/trix/core/collections/hash.coffee +98 -0
  291. data/lib/vapid/vendor/trix/src/trix/core/collections/index.coffee +4 -0
  292. data/lib/vapid/vendor/trix/src/trix/core/collections/object_group.coffee +37 -0
  293. data/lib/vapid/vendor/trix/src/trix/core/collections/object_map.coffee +10 -0
  294. data/lib/vapid/vendor/trix/src/trix/core/helpers/arrays.coffee +34 -0
  295. data/lib/vapid/vendor/trix/src/trix/core/helpers/config.coffee +23 -0
  296. data/lib/vapid/vendor/trix/src/trix/core/helpers/custom_elements.coffee +45 -0
  297. data/lib/vapid/vendor/trix/src/trix/core/helpers/dom.coffee +185 -0
  298. data/lib/vapid/vendor/trix/src/trix/core/helpers/extend.coffee +4 -0
  299. data/lib/vapid/vendor/trix/src/trix/core/helpers/functions.coffee +3 -0
  300. data/lib/vapid/vendor/trix/src/trix/core/helpers/global.coffee +23 -0
  301. data/lib/vapid/vendor/trix/src/trix/core/helpers/index.coffee +10 -0
  302. data/lib/vapid/vendor/trix/src/trix/core/helpers/objects.coffee +11 -0
  303. data/lib/vapid/vendor/trix/src/trix/core/helpers/ranges.coffee +33 -0
  304. data/lib/vapid/vendor/trix/src/trix/core/helpers/selection.coffee +25 -0
  305. data/lib/vapid/vendor/trix/src/trix/core/helpers/strings.coffee +46 -0
  306. data/lib/vapid/vendor/trix/src/trix/core/index.coffee +4 -0
  307. data/lib/vapid/vendor/trix/src/trix/core/object.coffee +33 -0
  308. data/lib/vapid/vendor/trix/src/trix/core/utilities/index.coffee +2 -0
  309. data/lib/vapid/vendor/trix/src/trix/core/utilities/operation.coffee +37 -0
  310. data/lib/vapid/vendor/trix/src/trix/core/utilities/utf16_string.coffee +93 -0
  311. data/lib/vapid/vendor/trix/src/trix/elements/trix_editor_element.coffee +166 -0
  312. data/lib/vapid/vendor/trix/src/trix/elements/trix_toolbar_element.coffee +28 -0
  313. data/lib/vapid/vendor/trix/src/trix/index.coffee.erb +14 -0
  314. data/lib/vapid/vendor/trix/src/trix/inspector/control_element.coffee +60 -0
  315. data/lib/vapid/vendor/trix/src/trix/inspector/debugger.coffee +104 -0
  316. data/lib/vapid/vendor/trix/src/trix/inspector/element.coffee +86 -0
  317. data/lib/vapid/vendor/trix/src/trix/inspector/index.coffee +17 -0
  318. data/lib/vapid/vendor/trix/src/trix/inspector/polyfills/vendor/details-element-polyfill.js +5 -0
  319. data/lib/vapid/vendor/trix/src/trix/inspector/templates/debug.jst.eco +17 -0
  320. data/lib/vapid/vendor/trix/src/trix/inspector/templates/document.jst.eco +33 -0
  321. data/lib/vapid/vendor/trix/src/trix/inspector/templates/performance.jst.eco +10 -0
  322. data/lib/vapid/vendor/trix/src/trix/inspector/templates/render.jst.eco +1 -0
  323. data/lib/vapid/vendor/trix/src/trix/inspector/templates/selection.jst.eco +5 -0
  324. data/lib/vapid/vendor/trix/src/trix/inspector/templates/undo.jst.eco +13 -0
  325. data/lib/vapid/vendor/trix/src/trix/inspector/view.coffee +58 -0
  326. data/lib/vapid/vendor/trix/src/trix/inspector/views/debug_view.coffee +33 -0
  327. data/lib/vapid/vendor/trix/src/trix/inspector/views/document_view.coffee +12 -0
  328. data/lib/vapid/vendor/trix/src/trix/inspector/views/performance_view.coffee +51 -0
  329. data/lib/vapid/vendor/trix/src/trix/inspector/views/render_view.coffee +21 -0
  330. data/lib/vapid/vendor/trix/src/trix/inspector/views/selection_view.coffee +33 -0
  331. data/lib/vapid/vendor/trix/src/trix/inspector/views/undo_view.coffee +12 -0
  332. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/deserializer.coffee +55 -0
  333. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/index.coffee +5 -0
  334. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player.coffee +60 -0
  335. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player_controller.coffee +43 -0
  336. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player_element.coffee +32 -0
  337. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/player_view.coffee +133 -0
  338. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/recorder.coffee +82 -0
  339. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/recording.coffee +54 -0
  340. data/lib/vapid/vendor/trix/src/trix/inspector/watchdog/serializer.coffee +61 -0
  341. data/lib/vapid/vendor/trix/src/trix/models/attachment.coffee +157 -0
  342. data/lib/vapid/vendor/trix/src/trix/models/attachment_manager.coffee +24 -0
  343. data/lib/vapid/vendor/trix/src/trix/models/attachment_piece.coffee +47 -0
  344. data/lib/vapid/vendor/trix/src/trix/models/block.coffee +230 -0
  345. data/lib/vapid/vendor/trix/src/trix/models/composition.coffee +521 -0
  346. data/lib/vapid/vendor/trix/src/trix/models/document.coffee +538 -0
  347. data/lib/vapid/vendor/trix/src/trix/models/editor.coffee +141 -0
  348. data/lib/vapid/vendor/trix/src/trix/models/html_parser.coffee +335 -0
  349. data/lib/vapid/vendor/trix/src/trix/models/line_break_insertion.coffee +31 -0
  350. data/lib/vapid/vendor/trix/src/trix/models/location_mapper.coffee +156 -0
  351. data/lib/vapid/vendor/trix/src/trix/models/managed_attachment.coffee +28 -0
  352. data/lib/vapid/vendor/trix/src/trix/models/piece.coffee +95 -0
  353. data/lib/vapid/vendor/trix/src/trix/models/point_mapper.coffee +28 -0
  354. data/lib/vapid/vendor/trix/src/trix/models/selection_manager.coffee +129 -0
  355. data/lib/vapid/vendor/trix/src/trix/models/splittable_list.coffee +168 -0
  356. data/lib/vapid/vendor/trix/src/trix/models/string_piece.coffee +49 -0
  357. data/lib/vapid/vendor/trix/src/trix/models/text.coffee +168 -0
  358. data/lib/vapid/vendor/trix/src/trix/models/undo_manager.coffee +40 -0
  359. data/lib/vapid/vendor/trix/src/trix/observers/mutation_observer.coffee +131 -0
  360. data/lib/vapid/vendor/trix/src/trix/observers/selection_change_observer.coffee +56 -0
  361. data/lib/vapid/vendor/trix/src/trix/operations/file_verification_operation.coffee +15 -0
  362. data/lib/vapid/vendor/trix/src/trix/operations/image_preload_operation.coffee +15 -0
  363. data/lib/vapid/vendor/trix/src/trix/views/attachment_view.coffee +99 -0
  364. data/lib/vapid/vendor/trix/src/trix/views/block_view.coffee +37 -0
  365. data/lib/vapid/vendor/trix/src/trix/views/document_view.coffee +68 -0
  366. data/lib/vapid/vendor/trix/src/trix/views/object_group_view.coffee +23 -0
  367. data/lib/vapid/vendor/trix/src/trix/views/object_view.coffee +86 -0
  368. data/lib/vapid/vendor/trix/src/trix/views/piece_view.coffee +97 -0
  369. data/lib/vapid/vendor/trix/src/trix/views/previewable_attachment_view.coffee +49 -0
  370. data/lib/vapid/vendor/trix/src/trix/views/text_view.coffee +30 -0
  371. data/lib/vapid/vendor/trix/test/.gitignore +1 -0
  372. data/lib/vapid/vendor/trix/test/src/system/attachment_test.coffee +70 -0
  373. data/lib/vapid/vendor/trix/test/src/system/basic_input_test.coffee +68 -0
  374. data/lib/vapid/vendor/trix/test/src/system/block_formatting_test.coffee +602 -0
  375. data/lib/vapid/vendor/trix/test/src/system/caching_test.coffee +21 -0
  376. data/lib/vapid/vendor/trix/test/src/system/composition_input_test.coffee +138 -0
  377. data/lib/vapid/vendor/trix/test/src/system/cursor_movement_test.coffee +54 -0
  378. data/lib/vapid/vendor/trix/test/src/system/custom_element_test.coffee +314 -0
  379. data/lib/vapid/vendor/trix/test/src/system/html_loading_test.coffee +62 -0
  380. data/lib/vapid/vendor/trix/test/src/system/html_replacement_test.coffee +101 -0
  381. data/lib/vapid/vendor/trix/test/src/system/installation_process_test.coffee +59 -0
  382. data/lib/vapid/vendor/trix/test/src/system/list_formatting_test.coffee +70 -0
  383. data/lib/vapid/vendor/trix/test/src/system/mutation_input_test.coffee +73 -0
  384. data/lib/vapid/vendor/trix/test/src/system/pasting_test.coffee +215 -0
  385. data/lib/vapid/vendor/trix/test/src/system/text_formatting_test.coffee +151 -0
  386. data/lib/vapid/vendor/trix/test/src/system/undo_test.coffee +48 -0
  387. data/lib/vapid/vendor/trix/test/src/test.coffee +16 -0
  388. data/lib/vapid/vendor/trix/test/src/test_helpers/assertions.coffee +38 -0
  389. data/lib/vapid/vendor/trix/test/src/test_helpers/editor_helpers.coffee +37 -0
  390. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_empty.jst.eco +1 -0
  391. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_html.jst.eco +2 -0
  392. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_in_table.jst.eco +7 -0
  393. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_block_styles.jst.eco +6 -0
  394. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_bold_styles.jst.eco +7 -0
  395. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_image.jst.eco +2 -0
  396. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_styled_content.jst.eco +7 -0
  397. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/editor_with_toolbar_and_input.jst.eco +5 -0
  398. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/fixtures.coffee +536 -0
  399. data/lib/vapid/vendor/trix/test/src/test_helpers/fixtures/logo.png +0 -0
  400. data/lib/vapid/vendor/trix/test/src/test_helpers/index.coffee +18 -0
  401. data/lib/vapid/vendor/trix/test/src/test_helpers/input_helpers.coffee +183 -0
  402. data/lib/vapid/vendor/trix/test/src/test_helpers/selection_helpers.coffee +91 -0
  403. data/lib/vapid/vendor/trix/test/src/test_helpers/test_helpers.coffee +72 -0
  404. data/lib/vapid/vendor/trix/test/src/test_helpers/test_stubs.coffee +31 -0
  405. data/lib/vapid/vendor/trix/test/src/test_helpers/toolbar_helpers.coffee +45 -0
  406. data/lib/vapid/vendor/trix/test/src/unit/attachment_test.coffee +23 -0
  407. data/lib/vapid/vendor/trix/test/src/unit/block_test.coffee +22 -0
  408. data/lib/vapid/vendor/trix/test/src/unit/composition_test.coffee +13 -0
  409. data/lib/vapid/vendor/trix/test/src/unit/document_test.coffee +11 -0
  410. data/lib/vapid/vendor/trix/test/src/unit/document_view_test.coffee +6 -0
  411. data/lib/vapid/vendor/trix/test/src/unit/html_parser_test.coffee +162 -0
  412. data/lib/vapid/vendor/trix/test/src/unit/location_mapper_test.coffee +185 -0
  413. data/lib/vapid/vendor/trix/test/src/unit/mutation_observer_test.coffee +84 -0
  414. data/lib/vapid/vendor/trix/test/src/unit/serialization_test.coffee +7 -0
  415. data/lib/vapid/vendor/trix/test/src/unit/string_change_summary_test.coffee +57 -0
  416. data/lib/vapid/vendor/trix/test/src/unit/text_test.coffee +19 -0
  417. data/lib/vapid/vendor/trix/test/vendor/rangy-core.js +3845 -0
  418. data/lib/vapid/vendor/trix/test/vendor/rangy-textrange.js +1930 -0
  419. data/lib/vapid/version.rb +4 -0
  420. data/lib/vapid/views/admin/install.html.erb +19 -0
  421. data/lib/vapid/views/admin/login.html.erb +11 -0
  422. data/lib/vapid/views/admin/overview/index.html.erb +1 -0
  423. data/lib/vapid/views/admin/records/_form.erb +9 -0
  424. data/lib/vapid/views/admin/records/edit.html.erb +5 -0
  425. data/lib/vapid/views/admin/records/index.html.erb +38 -0
  426. data/lib/vapid/views/admin/records/new.html.erb +3 -0
  427. data/lib/vapid/views/errors/404.html.erb +1 -0
  428. data/lib/vapid/views/errors/500.html.erb +1 -0
  429. data/lib/vapid/views/layouts/admin.html.erb +41 -0
  430. data/lib/vapid/views/layouts/admin_form.html.erb +22 -0
  431. data/lib/vapid/views/layouts/error.html.erb +11 -0
  432. data/vapid.gemspec +48 -0
  433. metadata +811 -0
@@ -0,0 +1,1095 @@
1
+ /*!
2
+ * # Semantic UI 2.2.9 - Transition
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Released under the MIT license
7
+ * http://opensource.org/licenses/MIT
8
+ *
9
+ */
10
+
11
+ ;(function ($, window, document, undefined) {
12
+
13
+ "use strict";
14
+
15
+ window = (typeof window != 'undefined' && window.Math == Math)
16
+ ? window
17
+ : (typeof self != 'undefined' && self.Math == Math)
18
+ ? self
19
+ : Function('return this')()
20
+ ;
21
+
22
+ $.fn.transition = function() {
23
+ var
24
+ $allModules = $(this),
25
+ moduleSelector = $allModules.selector || '',
26
+
27
+ time = new Date().getTime(),
28
+ performance = [],
29
+
30
+ moduleArguments = arguments,
31
+ query = moduleArguments[0],
32
+ queryArguments = [].slice.call(arguments, 1),
33
+ methodInvoked = (typeof query === 'string'),
34
+
35
+ requestAnimationFrame = window.requestAnimationFrame
36
+ || window.mozRequestAnimationFrame
37
+ || window.webkitRequestAnimationFrame
38
+ || window.msRequestAnimationFrame
39
+ || function(callback) { setTimeout(callback, 0); },
40
+
41
+ returnedValue
42
+ ;
43
+ $allModules
44
+ .each(function(index) {
45
+ var
46
+ $module = $(this),
47
+ element = this,
48
+
49
+ // set at run time
50
+ settings,
51
+ instance,
52
+
53
+ error,
54
+ className,
55
+ metadata,
56
+ animationEnd,
57
+ animationName,
58
+
59
+ namespace,
60
+ moduleNamespace,
61
+ eventNamespace,
62
+ module
63
+ ;
64
+
65
+ module = {
66
+
67
+ initialize: function() {
68
+
69
+ // get full settings
70
+ settings = module.get.settings.apply(element, moduleArguments);
71
+
72
+ // shorthand
73
+ className = settings.className;
74
+ error = settings.error;
75
+ metadata = settings.metadata;
76
+
77
+ // define namespace
78
+ eventNamespace = '.' + settings.namespace;
79
+ moduleNamespace = 'module-' + settings.namespace;
80
+ instance = $module.data(moduleNamespace) || module;
81
+
82
+ // get vendor specific events
83
+ animationEnd = module.get.animationEndEvent();
84
+
85
+ if(methodInvoked) {
86
+ methodInvoked = module.invoke(query);
87
+ }
88
+
89
+ // method not invoked, lets run an animation
90
+ if(methodInvoked === false) {
91
+ module.verbose('Converted arguments into settings object', settings);
92
+ if(settings.interval) {
93
+ module.delay(settings.animate);
94
+ }
95
+ else {
96
+ module.animate();
97
+ }
98
+ module.instantiate();
99
+ }
100
+ },
101
+
102
+ instantiate: function() {
103
+ module.verbose('Storing instance of module', module);
104
+ instance = module;
105
+ $module
106
+ .data(moduleNamespace, instance)
107
+ ;
108
+ },
109
+
110
+ destroy: function() {
111
+ module.verbose('Destroying previous module for', element);
112
+ $module
113
+ .removeData(moduleNamespace)
114
+ ;
115
+ },
116
+
117
+ refresh: function() {
118
+ module.verbose('Refreshing display type on next animation');
119
+ delete module.displayType;
120
+ },
121
+
122
+ forceRepaint: function() {
123
+ module.verbose('Forcing element repaint');
124
+ var
125
+ $parentElement = $module.parent(),
126
+ $nextElement = $module.next()
127
+ ;
128
+ if($nextElement.length === 0) {
129
+ $module.detach().appendTo($parentElement);
130
+ }
131
+ else {
132
+ $module.detach().insertBefore($nextElement);
133
+ }
134
+ },
135
+
136
+ repaint: function() {
137
+ module.verbose('Repainting element');
138
+ var
139
+ fakeAssignment = element.offsetWidth
140
+ ;
141
+ },
142
+
143
+ delay: function(interval) {
144
+ var
145
+ direction = module.get.animationDirection(),
146
+ shouldReverse,
147
+ delay
148
+ ;
149
+ if(!direction) {
150
+ direction = module.can.transition()
151
+ ? module.get.direction()
152
+ : 'static'
153
+ ;
154
+ }
155
+ interval = (interval !== undefined)
156
+ ? interval
157
+ : settings.interval
158
+ ;
159
+ shouldReverse = (settings.reverse == 'auto' && direction == className.outward);
160
+ delay = (shouldReverse || settings.reverse == true)
161
+ ? ($allModules.length - index) * settings.interval
162
+ : index * settings.interval
163
+ ;
164
+ module.debug('Delaying animation by', delay);
165
+ setTimeout(module.animate, delay);
166
+ },
167
+
168
+ animate: function(overrideSettings) {
169
+ settings = overrideSettings || settings;
170
+ if(!module.is.supported()) {
171
+ module.error(error.support);
172
+ return false;
173
+ }
174
+ module.debug('Preparing animation', settings.animation);
175
+ if(module.is.animating()) {
176
+ if(settings.queue) {
177
+ if(!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
178
+ module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
179
+ }
180
+ else {
181
+ module.queue(settings.animation);
182
+ }
183
+ return false;
184
+ }
185
+ else if(!settings.allowRepeats && module.is.occurring()) {
186
+ module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
187
+ return false;
188
+ }
189
+ else {
190
+ module.debug('New animation started, completing previous early', settings.animation);
191
+ instance.complete();
192
+ }
193
+ }
194
+ if( module.can.animate() ) {
195
+ module.set.animating(settings.animation);
196
+ }
197
+ else {
198
+ module.error(error.noAnimation, settings.animation, element);
199
+ }
200
+ },
201
+
202
+ reset: function() {
203
+ module.debug('Resetting animation to beginning conditions');
204
+ module.remove.animationCallbacks();
205
+ module.restore.conditions();
206
+ module.remove.animating();
207
+ },
208
+
209
+ queue: function(animation) {
210
+ module.debug('Queueing animation of', animation);
211
+ module.queuing = true;
212
+ $module
213
+ .one(animationEnd + '.queue' + eventNamespace, function() {
214
+ module.queuing = false;
215
+ module.repaint();
216
+ module.animate.apply(this, settings);
217
+ })
218
+ ;
219
+ },
220
+
221
+ complete: function (event) {
222
+ module.debug('Animation complete', settings.animation);
223
+ module.remove.completeCallback();
224
+ module.remove.failSafe();
225
+ if(!module.is.looping()) {
226
+ if( module.is.outward() ) {
227
+ module.verbose('Animation is outward, hiding element');
228
+ module.restore.conditions();
229
+ module.hide();
230
+ }
231
+ else if( module.is.inward() ) {
232
+ module.verbose('Animation is outward, showing element');
233
+ module.restore.conditions();
234
+ module.show();
235
+ }
236
+ else {
237
+ module.verbose('Static animation completed');
238
+ module.restore.conditions();
239
+ settings.onComplete.call(element);
240
+ }
241
+ }
242
+ },
243
+
244
+ force: {
245
+ visible: function() {
246
+ var
247
+ style = $module.attr('style'),
248
+ userStyle = module.get.userStyle(),
249
+ displayType = module.get.displayType(),
250
+ overrideStyle = userStyle + 'display: ' + displayType + ' !important;',
251
+ currentDisplay = $module.css('display'),
252
+ emptyStyle = (style === undefined || style === '')
253
+ ;
254
+ if(currentDisplay !== displayType) {
255
+ module.verbose('Overriding default display to show element', displayType);
256
+ $module
257
+ .attr('style', overrideStyle)
258
+ ;
259
+ }
260
+ else if(emptyStyle) {
261
+ $module.removeAttr('style');
262
+ }
263
+ },
264
+ hidden: function() {
265
+ var
266
+ style = $module.attr('style'),
267
+ currentDisplay = $module.css('display'),
268
+ emptyStyle = (style === undefined || style === '')
269
+ ;
270
+ if(currentDisplay !== 'none' && !module.is.hidden()) {
271
+ module.verbose('Overriding default display to hide element');
272
+ $module
273
+ .css('display', 'none')
274
+ ;
275
+ }
276
+ else if(emptyStyle) {
277
+ $module
278
+ .removeAttr('style')
279
+ ;
280
+ }
281
+ }
282
+ },
283
+
284
+ has: {
285
+ direction: function(animation) {
286
+ var
287
+ hasDirection = false
288
+ ;
289
+ animation = animation || settings.animation;
290
+ if(typeof animation === 'string') {
291
+ animation = animation.split(' ');
292
+ $.each(animation, function(index, word){
293
+ if(word === className.inward || word === className.outward) {
294
+ hasDirection = true;
295
+ }
296
+ });
297
+ }
298
+ return hasDirection;
299
+ },
300
+ inlineDisplay: function() {
301
+ var
302
+ style = $module.attr('style') || ''
303
+ ;
304
+ return $.isArray(style.match(/display.*?;/, ''));
305
+ }
306
+ },
307
+
308
+ set: {
309
+ animating: function(animation) {
310
+ var
311
+ animationClass,
312
+ direction
313
+ ;
314
+ // remove previous callbacks
315
+ module.remove.completeCallback();
316
+
317
+ // determine exact animation
318
+ animation = animation || settings.animation;
319
+ animationClass = module.get.animationClass(animation);
320
+
321
+ // save animation class in cache to restore class names
322
+ module.save.animation(animationClass);
323
+
324
+ // override display if necessary so animation appears visibly
325
+ module.force.visible();
326
+
327
+ module.remove.hidden();
328
+ module.remove.direction();
329
+
330
+ module.start.animation(animationClass);
331
+
332
+ },
333
+ duration: function(animationName, duration) {
334
+ duration = duration || settings.duration;
335
+ duration = (typeof duration == 'number')
336
+ ? duration + 'ms'
337
+ : duration
338
+ ;
339
+ if(duration || duration === 0) {
340
+ module.verbose('Setting animation duration', duration);
341
+ $module
342
+ .css({
343
+ 'animation-duration': duration
344
+ })
345
+ ;
346
+ }
347
+ },
348
+ direction: function(direction) {
349
+ direction = direction || module.get.direction();
350
+ if(direction == className.inward) {
351
+ module.set.inward();
352
+ }
353
+ else {
354
+ module.set.outward();
355
+ }
356
+ },
357
+ looping: function() {
358
+ module.debug('Transition set to loop');
359
+ $module
360
+ .addClass(className.looping)
361
+ ;
362
+ },
363
+ hidden: function() {
364
+ $module
365
+ .addClass(className.transition)
366
+ .addClass(className.hidden)
367
+ ;
368
+ },
369
+ inward: function() {
370
+ module.debug('Setting direction to inward');
371
+ $module
372
+ .removeClass(className.outward)
373
+ .addClass(className.inward)
374
+ ;
375
+ },
376
+ outward: function() {
377
+ module.debug('Setting direction to outward');
378
+ $module
379
+ .removeClass(className.inward)
380
+ .addClass(className.outward)
381
+ ;
382
+ },
383
+ visible: function() {
384
+ $module
385
+ .addClass(className.transition)
386
+ .addClass(className.visible)
387
+ ;
388
+ }
389
+ },
390
+
391
+ start: {
392
+ animation: function(animationClass) {
393
+ animationClass = animationClass || module.get.animationClass();
394
+ module.debug('Starting tween', animationClass);
395
+ $module
396
+ .addClass(animationClass)
397
+ .one(animationEnd + '.complete' + eventNamespace, module.complete)
398
+ ;
399
+ if(settings.useFailSafe) {
400
+ module.add.failSafe();
401
+ }
402
+ module.set.duration(settings.duration);
403
+ settings.onStart.call(element);
404
+ }
405
+ },
406
+
407
+ save: {
408
+ animation: function(animation) {
409
+ if(!module.cache) {
410
+ module.cache = {};
411
+ }
412
+ module.cache.animation = animation;
413
+ },
414
+ displayType: function(displayType) {
415
+ if(displayType !== 'none') {
416
+ $module.data(metadata.displayType, displayType);
417
+ }
418
+ },
419
+ transitionExists: function(animation, exists) {
420
+ $.fn.transition.exists[animation] = exists;
421
+ module.verbose('Saving existence of transition', animation, exists);
422
+ }
423
+ },
424
+
425
+ restore: {
426
+ conditions: function() {
427
+ var
428
+ animation = module.get.currentAnimation()
429
+ ;
430
+ if(animation) {
431
+ $module
432
+ .removeClass(animation)
433
+ ;
434
+ module.verbose('Removing animation class', module.cache);
435
+ }
436
+ module.remove.duration();
437
+ }
438
+ },
439
+
440
+ add: {
441
+ failSafe: function() {
442
+ var
443
+ duration = module.get.duration()
444
+ ;
445
+ module.timer = setTimeout(function() {
446
+ $module.triggerHandler(animationEnd);
447
+ }, duration + settings.failSafeDelay);
448
+ module.verbose('Adding fail safe timer', module.timer);
449
+ }
450
+ },
451
+
452
+ remove: {
453
+ animating: function() {
454
+ $module.removeClass(className.animating);
455
+ },
456
+ animationCallbacks: function() {
457
+ module.remove.queueCallback();
458
+ module.remove.completeCallback();
459
+ },
460
+ queueCallback: function() {
461
+ $module.off('.queue' + eventNamespace);
462
+ },
463
+ completeCallback: function() {
464
+ $module.off('.complete' + eventNamespace);
465
+ },
466
+ display: function() {
467
+ $module.css('display', '');
468
+ },
469
+ direction: function() {
470
+ $module
471
+ .removeClass(className.inward)
472
+ .removeClass(className.outward)
473
+ ;
474
+ },
475
+ duration: function() {
476
+ $module
477
+ .css('animation-duration', '')
478
+ ;
479
+ },
480
+ failSafe: function() {
481
+ module.verbose('Removing fail safe timer', module.timer);
482
+ if(module.timer) {
483
+ clearTimeout(module.timer);
484
+ }
485
+ },
486
+ hidden: function() {
487
+ $module.removeClass(className.hidden);
488
+ },
489
+ visible: function() {
490
+ $module.removeClass(className.visible);
491
+ },
492
+ looping: function() {
493
+ module.debug('Transitions are no longer looping');
494
+ if( module.is.looping() ) {
495
+ module.reset();
496
+ $module
497
+ .removeClass(className.looping)
498
+ ;
499
+ }
500
+ },
501
+ transition: function() {
502
+ $module
503
+ .removeClass(className.visible)
504
+ .removeClass(className.hidden)
505
+ ;
506
+ }
507
+ },
508
+ get: {
509
+ settings: function(animation, duration, onComplete) {
510
+ // single settings object
511
+ if(typeof animation == 'object') {
512
+ return $.extend(true, {}, $.fn.transition.settings, animation);
513
+ }
514
+ // all arguments provided
515
+ else if(typeof onComplete == 'function') {
516
+ return $.extend({}, $.fn.transition.settings, {
517
+ animation : animation,
518
+ onComplete : onComplete,
519
+ duration : duration
520
+ });
521
+ }
522
+ // only duration provided
523
+ else if(typeof duration == 'string' || typeof duration == 'number') {
524
+ return $.extend({}, $.fn.transition.settings, {
525
+ animation : animation,
526
+ duration : duration
527
+ });
528
+ }
529
+ // duration is actually settings object
530
+ else if(typeof duration == 'object') {
531
+ return $.extend({}, $.fn.transition.settings, duration, {
532
+ animation : animation
533
+ });
534
+ }
535
+ // duration is actually callback
536
+ else if(typeof duration == 'function') {
537
+ return $.extend({}, $.fn.transition.settings, {
538
+ animation : animation,
539
+ onComplete : duration
540
+ });
541
+ }
542
+ // only animation provided
543
+ else {
544
+ return $.extend({}, $.fn.transition.settings, {
545
+ animation : animation
546
+ });
547
+ }
548
+ },
549
+ animationClass: function(animation) {
550
+ var
551
+ animationClass = animation || settings.animation,
552
+ directionClass = (module.can.transition() && !module.has.direction())
553
+ ? module.get.direction() + ' '
554
+ : ''
555
+ ;
556
+ return className.animating + ' '
557
+ + className.transition + ' '
558
+ + directionClass
559
+ + animationClass
560
+ ;
561
+ },
562
+ currentAnimation: function() {
563
+ return (module.cache && module.cache.animation !== undefined)
564
+ ? module.cache.animation
565
+ : false
566
+ ;
567
+ },
568
+ currentDirection: function() {
569
+ return module.is.inward()
570
+ ? className.inward
571
+ : className.outward
572
+ ;
573
+ },
574
+ direction: function() {
575
+ return module.is.hidden() || !module.is.visible()
576
+ ? className.inward
577
+ : className.outward
578
+ ;
579
+ },
580
+ animationDirection: function(animation) {
581
+ var
582
+ direction
583
+ ;
584
+ animation = animation || settings.animation;
585
+ if(typeof animation === 'string') {
586
+ animation = animation.split(' ');
587
+ // search animation name for out/in class
588
+ $.each(animation, function(index, word){
589
+ if(word === className.inward) {
590
+ direction = className.inward;
591
+ }
592
+ else if(word === className.outward) {
593
+ direction = className.outward;
594
+ }
595
+ });
596
+ }
597
+ // return found direction
598
+ if(direction) {
599
+ return direction;
600
+ }
601
+ return false;
602
+ },
603
+ duration: function(duration) {
604
+ duration = duration || settings.duration;
605
+ if(duration === false) {
606
+ duration = $module.css('animation-duration') || 0;
607
+ }
608
+ return (typeof duration === 'string')
609
+ ? (duration.indexOf('ms') > -1)
610
+ ? parseFloat(duration)
611
+ : parseFloat(duration) * 1000
612
+ : duration
613
+ ;
614
+ },
615
+ displayType: function(shouldDetermine) {
616
+ shouldDetermine = (shouldDetermine !== undefined)
617
+ ? shouldDetermine
618
+ : true
619
+ ;
620
+ if(settings.displayType) {
621
+ return settings.displayType;
622
+ }
623
+ if(shouldDetermine && $module.data(metadata.displayType) === undefined) {
624
+ // create fake element to determine display state
625
+ module.can.transition(true);
626
+ }
627
+ return $module.data(metadata.displayType);
628
+ },
629
+ userStyle: function(style) {
630
+ style = style || $module.attr('style') || '';
631
+ return style.replace(/display.*?;/, '');
632
+ },
633
+ transitionExists: function(animation) {
634
+ return $.fn.transition.exists[animation];
635
+ },
636
+ animationStartEvent: function() {
637
+ var
638
+ element = document.createElement('div'),
639
+ animations = {
640
+ 'animation' :'animationstart',
641
+ 'OAnimation' :'oAnimationStart',
642
+ 'MozAnimation' :'mozAnimationStart',
643
+ 'WebkitAnimation' :'webkitAnimationStart'
644
+ },
645
+ animation
646
+ ;
647
+ for(animation in animations){
648
+ if( element.style[animation] !== undefined ){
649
+ return animations[animation];
650
+ }
651
+ }
652
+ return false;
653
+ },
654
+ animationEndEvent: function() {
655
+ var
656
+ element = document.createElement('div'),
657
+ animations = {
658
+ 'animation' :'animationend',
659
+ 'OAnimation' :'oAnimationEnd',
660
+ 'MozAnimation' :'mozAnimationEnd',
661
+ 'WebkitAnimation' :'webkitAnimationEnd'
662
+ },
663
+ animation
664
+ ;
665
+ for(animation in animations){
666
+ if( element.style[animation] !== undefined ){
667
+ return animations[animation];
668
+ }
669
+ }
670
+ return false;
671
+ }
672
+
673
+ },
674
+
675
+ can: {
676
+ transition: function(forced) {
677
+ var
678
+ animation = settings.animation,
679
+ transitionExists = module.get.transitionExists(animation),
680
+ displayType = module.get.displayType(false),
681
+ elementClass,
682
+ tagName,
683
+ $clone,
684
+ currentAnimation,
685
+ inAnimation,
686
+ directionExists
687
+ ;
688
+ if( transitionExists === undefined || forced) {
689
+ module.verbose('Determining whether animation exists');
690
+ elementClass = $module.attr('class');
691
+ tagName = $module.prop('tagName');
692
+
693
+ $clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
694
+ currentAnimation = $clone
695
+ .addClass(animation)
696
+ .removeClass(className.inward)
697
+ .removeClass(className.outward)
698
+ .addClass(className.animating)
699
+ .addClass(className.transition)
700
+ .css('animationName')
701
+ ;
702
+ inAnimation = $clone
703
+ .addClass(className.inward)
704
+ .css('animationName')
705
+ ;
706
+ if(!displayType) {
707
+ displayType = $clone
708
+ .attr('class', elementClass)
709
+ .removeAttr('style')
710
+ .removeClass(className.hidden)
711
+ .removeClass(className.visible)
712
+ .show()
713
+ .css('display')
714
+ ;
715
+ module.verbose('Determining final display state', displayType);
716
+ module.save.displayType(displayType);
717
+ }
718
+
719
+ $clone.remove();
720
+ if(currentAnimation != inAnimation) {
721
+ module.debug('Direction exists for animation', animation);
722
+ directionExists = true;
723
+ }
724
+ else if(currentAnimation == 'none' || !currentAnimation) {
725
+ module.debug('No animation defined in css', animation);
726
+ return;
727
+ }
728
+ else {
729
+ module.debug('Static animation found', animation, displayType);
730
+ directionExists = false;
731
+ }
732
+ module.save.transitionExists(animation, directionExists);
733
+ }
734
+ return (transitionExists !== undefined)
735
+ ? transitionExists
736
+ : directionExists
737
+ ;
738
+ },
739
+ animate: function() {
740
+ // can transition does not return a value if animation does not exist
741
+ return (module.can.transition() !== undefined);
742
+ }
743
+ },
744
+
745
+ is: {
746
+ animating: function() {
747
+ return $module.hasClass(className.animating);
748
+ },
749
+ inward: function() {
750
+ return $module.hasClass(className.inward);
751
+ },
752
+ outward: function() {
753
+ return $module.hasClass(className.outward);
754
+ },
755
+ looping: function() {
756
+ return $module.hasClass(className.looping);
757
+ },
758
+ occurring: function(animation) {
759
+ animation = animation || settings.animation;
760
+ animation = '.' + animation.replace(' ', '.');
761
+ return ( $module.filter(animation).length > 0 );
762
+ },
763
+ visible: function() {
764
+ return $module.is(':visible');
765
+ },
766
+ hidden: function() {
767
+ return $module.css('visibility') === 'hidden';
768
+ },
769
+ supported: function() {
770
+ return(animationEnd !== false);
771
+ }
772
+ },
773
+
774
+ hide: function() {
775
+ module.verbose('Hiding element');
776
+ if( module.is.animating() ) {
777
+ module.reset();
778
+ }
779
+ element.blur(); // IE will trigger focus change if element is not blurred before hiding
780
+ module.remove.display();
781
+ module.remove.visible();
782
+ module.set.hidden();
783
+ module.force.hidden();
784
+ settings.onHide.call(element);
785
+ settings.onComplete.call(element);
786
+ // module.repaint();
787
+ },
788
+
789
+ show: function(display) {
790
+ module.verbose('Showing element', display);
791
+ module.remove.hidden();
792
+ module.set.visible();
793
+ module.force.visible();
794
+ settings.onShow.call(element);
795
+ settings.onComplete.call(element);
796
+ // module.repaint();
797
+ },
798
+
799
+ toggle: function() {
800
+ if( module.is.visible() ) {
801
+ module.hide();
802
+ }
803
+ else {
804
+ module.show();
805
+ }
806
+ },
807
+
808
+ stop: function() {
809
+ module.debug('Stopping current animation');
810
+ $module.triggerHandler(animationEnd);
811
+ },
812
+
813
+ stopAll: function() {
814
+ module.debug('Stopping all animation');
815
+ module.remove.queueCallback();
816
+ $module.triggerHandler(animationEnd);
817
+ },
818
+
819
+ clear: {
820
+ queue: function() {
821
+ module.debug('Clearing animation queue');
822
+ module.remove.queueCallback();
823
+ }
824
+ },
825
+
826
+ enable: function() {
827
+ module.verbose('Starting animation');
828
+ $module.removeClass(className.disabled);
829
+ },
830
+
831
+ disable: function() {
832
+ module.debug('Stopping animation');
833
+ $module.addClass(className.disabled);
834
+ },
835
+
836
+ setting: function(name, value) {
837
+ module.debug('Changing setting', name, value);
838
+ if( $.isPlainObject(name) ) {
839
+ $.extend(true, settings, name);
840
+ }
841
+ else if(value !== undefined) {
842
+ if($.isPlainObject(settings[name])) {
843
+ $.extend(true, settings[name], value);
844
+ }
845
+ else {
846
+ settings[name] = value;
847
+ }
848
+ }
849
+ else {
850
+ return settings[name];
851
+ }
852
+ },
853
+ internal: function(name, value) {
854
+ if( $.isPlainObject(name) ) {
855
+ $.extend(true, module, name);
856
+ }
857
+ else if(value !== undefined) {
858
+ module[name] = value;
859
+ }
860
+ else {
861
+ return module[name];
862
+ }
863
+ },
864
+ debug: function() {
865
+ if(!settings.silent && settings.debug) {
866
+ if(settings.performance) {
867
+ module.performance.log(arguments);
868
+ }
869
+ else {
870
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
871
+ module.debug.apply(console, arguments);
872
+ }
873
+ }
874
+ },
875
+ verbose: function() {
876
+ if(!settings.silent && settings.verbose && settings.debug) {
877
+ if(settings.performance) {
878
+ module.performance.log(arguments);
879
+ }
880
+ else {
881
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
882
+ module.verbose.apply(console, arguments);
883
+ }
884
+ }
885
+ },
886
+ error: function() {
887
+ if(!settings.silent) {
888
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
889
+ module.error.apply(console, arguments);
890
+ }
891
+ },
892
+ performance: {
893
+ log: function(message) {
894
+ var
895
+ currentTime,
896
+ executionTime,
897
+ previousTime
898
+ ;
899
+ if(settings.performance) {
900
+ currentTime = new Date().getTime();
901
+ previousTime = time || currentTime;
902
+ executionTime = currentTime - previousTime;
903
+ time = currentTime;
904
+ performance.push({
905
+ 'Name' : message[0],
906
+ 'Arguments' : [].slice.call(message, 1) || '',
907
+ 'Element' : element,
908
+ 'Execution Time' : executionTime
909
+ });
910
+ }
911
+ clearTimeout(module.performance.timer);
912
+ module.performance.timer = setTimeout(module.performance.display, 500);
913
+ },
914
+ display: function() {
915
+ var
916
+ title = settings.name + ':',
917
+ totalTime = 0
918
+ ;
919
+ time = false;
920
+ clearTimeout(module.performance.timer);
921
+ $.each(performance, function(index, data) {
922
+ totalTime += data['Execution Time'];
923
+ });
924
+ title += ' ' + totalTime + 'ms';
925
+ if(moduleSelector) {
926
+ title += ' \'' + moduleSelector + '\'';
927
+ }
928
+ if($allModules.length > 1) {
929
+ title += ' ' + '(' + $allModules.length + ')';
930
+ }
931
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
932
+ console.groupCollapsed(title);
933
+ if(console.table) {
934
+ console.table(performance);
935
+ }
936
+ else {
937
+ $.each(performance, function(index, data) {
938
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
939
+ });
940
+ }
941
+ console.groupEnd();
942
+ }
943
+ performance = [];
944
+ }
945
+ },
946
+ // modified for transition to return invoke success
947
+ invoke: function(query, passedArguments, context) {
948
+ var
949
+ object = instance,
950
+ maxDepth,
951
+ found,
952
+ response
953
+ ;
954
+ passedArguments = passedArguments || queryArguments;
955
+ context = element || context;
956
+ if(typeof query == 'string' && object !== undefined) {
957
+ query = query.split(/[\. ]/);
958
+ maxDepth = query.length - 1;
959
+ $.each(query, function(depth, value) {
960
+ var camelCaseValue = (depth != maxDepth)
961
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
962
+ : query
963
+ ;
964
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
965
+ object = object[camelCaseValue];
966
+ }
967
+ else if( object[camelCaseValue] !== undefined ) {
968
+ found = object[camelCaseValue];
969
+ return false;
970
+ }
971
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
972
+ object = object[value];
973
+ }
974
+ else if( object[value] !== undefined ) {
975
+ found = object[value];
976
+ return false;
977
+ }
978
+ else {
979
+ return false;
980
+ }
981
+ });
982
+ }
983
+ if ( $.isFunction( found ) ) {
984
+ response = found.apply(context, passedArguments);
985
+ }
986
+ else if(found !== undefined) {
987
+ response = found;
988
+ }
989
+
990
+ if($.isArray(returnedValue)) {
991
+ returnedValue.push(response);
992
+ }
993
+ else if(returnedValue !== undefined) {
994
+ returnedValue = [returnedValue, response];
995
+ }
996
+ else if(response !== undefined) {
997
+ returnedValue = response;
998
+ }
999
+ return (found !== undefined)
1000
+ ? found
1001
+ : false
1002
+ ;
1003
+ }
1004
+ };
1005
+ module.initialize();
1006
+ })
1007
+ ;
1008
+ return (returnedValue !== undefined)
1009
+ ? returnedValue
1010
+ : this
1011
+ ;
1012
+ };
1013
+
1014
+ // Records if CSS transition is available
1015
+ $.fn.transition.exists = {};
1016
+
1017
+ $.fn.transition.settings = {
1018
+
1019
+ // module info
1020
+ name : 'Transition',
1021
+
1022
+ // hide all output from this component regardless of other settings
1023
+ silent : false,
1024
+
1025
+ // debug content outputted to console
1026
+ debug : false,
1027
+
1028
+ // verbose debug output
1029
+ verbose : false,
1030
+
1031
+ // performance data output
1032
+ performance : true,
1033
+
1034
+ // event namespace
1035
+ namespace : 'transition',
1036
+
1037
+ // delay between animations in group
1038
+ interval : 0,
1039
+
1040
+ // whether group animations should be reversed
1041
+ reverse : 'auto',
1042
+
1043
+ // animation callback event
1044
+ onStart : function() {},
1045
+ onComplete : function() {},
1046
+ onShow : function() {},
1047
+ onHide : function() {},
1048
+
1049
+ // whether timeout should be used to ensure callback fires in cases animationend does not
1050
+ useFailSafe : true,
1051
+
1052
+ // delay in ms for fail safe
1053
+ failSafeDelay : 100,
1054
+
1055
+ // whether EXACT animation can occur twice in a row
1056
+ allowRepeats : false,
1057
+
1058
+ // Override final display type on visible
1059
+ displayType : false,
1060
+
1061
+ // animation duration
1062
+ animation : 'fade',
1063
+ duration : false,
1064
+
1065
+ // new animations will occur after previous ones
1066
+ queue : true,
1067
+
1068
+ metadata : {
1069
+ displayType: 'display'
1070
+ },
1071
+
1072
+ className : {
1073
+ animating : 'animating',
1074
+ disabled : 'disabled',
1075
+ hidden : 'hidden',
1076
+ inward : 'in',
1077
+ loading : 'loading',
1078
+ looping : 'looping',
1079
+ outward : 'out',
1080
+ transition : 'transition',
1081
+ visible : 'visible'
1082
+ },
1083
+
1084
+ // possible errors
1085
+ error: {
1086
+ noAnimation : 'Element is no longer attached to DOM. Unable to animate. Use silent setting to surpress this warning in production.',
1087
+ repeated : 'That animation is already occurring, cancelling repeated animation',
1088
+ method : 'The method you called is not defined',
1089
+ support : 'This browser does not support CSS animations'
1090
+ }
1091
+
1092
+ };
1093
+
1094
+
1095
+ })( jQuery, window, document );