stylish 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (458) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -10
  3. data/ARCHITECTURE.md +96 -0
  4. data/Gemfile +8 -0
  5. data/README.md +25 -29
  6. data/Rakefile +24 -0
  7. data/bin/stylish +33 -0
  8. data/lib/stylish.rb +36 -1
  9. data/lib/stylish/configuration.rb +37 -0
  10. data/lib/stylish/core_ext.rb +20 -0
  11. data/lib/stylish/developer.rb +13 -0
  12. data/lib/stylish/developer/config.rb +19 -0
  13. data/lib/stylish/developer/environment.rb +75 -0
  14. data/lib/stylish/developer/listing.rb +85 -0
  15. data/lib/stylish/developer/model_delegator.rb +51 -0
  16. data/lib/stylish/developer/modification.rb +139 -0
  17. data/lib/stylish/developer/path.rb +168 -0
  18. data/lib/stylish/developer/route.rb +97 -0
  19. data/lib/stylish/developer/server.rb +40 -0
  20. data/lib/stylish/engine.rb +12 -0
  21. data/lib/stylish/fs.rb +59 -0
  22. data/lib/stylish/manifest.rb +100 -0
  23. data/lib/stylish/models.rb +119 -0
  24. data/lib/stylish/models/component.rb +19 -0
  25. data/lib/stylish/models/layout.rb +19 -0
  26. data/lib/stylish/models/library.rb +134 -0
  27. data/lib/stylish/models/package.rb +156 -0
  28. data/lib/stylish/models/script.rb +10 -0
  29. data/lib/stylish/models/stylesheet.rb +9 -0
  30. data/lib/stylish/models/template.rb +9 -0
  31. data/lib/stylish/models/theme.rb +8 -0
  32. data/lib/stylish/util.rb +20 -0
  33. data/lib/stylish/version.rb +1 -1
  34. data/library/config.json +4 -0
  35. data/library/second-theme/manifest.json +8 -0
  36. data/library/second-theme/manifest.yml +6 -0
  37. data/library/second-theme/templates/footers/footer-01.html +3 -0
  38. data/library/second-theme/templates/footers/footer-02.html +3 -0
  39. data/library/second-theme/templates/headers/header-01.html +3 -0
  40. data/library/second-theme/templates/headers/header-02.html +3 -0
  41. data/library/second-theme/templates/landing-page-blocks/landing-page-block-01.html +3 -0
  42. data/library/second-theme/templates/landing-page-blocks/landing-page-block-02.html +3 -0
  43. data/library/test-theme/components/footers/footer-01.json +5 -0
  44. data/library/test-theme/components/footers/footer-02.json +5 -0
  45. data/library/test-theme/components/headers/header-01.json +5 -0
  46. data/library/test-theme/components/headers/header-02.json +5 -0
  47. data/library/test-theme/components/landing-page-blocks/landing-page-01.json +5 -0
  48. data/library/test-theme/components/landing-page-blocks/landing-page-02.json +5 -0
  49. data/library/test-theme/manifest.json +8 -0
  50. data/library/test-theme/manifest.yml +6 -0
  51. data/library/test-theme/pages/page-01.json +11 -0
  52. data/library/test-theme/templates/footers/footer-01.html +3 -0
  53. data/library/test-theme/templates/footers/footer-02.html +3 -0
  54. data/library/test-theme/templates/headers/header-01.html +3 -0
  55. data/library/test-theme/templates/headers/header-02.html +3 -0
  56. data/library/test-theme/templates/landing-page-blocks/landing-page-block-01.html +3 -0
  57. data/library/test-theme/templates/landing-page-blocks/landing-page-block-02.html +3 -0
  58. data/library/test-theme/templates/layouts/standard-layout.html +10 -0
  59. data/spec/acceptance/listing_assets_spec.rb +20 -0
  60. data/spec/acceptance/model_browsing_spec.rb +21 -0
  61. data/spec/acceptance/model_creation_spec.rb +16 -0
  62. data/spec/acceptance/model_deleting_spec.rb +10 -0
  63. data/spec/acceptance/model_updating_spec.rb +12 -0
  64. data/spec/acceptance/modifying_assets_spec.rb +50 -0
  65. data/spec/acceptance/server_info_spec.rb +10 -0
  66. data/spec/dummy/README.rdoc +28 -0
  67. data/spec/dummy/Rakefile +6 -0
  68. data/spec/dummy/app/assets/images/.keep +0 -0
  69. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  70. data/spec/dummy/app/assets/javascripts/test.coffee +4 -0
  71. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  72. data/spec/dummy/app/assets/stylesheets/test.css.scss +6 -0
  73. data/spec/dummy/app/assets/stylesheets/writable/existing.scss.css +0 -0
  74. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  75. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  76. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  77. data/spec/dummy/app/mailers/.keep +0 -0
  78. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  79. data/spec/dummy/bin/bundle +3 -0
  80. data/spec/dummy/bin/rails +4 -0
  81. data/spec/dummy/bin/rake +4 -0
  82. data/spec/dummy/config.ru +4 -0
  83. data/spec/dummy/config/application.rb +30 -0
  84. data/spec/dummy/config/boot.rb +5 -0
  85. data/spec/dummy/config/database.yml +25 -0
  86. data/spec/dummy/config/environment.rb +5 -0
  87. data/spec/dummy/config/environments/development.rb +37 -0
  88. data/spec/dummy/config/environments/production.rb +82 -0
  89. data/spec/dummy/config/environments/test.rb +39 -0
  90. data/spec/dummy/config/initializers/assets.rb +8 -0
  91. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  92. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  93. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  94. data/spec/dummy/config/initializers/inflections.rb +16 -0
  95. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  96. data/spec/dummy/config/initializers/session_store.rb +3 -0
  97. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  98. data/spec/dummy/config/locales/en.yml +23 -0
  99. data/spec/dummy/config/routes.rb +3 -0
  100. data/spec/dummy/config/secrets.yml +22 -0
  101. data/spec/dummy/db/migrate/20140822065900_create_books.rb +11 -0
  102. data/spec/dummy/db/migrate/20140822065916_create_authors.rb +9 -0
  103. data/spec/dummy/db/migrate/20140824215902_create_users.rb +10 -0
  104. data/spec/dummy/db/migrate/20140826193259_create_libraries.rb +10 -0
  105. data/spec/dummy/db/schema.rb +37 -0
  106. data/spec/dummy/db/test.sqlite3 +0 -0
  107. data/spec/dummy/lib/assets/.keep +0 -0
  108. data/spec/dummy/log/.keep +0 -0
  109. data/spec/dummy/public/404.html +67 -0
  110. data/spec/dummy/public/422.html +67 -0
  111. data/spec/dummy/public/500.html +66 -0
  112. data/spec/dummy/public/favicon.ico +0 -0
  113. data/spec/fixtures/config.json +3 -0
  114. data/spec/fixtures/test-theme/components/footers/footer-01.json +5 -0
  115. data/spec/fixtures/test-theme/components/footers/footer-02.json +5 -0
  116. data/spec/fixtures/test-theme/components/headers/header-01.json +5 -0
  117. data/spec/fixtures/test-theme/components/headers/header-02.json +5 -0
  118. data/spec/fixtures/test-theme/components/landing-page-blocks/landing-page-01.json +5 -0
  119. data/spec/fixtures/test-theme/components/landing-page-blocks/landing-page-02.json +5 -0
  120. data/spec/fixtures/test-theme/manifest.json +8 -0
  121. data/spec/fixtures/test-theme/manifest.yml +6 -0
  122. data/spec/fixtures/test-theme/pages/page-01.json +11 -0
  123. data/spec/fixtures/test-theme/templates/footers/footer-01.html +3 -0
  124. data/spec/fixtures/test-theme/templates/footers/footer-02.html +3 -0
  125. data/spec/fixtures/test-theme/templates/headers/header-01.html +3 -0
  126. data/spec/fixtures/test-theme/templates/headers/header-02.html +3 -0
  127. data/spec/fixtures/test-theme/templates/landing-page-blocks/landing-page-block-01.html +3 -0
  128. data/spec/fixtures/test-theme/templates/landing-page-blocks/landing-page-block-02.html +3 -0
  129. data/spec/fixtures/test-theme/templates/layouts/standard-01.html +9 -0
  130. data/spec/lib/stylish/configuration_spec.rb +8 -0
  131. data/spec/lib/stylish/developer/path_spec.rb +36 -0
  132. data/spec/lib/stylish/developer/route_spec.rb +5 -0
  133. data/spec/lib/stylish/manifest_spec.rb +48 -0
  134. data/spec/lib/stylish/models/library_spec.rb +38 -0
  135. data/spec/lib/stylish/models/package_spec.rb +35 -0
  136. data/spec/lib/stylish/models_spec.rb +12 -0
  137. data/spec/spec_helper.rb +38 -0
  138. data/spec/support/json_helper.rb +7 -0
  139. data/spec/test.css.scss +6 -0
  140. data/stylish.gemspec +17 -2
  141. data/support/editor-app/.gitignore +2 -0
  142. data/support/editor-app/development/bower.json +9 -0
  143. data/support/editor-app/development/package.json +28 -0
  144. data/support/editor-app/development/semantic/components/accordion.css +257 -0
  145. data/support/editor-app/development/semantic/components/accordion.js +558 -0
  146. data/support/editor-app/development/semantic/components/accordion.min.css +11 -0
  147. data/support/editor-app/development/semantic/components/accordion.min.js +11 -0
  148. data/support/editor-app/development/semantic/components/ad.css +277 -0
  149. data/support/editor-app/development/semantic/components/ad.min.css +11 -0
  150. data/support/editor-app/development/semantic/components/api.js +851 -0
  151. data/support/editor-app/development/semantic/components/api.min.js +11 -0
  152. data/support/editor-app/development/semantic/components/breadcrumb.css +125 -0
  153. data/support/editor-app/development/semantic/components/breadcrumb.min.css +11 -0
  154. data/support/editor-app/development/semantic/components/button.css +2391 -0
  155. data/support/editor-app/development/semantic/components/button.min.css +11 -0
  156. data/support/editor-app/development/semantic/components/card.css +758 -0
  157. data/support/editor-app/development/semantic/components/card.min.css +11 -0
  158. data/support/editor-app/development/semantic/components/checkbox.css +514 -0
  159. data/support/editor-app/development/semantic/components/checkbox.js +507 -0
  160. data/support/editor-app/development/semantic/components/checkbox.min.css +11 -0
  161. data/support/editor-app/development/semantic/components/checkbox.min.js +11 -0
  162. data/support/editor-app/development/semantic/components/comment.css +260 -0
  163. data/support/editor-app/development/semantic/components/comment.min.css +11 -0
  164. data/support/editor-app/development/semantic/components/dimmer.css +187 -0
  165. data/support/editor-app/development/semantic/components/dimmer.js +627 -0
  166. data/support/editor-app/development/semantic/components/dimmer.min.css +11 -0
  167. data/support/editor-app/development/semantic/components/dimmer.min.js +11 -0
  168. data/support/editor-app/development/semantic/components/divider.css +244 -0
  169. data/support/editor-app/development/semantic/components/divider.min.css +11 -0
  170. data/support/editor-app/development/semantic/components/dropdown.css +1085 -0
  171. data/support/editor-app/development/semantic/components/dropdown.js +1757 -0
  172. data/support/editor-app/development/semantic/components/dropdown.min.css +11 -0
  173. data/support/editor-app/development/semantic/components/dropdown.min.js +11 -0
  174. data/support/editor-app/development/semantic/components/feed.css +277 -0
  175. data/support/editor-app/development/semantic/components/feed.min.css +11 -0
  176. data/support/editor-app/development/semantic/components/flag.css +1017 -0
  177. data/support/editor-app/development/semantic/components/flag.min.css +11 -0
  178. data/support/editor-app/development/semantic/components/form.css +875 -0
  179. data/support/editor-app/development/semantic/components/form.js +1039 -0
  180. data/support/editor-app/development/semantic/components/form.min.css +11 -0
  181. data/support/editor-app/development/semantic/components/form.min.js +11 -0
  182. data/support/editor-app/development/semantic/components/grid.css +1816 -0
  183. data/support/editor-app/development/semantic/components/grid.min.css +11 -0
  184. data/support/editor-app/development/semantic/components/header.css +572 -0
  185. data/support/editor-app/development/semantic/components/header.min.css +11 -0
  186. data/support/editor-app/development/semantic/components/icon.css +2127 -0
  187. data/support/editor-app/development/semantic/components/icon.min.css +11 -0
  188. data/support/editor-app/development/semantic/components/image.css +275 -0
  189. data/support/editor-app/development/semantic/components/image.min.css +11 -0
  190. data/support/editor-app/development/semantic/components/input.css +455 -0
  191. data/support/editor-app/development/semantic/components/input.min.css +11 -0
  192. data/support/editor-app/development/semantic/components/item.css +458 -0
  193. data/support/editor-app/development/semantic/components/item.min.css +11 -0
  194. data/support/editor-app/development/semantic/components/label.css +930 -0
  195. data/support/editor-app/development/semantic/components/label.min.css +11 -0
  196. data/support/editor-app/development/semantic/components/list.css +879 -0
  197. data/support/editor-app/development/semantic/components/list.min.css +11 -0
  198. data/support/editor-app/development/semantic/components/loader.css +279 -0
  199. data/support/editor-app/development/semantic/components/loader.min.css +11 -0
  200. data/support/editor-app/development/semantic/components/menu.css +1596 -0
  201. data/support/editor-app/development/semantic/components/menu.min.css +11 -0
  202. data/support/editor-app/development/semantic/components/message.css +422 -0
  203. data/support/editor-app/development/semantic/components/message.min.css +11 -0
  204. data/support/editor-app/development/semantic/components/modal.css +431 -0
  205. data/support/editor-app/development/semantic/components/modal.js +860 -0
  206. data/support/editor-app/development/semantic/components/modal.min.css +11 -0
  207. data/support/editor-app/development/semantic/components/modal.min.js +11 -0
  208. data/support/editor-app/development/semantic/components/nag.css +149 -0
  209. data/support/editor-app/development/semantic/components/nag.js +477 -0
  210. data/support/editor-app/development/semantic/components/nag.min.css +11 -0
  211. data/support/editor-app/development/semantic/components/nag.min.js +11 -0
  212. data/support/editor-app/development/semantic/components/popup.css +294 -0
  213. data/support/editor-app/development/semantic/components/popup.js +1187 -0
  214. data/support/editor-app/development/semantic/components/popup.min.css +11 -0
  215. data/support/editor-app/development/semantic/components/popup.min.js +11 -0
  216. data/support/editor-app/development/semantic/components/progress.css +449 -0
  217. data/support/editor-app/development/semantic/components/progress.js +785 -0
  218. data/support/editor-app/development/semantic/components/progress.min.css +11 -0
  219. data/support/editor-app/development/semantic/components/progress.min.js +11 -0
  220. data/support/editor-app/development/semantic/components/rail.css +125 -0
  221. data/support/editor-app/development/semantic/components/rail.min.css +11 -0
  222. data/support/editor-app/development/semantic/components/rating.css +262 -0
  223. data/support/editor-app/development/semantic/components/rating.js +451 -0
  224. data/support/editor-app/development/semantic/components/rating.min.css +11 -0
  225. data/support/editor-app/development/semantic/components/rating.min.js +11 -0
  226. data/support/editor-app/development/semantic/components/reset.css +430 -0
  227. data/support/editor-app/development/semantic/components/reset.min.css +11 -0
  228. data/support/editor-app/development/semantic/components/reveal.css +294 -0
  229. data/support/editor-app/development/semantic/components/reveal.min.css +11 -0
  230. data/support/editor-app/development/semantic/components/search.css +330 -0
  231. data/support/editor-app/development/semantic/components/search.js +1055 -0
  232. data/support/editor-app/development/semantic/components/search.min.css +11 -0
  233. data/support/editor-app/development/semantic/components/search.min.js +11 -0
  234. data/support/editor-app/development/semantic/components/segment.css +590 -0
  235. data/support/editor-app/development/semantic/components/segment.min.css +11 -0
  236. data/support/editor-app/development/semantic/components/shape.css +155 -0
  237. data/support/editor-app/development/semantic/components/shape.js +830 -0
  238. data/support/editor-app/development/semantic/components/shape.min.css +11 -0
  239. data/support/editor-app/development/semantic/components/shape.min.js +11 -0
  240. data/support/editor-app/development/semantic/components/sidebar.css +621 -0
  241. data/support/editor-app/development/semantic/components/sidebar.js +1084 -0
  242. data/support/editor-app/development/semantic/components/sidebar.min.css +11 -0
  243. data/support/editor-app/development/semantic/components/sidebar.min.js +11 -0
  244. data/support/editor-app/development/semantic/components/site.css +147 -0
  245. data/support/editor-app/development/semantic/components/site.js +487 -0
  246. data/support/editor-app/development/semantic/components/site.min.css +11 -0
  247. data/support/editor-app/development/semantic/components/site.min.js +11 -0
  248. data/support/editor-app/development/semantic/components/state.js +690 -0
  249. data/support/editor-app/development/semantic/components/state.min.js +11 -0
  250. data/support/editor-app/development/semantic/components/statistic.css +410 -0
  251. data/support/editor-app/development/semantic/components/statistic.min.css +11 -0
  252. data/support/editor-app/development/semantic/components/step.css +433 -0
  253. data/support/editor-app/development/semantic/components/step.min.css +11 -0
  254. data/support/editor-app/development/semantic/components/sticky.css +80 -0
  255. data/support/editor-app/development/semantic/components/sticky.js +775 -0
  256. data/support/editor-app/development/semantic/components/sticky.min.css +11 -0
  257. data/support/editor-app/development/semantic/components/sticky.min.js +11 -0
  258. data/support/editor-app/development/semantic/components/tab.css +93 -0
  259. data/support/editor-app/development/semantic/components/tab.js +787 -0
  260. data/support/editor-app/development/semantic/components/tab.min.css +11 -0
  261. data/support/editor-app/development/semantic/components/tab.min.js +11 -0
  262. data/support/editor-app/development/semantic/components/table.css +999 -0
  263. data/support/editor-app/development/semantic/components/table.min.css +11 -0
  264. data/support/editor-app/development/semantic/components/transition.css +2152 -0
  265. data/support/editor-app/development/semantic/components/transition.js +936 -0
  266. data/support/editor-app/development/semantic/components/transition.min.css +11 -0
  267. data/support/editor-app/development/semantic/components/transition.min.js +11 -0
  268. data/support/editor-app/development/semantic/components/video.css +126 -0
  269. data/support/editor-app/development/semantic/components/video.js +540 -0
  270. data/support/editor-app/development/semantic/components/video.min.css +11 -0
  271. data/support/editor-app/development/semantic/components/video.min.js +11 -0
  272. data/support/editor-app/development/semantic/components/visibility.js +970 -0
  273. data/support/editor-app/development/semantic/components/visibility.min.js +11 -0
  274. data/support/editor-app/development/semantic/semantic.css +31768 -0
  275. data/support/editor-app/development/semantic/semantic.js +18317 -0
  276. data/support/editor-app/development/semantic/semantic.min.css +11 -0
  277. data/support/editor-app/development/semantic/semantic.min.js +17 -0
  278. data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.eot +0 -0
  279. data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.svg +450 -0
  280. data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.ttf +0 -0
  281. data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.woff +0 -0
  282. data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.eot +0 -0
  283. data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.otf +0 -0
  284. data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.svg +504 -0
  285. data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.ttf +0 -0
  286. data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.woff +0 -0
  287. data/support/editor-app/development/semantic/themes/default/assets/images/flags.png +0 -0
  288. data/support/editor-app/development/src/apis/index.coffee +35 -0
  289. data/support/editor-app/development/src/components/editor.cjsx +58 -0
  290. data/support/editor-app/development/src/components/editor_drawer.cjsx +7 -0
  291. data/support/editor-app/development/src/components/header.cjsx +12 -0
  292. data/support/editor-app/development/src/components/index.coffee +9 -0
  293. data/support/editor-app/development/src/components/menus/icon_grid.cjsx +0 -0
  294. data/support/editor-app/development/src/components/sidebar.cjsx +24 -0
  295. data/support/editor-app/development/src/components/tiled_grid.cjsx +35 -0
  296. data/support/editor-app/development/src/index.cjsx +82 -0
  297. data/support/editor-app/development/src/lib/util.coffee +48 -0
  298. data/support/editor-app/development/src/pages/home.cjsx +46 -0
  299. data/support/editor-app/development/src/pages/index.coffee +6 -0
  300. data/support/editor-app/development/src/pages/package_details.cjsx +55 -0
  301. data/support/editor-app/development/src/registry.coffee +35 -0
  302. data/support/editor-app/development/src/styles/components/tiled_grid.css.scss +5 -0
  303. data/support/editor-app/development/src/styles/index.css.scss +240 -0
  304. data/support/editor-app/development/src/sugar.cjsx +126 -0
  305. data/support/editor-app/development/webpack.config.js +53 -0
  306. data/support/editor-app/dist/base.css +0 -0
  307. data/support/editor-app/dist/toolit.js +62 -0
  308. data/support/editor-app/dist/toolkit.js +44573 -0
  309. data/support/editor-app/index.html +50 -0
  310. data/support/editor-app/package.json +15 -0
  311. data/support/editor-app/semantic/components/accordion.css +257 -0
  312. data/support/editor-app/semantic/components/accordion.js +558 -0
  313. data/support/editor-app/semantic/components/accordion.min.css +11 -0
  314. data/support/editor-app/semantic/components/accordion.min.js +11 -0
  315. data/support/editor-app/semantic/components/ad.css +277 -0
  316. data/support/editor-app/semantic/components/ad.min.css +11 -0
  317. data/support/editor-app/semantic/components/api.js +851 -0
  318. data/support/editor-app/semantic/components/api.min.js +11 -0
  319. data/support/editor-app/semantic/components/breadcrumb.css +125 -0
  320. data/support/editor-app/semantic/components/breadcrumb.min.css +11 -0
  321. data/support/editor-app/semantic/components/button.css +2391 -0
  322. data/support/editor-app/semantic/components/button.min.css +11 -0
  323. data/support/editor-app/semantic/components/card.css +758 -0
  324. data/support/editor-app/semantic/components/card.min.css +11 -0
  325. data/support/editor-app/semantic/components/checkbox.css +514 -0
  326. data/support/editor-app/semantic/components/checkbox.js +507 -0
  327. data/support/editor-app/semantic/components/checkbox.min.css +11 -0
  328. data/support/editor-app/semantic/components/checkbox.min.js +11 -0
  329. data/support/editor-app/semantic/components/comment.css +260 -0
  330. data/support/editor-app/semantic/components/comment.min.css +11 -0
  331. data/support/editor-app/semantic/components/dimmer.css +187 -0
  332. data/support/editor-app/semantic/components/dimmer.js +627 -0
  333. data/support/editor-app/semantic/components/dimmer.min.css +11 -0
  334. data/support/editor-app/semantic/components/dimmer.min.js +11 -0
  335. data/support/editor-app/semantic/components/divider.css +244 -0
  336. data/support/editor-app/semantic/components/divider.min.css +11 -0
  337. data/support/editor-app/semantic/components/dropdown.css +1085 -0
  338. data/support/editor-app/semantic/components/dropdown.js +1757 -0
  339. data/support/editor-app/semantic/components/dropdown.min.css +11 -0
  340. data/support/editor-app/semantic/components/dropdown.min.js +11 -0
  341. data/support/editor-app/semantic/components/feed.css +277 -0
  342. data/support/editor-app/semantic/components/feed.min.css +11 -0
  343. data/support/editor-app/semantic/components/flag.css +1017 -0
  344. data/support/editor-app/semantic/components/flag.min.css +11 -0
  345. data/support/editor-app/semantic/components/form.css +875 -0
  346. data/support/editor-app/semantic/components/form.js +1039 -0
  347. data/support/editor-app/semantic/components/form.min.css +11 -0
  348. data/support/editor-app/semantic/components/form.min.js +11 -0
  349. data/support/editor-app/semantic/components/grid.css +1816 -0
  350. data/support/editor-app/semantic/components/grid.min.css +11 -0
  351. data/support/editor-app/semantic/components/header.css +572 -0
  352. data/support/editor-app/semantic/components/header.min.css +11 -0
  353. data/support/editor-app/semantic/components/icon.css +2127 -0
  354. data/support/editor-app/semantic/components/icon.min.css +11 -0
  355. data/support/editor-app/semantic/components/image.css +275 -0
  356. data/support/editor-app/semantic/components/image.min.css +11 -0
  357. data/support/editor-app/semantic/components/input.css +455 -0
  358. data/support/editor-app/semantic/components/input.min.css +11 -0
  359. data/support/editor-app/semantic/components/item.css +458 -0
  360. data/support/editor-app/semantic/components/item.min.css +11 -0
  361. data/support/editor-app/semantic/components/label.css +930 -0
  362. data/support/editor-app/semantic/components/label.min.css +11 -0
  363. data/support/editor-app/semantic/components/list.css +879 -0
  364. data/support/editor-app/semantic/components/list.min.css +11 -0
  365. data/support/editor-app/semantic/components/loader.css +279 -0
  366. data/support/editor-app/semantic/components/loader.min.css +11 -0
  367. data/support/editor-app/semantic/components/menu.css +1596 -0
  368. data/support/editor-app/semantic/components/menu.min.css +11 -0
  369. data/support/editor-app/semantic/components/message.css +422 -0
  370. data/support/editor-app/semantic/components/message.min.css +11 -0
  371. data/support/editor-app/semantic/components/modal.css +431 -0
  372. data/support/editor-app/semantic/components/modal.js +860 -0
  373. data/support/editor-app/semantic/components/modal.min.css +11 -0
  374. data/support/editor-app/semantic/components/modal.min.js +11 -0
  375. data/support/editor-app/semantic/components/nag.css +149 -0
  376. data/support/editor-app/semantic/components/nag.js +477 -0
  377. data/support/editor-app/semantic/components/nag.min.css +11 -0
  378. data/support/editor-app/semantic/components/nag.min.js +11 -0
  379. data/support/editor-app/semantic/components/popup.css +294 -0
  380. data/support/editor-app/semantic/components/popup.js +1187 -0
  381. data/support/editor-app/semantic/components/popup.min.css +11 -0
  382. data/support/editor-app/semantic/components/popup.min.js +11 -0
  383. data/support/editor-app/semantic/components/progress.css +449 -0
  384. data/support/editor-app/semantic/components/progress.js +785 -0
  385. data/support/editor-app/semantic/components/progress.min.css +11 -0
  386. data/support/editor-app/semantic/components/progress.min.js +11 -0
  387. data/support/editor-app/semantic/components/rail.css +125 -0
  388. data/support/editor-app/semantic/components/rail.min.css +11 -0
  389. data/support/editor-app/semantic/components/rating.css +262 -0
  390. data/support/editor-app/semantic/components/rating.js +451 -0
  391. data/support/editor-app/semantic/components/rating.min.css +11 -0
  392. data/support/editor-app/semantic/components/rating.min.js +11 -0
  393. data/support/editor-app/semantic/components/reset.css +430 -0
  394. data/support/editor-app/semantic/components/reset.min.css +11 -0
  395. data/support/editor-app/semantic/components/reveal.css +294 -0
  396. data/support/editor-app/semantic/components/reveal.min.css +11 -0
  397. data/support/editor-app/semantic/components/search.css +330 -0
  398. data/support/editor-app/semantic/components/search.js +1055 -0
  399. data/support/editor-app/semantic/components/search.min.css +11 -0
  400. data/support/editor-app/semantic/components/search.min.js +11 -0
  401. data/support/editor-app/semantic/components/segment.css +590 -0
  402. data/support/editor-app/semantic/components/segment.min.css +11 -0
  403. data/support/editor-app/semantic/components/shape.css +155 -0
  404. data/support/editor-app/semantic/components/shape.js +830 -0
  405. data/support/editor-app/semantic/components/shape.min.css +11 -0
  406. data/support/editor-app/semantic/components/shape.min.js +11 -0
  407. data/support/editor-app/semantic/components/sidebar.css +621 -0
  408. data/support/editor-app/semantic/components/sidebar.js +1084 -0
  409. data/support/editor-app/semantic/components/sidebar.min.css +11 -0
  410. data/support/editor-app/semantic/components/sidebar.min.js +11 -0
  411. data/support/editor-app/semantic/components/site.css +147 -0
  412. data/support/editor-app/semantic/components/site.js +487 -0
  413. data/support/editor-app/semantic/components/site.min.css +11 -0
  414. data/support/editor-app/semantic/components/site.min.js +11 -0
  415. data/support/editor-app/semantic/components/state.js +690 -0
  416. data/support/editor-app/semantic/components/state.min.js +11 -0
  417. data/support/editor-app/semantic/components/statistic.css +410 -0
  418. data/support/editor-app/semantic/components/statistic.min.css +11 -0
  419. data/support/editor-app/semantic/components/step.css +433 -0
  420. data/support/editor-app/semantic/components/step.min.css +11 -0
  421. data/support/editor-app/semantic/components/sticky.css +80 -0
  422. data/support/editor-app/semantic/components/sticky.js +775 -0
  423. data/support/editor-app/semantic/components/sticky.min.css +11 -0
  424. data/support/editor-app/semantic/components/sticky.min.js +11 -0
  425. data/support/editor-app/semantic/components/tab.css +93 -0
  426. data/support/editor-app/semantic/components/tab.js +787 -0
  427. data/support/editor-app/semantic/components/tab.min.css +11 -0
  428. data/support/editor-app/semantic/components/tab.min.js +11 -0
  429. data/support/editor-app/semantic/components/table.css +999 -0
  430. data/support/editor-app/semantic/components/table.min.css +11 -0
  431. data/support/editor-app/semantic/components/transition.css +2152 -0
  432. data/support/editor-app/semantic/components/transition.js +936 -0
  433. data/support/editor-app/semantic/components/transition.min.css +11 -0
  434. data/support/editor-app/semantic/components/transition.min.js +11 -0
  435. data/support/editor-app/semantic/components/video.css +126 -0
  436. data/support/editor-app/semantic/components/video.js +540 -0
  437. data/support/editor-app/semantic/components/video.min.css +11 -0
  438. data/support/editor-app/semantic/components/video.min.js +11 -0
  439. data/support/editor-app/semantic/components/visibility.js +970 -0
  440. data/support/editor-app/semantic/components/visibility.min.js +11 -0
  441. data/support/editor-app/semantic/semantic.css +31768 -0
  442. data/support/editor-app/semantic/semantic.js +18317 -0
  443. data/support/editor-app/semantic/semantic.min.css +11 -0
  444. data/support/editor-app/semantic/semantic.min.js +17 -0
  445. data/support/editor-app/semantic/themes/basic/assets/fonts/icons.eot +0 -0
  446. data/support/editor-app/semantic/themes/basic/assets/fonts/icons.svg +450 -0
  447. data/support/editor-app/semantic/themes/basic/assets/fonts/icons.ttf +0 -0
  448. data/support/editor-app/semantic/themes/basic/assets/fonts/icons.woff +0 -0
  449. data/support/editor-app/semantic/themes/default/assets/fonts/icons.eot +0 -0
  450. data/support/editor-app/semantic/themes/default/assets/fonts/icons.otf +0 -0
  451. data/support/editor-app/semantic/themes/default/assets/fonts/icons.svg +504 -0
  452. data/support/editor-app/semantic/themes/default/assets/fonts/icons.ttf +0 -0
  453. data/support/editor-app/semantic/themes/default/assets/fonts/icons.woff +0 -0
  454. data/support/editor-app/semantic/themes/default/assets/images/flags.png +0 -0
  455. data/support/editor-app/vendor/jquery.js +8829 -0
  456. data/support/library-server/Gemfile +0 -0
  457. data/support/library-server/config.ru +4 -0
  458. metadata +740 -7
