ad2games-ui_components 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (460) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +28 -0
  4. data/app/assets/javascripts/ui_components.js.erb +26 -0
  5. data/app/assets/javascripts/ui_components/chosen_init.coffee +9 -0
  6. data/app/assets/javascripts/ui_components/domchange.coffee +1 -0
  7. data/app/assets/javascripts/ui_components/hide_empty_dropdowns.coffee +4 -0
  8. data/app/assets/javascripts/ui_components/modal.coffee +1 -0
  9. data/app/assets/javascripts/ui_components/navbar.coffee +2 -0
  10. data/app/assets/javascripts/ui_components/sticky_header.coffee +24 -0
  11. data/app/assets/javascripts/ui_components/submit_on_change.coffee +3 -0
  12. data/app/assets/javascripts/ui_components/turbolinks_progressbar.coffee +2 -0
  13. data/app/assets/stylesheets/a2g_ui_components.scss +8 -0
  14. data/app/assets/stylesheets/default_theme/button.scss +160 -0
  15. data/app/assets/stylesheets/default_theme/common.scss +15 -0
  16. data/app/assets/stylesheets/default_theme/footer.scss +7 -0
  17. data/app/assets/stylesheets/default_theme/form.scss +72 -0
  18. data/app/assets/stylesheets/default_theme/navbar.scss +55 -0
  19. data/app/assets/stylesheets/default_theme/table.scss +68 -0
  20. data/app/assets/stylesheets/default_theme/toolbar.scss +117 -0
  21. data/app/assets/stylesheets/libs.scss +6 -0
  22. data/app/assets/stylesheets/ui_components.scss.erb +15 -0
  23. data/app/assets/stylesheets/ui_components/checkbox_list.scss +11 -0
  24. data/app/assets/stylesheets/ui_components/date_range.scss +5 -0
  25. data/app/assets/stylesheets/ui_components/markdown_textarea.scss +7 -0
  26. data/app/assets/stylesheets/variables.scss +893 -0
  27. data/app/cells/checkbox_list/checkbox_list.yml +7 -0
  28. data/app/cells/checkbox_list/checkbox_list_cell.rb +33 -0
  29. data/app/cells/datagrid_filter/datagrid_filter.yml +14 -0
  30. data/app/cells/datagrid_filter/datagrid_filter_cell.rb +35 -0
  31. data/app/cells/date_range/date_range.coffee +69 -0
  32. data/app/cells/date_range/date_range.yml +7 -0
  33. data/app/cells/date_range/date_range_cell.rb +55 -0
  34. data/app/cells/form_cell_base.rb +26 -0
  35. data/app/cells/hello_world/hello_world.slim +1 -0
  36. data/app/cells/hello_world/hello_world.yml +5 -0
  37. data/app/cells/hello_world/hello_world_cell.rb +4 -0
  38. data/app/cells/markdown_readonly/markdown_readonly.coffee +5 -0
  39. data/app/cells/markdown_readonly/markdown_readonly.slim +1 -0
  40. data/app/cells/markdown_readonly/markdown_readonly.yml +4 -0
  41. data/app/cells/markdown_readonly/markdown_readonly_cell.rb +4 -0
  42. data/app/cells/markdown_textarea/markdown_textarea.coffee +9 -0
  43. data/app/cells/markdown_textarea/markdown_textarea.slim +9 -0
  44. data/app/cells/markdown_textarea/markdown_textarea.yml +8 -0
  45. data/app/cells/markdown_textarea/markdown_textarea_cell.rb +42 -0
  46. data/app/cells/modal/modal.coffee +2 -0
  47. data/app/cells/modal/modal.slim +12 -0
  48. data/app/cells/modal/modal.yml +22 -0
  49. data/app/cells/modal/modal_cell.rb +31 -0
  50. data/app/cells/select/select.coffee +35 -0
  51. data/app/cells/select/select.yml +14 -0
  52. data/app/cells/select/select_cell.rb +59 -0
  53. data/app/helpers/ui_components/view_helper.rb +8 -0
  54. data/lib/generators/generate_component.thor +32 -0
  55. data/lib/tasks/styleguide.rake +8 -0
  56. data/lib/ui_components.rb +14 -0
  57. data/lib/ui_components/cell.rb +16 -0
  58. data/lib/ui_components/cell_attributes.rb +49 -0
  59. data/lib/ui_components/docu_cop.rb +31 -0
  60. data/lib/ui_components/engine.rb +26 -0
  61. data/lib/ui_components/form_helper.rb +32 -0
  62. data/lib/ui_components/templates/cell.tt +2 -0
  63. data/lib/ui_components/templates/coffee.tt +0 -0
  64. data/lib/ui_components/templates/config.tt +9 -0
  65. data/lib/ui_components/templates/sass.tt +0 -0
  66. data/lib/ui_components/templates/view.tt +0 -0
  67. data/vendor/assets/bower_components/ajax-chosen/CHANGELOG.md +10 -0
  68. data/vendor/assets/bower_components/ajax-chosen/Cakefile +93 -0
  69. data/vendor/assets/bower_components/ajax-chosen/Makefile +2 -0
  70. data/vendor/assets/bower_components/ajax-chosen/README.md +131 -0
  71. data/vendor/assets/bower_components/ajax-chosen/VERSION +1 -0
  72. data/vendor/assets/bower_components/ajax-chosen/bower.json +23 -0
  73. data/vendor/assets/bower_components/ajax-chosen/data.json +57 -0
  74. data/vendor/assets/bower_components/ajax-chosen/docs/ajax-chosen.html +71 -0
  75. data/vendor/assets/bower_components/ajax-chosen/docs/docco.css +186 -0
  76. data/vendor/assets/bower_components/ajax-chosen/index.html +47 -0
  77. data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.js +159 -0
  78. data/vendor/assets/bower_components/ajax-chosen/lib/ajax-chosen.min.js +17 -0
  79. data/vendor/assets/bower_components/ajax-chosen/package.json +18 -0
  80. data/vendor/assets/bower_components/ajax-chosen/src/ajax-chosen.coffee +183 -0
  81. data/vendor/assets/bower_components/bootstrap-chosen/README.md +29 -0
  82. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.less +24 -0
  83. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen-variables.scss +16 -0
  84. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.less +473 -0
  85. data/vendor/assets/bower_components/bootstrap-chosen/bootstrap-chosen.scss +459 -0
  86. data/vendor/assets/bower_components/bootstrap-chosen/bower.json +25 -0
  87. data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite.png +0 -0
  88. data/vendor/assets/bower_components/bootstrap-chosen/chosen-sprite@2x.png +0 -0
  89. data/vendor/assets/bower_components/bootstrap-daterangepicker/README.md +200 -0
  90. data/vendor/assets/bower_components/bootstrap-daterangepicker/bower.json +20 -0
  91. data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs2.css +303 -0
  92. data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker-bs3.css +335 -0
  93. data/vendor/assets/bower_components/bootstrap-daterangepicker/daterangepicker.js +1348 -0
  94. data/vendor/assets/bower_components/bootstrap-daterangepicker/examples.html +272 -0
  95. data/vendor/assets/bower_components/bootstrap-daterangepicker/package.js +18 -0
  96. data/vendor/assets/bower_components/bootstrap-daterangepicker/package.json +32 -0
  97. data/vendor/assets/bower_components/chosen/bower.json +50 -0
  98. data/vendor/assets/bower_components/chosen/chosen-sprite.png +0 -0
  99. data/vendor/assets/bower_components/chosen/chosen-sprite@2x.png +0 -0
  100. data/vendor/assets/bower_components/chosen/chosen.css +448 -0
  101. data/vendor/assets/bower_components/chosen/chosen.jquery.js +1272 -0
  102. data/vendor/assets/bower_components/highlightjs/LICENSE +24 -0
  103. data/vendor/assets/bower_components/highlightjs/Makefile +21 -0
  104. data/vendor/assets/bower_components/highlightjs/README.md +12 -0
  105. data/vendor/assets/bower_components/highlightjs/bower.json +14 -0
  106. data/vendor/assets/bower_components/highlightjs/component.json +12 -0
  107. data/vendor/assets/bower_components/highlightjs/composer.json +26 -0
  108. data/vendor/assets/bower_components/highlightjs/highlight.pack.js +15263 -0
  109. data/vendor/assets/bower_components/highlightjs/highlight.pack.min.js +12 -0
  110. data/vendor/assets/bower_components/highlightjs/package.json +8 -0
  111. data/vendor/assets/bower_components/highlightjs/styles/agate.css +108 -0
  112. data/vendor/assets/bower_components/highlightjs/styles/androidstudio.css +66 -0
  113. data/vendor/assets/bower_components/highlightjs/styles/arduino-light.css +88 -0
  114. data/vendor/assets/bower_components/highlightjs/styles/arta.css +73 -0
  115. data/vendor/assets/bower_components/highlightjs/styles/ascetic.css +45 -0
  116. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-dark.css +83 -0
  117. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave-light.css +85 -0
  118. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.dark.css +113 -0
  119. data/vendor/assets/bower_components/highlightjs/styles/atelier-cave.light.css +113 -0
  120. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-dark.css +69 -0
  121. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune-light.css +69 -0
  122. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.dark.css +94 -0
  123. data/vendor/assets/bower_components/highlightjs/styles/atelier-dune.light.css +94 -0
  124. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-dark.css +84 -0
  125. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary-light.css +84 -0
  126. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.dark.css +113 -0
  127. data/vendor/assets/bower_components/highlightjs/styles/atelier-estuary.light.css +113 -0
  128. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-dark.css +69 -0
  129. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest-light.css +69 -0
  130. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.dark.css +94 -0
  131. data/vendor/assets/bower_components/highlightjs/styles/atelier-forest.light.css +94 -0
  132. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-dark.css +69 -0
  133. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath-light.css +69 -0
  134. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.dark.css +94 -0
  135. data/vendor/assets/bower_components/highlightjs/styles/atelier-heath.light.css +94 -0
  136. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-dark.css +69 -0
  137. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside-light.css +69 -0
  138. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.dark.css +94 -0
  139. data/vendor/assets/bower_components/highlightjs/styles/atelier-lakeside.light.css +94 -0
  140. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-dark.css +84 -0
  141. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau-light.css +84 -0
  142. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.dark.css +113 -0
  143. data/vendor/assets/bower_components/highlightjs/styles/atelier-plateau.light.css +113 -0
  144. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-dark.css +84 -0
  145. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna-light.css +84 -0
  146. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.dark.css +113 -0
  147. data/vendor/assets/bower_components/highlightjs/styles/atelier-savanna.light.css +113 -0
  148. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-dark.css +69 -0
  149. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside-light.css +69 -0
  150. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.dark.css +94 -0
  151. data/vendor/assets/bower_components/highlightjs/styles/atelier-seaside.light.css +94 -0
  152. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-dark.css +69 -0
  153. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool-light.css +69 -0
  154. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.dark.css +94 -0
  155. data/vendor/assets/bower_components/highlightjs/styles/atelier-sulphurpool.light.css +94 -0
  156. data/vendor/assets/bower_components/highlightjs/styles/brown-paper.css +64 -0
  157. data/vendor/assets/bower_components/highlightjs/styles/brown-papersq.png +0 -0
  158. data/vendor/assets/bower_components/highlightjs/styles/brown_paper.css +103 -0
  159. data/vendor/assets/bower_components/highlightjs/styles/brown_papersq.png +0 -0
  160. data/vendor/assets/bower_components/highlightjs/styles/codepen-embed.css +60 -0
  161. data/vendor/assets/bower_components/highlightjs/styles/color-brewer.css +71 -0
  162. data/vendor/assets/bower_components/highlightjs/styles/dark.css +63 -0
  163. data/vendor/assets/bower_components/highlightjs/styles/darkula.css +74 -0
  164. data/vendor/assets/bower_components/highlightjs/styles/default.css +99 -0
  165. data/vendor/assets/bower_components/highlightjs/styles/docco.css +97 -0
  166. data/vendor/assets/bower_components/highlightjs/styles/dracula.css +76 -0
  167. data/vendor/assets/bower_components/highlightjs/styles/far.css +71 -0
  168. data/vendor/assets/bower_components/highlightjs/styles/foundation.css +88 -0
  169. data/vendor/assets/bower_components/highlightjs/styles/github-gist.css +71 -0
  170. data/vendor/assets/bower_components/highlightjs/styles/github.css +99 -0
  171. data/vendor/assets/bower_components/highlightjs/styles/googlecode.css +89 -0
  172. data/vendor/assets/bower_components/highlightjs/styles/grayscale.css +101 -0
  173. data/vendor/assets/bower_components/highlightjs/styles/gruvbox-dark.css +108 -0
  174. data/vendor/assets/bower_components/highlightjs/styles/gruvbox-light.css +108 -0
  175. data/vendor/assets/bower_components/highlightjs/styles/hopscotch.css +83 -0
  176. data/vendor/assets/bower_components/highlightjs/styles/hybrid.css +102 -0
  177. data/vendor/assets/bower_components/highlightjs/styles/idea.css +97 -0
  178. data/vendor/assets/bower_components/highlightjs/styles/ir-black.css +73 -0
  179. data/vendor/assets/bower_components/highlightjs/styles/ir_black.css +106 -0
  180. data/vendor/assets/bower_components/highlightjs/styles/kimbie.dark.css +74 -0
  181. data/vendor/assets/bower_components/highlightjs/styles/kimbie.light.css +74 -0
  182. data/vendor/assets/bower_components/highlightjs/styles/magula.css +70 -0
  183. data/vendor/assets/bower_components/highlightjs/styles/mono-blue.css +59 -0
  184. data/vendor/assets/bower_components/highlightjs/styles/monokai-sublime.css +83 -0
  185. data/vendor/assets/bower_components/highlightjs/styles/monokai.css +70 -0
  186. data/vendor/assets/bower_components/highlightjs/styles/monokai_sublime.css +154 -0
  187. data/vendor/assets/bower_components/highlightjs/styles/obsidian.css +88 -0
  188. data/vendor/assets/bower_components/highlightjs/styles/paraiso-dark.css +72 -0
  189. data/vendor/assets/bower_components/highlightjs/styles/paraiso-light.css +72 -0
  190. data/vendor/assets/bower_components/highlightjs/styles/paraiso.dark.css +96 -0
  191. data/vendor/assets/bower_components/highlightjs/styles/paraiso.light.css +96 -0
  192. data/vendor/assets/bower_components/highlightjs/styles/pojoaque.css +83 -0
  193. data/vendor/assets/bower_components/highlightjs/styles/pojoaque.jpg +0 -0
  194. data/vendor/assets/bower_components/highlightjs/styles/qtcreator_dark.css +83 -0
  195. data/vendor/assets/bower_components/highlightjs/styles/qtcreator_light.css +83 -0
  196. data/vendor/assets/bower_components/highlightjs/styles/railscasts.css +106 -0
  197. data/vendor/assets/bower_components/highlightjs/styles/rainbow.css +85 -0
  198. data/vendor/assets/bower_components/highlightjs/styles/school-book.css +72 -0
  199. data/vendor/assets/bower_components/highlightjs/styles/school-book.png +0 -0
  200. data/vendor/assets/bower_components/highlightjs/styles/school_book.css +111 -0
  201. data/vendor/assets/bower_components/highlightjs/styles/school_book.png +0 -0
  202. data/vendor/assets/bower_components/highlightjs/styles/solarized-dark.css +84 -0
  203. data/vendor/assets/bower_components/highlightjs/styles/solarized-light.css +84 -0
  204. data/vendor/assets/bower_components/highlightjs/styles/solarized_dark.css +107 -0
  205. data/vendor/assets/bower_components/highlightjs/styles/solarized_light.css +107 -0
  206. data/vendor/assets/bower_components/highlightjs/styles/sunburst.css +102 -0
  207. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-blue.css +75 -0
  208. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-bright.css +74 -0
  209. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night-eighties.css +74 -0
  210. data/vendor/assets/bower_components/highlightjs/styles/tomorrow-night.css +75 -0
  211. data/vendor/assets/bower_components/highlightjs/styles/tomorrow.css +72 -0
  212. data/vendor/assets/bower_components/highlightjs/styles/vs.css +68 -0
  213. data/vendor/assets/bower_components/highlightjs/styles/xcode.css +93 -0
  214. data/vendor/assets/bower_components/highlightjs/styles/zenburn.css +80 -0
  215. data/vendor/assets/bower_components/jquery.floatThead/CONTRIBUTING.md +33 -0
  216. data/vendor/assets/bower_components/jquery.floatThead/README.md +285 -0
  217. data/vendor/assets/bower_components/jquery.floatThead/bower.json +34 -0
  218. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.js +899 -0
  219. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead-slim.min.js +3 -0
  220. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.js +964 -0
  221. data/vendor/assets/bower_components/jquery.floatThead/dist/jquery.floatThead.min.js +3 -0
  222. data/vendor/assets/bower_components/jquery.floatThead/license.txt +21 -0
  223. data/vendor/assets/bower_components/jquery/AUTHORS.txt +278 -0
  224. data/vendor/assets/bower_components/jquery/LICENSE.txt +36 -0
  225. data/vendor/assets/bower_components/jquery/README.md +65 -0
  226. data/vendor/assets/bower_components/jquery/bower.json +14 -0
  227. data/vendor/assets/bower_components/jquery/dist/jquery.js +9842 -0
  228. data/vendor/assets/bower_components/jquery/dist/jquery.min.js +4 -0
  229. data/vendor/assets/bower_components/jquery/dist/jquery.min.map +1 -0
  230. data/vendor/assets/bower_components/jquery/dist/jquery.slim.js +7877 -0
  231. data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.js +4 -0
  232. data/vendor/assets/bower_components/jquery/dist/jquery.slim.min.map +1 -0
  233. data/vendor/assets/bower_components/jquery/sizzle/LICENSE.txt +36 -0
  234. data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.js +2143 -0
  235. data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.js +3 -0
  236. data/vendor/assets/bower_components/jquery/sizzle/dist/sizzle.min.map +1 -0
  237. data/vendor/assets/bower_components/jquery/src/ajax.js +845 -0
  238. data/vendor/assets/bower_components/jquery/src/ajax/jsonp.js +100 -0
  239. data/vendor/assets/bower_components/jquery/src/ajax/load.js +83 -0
  240. data/vendor/assets/bower_components/jquery/src/ajax/parseJSON.js +13 -0
  241. data/vendor/assets/bower_components/jquery/src/ajax/parseXML.js +27 -0
  242. data/vendor/assets/bower_components/jquery/src/ajax/script.js +68 -0
  243. data/vendor/assets/bower_components/jquery/src/ajax/var/location.js +3 -0
  244. data/vendor/assets/bower_components/jquery/src/ajax/var/nonce.js +5 -0
  245. data/vendor/assets/bower_components/jquery/src/ajax/var/rquery.js +3 -0
  246. data/vendor/assets/bower_components/jquery/src/ajax/xhr.js +167 -0
  247. data/vendor/assets/bower_components/jquery/src/attributes.js +11 -0
  248. data/vendor/assets/bower_components/jquery/src/attributes/attr.js +142 -0
  249. data/vendor/assets/bower_components/jquery/src/attributes/classes.js +177 -0
  250. data/vendor/assets/bower_components/jquery/src/attributes/prop.js +125 -0
  251. data/vendor/assets/bower_components/jquery/src/attributes/support.js +36 -0
  252. data/vendor/assets/bower_components/jquery/src/attributes/val.js +177 -0
  253. data/vendor/assets/bower_components/jquery/src/callbacks.js +232 -0
  254. data/vendor/assets/bower_components/jquery/src/core.js +494 -0
  255. data/vendor/assets/bower_components/jquery/src/core/DOMEval.js +14 -0
  256. data/vendor/assets/bower_components/jquery/src/core/access.js +65 -0
  257. data/vendor/assets/bower_components/jquery/src/core/init.js +134 -0
  258. data/vendor/assets/bower_components/jquery/src/core/parseHTML.js +41 -0
  259. data/vendor/assets/bower_components/jquery/src/core/ready.js +103 -0
  260. data/vendor/assets/bower_components/jquery/src/core/support.js +18 -0
  261. data/vendor/assets/bower_components/jquery/src/core/var/rsingleTag.js +5 -0
  262. data/vendor/assets/bower_components/jquery/src/css.js +515 -0
  263. data/vendor/assets/bower_components/jquery/src/css/addGetHookIf.js +24 -0
  264. data/vendor/assets/bower_components/jquery/src/css/adjustCSS.js +65 -0
  265. data/vendor/assets/bower_components/jquery/src/css/curCSS.js +60 -0
  266. data/vendor/assets/bower_components/jquery/src/css/defaultDisplay.js +72 -0
  267. data/vendor/assets/bower_components/jquery/src/css/hiddenVisibleSelectors.js +18 -0
  268. data/vendor/assets/bower_components/jquery/src/css/showHide.js +48 -0
  269. data/vendor/assets/bower_components/jquery/src/css/support.js +121 -0
  270. data/vendor/assets/bower_components/jquery/src/css/var/cssExpand.js +3 -0
  271. data/vendor/assets/bower_components/jquery/src/css/var/getStyles.js +15 -0
  272. data/vendor/assets/bower_components/jquery/src/css/var/isHidden.js +16 -0
  273. data/vendor/assets/bower_components/jquery/src/css/var/rmargin.js +3 -0
  274. data/vendor/assets/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
  275. data/vendor/assets/bower_components/jquery/src/css/var/swap.js +24 -0
  276. data/vendor/assets/bower_components/jquery/src/data.js +187 -0
  277. data/vendor/assets/bower_components/jquery/src/data/Data.js +200 -0
  278. data/vendor/assets/bower_components/jquery/src/data/accepts.js +20 -0
  279. data/vendor/assets/bower_components/jquery/src/data/support.js +23 -0
  280. data/vendor/assets/bower_components/jquery/src/data/var/acceptData.js +18 -0
  281. data/vendor/assets/bower_components/jquery/src/data/var/dataPriv.js +5 -0
  282. data/vendor/assets/bower_components/jquery/src/data/var/dataUser.js +5 -0
  283. data/vendor/assets/bower_components/jquery/src/deferred.js +158 -0
  284. data/vendor/assets/bower_components/jquery/src/deferred/exceptionHook.js +19 -0
  285. data/vendor/assets/bower_components/jquery/src/deprecated.js +32 -0
  286. data/vendor/assets/bower_components/jquery/src/dimensions.js +54 -0
  287. data/vendor/assets/bower_components/jquery/src/effects.js +629 -0
  288. data/vendor/assets/bower_components/jquery/src/effects/Tween.js +121 -0
  289. data/vendor/assets/bower_components/jquery/src/effects/animatedSelector.js +13 -0
  290. data/vendor/assets/bower_components/jquery/src/effects/support.js +58 -0
  291. data/vendor/assets/bower_components/jquery/src/event.js +710 -0
  292. data/vendor/assets/bower_components/jquery/src/event/ajax.js +20 -0
  293. data/vendor/assets/bower_components/jquery/src/event/alias.js +27 -0
  294. data/vendor/assets/bower_components/jquery/src/event/focusin.js +53 -0
  295. data/vendor/assets/bower_components/jquery/src/event/support.js +9 -0
  296. data/vendor/assets/bower_components/jquery/src/event/trigger.js +199 -0
  297. data/vendor/assets/bower_components/jquery/src/exports/amd.js +24 -0
  298. data/vendor/assets/bower_components/jquery/src/exports/global.js +26 -0
  299. data/vendor/assets/bower_components/jquery/src/intro.js +44 -0
  300. data/vendor/assets/bower_components/jquery/src/jquery.js +37 -0
  301. data/vendor/assets/bower_components/jquery/src/manipulation.js +481 -0
  302. data/vendor/assets/bower_components/jquery/src/manipulation/_evalUrl.js +20 -0
  303. data/vendor/assets/bower_components/jquery/src/manipulation/buildFragment.js +102 -0
  304. data/vendor/assets/bower_components/jquery/src/manipulation/createSafeFragment.js +20 -0
  305. data/vendor/assets/bower_components/jquery/src/manipulation/getAll.js +21 -0
  306. data/vendor/assets/bower_components/jquery/src/manipulation/setGlobalEval.js +20 -0
  307. data/vendor/assets/bower_components/jquery/src/manipulation/support.js +33 -0
  308. data/vendor/assets/bower_components/jquery/src/manipulation/var/nodeNames.js +5 -0
  309. data/vendor/assets/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  310. data/vendor/assets/bower_components/jquery/src/manipulation/var/rleadingWhitespace.js +3 -0
  311. data/vendor/assets/bower_components/jquery/src/manipulation/var/rscriptType.js +3 -0
  312. data/vendor/assets/bower_components/jquery/src/manipulation/var/rtagName.js +3 -0
  313. data/vendor/assets/bower_components/jquery/src/manipulation/wrapMap.js +27 -0
  314. data/vendor/assets/bower_components/jquery/src/offset.js +218 -0
  315. data/vendor/assets/bower_components/jquery/src/outro.js +2 -0
  316. data/vendor/assets/bower_components/jquery/src/queue.js +143 -0
  317. data/vendor/assets/bower_components/jquery/src/queue/delay.js +22 -0
  318. data/vendor/assets/bower_components/jquery/src/selector-native.js +211 -0
  319. data/vendor/assets/bower_components/jquery/src/selector-sizzle.js +14 -0
  320. data/vendor/assets/bower_components/jquery/src/selector.js +1 -0
  321. data/vendor/assets/bower_components/jquery/src/serialize.js +125 -0
  322. data/vendor/assets/bower_components/jquery/src/support.js +63 -0
  323. data/vendor/assets/bower_components/jquery/src/traversing.js +175 -0
  324. data/vendor/assets/bower_components/jquery/src/traversing/findFilter.js +100 -0
  325. data/vendor/assets/bower_components/jquery/src/traversing/var/dir.js +20 -0
  326. data/vendor/assets/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
  327. data/vendor/assets/bower_components/jquery/src/traversing/var/siblings.js +15 -0
  328. data/vendor/assets/bower_components/jquery/src/var/arr.js +3 -0
  329. data/vendor/assets/bower_components/jquery/src/var/class2type.js +5 -0
  330. data/vendor/assets/bower_components/jquery/src/var/concat.js +5 -0
  331. data/vendor/assets/bower_components/jquery/src/var/deletedIds.js +3 -0
  332. data/vendor/assets/bower_components/jquery/src/var/document.js +3 -0
  333. data/vendor/assets/bower_components/jquery/src/var/documentElement.js +5 -0
  334. data/vendor/assets/bower_components/jquery/src/var/hasOwn.js +5 -0
  335. data/vendor/assets/bower_components/jquery/src/var/indexOf.js +5 -0
  336. data/vendor/assets/bower_components/jquery/src/var/pnum.js +3 -0
  337. data/vendor/assets/bower_components/jquery/src/var/push.js +5 -0
  338. data/vendor/assets/bower_components/jquery/src/var/rcssNum.js +7 -0
  339. data/vendor/assets/bower_components/jquery/src/var/rnotwhite.js +3 -0
  340. data/vendor/assets/bower_components/jquery/src/var/slice.js +5 -0
  341. data/vendor/assets/bower_components/jquery/src/var/support.js +5 -0
  342. data/vendor/assets/bower_components/jquery/src/var/toString.js +5 -0
  343. data/vendor/assets/bower_components/jquery/src/wrap.js +79 -0
  344. data/vendor/assets/bower_components/marked/Gulpfile.js +22 -0
  345. data/vendor/assets/bower_components/marked/LICENSE +19 -0
  346. data/vendor/assets/bower_components/marked/Makefile +12 -0
  347. data/vendor/assets/bower_components/marked/README.md +406 -0
  348. data/vendor/assets/bower_components/marked/bin/marked +187 -0
  349. data/vendor/assets/bower_components/marked/bower.json +24 -0
  350. data/vendor/assets/bower_components/marked/component.json +10 -0
  351. data/vendor/assets/bower_components/marked/doc/broken.md +426 -0
  352. data/vendor/assets/bower_components/marked/doc/todo.md +2 -0
  353. data/vendor/assets/bower_components/marked/index.js +1 -0
  354. data/vendor/assets/bower_components/marked/lib/marked.js +1285 -0
  355. data/vendor/assets/bower_components/marked/man/marked.1 +91 -0
  356. data/vendor/assets/bower_components/marked/marked.min.js +6 -0
  357. data/vendor/assets/bower_components/marked/package.json +24 -0
  358. data/vendor/assets/bower_components/moment/CHANGELOG.md +423 -0
  359. data/vendor/assets/bower_components/moment/LICENSE +22 -0
  360. data/vendor/assets/bower_components/moment/Moment.js.nuspec +28 -0
  361. data/vendor/assets/bower_components/moment/README.md +39 -0
  362. data/vendor/assets/bower_components/moment/benchmarks/clone.js +10 -0
  363. data/vendor/assets/bower_components/moment/bower.json +20 -0
  364. data/vendor/assets/bower_components/moment/locale/af.js +71 -0
  365. data/vendor/assets/bower_components/moment/locale/ar-ma.js +57 -0
  366. data/vendor/assets/bower_components/moment/locale/ar-sa.js +101 -0
  367. data/vendor/assets/bower_components/moment/locale/ar-tn.js +55 -0
  368. data/vendor/assets/bower_components/moment/locale/ar.js +134 -0
  369. data/vendor/assets/bower_components/moment/locale/az.js +107 -0
  370. data/vendor/assets/bower_components/moment/locale/be.js +154 -0
  371. data/vendor/assets/bower_components/moment/locale/bg.js +88 -0
  372. data/vendor/assets/bower_components/moment/locale/bn.js +111 -0
  373. data/vendor/assets/bower_components/moment/locale/bo.js +108 -0
  374. data/vendor/assets/bower_components/moment/locale/br.js +109 -0
  375. data/vendor/assets/bower_components/moment/locale/bs.js +140 -0
  376. data/vendor/assets/bower_components/moment/locale/ca.js +77 -0
  377. data/vendor/assets/bower_components/moment/locale/cs.js +157 -0
  378. data/vendor/assets/bower_components/moment/locale/cv.js +61 -0
  379. data/vendor/assets/bower_components/moment/locale/cy.js +79 -0
  380. data/vendor/assets/bower_components/moment/locale/da.js +58 -0
  381. data/vendor/assets/bower_components/moment/locale/de-at.js +74 -0
  382. data/vendor/assets/bower_components/moment/locale/de.js +73 -0
  383. data/vendor/assets/bower_components/moment/locale/el.js +94 -0
  384. data/vendor/assets/bower_components/moment/locale/en-au.js +64 -0
  385. data/vendor/assets/bower_components/moment/locale/en-ca.js +61 -0
  386. data/vendor/assets/bower_components/moment/locale/en-gb.js +65 -0
  387. data/vendor/assets/bower_components/moment/locale/eo.js +71 -0
  388. data/vendor/assets/bower_components/moment/locale/es.js +77 -0
  389. data/vendor/assets/bower_components/moment/locale/et.js +78 -0
  390. data/vendor/assets/bower_components/moment/locale/eu.js +62 -0
  391. data/vendor/assets/bower_components/moment/locale/fa.js +103 -0
  392. data/vendor/assets/bower_components/moment/locale/fi.js +107 -0
  393. data/vendor/assets/bower_components/moment/locale/fo.js +58 -0
  394. data/vendor/assets/bower_components/moment/locale/fr-ca.js +56 -0
  395. data/vendor/assets/bower_components/moment/locale/fr.js +60 -0
  396. data/vendor/assets/bower_components/moment/locale/fy.js +69 -0
  397. data/vendor/assets/bower_components/moment/locale/gl.js +73 -0
  398. data/vendor/assets/bower_components/moment/locale/he.js +80 -0
  399. data/vendor/assets/bower_components/moment/locale/hi.js +121 -0
  400. data/vendor/assets/bower_components/moment/locale/hr.js +141 -0
  401. data/vendor/assets/bower_components/moment/locale/hu.js +111 -0
  402. data/vendor/assets/bower_components/moment/locale/hy-am.js +118 -0
  403. data/vendor/assets/bower_components/moment/locale/id.js +81 -0
  404. data/vendor/assets/bower_components/moment/locale/is.js +126 -0
  405. data/vendor/assets/bower_components/moment/locale/it.js +68 -0
  406. data/vendor/assets/bower_components/moment/locale/ja.js +63 -0
  407. data/vendor/assets/bower_components/moment/locale/ka.js +109 -0
  408. data/vendor/assets/bower_components/moment/locale/km.js +56 -0
  409. data/vendor/assets/bower_components/moment/locale/ko.js +65 -0
  410. data/vendor/assets/bower_components/moment/locale/lb.js +139 -0
  411. data/vendor/assets/bower_components/moment/locale/lt.js +120 -0
  412. data/vendor/assets/bower_components/moment/locale/lv.js +79 -0
  413. data/vendor/assets/bower_components/moment/locale/mk.js +88 -0
  414. data/vendor/assets/bower_components/moment/locale/ml.js +69 -0
  415. data/vendor/assets/bower_components/moment/locale/mr.js +120 -0
  416. data/vendor/assets/bower_components/moment/locale/ms-my.js +80 -0
  417. data/vendor/assets/bower_components/moment/locale/my.js +89 -0
  418. data/vendor/assets/bower_components/moment/locale/nb.js +59 -0
  419. data/vendor/assets/bower_components/moment/locale/ne.js +121 -0
  420. data/vendor/assets/bower_components/moment/locale/nl.js +69 -0
  421. data/vendor/assets/bower_components/moment/locale/nn.js +58 -0
  422. data/vendor/assets/bower_components/moment/locale/pl.js +100 -0
  423. data/vendor/assets/bower_components/moment/locale/pt-br.js +58 -0
  424. data/vendor/assets/bower_components/moment/locale/pt.js +62 -0
  425. data/vendor/assets/bower_components/moment/locale/ro.js +73 -0
  426. data/vendor/assets/bower_components/moment/locale/ru.js +176 -0
  427. data/vendor/assets/bower_components/moment/locale/sk.js +158 -0
  428. data/vendor/assets/bower_components/moment/locale/sl.js +146 -0
  429. data/vendor/assets/bower_components/moment/locale/sq.js +67 -0
  430. data/vendor/assets/bower_components/moment/locale/sr-cyrl.js +107 -0
  431. data/vendor/assets/bower_components/moment/locale/sr.js +107 -0
  432. data/vendor/assets/bower_components/moment/locale/sv.js +65 -0
  433. data/vendor/assets/bower_components/moment/locale/ta.js +130 -0
  434. data/vendor/assets/bower_components/moment/locale/th.js +63 -0
  435. data/vendor/assets/bower_components/moment/locale/tl-ph.js +60 -0
  436. data/vendor/assets/bower_components/moment/locale/tr.js +94 -0
  437. data/vendor/assets/bower_components/moment/locale/tzm-latn.js +56 -0
  438. data/vendor/assets/bower_components/moment/locale/tzm.js +56 -0
  439. data/vendor/assets/bower_components/moment/locale/uk.js +163 -0
  440. data/vendor/assets/bower_components/moment/locale/uz.js +56 -0
  441. data/vendor/assets/bower_components/moment/locale/vi.js +64 -0
  442. data/vendor/assets/bower_components/moment/locale/zh-cn.js +125 -0
  443. data/vendor/assets/bower_components/moment/locale/zh-tw.js +99 -0
  444. data/vendor/assets/bower_components/moment/meteor/README.md +25 -0
  445. data/vendor/assets/bower_components/moment/meteor/export.js +3 -0
  446. data/vendor/assets/bower_components/moment/meteor/test.js +5 -0
  447. data/vendor/assets/bower_components/moment/min/locales.js +7306 -0
  448. data/vendor/assets/bower_components/moment/min/locales.min.js +4 -0
  449. data/vendor/assets/bower_components/moment/min/moment-with-locales.js +9792 -0
  450. data/vendor/assets/bower_components/moment/min/moment-with-locales.min.js +10 -0
  451. data/vendor/assets/bower_components/moment/min/moment.min.js +7 -0
  452. data/vendor/assets/bower_components/moment/moment.js +3043 -0
  453. data/vendor/assets/bower_components/moment/scripts/npm_prepublish.sh +43 -0
  454. data/vendor/assets/bower_components/underscore/LICENSE +23 -0
  455. data/vendor/assets/bower_components/underscore/README.md +22 -0
  456. data/vendor/assets/bower_components/underscore/bower.json +7 -0
  457. data/vendor/assets/bower_components/underscore/underscore-min.js +6 -0
  458. data/vendor/assets/bower_components/underscore/underscore-min.map +1 -0
  459. data/vendor/assets/bower_components/underscore/underscore.js +1548 -0
  460. metadata +782 -0
