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.nag{display:none;opacity:.95;position:relative;top:0;left:0;z-index:999;min-height:0;width:100%;margin:0;padding:.75em 1em;background:#555;box-shadow:0 1px 2px 0 rgba(0,0,0,.2);font-size:1rem;text-align:center;color:rgba(0,0,0,.8);border-radius:0 0 .2857rem .2857rem;-webkit-transition:.2s background ease;transition:.2s background ease}a.ui.nag{cursor:pointer}.ui.nag>.title{display:inline-block;margin:0 .5em;color:#fff}.ui.nag>.close.icon{cursor:pointer;opacity:.4;position:absolute;top:50%;right:1em;font-size:1em;margin:-.5em 0 0;color:#fff;-webkit-transition:opacity .2s ease;transition:opacity .2s ease}.ui.nag:hover{background:#555;opacity:1}.ui.nag .close:hover{opacity:1}.ui.overlay.nag{position:absolute;display:block}.ui.fixed.nag{position:fixed}.ui.bottom.nag,.ui.bottom.nags{border-radius:.2857rem .2857rem 0 0;top:auto;bottom:0}.ui.inverted.nag,.ui.inverted.nags .nag{background-color:#f0f0f0;color:rgba(0,0,0,.85)}.ui.inverted.nag .close,.ui.inverted.nag .title,.ui.inverted.nags .nag .close,.ui.inverted.nags .nag .title{color:rgba(0,0,0,.4)}.ui.nags .nag{border-radius:0!important}.ui.nags .nag:last-child{border-radius:0 0 .2857rem .2857rem}.ui.bottom.nags .nag:last-child{border-radius:.2857rem .2857rem 0 0}
@@ -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,o,n,t){"use strict";e.fn.nag=function(n){var i,a=e(this),r=a.selector||"",s=(new Date).getTime(),c=[],l=arguments[0],u="string"==typeof l,g=[].slice.call(arguments,1);return a.each(function(){{var a,d=e.isPlainObject(n)?e.extend(!0,{},e.fn.nag.settings,n):e.extend({},e.fn.nag.settings),m=(d.className,d.selector),f=d.error,p=d.namespace,h="."+p,b=p+"-module",v=e(this),y=v.find(m.close),k=e(d.context?d.context:"body"),w=this,x=v.data(b);o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||o.msRequestAnimationFrame||function(e){setTimeout(e,0)}}a={initialize:function(){a.verbose("Initializing element"),v.data(b,a),y.on("click"+h,a.dismiss),d.detachable&&v.parent()[0]!==k[0]&&v.detach().prependTo(k),d.displayTime>0&&setTimeout(a.hide,d.displayTime),a.show()},destroy:function(){a.verbose("Destroying instance"),v.removeData(b).off(h)},show:function(){a.should.show()&&!v.is(":visible")&&(a.debug("Showing nag",d.animation.show),"fade"==d.animation.show?v.fadeIn(d.duration,d.easing):v.slideDown(d.duration,d.easing))},hide:function(){a.debug("Showing nag",d.animation.hide),"fade"==d.animation.show?v.fadeIn(d.duration,d.easing):v.slideUp(d.duration,d.easing)},onHide:function(){a.debug("Removing nag",d.animation.hide),v.remove(),d.onHide&&d.onHide()},dismiss:function(e){d.storageMethod&&a.storage.set(d.key,d.value),a.hide(),e.stopImmediatePropagation(),e.preventDefault()},should:{show:function(){return d.persist?(a.debug("Persistent nag is set, can show nag"),!0):a.storage.get(d.key)!=d.value.toString()?(a.debug("Stored value is not set, can show nag",a.storage.get(d.key)),!0):(a.debug("Stored value is set, cannot show nag",a.storage.get(d.key)),!1)}},get:{storageOptions:function(){var e={};return d.expires&&(e.expires=d.expires),d.domain&&(e.domain=d.domain),d.path&&(e.path=d.path),e}},clear:function(){a.storage.remove(d.key)},storage:{set:function(n,i){var r=a.get.storageOptions();if("localstorage"==d.storageMethod&&o.localStorage!==t)o.localStorage.setItem(n,i),a.debug("Value stored using local storage",n,i);else{if(e.cookie===t)return void a.error(f.noCookieStorage);e.cookie(n,i,r),a.debug("Value stored using cookie",n,i,r)}},get:function(n){var i;return"localstorage"==d.storageMethod&&o.localStorage!==t?i=o.localStorage.getItem(n):e.cookie!==t?i=e.cookie(n):a.error(f.noCookieStorage),("undefined"==i||"null"==i||i===t||null===i)&&(i=t),i},remove:function(n){var i=a.get.storageOptions();"local"==d.storageMethod&&o.store!==t?o.localStorage.removeItem(n):e.cookie!==t?e.removeCookie(n,i):a.error(f.noStorage)}},setting:function(o,n){if(a.debug("Changing setting",o,n),e.isPlainObject(o))e.extend(!0,d,o);else{if(n===t)return d[o];d[o]=n}},internal:function(o,n){if(e.isPlainObject(o))e.extend(!0,a,o);else{if(n===t)return a[o];a[o]=n}},debug:function(){d.debug&&(d.performance?a.performance.log(arguments):(a.debug=Function.prototype.bind.call(console.info,console,d.name+":"),a.debug.apply(console,arguments)))},verbose:function(){d.verbose&&d.debug&&(d.performance?a.performance.log(arguments):(a.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),a.verbose.apply(console,arguments)))},error:function(){a.error=Function.prototype.bind.call(console.error,console,d.name+":"),a.error.apply(console,arguments)},performance:{log:function(e){var o,n,t;d.performance&&(o=(new Date).getTime(),t=s||o,n=o-t,s=o,c.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":n})),clearTimeout(a.performance.timer),a.performance.timer=setTimeout(a.performance.display,100)},display:function(){var o=d.name+":",n=0;s=!1,clearTimeout(a.performance.timer),e.each(c,function(e,o){n+=o["Execution Time"]}),o+=" "+n+"ms",r&&(o+=" '"+r+"'"),(console.group!==t||console.table!==t)&&c.length>0&&(console.groupCollapsed(o),console.table?console.table(c):e.each(c,function(e,o){console.log(o.Name+": "+o["Execution Time"]+"ms")}),console.groupEnd()),c=[]}},invoke:function(o,n,r){var s,c,l,u=x;return n=n||g,r=w||r,"string"==typeof o&&u!==t&&(o=o.split(/[\. ]/),s=o.length-1,e.each(o,function(n,i){var r=n!=s?i+o[n+1].charAt(0).toUpperCase()+o[n+1].slice(1):o;if(e.isPlainObject(u[r])&&n!=s)u=u[r];else{if(u[r]!==t)return c=u[r],!1;if(!e.isPlainObject(u[i])||n==s)return u[i]!==t?(c=u[i],!1):(a.error(f.method,o),!1);u=u[i]}})),e.isFunction(c)?l=c.apply(r,n):c!==t&&(l=c),e.isArray(i)?i.push(l):i!==t?i=[i,l]:l!==t&&(i=l),c}},u?(x===t&&a.initialize(),a.invoke(l)):(x!==t&&a.destroy(),a.initialize())}),i!==t?i:this},e.fn.nag.settings={name:"Nag",debug:!1,verbose:!0,performance:!0,namespace:"Nag",persist:!1,displayTime:0,animation:{show:"slide",hide:"slide"},context:!1,detachable:!1,expires:30,domain:!1,path:"/",storageMethod:"cookie",key:"nag",value:"dismiss",error:{noStorage:"Neither $.cookie or store is defined. A storage solution is required for storing state",method:"The method you called is not defined."},className:{bottom:"bottom",fixed:"fixed"},selector:{close:".close.icon"},speed:500,easing:"easeOutQuad",onHide:function(){}}}(jQuery,window,document);
@@ -0,0 +1,294 @@
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
+ Popup
16
+ *******************************/
17
+
18
+ .ui.popup {
19
+ display: none;
20
+ position: absolute;
21
+ top: 0px;
22
+ right: 0px;
23
+
24
+ /* Fixes content being squished when inline (moz only) */
25
+ min-width: -moz-max-content;
26
+ z-index: 1900;
27
+ border: 1px solid #cccccc;
28
+ max-width: 250px;
29
+ background-color: #ffffff;
30
+ padding: 0.833em 1em;
31
+ font-weight: normal;
32
+ font-style: normal;
33
+ color: rgba(0, 0, 0, 0.8);
34
+ border-radius: 0.2857rem;
35
+ box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
36
+ }
37
+ .ui.popup > .header {
38
+ padding: 0em;
39
+ font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
40
+ font-size: 1.125em;
41
+ line-height: 1.2;
42
+ font-weight: bold;
43
+ }
44
+ .ui.popup > .header + .content {
45
+ padding-top: 0.5em;
46
+ }
47
+ .ui.popup:before {
48
+ position: absolute;
49
+ content: '';
50
+ width: 0.75em;
51
+ height: 0.75em;
52
+ background: #ffffff;
53
+ -webkit-transform: rotate(45deg);
54
+ -ms-transform: rotate(45deg);
55
+ transform: rotate(45deg);
56
+ z-index: 2;
57
+ box-shadow: 1px 1px 0px 0px #b3b3b3;
58
+ }
59
+
60
+
61
+ /*******************************
62
+ Types
63
+ *******************************/
64
+
65
+
66
+ /*--------------
67
+ Spacing
68
+ ---------------*/
69
+
70
+ .ui.popup {
71
+ margin: 0em;
72
+ }
73
+ .ui.popup.bottom {
74
+ margin: 0.75em 0em 0em;
75
+ }
76
+ .ui.popup.top {
77
+ margin: 0em 0em 0.75em;
78
+ }
79
+ .ui.popup.left.center {
80
+ margin: 0em 0.75em 0em 0em;
81
+ }
82
+ .ui.popup.right.center {
83
+ margin: 0em 0em 0em 0.75em;
84
+ }
85
+
86
+ /*--------------
87
+ Pointer
88
+ ---------------*/
89
+
90
+
91
+ /*--- Below ---*/
92
+
93
+ .ui.bottom.center.popup:before {
94
+ margin-left: -0.325em;
95
+ top: -0.325em;
96
+ left: 50%;
97
+ right: auto;
98
+ bottom: auto;
99
+ box-shadow: -1px -1px 0px 0px #b3b3b3;
100
+ }
101
+ .ui.bottom.left.popup {
102
+ margin-left: 0em;
103
+ }
104
+ .ui.bottom.left.popup:before {
105
+ top: -0.325em;
106
+ left: 1em;
107
+ right: auto;
108
+ bottom: auto;
109
+ margin-left: 0em;
110
+ box-shadow: -1px -1px 0px 0px #b3b3b3;
111
+ }
112
+ .ui.bottom.right.popup {
113
+ margin-right: 0em;
114
+ }
115
+ .ui.bottom.right.popup:before {
116
+ top: -0.325em;
117
+ right: 1em;
118
+ bottom: auto;
119
+ left: auto;
120
+ margin-left: 0em;
121
+ box-shadow: -1px -1px 0px 0px #b3b3b3;
122
+ }
123
+
124
+ /*--- Above ---*/
125
+
126
+ .ui.top.center.popup:before {
127
+ top: auto;
128
+ right: auto;
129
+ bottom: -0.325em;
130
+ left: 50%;
131
+ margin-left: -0.325em;
132
+ }
133
+ .ui.top.left.popup {
134
+ margin-left: 0em;
135
+ }
136
+ .ui.top.left.popup:before {
137
+ bottom: -0.325em;
138
+ left: 1em;
139
+ top: auto;
140
+ right: auto;
141
+ margin-left: 0em;
142
+ }
143
+ .ui.top.right.popup {
144
+ margin-right: 0em;
145
+ }
146
+ .ui.top.right.popup:before {
147
+ bottom: -0.325em;
148
+ right: 1em;
149
+ top: auto;
150
+ left: auto;
151
+ margin-left: 0em;
152
+ }
153
+
154
+ /*--- Left Center ---*/
155
+
156
+ .ui.left.center.popup:before {
157
+ top: 50%;
158
+ right: -0.325em;
159
+ bottom: auto;
160
+ left: auto;
161
+ margin-top: -0.325em;
162
+ box-shadow: 1px -1px 0px 0px #b3b3b3;
163
+ }
164
+
165
+ /*--- Right Center ---*/
166
+
167
+ .ui.right.center.popup:before {
168
+ top: 50%;
169
+ left: -0.325em;
170
+ bottom: auto;
171
+ right: auto;
172
+ margin-top: -0.325em;
173
+ box-shadow: -1px 1px 0px 0px #b3b3b3;
174
+ }
175
+
176
+
177
+ /*******************************
178
+ Coupling
179
+ *******************************/
180
+
181
+
182
+ /* Immediate Nested Grid */
183
+ .ui.popup > .ui.grid:not(.padded) {
184
+ width: -webkit-calc(100% + 1.75rem);
185
+ width: calc(100% + 1.75rem);
186
+ margin: -0.7rem -0.875rem;
187
+ }
188
+
189
+
190
+ /*******************************
191
+ States
192
+ *******************************/
193
+
194
+ .ui.loading.popup {
195
+ display: block;
196
+ visibility: hidden;
197
+ z-index: -1;
198
+ }
199
+ .ui.animating.popup,
200
+ .ui.visible.popup {
201
+ display: block;
202
+ }
203
+
204
+
205
+ /*******************************
206
+ Variations
207
+ *******************************/
208
+
209
+
210
+ /*--------------
211
+ Basic
212
+ ---------------*/
213
+
214
+ .ui.basic.popup:before {
215
+ display: none;
216
+ }
217
+
218
+ /*--------------
219
+ Wide
220
+ ---------------*/
221
+
222
+ .ui.wide.popup {
223
+ max-width: 350px;
224
+ }
225
+ .ui[class*="very wide"].popup {
226
+ max-width: 550px;
227
+ }
228
+
229
+ /*--------------
230
+ Fluid
231
+ ---------------*/
232
+
233
+ .ui.fluid.popup {
234
+ width: 100%;
235
+ max-width: none;
236
+ }
237
+
238
+ /*--------------
239
+ Colors
240
+ ---------------*/
241
+
242
+
243
+ /* Inverted colors */
244
+ .ui.inverted.popup {
245
+ background: #1b1c1d;
246
+ color: #ffffff;
247
+ border: none;
248
+ box-shadow: none;
249
+ }
250
+ .ui.inverted.popup .header {
251
+ background-color: none;
252
+ color: #ffffff;
253
+ }
254
+ .ui.inverted.popup:before {
255
+ background-color: #1b1c1d;
256
+ box-shadow: none !important;
257
+ }
258
+
259
+ /*--------------
260
+ Flowing
261
+ ---------------*/
262
+
263
+ .ui.flowing.popup {
264
+ max-width: none;
265
+ }
266
+
267
+ /*--------------
268
+ Sizes
269
+ ---------------*/
270
+
271
+ .ui.small.popup {
272
+ font-size: 0.785714rem;
273
+ }
274
+ .ui.popup {
275
+ font-size: 0.85714rem;
276
+ }
277
+ .ui.large.popup {
278
+ font-size: 1rem;
279
+ }
280
+ .ui.huge.popup {
281
+ font-size: 1.14285rem;
282
+ }
283
+
284
+
285
+ /*******************************
286
+ Theme Overrides
287
+ *******************************/
288
+
289
+
290
+
291
+ /*******************************
292
+ User Overrides
293
+ *******************************/
294
+
@@ -0,0 +1,1187 @@
1
+ /*
2
+ * # Semantic - Popup
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.popup = function(parameters) {
17
+ var
18
+ $allModules = $(this),
19
+ $document = $(document),
20
+
21
+ moduleSelector = $allModules.selector || '',
22
+
23
+ hasTouch = ('ontouchstart' in document.documentElement),
24
+ time = new Date().getTime(),
25
+ performance = [],
26
+
27
+ query = arguments[0],
28
+ methodInvoked = (typeof query == 'string'),
29
+ queryArguments = [].slice.call(arguments, 1),
30
+
31
+ returnedValue
32
+ ;
33
+ $allModules
34
+ .each(function() {
35
+ var
36
+ settings = ( $.isPlainObject(parameters) )
37
+ ? $.extend(true, {}, $.fn.popup.settings, parameters)
38
+ : $.extend({}, $.fn.popup.settings),
39
+
40
+ selector = settings.selector,
41
+ className = settings.className,
42
+ error = settings.error,
43
+ metadata = settings.metadata,
44
+ namespace = settings.namespace,
45
+
46
+ eventNamespace = '.' + settings.namespace,
47
+ moduleNamespace = 'module-' + namespace,
48
+
49
+ $module = $(this),
50
+ $context = $(settings.context),
51
+ $target = (settings.target)
52
+ ? $(settings.target)
53
+ : $module,
54
+
55
+ $window = $(window),
56
+ $body = $('body'),
57
+ $popup,
58
+ $offsetParent,
59
+
60
+ searchDepth = 0,
61
+ triedPositions = false,
62
+
63
+ element = this,
64
+ instance = $module.data(moduleNamespace),
65
+ module
66
+ ;
67
+
68
+ module = {
69
+
70
+ // binds events
71
+ initialize: function() {
72
+ module.debug('Initializing module', $module);
73
+ if(settings.on == 'click') {
74
+ $module
75
+ .on('click' + eventNamespace, module.toggle)
76
+ ;
77
+ }
78
+ else if( module.get.startEvent() ) {
79
+ $module
80
+ .on(module.get.startEvent() + eventNamespace, module.event.start)
81
+ .on(module.get.endEvent() + eventNamespace, module.event.end)
82
+ ;
83
+ }
84
+ if(settings.target) {
85
+ module.debug('Target set to element', $target);
86
+ }
87
+ $window
88
+ .on('resize' + eventNamespace, module.event.resize)
89
+ ;
90
+ if( !module.exists() && settings.preserve) {
91
+ module.create();
92
+ }
93
+ module.instantiate();
94
+ },
95
+
96
+ instantiate: function() {
97
+ module.verbose('Storing instance of module', module);
98
+ instance = module;
99
+ $module
100
+ .data(moduleNamespace, instance)
101
+ ;
102
+ },
103
+
104
+ refresh: function() {
105
+ if(settings.popup) {
106
+ $popup = $(settings.popup).eq(0);
107
+ }
108
+ else {
109
+ if(settings.inline) {
110
+ $popup = $target.next(selector.popup).eq(0);
111
+ }
112
+ }
113
+ if(settings.popup) {
114
+ $popup.addClass(className.loading);
115
+ $offsetParent = module.get.offsetParent();
116
+ $popup.removeClass(className.loading);
117
+ if(settings.movePopup && module.has.popup() && module.get.offsetParent($popup)[0] !== $offsetParent[0]) {
118
+ module.debug('Moving popup to the same offset parent as activating element');
119
+ $popup
120
+ .detach()
121
+ .appendTo($offsetParent)
122
+ ;
123
+ }
124
+ }
125
+ else {
126
+ $offsetParent = (settings.inline)
127
+ ? module.get.offsetParent($target)
128
+ : module.has.popup()
129
+ ? module.get.offsetParent($popup)
130
+ : $body
131
+ ;
132
+ }
133
+ if( $offsetParent.is('html') ) {
134
+ module.debug('Setting page as offset parent');
135
+ $offsetParent = $body;
136
+ }
137
+ },
138
+
139
+ reposition: function() {
140
+ module.refresh();
141
+ module.set.position();
142
+ },
143
+
144
+ destroy: function() {
145
+ module.debug('Destroying previous module');
146
+ if($popup && !settings.preserve) {
147
+ module.removePopup();
148
+ }
149
+ clearTimeout(module.hideTimer);
150
+ clearTimeout(module.showTimer);
151
+ $module
152
+ .off(eventNamespace)
153
+ .removeData(moduleNamespace)
154
+ ;
155
+ },
156
+
157
+ event: {
158
+ start: function(event) {
159
+ var
160
+ delay = ($.isPlainObject(settings.delay))
161
+ ? settings.delay.show
162
+ : settings.delay
163
+ ;
164
+ clearTimeout(module.hideTimer);
165
+ module.showTimer = setTimeout(function() {
166
+ if(module.is.hidden() && !( module.is.active() && module.is.dropdown()) ) {
167
+ module.show();
168
+ }
169
+ }, delay);
170
+ },
171
+ end: function() {
172
+ var
173
+ delay = ($.isPlainObject(settings.delay))
174
+ ? settings.delay.hide
175
+ : settings.delay
176
+ ;
177
+ clearTimeout(module.showTimer);
178
+ module.hideTimer = setTimeout(function() {
179
+ if(module.is.visible() ) {
180
+ module.hide();
181
+ }
182
+ }, delay);
183
+ },
184
+ resize: function() {
185
+ if( module.is.visible() ) {
186
+ module.set.position();
187
+ }
188
+ }
189
+ },
190
+
191
+ // generates popup html from metadata
192
+ create: function() {
193
+ var
194
+ html = $module.data(metadata.html) || settings.html,
195
+ variation = $module.data(metadata.variation) || settings.variation,
196
+ title = $module.data(metadata.title) || settings.title,
197
+ content = $module.data(metadata.content) || $module.attr('title') || settings.content
198
+ ;
199
+ if(html || content || title) {
200
+ module.debug('Creating pop-up html');
201
+ if(!html) {
202
+ html = settings.templates.popup({
203
+ title : title,
204
+ content : content
205
+ });
206
+ }
207
+ $popup = $('<div/>')
208
+ .addClass(className.popup)
209
+ .addClass(variation)
210
+ .html(html)
211
+ ;
212
+ if(variation) {
213
+ $popup
214
+ .addClass(variation)
215
+ ;
216
+ }
217
+ if(settings.inline) {
218
+ module.verbose('Inserting popup element inline', $popup);
219
+ $popup
220
+ .insertAfter($module)
221
+ ;
222
+ }
223
+ else {
224
+ module.verbose('Appending popup element to body', $popup);
225
+ $popup
226
+ .appendTo( $context )
227
+ ;
228
+ }
229
+ module.refresh();
230
+ if(settings.hoverable) {
231
+ module.bind.popup();
232
+ }
233
+ settings.onCreate.call($popup, element);
234
+ }
235
+ else if($target.next(selector.popup).length !== 0) {
236
+ module.verbose('Pre-existing popup found');
237
+ settings.inline = true;
238
+ settings.popup = $target.next(selector.popup);
239
+ module.refresh();
240
+ if(settings.hoverable) {
241
+ module.bind.popup();
242
+ }
243
+ }
244
+ else if(settings.popup) {
245
+ module.verbose('Used popup specified in settings');
246
+ module.refresh();
247
+ if(settings.hoverable) {
248
+ module.bind.popup();
249
+ }
250
+ }
251
+ else {
252
+ module.debug('No content specified skipping display', element);
253
+ }
254
+ },
255
+
256
+ // determines popup state
257
+ toggle: function() {
258
+ module.debug('Toggling pop-up');
259
+ if( module.is.hidden() ) {
260
+ module.debug('Popup is hidden, showing pop-up');
261
+ module.unbind.close();
262
+ module.hideAll();
263
+ module.show();
264
+ }
265
+ else {
266
+ module.debug('Popup is visible, hiding pop-up');
267
+ module.hide();
268
+ }
269
+ },
270
+
271
+ show: function(callback) {
272
+ callback = $.isFunction(callback) ? callback : function(){};
273
+ module.debug('Showing pop-up', settings.transition);
274
+ if( !module.exists() ) {
275
+ module.create();
276
+ }
277
+ else if(!settings.preserve && !settings.popup) {
278
+ module.refresh();
279
+ }
280
+ if( $popup && module.set.position() ) {
281
+ module.save.conditions();
282
+ module.animate.show(callback);
283
+ }
284
+ },
285
+
286
+
287
+ hide: function(callback) {
288
+ callback = $.isFunction(callback) ? callback : function(){};
289
+ module.remove.visible();
290
+ module.unbind.close();
291
+ if( module.is.visible() ) {
292
+ module.restore.conditions();
293
+ module.animate.hide(callback);
294
+ }
295
+ },
296
+
297
+ hideAll: function() {
298
+ $(selector.popup)
299
+ .filter(':visible')
300
+ .transition(settings.transition)
301
+ ;
302
+ },
303
+
304
+ hideGracefully: function(event) {
305
+ // don't close on clicks inside popup
306
+ if(event && $(event.target).closest(selector.popup).length === 0) {
307
+ module.debug('Click occurred outside popup hiding popup');
308
+ module.hide();
309
+ }
310
+ else {
311
+ module.debug('Click was inside popup, keeping popup open');
312
+ }
313
+ },
314
+
315
+ exists: function() {
316
+ if(!$popup) {
317
+ return false;
318
+ }
319
+ if(settings.inline || settings.popup) {
320
+ return ( module.has.popup() );
321
+ }
322
+ else {
323
+ return ( $popup.closest($context).length >= 1 )
324
+ ? true
325
+ : false
326
+ ;
327
+ }
328
+ },
329
+
330
+ removePopup: function() {
331
+ module.debug('Removing popup', $popup);
332
+ if( module.has.popup() && !settings.popup) {
333
+ $popup.remove();
334
+ $popup = undefined;
335
+ }
336
+ settings.onRemove.call($popup, element);
337
+ },
338
+
339
+ save: {
340
+ conditions: function() {
341
+ module.cache = {
342
+ title: $module.attr('title')
343
+ };
344
+ if (module.cache.title) {
345
+ $module.removeAttr('title');
346
+ }
347
+ module.verbose('Saving original attributes', module.cache.title);
348
+ }
349
+ },
350
+ restore: {
351
+ conditions: function() {
352
+ if(module.cache && module.cache.title) {
353
+ $module.attr('title', module.cache.title);
354
+ module.verbose('Restoring original attributes', module.cache.title);
355
+ }
356
+ return true;
357
+ }
358
+ },
359
+ animate: {
360
+ show: function(callback) {
361
+ callback = $.isFunction(callback) ? callback : function(){};
362
+ if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
363
+ module.set.visible();
364
+ $popup
365
+ .transition({
366
+ animation : settings.transition + ' in',
367
+ queue : false,
368
+ debug : settings.debug,
369
+ verbose : settings.verbose,
370
+ duration : settings.duration,
371
+ onComplete : function() {
372
+ module.bind.close();
373
+ callback.call($popup, element);
374
+ settings.onVisible.call($popup, element);
375
+ }
376
+ })
377
+ ;
378
+ }
379
+ else {
380
+ module.set.visible();
381
+ $popup
382
+ .stop()
383
+ .fadeIn(settings.duration, settings.easing, function() {
384
+ module.bind.close();
385
+ callback.call($popup, element);
386
+ settings.onVisible.call($popup, element);
387
+ })
388
+ ;
389
+ }
390
+ settings.onShow.call($popup, element);
391
+ },
392
+ hide: function(callback) {
393
+ callback = $.isFunction(callback) ? callback : function(){};
394
+ module.debug('Hiding pop-up');
395
+ if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
396
+ $popup
397
+ .transition({
398
+ animation : settings.transition + ' out',
399
+ queue : false,
400
+ duration : settings.duration,
401
+ debug : settings.debug,
402
+ verbose : settings.verbose,
403
+ onComplete : function() {
404
+ module.reset();
405
+ callback.call($popup, element);
406
+ settings.onHidden.call($popup, element);
407
+ }
408
+ })
409
+ ;
410
+ }
411
+ else {
412
+ $popup
413
+ .stop()
414
+ .fadeOut(settings.duration, settings.easing, function() {
415
+ module.reset();
416
+ callback.call($popup, element);
417
+ settings.onHidden.call($popup, element);
418
+ })
419
+ ;
420
+ }
421
+ settings.onHide.call($popup, element);
422
+ }
423
+ },
424
+
425
+ get: {
426
+ startEvent: function() {
427
+ if(settings.on == 'hover') {
428
+ return 'mouseenter';
429
+ }
430
+ else if(settings.on == 'focus') {
431
+ return 'focus';
432
+ }
433
+ return false;
434
+ },
435
+ endEvent: function() {
436
+ if(settings.on == 'hover') {
437
+ return 'mouseleave';
438
+ }
439
+ else if(settings.on == 'focus') {
440
+ return 'blur';
441
+ }
442
+ return false;
443
+ },
444
+ offsetParent: function($target) {
445
+ var
446
+ element = ($target !== undefined)
447
+ ? $target[0]
448
+ : $module[0],
449
+ parentNode = element.parentNode,
450
+ $node = $(parentNode)
451
+ ;
452
+ if(parentNode) {
453
+ var
454
+ is2D = ($node.css('transform') === 'none'),
455
+ isStatic = ($node.css('position') === 'static'),
456
+ isHTML = $node.is('html')
457
+ ;
458
+ while(parentNode && !isHTML && isStatic && is2D) {
459
+ parentNode = parentNode.parentNode;
460
+ $node = $(parentNode);
461
+ is2D = ($node.css('transform') === 'none');
462
+ isStatic = ($node.css('position') === 'static');
463
+ isHTML = $node.is('html');
464
+ }
465
+ }
466
+ return ($node && $node.length > 0)
467
+ ? $node
468
+ : $()
469
+ ;
470
+ },
471
+ offstagePosition: function(position) {
472
+ var
473
+ boundary = {
474
+ top : $(window).scrollTop(),
475
+ bottom : $(window).scrollTop() + $(window).height(),
476
+ left : 0,
477
+ right : $(window).width()
478
+ },
479
+ popup = {
480
+ width : $popup.width(),
481
+ height : $popup.height(),
482
+ offset : $popup.offset()
483
+ },
484
+ offstage = {},
485
+ offstagePositions = []
486
+ ;
487
+ position = position || false;
488
+ if(popup.offset && position) {
489
+ module.verbose('Checking if outside viewable area', popup.offset);
490
+ offstage = {
491
+ top : (popup.offset.top < boundary.top),
492
+ bottom : (popup.offset.top + popup.height > boundary.bottom),
493
+ right : (popup.offset.left + popup.width > boundary.right),
494
+ left : (popup.offset.left < boundary.left)
495
+ };
496
+ }
497
+ // return only boundaries that have been surpassed
498
+ $.each(offstage, function(direction, isOffstage) {
499
+ if(isOffstage) {
500
+ offstagePositions.push(direction);
501
+ }
502
+ });
503
+ return (offstagePositions.length > 0)
504
+ ? offstagePositions.join(' ')
505
+ : false
506
+ ;
507
+ },
508
+ positions: function() {
509
+ return {
510
+ 'top left' : false,
511
+ 'top center' : false,
512
+ 'top right' : false,
513
+ 'bottom left' : false,
514
+ 'bottom center' : false,
515
+ 'bottom right' : false,
516
+ 'left center' : false,
517
+ 'right center' : false
518
+ };
519
+ },
520
+ nextPosition: function(position) {
521
+ var
522
+ positions = position.split(' '),
523
+ verticalPosition = positions[0],
524
+ horizontalPosition = positions[1],
525
+ opposite = {
526
+ top : 'bottom',
527
+ bottom : 'top',
528
+ left : 'right',
529
+ right : 'left'
530
+ },
531
+ adjacent = {
532
+ left : 'center',
533
+ center : 'right',
534
+ right : 'left'
535
+ },
536
+ backup = {
537
+ 'top left' : 'top center',
538
+ 'top center' : 'top right',
539
+ 'top right' : 'right center',
540
+ 'right center' : 'bottom right',
541
+ 'bottom right' : 'bottom center',
542
+ 'bottom center' : 'bottom left',
543
+ 'bottom left' : 'left center',
544
+ 'left center' : 'top left'
545
+ },
546
+ adjacentsAvailable = (verticalPosition == 'top' || verticalPosition == 'bottom'),
547
+ oppositeTried = false,
548
+ adjacentTried = false,
549
+ nextPosition = false
550
+ ;
551
+ if(!triedPositions) {
552
+ module.verbose('All available positions available');
553
+ triedPositions = module.get.positions();
554
+ }
555
+
556
+ module.debug('Recording last position tried', position);
557
+ triedPositions[position] = true;
558
+
559
+ if(settings.prefer === 'opposite') {
560
+ nextPosition = [opposite[verticalPosition], horizontalPosition];
561
+ nextPosition = nextPosition.join(' ');
562
+ oppositeTried = (triedPositions[nextPosition] === true);
563
+ module.debug('Trying opposite strategy', nextPosition);
564
+ }
565
+ if((settings.prefer === 'adjacent') && adjacentsAvailable ) {
566
+ nextPosition = [verticalPosition, adjacent[horizontalPosition]];
567
+ nextPosition = nextPosition.join(' ');
568
+ adjacentTried = (triedPositions[nextPosition] === true);
569
+ module.debug('Trying adjacent strategy', nextPosition);
570
+ }
571
+ if(adjacentTried || oppositeTried) {
572
+ module.debug('Using backup position', nextPosition);
573
+ nextPosition = backup[position];
574
+ }
575
+ return nextPosition;
576
+ }
577
+ },
578
+
579
+ set: {
580
+ position: function(position, arrowOffset) {
581
+ var
582
+ windowWidth = $(window).width(),
583
+ windowHeight = $(window).height(),
584
+
585
+ targetWidth = $target.outerWidth(),
586
+ targetHeight = $target.outerHeight(),
587
+
588
+ popupWidth = $popup.outerWidth(),
589
+ popupHeight = $popup.outerHeight(),
590
+
591
+ parentWidth = $offsetParent.outerWidth(),
592
+ parentHeight = $offsetParent.outerHeight(),
593
+
594
+ distanceAway = settings.distanceAway,
595
+
596
+ targetElement = $target[0],
597
+
598
+ marginTop = (settings.inline)
599
+ ? parseInt( window.getComputedStyle(targetElement).getPropertyValue('margin-top'), 10)
600
+ : 0,
601
+ marginLeft = (settings.inline)
602
+ ? parseInt( window.getComputedStyle(targetElement).getPropertyValue(module.is.rtl() ? 'margin-right' : 'margin-left'), 10)
603
+ : 0,
604
+
605
+ target = (settings.inline || settings.popup)
606
+ ? $target.position()
607
+ : $target.offset(),
608
+
609
+ computedPosition,
610
+ positioning,
611
+ offstagePosition
612
+ ;
613
+ position = position || $module.data(metadata.position) || settings.position;
614
+ arrowOffset = arrowOffset || $module.data(metadata.offset) || settings.offset;
615
+
616
+ if(searchDepth == settings.maxSearchDepth && settings.lastResort) {
617
+ module.debug('Using last resort position to display', settings.lastResort);
618
+ position = settings.lastResort;
619
+ }
620
+
621
+ if(settings.inline) {
622
+ module.debug('Adding targets margin to calculation');
623
+ if(position == 'left center' || position == 'right center') {
624
+ arrowOffset += marginTop;
625
+ distanceAway += -marginLeft;
626
+ }
627
+ else if (position == 'top left' || position == 'top center' || position == 'top right') {
628
+ arrowOffset += marginLeft;
629
+ distanceAway -= marginTop;
630
+ }
631
+ else {
632
+ arrowOffset += marginLeft;
633
+ distanceAway += marginTop;
634
+ }
635
+ }
636
+ module.debug('Calculating popup positioning', position);
637
+
638
+ computedPosition = position;
639
+ if (module.is.rtl()) {
640
+ computedPosition = computedPosition.replace(/left|right/g, function (match) {
641
+ return (match == 'left')
642
+ ? 'right'
643
+ : 'left'
644
+ ;
645
+ });
646
+ module.debug('RTL: Popup positioning updated', computedPosition);
647
+ }
648
+ switch (computedPosition) {
649
+ case 'top left':
650
+ positioning = {
651
+ top : 'auto',
652
+ bottom : parentHeight - target.top + distanceAway,
653
+ left : target.left + arrowOffset,
654
+ right : 'auto'
655
+ };
656
+ break;
657
+ case 'top center':
658
+ positioning = {
659
+ bottom : parentHeight - target.top + distanceAway,
660
+ left : target.left + (targetWidth / 2) - (popupWidth / 2) + arrowOffset,
661
+ top : 'auto',
662
+ right : 'auto'
663
+ };
664
+ break;
665
+ case 'top right':
666
+ positioning = {
667
+ bottom : parentHeight - target.top + distanceAway,
668
+ right : parentWidth - target.left - targetWidth - arrowOffset,
669
+ top : 'auto',
670
+ left : 'auto'
671
+ };
672
+ break;
673
+ case 'left center':
674
+ positioning = {
675
+ top : target.top + (targetHeight / 2) - (popupHeight / 2) + arrowOffset,
676
+ right : parentWidth - target.left + distanceAway,
677
+ left : 'auto',
678
+ bottom : 'auto'
679
+ };
680
+ break;
681
+ case 'right center':
682
+ positioning = {
683
+ top : target.top + (targetHeight / 2) - (popupHeight / 2) + arrowOffset,
684
+ left : target.left + targetWidth + distanceAway,
685
+ bottom : 'auto',
686
+ right : 'auto'
687
+ };
688
+ break;
689
+ case 'bottom left':
690
+ positioning = {
691
+ top : target.top + targetHeight + distanceAway,
692
+ left : target.left + arrowOffset,
693
+ bottom : 'auto',
694
+ right : 'auto'
695
+ };
696
+ break;
697
+ case 'bottom center':
698
+ positioning = {
699
+ top : target.top + targetHeight + distanceAway,
700
+ left : target.left + (targetWidth / 2) - (popupWidth / 2) + arrowOffset,
701
+ bottom : 'auto',
702
+ right : 'auto'
703
+ };
704
+ break;
705
+ case 'bottom right':
706
+ positioning = {
707
+ top : target.top + targetHeight + distanceAway,
708
+ right : parentWidth - target.left - targetWidth - arrowOffset,
709
+ left : 'auto',
710
+ bottom : 'auto'
711
+ };
712
+ break;
713
+ }
714
+ if(positioning === undefined) {
715
+ module.error(error.invalidPosition, position);
716
+ }
717
+
718
+ module.debug('Calculated popup positioning values', positioning);
719
+
720
+ // tentatively place on stage
721
+ $popup
722
+ .css(positioning)
723
+ .removeClass(className.position)
724
+ .addClass(position)
725
+ .addClass(className.loading)
726
+ ;
727
+ // check if is offstage
728
+ offstagePosition = module.get.offstagePosition(position);
729
+
730
+ // recursively find new positioning
731
+ if(offstagePosition) {
732
+ module.debug('Popup cant fit into viewport', offstagePosition);
733
+ if(searchDepth < settings.maxSearchDepth) {
734
+ searchDepth++;
735
+ position = module.get.nextPosition(position);
736
+ module.debug('Trying new position', position);
737
+ return ($popup)
738
+ ? module.set.position(position)
739
+ : false
740
+ ;
741
+ }
742
+ else if(!settings.lastResort) {
743
+ module.debug('Popup could not find a position in view', $popup);
744
+ module.error(error.cannotPlace);
745
+ module.remove.attempts();
746
+ module.remove.loading();
747
+ module.reset();
748
+ return false;
749
+ }
750
+ }
751
+
752
+ module.debug('Position is on stage', position);
753
+ module.remove.attempts();
754
+ module.set.fluidWidth();
755
+ module.remove.loading();
756
+ return true;
757
+ },
758
+
759
+ fluidWidth: function() {
760
+ if( settings.setFluidWidth && $popup.hasClass(className.fluid) ) {
761
+ $popup.css('width', $offsetParent.width());
762
+ }
763
+ },
764
+
765
+ visible: function() {
766
+ $module.addClass(className.visible);
767
+ }
768
+ },
769
+
770
+ remove: {
771
+ loading: function() {
772
+ $popup.removeClass(className.loading);
773
+ },
774
+ visible: function() {
775
+ $module.removeClass(className.visible);
776
+ },
777
+ attempts: function() {
778
+ module.verbose('Resetting all searched positions');
779
+ searchDepth = 0;
780
+ triedPositions = false;
781
+ }
782
+ },
783
+
784
+ bind: {
785
+ popup: function() {
786
+ module.verbose('Allowing hover events on popup to prevent closing');
787
+ if( $popup && module.has.popup() ) {
788
+ $popup
789
+ .on('mouseenter' + eventNamespace, module.event.start)
790
+ .on('mouseleave' + eventNamespace, module.event.end)
791
+ ;
792
+ }
793
+ },
794
+ close:function() {
795
+ if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {
796
+ $document
797
+ .one('touchmove' + eventNamespace, module.hideGracefully)
798
+ .one('scroll' + eventNamespace, module.hideGracefully)
799
+ ;
800
+ $context
801
+ .one('touchmove' + eventNamespace, module.hideGracefully)
802
+ .one('scroll' + eventNamespace, module.hideGracefully)
803
+ ;
804
+ }
805
+ if(settings.on == 'click' && settings.closable) {
806
+ module.verbose('Binding popup close event to document');
807
+ $document
808
+ .on('click' + eventNamespace, function(event) {
809
+ module.verbose('Pop-up clickaway intent detected');
810
+ module.hideGracefully.call(element, event);
811
+ })
812
+ ;
813
+ }
814
+ }
815
+ },
816
+
817
+ unbind: {
818
+ close: function() {
819
+ if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {
820
+ $document
821
+ .off('scroll' + eventNamespace, module.hide)
822
+ ;
823
+ $context
824
+ .off('scroll' + eventNamespace, module.hide)
825
+ ;
826
+ }
827
+ if(settings.on == 'click' && settings.closable) {
828
+ module.verbose('Removing close event from document');
829
+ $document
830
+ .off('click' + eventNamespace)
831
+ ;
832
+ }
833
+ }
834
+ },
835
+
836
+ has: {
837
+ popup: function() {
838
+ return ($popup && $popup.length > 0);
839
+ }
840
+ },
841
+
842
+ is: {
843
+ active: function() {
844
+ return $module.hasClass(className.active);
845
+ },
846
+ animating: function() {
847
+ return ( $popup && $popup.is(':animated') || $popup.hasClass(className.animating) );
848
+ },
849
+ visible: function() {
850
+ return $popup && $popup.is(':visible');
851
+ },
852
+ dropdown: function() {
853
+ return $module.hasClass(className.dropdown);
854
+ },
855
+ hidden: function() {
856
+ return !module.is.visible();
857
+ },
858
+ rtl: function () {
859
+ return $module.css('direction') == 'rtl';
860
+ }
861
+ },
862
+
863
+ reset: function() {
864
+ module.remove.visible();
865
+ if(settings.preserve) {
866
+ if($.fn.transition !== undefined) {
867
+ $popup
868
+ .transition('remove transition')
869
+ ;
870
+ }
871
+ }
872
+ else {
873
+ module.removePopup();
874
+ }
875
+ },
876
+
877
+ setting: function(name, value) {
878
+ if( $.isPlainObject(name) ) {
879
+ $.extend(true, settings, name);
880
+ }
881
+ else if(value !== undefined) {
882
+ settings[name] = value;
883
+ }
884
+ else {
885
+ return settings[name];
886
+ }
887
+ },
888
+ internal: function(name, value) {
889
+ if( $.isPlainObject(name) ) {
890
+ $.extend(true, module, name);
891
+ }
892
+ else if(value !== undefined) {
893
+ module[name] = value;
894
+ }
895
+ else {
896
+ return module[name];
897
+ }
898
+ },
899
+ debug: function() {
900
+ if(settings.debug) {
901
+ if(settings.performance) {
902
+ module.performance.log(arguments);
903
+ }
904
+ else {
905
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
906
+ module.debug.apply(console, arguments);
907
+ }
908
+ }
909
+ },
910
+ verbose: function() {
911
+ if(settings.verbose && settings.debug) {
912
+ if(settings.performance) {
913
+ module.performance.log(arguments);
914
+ }
915
+ else {
916
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
917
+ module.verbose.apply(console, arguments);
918
+ }
919
+ }
920
+ },
921
+ error: function() {
922
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
923
+ module.error.apply(console, arguments);
924
+ },
925
+ performance: {
926
+ log: function(message) {
927
+ var
928
+ currentTime,
929
+ executionTime,
930
+ previousTime
931
+ ;
932
+ if(settings.performance) {
933
+ currentTime = new Date().getTime();
934
+ previousTime = time || currentTime;
935
+ executionTime = currentTime - previousTime;
936
+ time = currentTime;
937
+ performance.push({
938
+ 'Name' : message[0],
939
+ 'Arguments' : [].slice.call(message, 1) || '',
940
+ 'Element' : element,
941
+ 'Execution Time' : executionTime
942
+ });
943
+ }
944
+ clearTimeout(module.performance.timer);
945
+ module.performance.timer = setTimeout(module.performance.display, 100);
946
+ },
947
+ display: function() {
948
+ var
949
+ title = settings.name + ':',
950
+ totalTime = 0
951
+ ;
952
+ time = false;
953
+ clearTimeout(module.performance.timer);
954
+ $.each(performance, function(index, data) {
955
+ totalTime += data['Execution Time'];
956
+ });
957
+ title += ' ' + totalTime + 'ms';
958
+ if(moduleSelector) {
959
+ title += ' \'' + moduleSelector + '\'';
960
+ }
961
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
962
+ console.groupCollapsed(title);
963
+ if(console.table) {
964
+ console.table(performance);
965
+ }
966
+ else {
967
+ $.each(performance, function(index, data) {
968
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
969
+ });
970
+ }
971
+ console.groupEnd();
972
+ }
973
+ performance = [];
974
+ }
975
+ },
976
+ invoke: function(query, passedArguments, context) {
977
+ var
978
+ object = instance,
979
+ maxDepth,
980
+ found,
981
+ response
982
+ ;
983
+ passedArguments = passedArguments || queryArguments;
984
+ context = element || context;
985
+ if(typeof query == 'string' && object !== undefined) {
986
+ query = query.split(/[\. ]/);
987
+ maxDepth = query.length - 1;
988
+ $.each(query, function(depth, value) {
989
+ var camelCaseValue = (depth != maxDepth)
990
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
991
+ : query
992
+ ;
993
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
994
+ object = object[camelCaseValue];
995
+ }
996
+ else if( object[camelCaseValue] !== undefined ) {
997
+ found = object[camelCaseValue];
998
+ return false;
999
+ }
1000
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
1001
+ object = object[value];
1002
+ }
1003
+ else if( object[value] !== undefined ) {
1004
+ found = object[value];
1005
+ return false;
1006
+ }
1007
+ else {
1008
+ return false;
1009
+ }
1010
+ });
1011
+ }
1012
+ if ( $.isFunction( found ) ) {
1013
+ response = found.apply(context, passedArguments);
1014
+ }
1015
+ else if(found !== undefined) {
1016
+ response = found;
1017
+ }
1018
+ if($.isArray(returnedValue)) {
1019
+ returnedValue.push(response);
1020
+ }
1021
+ else if(returnedValue !== undefined) {
1022
+ returnedValue = [returnedValue, response];
1023
+ }
1024
+ else if(response !== undefined) {
1025
+ returnedValue = response;
1026
+ }
1027
+ return found;
1028
+ }
1029
+ };
1030
+
1031
+ if(methodInvoked) {
1032
+ if(instance === undefined) {
1033
+ module.initialize();
1034
+ }
1035
+ module.invoke(query);
1036
+ }
1037
+ else {
1038
+ if(instance !== undefined) {
1039
+ module.destroy();
1040
+ }
1041
+ module.initialize();
1042
+ }
1043
+ })
1044
+ ;
1045
+
1046
+ return (returnedValue !== undefined)
1047
+ ? returnedValue
1048
+ : this
1049
+ ;
1050
+ };
1051
+
1052
+ $.fn.popup.settings = {
1053
+
1054
+ name : 'Popup',
1055
+
1056
+ debug : false,
1057
+ verbose : true,
1058
+ performance : true,
1059
+ namespace : 'popup',
1060
+
1061
+ onCreate : function(){},
1062
+ onRemove : function(){},
1063
+
1064
+ onShow : function(){},
1065
+ onVisible : function(){},
1066
+ onHide : function(){},
1067
+ onHidden : function(){},
1068
+
1069
+ variation : '',
1070
+ content : false,
1071
+ html : false,
1072
+ title : false,
1073
+
1074
+ on : 'hover',
1075
+ closable : true,
1076
+ hideOnScroll : 'auto',
1077
+
1078
+ context : 'body',
1079
+
1080
+ position : 'top left',
1081
+ prefer : 'opposite',
1082
+ lastResort : false,
1083
+
1084
+ delay : {
1085
+ show : 30,
1086
+ hide : 0
1087
+ },
1088
+
1089
+ setFluidWidth : true,
1090
+ movePopup : true,
1091
+
1092
+ target : false,
1093
+ popup : false,
1094
+ inline : false,
1095
+ preserve : false,
1096
+ hoverable : false,
1097
+
1098
+ duration : 200,
1099
+ easing : 'easeOutQuint',
1100
+ transition : 'scale',
1101
+
1102
+ distanceAway : 0,
1103
+ offset : 0,
1104
+ maxSearchDepth : 20,
1105
+
1106
+ error: {
1107
+ invalidPosition : 'The position you specified is not a valid position',
1108
+ cannotPlace : 'No visible position could be found for the popup',
1109
+ method : 'The method you called is not defined.'
1110
+ },
1111
+
1112
+ metadata: {
1113
+ content : 'content',
1114
+ html : 'html',
1115
+ offset : 'offset',
1116
+ position : 'position',
1117
+ title : 'title',
1118
+ variation : 'variation'
1119
+ },
1120
+
1121
+ className : {
1122
+ active : 'active',
1123
+ animating : 'animating',
1124
+ dropdown : 'dropdown',
1125
+ fluid : 'fluid',
1126
+ loading : 'loading',
1127
+ popup : 'ui popup',
1128
+ position : 'top left center bottom right',
1129
+ visible : 'visible'
1130
+ },
1131
+
1132
+ selector : {
1133
+ popup : '.ui.popup'
1134
+ },
1135
+
1136
+ templates: {
1137
+ escape: function(string) {
1138
+ var
1139
+ badChars = /[&<>"'`]/g,
1140
+ shouldEscape = /[&<>"'`]/,
1141
+ escape = {
1142
+ "&": "&amp;",
1143
+ "<": "&lt;",
1144
+ ">": "&gt;",
1145
+ '"': "&quot;",
1146
+ "'": "&#x27;",
1147
+ "`": "&#x60;"
1148
+ },
1149
+ escapedChar = function(chr) {
1150
+ return escape[chr];
1151
+ }
1152
+ ;
1153
+ if(shouldEscape.test(string)) {
1154
+ return string.replace(badChars, escapedChar);
1155
+ }
1156
+ return string;
1157
+ },
1158
+ popup: function(text) {
1159
+ var
1160
+ html = '',
1161
+ escape = $.fn.popup.settings.templates.escape
1162
+ ;
1163
+ if(typeof text !== undefined) {
1164
+ if(typeof text.title !== undefined && text.title) {
1165
+ text.title = escape(text.title);
1166
+ html += '<div class="header">' + text.title + '</div>';
1167
+ }
1168
+ if(typeof text.content !== undefined && text.content) {
1169
+ text.content = escape(text.content);
1170
+ html += '<div class="content">' + text.content + '</div>';
1171
+ }
1172
+ }
1173
+ return html;
1174
+ }
1175
+ }
1176
+
1177
+ };
1178
+
1179
+ // Adds easing
1180
+ $.extend( $.easing, {
1181
+ easeOutQuad: function (x, t, b, c, d) {
1182
+ return -c *(t/=d)*(t-2) + b;
1183
+ }
1184
+ });
1185
+
1186
+
1187
+ })( jQuery, window , document );