fanforce-plugin-factory 0.41.0 → 1.6.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (260) hide show
  1. data/.gitignore +1 -0
  2. data/.ruby-version +1 -0
  3. data/.yardopts +5 -0
  4. data/.yardopts.rb +1 -0
  5. data/Gemfile +9 -0
  6. data/README.md +40 -75
  7. data/Rakefile +61 -4
  8. data/fanforce-plugin-factory.gemspec +21 -21
  9. data/lib/fanforce/plugin_factory.rb +16 -58
  10. data/lib/fanforce/plugin_factory/Rakefile +51 -0
  11. data/lib/fanforce/plugin_factory/Routes.rb +33 -0
  12. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_bootstrap.scss +2 -0
  13. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_common.scss +1 -0
  14. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_directives.scss +7 -0
  15. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_font-awesome.scss +1 -0
  16. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/_ui-select.scss +3 -0
  17. data/lib/fanforce/plugin_factory/{assets/lib/common → asset_framework/plugin_factory/bootstrap}/_bootstrap-overrides.scss +2 -0
  18. data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/css → asset_framework/plugin_factory/bootstrap}/bootstrap.css +2 -2
  19. data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/js → asset_framework/plugin_factory/bootstrap}/bootstrap.js +0 -0
  20. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/bootstrap.min.css +7 -0
  21. data/lib/fanforce/plugin_factory/{assets/lib/vendors/bootstrap/js → asset_framework/plugin_factory/bootstrap}/bootstrap.min.js +0 -0
  22. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.eot +0 -0
  23. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.svg +229 -0
  24. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  25. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/bootstrap/glyphicons-halflings-regular.woff +0 -0
  26. data/lib/fanforce/plugin_factory/{assets/lib → asset_framework/plugin_factory}/common/_mixins.scss +2 -1
  27. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives.coffee +1 -0
  28. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/error/_error.scss +6 -0
  29. data/lib/fanforce/plugin_factory/{assets/lib/common/module-error → asset_framework/plugin_factory/directives/error}/arrow-left.png +0 -0
  30. data/lib/fanforce/plugin_factory/{assets/lib/common/module-error → asset_framework/plugin_factory/directives/error}/icon-error.png +0 -0
  31. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/initiative-footer/_initiative-footer.coffee +16 -0
  32. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-add-initiative-footer.scss → asset_framework/plugin_factory/directives/initiative-footer/_initiative-footer.scss} +4 -1
  33. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-initiative-searcher.scss → asset_framework/plugin_factory/directives/initiative-searcher/_initiative-searcher.scss} +14 -13
  34. data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/icon-search.png +0 -0
  35. data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/spinner.gif +0 -0
  36. data/lib/fanforce/plugin_factory/{assets/lib/common/module-initiative-searcher → asset_framework/plugin_factory/directives/initiative-searcher}/sprite-arrows.png +0 -0
  37. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/loading/_loading.coffee +4 -0
  38. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/loading/_loading.scss +4 -0
  39. data/lib/fanforce/plugin_factory/{assets/js/add_source_popup.js → asset_framework/plugin_factory/directives/saving-to-server/_saving-to-server.coffee} +0 -0
  40. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/saving-to-server/_saving-to-server.scss +6 -0
  41. data/lib/fanforce/plugin_factory/{assets/lib/common/module-saving-initiative → asset_framework/plugin_factory/directives/saving-to-server}/spinner.gif +0 -0
  42. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/directives/start-arrow/_start-arrow.coffee +8 -0
  43. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-start-here.scss → asset_framework/plugin_factory/directives/start-arrow/_start-arrow.scss} +5 -4
  44. data/lib/fanforce/plugin_factory/{assets/lib/common/module-start-here → asset_framework/plugin_factory/directives/start-arrow}/arrow.png +0 -0
  45. data/lib/fanforce/plugin_factory/{assets/lib/common/_module-video-thumbnail.scss → asset_framework/plugin_factory/directives/video-thumbnail/_video-thumbnail.scss} +4 -4
  46. data/lib/fanforce/plugin_factory/{assets/lib/common/module-video-thumbnail → asset_framework/plugin_factory/directives/video-thumbnail}/icon-play.png +0 -0
  47. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/font-awesome.coffee +1 -0
  48. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/FontAwesome.otf +0 -0
  49. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/css → asset_framework/plugin_factory/font-awesome}/font-awesome.css +2 -2
  50. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/css → asset_framework/plugin_factory/font-awesome}/font-awesome.min.css +0 -0
  51. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.eot +0 -0
  52. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.svg +0 -0
  53. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.ttf +0 -0
  54. data/lib/fanforce/plugin_factory/{assets/lib/vendors/font-awesome/font → asset_framework/plugin_factory/font-awesome}/fontawesome-webfont.woff +0 -0
  55. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib.coffee +1 -0
  56. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib/ng-focus-blur.js +68 -0
  57. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/lib/ng-visible.js +7 -0
  58. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select.coffee +1 -0
  59. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select.css +171 -0
  60. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select.js +1281 -0
  61. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/select_override.scss +1 -0
  62. data/lib/fanforce/plugin_factory/asset_framework/plugin_factory/ui-select/selectize.default.css +443 -0
  63. data/lib/fanforce/plugin_factory/cli.rb +5 -0
  64. data/lib/fanforce/plugin_factory/cli/lib/bitbucket.rb +77 -0
  65. data/lib/fanforce/plugin_factory/cli/lib/bundler.rb +21 -0
  66. data/lib/fanforce/plugin_factory/cli/lib/env.rb +96 -0
  67. data/lib/fanforce/plugin_factory/cli/lib/git.rb +59 -0
  68. data/lib/fanforce/plugin_factory/cli/lib/heroku.rb +94 -0
  69. data/lib/fanforce/plugin_factory/cli/lib/iron.rb +71 -0
  70. data/lib/fanforce/plugin_factory/cli/lib/pow.rb +46 -0
  71. data/lib/fanforce/plugin_factory/cli/lib/scaffolding.rb +74 -0
  72. data/lib/fanforce/plugin_factory/cli/lib/scaffolding_file.rb +510 -0
  73. data/lib/fanforce/plugin_factory/cli/lib/uranium.rb +77 -0
  74. data/lib/fanforce/plugin_factory/cli/lib/utils.rb +57 -0
  75. data/lib/fanforce/plugin_factory/cli/scripts/config.rb +9 -0
  76. data/lib/fanforce/plugin_factory/cli/scripts/create.rb +64 -0
  77. data/lib/fanforce/plugin_factory/cli/scripts/destroy.rb +61 -0
  78. data/lib/fanforce/plugin_factory/cli/scripts/diff.rb +156 -0
  79. data/lib/fanforce/plugin_factory/cli/scripts/push.rb +88 -0
  80. data/lib/fanforce/plugin_factory/cli/scripts/restart.rb +41 -0
  81. data/lib/fanforce/plugin_factory/cli/scripts/setup.rb +70 -0
  82. data/lib/fanforce/plugin_factory/cli/scripts/update.rb +132 -0
  83. data/lib/fanforce/plugin_factory/cli_directory_of_plugins.rb +51 -0
  84. data/lib/fanforce/plugin_factory/cli_single_plugin.rb +52 -0
  85. data/lib/fanforce/plugin_factory/controllers/base_controller.rb +15 -0
  86. data/lib/fanforce/plugin_factory/core_config.rb +94 -0
  87. data/lib/fanforce/plugin_factory/directive_views/initiative-footer.haml +8 -0
  88. data/lib/fanforce/plugin_factory/load.rb +7 -0
  89. data/lib/fanforce/plugin_factory/load_iron_worker.rb +2 -0
  90. data/lib/fanforce/plugin_factory/load_sprockets.rb +2 -0
  91. data/lib/fanforce/plugin_factory/plugin.rb +60 -0
  92. data/lib/fanforce/plugin_factory/scaffolding/._.gitignore.registry +1 -0
  93. data/lib/fanforce/plugin_factory/scaffolding/._Gemfile.registry +3 -0
  94. data/lib/fanforce/plugin_factory/scaffolding/._Rakefile.registry +3 -0
  95. data/lib/fanforce/plugin_factory/scaffolding/._config.json.registry +2 -0
  96. data/lib/fanforce/plugin_factory/scaffolding/._config.ru.registry +4 -0
  97. data/lib/fanforce/plugin_factory/scaffolding/._favicon.ico.registry +1 -0
  98. data/lib/fanforce/plugin_factory/scaffolding/._robots.txt.registry +3 -0
  99. data/lib/fanforce/plugin_factory/scaffolding/.gitignore +27 -0
  100. data/lib/fanforce/plugin_factory/scaffolding/Gemfile +9 -0
  101. data/lib/fanforce/plugin_factory/scaffolding/Rakefile +7 -0
  102. data/lib/fanforce/plugin_factory/scaffolding/Routes.rb +67 -0
  103. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._fembedded.scss.registry +4 -0
  104. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._promotional.scss.registry +4 -0
  105. data/lib/fanforce/plugin_factory/scaffolding/assets/css/._visitor.scss.registry +4 -0
  106. data/lib/fanforce/plugin_factory/scaffolding/assets/css/fembedded.scss +24 -0
  107. data/lib/fanforce/plugin_factory/scaffolding/assets/css/promotional.scss +33 -0
  108. data/lib/fanforce/plugin_factory/scaffolding/assets/css/visitor.scss +61 -0
  109. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-16.png.registry +1 -0
  110. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-32.png.registry +1 -0
  111. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._icon-42.png.registry +1 -0
  112. data/lib/fanforce/plugin_factory/scaffolding/assets/img/._marketplace.png.registry +1 -0
  113. data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-16.png +0 -0
  114. data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-32.png +0 -0
  115. data/lib/fanforce/plugin_factory/{assets → scaffolding/assets}/img/icon-42.png +0 -0
  116. data/lib/fanforce/plugin_factory/scaffolding/assets/img/marketplace.png +0 -0
  117. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._fanforce_bg.png.registry +1 -0
  118. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._icon-42.png.registry +1 -0
  119. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/._icon-plus.png.registry +1 -0
  120. data/lib/fanforce/plugin_factory/{assets/lib → scaffolding/assets/img}/promotional/fanforce_bg.png +0 -0
  121. data/lib/fanforce/plugin_factory/{assets/lib → scaffolding/assets/img}/promotional/icon-42.png +0 -0
  122. data/lib/fanforce/plugin_factory/scaffolding/assets/img/promotional/icon-plus.png +0 -0
  123. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._fembedded-app.coffee.registry +5 -0
  124. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._fembedded.js.registry +3 -0
  125. data/lib/fanforce/plugin_factory/scaffolding/assets/js/._promotional.js.registry +3 -0
  126. data/lib/fanforce/plugin_factory/scaffolding/assets/js/fembedded-app.coffee +11 -0
  127. data/lib/fanforce/plugin_factory/scaffolding/assets/js/fembedded.js +12 -0
  128. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._cookie.coffee.registry +3 -0
  129. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._filters.coffee.registry +3 -0
  130. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/._utils.coffee.registry +3 -0
  131. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/cookie.coffee +24 -0
  132. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee +9 -0
  133. data/lib/fanforce/plugin_factory/scaffolding/assets/js/lib/utils.coffee +40 -0
  134. data/lib/fanforce/plugin_factory/scaffolding/assets/js/promotional.js +4 -0
  135. data/lib/fanforce/plugin_factory/scaffolding/config.json +24 -0
  136. data/lib/fanforce/plugin_factory/scaffolding/config.ru +8 -0
  137. data/lib/fanforce/plugin_factory/{public → scaffolding}/favicon.ico +0 -0
  138. data/lib/fanforce/plugin_factory/scaffolding/layouts/._fembedded.haml.registry +4 -0
  139. data/lib/fanforce/plugin_factory/scaffolding/layouts/._promotional.haml.registry +2 -0
  140. data/lib/fanforce/plugin_factory/scaffolding/layouts/._visitor.haml.registry +6 -0
  141. data/lib/fanforce/plugin_factory/scaffolding/layouts/fembedded.haml +26 -0
  142. data/lib/fanforce/plugin_factory/{layouts → scaffolding/layouts}/promotional.haml +6 -6
  143. data/lib/fanforce/plugin_factory/{layouts/engage.haml → scaffolding/layouts/visitor.haml} +10 -7
  144. data/lib/fanforce/plugin_factory/scaffolding/robots.txt +7 -0
  145. data/lib/fanforce/plugin_factory/scaffolding/views/._index.haml.registry +3 -0
  146. data/lib/fanforce/plugin_factory/{views → scaffolding/views}/index.haml +13 -7
  147. data/lib/fanforce/plugin_factory/sinatra/_load.rb +87 -0
  148. data/lib/fanforce/plugin_factory/sinatra/error_handling.rb +48 -0
  149. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_behavior.rb +19 -0
  150. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_broadcaster.rb +7 -0
  151. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_connector.rb +11 -0
  152. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_identifier.rb +3 -0
  153. data/lib/fanforce/plugin_factory/sinatra/helper_routes/com_js_widget.rb +8 -0
  154. data/lib/fanforce/plugin_factory/sinatra/helper_routes/plugin.rb +50 -0
  155. data/lib/fanforce/plugin_factory/sinatra/helpers/assets.rb +23 -0
  156. data/lib/fanforce/plugin_factory/sinatra/helpers/css_frameworks.rb +70 -0
  157. data/lib/fanforce/plugin_factory/sinatra/helpers/fanforce.rb +18 -0
  158. data/lib/fanforce/plugin_factory/{config → sinatra}/helpers/json.rb +2 -2
  159. data/lib/fanforce/plugin_factory/sinatra/helpers/ractive.rb +45 -0
  160. data/lib/fanforce/plugin_factory/sprockets/compiler.rb +5 -11
  161. data/lib/fanforce/plugin_factory/sprockets/hacks.rb +2 -2
  162. data/lib/fanforce/plugin_factory/version.rb +2 -2
  163. metadata +201 -195
  164. data/.rbenv-gemsets +0 -1
  165. data/.rbenv-version +0 -1
  166. data/lib/fanforce/plugin_factory.rake +0 -72
  167. data/lib/fanforce/plugin_factory/_init_sinatra.rb +0 -54
  168. data/lib/fanforce/plugin_factory/assets/css/add_edit_initiative.scss +0 -1
  169. data/lib/fanforce/plugin_factory/assets/css/add_source.scss +0 -1
  170. data/lib/fanforce/plugin_factory/assets/css/convert_pending_initiative.scss +0 -1
  171. data/lib/fanforce/plugin_factory/assets/css/engage.scss +0 -1
  172. data/lib/fanforce/plugin_factory/assets/css/new_message.scss +0 -1
  173. data/lib/fanforce/plugin_factory/assets/css/promotional.scss +0 -1
  174. data/lib/fanforce/plugin_factory/assets/css/source_details.scss +0 -1
  175. data/lib/fanforce/plugin_factory/assets/js/add_edit_initiative.js +0 -1
  176. data/lib/fanforce/plugin_factory/assets/js/add_source.js +0 -1
  177. data/lib/fanforce/plugin_factory/assets/js/convert_pending_initiative.js +0 -1
  178. data/lib/fanforce/plugin_factory/assets/js/engage.js +0 -1
  179. data/lib/fanforce/plugin_factory/assets/js/new_message.js +0 -1
  180. data/lib/fanforce/plugin_factory/assets/js/promotional.js +0 -2
  181. data/lib/fanforce/plugin_factory/assets/js/source_details.js +0 -0
  182. data/lib/fanforce/plugin_factory/assets/lib/common/_module-error.scss +0 -11
  183. data/lib/fanforce/plugin_factory/assets/lib/common/_module-page-loading.scss +0 -1
  184. data/lib/fanforce/plugin_factory/assets/lib/common/_module-saving-initiative.scss +0 -6
  185. data/lib/fanforce/plugin_factory/assets/lib/common/_tags.scss +0 -1
  186. data/lib/fanforce/plugin_factory/assets/lib/common/_variables.scss +0 -27
  187. data/lib/fanforce/plugin_factory/assets/lib/common/broadcaster-divider-arrow.png +0 -0
  188. data/lib/fanforce/plugin_factory/assets/lib/common/icons/dropdown-arrow.png +0 -0
  189. data/lib/fanforce/plugin_factory/assets/lib/common/icons/initiative.png +0 -0
  190. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_add_edit_initiative.scss +0 -27
  191. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_add_source.scss +0 -18
  192. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_convert_pending_initiative.scss +0 -27
  193. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_engage.scss +0 -78
  194. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_new_message.scss +0 -24
  195. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_promotional.scss +0 -27
  196. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/_source_details.scss +0 -17
  197. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/add_edit_initiative.js +0 -6
  198. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/add_source.js +0 -6
  199. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/convert_pending_initiative.js +0 -6
  200. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/engage.js +0 -0
  201. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/new_message.js +0 -5
  202. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/promotional.js +0 -1
  203. data/lib/fanforce/plugin_factory/assets/lib/common/layouts/source_details.js +0 -5
  204. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-behavior.png +0 -0
  205. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-broadcaster.png +0 -0
  206. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-data-connector.png +0 -0
  207. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-data-processor.png +0 -0
  208. data/lib/fanforce/plugin_factory/assets/lib/promotional/icon-identifier.png +0 -0
  209. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-datepicker/datepicker.css +0 -7
  210. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-datepicker/datepicker.js +0 -454
  211. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-timepicker/timepicker.css +0 -82
  212. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap-timepicker/timepicker.js +0 -803
  213. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/css/bootstrap.min.css +0 -7
  214. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.eot +0 -0
  215. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.svg +0 -0
  216. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.ttf +0 -0
  217. data/lib/fanforce/plugin_factory/assets/lib/vendors/bootstrap/img/glyphicons-halflings-regular.woff +0 -0
  218. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/_chosen_override.scss +0 -6
  219. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen-sprite.png +0 -0
  220. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen-sprite@2x.png +0 -0
  221. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen.jquery.js +0 -1166
  222. data/lib/fanforce/plugin_factory/assets/lib/vendors/chosen/chosen.scss +0 -434
  223. data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery-1.10.2.js +0 -9789
  224. data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery.inputHint.js +0 -154
  225. data/lib/fanforce/plugin_factory/assets/lib/vendors/jquery/jquery.tmpl.debug.js +0 -484
  226. data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.custom-handlers.coffee +0 -155
  227. data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.debug.js +0 -4469
  228. data/lib/fanforce/plugin_factory/assets/lib/vendors/knockout/knockout.min.js +0 -96
  229. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/_select2_override.scss +0 -47
  230. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2-spinner.gif +0 -0
  231. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2.png +0 -0
  232. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2.scss +0 -617
  233. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2_modified.js +0 -3225
  234. data/lib/fanforce/plugin_factory/assets/lib/vendors/select2/select2x2.png +0 -0
  235. data/lib/fanforce/plugin_factory/assets/lib/vendors/underscore/underscore.debug.js +0 -999
  236. data/lib/fanforce/plugin_factory/config/_error_handling.rb +0 -27
  237. data/lib/fanforce/plugin_factory/config/core_config.rb +0 -92
  238. data/lib/fanforce/plugin_factory/config/helpers/assets.rb +0 -72
  239. data/lib/fanforce/plugin_factory/config/helpers/fanforce.rb +0 -19
  240. data/lib/fanforce/plugin_factory/layouts/add_edit_initiative.haml +0 -19
  241. data/lib/fanforce/plugin_factory/layouts/add_source.haml +0 -19
  242. data/lib/fanforce/plugin_factory/layouts/convert_pending_initiative.haml +0 -19
  243. data/lib/fanforce/plugin_factory/layouts/new_message.haml +0 -19
  244. data/lib/fanforce/plugin_factory/layouts/source_details.haml +0 -19
  245. data/lib/fanforce/plugin_factory/public/robots.txt +0 -2
  246. data/lib/fanforce/plugin_factory/routes.rb +0 -48
  247. data/lib/fanforce/plugin_factory/routes_behavior.rb +0 -34
  248. data/lib/fanforce/plugin_factory/routes_broadcaster.rb +0 -9
  249. data/lib/fanforce/plugin_factory/routes_data_connector.rb +0 -21
  250. data/lib/fanforce/plugin_factory/routes_identifier.rb +0 -3
  251. data/lib/fanforce/plugin_factory/views/add_initiative.haml +0 -1
  252. data/lib/fanforce/plugin_factory/views/add_source.haml +0 -1
  253. data/lib/fanforce/plugin_factory/views/close_popup.haml +0 -8
  254. data/lib/fanforce/plugin_factory/views/convert_pending_initiative.haml +0 -1
  255. data/lib/fanforce/plugin_factory/views/edit_initiative.haml +0 -1
  256. data/lib/fanforce/plugin_factory/views/engage.haml +0 -1
  257. data/lib/fanforce/plugin_factory/views/new_message.haml +0 -1
  258. data/lib/fanforce/plugin_factory/views/source_details.haml +0 -1
  259. data/lib/fanforce/plugin_factory/views/widget_tmpls.haml +0 -1
  260. data/lib/fanforce/plugin_factory_workers.rb +0 -2
