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.accordion,.ui.accordion .accordion{max-width:100%;font-size:1em}.ui.accordion .accordion{margin:1em 0 0;padding:0}.ui.accordion .accordion .title,.ui.accordion .title{cursor:pointer}.ui.accordion .title:not(.ui){padding:.5em 0;font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;font-size:1em;color:rgba(0,0,0,.8)}.ui.accordion .accordion .title~.content,.ui.accordion .title~.content{display:none}.ui.accordion:not(.styled) .accordion .title~.content:not(.ui),.ui.accordion:not(.styled) .title~.content:not(.ui){margin:0;padding:.5em 0 1em}.ui.accordion:not(.styled) .title~.content:not(.ui):last-child{padding-bottom:0}.ui.accordion .accordion .title .dropdown.icon,.ui.accordion .title .dropdown.icon{display:inline-block;float:none;opacity:1;width:1.25em;height:1em;margin:0 .25rem 0 0;padding:0;font-size:1em;-webkit-transition:-webkit-transform .2s ease,opacity .2s ease;transition:transform .2s ease,opacity .2s ease;vertical-align:baseline;-webkit-transform:none;-ms-transform:none;transform:none}.ui.accordion.menu .item .title{display:block;padding:0}.ui.accordion.menu .item .title>.dropdown.icon{float:right;margin:.165em 0 0 1em;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.ui.accordion .ui.header .dropdown.icon{font-size:1em;margin:0 .25rem 0 0}.ui.accordion .accordion .active.title .dropdown.icon,.ui.accordion .active.title .dropdown.icon,.ui.accordion.menu .item .active.title>.dropdown.icon{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.ui.styled.accordion{width:600px}.ui.styled.accordion,.ui.styled.accordion .accordion{border-radius:.2857rem;background:#fff;box-shadow:0 1px 2px 0 rgba(0,0,0,.05),0 0 0 1px rgba(39,41,43,.15)}.ui.styled.accordion .accordion .title,.ui.styled.accordion .title{margin:0;padding:.75em 1em;color:rgba(0,0,0,.4);font-weight:700;border-top:1px solid rgba(39,41,43,.15);-webkit-transition:background .2s ease,color .2s ease;transition:background .2s ease,color .2s ease}.ui.styled.accordion>.accordion .title:first-child,.ui.styled.accordion>.title:first-child{border-top:none}.ui.styled.accordion .accordion .content,.ui.styled.accordion .content{margin:0;padding:.5em 1em 1.5em}.ui.styled.accordion .accordion .content{padding:.5em 1em 1.5em}.ui.styled.accordion .accordion .active.title,.ui.styled.accordion .accordion .title:hover,.ui.styled.accordion .active.title,.ui.styled.accordion .title:hover{background:0 0;color:rgba(0,0,0,.8)}.ui.accordion .accordion .active.content,.ui.accordion .active.content{display:block}.ui.fluid.accordion,.ui.fluid.accordion .accordion{width:100%}.ui.inverted.accordion .title:not(.ui){color:#fff}@font-face{font-family:Accordion;src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfOIKAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zryj6HgAAAFwAAAAyGhlYWT/0IhHAAACOAAAADZoaGVhApkB5wAAAnAAAAAkaG10eAJuABIAAAKUAAAAGGxvY2EAjABWAAACrAAAAA5tYXhwAAgAFgAAArwAAAAgbmFtZfC1n04AAALcAAABPHBvc3QAAwAAAAAEGAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQASAEkAtwFuABMAADc0PwE2FzYXFh0BFAcGJwYvASY1EgaABQgHBQYGBQcIBYAG2wcGfwcBAQcECf8IBAcBAQd/BgYAAAAAAQAAAEkApQFuABMAADcRNDc2MzIfARYVFA8BBiMiJyY1AAUGBwgFgAYGgAUIBwYFWwEACAUGBoAFCAcFgAYGBQcAAAABAAAAAQAAqWYls18PPPUACwIAAAAAAM/9o+4AAAAAz/2j7gAAAAAAtwFuAAAACAACAAAAAAAAAAEAAAHg/+AAAAIAAAAAAAC3AAEAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAQAAAAC3ABIAtwAAAAAAAAAKABQAHgBCAGQAAAABAAAABgAUAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype'),url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAASwAAoAAAAABGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAS0AAAEtFpovuE9TLzIAAAIkAAAAYAAAAGAIIweQY21hcAAAAoQAAABMAAAATA984gpnYXNwAAAC0AAAAAgAAAAIAAAAEGhlYWQAAALYAAAANgAAADb/0IhHaGhlYQAAAxAAAAAkAAAAJAKZAedobXR4AAADNAAAABgAAAAYAm4AEm1heHAAAANMAAAABgAAAAYABlAAbmFtZQAAA1QAAAE8AAABPPC1n05wb3N0AAAEkAAAACAAAAAgAAMAAAEABAQAAQEBB3JhdGluZwABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLa/iU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAABJBIABwEBBw0PERQZHnJhdGluZ3JhdGluZ3UwdTF1MjB1RjBEOXVGMERBAAACAYkABAAGAQEEBwoNVp38lA78lA78lA77lA773Z33bxWLkI2Qj44I9xT3FAWOj5CNkIuQi4+JjoePiI2Gi4YIi/uUBYuGiYeHiIiHh4mGi4aLho2Ijwj7FPcUBYeOiY+LkAgO+92L5hWL95QFi5CNkI6Oj4+PjZCLkIuQiY6HCPcU+xQFj4iNhouGi4aJh4eICPsU+xQFiIeGiYaLhouHjYePiI6Jj4uQCA74lBT4lBWLDAoAAAAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAADfYOJZfDzz1AAsCAAAAAADP/aPuAAAAAM/9o+4AAAAAALcBbgAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAAtwABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAAAtwASALcAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');font-weight:400;font-style:normal}.ui.accordion .accordion .title .dropdown.icon,.ui.accordion .title .dropdown.icon{font-family:Accordion;line-height:1;-webkit-backface-visibility:hidden;backface-visibility:hidden;font-weight:400;font-style:normal;text-align:center}.ui.accordion .accordion .title .dropdown.icon:before,.ui.accordion .title .dropdown.icon:before{content:'\f0da'}
@@ -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
+ !function(e,n,t,i){"use strict";e.fn.accordion=function(t){{var o,a=e(this),s=(new Date).getTime(),r=[],c=arguments[0],l="string"==typeof c,u=[].slice.call(arguments,1);n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(e){setTimeout(e,0)}}return a.each(function(){var d,f,m=e.isPlainObject(t)?e.extend(!0,{},e.fn.accordion.settings,t):e.extend({},e.fn.accordion.settings),p=m.className,g=m.namespace,b=m.selector,h=m.error,v="."+g,y="module-"+g,C=a.selector||"",O=e(this),x=O.find(b.title),F=O.find(b.content),T=this,A=O.data(y);f={initialize:function(){f.debug("Initializing accordion with bound events",O),O.on("click"+v,b.title,f.event.click),f.observeChanges(),f.instantiate()},instantiate:function(){A=f,O.data(y,f)},destroy:function(){f.debug("Destroying previous accordion for",O),O.removeData(y),x.off(v)},refresh:function(){x=O.find(b.title),F=O.find(b.content)},observeChanges:function(){"MutationObserver"in n&&(d=new MutationObserver(function(){f.debug("DOM tree modified, updating selector cache"),f.refresh()}),d.observe(T,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",d))},event:{click:function(){f.toggle.call(this)}},toggle:function(n){var t=n!==i?"number"==typeof n?x.eq(n):e(n):e(this),o=t.next(F),a=o.is(":visible");f.debug("Toggling visibility of content",t),a?m.collapsible?f.close.call(t):f.debug("Cannot close accordion content collapsing is disabled"):f.open.call(t)},open:function(n){var t=n!==i?"number"==typeof n?x.eq(n):e(n):e(this),o=t.next(F),a=o.is(":animated"),s=o.hasClass(p.active);a||s||(f.debug("Opening accordion content",t),m.exclusive&&f.closeOthers.call(t),t.addClass(p.active),m.animateChildren&&(e.fn.transition!==i&&O.transition("is supported")?o.children().transition({animation:"fade in",useFailSafe:!0,debug:m.debug,verbose:m.verbose,duration:m.duration}):o.children().stop().animate({opacity:1},m.duration,f.resetOpacity)),o.stop().slideDown(m.duration,m.easing,function(){o.addClass(p.active),f.reset.display.call(this),m.onOpen.call(this),m.onChange.call(this)}))},close:function(n){var t=n!==i?"number"==typeof n?x.eq(n):e(n):e(this),o=t.next(F),a=o.hasClass(p.active);a&&(f.debug("Closing accordion content",o),t.removeClass(p.active),o.removeClass(p.active).show(),m.animateChildren&&(e.fn.transition!==i&&O.transition("is supported")?o.children().transition({animation:"fade out",useFailSafe:!0,debug:m.debug,verbose:m.verbose,duration:m.duration}):o.children().stop().animate({opacity:0},m.duration,f.resetOpacity)),o.stop().slideUp(m.duration,m.easing,function(){f.reset.display.call(this),m.onClose.call(this),m.onChange.call(this)}))},closeOthers:function(n){var t,o,a,s=n!==i?x.eq(n):e(this),r=s.parents(b.content).prev(b.title),c=s.closest(b.accordion),l=b.title+"."+p.active+":visible",u=b.content+"."+p.active+":visible";m.closeNested?(t=c.find(l).not(r),a=t.next(F)):(t=c.find(l).not(r),o=c.find(u).find(l).not(r),t=t.not(o),a=t.next(F)),t.length>0&&(f.debug("Exclusive enabled, closing other content",t),t.removeClass(p.active),m.animateChildren&&(e.fn.transition!==i&&O.transition("is supported")?a.children().transition({animation:"fade out",useFailSafe:!0,debug:m.debug,verbose:m.verbose,duration:m.duration}):a.children().stop().animate({opacity:0},m.duration,f.resetOpacity)),a.stop().slideUp(m.duration,m.easing,function(){e(this).removeClass(p.active),f.reset.display.call(this)}))},reset:{display:function(){f.verbose("Removing inline display from element",this),e(this).css("display",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")},opacity:function(){f.verbose("Removing inline opacity from element",this),e(this).css("opacity",""),""===e(this).attr("style")&&e(this).attr("style","").removeAttr("style")}},setting:function(n,t){if(f.debug("Changing setting",n,t),e.isPlainObject(n))e.extend(!0,m,n);else{if(t===i)return m[n];m[n]=t}},internal:function(n,t){return f.debug("Changing internal",n,t),t===i?f[n]:void(e.isPlainObject(n)?e.extend(!0,f,n):f[n]=t)},debug:function(){m.debug&&(m.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,m.name+":"),f.debug.apply(console,arguments)))},verbose:function(){m.verbose&&m.debug&&(m.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,m.name+":"),f.verbose.apply(console,arguments)))},error:function(){f.error=Function.prototype.bind.call(console.error,console,m.name+":"),f.error.apply(console,arguments)},performance:{log:function(e){var n,t,i;m.performance&&(n=(new Date).getTime(),i=s||n,t=n-i,s=n,r.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:T,"Execution Time":t})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,100)},display:function(){var n=m.name+":",t=0;s=!1,clearTimeout(f.performance.timer),e.each(r,function(e,n){t+=n["Execution Time"]}),n+=" "+t+"ms",C&&(n+=" '"+C+"'"),(console.group!==i||console.table!==i)&&r.length>0&&(console.groupCollapsed(n),console.table?console.table(r):e.each(r,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),r=[]}},invoke:function(n,t,a){var s,r,c,l=A;return t=t||u,a=T||a,"string"==typeof n&&l!==i&&(n=n.split(/[\. ]/),s=n.length-1,e.each(n,function(t,o){var a=t!=s?o+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(e.isPlainObject(l[a])&&t!=s)l=l[a];else{if(l[a]!==i)return r=l[a],!1;if(!e.isPlainObject(l[o])||t==s)return l[o]!==i?(r=l[o],!1):(f.error(h.method,n),!1);l=l[o]}})),e.isFunction(r)?c=r.apply(a,t):r!==i&&(c=r),e.isArray(o)?o.push(c):o!==i?o=[o,c]:c!==i&&(o=c),r}},l?(A===i&&f.initialize(),f.invoke(c)):(A!==i&&f.destroy(),f.initialize())}),o!==i?o:this},e.fn.accordion.settings={name:"Accordion",namespace:"accordion",debug:!1,verbose:!0,performance:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:500,easing:"easeOutQuint",onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active"},selector:{accordion:".accordion",title:".title",content:".content"}},e.extend(e.easing,{easeOutQuint:function(e,n,t,i,o){return i*((n=n/o-1)*n*n*n*n+1)+t}})}(jQuery,window,document);
@@ -0,0 +1,277 @@
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
+ Advertisement
16
+ *******************************/
17
+
18
+ .ui.ad {
19
+ display: block;
20
+ overflow: hidden;
21
+ margin: 1em 0em;
22
+ }
23
+ .ui.ad:first-child {
24
+ margin: 0em;
25
+ }
26
+ .ui.ad:last-child {
27
+ margin: 0em;
28
+ }
29
+ .ui.ad iframe {
30
+ margin: 0em;
31
+ padding: 0em;
32
+ border: none;
33
+ overflow: hidden;
34
+ }
35
+
36
+ /*--------------
37
+ Common
38
+ ---------------*/
39
+
40
+
41
+ /* Leaderboard */
42
+ .ui.leaderboard.ad {
43
+ width: 728px;
44
+ height: 90px;
45
+ }
46
+
47
+ /* Medium Rectangle */
48
+ .ui[class*="medium rectangle"].ad {
49
+ width: 300px;
50
+ height: 250px;
51
+ }
52
+
53
+ /* Large Rectangle */
54
+ .ui[class*="large rectangle"].ad {
55
+ width: 336px;
56
+ height: 280px;
57
+ }
58
+
59
+ /* Half Page */
60
+ .ui[class*="half page"].ad {
61
+ width: 300px;
62
+ height: 600px;
63
+ }
64
+
65
+ /*--------------
66
+ Square
67
+ ---------------*/
68
+
69
+
70
+ /* Square */
71
+ .ui.square.ad {
72
+ width: 250px;
73
+ height: 250px;
74
+ }
75
+
76
+ /* Small Square */
77
+ .ui[class*="small square"].ad {
78
+ width: 200px;
79
+ height: 200px;
80
+ }
81
+
82
+ /*--------------
83
+ Rectangle
84
+ ---------------*/
85
+
86
+
87
+ /* Small Rectangle */
88
+ .ui[class*="small rectangle"].ad {
89
+ width: 180px;
90
+ height: 150px;
91
+ }
92
+
93
+ /* Vertical Rectangle */
94
+ .ui[class*="vertical rectangle"].ad {
95
+ width: 240px;
96
+ height: 400px;
97
+ }
98
+
99
+ /*--------------
100
+ Button
101
+ ---------------*/
102
+
103
+ .ui.button.ad {
104
+ width: 120px;
105
+ height: 90px;
106
+ }
107
+ .ui[class*="square button"].ad {
108
+ width: 125px;
109
+ height: 125px;
110
+ }
111
+ .ui[class*="small button"].ad {
112
+ width: 120px;
113
+ height: 60px;
114
+ }
115
+
116
+ /*--------------
117
+ Skyscrapers
118
+ ---------------*/
119
+
120
+
121
+ /* Skyscraper */
122
+ .ui.skyscraper.ad {
123
+ width: 120px;
124
+ height: 600px;
125
+ }
126
+
127
+ /* Wide Skyscraper */
128
+ .ui[class*="wide skyscraper"].ad {
129
+ width: 160px;
130
+ }
131
+
132
+ /*--------------
133
+ Banners
134
+ ---------------*/
135
+
136
+
137
+ /* Banner */
138
+ .ui.banner.ad {
139
+ width: 468px;
140
+ height: 60px;
141
+ }
142
+
143
+ /* Vertical Banner */
144
+ .ui[class*="vertical banner"].ad {
145
+ width: 120px;
146
+ height: 240px;
147
+ }
148
+
149
+ /* Top Banner */
150
+ .ui[class*="top banner"].ad {
151
+ width: 930px;
152
+ height: 180px;
153
+ }
154
+
155
+ /* Half Banner */
156
+ .ui[class*="half banner"].ad {
157
+ width: 234px;
158
+ height: 60px;
159
+ }
160
+
161
+ /*--------------
162
+ Boards
163
+ ---------------*/
164
+
165
+
166
+ /* Leaderboard */
167
+ .ui[class*="large leaderboard"].ad {
168
+ width: 970px;
169
+ height: 90px;
170
+ }
171
+
172
+ /* Billboard */
173
+ .ui.billboard.ad {
174
+ width: 970px;
175
+ height: 250px;
176
+ }
177
+
178
+ /*--------------
179
+ Panorama
180
+ ---------------*/
181
+
182
+
183
+ /* Panorama */
184
+ .ui.panorama.ad {
185
+ width: 980px;
186
+ height: 120px;
187
+ }
188
+
189
+ /*--------------
190
+ Netboard
191
+ ---------------*/
192
+
193
+
194
+ /* Netboard */
195
+ .ui.netboard.ad {
196
+ width: 580px;
197
+ height: 400px;
198
+ }
199
+
200
+ /*--------------
201
+ Mobile
202
+ ---------------*/
203
+
204
+
205
+ /* Large Mobile Banner */
206
+ .ui[class*="large mobile banner"].ad {
207
+ width: 320px;
208
+ height: 100px;
209
+ }
210
+
211
+ /* Mobile Leaderboard */
212
+ .ui[class*="mobile leaderboard"].ad {
213
+ width: 320px;
214
+ height: 50px;
215
+ }
216
+
217
+
218
+ /*******************************
219
+ Types
220
+ *******************************/
221
+
222
+
223
+ /* Mobile Sizes */
224
+ .ui.mobile.ad {
225
+ display: none;
226
+ }
227
+ @media only screen and (max-width: 767px) {
228
+ .ui.mobile.ad {
229
+ display: block;
230
+ }
231
+ }
232
+
233
+
234
+ /*******************************
235
+ Variations
236
+ *******************************/
237
+
238
+ .ui.centered.ad {
239
+ margin-left: auto;
240
+ margin-right: auto;
241
+ }
242
+ .ui.test.ad {
243
+ position: relative;
244
+ background: #333333;
245
+ }
246
+ .ui.test.ad:after {
247
+ position: absolute;
248
+ top: 50%;
249
+ left: 50%;
250
+ width: 100%;
251
+ text-align: center;
252
+ -webkit-transform: translateX(-50%) translateY(-50%);
253
+ -ms-transform: translateX(-50%) translateY(-50%);
254
+ transform: translateX(-50%) translateY(-50%);
255
+ content: 'Ad';
256
+ color: #ffffff;
257
+ font-size: 1em;
258
+ font-weight: bold;
259
+ }
260
+ .ui.mobile.test.ad:after {
261
+ font-size: 0.85714em;
262
+ }
263
+ .ui.test.ad[data-text]:after {
264
+ content: attr(data-text);
265
+ }
266
+
267
+
268
+ /*******************************
269
+ Theme Overrides
270
+ *******************************/
271
+
272
+
273
+
274
+ /*******************************
275
+ User Variable Overrides
276
+ *******************************/
277
+
@@ -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.ad{display:block;overflow:hidden;margin:1em 0}.ui.ad:first-child,.ui.ad:last-child{margin:0}.ui.ad iframe{margin:0;padding:0;border:none;overflow:hidden}.ui.leaderboard.ad{width:728px;height:90px}.ui[class*="medium rectangle"].ad{width:300px;height:250px}.ui[class*="large rectangle"].ad{width:336px;height:280px}.ui[class*="half page"].ad{width:300px;height:600px}.ui.square.ad{width:250px;height:250px}.ui[class*="small square"].ad{width:200px;height:200px}.ui[class*="small rectangle"].ad{width:180px;height:150px}.ui[class*="vertical rectangle"].ad{width:240px;height:400px}.ui.button.ad{width:120px;height:90px}.ui[class*="square button"].ad{width:125px;height:125px}.ui[class*="small button"].ad{width:120px;height:60px}.ui.skyscraper.ad{width:120px;height:600px}.ui[class*="wide skyscraper"].ad{width:160px}.ui.banner.ad{width:468px;height:60px}.ui[class*="vertical banner"].ad{width:120px;height:240px}.ui[class*="top banner"].ad{width:930px;height:180px}.ui[class*="half banner"].ad{width:234px;height:60px}.ui[class*="large leaderboard"].ad{width:970px;height:90px}.ui.billboard.ad{width:970px;height:250px}.ui.panorama.ad{width:980px;height:120px}.ui.netboard.ad{width:580px;height:400px}.ui[class*="large mobile banner"].ad{width:320px;height:100px}.ui[class*="mobile leaderboard"].ad{width:320px;height:50px}.ui.mobile.ad{display:none}@media only screen and (max-width:767px){.ui.mobile.ad{display:block}}.ui.centered.ad{margin-left:auto;margin-right:auto}.ui.test.ad{position:relative;background:#333}.ui.test.ad:after{position:absolute;top:50%;left:50%;width:100%;text-align:center;-webkit-transform:translateX(-50%) translateY(-50%);-ms-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%);content:'Ad';color:#fff;font-size:1em;font-weight:700}.ui.mobile.test.ad:after{font-size:.85714em}.ui.test.ad[data-text]:after{content:attr(data-text)}
@@ -0,0 +1,851 @@
1
+ /*
2
+ * # Semantic - API
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
+ $.api = $.fn.api = function(parameters) {
15
+
16
+ var
17
+ // use window context if none specified
18
+ $allModules = $.isFunction(this)
19
+ ? $(window)
20
+ : $(this),
21
+ moduleSelector = $allModules.selector || '',
22
+ time = new Date().getTime(),
23
+ performance = [],
24
+
25
+ query = arguments[0],
26
+ methodInvoked = (typeof query == 'string'),
27
+ queryArguments = [].slice.call(arguments, 1),
28
+
29
+ returnedValue
30
+ ;
31
+
32
+ $allModules
33
+ .each(function() {
34
+ var
35
+ settings = ( $.isPlainObject(parameters) )
36
+ ? $.extend(true, {}, $.fn.api.settings, parameters)
37
+ : $.extend({}, $.fn.api.settings),
38
+
39
+ // internal aliases
40
+ namespace = settings.namespace,
41
+ metadata = settings.metadata,
42
+ selector = settings.selector,
43
+ error = settings.error,
44
+ className = settings.className,
45
+
46
+ // define namespaces for modules
47
+ eventNamespace = '.' + namespace,
48
+ moduleNamespace = 'module-' + namespace,
49
+
50
+ // element that creates request
51
+ $module = $(this),
52
+ $form = $module.closest(selector.form),
53
+
54
+ // context used for state
55
+ $context = (settings.stateContext)
56
+ ? $(settings.stateContext)
57
+ : $module,
58
+
59
+ // request details
60
+ ajaxSettings,
61
+ requestSettings,
62
+ url,
63
+ data,
64
+
65
+ // standard module
66
+ element = this,
67
+ context = $context.get(),
68
+ instance = $module.data(moduleNamespace),
69
+ module
70
+ ;
71
+
72
+ module = {
73
+
74
+ initialize: function() {
75
+ var
76
+ triggerEvent = module.get.event()
77
+ ;
78
+ // bind events
79
+ if(!methodInvoked) {
80
+ if( triggerEvent ) {
81
+ module.debug('Attaching API events to element', triggerEvent);
82
+ $module
83
+ .on(triggerEvent + eventNamespace, module.event.trigger)
84
+ ;
85
+ }
86
+ else if(settings.on == 'now') {
87
+ module.debug('Querying API now', triggerEvent);
88
+ module.query();
89
+ }
90
+ }
91
+ module.instantiate();
92
+ },
93
+
94
+ instantiate: function() {
95
+ module.verbose('Storing instance of module', module);
96
+ instance = module;
97
+ $module
98
+ .data(moduleNamespace, instance)
99
+ ;
100
+ },
101
+
102
+ destroy: function() {
103
+ module.verbose('Destroying previous module for', element);
104
+ $module
105
+ .removeData(moduleNamespace)
106
+ .off(eventNamespace)
107
+ ;
108
+ },
109
+
110
+ query: function() {
111
+
112
+ if(module.is.disabled()) {
113
+ module.debug('Element is disabled API request aborted');
114
+ return;
115
+ }
116
+ // determine if an api event already occurred
117
+ if(module.is.loading() && settings.throttle === 0 ) {
118
+ module.debug('Cancelling request, previous request is still pending');
119
+ return;
120
+ }
121
+
122
+ // pass element metadata to url (value, text)
123
+ if(settings.defaultData) {
124
+ $.extend(true, settings.urlData, module.get.defaultData());
125
+ }
126
+
127
+ // Add form content
128
+ if(settings.serializeForm !== false || $context.is('form')) {
129
+ if(settings.serializeForm == 'json') {
130
+ $.extend(true, settings.data, module.get.formData());
131
+ }
132
+ else {
133
+ settings.data = module.get.formData();
134
+ }
135
+ }
136
+
137
+ // call beforesend and get any settings changes
138
+ requestSettings = module.get.settings();
139
+
140
+ // check if beforesend cancelled request
141
+ if(requestSettings === false) {
142
+ module.error(error.beforeSend);
143
+ return;
144
+ }
145
+
146
+ if(settings.url) {
147
+ // override with url if specified
148
+ module.debug('Using specified url', url);
149
+ url = module.add.urlData( settings.url );
150
+ }
151
+ else {
152
+ // otherwise find url from api endpoints
153
+ url = module.add.urlData( module.get.templateURL() );
154
+ module.debug('Added URL Data to url', url);
155
+ }
156
+
157
+ // exit conditions reached, missing url parameters
158
+ if( !url ) {
159
+ if($module.is('form')) {
160
+ module.debug('No url or action specified, defaulting to form action');
161
+ url = $module.attr('action');
162
+ }
163
+ else {
164
+ module.error(error.missingURL, settings.action);
165
+ return;
166
+ }
167
+ }
168
+
169
+ // add loading state
170
+ module.set.loading();
171
+
172
+ // look for jQuery ajax parameters in settings
173
+ ajaxSettings = $.extend(true, {}, settings, {
174
+ type : settings.method || settings.type,
175
+ data : data,
176
+ url : settings.base + url,
177
+ beforeSend : settings.beforeXHR,
178
+ success : function() {},
179
+ failure : function() {},
180
+ complete : function() {}
181
+ });
182
+
183
+ module.verbose('Creating AJAX request with settings', ajaxSettings);
184
+
185
+ if( module.is.loading() ) {
186
+ // throttle additional requests
187
+ module.timer = setTimeout(function() {
188
+ module.request = module.create.request();
189
+ module.xhr = module.create.xhr();
190
+ }, settings.throttle);
191
+ }
192
+ else {
193
+ // immediately on first request
194
+ module.request = module.create.request();
195
+ module.xhr = module.create.xhr();
196
+ }
197
+
198
+ },
199
+
200
+
201
+ is: {
202
+ disabled: function() {
203
+ return ($module.filter(settings.filter).length > 0);
204
+ },
205
+ loading: function() {
206
+ return (module.request && module.request.state() == 'pending');
207
+ }
208
+ },
209
+
210
+ was: {
211
+ succesful: function() {
212
+ return (module.request && module.request.state() == 'resolved');
213
+ },
214
+ failure: function() {
215
+ return (module.request && module.request.state() == 'rejected');
216
+ },
217
+ complete: function() {
218
+ return (module.request && (module.request.state() == 'resolved' || module.request.state() == 'rejected') );
219
+ }
220
+ },
221
+
222
+ add: {
223
+ urlData: function(url, urlData) {
224
+ var
225
+ requiredVariables,
226
+ optionalVariables
227
+ ;
228
+ if(url) {
229
+ requiredVariables = url.match(settings.regExp.required);
230
+ optionalVariables = url.match(settings.regExp.optional);
231
+ urlData = urlData || settings.urlData;
232
+ if(requiredVariables) {
233
+ module.debug('Looking for required URL variables', requiredVariables);
234
+ $.each(requiredVariables, function(index, templatedString) {
235
+ var
236
+ // allow legacy {$var} style
237
+ variable = (templatedString.indexOf('$') !== -1)
238
+ ? templatedString.substr(2, templatedString.length - 3)
239
+ : templatedString.substr(1, templatedString.length - 2),
240
+ value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
241
+ ? urlData[variable]
242
+ : ($module.data(variable) !== undefined)
243
+ ? $module.data(variable)
244
+ : ($context.data(variable) !== undefined)
245
+ ? $context.data(variable)
246
+ : urlData[variable]
247
+ ;
248
+ // remove value
249
+ if(value === undefined) {
250
+ module.error(error.requiredParameter, variable, url);
251
+ url = false;
252
+ return false;
253
+ }
254
+ else {
255
+ module.verbose('Found required variable', variable, value);
256
+ url = url.replace(templatedString, value);
257
+ }
258
+ });
259
+ }
260
+ if(optionalVariables) {
261
+ module.debug('Looking for optional URL variables', requiredVariables);
262
+ $.each(optionalVariables, function(index, templatedString) {
263
+ var
264
+ // allow legacy {/$var} style
265
+ variable = (templatedString.indexOf('$') !== -1)
266
+ ? templatedString.substr(3, templatedString.length - 4)
267
+ : templatedString.substr(2, templatedString.length - 3),
268
+ value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
269
+ ? urlData[variable]
270
+ : ($module.data(variable) !== undefined)
271
+ ? $module.data(variable)
272
+ : ($context.data(variable) !== undefined)
273
+ ? $context.data(variable)
274
+ : urlData[variable]
275
+ ;
276
+ // optional replacement
277
+ if(value !== undefined) {
278
+ module.verbose('Optional variable Found', variable, value);
279
+ url = url.replace(templatedString, value);
280
+ }
281
+ else {
282
+ module.verbose('Optional variable not found', variable);
283
+ // remove preceding slash if set
284
+ if(url.indexOf('/' + templatedString) !== -1) {
285
+ url = url.replace('/' + templatedString, '');
286
+ }
287
+ else {
288
+ url = url.replace(templatedString, '');
289
+ }
290
+ }
291
+ });
292
+ }
293
+ }
294
+ return url;
295
+ }
296
+ },
297
+
298
+ event: {
299
+ trigger: function(event) {
300
+ module.query();
301
+ if(event.type == 'submit' || event.type == 'click') {
302
+ event.preventDefault();
303
+ }
304
+ },
305
+ xhr: {
306
+ always: function() {
307
+ // calculate if loading time was below minimum threshold
308
+ },
309
+ done: function(response) {
310
+ var
311
+ context = this,
312
+ elapsedTime = (new Date().getTime() - time),
313
+ timeLeft = (settings.loadingDuration - elapsedTime)
314
+ ;
315
+ timeLeft = (timeLeft > 0)
316
+ ? timeLeft
317
+ : 0
318
+ ;
319
+ setTimeout(function() {
320
+ module.request.resolveWith(context, [response]);
321
+ }, timeLeft);
322
+ },
323
+ fail: function(xhr, status, httpMessage) {
324
+ var
325
+ context = this,
326
+ elapsedTime = (new Date().getTime() - time),
327
+ timeLeft = (settings.loadingDuration - elapsedTime)
328
+ ;
329
+ timeLeft = (timeLeft > 0)
330
+ ? timeLeft
331
+ : 0
332
+ ;
333
+ // page triggers abort on navigation, dont show error
334
+ setTimeout(function() {
335
+ if(status !== 'abort') {
336
+ module.request.rejectWith(context, [xhr, status, httpMessage]);
337
+ }
338
+ else {
339
+ module.reset();
340
+ }
341
+ }, timeLeft);
342
+ }
343
+ },
344
+ request: {
345
+ complete: function(response) {
346
+ module.remove.loading();
347
+ settings.onComplete.call(context, response, $module);
348
+ },
349
+ done: function(response) {
350
+ module.debug('API Response Received', response);
351
+ if(settings.dataType == 'json') {
352
+ if( $.isFunction(settings.successTest) ) {
353
+ module.debug('Checking JSON returned success', settings.successTest, response);
354
+ if( settings.successTest(response) ) {
355
+ settings.onSuccess.call(context, response, $module);
356
+ }
357
+ else {
358
+ module.debug('JSON test specified by user and response failed', response);
359
+ settings.onFailure.call(context, response, $module);
360
+ }
361
+ }
362
+ else {
363
+ settings.onSuccess.call(context, response, $module);
364
+ }
365
+ }
366
+ else {
367
+ settings.onSuccess.call(context, response, $module);
368
+ }
369
+ },
370
+ error: function(xhr, status, httpMessage) {
371
+ var
372
+ errorMessage = (settings.error[status] !== undefined)
373
+ ? settings.error[status]
374
+ : httpMessage,
375
+ response
376
+ ;
377
+ // let em know unless request aborted
378
+ if(xhr !== undefined) {
379
+ // readyState 4 = done, anything less is not really sent
380
+ if(xhr.readyState !== undefined && xhr.readyState == 4) {
381
+
382
+ // if http status code returned and json returned error, look for it
383
+ if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') {
384
+ module.error(error.statusMessage + httpMessage);
385
+ }
386
+ else {
387
+ if(status == 'error' && settings.dataType == 'json') {
388
+ try {
389
+ response = $.parseJSON(xhr.responseText);
390
+ if(response && response.error !== undefined) {
391
+ errorMessage = response.error;
392
+ }
393
+ }
394
+ catch(e) {
395
+ module.error(error.JSONParse);
396
+ }
397
+ }
398
+ }
399
+ module.remove.loading();
400
+ module.set.error();
401
+ // show error state only for duration specified in settings
402
+ if(settings.errorDuration) {
403
+ setTimeout(module.remove.error, settings.errorDuration);
404
+ }
405
+ module.debug('API Request error:', errorMessage);
406
+ settings.onError.call(context, errorMessage, $module);
407
+ }
408
+ else {
409
+ settings.onAbort.call(context, errorMessage, $module);
410
+ module.debug('Request Aborted (Most likely caused by page change or CORS Policy)', status, httpMessage);
411
+ }
412
+ }
413
+ }
414
+ }
415
+ },
416
+
417
+ create: {
418
+ request: function() {
419
+ return $.Deferred()
420
+ .always(module.event.request.complete)
421
+ .done(module.event.request.done)
422
+ .fail(module.event.request.error)
423
+ ;
424
+ },
425
+ xhr: function() {
426
+ return $.ajax(ajaxSettings)
427
+ .always(module.event.xhr.always)
428
+ .done(module.event.xhr.done)
429
+ .fail(module.event.xhr.fail)
430
+ ;
431
+ }
432
+ },
433
+
434
+ set: {
435
+ error: function() {
436
+ module.verbose('Adding error state to element', $context);
437
+ $context.addClass(className.error);
438
+ },
439
+ loading: function() {
440
+ module.verbose('Adding loading state to element', $context);
441
+ $context.addClass(className.loading);
442
+ }
443
+ },
444
+
445
+ remove: {
446
+ error: function() {
447
+ module.verbose('Removing error state from element', $context);
448
+ $context.removeClass(className.error);
449
+ },
450
+ loading: function() {
451
+ module.verbose('Removing loading state from element', $context);
452
+ $context.removeClass(className.loading);
453
+ }
454
+ },
455
+
456
+ get: {
457
+ request: function() {
458
+ return module.request || false;
459
+ },
460
+ xhr: function() {
461
+ return module.xhr || false;
462
+ },
463
+ settings: function() {
464
+ var
465
+ runSettings
466
+ ;
467
+ runSettings = settings.beforeSend.call($module, settings);
468
+ if(runSettings) {
469
+ if(runSettings.success !== undefined) {
470
+ module.debug('Legacy success callback detected', runSettings);
471
+ module.error(error.legacyParameters, runSettings.success);
472
+ runSettings.onSuccess = runSettings.success;
473
+ }
474
+ if(runSettings.failure !== undefined) {
475
+ module.debug('Legacy failure callback detected', runSettings);
476
+ module.error(error.legacyParameters, runSettings.failure);
477
+ runSettings.onFailure = runSettings.failure;
478
+ }
479
+ if(runSettings.complete !== undefined) {
480
+ module.debug('Legacy complete callback detected', runSettings);
481
+ module.error(error.legacyParameters, runSettings.complete);
482
+ runSettings.onComplete = runSettings.complete;
483
+ }
484
+ }
485
+ if(runSettings === undefined) {
486
+ module.error(error.noReturnedValue);
487
+ }
488
+ return (runSettings !== undefined)
489
+ ? runSettings
490
+ : settings
491
+ ;
492
+ },
493
+ defaultData: function() {
494
+ var
495
+ data = {}
496
+ ;
497
+ if( !$.isWindow(element) ) {
498
+ if( $module.is('input') ) {
499
+ data.value = $module.val();
500
+ }
501
+ else if( $module.is('form') ) {
502
+
503
+ }
504
+ else {
505
+ data.text = $module.text();
506
+ }
507
+ }
508
+ return data;
509
+ },
510
+ event: function() {
511
+ if( $.isWindow(element) || settings.on == 'now' ) {
512
+ module.debug('API called without element, no events attached');
513
+ return false;
514
+ }
515
+ else if(settings.on == 'auto') {
516
+ if( $module.is('input') ) {
517
+ return (element.oninput !== undefined)
518
+ ? 'input'
519
+ : (element.onpropertychange !== undefined)
520
+ ? 'propertychange'
521
+ : 'keyup'
522
+ ;
523
+ }
524
+ else if( $module.is('form') ) {
525
+ return 'submit';
526
+ }
527
+ else {
528
+ return 'click';
529
+ }
530
+ }
531
+ else {
532
+ return settings.on;
533
+ }
534
+ },
535
+ formData: function() {
536
+ var
537
+ formData
538
+ ;
539
+ if($(this).serializeObject() !== undefined) {
540
+ formData = $form.serializeObject();
541
+ }
542
+ else {
543
+ module.error(error.missingSerialize);
544
+ formData = $form.serialize();
545
+ }
546
+ module.debug('Retrieved form data', formData);
547
+ return formData;
548
+ },
549
+ templateURL: function(action) {
550
+ var
551
+ url
552
+ ;
553
+ action = action || $module.data(metadata.action) || settings.action || false;
554
+ if(action) {
555
+ module.debug('Looking up url for action', action, settings.api);
556
+ if(settings.api[action] !== undefined) {
557
+ url = settings.api[action];
558
+ module.debug('Found template url', url);
559
+ }
560
+ else {
561
+ module.error(error.missingAction, settings.action, settings.api);
562
+ }
563
+ }
564
+ return url;
565
+ }
566
+ },
567
+
568
+ abort: function() {
569
+ var
570
+ xhr = module.get.xhr()
571
+ ;
572
+ if( xhr && xhr.state() !== 'resolved') {
573
+ module.debug('Cancelling API request');
574
+ xhr.abort();
575
+ module.request.rejectWith(settings.apiSettings);
576
+ }
577
+ },
578
+
579
+ // reset state
580
+ reset: function() {
581
+ module.remove.error();
582
+ module.remove.loading();
583
+ },
584
+
585
+ setting: function(name, value) {
586
+ module.debug('Changing setting', name, value);
587
+ if( $.isPlainObject(name) ) {
588
+ $.extend(true, settings, name);
589
+ }
590
+ else if(value !== undefined) {
591
+ settings[name] = value;
592
+ }
593
+ else {
594
+ return settings[name];
595
+ }
596
+ },
597
+ internal: function(name, value) {
598
+ if( $.isPlainObject(name) ) {
599
+ $.extend(true, module, name);
600
+ }
601
+ else if(value !== undefined) {
602
+ module[name] = value;
603
+ }
604
+ else {
605
+ return module[name];
606
+ }
607
+ },
608
+ debug: function() {
609
+ if(settings.debug) {
610
+ if(settings.performance) {
611
+ module.performance.log(arguments);
612
+ }
613
+ else {
614
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
615
+ module.debug.apply(console, arguments);
616
+ }
617
+ }
618
+ },
619
+ verbose: function() {
620
+ if(settings.verbose && settings.debug) {
621
+ if(settings.performance) {
622
+ module.performance.log(arguments);
623
+ }
624
+ else {
625
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
626
+ module.verbose.apply(console, arguments);
627
+ }
628
+ }
629
+ },
630
+ error: function() {
631
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
632
+ module.error.apply(console, arguments);
633
+ },
634
+ performance: {
635
+ log: function(message) {
636
+ var
637
+ currentTime,
638
+ executionTime,
639
+ previousTime
640
+ ;
641
+ if(settings.performance) {
642
+ currentTime = new Date().getTime();
643
+ previousTime = time || currentTime;
644
+ executionTime = currentTime - previousTime;
645
+ time = currentTime;
646
+ performance.push({
647
+ 'Name' : message[0],
648
+ 'Arguments' : [].slice.call(message, 1) || '',
649
+ //'Element' : element,
650
+ 'Execution Time' : executionTime
651
+ });
652
+ }
653
+ clearTimeout(module.performance.timer);
654
+ module.performance.timer = setTimeout(module.performance.display, 100);
655
+ },
656
+ display: function() {
657
+ var
658
+ title = settings.name + ':',
659
+ totalTime = 0
660
+ ;
661
+ time = false;
662
+ clearTimeout(module.performance.timer);
663
+ $.each(performance, function(index, data) {
664
+ totalTime += data['Execution Time'];
665
+ });
666
+ title += ' ' + totalTime + 'ms';
667
+ if(moduleSelector) {
668
+ title += ' \'' + moduleSelector + '\'';
669
+ }
670
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
671
+ console.groupCollapsed(title);
672
+ if(console.table) {
673
+ console.table(performance);
674
+ }
675
+ else {
676
+ $.each(performance, function(index, data) {
677
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
678
+ });
679
+ }
680
+ console.groupEnd();
681
+ }
682
+ performance = [];
683
+ }
684
+ },
685
+ invoke: function(query, passedArguments, context) {
686
+ var
687
+ object = instance,
688
+ maxDepth,
689
+ found,
690
+ response
691
+ ;
692
+ passedArguments = passedArguments || queryArguments;
693
+ context = element || context;
694
+ if(typeof query == 'string' && object !== undefined) {
695
+ query = query.split(/[\. ]/);
696
+ maxDepth = query.length - 1;
697
+ $.each(query, function(depth, value) {
698
+ var camelCaseValue = (depth != maxDepth)
699
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
700
+ : query
701
+ ;
702
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
703
+ object = object[camelCaseValue];
704
+ }
705
+ else if( object[camelCaseValue] !== undefined ) {
706
+ found = object[camelCaseValue];
707
+ return false;
708
+ }
709
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
710
+ object = object[value];
711
+ }
712
+ else if( object[value] !== undefined ) {
713
+ found = object[value];
714
+ return false;
715
+ }
716
+ else {
717
+ module.error(error.method, query);
718
+ return false;
719
+ }
720
+ });
721
+ }
722
+ if ( $.isFunction( found ) ) {
723
+ response = found.apply(context, passedArguments);
724
+ }
725
+ else if(found !== undefined) {
726
+ response = found;
727
+ }
728
+ if($.isArray(returnedValue)) {
729
+ returnedValue.push(response);
730
+ }
731
+ else if(returnedValue !== undefined) {
732
+ returnedValue = [returnedValue, response];
733
+ }
734
+ else if(response !== undefined) {
735
+ returnedValue = response;
736
+ }
737
+ return found;
738
+ }
739
+ };
740
+
741
+ if(methodInvoked) {
742
+ if(instance === undefined) {
743
+ module.initialize();
744
+ }
745
+ module.invoke(query);
746
+ }
747
+ else {
748
+ if(instance !== undefined) {
749
+ module.destroy();
750
+ }
751
+ module.initialize();
752
+ }
753
+ })
754
+ ;
755
+
756
+ return (returnedValue !== undefined)
757
+ ? returnedValue
758
+ : this
759
+ ;
760
+ };
761
+
762
+ $.api.settings = {
763
+
764
+ name : 'API',
765
+ namespace : 'api',
766
+
767
+ debug : true,
768
+ verbose : true,
769
+ performance : true,
770
+
771
+ // event binding
772
+ on : 'auto',
773
+ filter : '.disabled',
774
+ stateContext : false,
775
+
776
+ // state
777
+ loadingDuration : 0,
778
+ errorDuration : 2000,
779
+
780
+ // templating
781
+ action : false,
782
+ url : false,
783
+ base : '',
784
+
785
+ // data
786
+ urlData : {},
787
+
788
+ // ui
789
+ defaultData : true,
790
+ serializeForm : false,
791
+ throttle : 0,
792
+
793
+ // jQ ajax
794
+ method : 'get',
795
+ data : {},
796
+ dataType : 'json',
797
+
798
+ // callbacks
799
+ beforeSend : function(settings) { return settings; },
800
+ beforeXHR : function(xhr) {},
801
+
802
+ onSuccess : function(response, $module) {},
803
+ onComplete : function(response, $module) {},
804
+ onFailure : function(errorMessage, $module) {},
805
+ onError : function(errorMessage, $module) {},
806
+ onAbort : function(errorMessage, $module) {},
807
+
808
+ successTest : false,
809
+
810
+ // errors
811
+ error : {
812
+ beforeSend : 'The before send function has aborted the request',
813
+ error : 'There was an error with your request',
814
+ exitConditions : 'API Request Aborted. Exit conditions met',
815
+ JSONParse : 'JSON could not be parsed during error handling',
816
+ legacyParameters : 'You are using legacy API success callback names',
817
+ method : 'The method you called is not defined',
818
+ missingAction : 'API action used but no url was defined',
819
+ missingSerialize : 'Required dependency jquery-serialize-object missing, using basic serialize',
820
+ missingURL : 'No URL specified for api event',
821
+ noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
822
+ parseError : 'There was an error parsing your request',
823
+ requiredParameter : 'Missing a required URL parameter: ',
824
+ statusMessage : 'Server gave an error: ',
825
+ timeout : 'Your request timed out'
826
+ },
827
+
828
+ regExp : {
829
+ required: /\{\$*[A-z0-9]+\}/g,
830
+ optional: /\{\/\$*[A-z0-9]+\}/g,
831
+ },
832
+
833
+ className: {
834
+ loading : 'loading',
835
+ error : 'error'
836
+ },
837
+
838
+ selector: {
839
+ form: 'form'
840
+ },
841
+
842
+ metadata: {
843
+ action : 'action'
844
+ }
845
+ };
846
+
847
+
848
+ $.api.settings.api = {};
849
+
850
+
851
+ })( jQuery, window , document );