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,11 @@
1
+ /*
2
+ * # Semantic UI - 1.8.1
3
+ * https://github.com/Semantic-Org/Semantic-UI
4
+ * http://www.semantic-ui.com/
5
+ *
6
+ * Copyright 2014 Contributors
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+ .ui.segment{position:relative;background-color:#fff;box-shadow:0 0 0 1px rgba(39,41,43,.15),0 1px 2px 0 rgba(0,0,0,.05);margin:1rem 0;padding:1em;border-radius:.2857rem;border:none}.ui.segment:first-child{margin-top:0}.ui.segment:last-child{margin-bottom:0}.ui.segment:after{content:'';display:block;height:0;clear:both;visibility:hidden}.ui[class*="vertical segment"]{margin:0;padding-left:0;padding-right:0;background-color:transparent;border-radius:0;border:none;box-shadow:0 -1px 0 rgba(39,41,43,.15) inset}.ui[class*="vertical segment"]:last-child{box-shadow:none}.ui[class*="horizontal segment"]{margin:0;padding-top:0;padding-bottom:0;background-color:transparent;border-radius:0;border:none;box-shadow:1px 0 0 rgba(39,41,43,.15)}.ui.inverted.segment>.ui.header{color:#fff}.ui[class*="bottom attached"].segment>[class*="top attached"].label{border-top-left-radius:0;border-top-right-radius:0}.ui[class*="top attached"].segment>[class*="bottom attached"].label{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui.attached.segment:not(.top):not(.bottom)>[class*="top attached"].label{border-top-left-radius:0;border-top-right-radius:0}.ui.attached.segment:not(.top):not(.bottom)>[class*="bottom attached"].label{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui.grid .ui.segment.column,.ui.page.grid.segment{padding-top:2em;padding-bottom:2em}.ui.grid.segment{margin:1rem 0;border-radius:.2857rem}.ui.basic.table.segment{background:#fff;border:none;box-shadow:0 0 0 1px rgba(39,41,43,.15),0 1px 2px 0 rgba(0,0,0,.05)}.ui[class*="very basic"].table.segment{padding:1em}.ui.piled.segment{margin:3em 0;box-shadow:0 0 1px 1px rgba(39,41,43,.15);z-index:auto}.ui.piled.segment:first-child{margin-top:0}.ui.piled.segment:last-child{margin-bottom:0}.ui.piled.segment:after,.ui.piled.segment:before{background-color:#fff;visibility:visible;content:'';display:block;height:100%;left:0;position:absolute;width:100%;box-shadow:0 0 1px 1px rgba(39,41,43,.15)}.ui.piled.segment:after{-webkit-transform:rotate(1.2deg);-ms-transform:rotate(1.2deg);transform:rotate(1.2deg);top:0;z-index:-1}.ui.piled.segment:before{-webkit-transform:rotate(-1.2deg);-ms-transform:rotate(-1.2deg);transform:rotate(-1.2deg);top:0;z-index:-2}.ui[class*="top attached"].piled.segment{margin-top:3em;margin-bottom:0}.ui.piled.segment[class*="top attached"]:first-child{margin-top:0}.ui.piled.segment[class*="bottom attached"]{margin-top:0;margin-bottom:3em}.ui.piled.segment[class*="bottom attached"]:last-child{margin-bottom:0}.ui.stacked.segment{padding-bottom:1.4em}.ui.stacked.segment:after,.ui.stacked.segment:before{content:'';position:absolute;bottom:-3px;left:0;border-top:1px solid rgba(39,41,43,.15);background-color:rgba(0,0,0,.03);width:100%;height:6px;visibility:visible}.ui.stacked.segment:before{display:none}.ui.tall.stacked.segment:before{display:block;bottom:0}.ui.stacked.inverted.segment:after,.ui.stacked.inverted.segment:before{background-color:rgba(0,0,0,.03);border-top:1px solid rgba(39,41,43,.3)}.ui.compact.segment{display:table}.ui.circular.segment{display:table-cell;padding:2em;text-align:center;vertical-align:middle;border-radius:500em}.ui.raised.segment{box-shadow:0 0 0 1px rgba(39,41,43,.15),0 1px 4px 0 rgba(0,0,0,.15)}.ui.disabled.segment{opacity:.3;color:rgba(40,40,40,.3)}.ui.loading.segment{position:relative;cursor:default;point-events:none;text-shadow:none!important;color:transparent!important;-webkit-transition:all 0s linear;transition:all 0s linear}.ui.loading.segment:before{position:absolute;content:'';top:0;left:0;background:rgba(255,255,255,.8);width:100%;height:100%;border-radius:.2857rem;z-index:100}.ui.loading.segment:after{position:absolute;content:'';top:50%;left:50%;margin:-1.5em 0 0 -1.5em;width:3em;height:3em;-webkit-animation:segment-spin .6s linear;animation:segment-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#aaa rgba(0,0,0,.1) rgba(0,0,0,.1);border-style:solid;border-width:.2em;box-shadow:0 0 0 1px transparent;visibility:visible;z-index:101}@-webkit-keyframes segment-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes segment-spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ui.basic.segment{position:relative;background-color:transparent;box-shadow:none;border-radius:0}.ui.fitted.segment{padding:0}.ui.black.segment:not(.inverted){border-top:2px solid #1b1c1d}.ui.blue.segment:not(.inverted){border-top:2px solid #3b83c0}.ui.green.segment:not(.inverted){border-top:2px solid #5bbd72}.ui.orange.segment:not(.inverted){border-top:2px solid #e07b53}.ui.pink.segment:not(.inverted){border-top:2px solid #d9499a}.ui.purple.segment:not(.inverted){border-top:2px solid #564f8a}.ui.red.segment:not(.inverted){border-top:2px solid #d95c5c}.ui.teal.segment:not(.inverted){border-top:2px solid #00b5ad}.ui.yellow.segment:not(.inverted){border-top:2px solid #f2c61f}.ui.black.segment:not(.inverted):not(.attached),.ui.blue.segment:not(.inverted):not(.attached),.ui.green.segment:not(.inverted):not(.attached),.ui.orange.segment:not(.inverted):not(.attached),.ui.pink.segment:not(.inverted):not(.attached),.ui.purple.segment:not(.inverted):not(.attached),.ui.red.segment:not(.inverted):not(.attached),.ui.teal.segment:not(.inverted):not(.attached),.ui.yellow.segment:not(.inverted):not(.attached){border-top-left-radius:.2857rem!important;border-top-right-radius:.2857rem!important}.ui.inverted.black.segment,.ui.inverted.segment{background-color:#1b1c1d!important;color:#fff!important}.ui.inverted.blue.segment{background-color:#3b83c0!important;color:#fff!important}.ui.inverted.green.segment{background-color:#5bbd72!important;color:#fff!important}.ui.inverted.orange.segment{background-color:#e07b53!important;color:#fff!important}.ui.inverted.pink.segment{background-color:#d9499a!important;color:#fff!important}.ui.inverted.purple.segment{background-color:#564f8a!important;color:#fff!important}.ui.inverted.red.segment{background-color:#d95c5c!important;color:#fff!important}.ui.inverted.teal.segment{background-color:#00b5ad!important;color:#fff!important}.ui.inverted.yellow.segment{background-color:#f2c61f!important;color:#fff!important}.ui[class*="left aligned"].segment{text-align:left}.ui[class*="right aligned"].segment{text-align:right}.ui[class*="center aligned"].segment{text-align:center}.ui.floated.segment,.ui[class*="left floated"].segment{float:left;margin-right:1rem}.ui[class*="right floated"].segment{float:right;margin-left:1rem}.ui.inverted.segment{border:none;box-shadow:none}.ui.inverted.segment .segment{color:rgba(0,0,0,.8)}.ui.inverted.segment .inverted.segment{color:#fff}.ui.inverted.segment,.ui.primary.inverted.segment{background-color:#1b1c1d;color:#fff}.ui.inverted.attached.segment,.ui.inverted.block.segment{border-color:#555}.ui.secondary.segment{background:#faf9fa;color:rgba(0,0,0,.8)}.ui.tertiary.segment{background:#ebebeb;color:rgba(0,0,0,.8)}.ui.secondary.inverted.segment{background:-webkit-linear-gradient(rgba(255,255,255,.3) 0,rgba(255,255,255,.3) 100%);background:linear-gradient(rgba(255,255,255,.3) 0,rgba(255,255,255,.3) 100%);color:#fafafa}.ui.tertiary.inverted.segment{background:-webkit-linear-gradient(rgba(255,255,255,.5) 0,rgba(255,255,255,.5) 100%);background:linear-gradient(rgba(255,255,255,.5) 0,rgba(255,255,255,.5) 100%);color:#f0f0f0}.ui.segment.attached{top:0;bottom:0;margin:0 -1px;width:-webkit-calc(100% + 2px);width:calc(100% + 2px);max-width:-webkit-calc(100% + 2px);max-width:calc(100% + 2px);border-radius:0;box-shadow:none;border:1px solid #d4d4d5}.ui.segment.attached+.ui.segment.attached:not(.top){border-top:none}.ui[class*="top attached"].segment{top:0;bottom:0;margin-top:1rem;margin-bottom:0;border-radius:.2857rem .2857rem 0 0}.ui.segment[class*="top attached"]:first-child{margin-top:0}.ui.segment[class*="bottom attached"]{top:0;bottom:0;margin-top:0;margin-bottom:1rem;box-shadow:none,0 1px 2px 0 rgba(0,0,0,.05);border-radius:0 0 .2857rem .2857rem}.ui.segment[class*="bottom attached"]:last-child{margin-bottom:0}
@@ -0,0 +1,155 @@
1
+ /*
2
+ * # Semantic UI - 1.8.1
3
+ * https://github.com/Semantic-Org/Semantic-UI
4
+ * http://www.semantic-ui.com/
5
+ *
6
+ * Copyright 2014 Contributors
7
+ * Released under the MIT license
8
+ * http://opensource.org/licenses/MIT
9
+ *
10
+ */
11
+
12
+
13
+
14
+ /*******************************
15
+ Shape
16
+ *******************************/
17
+
18
+ .ui.shape {
19
+ position: relative;
20
+ display: inline-block;
21
+ -webkit-perspective: 2000px;
22
+ perspective: 2000px;
23
+ }
24
+ .ui.shape .sides {
25
+ -webkit-transform-style: preserve-3d;
26
+ transform-style: preserve-3d;
27
+ }
28
+ .ui.shape .side {
29
+ opacity: 1;
30
+ width: 100%;
31
+ margin: 0em !important;
32
+ -webkit-backface-visibility: hidden;
33
+ backface-visibility: hidden;
34
+ }
35
+ .ui.shape .side {
36
+ display: none;
37
+ }
38
+ .ui.shape .side > * {
39
+ -webkit-backface-visibility: visible !important;
40
+ backface-visibility: visible !important;
41
+ }
42
+
43
+
44
+ /*******************************
45
+ Types
46
+ *******************************/
47
+
48
+ .ui.cube.shape .side {
49
+ min-width: 15em;
50
+ height: 15em;
51
+ padding: 2em;
52
+ background-color: #e6e6e6;
53
+ color: rgba(0, 0, 0, 0.8);
54
+ box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.3);
55
+ }
56
+ .ui.cube.shape .side > .content {
57
+ width: 100%;
58
+ height: 100%;
59
+ display: table;
60
+ text-align: center;
61
+ -webkit-user-select: text;
62
+ -moz-user-select: text;
63
+ -ms-user-select: text;
64
+ user-select: text;
65
+ }
66
+ .ui.cube.shape .side > .content > div {
67
+ display: table-cell;
68
+ vertical-align: middle;
69
+ font-size: 2em;
70
+ }
71
+
72
+
73
+ /*******************************
74
+ Variations
75
+ *******************************/
76
+
77
+ .ui.text.shape.animating .sides {
78
+ position: static;
79
+ }
80
+ .ui.text.shape .side {
81
+ white-space: nowrap;
82
+ }
83
+ .ui.text.shape .side > * {
84
+ white-space: normal;
85
+ }
86
+
87
+
88
+ /*******************************
89
+ States
90
+ *******************************/
91
+
92
+
93
+ /*--------------
94
+ Loading
95
+ ---------------*/
96
+
97
+ .ui.loading.shape {
98
+ position: absolute;
99
+ top: -9999px;
100
+ left: -9999px;
101
+ }
102
+
103
+ /*--------------
104
+ Animating
105
+ ---------------*/
106
+
107
+ .ui.shape .animating.side {
108
+ position: absolute;
109
+ top: 0px;
110
+ left: 0px;
111
+ z-index: 100;
112
+ }
113
+ .ui.shape .hidden.side {
114
+ opacity: 0.4;
115
+ }
116
+
117
+ /*--------------
118
+ CSS
119
+ ---------------*/
120
+
121
+ .ui.shape.animating {
122
+ -webkit-transition: all 0.6s ease-in-out;
123
+ transition: all 0.6s ease-in-out;
124
+ }
125
+ .ui.shape.animating .sides {
126
+ position: absolute;
127
+ }
128
+ .ui.shape.animating .sides {
129
+ -webkit-transition: all 0.6s ease-in-out;
130
+ transition: all 0.6s ease-in-out;
131
+ }
132
+ .ui.shape.animating .side {
133
+ -webkit-transition: opacity 0.6s ease-in-out;
134
+ transition: opacity 0.6s ease-in-out;
135
+ }
136
+
137
+ /*--------------
138
+ Active
139
+ ---------------*/
140
+
141
+ .ui.shape .active.side {
142
+ display: block;
143
+ }
144
+
145
+
146
+ /*******************************
147
+ Theme Overrides
148
+ *******************************/
149
+
150
+
151
+
152
+ /*******************************
153
+ User Overrides
154
+ *******************************/
155
+
@@ -0,0 +1,830 @@
1
+ /*
2
+ * # Semantic - Shape
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.shape = function(parameters) {
17
+ var
18
+ $allModules = $(this),
19
+ $body = $('body'),
20
+
21
+ time = new Date().getTime(),
22
+ performance = [],
23
+
24
+ query = arguments[0],
25
+ methodInvoked = (typeof query == 'string'),
26
+ queryArguments = [].slice.call(arguments, 1),
27
+
28
+ requestAnimationFrame = window.requestAnimationFrame
29
+ || window.mozRequestAnimationFrame
30
+ || window.webkitRequestAnimationFrame
31
+ || window.msRequestAnimationFrame
32
+ || function(callback) { setTimeout(callback, 0); },
33
+
34
+ returnedValue
35
+ ;
36
+
37
+ $allModules
38
+ .each(function() {
39
+ var
40
+ moduleSelector = $allModules.selector || '',
41
+ settings = $.extend(true, {}, $.fn.shape.settings, parameters),
42
+
43
+ // internal aliases
44
+ namespace = settings.namespace,
45
+ selector = settings.selector,
46
+ error = settings.error,
47
+ className = settings.className,
48
+
49
+ // define namespaces for modules
50
+ eventNamespace = '.' + namespace,
51
+ moduleNamespace = 'module-' + namespace,
52
+
53
+ // selector cache
54
+ $module = $(this),
55
+ $sides = $module.find(selector.sides),
56
+ $side = $module.find(selector.side),
57
+
58
+ // private variables
59
+ nextIndex = false,
60
+ $activeSide,
61
+ $nextSide,
62
+
63
+ // standard module
64
+ element = this,
65
+ instance = $module.data(moduleNamespace),
66
+ module
67
+ ;
68
+
69
+ module = {
70
+
71
+ initialize: function() {
72
+ module.verbose('Initializing module for', element);
73
+ module.set.defaultSide();
74
+ module.instantiate();
75
+ },
76
+
77
+ instantiate: function() {
78
+ module.verbose('Storing instance of module', module);
79
+ instance = module;
80
+ $module
81
+ .data(moduleNamespace, instance)
82
+ ;
83
+ },
84
+
85
+ destroy: function() {
86
+ module.verbose('Destroying previous module for', element);
87
+ $module
88
+ .removeData(moduleNamespace)
89
+ .off(eventNamespace)
90
+ ;
91
+ },
92
+
93
+ refresh: function() {
94
+ module.verbose('Refreshing selector cache for', element);
95
+ $module = $(element);
96
+ $sides = $(this).find(selector.shape);
97
+ $side = $(this).find(selector.side);
98
+ },
99
+
100
+ repaint: function() {
101
+ module.verbose('Forcing repaint event');
102
+ var
103
+ shape = $sides.get(0) || document.createElement('div'),
104
+ fakeAssignment = shape.offsetWidth
105
+ ;
106
+ },
107
+
108
+ animate: function(propertyObject, callback) {
109
+ module.verbose('Animating box with properties', propertyObject);
110
+ callback = callback || function(event) {
111
+ module.verbose('Executing animation callback');
112
+ if(event !== undefined) {
113
+ event.stopPropagation();
114
+ }
115
+ module.reset();
116
+ module.set.active();
117
+ };
118
+ settings.beforeChange.call($nextSide.get());
119
+ if(module.get.transitionEvent()) {
120
+ module.verbose('Starting CSS animation');
121
+ $module
122
+ .addClass(className.animating)
123
+ ;
124
+ $sides
125
+ .css(propertyObject)
126
+ .one(module.get.transitionEvent(), callback)
127
+ ;
128
+ module.set.duration(settings.duration);
129
+ requestAnimationFrame(function() {
130
+ $module
131
+ .addClass(className.animating)
132
+ ;
133
+ $activeSide
134
+ .addClass(className.hidden)
135
+ ;
136
+ });
137
+ }
138
+ else {
139
+ callback();
140
+ }
141
+ },
142
+
143
+ queue: function(method) {
144
+ module.debug('Queueing animation of', method);
145
+ $sides
146
+ .one(module.get.transitionEvent(), function() {
147
+ module.debug('Executing queued animation');
148
+ setTimeout(function(){
149
+ $module.shape(method);
150
+ }, 0);
151
+ })
152
+ ;
153
+ },
154
+
155
+ reset: function() {
156
+ module.verbose('Animating states reset');
157
+ $module
158
+ .removeClass(className.animating)
159
+ .attr('style', '')
160
+ .removeAttr('style')
161
+ ;
162
+ // removeAttr style does not consistently work in safari
163
+ $sides
164
+ .attr('style', '')
165
+ .removeAttr('style')
166
+ ;
167
+ $side
168
+ .attr('style', '')
169
+ .removeAttr('style')
170
+ .removeClass(className.hidden)
171
+ ;
172
+ $nextSide
173
+ .removeClass(className.animating)
174
+ .attr('style', '')
175
+ .removeAttr('style')
176
+ ;
177
+ },
178
+
179
+ is: {
180
+ complete: function() {
181
+ return ($side.filter('.' + className.active)[0] == $nextSide[0]);
182
+ },
183
+ animating: function() {
184
+ return $module.hasClass(className.animating);
185
+ }
186
+ },
187
+
188
+ set: {
189
+
190
+ defaultSide: function() {
191
+ $activeSide = $module.find('.' + settings.className.active);
192
+ $nextSide = ( $activeSide.next(selector.side).length > 0 )
193
+ ? $activeSide.next(selector.side)
194
+ : $module.find(selector.side).first()
195
+ ;
196
+ nextIndex = false;
197
+ module.verbose('Active side set to', $activeSide);
198
+ module.verbose('Next side set to', $nextSide);
199
+ },
200
+
201
+ duration: function(duration) {
202
+ duration = duration || settings.duration;
203
+ duration = (typeof duration == 'number')
204
+ ? duration + 'ms'
205
+ : duration
206
+ ;
207
+ module.verbose('Setting animation duration', duration);
208
+ $sides.add($side)
209
+ .css({
210
+ '-webkit-transition-duration': duration,
211
+ '-moz-transition-duration': duration,
212
+ '-ms-transition-duration': duration,
213
+ '-o-transition-duration': duration,
214
+ 'transition-duration': duration
215
+ })
216
+ ;
217
+ },
218
+
219
+ stageSize: function() {
220
+ var
221
+ $clone = $module.clone().addClass(className.loading),
222
+ $activeSide = $clone.find('.' + settings.className.active),
223
+ $nextSide = (nextIndex)
224
+ ? $clone.find(selector.side).eq(nextIndex)
225
+ : ( $activeSide.next(selector.side).length > 0 )
226
+ ? $activeSide.next(selector.side)
227
+ : $clone.find(selector.side).first(),
228
+ newSize = {}
229
+ ;
230
+ $activeSide.removeClass(className.active);
231
+ $nextSide.addClass(className.active);
232
+ $clone.insertAfter($module);
233
+ newSize = {
234
+ width : $nextSide.outerWidth(),
235
+ height : $nextSide.outerHeight()
236
+ };
237
+ $clone.remove();
238
+ $module
239
+ .css(newSize)
240
+ ;
241
+ module.verbose('Resizing stage to fit new content', newSize);
242
+ },
243
+
244
+ nextSide: function(selector) {
245
+ nextIndex = selector;
246
+ $nextSide = $side.filter(selector);
247
+ nextIndex = $side.index($nextSide);
248
+ if($nextSide.length === 0) {
249
+ module.set.defaultSide();
250
+ module.error(error.side);
251
+ }
252
+ module.verbose('Next side manually set to', $nextSide);
253
+ },
254
+
255
+ active: function() {
256
+ module.verbose('Setting new side to active', $nextSide);
257
+ $side
258
+ .removeClass(className.active)
259
+ ;
260
+ $nextSide
261
+ .addClass(className.active)
262
+ ;
263
+ settings.onChange.call($nextSide.get());
264
+ module.set.defaultSide();
265
+ }
266
+ },
267
+
268
+ flip: {
269
+
270
+ up: function() {
271
+ if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
272
+ module.debug('Side already visible', $nextSide);
273
+ return;
274
+ }
275
+ if( !module.is.animating()) {
276
+ module.debug('Flipping up', $nextSide);
277
+ module.set.stageSize();
278
+ module.stage.above();
279
+ module.animate( module.get.transform.up() );
280
+ }
281
+ else {
282
+ module.queue('flip up');
283
+ }
284
+ },
285
+
286
+ down: function() {
287
+ if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
288
+ module.debug('Side already visible', $nextSide);
289
+ return;
290
+ }
291
+ if( !module.is.animating()) {
292
+ module.debug('Flipping down', $nextSide);
293
+ module.set.stageSize();
294
+ module.stage.below();
295
+ module.animate( module.get.transform.down() );
296
+ }
297
+ else {
298
+ module.queue('flip down');
299
+ }
300
+ },
301
+
302
+ left: function() {
303
+ if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
304
+ module.debug('Side already visible', $nextSide);
305
+ return;
306
+ }
307
+ if( !module.is.animating()) {
308
+ module.debug('Flipping left', $nextSide);
309
+ module.set.stageSize();
310
+ module.stage.left();
311
+ module.animate(module.get.transform.left() );
312
+ }
313
+ else {
314
+ module.queue('flip left');
315
+ }
316
+ },
317
+
318
+ right: function() {
319
+ if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
320
+ module.debug('Side already visible', $nextSide);
321
+ return;
322
+ }
323
+ if( !module.is.animating()) {
324
+ module.debug('Flipping right', $nextSide);
325
+ module.set.stageSize();
326
+ module.stage.right();
327
+ module.animate(module.get.transform.right() );
328
+ }
329
+ else {
330
+ module.queue('flip right');
331
+ }
332
+ },
333
+
334
+ over: function() {
335
+ if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
336
+ module.debug('Side already visible', $nextSide);
337
+ return;
338
+ }
339
+ if( !module.is.animating()) {
340
+ module.debug('Flipping over', $nextSide);
341
+ module.set.stageSize();
342
+ module.stage.behind();
343
+ module.animate(module.get.transform.over() );
344
+ }
345
+ else {
346
+ module.queue('flip over');
347
+ }
348
+ },
349
+
350
+ back: function() {
351
+ if(module.is.complete() && !module.is.animating() && !settings.allowRepeats) {
352
+ module.debug('Side already visible', $nextSide);
353
+ return;
354
+ }
355
+ if( !module.is.animating()) {
356
+ module.debug('Flipping back', $nextSide);
357
+ module.set.stageSize();
358
+ module.stage.behind();
359
+ module.animate(module.get.transform.back() );
360
+ }
361
+ else {
362
+ module.queue('flip back');
363
+ }
364
+ }
365
+
366
+ },
367
+
368
+ get: {
369
+
370
+ transform: {
371
+ up: function() {
372
+ var
373
+ translate = {
374
+ y: -(($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
375
+ z: -($activeSide.outerHeight() / 2)
376
+ }
377
+ ;
378
+ return {
379
+ transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(-90deg)'
380
+ };
381
+ },
382
+
383
+ down: function() {
384
+ var
385
+ translate = {
386
+ y: -(($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
387
+ z: -($activeSide.outerHeight() / 2)
388
+ }
389
+ ;
390
+ return {
391
+ transform: 'translateY(' + translate.y + 'px) translateZ('+ translate.z + 'px) rotateX(90deg)'
392
+ };
393
+ },
394
+
395
+ left: function() {
396
+ var
397
+ translate = {
398
+ x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2),
399
+ z : -($activeSide.outerWidth() / 2)
400
+ }
401
+ ;
402
+ return {
403
+ transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(90deg)'
404
+ };
405
+ },
406
+
407
+ right: function() {
408
+ var
409
+ translate = {
410
+ x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2),
411
+ z : -($activeSide.outerWidth() / 2)
412
+ }
413
+ ;
414
+ return {
415
+ transform: 'translateX(' + translate.x + 'px) translateZ(' + translate.z + 'px) rotateY(-90deg)'
416
+ };
417
+ },
418
+
419
+ over: function() {
420
+ var
421
+ translate = {
422
+ x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2)
423
+ }
424
+ ;
425
+ return {
426
+ transform: 'translateX(' + translate.x + 'px) rotateY(180deg)'
427
+ };
428
+ },
429
+
430
+ back: function() {
431
+ var
432
+ translate = {
433
+ x : -(($activeSide.outerWidth() - $nextSide.outerWidth()) / 2)
434
+ }
435
+ ;
436
+ return {
437
+ transform: 'translateX(' + translate.x + 'px) rotateY(-180deg)'
438
+ };
439
+ }
440
+ },
441
+
442
+ transitionEvent: function() {
443
+ var
444
+ element = document.createElement('element'),
445
+ transitions = {
446
+ 'transition' :'transitionend',
447
+ 'OTransition' :'oTransitionEnd',
448
+ 'MozTransition' :'transitionend',
449
+ 'WebkitTransition' :'webkitTransitionEnd'
450
+ },
451
+ transition
452
+ ;
453
+ for(transition in transitions){
454
+ if( element.style[transition] !== undefined ){
455
+ return transitions[transition];
456
+ }
457
+ }
458
+ },
459
+
460
+ nextSide: function() {
461
+ return ( $activeSide.next(selector.side).length > 0 )
462
+ ? $activeSide.next(selector.side)
463
+ : $module.find(selector.side).first()
464
+ ;
465
+ }
466
+
467
+ },
468
+
469
+ stage: {
470
+
471
+ above: function() {
472
+ var
473
+ box = {
474
+ origin : (($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
475
+ depth : {
476
+ active : ($nextSide.outerHeight() / 2),
477
+ next : ($activeSide.outerHeight() / 2)
478
+ }
479
+ }
480
+ ;
481
+ module.verbose('Setting the initial animation position as above', $nextSide, box);
482
+ $activeSide
483
+ .css({
484
+ 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
485
+ })
486
+ ;
487
+ $nextSide
488
+ .addClass(className.animating)
489
+ .css({
490
+ 'display' : 'block',
491
+ 'top' : box.origin + 'px',
492
+ 'transform' : 'rotateX(90deg) translateZ(' + box.depth.next + 'px)'
493
+ })
494
+ ;
495
+ },
496
+
497
+ below: function() {
498
+ var
499
+ box = {
500
+ origin : (($activeSide.outerHeight() - $nextSide.outerHeight()) / 2),
501
+ depth : {
502
+ active : ($nextSide.outerHeight() / 2),
503
+ next : ($activeSide.outerHeight() / 2)
504
+ }
505
+ }
506
+ ;
507
+ module.verbose('Setting the initial animation position as below', $nextSide, box);
508
+ $activeSide
509
+ .css({
510
+ 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
511
+ })
512
+ ;
513
+ $nextSide
514
+ .addClass(className.animating)
515
+ .css({
516
+ 'display' : 'block',
517
+ 'top' : box.origin + 'px',
518
+ 'transform' : 'rotateX(-90deg) translateZ(' + box.depth.next + 'px)'
519
+ })
520
+ ;
521
+ },
522
+
523
+ left: function() {
524
+ var
525
+ box = {
526
+ origin : ( ( $activeSide.outerWidth() - $nextSide.outerWidth() ) / 2),
527
+ depth : {
528
+ active : ($nextSide.outerWidth() / 2),
529
+ next : ($activeSide.outerWidth() / 2)
530
+ }
531
+ }
532
+ ;
533
+ module.verbose('Setting the initial animation position as left', $nextSide, box);
534
+ $activeSide
535
+ .css({
536
+ 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
537
+ })
538
+ ;
539
+ $nextSide
540
+ .addClass(className.animating)
541
+ .css({
542
+ 'display' : 'block',
543
+ 'left' : box.origin + 'px',
544
+ 'transform' : 'rotateY(-90deg) translateZ(' + box.depth.next + 'px)'
545
+ })
546
+ ;
547
+ },
548
+
549
+ right: function() {
550
+ var
551
+ box = {
552
+ origin : ( ( $activeSide.outerWidth() - $nextSide.outerWidth() ) / 2),
553
+ depth : {
554
+ active : ($nextSide.outerWidth() / 2),
555
+ next : ($activeSide.outerWidth() / 2)
556
+ }
557
+ }
558
+ ;
559
+ module.verbose('Setting the initial animation position as left', $nextSide, box);
560
+ $activeSide
561
+ .css({
562
+ 'transform' : 'rotateY(0deg) translateZ(' + box.depth.active + 'px)'
563
+ })
564
+ ;
565
+ $nextSide
566
+ .addClass(className.animating)
567
+ .css({
568
+ 'display' : 'block',
569
+ 'left' : box.origin + 'px',
570
+ 'transform' : 'rotateY(90deg) translateZ(' + box.depth.next + 'px)'
571
+ })
572
+ ;
573
+ },
574
+
575
+ behind: function() {
576
+ var
577
+ box = {
578
+ origin : ( ( $activeSide.outerWidth() - $nextSide.outerWidth() ) / 2),
579
+ depth : {
580
+ active : ($nextSide.outerWidth() / 2),
581
+ next : ($activeSide.outerWidth() / 2)
582
+ }
583
+ }
584
+ ;
585
+ module.verbose('Setting the initial animation position as behind', $nextSide, box);
586
+ $activeSide
587
+ .css({
588
+ 'transform' : 'rotateY(0deg)'
589
+ })
590
+ ;
591
+ $nextSide
592
+ .addClass(className.animating)
593
+ .css({
594
+ 'display' : 'block',
595
+ 'left' : box.origin + 'px',
596
+ 'transform' : 'rotateY(-180deg)'
597
+ })
598
+ ;
599
+ }
600
+ },
601
+ setting: function(name, value) {
602
+ module.debug('Changing setting', name, value);
603
+ if( $.isPlainObject(name) ) {
604
+ $.extend(true, settings, name);
605
+ }
606
+ else if(value !== undefined) {
607
+ settings[name] = value;
608
+ }
609
+ else {
610
+ return settings[name];
611
+ }
612
+ },
613
+ internal: function(name, value) {
614
+ if( $.isPlainObject(name) ) {
615
+ $.extend(true, module, name);
616
+ }
617
+ else if(value !== undefined) {
618
+ module[name] = value;
619
+ }
620
+ else {
621
+ return module[name];
622
+ }
623
+ },
624
+ debug: function() {
625
+ if(settings.debug) {
626
+ if(settings.performance) {
627
+ module.performance.log(arguments);
628
+ }
629
+ else {
630
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
631
+ module.debug.apply(console, arguments);
632
+ }
633
+ }
634
+ },
635
+ verbose: function() {
636
+ if(settings.verbose && settings.debug) {
637
+ if(settings.performance) {
638
+ module.performance.log(arguments);
639
+ }
640
+ else {
641
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
642
+ module.verbose.apply(console, arguments);
643
+ }
644
+ }
645
+ },
646
+ error: function() {
647
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
648
+ module.error.apply(console, arguments);
649
+ },
650
+ performance: {
651
+ log: function(message) {
652
+ var
653
+ currentTime,
654
+ executionTime,
655
+ previousTime
656
+ ;
657
+ if(settings.performance) {
658
+ currentTime = new Date().getTime();
659
+ previousTime = time || currentTime;
660
+ executionTime = currentTime - previousTime;
661
+ time = currentTime;
662
+ performance.push({
663
+ 'Name' : message[0],
664
+ 'Arguments' : [].slice.call(message, 1) || '',
665
+ 'Element' : element,
666
+ 'Execution Time' : executionTime
667
+ });
668
+ }
669
+ clearTimeout(module.performance.timer);
670
+ module.performance.timer = setTimeout(module.performance.display, 100);
671
+ },
672
+ display: function() {
673
+ var
674
+ title = settings.name + ':',
675
+ totalTime = 0
676
+ ;
677
+ time = false;
678
+ clearTimeout(module.performance.timer);
679
+ $.each(performance, function(index, data) {
680
+ totalTime += data['Execution Time'];
681
+ });
682
+ title += ' ' + totalTime + 'ms';
683
+ if(moduleSelector) {
684
+ title += ' \'' + moduleSelector + '\'';
685
+ }
686
+ if($allModules.length > 1) {
687
+ title += ' ' + '(' + $allModules.length + ')';
688
+ }
689
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
690
+ console.groupCollapsed(title);
691
+ if(console.table) {
692
+ console.table(performance);
693
+ }
694
+ else {
695
+ $.each(performance, function(index, data) {
696
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
697
+ });
698
+ }
699
+ console.groupEnd();
700
+ }
701
+ performance = [];
702
+ }
703
+ },
704
+ invoke: function(query, passedArguments, context) {
705
+ var
706
+ object = instance,
707
+ maxDepth,
708
+ found,
709
+ response
710
+ ;
711
+ passedArguments = passedArguments || queryArguments;
712
+ context = element || context;
713
+ if(typeof query == 'string' && object !== undefined) {
714
+ query = query.split(/[\. ]/);
715
+ maxDepth = query.length - 1;
716
+ $.each(query, function(depth, value) {
717
+ var camelCaseValue = (depth != maxDepth)
718
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
719
+ : query
720
+ ;
721
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
722
+ object = object[camelCaseValue];
723
+ }
724
+ else if( object[camelCaseValue] !== undefined ) {
725
+ found = object[camelCaseValue];
726
+ return false;
727
+ }
728
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
729
+ object = object[value];
730
+ }
731
+ else if( object[value] !== undefined ) {
732
+ found = object[value];
733
+ return false;
734
+ }
735
+ else {
736
+ return false;
737
+ }
738
+ });
739
+ }
740
+ if ( $.isFunction( found ) ) {
741
+ response = found.apply(context, passedArguments);
742
+ }
743
+ else if(found !== undefined) {
744
+ response = found;
745
+ }
746
+ if($.isArray(returnedValue)) {
747
+ returnedValue.push(response);
748
+ }
749
+ else if(returnedValue !== undefined) {
750
+ returnedValue = [returnedValue, response];
751
+ }
752
+ else if(response !== undefined) {
753
+ returnedValue = response;
754
+ }
755
+ return found;
756
+ }
757
+ };
758
+
759
+ if(methodInvoked) {
760
+ if(instance === undefined) {
761
+ module.initialize();
762
+ }
763
+ module.invoke(query);
764
+ }
765
+ else {
766
+ if(instance !== undefined) {
767
+ module.destroy();
768
+ }
769
+ module.initialize();
770
+ }
771
+ })
772
+ ;
773
+
774
+ return (returnedValue !== undefined)
775
+ ? returnedValue
776
+ : this
777
+ ;
778
+ };
779
+
780
+ $.fn.shape.settings = {
781
+
782
+ // module info
783
+ name : 'Shape',
784
+
785
+ // debug content outputted to console
786
+ debug : false,
787
+
788
+ // verbose debug output
789
+ verbose : true,
790
+
791
+ // performance data output
792
+ performance: true,
793
+
794
+ // event namespace
795
+ namespace : 'shape',
796
+
797
+ // callback occurs on side change
798
+ beforeChange : function() {},
799
+ onChange : function() {},
800
+
801
+ // allow animation to same side
802
+ allowRepeats: false,
803
+
804
+ // animation duration
805
+ duration : 700,
806
+
807
+ // possible errors
808
+ error: {
809
+ side : 'You tried to switch to a side that does not exist.',
810
+ method : 'The method you called is not defined'
811
+ },
812
+
813
+ // classnames used
814
+ className : {
815
+ animating : 'animating',
816
+ hidden : 'hidden',
817
+ loading : 'loading',
818
+ active : 'active'
819
+ },
820
+
821
+ // selectors used
822
+ selector : {
823
+ sides : '.sides',
824
+ side : '.side'
825
+ }
826
+
827
+ };
828
+
829
+
830
+ })( jQuery, window , document );