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.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +167 -0
- data/LICENSE.txt +20 -0
- data/README.markdown +9 -0
- data/Rakefile +31 -0
- data/Rakefile1 +9 -0
- data/Vagrantfile +51 -0
- data/app/assets/images/arrow_bottom.gif +0 -0
- data/app/assets/images/arrow_right.gif +0 -0
- data/app/assets/images/at-sign.png +0 -0
- data/app/assets/images/checkerboard.gif +0 -0
- data/app/assets/images/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/glyphicons-halflings.png +0 -0
- data/app/assets/images/icon_draft.gif +0 -0
- data/app/assets/images/icon_layout.gif +0 -0
- data/app/assets/images/icon_move.gif +0 -0
- data/app/assets/images/icon_regular.gif +0 -0
- data/app/assets/images/icon_snippet.gif +0 -0
- data/app/assets/images/nav_arrow.png +0 -0
- data/app/assets/images/x.png +0 -0
- data/app/assets/javascripts/application.coffee.erb +27 -0
- data/app/assets/javascripts/canjs/can.construct.proxy.js +60 -0
- data/app/assets/javascripts/canjs/can.construct.super.js +44 -0
- data/app/assets/javascripts/canjs/can.control.plugin.js +245 -0
- data/app/assets/javascripts/canjs/can.control.view.js +88 -0
- data/app/assets/javascripts/canjs/can.dojo.js +3669 -0
- data/app/assets/javascripts/canjs/can.dojo.min.js +66 -0
- data/app/assets/javascripts/canjs/can.fixture.js +1020 -0
- data/app/assets/javascripts/canjs/can.jquery.js +2995 -0
- data/app/assets/javascripts/canjs/can.jquery.min.js +52 -0
- data/app/assets/javascripts/canjs/can.mootools.js +3462 -0
- data/app/assets/javascripts/canjs/can.mootools.min.js +63 -0
- data/app/assets/javascripts/canjs/can.observe.attributes.js +293 -0
- data/app/assets/javascripts/canjs/can.observe.backup.js +368 -0
- data/app/assets/javascripts/canjs/can.observe.delegate.js +359 -0
- data/app/assets/javascripts/canjs/can.observe.setter.js +58 -0
- data/app/assets/javascripts/canjs/can.observe.validations.js +374 -0
- data/app/assets/javascripts/canjs/can.view.modifiers.js +292 -0
- data/app/assets/javascripts/canjs/can.yui.js +3530 -0
- data/app/assets/javascripts/canjs/can.yui.min.js +65 -0
- data/app/assets/javascripts/canjs/can.zepto.js +3426 -0
- data/app/assets/javascripts/canjs/can.zepto.min.js +62 -0
- data/app/assets/javascripts/controls/admins.coffee.erb +105 -0
- data/app/assets/javascripts/controls/aliases.coffee.erb +91 -0
- data/app/assets/javascripts/controls/domains.coffee.erb +115 -0
- data/app/assets/javascripts/controls/settings.coffee.erb +47 -0
- data/app/assets/javascripts/controls/users.coffee.erb +94 -0
- data/app/assets/javascripts/lib/facebox.js +311 -0
- data/app/assets/javascripts/lib/html5.js +2 -0
- data/app/assets/javascripts/lib/jquery.js +9301 -0
- data/app/assets/javascripts/lib/jquery_formparams.js +108 -0
- data/app/assets/javascripts/lib/jquery_input_hint.js +20 -0
- data/app/assets/javascripts/lib/jquery_paginate.js +120 -0
- data/app/assets/javascripts/lib/jquery_ui_custom.js +6 -0
- data/app/assets/javascripts/lib/json2.js +487 -0
- data/app/assets/javascripts/lib/utils.coffee.erb +48 -0
- data/app/assets/javascripts/models/admin.coffee.erb +42 -0
- data/app/assets/javascripts/models/alias.coffee.erb +28 -0
- data/app/assets/javascripts/models/domain.coffee.erb +39 -0
- data/app/assets/javascripts/models/property.coffee.erb +18 -0
- data/app/assets/javascripts/models/user.coffee.erb +29 -0
- data/app/assets/stylesheets/application.sass +156 -0
- data/app/assets/stylesheets/base.css.sass +243 -0
- data/app/assets/stylesheets/facebox.css +80 -0
- data/app/assets/stylesheets/lib/bootstrap.css +9 -0
- data/app/assets/stylesheets/twitter/bootstrap-responsive.scss +1 -0
- data/app/assets/stylesheets/twitter/bootstrap.scss +63 -0
- data/app/assets/stylesheets/twitter/bootstrap/_accordion.scss +34 -0
- data/app/assets/stylesheets/twitter/bootstrap/_alerts.scss +79 -0
- data/app/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +24 -0
- data/app/assets/stylesheets/twitter/bootstrap/_button-groups.scss +229 -0
- data/app/assets/stylesheets/twitter/bootstrap/_buttons.scss +228 -0
- data/app/assets/stylesheets/twitter/bootstrap/_carousel.scss +158 -0
- data/app/assets/stylesheets/twitter/bootstrap/_close.scss +32 -0
- data/app/assets/stylesheets/twitter/bootstrap/_code.scss +61 -0
- data/app/assets/stylesheets/twitter/bootstrap/_component-animations.scss +22 -0
- data/app/assets/stylesheets/twitter/bootstrap/_dropdowns.scss +237 -0
- data/app/assets/stylesheets/twitter/bootstrap/_forms.scss +689 -0
- data/app/assets/stylesheets/twitter/bootstrap/_grid.scss +21 -0
- data/app/assets/stylesheets/twitter/bootstrap/_hero-unit.scss +25 -0
- data/app/assets/stylesheets/twitter/bootstrap/_labels-badges.scss +83 -0
- data/app/assets/stylesheets/twitter/bootstrap/_layouts.scss +16 -0
- data/app/assets/stylesheets/twitter/bootstrap/_media.scss +55 -0
- data/app/assets/stylesheets/twitter/bootstrap/_mixins.scss +690 -0
- data/app/assets/stylesheets/twitter/bootstrap/_modals.scss +95 -0
- data/app/assets/stylesheets/twitter/bootstrap/_navbar.scss +497 -0
- data/app/assets/stylesheets/twitter/bootstrap/_navs.scss +409 -0
- data/app/assets/stylesheets/twitter/bootstrap/_pager.scss +43 -0
- data/app/assets/stylesheets/twitter/bootstrap/_pagination.scss +123 -0
- data/app/assets/stylesheets/twitter/bootstrap/_popovers.scss +133 -0
- data/app/assets/stylesheets/twitter/bootstrap/_progress-bars.scss +122 -0
- data/app/assets/stylesheets/twitter/bootstrap/_reset.scss +216 -0
- data/app/assets/stylesheets/twitter/bootstrap/_responsive-1200px-min.scss +28 -0
- data/app/assets/stylesheets/twitter/bootstrap/_responsive-767px-max.scss +193 -0
- data/app/assets/stylesheets/twitter/bootstrap/_responsive-768px-979px.scss +19 -0
- data/app/assets/stylesheets/twitter/bootstrap/_responsive-navbar.scss +189 -0
- data/app/assets/stylesheets/twitter/bootstrap/_responsive-utilities.scss +74 -0
- data/app/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +53 -0
- data/app/assets/stylesheets/twitter/bootstrap/_sprites.scss +197 -0
- data/app/assets/stylesheets/twitter/bootstrap/_tables.scss +235 -0
- data/app/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +53 -0
- data/app/assets/stylesheets/twitter/bootstrap/_tooltip.scss +70 -0
- data/app/assets/stylesheets/twitter/bootstrap/_type.scss +247 -0
- data/app/assets/stylesheets/twitter/bootstrap/_utilities.scss +45 -0
- data/app/assets/stylesheets/twitter/bootstrap/_variables.scss +301 -0
- data/app/assets/stylesheets/twitter/bootstrap/_wells.scss +29 -0
- data/app/assets/stylesheets/twitter/bootstrap/responsive.scss +48 -0
- data/app/controllers/admin_users_controller.rb +62 -0
- data/app/controllers/aliases_controller.rb +35 -0
- data/app/controllers/application_controller.rb +20 -0
- data/app/controllers/domains_controller.rb +48 -0
- data/app/controllers/server_controller.rb +28 -0
- data/app/controllers/users_controller.rb +35 -0
- data/app/helpers/admin_users_helper.rb +11 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/domains_helper.rb +25 -0
- data/app/helpers/server_helper.rb +30 -0
- data/app/mailers/.gitkeep +0 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/admin_user.rb +54 -0
- data/app/models/certificate_manager.rb +46 -0
- data/app/models/property.rb +103 -0
- data/app/models/property/awstats.rb +15 -0
- data/app/models/property/dovecot.rb +61 -0
- data/app/models/property/dspam.rb +45 -0
- data/app/models/property/nginx.rb +47 -0
- data/app/models/property/postfix.rb +64 -0
- data/app/models/property_value_validator.rb +41 -0
- data/app/models/system_manager.rb +88 -0
- data/app/models/virtual_alias.rb +13 -0
- data/app/models/virtual_domain.rb +15 -0
- data/app/models/virtual_user.rb +51 -0
- data/app/views/admin_users/_form.html.haml +21 -0
- data/app/views/admin_users/first.html.haml +12 -0
- data/app/views/admin_users/index.html.haml +61 -0
- data/app/views/aliases/_form.html.haml +11 -0
- data/app/views/aliases/_list.html.haml +0 -0
- data/app/views/devise/confirmations/new.html.haml +9 -0
- data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/devise/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/devise/passwords/edit.html.haml +14 -0
- data/app/views/devise/passwords/new.html.haml +12 -0
- data/app/views/devise/registrations/edit.html.haml +18 -0
- data/app/views/devise/registrations/new.html.haml +10 -0
- data/app/views/devise/sessions/new.html.haml +16 -0
- data/app/views/devise/shared/_links.haml +17 -0
- data/app/views/devise/unlocks/new.html.haml +11 -0
- data/app/views/domains/_fields.html.haml +0 -0
- data/app/views/domains/_form.html.haml +7 -0
- data/app/views/domains/index.html.haml +133 -0
- data/app/views/domains/show.html.haml +1 -0
- data/app/views/layouts/_nav.html.haml +3 -0
- data/app/views/layouts/application.html.haml +29 -0
- data/app/views/server/_certificates.html.haml +10 -0
- data/app/views/server/_dovecot.html.haml +27 -0
- data/app/views/server/_dspam.html.haml +9 -0
- data/app/views/server/_postfix_info.html.haml +5 -0
- data/app/views/server/_postfix_test.html.haml +5 -0
- data/app/views/server/_status.html.haml +11 -0
- data/app/views/server/index.html.haml +36 -0
- data/app/views/users/_form.html.haml +11 -0
- data/app/views/users/_list.html.haml +0 -0
- data/bin/rmails +43 -0
- data/config.ru +4 -0
- data/config/application.rb +62 -0
- data/config/boot.rb +6 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +37 -0
- data/config/environments/production.rb +67 -0
- data/config/environments/test.rb +37 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/devise.rb +240 -0
- data/config/initializers/devise_encryptable.rb +37 -0
- data/config/initializers/devise_models.rb +86 -0
- data/config/initializers/inflections.rb +15 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/simple_form.rb +142 -0
- data/config/initializers/simple_form_bootstrap.rb +45 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/cz.yml +45 -0
- data/config/locales/devise.cz.yml +47 -0
- data/config/locales/devise.en.yml +60 -0
- data/config/locales/en.yml +5 -0
- data/config/locales/server/cz.yml +14 -0
- data/config/locales/server/en.yml +7 -0
- data/config/locales/server/help/dovecot/cz.yml +21 -0
- data/config/locales/server/help/dovecot/en.yml +18 -0
- data/config/locales/server/help/dspam/cz.yml +10 -0
- data/config/locales/server/help/dspam/en.yml +4 -0
- data/config/locales/server/key/dovecot/cz.yml +23 -0
- data/config/locales/server/key/dovecot/en.yml +20 -0
- data/config/locales/server/key/dspam/cz.yml +10 -0
- data/config/locales/server/key/dspam/en.yml +4 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/locales/views/admin_users/cz.yml +25 -0
- data/config/locales/views/admin_users/en.yml +5 -0
- data/config/locales/views/aliases/cz.yml +17 -0
- data/config/locales/views/aliases/en.yml +1 -0
- data/config/locales/views/devise/cz.yml +26 -0
- data/config/locales/views/devise/en.yml +13 -0
- data/config/locales/views/domains/cz.yml +15 -0
- data/config/locales/views/domains/en.yml +15 -0
- data/config/locales/views/server/cz.yml +19 -0
- data/config/locales/views/server/en.yml +3 -0
- data/config/locales/views/users/cz.yml +18 -0
- data/config/locales/views/users/en.yml +1 -0
- data/config/routes.rb +80 -0
- data/db/migrate/20121112201233_virtual_domain.rb +11 -0
- data/db/migrate/20121112201247_virtual_alias.rb +10 -0
- data/db/migrate/20121112201341_virtual_user.rb +34 -0
- data/db/migrate/20121112201359_create_admin_user.rb +30 -0
- data/db/migrate/20121112201411_server_configuration.rb +13 -0
- data/db/migrate/20130304083938_join_domains_users.rb +12 -0
- data/db/migrate/20130311214040_create_versions.rb +18 -0
- data/db/seeds.rb +45 -0
- data/lib/devise-encryptable.rb +1 -0
- data/lib/rmails.rb +5 -0
- data/lib/rmails/installer.rb +37 -0
- data/lib/rmails/version.rb +3 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/templates/haml/scaffold/_form.html.haml +10 -0
- data/locals +0 -0
- data/log/.gitkeep +0 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +25 -0
- data/public/favicon.ico +0 -0
- data/public/fonts/London.eot +0 -0
- data/public/fonts/London.otf +0 -0
- data/public/fonts/London.woff +0 -0
- data/public/fonts/LondonBold.otf +0 -0
- data/public/robots.txt +5 -0
- data/rmails.gemspec +35 -0
- data/script/prepflog.pl +576 -0
- data/script/rails +6 -0
- data/system/config/automateit_env.rb +16 -0
- data/system/config/fields.yml +48 -0
- data/system/config/tags.yml +39 -0
- data/system/dist/README_AutomateIt_dist.txt +20 -0
- data/system/dist/amavis/spamassassin.cf.erb +85 -0
- data/system/dist/amavis/user.erb +33 -0
- data/system/dist/awstats/awstats.mail.conf.erb +41 -0
- data/system/dist/awstats/prepflog.pl +576 -0
- data/system/dist/dovecot/dovecot-sql.conf.ext.erb +14 -0
- data/system/dist/dovecot/dovecot.conf.erb +297 -0
- data/system/dist/dovecot/old_dovecot.conf.erb +63 -0
- data/system/dist/dspam/conf.erb +96 -0
- data/system/dist/dspam/pgsql.conf +33 -0
- data/system/dist/nginx/awstats.erb +17 -0
- data/system/dist/nginx/rmails.erb +40 -0
- data/system/dist/postfix/email2email.cf.erb +5 -0
- data/system/dist/postfix/main.cf.erb +118 -0
- data/system/dist/postfix/master.cf.erb +74 -0
- data/system/dist/postfix/sasl.conf.erb +3 -0
- data/system/dist/postfix/sender_login_maps.cf.erb +5 -0
- data/system/dist/postfix/virtual_alias_maps.cf.erb +5 -0
- data/system/dist/postfix/virtual_mailbox_domains.cf.erb +5 -0
- data/system/dist/postfix/virtual_mailbox_maps.cf.erb +5 -0
- data/system/dist/postgresql/postgresql.conf.erb +54 -0
- data/system/dist/rmails/Gemfile.1 +8 -0
- data/system/dist/rmails/Gemfile.2 +24 -0
- data/system/dist/rmails/database.yml.erb +15 -0
- data/system/dist/sudoers +37 -0
- data/system/lib/README_AutomateIt_lib.txt +22 -0
- data/system/lib/dkim_key.rb +9 -0
- data/system/lib/smtpd_key.rb +39 -0
- data/system/lib/ssl.rb +23 -0
- data/system/recipes/01_prepare_server.rb +84 -0
- data/system/recipes/02_setup_database.rb +65 -0
- data/system/recipes/03_setup_postfix.rb +124 -0
- data/system/recipes/04_setup_dovecot.rb +78 -0
- data/system/recipes/05_setup_nginx.rb +29 -0
- data/system/recipes/06_setup_dspam.rb +24 -0
- data/system/recipes/07_setup_amavis.rb +16 -0
- data/system/recipes/08_setup_spamassassin.rb +22 -0
- data/system/recipes/09_setup_awstats.rb +49 -0
- data/system/recipes/XX_start_services.rb +5 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/functional/.gitkeep +0 -0
- data/test/functional/aliases_controller_test.rb +7 -0
- data/test/functional/domains_controller_test.rb +7 -0
- data/test/functional/users_controller_test.rb +7 -0
- data/test/integration/.gitkeep +0 -0
- data/test/performance/browsing_test.rb +12 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/.gitkeep +0 -0
- data/test/unit/helpers/aliases_helper_test.rb +4 -0
- data/test/unit/helpers/domains_helper_test.rb +4 -0
- data/test/unit/helpers/users_helper_test.rb +4 -0
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/javascripts/canjs/can.construct.proxy.js +60 -0
- data/vendor/assets/javascripts/canjs/can.construct.super.js +44 -0
- data/vendor/assets/javascripts/canjs/can.control.plugin.js +245 -0
- data/vendor/assets/javascripts/canjs/can.control.view.js +88 -0
- data/vendor/assets/javascripts/canjs/can.dojo.js +3669 -0
- data/vendor/assets/javascripts/canjs/can.dojo.min.js +66 -0
- data/vendor/assets/javascripts/canjs/can.fixture.js +1020 -0
- data/vendor/assets/javascripts/canjs/can.jquery.js +2995 -0
- data/vendor/assets/javascripts/canjs/can.jquery.min.js +52 -0
- data/vendor/assets/javascripts/canjs/can.mootools.js +3462 -0
- data/vendor/assets/javascripts/canjs/can.mootools.min.js +63 -0
- data/vendor/assets/javascripts/canjs/can.observe.attributes.js +293 -0
- data/vendor/assets/javascripts/canjs/can.observe.backup.js +368 -0
- data/vendor/assets/javascripts/canjs/can.observe.delegate.js +359 -0
- data/vendor/assets/javascripts/canjs/can.observe.setter.js +58 -0
- data/vendor/assets/javascripts/canjs/can.observe.validations.js +374 -0
- data/vendor/assets/javascripts/canjs/can.view.modifiers.js +292 -0
- data/vendor/assets/javascripts/canjs/can.yui.js +3530 -0
- data/vendor/assets/javascripts/canjs/can.yui.min.js +65 -0
- data/vendor/assets/javascripts/canjs/can.zepto.js +3426 -0
- data/vendor/assets/javascripts/canjs/can.zepto.min.js +62 -0
- data/vendor/assets/javascripts/twitter/bootstrap-affix.js +104 -0
- data/vendor/assets/javascripts/twitter/bootstrap-alert.js +90 -0
- data/vendor/assets/javascripts/twitter/bootstrap-button.js +96 -0
- data/vendor/assets/javascripts/twitter/bootstrap-carousel.js +176 -0
- data/vendor/assets/javascripts/twitter/bootstrap-collapse.js +158 -0
- data/vendor/assets/javascripts/twitter/bootstrap-dropdown.js +150 -0
- data/vendor/assets/javascripts/twitter/bootstrap-modal.js +239 -0
- data/vendor/assets/javascripts/twitter/bootstrap-popover.js +103 -0
- data/vendor/assets/javascripts/twitter/bootstrap-scrollspy.js +151 -0
- data/vendor/assets/javascripts/twitter/bootstrap-tab.js +135 -0
- data/vendor/assets/javascripts/twitter/bootstrap-tooltip.js +275 -0
- data/vendor/assets/javascripts/twitter/bootstrap-transition.js +60 -0
- data/vendor/assets/javascripts/twitter/bootstrap-typeahead.js +300 -0
- data/vendor/assets/javascripts/twitter/my/bootstrap-typeahead.js +311 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- metadata +470 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/* =============================================================
|
|
2
|
+
* bootstrap-collapse.js v2.1.1
|
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
|
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
|
+
/* COLLAPSE PUBLIC CLASS DEFINITION
|
|
27
|
+
* ================================ */
|
|
28
|
+
|
|
29
|
+
var Collapse = function (element, options) {
|
|
30
|
+
this.$element = $(element)
|
|
31
|
+
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
|
32
|
+
|
|
33
|
+
if (this.options.parent) {
|
|
34
|
+
this.$parent = $(this.options.parent)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
this.options.toggle && this.toggle()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Collapse.prototype = {
|
|
41
|
+
|
|
42
|
+
constructor: Collapse
|
|
43
|
+
|
|
44
|
+
, dimension: function () {
|
|
45
|
+
var hasWidth = this.$element.hasClass('width')
|
|
46
|
+
return hasWidth ? 'width' : 'height'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
, show: function () {
|
|
50
|
+
var dimension
|
|
51
|
+
, scroll
|
|
52
|
+
, actives
|
|
53
|
+
, hasData
|
|
54
|
+
|
|
55
|
+
if (this.transitioning) return
|
|
56
|
+
|
|
57
|
+
dimension = this.dimension()
|
|
58
|
+
scroll = $.camelCase(['scroll', dimension].join('-'))
|
|
59
|
+
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
|
60
|
+
|
|
61
|
+
if (actives && actives.length) {
|
|
62
|
+
hasData = actives.data('collapse')
|
|
63
|
+
if (hasData && hasData.transitioning) return
|
|
64
|
+
actives.collapse('hide')
|
|
65
|
+
hasData || actives.data('collapse', null)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.$element[dimension](0)
|
|
69
|
+
this.transition('addClass', $.Event('show'), 'shown')
|
|
70
|
+
$.support.transition && this.$element[dimension](this.$element[0][scroll])
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
, hide: function () {
|
|
74
|
+
var dimension
|
|
75
|
+
if (this.transitioning) return
|
|
76
|
+
dimension = this.dimension()
|
|
77
|
+
this.reset(this.$element[dimension]())
|
|
78
|
+
this.transition('removeClass', $.Event('hide'), 'hidden')
|
|
79
|
+
this.$element[dimension](0)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
, reset: function (size) {
|
|
83
|
+
var dimension = this.dimension()
|
|
84
|
+
|
|
85
|
+
this.$element
|
|
86
|
+
.removeClass('collapse')
|
|
87
|
+
[dimension](size || 'auto')
|
|
88
|
+
[0].offsetWidth
|
|
89
|
+
|
|
90
|
+
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
|
91
|
+
|
|
92
|
+
return this
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
, transition: function (method, startEvent, completeEvent) {
|
|
96
|
+
var that = this
|
|
97
|
+
, complete = function () {
|
|
98
|
+
if (startEvent.type == 'show') that.reset()
|
|
99
|
+
that.transitioning = 0
|
|
100
|
+
that.$element.trigger(completeEvent)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
this.$element.trigger(startEvent)
|
|
104
|
+
|
|
105
|
+
if (startEvent.isDefaultPrevented()) return
|
|
106
|
+
|
|
107
|
+
this.transitioning = 1
|
|
108
|
+
|
|
109
|
+
this.$element[method]('in')
|
|
110
|
+
|
|
111
|
+
$.support.transition && this.$element.hasClass('collapse') ?
|
|
112
|
+
this.$element.one($.support.transition.end, complete) :
|
|
113
|
+
complete()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
, toggle: function () {
|
|
117
|
+
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/* COLLAPSIBLE PLUGIN DEFINITION
|
|
124
|
+
* ============================== */
|
|
125
|
+
|
|
126
|
+
$.fn.collapse = function (option) {
|
|
127
|
+
return this.each(function () {
|
|
128
|
+
var $this = $(this)
|
|
129
|
+
, data = $this.data('collapse')
|
|
130
|
+
, options = typeof option == 'object' && option
|
|
131
|
+
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
|
132
|
+
if (typeof option == 'string') data[option]()
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
$.fn.collapse.defaults = {
|
|
137
|
+
toggle: true
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
$.fn.collapse.Constructor = Collapse
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
/* COLLAPSIBLE DATA-API
|
|
144
|
+
* ==================== */
|
|
145
|
+
|
|
146
|
+
$(function () {
|
|
147
|
+
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
|
148
|
+
var $this = $(this), href
|
|
149
|
+
, target = $this.attr('data-target')
|
|
150
|
+
|| e.preventDefault()
|
|
151
|
+
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
|
152
|
+
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
|
153
|
+
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
|
154
|
+
$(target).collapse(option)
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
}(window.jQuery);
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
* bootstrap-dropdown.js v2.1.1
|
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
|
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
|
+
/* DROPDOWN CLASS DEFINITION
|
|
27
|
+
* ========================= */
|
|
28
|
+
|
|
29
|
+
var toggle = '[data-toggle=dropdown]'
|
|
30
|
+
, Dropdown = function (element) {
|
|
31
|
+
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
|
32
|
+
$('html').on('click.dropdown.data-api', function () {
|
|
33
|
+
$el.parent().removeClass('open')
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Dropdown.prototype = {
|
|
38
|
+
|
|
39
|
+
constructor: Dropdown
|
|
40
|
+
|
|
41
|
+
, toggle: function (e) {
|
|
42
|
+
var $this = $(this)
|
|
43
|
+
, $parent
|
|
44
|
+
, isActive
|
|
45
|
+
|
|
46
|
+
if ($this.is('.disabled, :disabled')) return
|
|
47
|
+
|
|
48
|
+
$parent = getParent($this)
|
|
49
|
+
|
|
50
|
+
isActive = $parent.hasClass('open')
|
|
51
|
+
|
|
52
|
+
clearMenus()
|
|
53
|
+
|
|
54
|
+
if (!isActive) {
|
|
55
|
+
$parent.toggleClass('open')
|
|
56
|
+
$this.focus()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return false
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
, keydown: function (e) {
|
|
63
|
+
var $this
|
|
64
|
+
, $items
|
|
65
|
+
, $active
|
|
66
|
+
, $parent
|
|
67
|
+
, isActive
|
|
68
|
+
, index
|
|
69
|
+
|
|
70
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
|
71
|
+
|
|
72
|
+
$this = $(this)
|
|
73
|
+
|
|
74
|
+
e.preventDefault()
|
|
75
|
+
e.stopPropagation()
|
|
76
|
+
|
|
77
|
+
if ($this.is('.disabled, :disabled')) return
|
|
78
|
+
|
|
79
|
+
$parent = getParent($this)
|
|
80
|
+
|
|
81
|
+
isActive = $parent.hasClass('open')
|
|
82
|
+
|
|
83
|
+
if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
|
|
84
|
+
|
|
85
|
+
$items = $('[role=menu] li:not(.divider) a', $parent)
|
|
86
|
+
|
|
87
|
+
if (!$items.length) return
|
|
88
|
+
|
|
89
|
+
index = $items.index($items.filter(':focus'))
|
|
90
|
+
|
|
91
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
|
92
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
|
93
|
+
if (!~index) index = 0
|
|
94
|
+
|
|
95
|
+
$items
|
|
96
|
+
.eq(index)
|
|
97
|
+
.focus()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function clearMenus() {
|
|
103
|
+
getParent($(toggle))
|
|
104
|
+
.removeClass('open')
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getParent($this) {
|
|
108
|
+
var selector = $this.attr('data-target')
|
|
109
|
+
, $parent
|
|
110
|
+
|
|
111
|
+
if (!selector) {
|
|
112
|
+
selector = $this.attr('href')
|
|
113
|
+
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
$parent = $(selector)
|
|
117
|
+
$parent.length || ($parent = $this.parent())
|
|
118
|
+
|
|
119
|
+
return $parent
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/* DROPDOWN PLUGIN DEFINITION
|
|
124
|
+
* ========================== */
|
|
125
|
+
|
|
126
|
+
$.fn.dropdown = function (option) {
|
|
127
|
+
return this.each(function () {
|
|
128
|
+
var $this = $(this)
|
|
129
|
+
, data = $this.data('dropdown')
|
|
130
|
+
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
|
131
|
+
if (typeof option == 'string') data[option].call($this)
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
$.fn.dropdown.Constructor = Dropdown
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
|
139
|
+
* =================================== */
|
|
140
|
+
|
|
141
|
+
$(function () {
|
|
142
|
+
$('html')
|
|
143
|
+
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
|
144
|
+
$('body')
|
|
145
|
+
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
|
146
|
+
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
|
147
|
+
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
}(window.jQuery);
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/* =========================================================
|
|
2
|
+
* bootstrap-modal.js v2.1.1
|
|
3
|
+
* http://twitter.github.com/bootstrap/javascript.html#modals
|
|
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
|
+
/* MODAL CLASS DEFINITION
|
|
27
|
+
* ====================== */
|
|
28
|
+
|
|
29
|
+
var Modal = function (element, options) {
|
|
30
|
+
this.options = options
|
|
31
|
+
this.$element = $(element)
|
|
32
|
+
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
|
33
|
+
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Modal.prototype = {
|
|
37
|
+
|
|
38
|
+
constructor: Modal
|
|
39
|
+
|
|
40
|
+
, toggle: function () {
|
|
41
|
+
return this[!this.isShown ? 'show' : 'hide']()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
, show: function () {
|
|
45
|
+
var that = this
|
|
46
|
+
, e = $.Event('show')
|
|
47
|
+
|
|
48
|
+
this.$element.trigger(e)
|
|
49
|
+
|
|
50
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
|
51
|
+
|
|
52
|
+
$('body').addClass('modal-open')
|
|
53
|
+
|
|
54
|
+
this.isShown = true
|
|
55
|
+
|
|
56
|
+
this.escape()
|
|
57
|
+
|
|
58
|
+
this.backdrop(function () {
|
|
59
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
|
60
|
+
|
|
61
|
+
if (!that.$element.parent().length) {
|
|
62
|
+
that.$element.appendTo(document.body) //don't move modals dom position
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
that.$element
|
|
66
|
+
.show()
|
|
67
|
+
|
|
68
|
+
if (transition) {
|
|
69
|
+
that.$element[0].offsetWidth // force reflow
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
that.$element
|
|
73
|
+
.addClass('in')
|
|
74
|
+
.attr('aria-hidden', false)
|
|
75
|
+
.focus()
|
|
76
|
+
|
|
77
|
+
that.enforceFocus()
|
|
78
|
+
|
|
79
|
+
transition ?
|
|
80
|
+
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
|
81
|
+
that.$element.trigger('shown')
|
|
82
|
+
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
, hide: function (e) {
|
|
87
|
+
e && e.preventDefault()
|
|
88
|
+
|
|
89
|
+
var that = this
|
|
90
|
+
|
|
91
|
+
e = $.Event('hide')
|
|
92
|
+
|
|
93
|
+
this.$element.trigger(e)
|
|
94
|
+
|
|
95
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
|
96
|
+
|
|
97
|
+
this.isShown = false
|
|
98
|
+
|
|
99
|
+
$('body').removeClass('modal-open')
|
|
100
|
+
|
|
101
|
+
this.escape()
|
|
102
|
+
|
|
103
|
+
$(document).off('focusin.modal')
|
|
104
|
+
|
|
105
|
+
this.$element
|
|
106
|
+
.removeClass('in')
|
|
107
|
+
.attr('aria-hidden', true)
|
|
108
|
+
|
|
109
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
|
110
|
+
this.hideWithTransition() :
|
|
111
|
+
this.hideModal()
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
, enforceFocus: function () {
|
|
115
|
+
var that = this
|
|
116
|
+
$(document).on('focusin.modal', function (e) {
|
|
117
|
+
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
|
|
118
|
+
that.$element.focus()
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
, escape: function () {
|
|
124
|
+
var that = this
|
|
125
|
+
if (this.isShown && this.options.keyboard) {
|
|
126
|
+
this.$element.on('keyup.dismiss.modal', function ( e ) {
|
|
127
|
+
e.which == 27 && that.hide()
|
|
128
|
+
})
|
|
129
|
+
} else if (!this.isShown) {
|
|
130
|
+
this.$element.off('keyup.dismiss.modal')
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
, hideWithTransition: function () {
|
|
135
|
+
var that = this
|
|
136
|
+
, timeout = setTimeout(function () {
|
|
137
|
+
that.$element.off($.support.transition.end)
|
|
138
|
+
that.hideModal()
|
|
139
|
+
}, 500)
|
|
140
|
+
|
|
141
|
+
this.$element.one($.support.transition.end, function () {
|
|
142
|
+
clearTimeout(timeout)
|
|
143
|
+
that.hideModal()
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
, hideModal: function (that) {
|
|
148
|
+
this.$element
|
|
149
|
+
.hide()
|
|
150
|
+
.trigger('hidden')
|
|
151
|
+
|
|
152
|
+
this.backdrop()
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
, removeBackdrop: function () {
|
|
156
|
+
this.$backdrop.remove()
|
|
157
|
+
this.$backdrop = null
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
, backdrop: function (callback) {
|
|
161
|
+
var that = this
|
|
162
|
+
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
|
163
|
+
|
|
164
|
+
if (this.isShown && this.options.backdrop) {
|
|
165
|
+
var doAnimate = $.support.transition && animate
|
|
166
|
+
|
|
167
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
|
168
|
+
.appendTo(document.body)
|
|
169
|
+
|
|
170
|
+
if (this.options.backdrop != 'static') {
|
|
171
|
+
this.$backdrop.click($.proxy(this.hide, this))
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
|
175
|
+
|
|
176
|
+
this.$backdrop.addClass('in')
|
|
177
|
+
|
|
178
|
+
doAnimate ?
|
|
179
|
+
this.$backdrop.one($.support.transition.end, callback) :
|
|
180
|
+
callback()
|
|
181
|
+
|
|
182
|
+
} else if (!this.isShown && this.$backdrop) {
|
|
183
|
+
this.$backdrop.removeClass('in')
|
|
184
|
+
|
|
185
|
+
$.support.transition && this.$element.hasClass('fade')?
|
|
186
|
+
this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
|
|
187
|
+
this.removeBackdrop()
|
|
188
|
+
|
|
189
|
+
} else if (callback) {
|
|
190
|
+
callback()
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
/* MODAL PLUGIN DEFINITION
|
|
197
|
+
* ======================= */
|
|
198
|
+
|
|
199
|
+
$.fn.modal = function (option) {
|
|
200
|
+
return this.each(function () {
|
|
201
|
+
var $this = $(this)
|
|
202
|
+
, data = $this.data('modal')
|
|
203
|
+
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
|
204
|
+
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
|
205
|
+
if (typeof option == 'string') data[option]()
|
|
206
|
+
else if (options.show) data.show()
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
$.fn.modal.defaults = {
|
|
211
|
+
backdrop: true
|
|
212
|
+
, keyboard: true
|
|
213
|
+
, show: true
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
$.fn.modal.Constructor = Modal
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
/* MODAL DATA-API
|
|
220
|
+
* ============== */
|
|
221
|
+
|
|
222
|
+
$(function () {
|
|
223
|
+
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
|
224
|
+
var $this = $(this)
|
|
225
|
+
, href = $this.attr('href')
|
|
226
|
+
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
|
227
|
+
, option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
|
228
|
+
|
|
229
|
+
e.preventDefault()
|
|
230
|
+
|
|
231
|
+
$target
|
|
232
|
+
.modal(option)
|
|
233
|
+
.one('hide', function () {
|
|
234
|
+
$this.focus()
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
}(window.jQuery);
|