@@ -0,0 +1,17 @@
1
+
2
+ (function($){var ajaxChosen,defaultOptions;defaultOptions={minTermLength:3,afterTypeDelay:500,jsonTermKey:"term",keepTypingMsg:"Keep typing...",lookingForMsg:"Looking for"};return ajaxChosen=(function(){function ajaxChosen(element,settings,callback,chosenOptions){var chosenXhr;this.element=element;chosenXhr=null;this.callback_function=callback;this.options=$.extend({},defaultOptions,this.element.data(),settings);this.success=settings.success;this.element.chosen(chosenOptions?chosenOptions:{});this.search_field=this.element.next('.chosen-container').find(".search-field > input, .chosen-search > input");this.register_observers();}
3
+ ajaxChosen.prototype.register_observers=function(){var _this=this;this.search_field.keyup(function(evt){_this.update_list(evt);});return this.search_field.focus(function(evt){_this.search_field_focused(evt);});};ajaxChosen.prototype.search_field_focused=function(evt){if(this.options.minTermLength===0&&this.search_field.val().length===0){return this.update_list(evt);}};ajaxChosen.prototype.update_list=function(evt){var msg,options,val,_this;this.untrimmed_val=this.search_field.val();val=$.trim(this.search_field.val());msg=val.length<this.options.minTermLength?this.options.keepTypingMsg:this.options.lookingForMsg+(" '"+val+"'");this.element.next('.chosen-container').find('.no-results').text(msg);if(val===this.search_field.data('prevVal')){return false;}
4
+ this.search_field.data('prevVal',val);if(this.timer){clearTimeout(this.timer);}
5
+ if(val.length<this.options.minTermLength){return false;}
6
+ if(this.options.data==null){this.options.data={};}
7
+ this.options.data[this.options.jsonTermKey]=val;if(this.options.dataCallback!=null){this.options.data=this.options.dataCallback(this.options.data);}
8
+ _this=this;options=this.options;options.success=function(data){return _this.show_results(data);};return this.timer=setTimeout(function(){if(_this.chosenXhr){_this.chosenXhr.abort();}
9
+ return _this.chosenXhr=$.ajax(options);},options.afterTypeDelay);};ajaxChosen.prototype.show_results=function(data){var items,nbItems,selected_values,_this;if(data==null){return;}
10
+ selected_values=[];this.element.find('option').each(function(){if(!$(this).is(":selected")){return $(this).remove();}else{return selected_values.push($(this).val()+"-"+$(this).text());}});this.element.find('optgroup:empty').each(function(){return $(this).remove();});items=this.callback_function!=null?this.callback_function(data,this.search_field):data;nbItems=0;_this=this;$.each(items,function(i,element){var group,text,value;nbItems++;if(element.group){group=_this.element.find("optgroup[label='"+element.text+"']");if(!group.size()){group=$("<optgroup />");}
11
+ group.attr('label',element.text).appendTo(_this.element);return $.each(element.items,function(i,element){var text,value;if(typeof element==="string"){value=i;text=element;}else{value=element.value;text=element.text;}
12
+ if($.inArray(value+"-"+text,selected_values)===-1){return $("<option />").attr('value',value).html(text).appendTo(group);}});}else{if(typeof element==="string"){value=i;text=element;}else{value=element.value;text=element.text;}
13
+ if($.inArray(value+"-"+text,selected_values)===-1){return $("<option />").attr('value',value).html(text).appendTo(_this.element);}}});if(nbItems){this.element.trigger("chosen:updated");}else{this.element.data().chosen.no_results_clear();this.element.data().chosen.no_results(this.search_field.val());}
14
+ if(this.success!=null){this.success(data);}
15
+ return this.search_field.val(this.untrimmed_val);};$.fn.ajaxChosen=function(options,callback,chosenOptions){if(options==null){options={};}
16
+ if(chosenOptions==null){chosenOptions={};}
17
+ return this.each(function(){return new ajaxChosen($(this),options,callback,chosenOptions);});};return ajaxChosen;})();})(jQuery);
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "ajax-chosen",
3
+ "description": "A complement to the jQuery library Chosen that adds ajax autocomplete",
4
+ "version": "1.0.1",
5
+ "author": {
6
+ "name": "Ryan LeFevre",
7
+ "email": "meltingice8917@gmail.com",
8
+ "url": "http://meltingice.net"
9
+ },
10
+ "devDependencies": {
11
+ "coffee-script": ">= 1.3.1",
12
+ "jsmin": "*",
13
+ "servedir": "*"
14
+ },
15
+ "scripts": {
16
+ "start": "servedir"
17
+ }
18
+ }
@@ -0,0 +1,183 @@
1
+ do ($ = jQuery) ->
2
+ defaultOptions =
3
+ minTermLength: 3
4
+ afterTypeDelay: 500
5
+ jsonTermKey: "term"
6
+ keepTypingMsg: "Keep typing..."
7
+ lookingForMsg: "Looking for"
8
+
9
+ class ajaxChosen
10
+ constructor: (@element, settings, callback, chosenOptions) ->
11
+ chosenXhr = null
12
+
13
+ @callback_function = callback
14
+
15
+ # Merge options with defaults
16
+ @options = $.extend {}, defaultOptions, @element.data(), settings
17
+
18
+ # If the user provided an ajax success callback, store it so we can
19
+ # call it after our bootstrapping is finished.
20
+ @success = settings.success
21
+
22
+ # Load chosen. To make things clear, I have taken the liberty
23
+ # of using the .chosen-autoselect class to specify input elements
24
+ # we want to use with ajax autocomplete.
25
+ @element.chosen(if chosenOptions then chosenOptions else {})
26
+
27
+ # Now that chosen is loaded normally, we can bootstrap it with
28
+ # our ajax autocomplete code.
29
+ @search_field = @element.next('.chosen-container')
30
+ .find(".search-field > input, .chosen-search > input")
31
+
32
+ @register_observers()
33
+
34
+ register_observers: ->
35
+ @search_field.keyup (evt) => @update_list(evt); return
36
+ @search_field.focus (evt) => @search_field_focused(evt); return
37
+
38
+ search_field_focused: (evt) ->
39
+ return @update_list(evt) if @options.minTermLength == 0 and @search_field.val().length == 0
40
+
41
+ update_list: (evt) ->
42
+ # This code will be executed every time the user types a letter
43
+ # into the input form that chosen has created
44
+
45
+ # Retrieve the current value of the input form
46
+ @untrimmed_val = @search_field.val()
47
+ val = $.trim @search_field.val()
48
+
49
+ # Depending on how much text the user has typed, let them know
50
+ # if they need to keep typing or if we are looking for their data
51
+ msg = if val.length < @options.minTermLength then @options.keepTypingMsg else @options.lookingForMsg + " '#{val}'"
52
+ @element.next('.chosen-container').find('.no-results').text(msg)
53
+
54
+ # If input text has not changed ... do nothing
55
+ return false if val is @search_field.data('prevVal')
56
+
57
+ # Set the current search term so we don't execute the ajax call if
58
+ # the user hits a key that isn't an input letter/number/symbol
59
+ @search_field.data('prevVal', val)
60
+
61
+ # At this point, we have a new term/query ... the old timer
62
+ # is no longer valid. Clear it.
63
+
64
+ # We delay searches by a small amount so that we don't flood the
65
+ # server with ajax requests.
66
+ clearTimeout(@timer) if @timer
67
+
68
+ # Do not make ajax calls if search value length is lower than the minimum term length
69
+ return false if val.length < @options.minTermLength
70
+
71
+ # Default term key is `term`. Specify alternative in @options.options.jsonTermKey
72
+ @options.data = {} unless @options.data?
73
+ @options.data[@options.jsonTermKey] = val
74
+ @options.data = @options.dataCallback(@options.data) if @options.dataCallback?
75
+
76
+ _this = @
77
+ options = @options
78
+
79
+ options.success = (data) ->
80
+ _this.show_results(data)
81
+
82
+ # Execute the ajax call to search for autocomplete data with a timer
83
+ @timer = setTimeout ->
84
+ _this.chosenXhr.abort() if _this.chosenXhr
85
+ _this.chosenXhr = $.ajax(options)
86
+ , options.afterTypeDelay
87
+
88
+ # Create our own callback that will be executed when the ajax call is
89
+ # finished.
90
+ show_results: (data) ->
91
+ # Exit if the data we're given is invalid
92
+ return unless data?
93
+
94
+ # Go through all of the <option> elements in the <select> and remove
95
+ # ones that have not been selected by the user. For those selected
96
+ # by the user, add them to a list to filter from the results later.
97
+ selected_values = []
98
+ @element.find('option').each ->
99
+ if not $(@).is(":selected")
100
+ $(@).remove()
101
+ else
102
+ selected_values.push $(@).val() + "-" + $(@).text()
103
+ @element.find('optgroup:empty').each ->
104
+ $(@).remove()
105
+
106
+ # Send the ajax results to the user callback so we can get an object of
107
+ # value => text pairs to inject as <option> elements.
108
+ items = if @callback_function? then @callback_function(data, @search_field) else data
109
+
110
+ nbItems = 0
111
+
112
+ _this = @
113
+
114
+ # Iterate through the given data and inject the <option> elements into
115
+ # the DOM if it doesn't exist in the selector already
116
+ $.each items, (i, element) ->
117
+ nbItems++
118
+
119
+ if element.group
120
+ group = _this.element.find("optgroup[label='#{element.text}']")
121
+ group = $("<optgroup />") unless group.size()
122
+
123
+ group.attr('label', element.text)
124
+ .appendTo(_this.element)
125
+ $.each element.items, (i, element) ->
126
+ if typeof element == "string"
127
+ value = i;
128
+ text = element;
129
+ else
130
+ value = element.value;
131
+ text = element.text;
132
+ if $.inArray(value + "-" + text, selected_values) == -1
133
+ $("<option />")
134
+ .attr('value', value)
135
+ .html(text)
136
+ .appendTo(group)
137
+ else
138
+ if typeof element == "string"
139
+ value = i;
140
+ text = element;
141
+ else
142
+ value = element.value;
143
+ text = element.text;
144
+ if $.inArray(value + "-" + text, selected_values) == -1
145
+ $("<option />")
146
+ .attr('value', value)
147
+ .html(text)
148
+ .appendTo(_this.element)
149
+
150
+ if nbItems
151
+ # Tell chosen that the contents of the <select> input have been updated
152
+ # This makes chosen update its internal list of the input data.
153
+ @element.trigger("chosen:updated")
154
+ else
155
+ # If there are no results, display the no_results text
156
+ @element.data().chosen.no_results_clear()
157
+ @element.data().chosen.no_results @search_field.val()
158
+
159
+ # Finally, call the user supplied callback (if it exists)
160
+ @success(data) if @success?
161
+
162
+ # For some reason, the contents of the input field get removed once you
163
+ # call trigger above. Often, this can be very annoying (and can make some
164
+ # searches impossible), so we add the value the user was typing back into
165
+ # the input field.
166
+ @search_field.val(@untrimmed_val)
167
+
168
+ # Because non-ajax Chosen isn't constantly re-building results, when it
169
+ # DOES rebuild results (during chosen:updated above, it clears the input
170
+ # search field before scaling it. This causes the input field width to be
171
+ # at it's minimum, which is about 25px.
172
+
173
+ # The proper way to fix this would be create a new method in chosen for
174
+ # rebuilding results without clearing the input field. Or to call
175
+ # Chosen.search_field_scale() after resetting the value above. This isn't
176
+ # possible with the current state of Chosen. The quick fix is to simply reset
177
+ # the width of the field after we reset the value of the input text.
178
+ # @search_field.css('width','auto')
179
+
180
+ $.fn.ajaxChosen = (options = {}, callback, chosenOptions = {}) ->
181
+ @each ->
182
+ new ajaxChosen($(@), options, callback, chosenOptions)
183
+
@@ -0,0 +1,29 @@
1
+ # bootstrap-chosen (less/sass)
2
+
3
+ ![](https://github.com/alxlit/bootstrap-chosen/raw/master/example.png)
4
+
5
+ An alternate stylesheet for [Chosen 1.0](http://harvesthq.github.com/chosen/). This
6
+ one is supposed to integrate better with [Bootstrap 3.0](http://getbootstrap.com/).
7
+
8
+ [Here's the example page](http://alxlit.github.io/bootstrap-chosen/).
9
+
10
+ How you add `bootstrap-chosen.less` to your build process is up to you. Just keep
11
+ in mind that it needs access to `variables.less` and `mixins.less`.
12
+
13
+ You can tinker with the example page by:
14
+
15
+ ```
16
+ $ git clone https://github.com/alxlit/bootstrap-chosen
17
+ $ cd bootstrap-chosen
18
+ bootstrap-chosen $ git clone --depth=1 https://github.com/twbs/bootstrap
19
+ bootstrap-chosen $ vi bootstrap/less/bootstrap.less
20
+
21
+ // Add this to the bottom
22
+ @import "../../bootstrap-chosen.less";
23
+
24
+ bootstrap-chosen $ lessc bootstrap/less/bootstrap.less > bootstrap.css
25
+ bootstrap-chosen $ firefox example.html
26
+ ```
27
+
28
+ License: [MIT](https://en.wikipedia.org/wiki/MIT_License)
29
+
@@ -0,0 +1,24 @@
1
+ //
2
+ // bootstrap-chosen-variables.less
3
+ //
4
+ // An alternate stylesheet for Chosen (http://harvesthq.github.com/chosen/).
5
+ // This one is supposed to integrate better with Bootstrap.
6
+ //
7
+ // Submit bugfixes to: http://github.com/alxlit/bootstrap-chosen
8
+ //
9
+
10
+ @chosen-background: @input-bg;
11
+ @chosen-border: 1px solid @input-border;
12
+ @chosen-border-radius: @input-border-radius;
13
+ @chosen-multi-border-radius: @chosen-border-radius;
14
+ @chosen-box-shadow: ~"inset 0 1px 1px rgba(0, 0, 0, .075)";
15
+ @chosen-drop-border: @input-border;
16
+ @chosen-drop-box-shadow: ~"0 8px 8px rgba(0, 0, 0, .25)";
17
+ @chosen-drop-zindex: 1060;
18
+ @chosen-focus-border: 1px solid @input-border-focus;
19
+ @chosen-focus-box-shadow: ~"0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82, 168, 236, .6)";
20
+ @chosen-focus-transition: ~"border linear .2s, box-shadow linear .2s";
21
+ @chosen-height: @input-height-base;
22
+ @chosen-multi-height: @input-height-base + 6px;
23
+ @chosen-sprite-path: "chosen-sprite.png";
24
+ @chosen-sprite-retina-path: "chosen-sprite@2x.png";
@@ -0,0 +1,16 @@
1
+ $chosen-background: $input-bg !default;
2
+ $chosen-border: 1px solid $input-border !default;
3
+ $chosen-border-color: $input-border-focus;
4
+ $chosen-border-radius: $input-border-radius !default;
5
+ $chosen-multi-border-radius: $chosen-border-radius !default;
6
+ $chosen-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075) !default;
7
+ $chosen-drop-border: $input-border !default;
8
+ $chosen-drop-box-shadow: 0 8px 8px rgba(0, 0, 0, .25) !default;
9
+ $chosen-drop-zindex: 1060 !default;
10
+ $chosen-focus-border: 1px solid $input-border-focus !default;
11
+ $chosen-focus-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px $chosen-border-color !default;
12
+ $chosen-focus-transition: border linear .2s, box-shadow linear .2s !default;
13
+ $chosen-height: $input-height-base !default;
14
+ $chosen-multi-height: $input-height-base + 6px !default;
15
+ $chosen-sprite-path: 'chosen-sprite.png' !default;
16
+ $chosen-sprite-retina-path: 'chosen-sprite@2x.png' !default;
@@ -0,0 +1,473 @@
1
+ //
2
+ // bootstrap-chosen.less
3
+ //
4
+ // An alternate stylesheet for Chosen (http://harvesthq.github.com/chosen/).
5
+ // This one is supposed to integrate better with Bootstrap.
6
+ //
7
+ // Submit bugfixes to: http://github.com/alxlit/bootstrap-chosen
8
+ //
9
+
10
+ @import "bootstrap-chosen-variables.less";
11
+
12
+ .chosen-select { width: 100%; }
13
+ .chosen-select-deselect { width: 100%; }
14
+
15
+ .chosen-container {
16
+ display: inline-block;
17
+ font-size: @font-size-base;
18
+ position: relative;
19
+ vertical-align: middle;
20
+
21
+ .chosen-drop {
22
+ background: @chosen-background;
23
+ border: 1px solid @chosen-drop-border;
24
+ .border-bottom-radius(@chosen-border-radius);
25
+ .box-shadow(@chosen-drop-box-shadow);
26
+ margin-top: -1px;
27
+ position: absolute;
28
+ top: 100%;
29
+ left: -9000px;
30
+ z-index: @chosen-drop-zindex;
31
+ }
32
+
33
+ &.chosen-with-drop .chosen-drop {
34
+ left: 0;
35
+ right: 0;
36
+ }
37
+
38
+ .chosen-results {
39
+ color: @gray;
40
+ margin: 0 4px 4px 0;
41
+ max-height: 240px;
42
+ padding: 0 0 0 4px;
43
+ position: relative;
44
+ overflow-x: hidden;
45
+ overflow-y: auto;
46
+ -webkit-overflow-scrolling: touch;
47
+
48
+ li {
49
+ display: none;
50
+ line-height: @line-height-base; // 15px;
51
+ list-style: none;
52
+ margin: 0;
53
+ padding: 5px 6px;
54
+
55
+ em {
56
+ background: #feffde;
57
+ font-style: normal;
58
+ }
59
+
60
+ &.group-result {
61
+ display: list-item;
62
+ cursor: default;
63
+ color: #999;
64
+ font-weight: bold;
65
+ }
66
+
67
+ &.group-option {
68
+ padding-left: 15px;
69
+ }
70
+
71
+ &.active-result {
72
+ cursor: pointer;
73
+ display: list-item;
74
+ }
75
+
76
+ &.highlighted {
77
+ background-color: @link-color;
78
+ background-image: none;
79
+ color: white;
80
+
81
+ em {
82
+ background: transparent;
83
+ }
84
+ }
85
+
86
+ &.disabled-result {
87
+ display: list-item;
88
+ color: @gray-light;
89
+ }
90
+ }
91
+
92
+ .no-results {
93
+ background: @gray-lighter;
94
+ display: list-item;
95
+ }
96
+ }
97
+
98
+ .chosen-results-scroll {
99
+ background: white;
100
+ margin: 0 4px;
101
+ position: absolute;
102
+ text-align: center;
103
+ width: 321px;
104
+ z-index: 1;
105
+
106
+ span {
107
+ display: inline-block;
108
+ height: @line-height-base; // 17px;
109
+ text-indent: -5000px;
110
+ width: 9px;
111
+ }
112
+ }
113
+
114
+ .chosen-results-scroll-down {
115
+ bottom: 0;
116
+
117
+ span {
118
+ background: url("@{chosen-sprite-path}") no-repeat -4px -3px;
119
+ }
120
+ }
121
+
122
+ .chosen-results-scroll-up {
123
+ span {
124
+ background: url("@{chosen-sprite-path}") no-repeat -22px -3px;
125
+ }
126
+ }
127
+ }
128
+
129
+ .chosen-container-single {
130
+ .chosen-single {
131
+ background-color: @chosen-background;
132
+ -webkit-background-clip: padding-box;
133
+ -moz-background-clip: padding;
134
+ background-clip: padding-box;
135
+ border: @chosen-border;
136
+ .border-top-radius(@chosen-border-radius);
137
+ .border-bottom-radius(@chosen-border-radius);
138
+ .box-shadow(@chosen-box-shadow);
139
+ color: @gray;
140
+ display: block;
141
+ height: @chosen-height;
142
+ overflow: hidden;
143
+ line-height: @chosen-height;
144
+ padding: 0 0 0 8px;
145
+ position: relative;
146
+ text-decoration: none;
147
+ white-space: nowrap;
148
+
149
+ span {
150
+ display: block;
151
+ margin-right: 26px;
152
+ .text-overflow();
153
+ }
154
+
155
+ abbr {
156
+ background: url("@{chosen-sprite-path}") right top no-repeat;
157
+ display: block;
158
+ font-size: 1px;
159
+ height: 10px;
160
+ position: absolute;
161
+ right: 26px;
162
+ top: ((@chosen-height - 10px) / 2);
163
+ width: 12px;
164
+
165
+ &:hover {
166
+ background-position: right -11px;
167
+ }
168
+ }
169
+
170
+ &.chosen-disabled .chosen-single abbr:hover {
171
+ background-position: right 2px;
172
+ }
173
+
174
+ div {
175
+ display: block;
176
+ height: 100%;
177
+ position: absolute;
178
+ top: 0;
179
+ right: 0;
180
+ width: 18px;
181
+
182
+ b {
183
+ background: url("@{chosen-sprite-path}") no-repeat 0 7px;
184
+ display: block;
185
+ height: 100%;
186
+ width: 100%;
187
+ }
188
+ }
189
+ }
190
+
191
+ .chosen-default {
192
+ color: @gray-light;
193
+ }
194
+
195
+ .chosen-search {
196
+ margin: 0;
197
+ padding: 3px 4px;
198
+ position: relative;
199
+ white-space: nowrap;
200
+ z-index: @zindex-dropdown;
201
+
202
+ input[type="text"] {
203
+ background: url("@{chosen-sprite-path}") no-repeat 100% -20px, @chosen-background;
204
+ border: @chosen-border;
205
+ .border-top-radius(@chosen-border-radius);
206
+ .border-bottom-radius(@chosen-border-radius);
207
+ .box-shadow(@chosen-box-shadow);
208
+ margin: 1px 0;
209
+ padding: 4px 20px 4px 4px;
210
+ width: 100%;
211
+ }
212
+ }
213
+
214
+ .chosen-drop {
215
+ margin-top: -1px;
216
+ .border-bottom-radius(@chosen-border-radius);
217
+ -webkit-background-clip: padding-box;
218
+ -moz-background-clip: padding;
219
+ background-clip: padding-box;
220
+ }
221
+ }
222
+
223
+ .chosen-container-single-nosearch {
224
+ .chosen-search {
225
+ input {
226
+ position: absolute;
227
+ left: -9000px;
228
+ }
229
+ }
230
+ }
231
+
232
+ .chosen-container-multi {
233
+ .chosen-choices {
234
+ background-color: @chosen-background;
235
+ border: @chosen-border;
236
+ .border-top-radius(@chosen-multi-border-radius);
237
+ .border-bottom-radius(@chosen-multi-border-radius);
238
+ .box-shadow(@chosen-box-shadow);
239
+ cursor: text;
240
+ height: auto !important;
241
+ height: 1%;
242
+ margin: 0;
243
+ overflow: hidden;
244
+ padding: 0;
245
+ position: relative;
246
+
247
+ li {
248
+ float: left;
249
+ list-style: none;
250
+ }
251
+
252
+ .search-field {
253
+ margin: 0;
254
+ padding: 0;
255
+ white-space: nowrap;
256
+
257
+ input[type="text"] {
258
+ background: transparent !important;
259
+ border: 0 !important;
260
+ .box-shadow(none);
261
+ color: @gray;
262
+ height: @chosen-multi-height - 8px;
263
+ margin: 0;
264
+ padding: 4px;
265
+ outline: 0;
266
+ }
267
+
268
+ .default {
269
+ color: #999;
270
+ }
271
+ }
272
+
273
+ .search-choice {
274
+ -webkit-background-clip: padding-box;
275
+ -moz-background-clip: padding;
276
+ background-clip: padding-box;
277
+ background-color: @gray-lighter;
278
+ border: @chosen-border;
279
+ .border-top-radius(@chosen-border-radius);
280
+ .border-bottom-radius(@chosen-border-radius);
281
+ .box-shadow(@chosen-box-shadow);
282
+ color: @gray-dark;
283
+ cursor: default;
284
+ line-height: 13px;
285
+ margin: 6px 0 3px 5px;
286
+ padding: 3px 20px 3px 5px;
287
+ position: relative;
288
+
289
+ .search-choice-close {
290
+ background: url("@{chosen-sprite-path}") right top no-repeat;
291
+ display: block;
292
+ font-size: 1px;
293
+ height: 10px;
294
+ position: absolute;
295
+ right: 4px;
296
+ top: 5px;
297
+ width: 12px;
298
+ cursor: pointer;
299
+
300
+ &:hover {
301
+ background-position: right -11px;
302
+ }
303
+ }
304
+ }
305
+
306
+ .search-choice-focus {
307
+ background: #d4d4d4;
308
+
309
+ .search-choice-close {
310
+ background-position: right -11px;
311
+ }
312
+ }
313
+ }
314
+
315
+ .chosen-results {
316
+ margin: 0 0 0 0;
317
+ padding: 0;
318
+ }
319
+
320
+ .chosen-drop {
321
+ .result-selected {
322
+ display: none;
323
+ }
324
+ }
325
+ }
326
+
327
+ .chosen-container-active {
328
+ .chosen-single {
329
+ border: @chosen-focus-border;
330
+ .box-shadow(@chosen-focus-box-shadow);
331
+ .transition(@chosen-focus-transition);
332
+ }
333
+
334
+ &.chosen-with-drop .chosen-single {
335
+ background-color: @input-bg;
336
+ border: @chosen-focus-border;
337
+ .border-bottom-radius(0);
338
+ .box-shadow(@chosen-focus-box-shadow);
339
+ .transition(@chosen-focus-transition);
340
+
341
+ div {
342
+ background: transparent;
343
+ border-left: none;
344
+
345
+ b {
346
+ background-position: -18px 7px;
347
+ }
348
+ }
349
+ }
350
+
351
+ .chosen-choices {
352
+ border: @chosen-focus-border;
353
+ .border-bottom-radius(0);
354
+ .box-shadow(@chosen-focus-box-shadow);
355
+ .transition(@chosen-focus-transition);
356
+
357
+ .search-field input[type="text"] {
358
+ color: #111 !important;
359
+ }
360
+ }
361
+
362
+ &.chosen-with-drop .chosen-choices {
363
+ .border-bottom-radius(0);
364
+ }
365
+ }
366
+
367
+ .chosen-disabled {
368
+ cursor: default;
369
+ opacity: 0.5 !important;
370
+
371
+ .chosen-single {
372
+ cursor: default;
373
+ }
374
+
375
+ .chosen-choices .search-choice .search-choice-close {
376
+ cursor: default;
377
+ }
378
+ }
379
+
380
+ .chosen-rtl {
381
+ text-align: right;
382
+
383
+ .chosen-single {
384
+ padding: 0 8px 0 0;
385
+ overflow: visible;
386
+
387
+ span {
388
+ margin-left: 26px;
389
+ margin-right: 0;
390
+ direction: rtl;
391
+ }
392
+
393
+ div {
394
+ left: 7px;
395
+ right: auto;
396
+ }
397
+
398
+ abbr {
399
+ left: 26px;
400
+ right: auto;
401
+ }
402
+ }
403
+
404
+ .chosen-choices {
405
+ .search-field input[type="text"] {
406
+ direction: rtl;
407
+ }
408
+
409
+ li {
410
+ float: right;
411
+ }
412
+
413
+ .search-choice {
414
+ margin: 6px 5px 3px 0;
415
+ padding: 3px 5px 3px 19px;
416
+
417
+ .search-choice-close {
418
+ background-position: right top;
419
+ left: 4px;
420
+ right: auto;
421
+ }
422
+ }
423
+ }
424
+
425
+ &.chosen-container-single .chosen-results {
426
+ margin: 0 0 4px 4px;
427
+ padding: 0 4px 0 0;
428
+ }
429
+
430
+ .chosen-results .group-option {
431
+ padding-left: 0;
432
+ padding-right: 15px;
433
+ }
434
+
435
+ &.chosen-container-active.chosen-with-drop .chosen-single div {
436
+ border-right: none;
437
+ }
438
+
439
+ .chosen-search input[type="text"] {
440
+ background: url("@{chosen-sprite-path}") no-repeat -28px -20px, @chosen-background;
441
+ direction: rtl;
442
+ padding: 4px 5px 4px 20px;
443
+ }
444
+ }
445
+
446
+ .input-group {
447
+ .chosen-container:last-child {
448
+ .chosen-single, .chosen-default, .chosen-choices {
449
+ border-top-left-radius: 0px;
450
+ border-bottom-left-radius: 0px;
451
+ }
452
+ }
453
+ .chosen-container:not(:last-child) {
454
+ .chosen-single, .chosen-default, .chosen-choices {
455
+ border-top-right-radius: 0px;
456
+ border-bottom-right-radius: 0px;
457
+ }
458
+ }
459
+ }
460
+
461
+ @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 2dppx) {
462
+ .chosen-rtl .chosen-search input[type="text"],
463
+ .chosen-container-single .chosen-single abbr,
464
+ .chosen-container-single .chosen-single div b,
465
+ .chosen-container-single .chosen-search input[type="text"],
466
+ .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
467
+ .chosen-container .chosen-results-scroll-down span,
468
+ .chosen-container .chosen-results-scroll-up span {
469
+ background-image: url("@{chosen-sprite-retina-path}") !important;
470
+ background-size: 52px 37px !important;
471
+ background-repeat: no-repeat !important;
472
+ }
473
+ }