@@ -1,82 +0,0 @@
1
- .bootstrap-timepicker.dropdown-menu {
2
- border-radius: 4px 4px 4px 4px;
3
- display: none;
4
- left: 0;
5
- margin-top: 1px;
6
- padding: 4px;
7
- top: 0;
8
- min-width: 10px;
9
- z-index: 99999;
10
- }
11
- .bootstrap-timepicker.dropdown-menu.open {
12
- display: inline-block;
13
- }
14
- .bootstrap-timepicker.dropdown-menu:before {
15
- border-bottom: 7px solid rgba(0, 0, 0, 0.2);
16
- border-left: 7px solid transparent;
17
- border-right: 7px solid transparent;
18
- content: "";
19
- left: 6px;
20
- position: absolute;
21
- top: -7px;
22
- }
23
- .bootstrap-timepicker.dropdown-menu:after {
24
- border-bottom: 6px solid #FFFFFF;
25
- border-left: 6px solid transparent;
26
- border-right: 6px solid transparent;
27
- content: "";
28
- left: 7px;
29
- position: absolute;
30
- top: -6px;
31
- }
32
- .bootstrap-timepicker.modal {
33
- margin-left: -100px;
34
- margin-top: 0;
35
- top: 30%;
36
- width: 200px;
37
- }
38
- .bootstrap-timepicker.modal .modal-content {
39
- padding: 0;
40
- }
41
- .bootstrap-timepicker table {
42
- margin: 0;
43
- width: 100%;
44
- }
45
- .bootstrap-timepicker table td {
46
- height: 30px;
47
- margin: 0;
48
- padding: 2px;
49
- text-align: center;
50
- }
51
- .bootstrap-timepicker table td span {
52
- width: 100%;
53
- }
54
- .bootstrap-timepicker table td a {
55
- border: 1px solid transparent;
56
- display: inline-block;
57
- margin: 0;
58
- outline: 0 none;
59
- padding: 8px 0;
60
- width: 3em;
61
- }
62
- .bootstrap-timepicker table td a:hover {
63
- background-color: #EEEEEE;
64
- border-color: #DDDDDD;
65
- border-radius: 4px 4px 4px 4px;
66
- }
67
- .bootstrap-timepicker table td a i {
68
- margin-top: 2px;
69
- }
70
- .bootstrap-timepicker table td input {
71
- margin: 0;
72
- text-align: center;
73
- width: 25px;
74
- }
75
- .bootstrap-timepicker-component .add-on {
76
- cursor: pointer;
77
- }
78
- .bootstrap-timepicker-component .add-on i {
79
- display: block;
80
- height: 16px;
81
- width: 16px;
82
- }
@@ -1,803 +0,0 @@
1
- /* =========================================================
2
- * bootstrap-timepicker.js
3
- * http://www.github.com/jdewit/bootstrap-timepicker
4
- * =========================================================
5
- * Copyright 2012
6
- *
7
- * Created By:
8
- * Joris de Wit @joris_dewit
9
- *
10
- * Contributions By:
11
- * Gilbert @mindeavor
12
- * Koen Punt info@koenpunt.nl
13
- * Nek
14
- * Chris Martin
15
- * Dominic Barnes contact@dominicbarnes.us
16
- *
17
- * Licensed under the Apache License, Version 2.0 (the "License");
18
- * you may not use this file except in compliance with the License.
19
- * You may obtain a copy of the License at
20
- *
21
- * http://www.apache.org/licenses/LICENSE-2.0
22
- *
23
- * Unless required by applicable law or agreed to in writing, software
24
- * distributed under the License is distributed on an "AS IS" BASIS,
25
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
- * See the License for the specific language governing permissions and
27
- * limitations under the License.
28
- * ========================================================= */
29
-
30
- !function($) {
31
-
32
- "use strict"; // jshint ;_;
33
-
34
- /* TIMEPICKER PUBLIC CLASS DEFINITION
35
- * ================================== */
36
- var Timepicker = function(element, options) {
37
- this.$element = $(element);
38
- this.options = $.extend({}, $.fn.timepicker.defaults, options, this.$element.data());
39
- this.minuteStep = this.options.minuteStep || this.minuteStep;
40
- this.secondStep = this.options.secondStep || this.secondStep;
41
- this.showMeridian = this.options.showMeridian || this.showMeridian;
42
- this.showSeconds = this.options.showSeconds || this.showSeconds;
43
- this.showInputs = this.options.showInputs || this.showInputs;
44
- this.disableFocus = this.options.disableFocus || this.disableFocus;
45
- this.template = this.options.template || this.template;
46
- this.modalBackdrop = this.options.modalBackdrop || this.modalBackdrop;
47
- this.defaultTime = this.options.defaultTime || this.defaultTime;
48
- this.open = false;
49
- this.init();
50
- };
51
-
52
- Timepicker.prototype = {
53
-
54
- constructor: Timepicker
55
-
56
- , init: function () {
57
- if (this.$element.parent().hasClass('input-append')) {
58
- this.$element.parent('.input-append').find('.add-on').on('click', $.proxy(this.showWidget, this));
59
- this.$element.on({
60
- focus: $.proxy(this.highlightUnit, this),
61
- click: $.proxy(this.highlightUnit, this),
62
- keypress: $.proxy(this.elementKeypress, this),
63
- blur: $.proxy(this.blurElement, this)
64
- });
65
-
66
- } else {
67
- if (this.template) {
68
- this.$element.on({
69
- focus: $.proxy(this.showWidget, this),
70
- click: $.proxy(this.showWidget, this),
71
- blur: $.proxy(this.blurElement, this)
72
- });
73
- } else {
74
- this.$element.on({
75
- focus: $.proxy(this.highlightUnit, this),
76
- click: $.proxy(this.highlightUnit, this),
77
- keypress: $.proxy(this.elementKeypress, this),
78
- blur: $.proxy(this.blurElement, this)
79
- });
80
- }
81
- }
82
-
83
-
84
- this.$widget = $(this.getTemplate()).appendTo('body');
85
-
86
- this.$widget.on('click', $.proxy(this.widgetClick, this));
87
-
88
- if (this.showInputs) {
89
- this.$widget.find('input').on({
90
- click: function() { this.select(); },
91
- keypress: $.proxy(this.widgetKeypress, this),
92
- change: $.proxy(this.updateFromWidgetInputs, this)
93
- });
94
- }
95
-
96
- this.setDefaultTime(this.defaultTime);
97
- }
98
-
99
- , showWidget: function(e) {
100
- e.stopPropagation();
101
- e.preventDefault();
102
-
103
- if (this.open) {
104
- return;
105
- }
106
-
107
- this.$element.trigger('show');
108
-
109
- if (this.disableFocus) {
110
- this.$element.blur();
111
- }
112
-
113
- var pos = $.extend({}, this.$element.offset(), {
114
- height: this.$element[0].offsetHeight
115
- });
116
-
117
- this.updateFromElementVal();
118
-
119
- $('html')
120
- .trigger('click.timepicker.data-api')
121
- .one('click.timepicker.data-api', $.proxy(this.hideWidget, this));
122
-
123
- if (this.template === 'modal') {
124
- this.$widget.modal('show').on('hidden', $.proxy(this.hideWidget, this));
125
- } else {
126
- this.$widget.css({
127
- top: pos.top + pos.height
128
- , left: pos.left
129
- })
130
-
131
- if (!this.open) {
132
- this.$widget.addClass('open');
133
- }
134
- }
135
-
136
- this.open = true;
137
- this.$element.trigger('shown');
138
- }
139
-
140
- , hideWidget: function(){
141
- this.$element.trigger('hide');
142
-
143
- if (this.template === 'modal') {
144
- this.$widget.modal('hide');
145
- } else {
146
- this.$widget.removeClass('open');
147
- }
148
- this.open = false;
149
- this.$element.trigger('hidden');
150
- }
151
-
152
- , widgetClick: function(e) {
153
- e.stopPropagation();
154
- e.preventDefault();
155
-
156
- var action = $(e.target).closest('a').data('action');
157
- if (action) {
158
- this[action]();
159
- this.update();
160
- }
161
- }
162
-
163
- , widgetKeypress: function(e) {
164
- var input = $(e.target).closest('input').attr('name');
165
-
166
- switch (e.keyCode) {
167
- case 9: //tab
168
- if (this.showMeridian) {
169
- if (input == 'meridian') {
170
- this.hideWidget();
171
- }
172
- } else {
173
- if (this.showSeconds) {
174
- if (input == 'second') {
175
- this.hideWidget();
176
- }
177
- } else {
178
- if (input == 'minute') {
179
- this.hideWidget();
180
- }
181
- }
182
- }
183
- break;
184
- case 27: // escape
185
- this.hideWidget();
186
- break;
187
- case 38: // up arrow
188
- switch (input) {
189
- case 'hour':
190
- this.incrementHour();
191
- break;
192
- case 'minute':
193
- this.incrementMinute();
194
- break;
195
- case 'second':
196
- this.incrementSecond();
197
- break;
198
- case 'meridian':
199
- this.toggleMeridian();
200
- break;
201
- }
202
- this.update();
203
- break;
204
- case 40: // down arrow
205
- switch (input) {
206
- case 'hour':
207
- this.decrementHour();
208
- break;
209
- case 'minute':
210
- this.decrementMinute();
211
- break;
212
- case 'second':
213
- this.decrementSecond();
214
- break;
215
- case 'meridian':
216
- this.toggleMeridian();
217
- break;
218
- }
219
- this.update();
220
- break;
221
- }
222
- }
223
-
224
- , elementKeypress: function(e) {
225
- var input = this.$element.get(0);
226
- switch (e.keyCode) {
227
- case 0: //input
228
- break;
229
- case 9: //tab
230
- this.updateFromElementVal();
231
- if (this.showMeridian) {
232
- if (this.highlightedUnit != 'meridian') {
233
- e.preventDefault();
234
- this.highlightNextUnit();
235
- }
236
- } else {
237
- if (this.showSeconds) {
238
- if (this.highlightedUnit != 'second') {
239
- e.preventDefault();
240
- this.highlightNextUnit();
241
- }
242
- } else {
243
- if (this.highlightedUnit != 'minute') {
244
- e.preventDefault();
245
- this.highlightNextUnit();
246
- }
247
- }
248
- }
249
- break;
250
- case 27: // escape
251
- this.updateFromElementVal();
252
- break;
253
- case 37: // left arrow
254
- this.updateFromElementVal();
255
- this.highlightPrevUnit();
256
- break;
257
- case 38: // up arrow
258
- switch (this.highlightedUnit) {
259
- case 'hour':
260
- this.incrementHour();
261
- break;
262
- case 'minute':
263
- this.incrementMinute();
264
- break;
265
- case 'second':
266
- this.incrementSecond();
267
- break;
268
- case 'meridian':
269
- this.toggleMeridian();
270
- break;
271
- }
272
- this.updateElement();
273
- break;
274
- case 39: // right arrow
275
- this.updateFromElementVal();
276
- this.highlightNextUnit();
277
- break;
278
- case 40: // down arrow
279
- switch (this.highlightedUnit) {
280
- case 'hour':
281
- this.decrementHour();
282
- break;
283
- case 'minute':
284
- this.decrementMinute();
285
- break;
286
- case 'second':
287
- this.decrementSecond();
288
- break;
289
- case 'meridian':
290
- this.toggleMeridian();
291
- break;
292
- }
293
- this.updateElement();
294
- break;
295
- }
296
-
297
- if (e.keyCode !== 0 && e.keyCode !== 8 && e.keyCode !== 9 && e.keyCode !== 46) {
298
- e.preventDefault();
299
- }
300
- }
301
-
302
- , setValues: function(time) {
303
- if (this.showMeridian) {
304
- var arr = time.split(' ');
305
- var timeArray = arr[0].split(':');
306
- this.meridian = arr[1];
307
- } else {
308
- var timeArray = time.split(':');
309
- }
310
-
311
- this.hour = parseInt(timeArray[0], 10);
312
- this.minute = parseInt(timeArray[1], 10);
313
- this.second = parseInt(timeArray[2], 10);
314
-
315
- if (isNaN(this.hour)) {
316
- this.hour = 0;
317
- }
318
- if (isNaN(this.minute)) {
319
- this.minute = 0;
320
- }
321
-
322
- if (this.showMeridian) {
323
- if (this.hour > 12) {
324
- this.hour = 12;
325
- } else if (this.hour < 1) {
326
- this.hour = 1;
327
- }
328
-
329
- if (this.meridian == 'am' || this.meridian == 'a') {
330
- this.meridian = 'AM';
331
- } else if (this.meridian == 'pm' || this.meridian == 'p') {
332
- this.meridian = 'PM';
333
- }
334
-
335
- if (this.meridian != 'AM' && this.meridian != 'PM') {
336
- this.meridian = 'AM';
337
- }
338
- } else {
339
- if (this.hour >= 24) {
340
- this.hour = 23;
341
- } else if (this.hour < 0) {
342
- this.hour = 0;
343
- }
344
- }
345
-
346
- if (this.minute < 0) {
347
- this.minute = 0;
348
- } else if (this.minute >= 60) {
349
- this.minute = 59;
350
- }
351
-
352
- if (this.showSeconds) {
353
- if (isNaN(this.second)) {
354
- this.second = 0;
355
- } else if (this.second < 0) {
356
- this.second = 0;
357
- } else if (this.second >= 60) {
358
- this.second = 59;
359
- }
360
- }
361
-
362
- if ( this.$element.val() != '' )
363
- this.updateElement();
364
- this.updateWidget();
365
- }
366
-
367
- , setMeridian: function(meridian) {
368
- if (meridian == 'a' || meridian == 'am' || meridian == 'AM' ) {
369
- this.meridian = 'AM';
370
- } else if (meridian == 'p' || meridian == 'pm' || meridian == 'PM' ) {
371
- this.meridian = 'PM';
372
- } else {
373
- this.updateWidget();
374
- }
375
-
376
- this.updateElement();
377
- }
378
-
379
- , setDefaultTime: function(defaultTime){
380
- if (defaultTime) {
381
- if (defaultTime === 'current') {
382
- var dTime = new Date();
383
- var hours = dTime.getHours();
384
- var minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep;
385
- var seconds = Math.floor(dTime.getSeconds() / this.secondStep) * this.secondStep;
386
- var meridian = "AM";
387
- if (this.showMeridian) {
388
- if (hours === 0) {
389
- hours = 12;
390
- } else if (hours >= 12) {
391
- if (hours > 12) {
392
- hours = hours - 12;
393
- }
394
- meridian = "PM";
395
- } else {
396
- meridian = "AM";
397
- }
398
- }
399
- this.hour = hours;
400
- this.minute = minutes;
401
- this.second = seconds;
402
- this.meridian = meridian;
403
- } else if (defaultTime === 'value') {
404
- this.setValues(this.$element.val());
405
- } else {
406
- this.setValues(defaultTime);
407
- }
408
- if ( this.$element.val() != '' )
409
- this.updateElement();
410
- this.updateWidget();
411
- } else {
412
- this.hour = 0;
413
- this.minute = 0;
414
- this.second = 0;
415
- }
416
- }
417
-
418
- , formatTime: function(hour, minute, second, meridian) {
419
- hour = hour < 10 ? '0' + hour : hour;
420
- minute = minute < 10 ? '0' + minute : minute;
421
- second = second < 10 ? '0' + second : second;
422
-
423
- return hour + ':' + minute + (this.showSeconds ? ':' + second : '') + (this.showMeridian ? ' ' + meridian : '');
424
- }
425
-
426
- , getTime: function() {
427
- return this.formatTime(this.hour, this.minute, this.second, this.meridian);
428
- }
429
-
430
- , setTime: function(time) {
431
- this.setValues(time);
432
- this.update();
433
- }
434
-
435
- , update: function() {
436
- this.updateElement();
437
- this.updateWidget();
438
- }
439
-
440
- , blurElement: function() {
441
- this.highlightedUnit = undefined;
442
- this.updateFromElementVal();
443
- }
444
-
445
- , updateElement: function() {
446
- var time = this.getTime();
447
-
448
- this.$element.val(time).change();
449
-
450
- switch (this.highlightedUnit) {
451
- case 'hour':
452
- this.highlightHour();
453
- break;
454
- case 'minute':
455
- this.highlightMinute();
456
- break;
457
- case 'second':
458
- this.highlightSecond();
459
- break;
460
- case 'meridian':
461
- this.highlightMeridian();
462
- break;
463
- }
464
- }
465
-
466
- , updateWidget: function() {
467
- if (this.showInputs) {
468
- this.$widget.find('input.bootstrap-timepicker-hour').val(this.hour < 10 ? '0' + this.hour : this.hour);
469
- this.$widget.find('input.bootstrap-timepicker-minute').val(this.minute < 10 ? '0' + this.minute : this.minute);
470
- if (this.showSeconds) {
471
- this.$widget.find('input.bootstrap-timepicker-second').val(this.second < 10 ? '0' + this.second : this.second);
472
- }
473
- if (this.showMeridian) {
474
- this.$widget.find('input.bootstrap-timepicker-meridian').val(this.meridian);
475
- }
476
- } else {
477
- this.$widget.find('span.bootstrap-timepicker-hour').text(this.hour);
478
- this.$widget.find('span.bootstrap-timepicker-minute').text(this.minute < 10 ? '0' + this.minute : this.minute);
479
- if (this.showSeconds) {
480
- this.$widget.find('span.bootstrap-timepicker-second').text(this.second < 10 ? '0' + this.second : this.second);
481
- }
482
- if (this.showMeridian) {
483
- this.$widget.find('span.bootstrap-timepicker-meridian').text(this.meridian);
484
- }
485
- }
486
- }
487
-
488
- , updateFromElementVal: function (e) {
489
- var time = this.$element.val();
490
- if (time) {
491
- this.setValues(time);
492
- this.updateWidget();
493
- }
494
- }
495
-
496
- , updateFromWidgetInputs: function () {
497
- var time = $('input.bootstrap-timepicker-hour', this.$widget).val() + ':' +
498
- $('input.bootstrap-timepicker-minute', this.$widget).val() +
499
- (this.showSeconds ?
500
- ':' + $('input.bootstrap-timepicker-second', this.$widget).val()
501
- : '') +
502
- (this.showMeridian ?
503
- ' ' + $('input.bootstrap-timepicker-meridian', this.$widget).val()
504
- : '');
505
-
506
- this.setValues(time);
507
- }
508
-
509
- , getCursorPosition: function() {
510
- var input = this.$element.get(0);
511
-
512
- if ('selectionStart' in input) {
513
- // Standard-compliant browsers
514
- return input.selectionStart;
515
- } else if (document.selection) {
516
- // IE fix
517
- input.focus();
518
- var sel = document.selection.createRange();
519
- var selLen = document.selection.createRange().text.length;
520
- sel.moveStart('character', - input.value.length);
521
-
522
- return sel.text.length - selLen;
523
- }
524
- }
525
-
526
- , highlightUnit: function () {
527
- var input = this.$element.get(0);
528
-
529
- this.position = this.getCursorPosition();
530
- if (this.position >= 0 && this.position <= 2) {
531
- this.highlightHour();
532
- } else if (this.position >= 3 && this.position <= 5) {
533
- this.highlightMinute();
534
- } else if (this.position >= 6 && this.position <= 8) {
535
- if (this.showSeconds) {
536
- this.highlightSecond();
537
- } else {
538
- this.highlightMeridian();
539
- }
540
- } else if (this.position >= 9 && this.position <= 11) {
541
- this.highlightMeridian();
542
- }
543
- }
544
-
545
- , highlightNextUnit: function() {
546
- switch (this.highlightedUnit) {
547
- case 'hour':
548
- this.highlightMinute();
549
- break;
550
- case 'minute':
551
- if (this.showSeconds) {
552
- this.highlightSecond();
553
- } else {
554
- this.highlightMeridian();
555
- }
556
- break;
557
- case 'second':
558
- this.highlightMeridian();
559
- break;
560
- case 'meridian':
561
- this.highlightHour();
562
- break;
563
- }
564
- }
565
-
566
- , highlightPrevUnit: function() {
567
- switch (this.highlightedUnit) {
568
- case 'hour':
569
- this.highlightMeridian();
570
- break;
571
- case 'minute':
572
- this.highlightHour();
573
- break;
574
- case 'second':
575
- this.highlightMinute();
576
- break;
577
- case 'meridian':
578
- if (this.showSeconds) {
579
- this.highlightSecond();
580
- } else {
581
- this.highlightMinute();
582
- }
583
- break;
584
- }
585
- }
586
-
587
- , highlightHour: function() {
588
- this.highlightedUnit = 'hour';
589
- this.$element.get(0).setSelectionRange(0,2);
590
- }
591
-
592
- , highlightMinute: function() {
593
- this.highlightedUnit = 'minute';
594
- this.$element.get(0).setSelectionRange(3,5);
595
- }
596
-
597
- , highlightSecond: function() {
598
- this.highlightedUnit = 'second';
599
- this.$element.get(0).setSelectionRange(6,8);
600
- }
601
-
602
- , highlightMeridian: function() {
603
- this.highlightedUnit = 'meridian';
604
- if (this.showSeconds) {
605
- this.$element.get(0).setSelectionRange(9,11);
606
- } else {
607
- this.$element.get(0).setSelectionRange(6,8);
608
- }
609
- }
610
-
611
- , incrementHour: function() {
612
- if (this.showMeridian) {
613
- if (this.hour === 11) {
614
- this.toggleMeridian();
615
- } else if (this.hour === 12) {
616
- return this.hour = 1;
617
- }
618
- }
619
- if (this.hour === 23) {
620
- return this.hour = 0;
621
- }
622
- this.hour = this.hour + 1;
623
- }
624
-
625
- , decrementHour: function() {
626
- if (this.showMeridian) {
627
- if (this.hour === 1) {
628
- return this.hour = 12;
629
- }
630
- else if (this.hour === 12) {
631
- this.toggleMeridian();
632
- }
633
- }
634
- if (this.hour === 0) {
635
- return this.hour = 23;
636
- }
637
- this.hour = this.hour - 1;
638
- }
639
-
640
- , incrementMinute: function() {
641
- var newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
642
- if (newVal > 59) {
643
- this.incrementHour();
644
- this.minute = newVal - 60;
645
- } else {
646
- this.minute = newVal;
647
- }
648
- }
649
-
650
- , decrementMinute: function() {
651
- var newVal = this.minute - this.minuteStep;
652
- if (newVal < 0) {
653
- this.decrementHour();
654
- this.minute = newVal + 60;
655
- } else {
656
- this.minute = newVal;
657
- }
658
- }
659
-
660
- , incrementSecond: function() {
661
- var newVal = this.second + this.secondStep - (this.second % this.secondStep);
662
- if (newVal > 59) {
663
- this.incrementMinute();
664
- this.second = newVal - 60;
665
- } else {
666
- this.second = newVal;
667
- }
668
- }
669
-
670
- , decrementSecond: function() {
671
- var newVal = this.second - this.secondStep;
672
- if (newVal < 0) {
673
- this.decrementMinute();
674
- this.second = newVal + 60;
675
- } else {
676
- this.second = newVal;
677
- }
678
- }
679
-
680
- , toggleMeridian: function() {
681
- this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
682
-
683
- this.update();
684
- }
685
-
686
- , getTemplate: function() {
687
- if (this.options.templates[this.options.template]) {
688
- return this.options.templates[this.options.template];
689
- }
690
- if (this.showInputs) {
691
- var hourTemplate = '<input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"/>';
692
- var minuteTemplate = '<input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"/>';
693
- var secondTemplate = '<input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"/>';
694
- var meridianTemplate = '<input type="text" name="meridian" class="bootstrap-timepicker-meridian" maxlength="2"/>';
695
- } else {
696
- var hourTemplate = '<span class="bootstrap-timepicker-hour"></span>';
697
- var minuteTemplate = '<span class="bootstrap-timepicker-minute"></span>';
698
- var secondTemplate = '<span class="bootstrap-timepicker-second"></span>';
699
- var meridianTemplate = '<span class="bootstrap-timepicker-meridian"></span>';
700
- }
701
- var templateContent = '<table class="'+ (this.showSeconds ? 'show-seconds' : '') +' '+ (this.showMeridian ? 'show-meridian' : '') +'">'+
702
- '<tr>'+
703
- '<td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td>'+
704
- '<td class="separator">&nbsp;</td>'+
705
- '<td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+
706
- (this.showSeconds ?
707
- '<td class="separator">&nbsp;</td>'+
708
- '<td><a href="#" data-action="incrementSecond"><i class="icon-chevron-up"></i></a></td>'
709
- : '') +
710
- (this.showMeridian ?
711
- '<td class="separator">&nbsp;</td>'+
712
- '<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>'
713
- : '') +
714
- '</tr>'+
715
- '<tr>'+
716
- '<td>'+ hourTemplate +'</td> '+
717
- '<td class="separator">:</td>'+
718
- '<td>'+ minuteTemplate +'</td> '+
719
- (this.showSeconds ?
720
- '<td class="separator">:</td>'+
721
- '<td>'+ secondTemplate +'</td>'
722
- : '') +
723
- (this.showMeridian ?
724
- '<td class="separator">&nbsp;</td>'+
725
- '<td>'+ meridianTemplate +'</td>'
726
- : '') +
727
- '</tr>'+
728
- '<tr>'+
729
- '<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
730
- '<td class="separator"></td>'+
731
- '<td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+
732
- (this.showSeconds ?
733
- '<td class="separator">&nbsp;</td>'+
734
- '<td><a href="#" data-action="decrementSecond"><i class="icon-chevron-down"></i></a></td>'
735
- : '') +
736
- (this.showMeridian ?
737
- '<td class="separator">&nbsp;</td>'+
738
- '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>'
739
- : '') +
740
- '</tr>'+
741
- '</table>';
742
-
743
- var template;
744
- switch(this.options.template) {
745
- case 'modal':
746
- template = '<div class="bootstrap-timepicker modal hide fade in" style="top: 30%; margin-top: 0; width: 200px; margin-left: -100px;" data-backdrop="'+ (this.modalBackdrop ? 'true' : 'false') +'">'+
747
- '<div class="modal-header">'+
748
- '<a href="#" class="close" data-dismiss="modal">×</a>'+
749
- '<h3>Pick a Time</h3>'+
750
- '</div>'+
751
- '<div class="modal-content">'+
752
- templateContent +
753
- '</div>'+
754
- '<div class="modal-footer">'+
755
- '<a href="#" class="btn btn-primary" data-dismiss="modal">Ok</a>'+
756
- '</div>'+
757
- '</div>';
758
-
759
- break;
760
- case 'dropdown':
761
- template = '<div class="bootstrap-timepicker dropdown-menu">'+
762
- templateContent +
763
- '</div>';
764
- break;
765
-
766
- }
767
- return template;
768
- }
769
- };
770
-
771
-
772
- /* TIMEPICKER PLUGIN DEFINITION
773
- * =========================== */
774
-
775
- $.fn.timepicker = function (option) {
776
- return this.each(function () {
777
- var $this = $(this)
778
- , data = $this.data('timepicker')
779
- , options = typeof option == 'object' && option;
780
- if (!data) {
781
- $this.data('timepicker', (data = new Timepicker(this, options)));
782
- }
783
- if (typeof option == 'string') {
784
- data[option]();
785
- }
786
- })
787
- }
788
-
789
- $.fn.timepicker.defaults = {
790
- minuteStep: 15
791
- , secondStep: 15
792
- , disableFocus: false
793
- , defaultTime: 'current'
794
- , showSeconds: false
795
- , showInputs: true
796
- , showMeridian: true
797
- , template: 'dropdown'
798
- , modalBackdrop: false
799
- , templates: {} // set custom templates
800
- }
801
-
802
- $.fn.timepicker.Constructor = Timepicker
803
- }(window.jQuery);