rmails 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/Gemfile +24 -0
  4. data/Gemfile.lock +167 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.markdown +9 -0
  7. data/Rakefile +31 -0
  8. data/Rakefile1 +9 -0
  9. data/Vagrantfile +51 -0
  10. data/app/assets/images/arrow_bottom.gif +0 -0
  11. data/app/assets/images/arrow_right.gif +0 -0
  12. data/app/assets/images/at-sign.png +0 -0
  13. data/app/assets/images/checkerboard.gif +0 -0
  14. data/app/assets/images/glyphicons-halflings-white.png +0 -0
  15. data/app/assets/images/glyphicons-halflings.png +0 -0
  16. data/app/assets/images/icon_draft.gif +0 -0
  17. data/app/assets/images/icon_layout.gif +0 -0
  18. data/app/assets/images/icon_move.gif +0 -0
  19. data/app/assets/images/icon_regular.gif +0 -0
  20. data/app/assets/images/icon_snippet.gif +0 -0
  21. data/app/assets/images/nav_arrow.png +0 -0
  22. data/app/assets/images/x.png +0 -0
  23. data/app/assets/javascripts/application.coffee.erb +27 -0
  24. data/app/assets/javascripts/canjs/can.construct.proxy.js +60 -0
  25. data/app/assets/javascripts/canjs/can.construct.super.js +44 -0
  26. data/app/assets/javascripts/canjs/can.control.plugin.js +245 -0
  27. data/app/assets/javascripts/canjs/can.control.view.js +88 -0
  28. data/app/assets/javascripts/canjs/can.dojo.js +3669 -0
  29. data/app/assets/javascripts/canjs/can.dojo.min.js +66 -0
  30. data/app/assets/javascripts/canjs/can.fixture.js +1020 -0
  31. data/app/assets/javascripts/canjs/can.jquery.js +2995 -0
  32. data/app/assets/javascripts/canjs/can.jquery.min.js +52 -0
  33. data/app/assets/javascripts/canjs/can.mootools.js +3462 -0
  34. data/app/assets/javascripts/canjs/can.mootools.min.js +63 -0
  35. data/app/assets/javascripts/canjs/can.observe.attributes.js +293 -0
  36. data/app/assets/javascripts/canjs/can.observe.backup.js +368 -0
  37. data/app/assets/javascripts/canjs/can.observe.delegate.js +359 -0
  38. data/app/assets/javascripts/canjs/can.observe.setter.js +58 -0
  39. data/app/assets/javascripts/canjs/can.observe.validations.js +374 -0
  40. data/app/assets/javascripts/canjs/can.view.modifiers.js +292 -0
  41. data/app/assets/javascripts/canjs/can.yui.js +3530 -0
  42. data/app/assets/javascripts/canjs/can.yui.min.js +65 -0
  43. data/app/assets/javascripts/canjs/can.zepto.js +3426 -0
  44. data/app/assets/javascripts/canjs/can.zepto.min.js +62 -0
  45. data/app/assets/javascripts/controls/admins.coffee.erb +105 -0
  46. data/app/assets/javascripts/controls/aliases.coffee.erb +91 -0
  47. data/app/assets/javascripts/controls/domains.coffee.erb +115 -0
  48. data/app/assets/javascripts/controls/settings.coffee.erb +47 -0
  49. data/app/assets/javascripts/controls/users.coffee.erb +94 -0
  50. data/app/assets/javascripts/lib/facebox.js +311 -0
  51. data/app/assets/javascripts/lib/html5.js +2 -0
  52. data/app/assets/javascripts/lib/jquery.js +9301 -0
  53. data/app/assets/javascripts/lib/jquery_formparams.js +108 -0
  54. data/app/assets/javascripts/lib/jquery_input_hint.js +20 -0
  55. data/app/assets/javascripts/lib/jquery_paginate.js +120 -0
  56. data/app/assets/javascripts/lib/jquery_ui_custom.js +6 -0
  57. data/app/assets/javascripts/lib/json2.js +487 -0
  58. data/app/assets/javascripts/lib/utils.coffee.erb +48 -0
  59. data/app/assets/javascripts/models/admin.coffee.erb +42 -0
  60. data/app/assets/javascripts/models/alias.coffee.erb +28 -0
  61. data/app/assets/javascripts/models/domain.coffee.erb +39 -0
  62. data/app/assets/javascripts/models/property.coffee.erb +18 -0
  63. data/app/assets/javascripts/models/user.coffee.erb +29 -0
  64. data/app/assets/stylesheets/application.sass +156 -0
  65. data/app/assets/stylesheets/base.css.sass +243 -0
  66. data/app/assets/stylesheets/facebox.css +80 -0
  67. data/app/assets/stylesheets/lib/bootstrap.css +9 -0
  68. data/app/assets/stylesheets/twitter/bootstrap-responsive.scss +1 -0
  69. data/app/assets/stylesheets/twitter/bootstrap.scss +63 -0
  70. data/app/assets/stylesheets/twitter/bootstrap/_accordion.scss +34 -0
  71. data/app/assets/stylesheets/twitter/bootstrap/_alerts.scss +79 -0
  72. data/app/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +24 -0
  73. data/app/assets/stylesheets/twitter/bootstrap/_button-groups.scss +229 -0
  74. data/app/assets/stylesheets/twitter/bootstrap/_buttons.scss +228 -0
  75. data/app/assets/stylesheets/twitter/bootstrap/_carousel.scss +158 -0
  76. data/app/assets/stylesheets/twitter/bootstrap/_close.scss +32 -0
  77. data/app/assets/stylesheets/twitter/bootstrap/_code.scss +61 -0
  78. data/app/assets/stylesheets/twitter/bootstrap/_component-animations.scss +22 -0
  79. data/app/assets/stylesheets/twitter/bootstrap/_dropdowns.scss +237 -0
  80. data/app/assets/stylesheets/twitter/bootstrap/_forms.scss +689 -0
  81. data/app/assets/stylesheets/twitter/bootstrap/_grid.scss +21 -0
  82. data/app/assets/stylesheets/twitter/bootstrap/_hero-unit.scss +25 -0
  83. data/app/assets/stylesheets/twitter/bootstrap/_labels-badges.scss +83 -0
  84. data/app/assets/stylesheets/twitter/bootstrap/_layouts.scss +16 -0
  85. data/app/assets/stylesheets/twitter/bootstrap/_media.scss +55 -0
  86. data/app/assets/stylesheets/twitter/bootstrap/_mixins.scss +690 -0
  87. data/app/assets/stylesheets/twitter/bootstrap/_modals.scss +95 -0
  88. data/app/assets/stylesheets/twitter/bootstrap/_navbar.scss +497 -0
  89. data/app/assets/stylesheets/twitter/bootstrap/_navs.scss +409 -0
  90. data/app/assets/stylesheets/twitter/bootstrap/_pager.scss +43 -0
  91. data/app/assets/stylesheets/twitter/bootstrap/_pagination.scss +123 -0
  92. data/app/assets/stylesheets/twitter/bootstrap/_popovers.scss +133 -0
  93. data/app/assets/stylesheets/twitter/bootstrap/_progress-bars.scss +122 -0
  94. data/app/assets/stylesheets/twitter/bootstrap/_reset.scss +216 -0
  95. data/app/assets/stylesheets/twitter/bootstrap/_responsive-1200px-min.scss +28 -0
  96. data/app/assets/stylesheets/twitter/bootstrap/_responsive-767px-max.scss +193 -0
  97. data/app/assets/stylesheets/twitter/bootstrap/_responsive-768px-979px.scss +19 -0
  98. data/app/assets/stylesheets/twitter/bootstrap/_responsive-navbar.scss +189 -0
  99. data/app/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +74 -0
  100. data/app/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +53 -0
  101. data/app/assets/stylesheets/twitter/bootstrap/_sprites.scss +197 -0
  102. data/app/assets/stylesheets/twitter/bootstrap/_tables.scss +235 -0
  103. data/app/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +53 -0
  104. data/app/assets/stylesheets/twitter/bootstrap/_tooltip.scss +70 -0
  105. data/app/assets/stylesheets/twitter/bootstrap/_type.scss +247 -0
  106. data/app/assets/stylesheets/twitter/bootstrap/_utilities.scss +45 -0
  107. data/app/assets/stylesheets/twitter/bootstrap/_variables.scss +301 -0
  108. data/app/assets/stylesheets/twitter/bootstrap/_wells.scss +29 -0
  109. data/app/assets/stylesheets/twitter/bootstrap/responsive.scss +48 -0
  110. data/app/controllers/admin_users_controller.rb +62 -0
  111. data/app/controllers/aliases_controller.rb +35 -0
  112. data/app/controllers/application_controller.rb +20 -0
  113. data/app/controllers/domains_controller.rb +48 -0
  114. data/app/controllers/server_controller.rb +28 -0
  115. data/app/controllers/users_controller.rb +35 -0
  116. data/app/helpers/admin_users_helper.rb +11 -0
  117. data/app/helpers/application_helper.rb +2 -0
  118. data/app/helpers/domains_helper.rb +25 -0
  119. data/app/helpers/server_helper.rb +30 -0
  120. data/app/mailers/.gitkeep +0 -0
  121. data/app/models/.gitkeep +0 -0
  122. data/app/models/admin_user.rb +54 -0
  123. data/app/models/certificate_manager.rb +46 -0
  124. data/app/models/property.rb +103 -0
  125. data/app/models/property/awstats.rb +15 -0
  126. data/app/models/property/dovecot.rb +61 -0
  127. data/app/models/property/dspam.rb +45 -0
  128. data/app/models/property/nginx.rb +47 -0
  129. data/app/models/property/postfix.rb +64 -0
  130. data/app/models/property_value_validator.rb +41 -0
  131. data/app/models/system_manager.rb +88 -0
  132. data/app/models/virtual_alias.rb +13 -0
  133. data/app/models/virtual_domain.rb +15 -0
  134. data/app/models/virtual_user.rb +51 -0
  135. data/app/views/admin_users/_form.html.haml +21 -0
  136. data/app/views/admin_users/first.html.haml +12 -0
  137. data/app/views/admin_users/index.html.haml +61 -0
  138. data/app/views/aliases/_form.html.haml +11 -0
  139. data/app/views/aliases/_list.html.haml +0 -0
  140. data/app/views/devise/confirmations/new.html.haml +9 -0
  141. data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
  142. data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
  143. data/app/views/devise/mailer/unlock_instructions.html.haml +5 -0
  144. data/app/views/devise/passwords/edit.html.haml +14 -0
  145. data/app/views/devise/passwords/new.html.haml +12 -0
  146. data/app/views/devise/registrations/edit.html.haml +18 -0
  147. data/app/views/devise/registrations/new.html.haml +10 -0
  148. data/app/views/devise/sessions/new.html.haml +16 -0
  149. data/app/views/devise/shared/_links.haml +17 -0
  150. data/app/views/devise/unlocks/new.html.haml +11 -0
  151. data/app/views/domains/_fields.html.haml +0 -0
  152. data/app/views/domains/_form.html.haml +7 -0
  153. data/app/views/domains/index.html.haml +133 -0
  154. data/app/views/domains/show.html.haml +1 -0
  155. data/app/views/layouts/_nav.html.haml +3 -0
  156. data/app/views/layouts/application.html.haml +29 -0
  157. data/app/views/server/_certificates.html.haml +10 -0
  158. data/app/views/server/_dovecot.html.haml +27 -0
  159. data/app/views/server/_dspam.html.haml +9 -0
  160. data/app/views/server/_postfix_info.html.haml +5 -0
  161. data/app/views/server/_postfix_test.html.haml +5 -0
  162. data/app/views/server/_status.html.haml +11 -0
  163. data/app/views/server/index.html.haml +36 -0
  164. data/app/views/users/_form.html.haml +11 -0
  165. data/app/views/users/_list.html.haml +0 -0
  166. data/bin/rmails +43 -0
  167. data/config.ru +4 -0
  168. data/config/application.rb +62 -0
  169. data/config/boot.rb +6 -0
  170. data/config/environment.rb +5 -0
  171. data/config/environments/development.rb +37 -0
  172. data/config/environments/production.rb +67 -0
  173. data/config/environments/test.rb +37 -0
  174. data/config/initializers/backtrace_silencers.rb +7 -0
  175. data/config/initializers/devise.rb +240 -0
  176. data/config/initializers/devise_encryptable.rb +37 -0
  177. data/config/initializers/devise_models.rb +86 -0
  178. data/config/initializers/inflections.rb +15 -0
  179. data/config/initializers/mime_types.rb +5 -0
  180. data/config/initializers/secret_token.rb +7 -0
  181. data/config/initializers/session_store.rb +8 -0
  182. data/config/initializers/simple_form.rb +142 -0
  183. data/config/initializers/simple_form_bootstrap.rb +45 -0
  184. data/config/initializers/wrap_parameters.rb +14 -0
  185. data/config/locales/cz.yml +45 -0
  186. data/config/locales/devise.cz.yml +47 -0
  187. data/config/locales/devise.en.yml +60 -0
  188. data/config/locales/en.yml +5 -0
  189. data/config/locales/server/cz.yml +14 -0
  190. data/config/locales/server/en.yml +7 -0
  191. data/config/locales/server/help/dovecot/cz.yml +21 -0
  192. data/config/locales/server/help/dovecot/en.yml +18 -0
  193. data/config/locales/server/help/dspam/cz.yml +10 -0
  194. data/config/locales/server/help/dspam/en.yml +4 -0
  195. data/config/locales/server/key/dovecot/cz.yml +23 -0
  196. data/config/locales/server/key/dovecot/en.yml +20 -0
  197. data/config/locales/server/key/dspam/cz.yml +10 -0
  198. data/config/locales/server/key/dspam/en.yml +4 -0
  199. data/config/locales/simple_form.en.yml +26 -0
  200. data/config/locales/views/admin_users/cz.yml +25 -0
  201. data/config/locales/views/admin_users/en.yml +5 -0
  202. data/config/locales/views/aliases/cz.yml +17 -0
  203. data/config/locales/views/aliases/en.yml +1 -0
  204. data/config/locales/views/devise/cz.yml +26 -0
  205. data/config/locales/views/devise/en.yml +13 -0
  206. data/config/locales/views/domains/cz.yml +15 -0
  207. data/config/locales/views/domains/en.yml +15 -0
  208. data/config/locales/views/server/cz.yml +19 -0
  209. data/config/locales/views/server/en.yml +3 -0
  210. data/config/locales/views/users/cz.yml +18 -0
  211. data/config/locales/views/users/en.yml +1 -0
  212. data/config/routes.rb +80 -0
  213. data/db/migrate/20121112201233_virtual_domain.rb +11 -0
  214. data/db/migrate/20121112201247_virtual_alias.rb +10 -0
  215. data/db/migrate/20121112201341_virtual_user.rb +34 -0
  216. data/db/migrate/20121112201359_create_admin_user.rb +30 -0
  217. data/db/migrate/20121112201411_server_configuration.rb +13 -0
  218. data/db/migrate/20130304083938_join_domains_users.rb +12 -0
  219. data/db/migrate/20130311214040_create_versions.rb +18 -0
  220. data/db/seeds.rb +45 -0
  221. data/lib/devise-encryptable.rb +1 -0
  222. data/lib/rmails.rb +5 -0
  223. data/lib/rmails/installer.rb +37 -0
  224. data/lib/rmails/version.rb +3 -0
  225. data/lib/tasks/.gitkeep +0 -0
  226. data/lib/templates/haml/scaffold/_form.html.haml +10 -0
  227. data/locals +0 -0
  228. data/log/.gitkeep +0 -0
  229. data/public/404.html +26 -0
  230. data/public/422.html +26 -0
  231. data/public/500.html +25 -0
  232. data/public/favicon.ico +0 -0
  233. data/public/fonts/London.eot +0 -0
  234. data/public/fonts/London.otf +0 -0
  235. data/public/fonts/London.woff +0 -0
  236. data/public/fonts/LondonBold.otf +0 -0
  237. data/public/robots.txt +5 -0
  238. data/rmails.gemspec +35 -0
  239. data/script/prepflog.pl +576 -0
  240. data/script/rails +6 -0
  241. data/system/config/automateit_env.rb +16 -0
  242. data/system/config/fields.yml +48 -0
  243. data/system/config/tags.yml +39 -0
  244. data/system/dist/README_AutomateIt_dist.txt +20 -0
  245. data/system/dist/amavis/spamassassin.cf.erb +85 -0
  246. data/system/dist/amavis/user.erb +33 -0
  247. data/system/dist/awstats/awstats.mail.conf.erb +41 -0
  248. data/system/dist/awstats/prepflog.pl +576 -0
  249. data/system/dist/dovecot/dovecot-sql.conf.ext.erb +14 -0
  250. data/system/dist/dovecot/dovecot.conf.erb +297 -0
  251. data/system/dist/dovecot/old_dovecot.conf.erb +63 -0
  252. data/system/dist/dspam/conf.erb +96 -0
  253. data/system/dist/dspam/pgsql.conf +33 -0
  254. data/system/dist/nginx/awstats.erb +17 -0
  255. data/system/dist/nginx/rmails.erb +40 -0
  256. data/system/dist/postfix/email2email.cf.erb +5 -0
  257. data/system/dist/postfix/main.cf.erb +118 -0
  258. data/system/dist/postfix/master.cf.erb +74 -0
  259. data/system/dist/postfix/sasl.conf.erb +3 -0
  260. data/system/dist/postfix/sender_login_maps.cf.erb +5 -0
  261. data/system/dist/postfix/virtual_alias_maps.cf.erb +5 -0
  262. data/system/dist/postfix/virtual_mailbox_domains.cf.erb +5 -0
  263. data/system/dist/postfix/virtual_mailbox_maps.cf.erb +5 -0
  264. data/system/dist/postgresql/postgresql.conf.erb +54 -0
  265. data/system/dist/rmails/Gemfile.1 +8 -0
  266. data/system/dist/rmails/Gemfile.2 +24 -0
  267. data/system/dist/rmails/database.yml.erb +15 -0
  268. data/system/dist/sudoers +37 -0
  269. data/system/lib/README_AutomateIt_lib.txt +22 -0
  270. data/system/lib/dkim_key.rb +9 -0
  271. data/system/lib/smtpd_key.rb +39 -0
  272. data/system/lib/ssl.rb +23 -0
  273. data/system/recipes/01_prepare_server.rb +84 -0
  274. data/system/recipes/02_setup_database.rb +65 -0
  275. data/system/recipes/03_setup_postfix.rb +124 -0
  276. data/system/recipes/04_setup_dovecot.rb +78 -0
  277. data/system/recipes/05_setup_nginx.rb +29 -0
  278. data/system/recipes/06_setup_dspam.rb +24 -0
  279. data/system/recipes/07_setup_amavis.rb +16 -0
  280. data/system/recipes/08_setup_spamassassin.rb +22 -0
  281. data/system/recipes/09_setup_awstats.rb +49 -0
  282. data/system/recipes/XX_start_services.rb +5 -0
  283. data/test/fixtures/.gitkeep +0 -0
  284. data/test/functional/.gitkeep +0 -0
  285. data/test/functional/aliases_controller_test.rb +7 -0
  286. data/test/functional/domains_controller_test.rb +7 -0
  287. data/test/functional/users_controller_test.rb +7 -0
  288. data/test/integration/.gitkeep +0 -0
  289. data/test/performance/browsing_test.rb +12 -0
  290. data/test/test_helper.rb +13 -0
  291. data/test/unit/.gitkeep +0 -0
  292. data/test/unit/helpers/aliases_helper_test.rb +4 -0
  293. data/test/unit/helpers/domains_helper_test.rb +4 -0
  294. data/test/unit/helpers/users_helper_test.rb +4 -0
  295. data/vendor/assets/javascripts/.gitkeep +0 -0
  296. data/vendor/assets/javascripts/canjs/can.construct.proxy.js +60 -0
  297. data/vendor/assets/javascripts/canjs/can.construct.super.js +44 -0
  298. data/vendor/assets/javascripts/canjs/can.control.plugin.js +245 -0
  299. data/vendor/assets/javascripts/canjs/can.control.view.js +88 -0
  300. data/vendor/assets/javascripts/canjs/can.dojo.js +3669 -0
  301. data/vendor/assets/javascripts/canjs/can.dojo.min.js +66 -0
  302. data/vendor/assets/javascripts/canjs/can.fixture.js +1020 -0
  303. data/vendor/assets/javascripts/canjs/can.jquery.js +2995 -0
  304. data/vendor/assets/javascripts/canjs/can.jquery.min.js +52 -0
  305. data/vendor/assets/javascripts/canjs/can.mootools.js +3462 -0
  306. data/vendor/assets/javascripts/canjs/can.mootools.min.js +63 -0
  307. data/vendor/assets/javascripts/canjs/can.observe.attributes.js +293 -0
  308. data/vendor/assets/javascripts/canjs/can.observe.backup.js +368 -0
  309. data/vendor/assets/javascripts/canjs/can.observe.delegate.js +359 -0
  310. data/vendor/assets/javascripts/canjs/can.observe.setter.js +58 -0
  311. data/vendor/assets/javascripts/canjs/can.observe.validations.js +374 -0
  312. data/vendor/assets/javascripts/canjs/can.view.modifiers.js +292 -0
  313. data/vendor/assets/javascripts/canjs/can.yui.js +3530 -0
  314. data/vendor/assets/javascripts/canjs/can.yui.min.js +65 -0
  315. data/vendor/assets/javascripts/canjs/can.zepto.js +3426 -0
  316. data/vendor/assets/javascripts/canjs/can.zepto.min.js +62 -0
  317. data/vendor/assets/javascripts/twitter/bootstrap-affix.js +104 -0
  318. data/vendor/assets/javascripts/twitter/bootstrap-alert.js +90 -0
  319. data/vendor/assets/javascripts/twitter/bootstrap-button.js +96 -0
  320. data/vendor/assets/javascripts/twitter/bootstrap-carousel.js +176 -0
  321. data/vendor/assets/javascripts/twitter/bootstrap-collapse.js +158 -0
  322. data/vendor/assets/javascripts/twitter/bootstrap-dropdown.js +150 -0
  323. data/vendor/assets/javascripts/twitter/bootstrap-modal.js +239 -0
  324. data/vendor/assets/javascripts/twitter/bootstrap-popover.js +103 -0
  325. data/vendor/assets/javascripts/twitter/bootstrap-scrollspy.js +151 -0
  326. data/vendor/assets/javascripts/twitter/bootstrap-tab.js +135 -0
  327. data/vendor/assets/javascripts/twitter/bootstrap-tooltip.js +275 -0
  328. data/vendor/assets/javascripts/twitter/bootstrap-transition.js +60 -0
  329. data/vendor/assets/javascripts/twitter/bootstrap-typeahead.js +300 -0
  330. data/vendor/assets/javascripts/twitter/my/bootstrap-typeahead.js +311 -0
  331. data/vendor/assets/stylesheets/.gitkeep +0 -0
  332. metadata +470 -0