@@ -0,0 +1,936 @@
1
+ /*
2
+ * # Semantic - Transition
3
+ * http://github.com/semantic-org/semantic-ui/
4
+ *
5
+ *
6
+ * Copyright 2014 Contributor
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+
12
+ ;(function ( $, window, document, undefined ) {
13
+
14
+ "use strict";
15
+
16
+ $.fn.transition = function() {
17
+ var
18
+ $allModules = $(this),
19
+ moduleSelector = $allModules.selector || '',
20
+
21
+ time = new Date().getTime(),
22
+ performance = [],
23
+
24
+ moduleArguments = arguments,
25
+ query = moduleArguments[0],
26
+ queryArguments = [].slice.call(arguments, 1),
27
+ methodInvoked = (typeof query === 'string'),
28
+
29
+ requestAnimationFrame = window.requestAnimationFrame
30
+ || window.mozRequestAnimationFrame
31
+ || window.webkitRequestAnimationFrame
32
+ || window.msRequestAnimationFrame
33
+ || function(callback) { setTimeout(callback, 0); },
34
+
35
+ returnedValue
36
+ ;
37
+ $allModules
38
+ .each(function() {
39
+ var
40
+ $module = $(this),
41
+ element = this,
42
+
43
+ // set at run time
44
+ settings,
45
+ instance,
46
+
47
+ error,
48
+ className,
49
+ metadata,
50
+ animationStart,
51
+ animationEnd,
52
+ animationName,
53
+
54
+ namespace,
55
+ moduleNamespace,
56
+ eventNamespace,
57
+ module
58
+ ;
59
+
60
+ module = {
61
+
62
+ initialize: function() {
63
+
64
+ // get full settings
65
+ moduleNamespace = 'module-' + namespace;
66
+ settings = module.get.settings.apply(element, moduleArguments);
67
+ className = settings.className;
68
+ metadata = settings.metadata;
69
+
70
+ animationStart = module.get.animationStartEvent();
71
+ animationEnd = module.get.animationEndEvent();
72
+ animationName = module.get.animationName();
73
+ error = settings.error;
74
+ namespace = settings.namespace;
75
+ eventNamespace = '.' + settings.namespace;
76
+ instance = $module.data(moduleNamespace) || module;
77
+
78
+ if(methodInvoked) {
79
+ methodInvoked = module.invoke(query);
80
+ }
81
+ // no internal method was found matching query or query not made
82
+ if(methodInvoked === false) {
83
+ module.verbose('Converted arguments into settings object', settings);
84
+ module.animate();
85
+ module.instantiate();
86
+ }
87
+ },
88
+
89
+ instantiate: function() {
90
+ module.verbose('Storing instance of module', module);
91
+ $module
92
+ .data(moduleNamespace, instance)
93
+ ;
94
+ },
95
+
96
+ destroy: function() {
97
+ module.verbose('Destroying previous module for', element);
98
+ $module
99
+ .removeData(moduleNamespace)
100
+ ;
101
+ },
102
+
103
+ refresh: function() {
104
+ module.verbose('Refreshing display type on next animation');
105
+ delete module.displayType;
106
+ },
107
+
108
+ forceRepaint: function() {
109
+ module.verbose('Forcing element repaint');
110
+ var
111
+ $parentElement = $module.parent(),
112
+ $nextElement = $module.next()
113
+ ;
114
+ if($nextElement.length === 0) {
115
+ $module.detach().appendTo($parentElement);
116
+ }
117
+ else {
118
+ $module.detach().insertBefore($nextElement);
119
+ }
120
+ },
121
+
122
+ repaint: function() {
123
+ module.verbose('Repainting element');
124
+ var
125
+ fakeAssignment = element.offsetWidth
126
+ ;
127
+ },
128
+
129
+ animate: function(overrideSettings) {
130
+ settings = overrideSettings || settings;
131
+ if(!module.is.supported()) {
132
+ module.error(error.support);
133
+ return false;
134
+ }
135
+ module.debug('Preparing animation', settings.animation);
136
+ if(module.is.animating()) {
137
+ if(settings.queue) {
138
+ if(!settings.allowRepeats && module.has.direction() && module.is.occurring() && module.queuing !== true) {
139
+ module.debug('Animation is currently occurring, preventing queueing same animation', settings.animation);
140
+ }
141
+ else {
142
+ module.queue(settings.animation);
143
+ }
144
+ return false;
145
+ }
146
+ else if(!settings.allowRepeats && module.is.occurring()) {
147
+ module.debug('Animation is already occurring, will not execute repeated animation', settings.animation);
148
+ return false;
149
+ }
150
+ }
151
+ if( module.can.animate() ) {
152
+ module.set.animating(settings.animation);
153
+ }
154
+ else {
155
+ module.error(error.noAnimation, settings.animation, element);
156
+ }
157
+ },
158
+
159
+ reset: function() {
160
+ module.debug('Resetting animation to beginning conditions');
161
+ module.remove.animationEndCallback();
162
+ module.restore.conditions();
163
+ module.remove.animating();
164
+ },
165
+
166
+ queue: function(animation) {
167
+ module.debug('Queueing animation of', animation);
168
+ module.queuing = true;
169
+ $module
170
+ .one(animationEnd + eventNamespace, function() {
171
+ module.queuing = false;
172
+ module.repaint();
173
+ module.animate.apply(this, settings);
174
+ })
175
+ ;
176
+ },
177
+
178
+ complete: function () {
179
+ module.verbose('CSS animation complete', settings.animation);
180
+ module.remove.animationEndCallback();
181
+ module.remove.failSafe();
182
+ if(!module.is.looping()) {
183
+ if( module.is.outward() ) {
184
+ module.verbose('Animation is outward, hiding element');
185
+ module.restore.conditions();
186
+ module.hide();
187
+ settings.onHide.call(this);
188
+ }
189
+ else if( module.is.inward() ) {
190
+ module.verbose('Animation is outward, showing element');
191
+ module.restore.conditions();
192
+ module.show();
193
+ module.set.display();
194
+ settings.onShow.call(this);
195
+ }
196
+ else {
197
+ module.restore.conditions();
198
+ }
199
+ module.remove.animation();
200
+ module.remove.animating();
201
+ }
202
+ settings.onComplete.call(this);
203
+ },
204
+
205
+ has: {
206
+ direction: function(animation) {
207
+ var
208
+ hasDirection = false
209
+ ;
210
+ animation = animation || settings.animation;
211
+ if(typeof animation === 'string') {
212
+ animation = animation.split(' ');
213
+ $.each(animation, function(index, word){
214
+ if(word === className.inward || word === className.outward) {
215
+ hasDirection = true;
216
+ }
217
+ });
218
+ }
219
+ return hasDirection;
220
+ },
221
+ inlineDisplay: function() {
222
+ var
223
+ style = $module.attr('style') || ''
224
+ ;
225
+ return $.isArray(style.match(/display.*?;/, ''));
226
+ }
227
+ },
228
+
229
+ set: {
230
+ animating: function(animation) {
231
+ animation = animation || settings.animation;
232
+ if(!module.is.animating()) {
233
+ module.save.conditions();
234
+ }
235
+ module.remove.direction();
236
+ module.remove.animationEndCallback();
237
+ if(module.can.transition() && !module.has.direction()) {
238
+ module.set.direction();
239
+ }
240
+ module.remove.hidden();
241
+ module.set.display();
242
+ $module
243
+ .addClass(className.animating + ' ' + className.transition + ' ' + animation)
244
+ .addClass(animation)
245
+ .one(animationEnd + '.complete' + eventNamespace, module.complete)
246
+ ;
247
+ if(settings.useFailSafe) {
248
+ module.add.failSafe();
249
+ }
250
+ module.set.duration(settings.duration);
251
+ settings.onStart.call(this);
252
+ module.debug('Starting tween', animation, $module.attr('class'));
253
+ },
254
+ duration: function(animationName, duration) {
255
+ duration = duration || settings.duration;
256
+ duration = (typeof duration == 'number')
257
+ ? duration + 'ms'
258
+ : duration
259
+ ;
260
+ module.verbose('Setting animation duration', duration);
261
+ if(duration || duration === 0) {
262
+ $module
263
+ .css({
264
+ '-webkit-animation-duration': duration,
265
+ '-moz-animation-duration': duration,
266
+ '-ms-animation-duration': duration,
267
+ '-o-animation-duration': duration,
268
+ 'animation-duration': duration
269
+ })
270
+ ;
271
+ }
272
+ },
273
+ display: function() {
274
+ var
275
+ style = module.get.style(),
276
+ displayType = module.get.displayType(),
277
+ overrideStyle = style + 'display: ' + displayType + ' !important;'
278
+ ;
279
+ $module.css('display', '');
280
+ module.refresh();
281
+ if( $module.css('display') !== displayType ) {
282
+ module.verbose('Setting inline visibility to', displayType);
283
+ $module
284
+ .attr('style', overrideStyle)
285
+ ;
286
+ }
287
+ },
288
+ direction: function() {
289
+ if($module.is(':visible') && !module.is.hidden()) {
290
+ module.debug('Automatically determining the direction of animation', 'Outward');
291
+ $module
292
+ .removeClass(className.inward)
293
+ .addClass(className.outward)
294
+ ;
295
+ }
296
+ else {
297
+ module.debug('Automatically determining the direction of animation', 'Inward');
298
+ $module
299
+ .removeClass(className.outward)
300
+ .addClass(className.inward)
301
+ ;
302
+ }
303
+ },
304
+ looping: function() {
305
+ module.debug('Transition set to loop');
306
+ $module
307
+ .addClass(className.looping)
308
+ ;
309
+ },
310
+ hidden: function() {
311
+ if(!module.is.hidden()) {
312
+ $module
313
+ .addClass(className.transition)
314
+ .addClass(className.hidden)
315
+ ;
316
+ if($module.css('display') !== 'none') {
317
+ module.verbose('Overriding default display to hide element');
318
+ $module
319
+ .css('display', 'none')
320
+ ;
321
+ }
322
+ }
323
+ },
324
+ visible: function() {
325
+ $module
326
+ .addClass(className.transition)
327
+ .addClass(className.visible)
328
+ ;
329
+ }
330
+ },
331
+
332
+ save: {
333
+ displayType: function(displayType) {
334
+ $module.data(metadata.displayType, displayType);
335
+ },
336
+ transitionExists: function(animation, exists) {
337
+ $.fn.transition.exists[animation] = exists;
338
+ module.verbose('Saving existence of transition', animation, exists);
339
+ },
340
+ conditions: function() {
341
+ var
342
+ clasName = $module.attr('class') || false,
343
+ style = $module.attr('style') || ''
344
+ ;
345
+ $module.removeClass(settings.animation);
346
+ module.remove.direction();
347
+ module.cache = {
348
+ className : $module.attr('class'),
349
+ style : module.get.style()
350
+ };
351
+ module.verbose('Saving original attributes', module.cache);
352
+ }
353
+ },
354
+
355
+ restore: {
356
+ conditions: function() {
357
+ if(module.cache === undefined) {
358
+ return false;
359
+ }
360
+ if(module.cache.className) {
361
+ $module.attr('class', module.cache.className);
362
+ }
363
+ else {
364
+ $module.removeAttr('class');
365
+ }
366
+ if(module.cache.style) {
367
+ module.verbose('Restoring original style attribute', module.cache.style);
368
+ $module.attr('style', module.cache.style);
369
+ }
370
+ if(module.is.looping()) {
371
+ module.remove.looping();
372
+ }
373
+ module.verbose('Restoring original attributes', module.cache);
374
+ }
375
+ },
376
+
377
+ add: {
378
+ failSafe: function() {
379
+ var
380
+ duration = module.get.duration()
381
+ ;
382
+ module.timer = setTimeout(module.complete, duration + 100);
383
+ module.verbose('Adding fail safe timer', module.timer);
384
+ }
385
+ },
386
+
387
+ remove: {
388
+ animating: function() {
389
+ $module.removeClass(className.animating);
390
+ },
391
+ animation: function() {
392
+ $module
393
+ .css({
394
+ '-webkit-animation' : '',
395
+ '-moz-animation' : '',
396
+ '-ms-animation' : '',
397
+ '-o-animation' : '',
398
+ 'animation' : ''
399
+ })
400
+ ;
401
+ },
402
+ animationEndCallback: function() {
403
+ $module.off('.complete');
404
+ },
405
+ display: function() {
406
+ $module.css('display', '');
407
+ },
408
+ direction: function() {
409
+ $module
410
+ .removeClass(className.inward)
411
+ .removeClass(className.outward)
412
+ ;
413
+ },
414
+ failSafe: function() {
415
+ module.verbose('Removing fail safe timer', module.timer);
416
+ if(module.timer) {
417
+ clearTimeout(module.timer);
418
+ }
419
+ },
420
+ hidden: function() {
421
+ $module.removeClass(className.hidden);
422
+ },
423
+ visible: function() {
424
+ $module.removeClass(className.visible);
425
+ },
426
+ looping: function() {
427
+ module.debug('Transitions are no longer looping');
428
+ $module
429
+ .removeClass(className.looping)
430
+ ;
431
+ module.forceRepaint();
432
+ },
433
+ transition: function() {
434
+ $module
435
+ .removeClass(className.visible)
436
+ .removeClass(className.hidden)
437
+ ;
438
+ }
439
+ },
440
+ get: {
441
+ settings: function(animation, duration, onComplete) {
442
+ // single settings object
443
+ if(typeof animation == 'object') {
444
+ return $.extend(true, {}, $.fn.transition.settings, animation);
445
+ }
446
+ // all arguments provided
447
+ else if(typeof onComplete == 'function') {
448
+ return $.extend({}, $.fn.transition.settings, {
449
+ animation : animation,
450
+ onComplete : onComplete,
451
+ duration : duration
452
+ });
453
+ }
454
+ // only duration provided
455
+ else if(typeof duration == 'string' || typeof duration == 'number') {
456
+ return $.extend({}, $.fn.transition.settings, {
457
+ animation : animation,
458
+ duration : duration
459
+ });
460
+ }
461
+ // duration is actually settings object
462
+ else if(typeof duration == 'object') {
463
+ return $.extend({}, $.fn.transition.settings, duration, {
464
+ animation : animation
465
+ });
466
+ }
467
+ // duration is actually callback
468
+ else if(typeof duration == 'function') {
469
+ return $.extend({}, $.fn.transition.settings, {
470
+ animation : animation,
471
+ onComplete : duration
472
+ });
473
+ }
474
+ // only animation provided
475
+ else {
476
+ return $.extend({}, $.fn.transition.settings, {
477
+ animation : animation
478
+ });
479
+ }
480
+ return $.fn.transition.settings;
481
+ },
482
+ duration: function(duration) {
483
+ duration = duration || settings.duration;
484
+ if(duration === false) {
485
+ duration = $module.css('animation-duration') || 0;
486
+ }
487
+ return (typeof duration === 'string')
488
+ ? (duration.indexOf('ms') > -1)
489
+ ? parseFloat(duration)
490
+ : parseFloat(duration) * 1000
491
+ : duration
492
+ ;
493
+ },
494
+ displayType: function() {
495
+ if(settings.displayType) {
496
+ return settings.displayType;
497
+ }
498
+ if($module.data(metadata.displayType) === undefined) {
499
+ // create fake element to determine display state
500
+ module.can.transition(true);
501
+ }
502
+ return $module.data(metadata.displayType);
503
+ },
504
+ style: function() {
505
+ var
506
+ style = $module.attr('style') || ''
507
+ ;
508
+ return style.replace(/display.*?;/, '');
509
+ },
510
+ transitionExists: function(animation) {
511
+ return $.fn.transition.exists[animation];
512
+ },
513
+ animationName: function() {
514
+ var
515
+ element = document.createElement('div'),
516
+ animations = {
517
+ 'animation' :'animationName',
518
+ 'OAnimation' :'oAnimationName',
519
+ 'MozAnimation' :'mozAnimationName',
520
+ 'WebkitAnimation' :'webkitAnimationName'
521
+ },
522
+ animation
523
+ ;
524
+ for(animation in animations){
525
+ if( element.style[animation] !== undefined ){
526
+ return animations[animation];
527
+ }
528
+ }
529
+ return false;
530
+ },
531
+ animationStartEvent: function() {
532
+ var
533
+ element = document.createElement('div'),
534
+ animations = {
535
+ 'animation' :'animationstart',
536
+ 'OAnimation' :'oAnimationStart',
537
+ 'MozAnimation' :'mozAnimationStart',
538
+ 'WebkitAnimation' :'webkitAnimationStart'
539
+ },
540
+ animation
541
+ ;
542
+ for(animation in animations){
543
+ if( element.style[animation] !== undefined ){
544
+ return animations[animation];
545
+ }
546
+ }
547
+ return false;
548
+ },
549
+ animationEndEvent: function() {
550
+ var
551
+ element = document.createElement('div'),
552
+ animations = {
553
+ 'animation' :'animationend',
554
+ 'OAnimation' :'oAnimationEnd',
555
+ 'MozAnimation' :'mozAnimationEnd',
556
+ 'WebkitAnimation' :'webkitAnimationEnd'
557
+ },
558
+ animation
559
+ ;
560
+ for(animation in animations){
561
+ if( element.style[animation] !== undefined ){
562
+ return animations[animation];
563
+ }
564
+ }
565
+ return false;
566
+ }
567
+
568
+ },
569
+
570
+ can: {
571
+ transition: function(forced) {
572
+ var
573
+ elementClass = $module.attr('class'),
574
+ tagName = $module.prop('tagName'),
575
+ animation = settings.animation,
576
+ transitionExists = module.get.transitionExists(animation),
577
+ $clone,
578
+ currentAnimation,
579
+ inAnimation,
580
+ directionExists,
581
+ displayType
582
+ ;
583
+ if( transitionExists === undefined || forced) {
584
+ module.verbose('Determining whether animation exists');
585
+ $clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
586
+ currentAnimation = $clone
587
+ .addClass(animation)
588
+ .removeClass(className.inward)
589
+ .removeClass(className.outward)
590
+ .addClass(className.animating)
591
+ .addClass(className.transition)
592
+ .css(animationName)
593
+ ;
594
+ inAnimation = $clone
595
+ .addClass(className.inward)
596
+ .css(animationName)
597
+ ;
598
+ displayType = $clone
599
+ .attr('class', elementClass)
600
+ .removeAttr('style')
601
+ .removeClass(className.hidden)
602
+ .removeClass(className.visible)
603
+ .show()
604
+ .css('display')
605
+ ;
606
+ module.verbose('Determining final display state', displayType);
607
+ $clone.remove();
608
+ if(currentAnimation != inAnimation) {
609
+ module.debug('Direction exists for animation', animation);
610
+ directionExists = true;
611
+ }
612
+ else if(currentAnimation == 'none' || !currentAnimation) {
613
+ module.debug('No animation defined in css', animation);
614
+ return;
615
+ }
616
+ else {
617
+ module.debug('Static animation found', animation, displayType);
618
+ directionExists = false;
619
+ }
620
+ module.save.displayType(displayType);
621
+ module.save.transitionExists(animation, directionExists);
622
+ }
623
+ return (transitionExists !== undefined)
624
+ ? transitionExists
625
+ : directionExists
626
+ ;
627
+ },
628
+ animate: function() {
629
+ // can transition does not return a value if animation does not exist
630
+ return (module.can.transition() !== undefined);
631
+ }
632
+ },
633
+
634
+ is: {
635
+ animating: function() {
636
+ return $module.hasClass(className.animating);
637
+ },
638
+ inward: function() {
639
+ return $module.hasClass(className.inward);
640
+ },
641
+ outward: function() {
642
+ return $module.hasClass(className.outward);
643
+ },
644
+ looping: function() {
645
+ return $module.hasClass(className.looping);
646
+ },
647
+ occurring: function(animation) {
648
+ animation = animation || settings.animation;
649
+ animation = '.' + animation.replace(' ', '.');
650
+ return ( $module.filter(animation).length > 0 );
651
+ },
652
+ visible: function() {
653
+ return $module.is(':visible');
654
+ },
655
+ hidden: function() {
656
+ return $module.css('visibility') === 'hidden';
657
+ },
658
+ supported: function() {
659
+ return(animationName !== false && animationEnd !== false);
660
+ }
661
+ },
662
+
663
+ hide: function() {
664
+ module.verbose('Hiding element');
665
+ if( module.is.animating() ) {
666
+ module.reset();
667
+ }
668
+ module.remove.display();
669
+ module.remove.visible();
670
+ module.set.hidden();
671
+ module.repaint();
672
+ },
673
+
674
+ show: function(display) {
675
+ module.verbose('Showing element', display);
676
+ module.remove.hidden();
677
+ module.set.visible();
678
+ module.repaint();
679
+ },
680
+
681
+ start: function() {
682
+ module.verbose('Starting animation');
683
+ $module.removeClass(className.disabled);
684
+ },
685
+
686
+ stop: function() {
687
+ module.debug('Stopping animation');
688
+ $module.addClass(className.disabled);
689
+ },
690
+
691
+ toggle: function() {
692
+ module.debug('Toggling play status');
693
+ $module.toggleClass(className.disabled);
694
+ },
695
+
696
+ setting: function(name, value) {
697
+ module.debug('Changing setting', name, value);
698
+ if( $.isPlainObject(name) ) {
699
+ $.extend(true, settings, name);
700
+ }
701
+ else if(value !== undefined) {
702
+ settings[name] = value;
703
+ }
704
+ else {
705
+ return settings[name];
706
+ }
707
+ },
708
+ internal: function(name, value) {
709
+ if( $.isPlainObject(name) ) {
710
+ $.extend(true, module, name);
711
+ }
712
+ else if(value !== undefined) {
713
+ module[name] = value;
714
+ }
715
+ else {
716
+ return module[name];
717
+ }
718
+ },
719
+ debug: function() {
720
+ if(settings.debug) {
721
+ if(settings.performance) {
722
+ module.performance.log(arguments);
723
+ }
724
+ else {
725
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
726
+ module.debug.apply(console, arguments);
727
+ }
728
+ }
729
+ },
730
+ verbose: function() {
731
+ if(settings.verbose && settings.debug) {
732
+ if(settings.performance) {
733
+ module.performance.log(arguments);
734
+ }
735
+ else {
736
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
737
+ module.verbose.apply(console, arguments);
738
+ }
739
+ }
740
+ },
741
+ error: function() {
742
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
743
+ module.error.apply(console, arguments);
744
+ },
745
+ performance: {
746
+ log: function(message) {
747
+ var
748
+ currentTime,
749
+ executionTime,
750
+ previousTime
751
+ ;
752
+ if(settings.performance) {
753
+ currentTime = new Date().getTime();
754
+ previousTime = time || currentTime;
755
+ executionTime = currentTime - previousTime;
756
+ time = currentTime;
757
+ performance.push({
758
+ 'Name' : message[0],
759
+ 'Arguments' : [].slice.call(message, 1) || '',
760
+ 'Element' : element,
761
+ 'Execution Time' : executionTime
762
+ });
763
+ }
764
+ clearTimeout(module.performance.timer);
765
+ module.performance.timer = setTimeout(module.performance.display, 600);
766
+ },
767
+ display: function() {
768
+ var
769
+ title = settings.name + ':',
770
+ totalTime = 0
771
+ ;
772
+ time = false;
773
+ clearTimeout(module.performance.timer);
774
+ $.each(performance, function(index, data) {
775
+ totalTime += data['Execution Time'];
776
+ });
777
+ title += ' ' + totalTime + 'ms';
778
+ if(moduleSelector) {
779
+ title += ' \'' + moduleSelector + '\'';
780
+ }
781
+ if($allModules.length > 1) {
782
+ title += ' ' + '(' + $allModules.length + ')';
783
+ }
784
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
785
+ console.groupCollapsed(title);
786
+ if(console.table) {
787
+ console.table(performance);
788
+ }
789
+ else {
790
+ $.each(performance, function(index, data) {
791
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
792
+ });
793
+ }
794
+ console.groupEnd();
795
+ }
796
+ performance = [];
797
+ }
798
+ },
799
+ // modified for transition to return invoke success
800
+ invoke: function(query, passedArguments, context) {
801
+ var
802
+ object = instance,
803
+ maxDepth,
804
+ found,
805
+ response
806
+ ;
807
+ passedArguments = passedArguments || queryArguments;
808
+ context = element || context;
809
+ if(typeof query == 'string' && object !== undefined) {
810
+ query = query.split(/[\. ]/);
811
+ maxDepth = query.length - 1;
812
+ $.each(query, function(depth, value) {
813
+ var camelCaseValue = (depth != maxDepth)
814
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
815
+ : query
816
+ ;
817
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
818
+ object = object[camelCaseValue];
819
+ }
820
+ else if( object[camelCaseValue] !== undefined ) {
821
+ found = object[camelCaseValue];
822
+ return false;
823
+ }
824
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
825
+ object = object[value];
826
+ }
827
+ else if( object[value] !== undefined ) {
828
+ found = object[value];
829
+ return false;
830
+ }
831
+ else {
832
+ return false;
833
+ }
834
+ });
835
+ }
836
+ if ( $.isFunction( found ) ) {
837
+ response = found.apply(context, passedArguments);
838
+ }
839
+ else if(found !== undefined) {
840
+ response = found;
841
+ }
842
+
843
+ if($.isArray(returnedValue)) {
844
+ returnedValue.push(response);
845
+ }
846
+ else if(returnedValue !== undefined) {
847
+ returnedValue = [returnedValue, response];
848
+ }
849
+ else if(response !== undefined) {
850
+ returnedValue = response;
851
+ }
852
+ return (found !== undefined)
853
+ ? found
854
+ : false
855
+ ;
856
+ }
857
+ };
858
+ module.initialize();
859
+ })
860
+ ;
861
+ return (returnedValue !== undefined)
862
+ ? returnedValue
863
+ : this
864
+ ;
865
+ };
866
+
867
+ // Records if CSS transition is available
868
+ $.fn.transition.exists = {};
869
+
870
+ $.fn.transition.settings = {
871
+
872
+ // module info
873
+ name : 'Transition',
874
+
875
+ // debug content outputted to console
876
+ debug : false,
877
+
878
+ // verbose debug output
879
+ verbose : true,
880
+
881
+ // performance data output
882
+ performance : true,
883
+
884
+ // event namespace
885
+ namespace : 'transition',
886
+
887
+ // animation complete event
888
+ onStart : function() {},
889
+ onComplete : function() {},
890
+ onShow : function() {},
891
+ onHide : function() {},
892
+
893
+ // whether timeout should be used to ensure callback fires in cases animationend does not
894
+ useFailSafe : true,
895
+
896
+ // whether EXACT animation can occur twice in a row
897
+ allowRepeats : false,
898
+
899
+ // Override final display type on visible
900
+ displayType : false,
901
+
902
+ // animation duration
903
+ animation : 'fade',
904
+ duration : false,
905
+
906
+ // new animations will occur after previous ones
907
+ queue : true,
908
+
909
+ metadata : {
910
+ displayType: 'display'
911
+ },
912
+
913
+ className : {
914
+ animating : 'animating',
915
+ disabled : 'disabled',
916
+ hidden : 'hidden',
917
+ inward : 'in',
918
+ loading : 'loading',
919
+ looping : 'looping',
920
+ outward : 'out',
921
+ transition : 'transition',
922
+ visible : 'visible'
923
+ },
924
+
925
+ // possible errors
926
+ error: {
927
+ noAnimation : 'There is no css animation matching the one you specified.',
928
+ repeated : 'That animation is already occurring, cancelling repeated animation',
929
+ method : 'The method you called is not defined',
930
+ support : 'This browser does not support CSS animations'
931
+ }
932
+
933
+ };
934
+
935
+
936
+ })( jQuery, window , document );