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,17 +0,0 @@
1
- //////////////////////////////////////////////////////////////////////////////////////////////////
2
- // COMPASS AND BOOTSTRAP
3
- //////////////////////////////////////////////////////////////////////////////////////////////////
4
- @import 'compass/css3';
5
- @import 'compass/utilities';
6
- @import 'vendors/bootstrap/css/bootstrap.min.css';
7
-
8
- //////////////////////////////////////////////////////////////////////////////////////////////////
9
- // COMMON
10
- //////////////////////////////////////////////////////////////////////////////////////////////////
11
- @import 'common/mixins';
12
- @import 'common/variables';
13
- @import 'common/bootstrap-overrides';
14
-
15
- //////////////////////////////////////////////////////////////////////////////////////////////////
16
- // BASE STYLES (AS FEW AS POSSIBLE)
17
- //////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1,6 +0,0 @@
1
- //= require vendors/jquery/jquery.tmpl.debug
2
- //= require vendors/jquery/jquery.inputHint
3
- //= require vendors/bootstrap/js/bootstrap.min
4
- //= require vendors/knockout/knockout.min
5
- //= require vendors/knockout/knockout.custom-handlers
6
- //= require vendors/underscore/underscore.debug
@@ -1,6 +0,0 @@
1
- //= require vendors/jquery/jquery.tmpl.debug
2
- //= require vendors/jquery/jquery.inputHint
3
- //= require vendors/bootstrap/js/bootstrap.min
4
- //= require vendors/knockout/knockout.min
5
- //= require vendors/knockout/knockout.custom-handlers
6
- //= require vendors/underscore/underscore.debug
@@ -1,6 +0,0 @@
1
- //= require vendors/jquery/jquery.tmpl.debug
2
- //= require vendors/jquery/jquery.inputHint
3
- //= require vendors/bootstrap/js/bootstrap.min
4
- //= require vendors/knockout/knockout.min
5
- //= require vendors/knockout/knockout.custom-handlers
6
- //= require vendors/underscore/underscore.debug
@@ -1,5 +0,0 @@
1
- //= require vendors/bootstrap/js/bootstrap.min
2
- //= require vendors/jquery/jquery.tmpl.debug
3
- //= require vendors/jquery/jquery.inputHint
4
- //= require vendors/knockout/knockout.min
5
- //= require vendors/knockout/knockout.custom-handlers
@@ -1 +0,0 @@
1
- //= require vendors/bootstrap/js/bootstrap.min
@@ -1,5 +0,0 @@
1
- //= require vendors/bootstrap/js/bootstrap.min
2
- //= require vendors/jquery/jquery.tmpl.debug
3
- //= require vendors/jquery/jquery.inputHint
4
- //= require vendors/knockout/knockout.min
5
- //= require vendors/knockout/knockout.custom-handlers
@@ -1,7 +0,0 @@
1
- /*
2
- Datepicker for Bootstrap
3
- Copyright 2012 Stefan Petre
4
- Licensed under the Apache License v2.0
5
- http://www.apache.org/licenses/LICENSE-2.0
6
- */
7
- .datepicker { top: 0; left: 0; padding: 4px; margin-top: 1px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; /*.dow { border-top: 1px solid #ddd !important; }*/ } .datepicker:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 6px; } .datepicker:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 7px; } .datepicker > div { display: none; } .datepicker table { width: 100%; margin: 0; } .datepicker td, .datepicker th { text-align: center; width: 20px; height: 20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td.day:hover { background: #eeeeee; cursor: pointer; } .datepicker td.old, .datepicker td.new { color: #999999; } .datepicker td.active, .datepicker td.active:hover { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active, .datepicker td.active.disabled, .datepicker td.active:hover.disabled, .datepicker td.active[disabled], .datepicker td.active:hover[disabled] { background-color: #0044cc; } .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active { background-color: #003399 \9; } .datepicker td span { display: block; width: 47px; height: 54px; line-height: 54px; float: left; margin: 2px; cursor: pointer; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td span:hover { background: #eeeeee; } .datepicker td span.active { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled] { background-color: #0044cc; } .datepicker td span.active:active, .datepicker td span.active.active { background-color: #003399 \9; } .datepicker td span.old { color: #999999; } .datepicker th.switch { width: 145px; } .datepicker th.next, .datepicker th.prev { font-size: 19.5px; } .datepicker thead tr:first-child th { cursor: pointer; } .datepicker thead tr:first-child th:hover { background: #eeeeee; } .input-append.date .add-on i, .input-prepend.date .add-on i { display: block; cursor: pointer; width: 16px; height: 16px; }
@@ -1,454 +0,0 @@
1
- /* =========================================================
2
- * bootstrap-datepicker.js
3
- * http://www.eyecon.ro/bootstrap-datepicker
4
- * =========================================================
5
- * Copyright 2012 Stefan Petre
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- * ========================================================= */
19
-
20
- !function( $ ) {
21
-
22
- // Picker object
23
-
24
- var Datepicker = function(element, options){
25
- this.element = $(element);
26
- this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
27
- this.picker = $(DPGlobal.template)
28
- .appendTo('body')
29
- .on({
30
- click: $.proxy(this.click, this),
31
- mousedown: $.proxy(this.mousedown, this)
32
- });
33
- this.isInput = this.element.is('input');
34
- this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
35
-
36
- if (this.isInput) {
37
- this.element.on({
38
- focus: $.proxy(this.show, this),
39
- blur: $.proxy(this.hide, this),
40
- keyup: $.proxy(this.update, this)
41
- });
42
- } else {
43
- if (this.component){
44
- this.component.on('click', $.proxy(this.show, this));
45
- } else {
46
- this.element.on('click', $.proxy(this.show, this));
47
- }
48
- }
49
- this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
50
- if (typeof this.minViewMode === 'string') {
51
- switch (this.minViewMode) {
52
- case 'months':
53
- this.minViewMode = 1;
54
- break;
55
- case 'years':
56
- this.minViewMode = 2;
57
- break;
58
- default:
59
- this.minViewMode = 0;
60
- break;
61
- }
62
- }
63
- this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
64
- if (typeof this.viewMode === 'string') {
65
- switch (this.viewMode) {
66
- case 'months':
67
- this.viewMode = 1;
68
- break;
69
- case 'years':
70
- this.viewMode = 2;
71
- break;
72
- default:
73
- this.viewMode = 0;
74
- break;
75
- }
76
- }
77
- this.startViewMode = this.viewMode;
78
- this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
79
- this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
80
- this.fillDow();
81
- this.fillMonths();
82
- this.update();
83
- this.showMode();
84
- };
85
-
86
- Datepicker.prototype = {
87
- constructor: Datepicker,
88
-
89
- show: function(e) {
90
- this.picker.show();
91
- this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
92
- this.place();
93
- $(window).on('resize', $.proxy(this.place, this));
94
- if (e ) {
95
- e.stopPropagation();
96
- e.preventDefault();
97
- }
98
- if (!this.isInput) {
99
- $(document).on('mousedown', $.proxy(this.hide, this));
100
- }
101
- this.element.trigger({
102
- type: 'show',
103
- date: this.date
104
- });
105
- },
106
-
107
- hide: function(){
108
- this.picker.hide();
109
- $(window).off('resize', this.place);
110
- this.viewMode = this.startViewMode;
111
- this.showMode();
112
- if (!this.isInput) {
113
- $(document).off('mousedown', this.hide);
114
- }
115
- this.set();
116
- this.element.trigger({
117
- type: 'hide',
118
- date: this.date
119
- });
120
- },
121
-
122
- set: function() {
123
- var formated = DPGlobal.formatDate(this.date, this.format);
124
- if (!this.isInput) {
125
- if (this.component){
126
- this.element.find('input').prop('value', formated);
127
- }
128
- this.element.data('date', formated);
129
- } else {
130
- this.element.prop('value', formated);
131
- }
132
- },
133
-
134
- setValue: function(newDate) {
135
- if (typeof newDate === 'string') {
136
- this.date = DPGlobal.parseDate(newDate, this.format);
137
- } else {
138
- this.date = new Date(newDate);
139
- }
140
- this.set();
141
- this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
142
- this.fill();
143
- },
144
-
145
- place: function(){
146
- var offset = this.component ? this.component.offset() : this.element.offset();
147
- this.picker.css({
148
- top: offset.top + this.height,
149
- left: offset.left
150
- });
151
- },
152
-
153
- update: function(newDate){
154
- this.date = DPGlobal.parseDate(
155
- typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
156
- this.format
157
- );
158
- this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
159
- this.fill();
160
- },
161
-
162
- fillDow: function(){
163
- var dowCnt = this.weekStart;
164
- var html = '<tr>';
165
- while (dowCnt < this.weekStart + 7) {
166
- html += '<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+'</th>';
167
- }
168
- html += '</tr>';
169
- this.picker.find('.datepicker-days thead').append(html);
170
- },
171
-
172
- fillMonths: function(){
173
- var html = '';
174
- var i = 0
175
- while (i < 12) {
176
- html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
177
- }
178
- this.picker.find('.datepicker-months td').append(html);
179
- },
180
-
181
- fill: function() {
182
- var d = new Date(this.viewDate),
183
- year = d.getFullYear(),
184
- month = d.getMonth(),
185
- currentDate = this.date.valueOf();
186
- this.picker.find('.datepicker-days th:eq(1)')
187
- .text(DPGlobal.dates.months[month]+' '+year);
188
- var prevMonth = new Date(year, month-1, 28,0,0,0,0),
189
- day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
190
- prevMonth.setDate(day);
191
- prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
192
- var nextMonth = new Date(prevMonth);
193
- nextMonth.setDate(nextMonth.getDate() + 42);
194
- nextMonth = nextMonth.valueOf();
195
- html = [];
196
- var clsName;
197
- while(prevMonth.valueOf() < nextMonth) {
198
- if (prevMonth.getDay() === this.weekStart) {
199
- html.push('<tr>');
200
- }
201
- clsName = '';
202
- if (prevMonth.getMonth() < month) {
203
- clsName += ' old';
204
- } else if (prevMonth.getMonth() > month) {
205
- clsName += ' new';
206
- }
207
- if (prevMonth.valueOf() === currentDate) {
208
- clsName += ' active';
209
- }
210
- html.push('<td class="day'+clsName+'">'+prevMonth.getDate() + '</td>');
211
- if (prevMonth.getDay() === this.weekEnd) {
212
- html.push('</tr>');
213
- }
214
- prevMonth.setDate(prevMonth.getDate()+1);
215
- }
216
- this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
217
- var currentYear = this.date.getFullYear();
218
-
219
- var months = this.picker.find('.datepicker-months')
220
- .find('th:eq(1)')
221
- .text(year)
222
- .end()
223
- .find('span').removeClass('active');
224
- if (currentYear === year) {
225
- months.eq(this.date.getMonth()).addClass('active');
226
- }
227
-
228
- html = '';
229
- year = parseInt(year/10, 10) * 10;
230
- var yearCont = this.picker.find('.datepicker-years')
231
- .find('th:eq(1)')
232
- .text(year + '-' + (year + 9))
233
- .end()
234
- .find('td');
235
- year -= 1;
236
- for (var i = -1; i < 11; i++) {
237
- html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
238
- year += 1;
239
- }
240
- yearCont.html(html);
241
- },
242
-
243
- click: function(e) {
244
- e.stopPropagation();
245
- e.preventDefault();
246
- var target = $(e.target).closest('span, td, th');
247
- if (target.length === 1) {
248
- switch(target[0].nodeName.toLowerCase()) {
249
- case 'th':
250
- switch(target[0].className) {
251
- case 'switch':
252
- this.showMode(1);
253
- break;
254
- case 'prev':
255
- case 'next':
256
- this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
257
- this.viewDate,
258
- this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
259
- DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
260
- );
261
- this.fill();
262
- this.set();
263
- break;
264
- }
265
- break;
266
- case 'span':
267
- if (target.is('.month')) {
268
- var month = target.parent().find('span').index(target);
269
- this.viewDate.setMonth(month);
270
- } else {
271
- var year = parseInt(target.text(), 10)||0;
272
- this.viewDate.setFullYear(year);
273
- }
274
- if (this.viewMode !== 0) {
275
- this.date = new Date(this.viewDate);
276
- this.element.trigger({
277
- type: 'changeDate',
278
- date: this.date,
279
- viewMode: DPGlobal.modes[this.viewMode].clsName
280
- });
281
- }
282
- this.showMode(-1);
283
- this.fill();
284
- this.set();
285
- break;
286
- case 'td':
287
- if (target.is('.day')){
288
- var day = parseInt(target.text(), 10)||1;
289
- var month = this.viewDate.getMonth();
290
- if (target.is('.old')) {
291
- month -= 1;
292
- } else if (target.is('.new')) {
293
- month += 1;
294
- }
295
- var year = this.viewDate.getFullYear();
296
- this.date = new Date(year, month, day,0,0,0,0);
297
- this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
298
- this.fill();
299
- this.set();
300
- this.element.trigger({
301
- type: 'changeDate',
302
- date: this.date,
303
- viewMode: DPGlobal.modes[this.viewMode].clsName
304
- });
305
- }
306
- break;
307
- }
308
- }
309
- },
310
-
311
- mousedown: function(e){
312
- e.stopPropagation();
313
- e.preventDefault();
314
- },
315
-
316
- showMode: function(dir) {
317
- if (dir) {
318
- this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
319
- }
320
- this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
321
- }
322
- };
323
-
324
- $.fn.datepicker = function ( option, val ) {
325
- return this.each(function () {
326
- var $this = $(this),
327
- data = $this.data('datepicker'),
328
- options = typeof option === 'object' && option;
329
- if (!data) {
330
- $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
331
- }
332
- if (typeof option === 'string') data[option](val);
333
- });
334
- };
335
-
336
- $.fn.datepicker.defaults = {
337
- };
338
- $.fn.datepicker.Constructor = Datepicker;
339
-
340
- var DPGlobal = {
341
- modes: [
342
- {
343
- clsName: 'days',
344
- navFnc: 'Month',
345
- navStep: 1
346
- },
347
- {
348
- clsName: 'months',
349
- navFnc: 'FullYear',
350
- navStep: 1
351
- },
352
- {
353
- clsName: 'years',
354
- navFnc: 'FullYear',
355
- navStep: 10
356
- }],
357
- dates:{
358
- days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
359
- daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
360
- daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
361
- months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
362
- monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
363
- },
364
- isLeapYear: function (year) {
365
- return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
366
- },
367
- getDaysInMonth: function (year, month) {
368
- return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
369
- },
370
- parseFormat: function(format){
371
- var separator = format.match(/[.\/\-\s].*?/),
372
- parts = format.split(/\W+/);
373
- if (!separator || !parts || parts.length === 0){
374
- throw new Error("Invalid date format.");
375
- }
376
- return {separator: separator, parts: parts};
377
- },
378
- parseDate: function(date, format) {
379
- var parts = date.split(format.separator),
380
- date = new Date(),
381
- val;
382
- date.setHours(0);
383
- date.setMinutes(0);
384
- date.setSeconds(0);
385
- date.setMilliseconds(0);
386
- if (parts.length === format.parts.length) {
387
- for (var i=0, cnt = format.parts.length; i < cnt; i++) {
388
- val = parseInt(parts[i], 10)||1;
389
- switch(format.parts[i]) {
390
- case 'dd':
391
- case 'd':
392
- date.setDate(val);
393
- break;
394
- case 'mm':
395
- case 'm':
396
- date.setMonth(val - 1);
397
- break;
398
- case 'yy':
399
- date.setFullYear(2000 + val);
400
- break;
401
- case 'yyyy':
402
- date.setFullYear(val);
403
- break;
404
- }
405
- }
406
- }
407
- return date;
408
- },
409
- formatDate: function(date, format){
410
- var val = {
411
- d: date.getDate(),
412
- m: date.getMonth() + 1,
413
- yy: date.getFullYear().toString().substring(2),
414
- yyyy: date.getFullYear()
415
- };
416
- val.dd = (val.d < 10 ? '0' : '') + val.d;
417
- val.mm = (val.m < 10 ? '0' : '') + val.m;
418
- var date = [];
419
- for (var i=0, cnt = format.parts.length; i < cnt; i++) {
420
- date.push(val[format.parts[i]]);
421
- }
422
- return date.join(format.separator);
423
- },
424
- headTemplate: '<thead>'+
425
- '<tr>'+
426
- '<th class="prev">&lsaquo;</th>'+
427
- '<th colspan="5" class="switch"></th>'+
428
- '<th class="next">&rsaquo;</th>'+
429
- '</tr>'+
430
- '</thead>',
431
- contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
432
- };
433
- DPGlobal.template = '<div class="datepicker dropdown-menu">'+
434
- '<div class="datepicker-days">'+
435
- '<table class=" table-condensed">'+
436
- DPGlobal.headTemplate+
437
- '<tbody></tbody>'+
438
- '</table>'+
439
- '</div>'+
440
- '<div class="datepicker-months">'+
441
- '<table class="table-condensed">'+
442
- DPGlobal.headTemplate+
443
- DPGlobal.contTemplate+
444
- '</table>'+
445
- '</div>'+
446
- '<div class="datepicker-years">'+
447
- '<table class="table-condensed">'+
448
- DPGlobal.headTemplate+
449
- DPGlobal.contTemplate+
450
- '</table>'+
451
- '</div>'+
452
- '</div>';
453
-
454
- }( window.jQuery )