@@ -0,0 +1,60 @@
1
+ /* ===================================================
2
+ * bootstrap-transition.js v2.1.1
3
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
4
+ * ===================================================
5
+ * Copyright 2012 Twitter, Inc.
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
+
21
+ !function ($) {
22
+
23
+ $(function () {
24
+
25
+ "use strict"; // jshint ;_;
26
+
27
+
28
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29
+ * ======================================================= */
30
+
31
+ $.support.transition = (function () {
32
+
33
+ var transitionEnd = (function () {
34
+
35
+ var el = document.createElement('bootstrap')
36
+ , transEndEventNames = {
37
+ 'WebkitTransition' : 'webkitTransitionEnd'
38
+ , 'MozTransition' : 'transitionend'
39
+ , 'OTransition' : 'oTransitionEnd otransitionend'
40
+ , 'transition' : 'transitionend'
41
+ }
42
+ , name
43
+
44
+ for (name in transEndEventNames){
45
+ if (el.style[name] !== undefined) {
46
+ return transEndEventNames[name]
47
+ }
48
+ }
49
+
50
+ }())
51
+
52
+ return transitionEnd && {
53
+ end: transitionEnd
54
+ }
55
+
56
+ })()
57
+
58
+ })
59
+
60
+ }(window.jQuery);
@@ -0,0 +1,300 @@
1
+ /* =============================================================
2
+ * bootstrap-typeahead.js v2.1.1
3
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
4
+ * =============================================================
5
+ * Copyright 2012 Twitter, Inc.
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
+
21
+ !function($){
22
+
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
27
+ * ================================= */
28
+
29
+ var Typeahead = function (element, options) {
30
+ this.$element = $(element)
31
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
32
+ this.matcher = this.options.matcher || this.matcher
33
+ this.sorter = this.options.sorter || this.sorter
34
+ this.highlighter = this.options.highlighter || this.highlighter
35
+ this.updater = this.options.updater || this.updater
36
+ this.$menu = $(this.options.menu).appendTo('body')
37
+ this.source = this.options.source
38
+ this.shown = false
39
+ this.listen()
40
+ }
41
+
42
+ Typeahead.prototype = {
43
+
44
+ constructor: Typeahead
45
+
46
+ , select: function () {
47
+ var val = this.$menu.find('.active').attr('data-value')
48
+ this.$element
49
+ .val(this.updater(val))
50
+ .change()
51
+ return this.hide()
52
+ }
53
+
54
+ , updater: function (item) {
55
+ return item
56
+ }
57
+
58
+ , show: function () {
59
+ var pos = $.extend({}, this.$element.offset(), {
60
+ height: this.$element[0].offsetHeight
61
+ })
62
+
63
+ this.$menu.css({
64
+ top: pos.top + pos.height
65
+ , left: pos.left
66
+ })
67
+
68
+ this.$menu.show()
69
+ this.shown = true
70
+ return this
71
+ }
72
+
73
+ , hide: function () {
74
+ this.$menu.hide()
75
+ this.shown = false
76
+ return this
77
+ }
78
+
79
+ , lookup: function (event) {
80
+ var items
81
+
82
+ this.query = this.$element.val()
83
+
84
+ if (!this.query || this.query.length < this.options.minLength) {
85
+ return this.shown ? this.hide() : this
86
+ }
87
+
88
+ items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
89
+
90
+ return items ? this.process(items) : this
91
+ }
92
+
93
+ , process: function (items) {
94
+ var that = this
95
+
96
+ items = $.grep(items, function (item) {
97
+ return that.matcher(item)
98
+ })
99
+
100
+ items = this.sorter(items)
101
+
102
+ if (!items.length) {
103
+ return this.shown ? this.hide() : this
104
+ }
105
+
106
+ return this.render(items.slice(0, this.options.items)).show()
107
+ }
108
+
109
+ , matcher: function (item) {
110
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
111
+ }
112
+
113
+ , sorter: function (items) {
114
+ var beginswith = []
115
+ , caseSensitive = []
116
+ , caseInsensitive = []
117
+ , item
118
+
119
+ while (item = items.shift()) {
120
+ if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
121
+ else if (~item.indexOf(this.query)) caseSensitive.push(item)
122
+ else caseInsensitive.push(item)
123
+ }
124
+
125
+ return beginswith.concat(caseSensitive, caseInsensitive)
126
+ }
127
+
128
+ , highlighter: function (item) {
129
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
130
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
131
+ return '<strong>' + match + '</strong>'
132
+ })
133
+ }
134
+
135
+ , render: function (items) {
136
+ var that = this
137
+
138
+ items = $(items).map(function (i, item) {
139
+ i = $(that.options.item).attr('data-value', item)
140
+ i.find('a').html(that.highlighter(item))
141
+ return i[0]
142
+ })
143
+
144
+ items.first().addClass('active')
145
+ this.$menu.html(items)
146
+ return this
147
+ }
148
+
149
+ , next: function (event) {
150
+ var active = this.$menu.find('.active').removeClass('active')
151
+ , next = active.next()
152
+
153
+ if (!next.length) {
154
+ next = $(this.$menu.find('li')[0])
155
+ }
156
+
157
+ next.addClass('active')
158
+ }
159
+
160
+ , prev: function (event) {
161
+ var active = this.$menu.find('.active').removeClass('active')
162
+ , prev = active.prev()
163
+
164
+ if (!prev.length) {
165
+ prev = this.$menu.find('li').last()
166
+ }
167
+
168
+ prev.addClass('active')
169
+ }
170
+
171
+ , listen: function () {
172
+ this.$element
173
+ .on('blur', $.proxy(this.blur, this))
174
+ .on('keypress', $.proxy(this.keypress, this))
175
+ .on('keyup', $.proxy(this.keyup, this))
176
+
177
+ if ($.browser.chrome || $.browser.webkit || $.browser.msie) {
178
+ this.$element.on('keydown', $.proxy(this.keydown, this))
179
+ }
180
+
181
+ this.$menu
182
+ .on('click', $.proxy(this.click, this))
183
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
184
+ }
185
+
186
+ , move: function (e) {
187
+ if (!this.shown) return
188
+
189
+ switch(e.keyCode) {
190
+ case 9: // tab
191
+ case 13: // enter
192
+ case 27: // escape
193
+ e.preventDefault()
194
+ break
195
+
196
+ case 38: // up arrow
197
+ e.preventDefault()
198
+ this.prev()
199
+ break
200
+
201
+ case 40: // down arrow
202
+ e.preventDefault()
203
+ this.next()
204
+ break
205
+ }
206
+
207
+ e.stopPropagation()
208
+ }
209
+
210
+ , keydown: function (e) {
211
+ this.suppressKeyPressRepeat = !~$.inArray(e.keyCode, [40,38,9,13,27])
212
+ this.move(e)
213
+ }
214
+
215
+ , keypress: function (e) {
216
+ if (this.suppressKeyPressRepeat) return
217
+ this.move(e)
218
+ }
219
+
220
+ , keyup: function (e) {
221
+ switch(e.keyCode) {
222
+ case 40: // down arrow
223
+ case 38: // up arrow
224
+ break
225
+
226
+ case 9: // tab
227
+ case 13: // enter
228
+ if (!this.shown) return
229
+ this.select()
230
+ break
231
+
232
+ case 27: // escape
233
+ if (!this.shown) return
234
+ this.hide()
235
+ break
236
+
237
+ default:
238
+ this.lookup()
239
+ }
240
+
241
+ e.stopPropagation()
242
+ e.preventDefault()
243
+ }
244
+
245
+ , blur: function (e) {
246
+ var that = this
247
+ setTimeout(function () { that.hide() }, 150)
248
+ }
249
+
250
+ , click: function (e) {
251
+ e.stopPropagation()
252
+ e.preventDefault()
253
+ this.select()
254
+ }
255
+
256
+ , mouseenter: function (e) {
257
+ this.$menu.find('.active').removeClass('active')
258
+ $(e.currentTarget).addClass('active')
259
+ }
260
+
261
+ }
262
+
263
+
264
+ /* TYPEAHEAD PLUGIN DEFINITION
265
+ * =========================== */
266
+
267
+ $.fn.typeahead = function (option) {
268
+ return this.each(function () {
269
+ var $this = $(this)
270
+ , data = $this.data('typeahead')
271
+ , options = typeof option == 'object' && option
272
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
273
+ if (typeof option == 'string') data[option]()
274
+ })
275
+ }
276
+
277
+ $.fn.typeahead.defaults = {
278
+ source: []
279
+ , items: 8
280
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
281
+ , item: '<li><a href="#"></a></li>'
282
+ , minLength: 1
283
+ }
284
+
285
+ $.fn.typeahead.Constructor = Typeahead
286
+
287
+
288
+ /* TYPEAHEAD DATA-API
289
+ * ================== */
290
+
291
+ $(function () {
292
+ $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
293
+ var $this = $(this)
294
+ if ($this.data('typeahead')) return
295
+ e.preventDefault()
296
+ $this.typeahead($this.data())
297
+ })
298
+ })
299
+
300
+ }(window.jQuery);
@@ -0,0 +1,311 @@
1
+ /* =============================================================
2
+ * bootstrap-typeahead.js v2.0.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
4
+ * =============================================================
5
+ * Copyright 2012 Twitter, Inc.
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
+ "use strict"
23
+
24
+ var Typeahead = function ( element, options ) {
25
+ this.$element = $(element)
26
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
27
+ this.matcher = this.options.matcher || this.matcher
28
+ this.sorter = this.options.sorter || this.sorter
29
+ this.highlighter = this.options.highlighter || this.highlighter
30
+ this.$menu = $(this.options.menu).appendTo('body')
31
+ this.source = this.options.source
32
+ this.onselect = this.options.onselect
33
+ this.strings = true
34
+ this.shown = false
35
+ this.listen()
36
+ }
37
+
38
+ Typeahead.prototype = {
39
+
40
+ constructor: Typeahead
41
+
42
+ , select: function () {
43
+ var val = JSON.parse(this.$menu.find('.active').attr('data-value'))
44
+ , text
45
+
46
+ if (!this.strings) text = val[this.options.property]
47
+ else text = val
48
+
49
+ this.$element.val(text)
50
+
51
+ if (typeof this.onselect == "function")
52
+ this.onselect(val)
53
+
54
+ return this.hide()
55
+ }
56
+
57
+ , show: function () {
58
+ var pos = $.extend({}, this.$element.offset(), {
59
+ height: this.$element[0].offsetHeight
60
+ })
61
+
62
+ this.$menu.css({
63
+ top: pos.top + pos.height
64
+ , left: pos.left
65
+ })
66
+
67
+ this.$menu.show()
68
+ this.shown = true
69
+ return this
70
+ }
71
+
72
+ , hide: function () {
73
+ this.$menu.hide()
74
+ this.shown = false
75
+ return this
76
+ }
77
+
78
+ , lookup: function (event) {
79
+ var that = this
80
+ , items
81
+ , q
82
+ , value
83
+
84
+ this.query = this.$element.val()
85
+
86
+ if (typeof this.source == "function") {
87
+ value = this.source(this, this.query)
88
+ if (value) this.process(value)
89
+ } else {
90
+ this.process(this.source)
91
+ }
92
+ }
93
+
94
+ , process: function (results) {
95
+ var that = this
96
+ , items
97
+ , q
98
+
99
+ if (results.length && typeof results[0] != "string")
100
+ this.strings = false
101
+
102
+ this.query = this.$element.val()
103
+
104
+ if (!this.query) {
105
+ return this.shown ? this.hide() : this
106
+ }
107
+
108
+ items = $.grep(results, function (item) {
109
+ if (!that.strings)
110
+ item = item[that.options.property]
111
+ if (that.matcher(item)) return item
112
+ })
113
+
114
+ items = this.sorter(items)
115
+
116
+ if (!items.length) {
117
+ return this.shown ? this.hide() : this
118
+ }
119
+
120
+ return this.render(items.slice(0, this.options.items)).show()
121
+ }
122
+
123
+ , matcher: function (item) {
124
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
125
+ }
126
+
127
+ , sorter: function (items) {
128
+ var beginswith = []
129
+ , caseSensitive = []
130
+ , caseInsensitive = []
131
+ , item
132
+ , sortby
133
+
134
+ while (item = items.shift()) {
135
+ if (this.strings) sortby = item
136
+ else sortby = item[this.options.property]
137
+
138
+ if (!sortby.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
139
+ else if (~sortby.indexOf(this.query)) caseSensitive.push(item)
140
+ else caseInsensitive.push(item)
141
+ }
142
+
143
+ return beginswith.concat(caseSensitive, caseInsensitive)
144
+ }
145
+
146
+ , highlighter: function (item) {
147
+ return item.replace(new RegExp('(' + this.query + ')', 'ig'), function ($1, match) {
148
+ return '<strong>' + match + '</strong>'
149
+ })
150
+ }
151
+
152
+ , render: function (items) {
153
+ var that = this
154
+
155
+ items = $(items).map(function (i, item) {
156
+ i = $(that.options.item).attr('data-value', JSON.stringify(item))
157
+ if (!that.strings)
158
+ item = item[that.options.property]
159
+ i.find('a').html(that.highlighter(item))
160
+ return i[0]
161
+ })
162
+
163
+ items.first().addClass('active')
164
+ this.$menu.html(items)
165
+ return this
166
+ }
167
+
168
+ , next: function (event) {
169
+ var active = this.$menu.find('.active').removeClass('active')
170
+ , next = active.next()
171
+
172
+ if (!next.length) {
173
+ next = $(this.$menu.find('li')[0])
174
+ }
175
+
176
+ next.addClass('active')
177
+ }
178
+
179
+ , prev: function (event) {
180
+ var active = this.$menu.find('.active').removeClass('active')
181
+ , prev = active.prev()
182
+
183
+ if (!prev.length) {
184
+ prev = this.$menu.find('li').last()
185
+ }
186
+
187
+ prev.addClass('active')
188
+ }
189
+
190
+ , listen: function () {
191
+ this.$element
192
+ .on('blur', $.proxy(this.blur, this))
193
+ .on('keypress', $.proxy(this.keypress, this))
194
+ .on('keyup', $.proxy(this.keyup, this))
195
+
196
+ if ($.browser.webkit || $.browser.msie) {
197
+ this.$element.on('keydown', $.proxy(this.keypress, this))
198
+ }
199
+
200
+ this.$menu
201
+ .on('click', $.proxy(this.click, this))
202
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
203
+ }
204
+
205
+ , keyup: function (e) {
206
+ e.stopPropagation()
207
+ e.preventDefault()
208
+
209
+ switch(e.keyCode) {
210
+ case 40: // down arrow
211
+ case 38: // up arrow
212
+ break
213
+
214
+ case 9: // tab
215
+ case 13: // enter
216
+ if (!this.shown) return
217
+ this.select()
218
+ break
219
+
220
+ case 27: // escape
221
+ this.hide()
222
+ break
223
+
224
+ default:
225
+ this.lookup()
226
+ }
227
+
228
+ }
229
+
230
+ , keypress: function (e) {
231
+ e.stopPropagation()
232
+ if (!this.shown) return
233
+
234
+ switch(e.keyCode) {
235
+ case 9: // tab
236
+ case 13: // enter
237
+ case 27: // escape
238
+ e.preventDefault()
239
+ break
240
+
241
+ case 38: // up arrow
242
+ e.preventDefault()
243
+ this.prev()
244
+ break
245
+
246
+ case 40: // down arrow
247
+ e.preventDefault()
248
+ this.next()
249
+ break
250
+ }
251
+ }
252
+
253
+ , blur: function (e) {
254
+ var that = this
255
+ e.stopPropagation()
256
+ e.preventDefault()
257
+ setTimeout(function () { that.hide() }, 150)
258
+ }
259
+
260
+ , click: function (e) {
261
+ e.stopPropagation()
262
+ e.preventDefault()
263
+ this.select()
264
+ }
265
+
266
+ , mouseenter: function (e) {
267
+ this.$menu.find('.active').removeClass('active')
268
+ $(e.currentTarget).addClass('active')
269
+ }
270
+
271
+ }
272
+
273
+
274
+ /* TYPEAHEAD PLUGIN DEFINITION
275
+ * =========================== */
276
+
277
+ $.fn.typeahead = function ( option ) {
278
+ return this.each(function () {
279
+ var $this = $(this)
280
+ , data = $this.data('typeahead')
281
+ , options = typeof option == 'object' && option
282
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
283
+ if (typeof option == 'string') data[option]()
284
+ })
285
+ }
286
+
287
+ $.fn.typeahead.defaults = {
288
+ source: []
289
+ , items: 8
290
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
291
+ , item: '<li><a href="#"></a></li>'
292
+ , onselect: null
293
+ , property: 'value'
294
+ }
295
+
296
+ $.fn.typeahead.Constructor = Typeahead
297
+
298
+
299
+ /* TYPEAHEAD DATA-API
300
+ * ================== */
301
+
302
+ $(function () {
303
+ $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
304
+ var $this = $(this)
305
+ if ($this.data('typeahead')) return
306
+ e.preventDefault()
307
+ $this.typeahead($this.data())
308
+ })
309
+ })
310
+
311
+ }( window.jQuery );