├── .editorconfig
├── .gitignore
├── .jshintrc
├── BootstrapBlocks.info
├── Gruntfile.coffee
├── LICENSE.md
├── README.md
├── assets
├── css
│ ├── fonts
│ │ ├── icomoon.eot
│ │ ├── icomoon.svg
│ │ ├── icomoon.ttf
│ │ └── icomoon.woff
│ └── style.min.css
├── img
│ ├── hd
│ │ └── logo@2x.png
│ ├── icons
│ │ ├── touch-icon-ipad.png
│ │ ├── touch-icon-ipad3.png
│ │ ├── touch-icon-iphone.png
│ │ ├── touch-icon-iphone4.png
│ │ └── touch-icons-windows.png
│ └── throbber.gif
├── js
│ ├── main.js
│ ├── plugins
│ │ └── bootstrap
│ │ │ ├── affix.js
│ │ │ ├── alert.js
│ │ │ ├── button.js
│ │ │ ├── carousel.js
│ │ │ ├── collapse.js
│ │ │ ├── dropdown.js
│ │ │ ├── modal.js
│ │ │ ├── popover.js
│ │ │ ├── scrollspy.js
│ │ │ ├── tab.js
│ │ │ ├── tooltip.js
│ │ │ └── transition.js
│ ├── scripts.min.js
│ └── vendor
│ │ └── modernizr-2.6.2.min.js
└── less
│ ├── app.less
│ ├── bootstrap
│ ├── alerts.less
│ ├── badges.less
│ ├── bootstrap.less
│ ├── breadcrumbs.less
│ ├── button-groups.less
│ ├── buttons.less
│ ├── carousel.less
│ ├── close.less
│ ├── code.less
│ ├── component-animations.less
│ ├── dropdowns.less
│ ├── forms.less
│ ├── glyphicons.less
│ ├── grid.less
│ ├── input-groups.less
│ ├── jumbotron.less
│ ├── labels.less
│ ├── list-group.less
│ ├── media.less
│ ├── mixins.less
│ ├── modals.less
│ ├── navbar.less
│ ├── navs.less
│ ├── normalize.less
│ ├── pager.less
│ ├── pagination.less
│ ├── panels.less
│ ├── popovers.less
│ ├── print.less
│ ├── progress-bars.less
│ ├── responsive-utilities.less
│ ├── scaffolding.less
│ ├── tables.less
│ ├── theme.less
│ ├── thumbnails.less
│ ├── tooltip.less
│ ├── type.less
│ ├── utilities.less
│ ├── variables.less
│ └── wells.less
│ ├── drupal.less
│ ├── icons.less
│ └── style.less
├── favicon.ico
├── lib
├── breadcrumbs.inc
├── buttons.inc
├── containers.inc
├── fields.inc
├── forms.inc
├── lists.inc
├── menus.inc
├── messages.inc
├── pagers.inc
├── tables.inc
├── template-functions.php
└── templates
│ └── block-admin-display-form.tpl.php
├── logo.png
├── package.json
├── screenshot.png
├── template.php
├── templates
├── blocks
│ └── block.tpl.php
├── fields
│ └── field.tpl.php
├── html.tpl.php
├── includes
│ ├── page-head.php
│ ├── page-title.php
│ └── page-utility.php
├── nodes
│ └── node.tpl.php
├── page.tpl.php
└── regions
│ ├── region--footer.tpl.php
│ ├── region--menu.tpl.php
│ └── region--sidebar_right.tpl.php
└── theme-settings.php
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | indent_style = space
7 | indent_size = 2
8 | end_of_line = lf
9 | charset = utf-8
10 | trim_trailing_whitespace = true
11 | insert_final_newline = true
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "bitwise": true,
3 | "browser": true,
4 | "curly": true,
5 | "eqeqeq": true,
6 | "eqnull": true,
7 | "es5": true,
8 | "esnext": true,
9 | "immed": true,
10 | "jquery": true,
11 | "latedef": true,
12 | "newcap": true,
13 | "noarg": true,
14 | "node": true,
15 | "strict": false,
16 | "trailing": true,
17 | "undef": true
18 | }
19 |
--------------------------------------------------------------------------------
/BootstrapBlocks.info:
--------------------------------------------------------------------------------
1 | name = Bootstrap Blocks
2 | description = Bootstrap/HTML5 boilerpate based starter theme for Drupal 7.x http://basethe.me
3 |
4 | core = 7.x
5 |
6 | stylesheets[screen][] = assets/css/style.min.css
7 |
8 | scripts[] = assets/js/vendor/modernizr-2.6.2.min.js
9 | scripts[] = assets/js/scripts.min.js
10 |
11 | regions[navbar] = Navbar
12 | regions[menu] = Main Menu
13 | regions[content] = Content
14 | regions[sidebar_right] = Right Sidebar
15 | regions[footer] = Footer
16 |
17 | features[] = logo
18 | features[] = name
19 | features[] = slogan
20 | features[] = mission
21 | features[] = node_user_picture
22 | features[] = comment_user_picture
23 | ;features[] = search
24 | features[] = favicon
25 |
26 | settings[button_classes] = "
27 | Save|btn-primary
28 | Create|btn-primary
29 | Submit|btn-primary
30 | Export|btn-primary
31 | Import|btn-primary
32 | Rebuild|btn-primary
33 | Add|btn-info
34 | Update|btn-info
35 | Restore|btn-success
36 | Confirm|btn-success
37 | Submit|btn-success
38 | Delete|btn-danger
39 | Remove|btn-danger
40 | Filter|btn-inverse"
41 |
42 | settings[touch_icons_on_off] = 1
43 | settings[windows_color] = "#ffffff"
44 | settings[windows_title] = ""
45 |
46 |
--------------------------------------------------------------------------------
/Gruntfile.coffee:
--------------------------------------------------------------------------------
1 | "use strict" #jshint
2 | module.exports = (grunt) ->
3 | grunt.initConfig
4 | jshint:
5 | options:
6 | jshintrc: ".jshintrc" #jshint config file
7 |
8 | all: ["Gruntfile.js", "assets/js/*.js", "!assets/js/scripts.min.js"]
9 |
10 | less:
11 | all:
12 | files:
13 | "assets/css/style.min.css": "assets/less/style.less"
14 |
15 | uglify:
16 | all:
17 | files:
18 | "assets/js/scripts.min.js": ["assets/js/plugins/bootstrap/transition.js", "assets/js/plugins/bootstrap/alert.js", "assets/js/plugins/bootstrap/button.js", "assets/js/plugins/bootstrap/carousel.js", "assets/js/plugins/bootstrap/collapse.js", "assets/js/plugins/bootstrap/dropdown.js", "assets/js/plugins/bootstrap/modal.js", "assets/js/plugins/bootstrap/tooltip.js", "assets/js/plugins/bootstrap/popover.js", "assets/js/plugins/bootstrap/scrollspy.js", "assets/js/plugins/bootstrap/tab.js", "assets/js/plugins/bootstrap/typehead.js", "assets/js/plugins/*.js", "!assets/js/scripts.min.js", "assets/js/*.js"]
19 |
20 | watch:
21 | less:
22 | files: ["assets/less/*.less", "assets/less/bootstrap/*.less"]
23 | tasks: ["less"]
24 |
25 | js:
26 | files: ["<%= jshint.all %>"]
27 | tasks: ["jshint", "uglify"]
28 |
29 | clean:
30 | dist: ["assets/css/style.min.css", "assets/js/scripts.min.js"]
31 |
32 | grunt.loadNpmTasks "grunt-contrib-clean"
33 | grunt.loadNpmTasks "grunt-contrib-jshint"
34 | grunt.loadNpmTasks "grunt-contrib-uglify"
35 | grunt.loadNpmTasks "grunt-contrib-watch"
36 | grunt.loadNpmTasks "grunt-contrib-less"
37 | grunt.registerTask "default", ["clean", "less", "uglify"]
38 | grunt.registerTask "dev", ["watch"]
39 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) Patrick Coffey
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | #Bootstrap Blocks
2 | [](https://gitter.im/patrickocoffeyo/BootstrapBlocks?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3 |
4 | Bootstrap Blocks is a [Bootstrap-based](http://twitter.github.com/bootstrap), HTML5 BP base theme for Drupal 7.x. Includes lots of goodies, like [Icomoon](http://icomoon.io/), and [Modernizr](http://modernizr.com/).
5 |
6 | ##Features
7 | - Bootstrap integration
8 | - Clean HTML5 templates
9 | - Icomoon Support
10 | - HTML5 Boilerplate
11 | - Grunt
12 | - Cleaned Drupal output
13 | - Organized, easy to understand folder structure
14 | - Cool drush make
file: [bootstrapblocks.make](https://gist.github.com/patrickocoffeyo/9627418)
15 |
16 |
17 | ##The Module
18 | [Bootstrap Blocks Module](https://github.com/patrickocoffeyo/BootstrapBlocksModule) allows you to add custom Bootstrap-ized elements, like configurable Bootstrap menu blocks, navbars (including a nice Administration navbar) carousels from content types, and more. It's pretty much a staple for using this theme.
19 |
20 | ## Installation
21 | Pretty easy stuff:
22 |
23 | 1. **Get the Files** - Download or clone the repository into Drupal's sites/all/themes
directory. Or, just use drush make
with the [bootstrapblocks.make](https://gist.github.com/patrickocoffeyo/9627418) file.
24 | 2. **Install jQuery Update** - drush en jquery_update -y
, or download and install the [jQuery Update](https://drupal.org/project/jquery_update) module manually.
25 | 3. **Install Grunt Requirements** - cd
to the theme root and run npm install
. This will install all the npm packages that Grunt needs to properly run.
26 | 4. **Enable and Set Default** - There are a couple ways to enable themes in Drupal:
27 | 1. **Drush** If you have [Drush](http://drupal.org/project/drush) installed, run drush pm-enable BootstrapBlocks && drush vset theme_default BootstrapBlocks
28 | 2. **Administraion UI** - Navigate to admin/appearance/list
and click "Enable and set default"
29 |
30 | For more information on installing themes in Drupal, please visit the official [Theme Installation](http://drupal.org/node/456) documentation on drupal.org.
31 |
32 | ## Extension
33 | This project is meant to be a base theme. You can take it and build a custom theme on it, or use it as a parent theme to your own theme.
34 |
35 | ## Contrubution
36 | … is welcome and wanted. :) fork and contribute!
37 |
38 | ##License
39 | licensed under the [MIT License](http://en.wikipedia.org/wiki/MIT_License).
40 |
--------------------------------------------------------------------------------
/assets/css/fonts/icomoon.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/css/fonts/icomoon.eot
--------------------------------------------------------------------------------
/assets/css/fonts/icomoon.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/css/fonts/icomoon.ttf
--------------------------------------------------------------------------------
/assets/css/fonts/icomoon.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/css/fonts/icomoon.woff
--------------------------------------------------------------------------------
/assets/img/hd/logo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/img/hd/logo@2x.png
--------------------------------------------------------------------------------
/assets/img/icons/touch-icon-ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/img/icons/touch-icon-ipad.png
--------------------------------------------------------------------------------
/assets/img/icons/touch-icon-ipad3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/img/icons/touch-icon-ipad3.png
--------------------------------------------------------------------------------
/assets/img/icons/touch-icon-iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/img/icons/touch-icon-iphone.png
--------------------------------------------------------------------------------
/assets/img/icons/touch-icon-iphone4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/img/icons/touch-icon-iphone4.png
--------------------------------------------------------------------------------
/assets/img/icons/touch-icons-windows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/img/icons/touch-icons-windows.png
--------------------------------------------------------------------------------
/assets/img/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/assets/img/throbber.gif
--------------------------------------------------------------------------------
/assets/js/main.js:
--------------------------------------------------------------------------------
1 | (function ($) {
2 |
3 | // iOS orientation
4 | $(document).ready(function() {
5 | if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
6 | var viewportmeta = document.querySelector('meta[name="viewport"]');
7 | if (viewportmeta) {
8 | viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
9 | document.body.addEventListener('gesturestart', function () {
10 | viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
11 | }, false);
12 | }
13 | }
14 | });
15 |
16 | })(window.jQuery);
17 |
--------------------------------------------------------------------------------
/assets/js/plugins/bootstrap/affix.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: affix.js v3.0.3
3 | * http://getbootstrap.com/javascript/#affix
4 | * ========================================================================
5 | * Copyright 2013 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 ($) { "use strict";
22 |
23 | // AFFIX CLASS DEFINITION
24 | // ======================
25 |
26 | var Affix = function (element, options) {
27 | this.options = $.extend({}, Affix.DEFAULTS, options)
28 | this.$window = $(window)
29 | .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
30 | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
31 |
32 | this.$element = $(element)
33 | this.affixed =
34 | this.unpin = null
35 |
36 | this.checkPosition()
37 | }
38 |
39 | Affix.RESET = 'affix affix-top affix-bottom'
40 |
41 | Affix.DEFAULTS = {
42 | offset: 0
43 | }
44 |
45 | Affix.prototype.checkPositionWithEventLoop = function () {
46 | setTimeout($.proxy(this.checkPosition, this), 1)
47 | }
48 |
49 | Affix.prototype.checkPosition = function () {
50 | if (!this.$element.is(':visible')) return
51 |
52 | var scrollHeight = $(document).height()
53 | var scrollTop = this.$window.scrollTop()
54 | var position = this.$element.offset()
55 | var offset = this.options.offset
56 | var offsetTop = offset.top
57 | var offsetBottom = offset.bottom
58 |
59 | if (typeof offset != 'object') offsetBottom = offsetTop = offset
60 | if (typeof offsetTop == 'function') offsetTop = offset.top()
61 | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
62 |
63 | var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
64 | offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
65 | offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
66 |
67 | if (this.affixed === affix) return
68 | if (this.unpin) this.$element.css('top', '')
69 |
70 | this.affixed = affix
71 | this.unpin = affix == 'bottom' ? position.top - scrollTop : null
72 |
73 | this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
74 |
75 | if (affix == 'bottom') {
76 | this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
77 | }
78 | }
79 |
80 |
81 | // AFFIX PLUGIN DEFINITION
82 | // =======================
83 |
84 | var old = $.fn.affix
85 |
86 | $.fn.affix = function (option) {
87 | return this.each(function () {
88 | var $this = $(this)
89 | var data = $this.data('bs.affix')
90 | var options = typeof option == 'object' && option
91 |
92 | if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
93 | if (typeof option == 'string') data[option]()
94 | })
95 | }
96 |
97 | $.fn.affix.Constructor = Affix
98 |
99 |
100 | // AFFIX NO CONFLICT
101 | // =================
102 |
103 | $.fn.affix.noConflict = function () {
104 | $.fn.affix = old
105 | return this
106 | }
107 |
108 |
109 | // AFFIX DATA-API
110 | // ==============
111 |
112 | $(window).on('load', function () {
113 | $('[data-spy="affix"]').each(function () {
114 | var $spy = $(this)
115 | var data = $spy.data()
116 |
117 | data.offset = data.offset || {}
118 |
119 | if (data.offsetBottom) data.offset.bottom = data.offsetBottom
120 | if (data.offsetTop) data.offset.top = data.offsetTop
121 |
122 | $spy.affix(data)
123 | })
124 | })
125 |
126 | }(jQuery);
127 |
--------------------------------------------------------------------------------
/assets/js/plugins/bootstrap/alert.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: alert.js v3.0.3
3 | * http://getbootstrap.com/javascript/#alerts
4 | * ========================================================================
5 | * Copyright 2013 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 ($) { "use strict";
22 |
23 | // ALERT CLASS DEFINITION
24 | // ======================
25 |
26 | var dismiss = '[data-dismiss="alert"]'
27 | var Alert = function (el) {
28 | $(el).on('click', dismiss, this.close)
29 | }
30 |
31 | Alert.prototype.close = function (e) {
32 | var $this = $(this)
33 | var selector = $this.attr('data-target')
34 |
35 | if (!selector) {
36 | selector = $this.attr('href')
37 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
38 | }
39 |
40 | var $parent = $(selector)
41 |
42 | if (e) e.preventDefault()
43 |
44 | if (!$parent.length) {
45 | $parent = $this.hasClass('alert') ? $this : $this.parent()
46 | }
47 |
48 | $parent.trigger(e = $.Event('close.bs.alert'))
49 |
50 | if (e.isDefaultPrevented()) return
51 |
52 | $parent.removeClass('in')
53 |
54 | function removeElement() {
55 | $parent.trigger('closed.bs.alert').remove()
56 | }
57 |
58 | $.support.transition && $parent.hasClass('fade') ?
59 | $parent
60 | .one($.support.transition.end, removeElement)
61 | .emulateTransitionEnd(150) :
62 | removeElement()
63 | }
64 |
65 |
66 | // ALERT PLUGIN DEFINITION
67 | // =======================
68 |
69 | var old = $.fn.alert
70 |
71 | $.fn.alert = function (option) {
72 | return this.each(function () {
73 | var $this = $(this)
74 | var data = $this.data('bs.alert')
75 |
76 | if (!data) $this.data('bs.alert', (data = new Alert(this)))
77 | if (typeof option == 'string') data[option].call($this)
78 | })
79 | }
80 |
81 | $.fn.alert.Constructor = Alert
82 |
83 |
84 | // ALERT NO CONFLICT
85 | // =================
86 |
87 | $.fn.alert.noConflict = function () {
88 | $.fn.alert = old
89 | return this
90 | }
91 |
92 |
93 | // ALERT DATA-API
94 | // ==============
95 |
96 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
97 |
98 | }(jQuery);
99 |
--------------------------------------------------------------------------------
/assets/js/plugins/bootstrap/button.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: button.js v3.0.3
3 | * http://getbootstrap.com/javascript/#buttons
4 | * ========================================================================
5 | * Copyright 2013 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 ($) { "use strict";
22 |
23 | // BUTTON PUBLIC CLASS DEFINITION
24 | // ==============================
25 |
26 | var Button = function (element, options) {
27 | this.$element = $(element)
28 | this.options = $.extend({}, Button.DEFAULTS, options)
29 | }
30 |
31 | Button.DEFAULTS = {
32 | loadingText: 'loading...'
33 | }
34 |
35 | Button.prototype.setState = function (state) {
36 | var d = 'disabled'
37 | var $el = this.$element
38 | var val = $el.is('input') ? 'val' : 'html'
39 | var data = $el.data()
40 |
41 | state = state + 'Text'
42 |
43 | if (!data.resetText) $el.data('resetText', $el[val]())
44 |
45 | $el[val](data[state] || this.options[state])
46 |
47 | // push to event loop to allow forms to submit
48 | setTimeout(function () {
49 | state == 'loadingText' ?
50 | $el.addClass(d).attr(d, d) :
51 | $el.removeClass(d).removeAttr(d);
52 | }, 0)
53 | }
54 |
55 | Button.prototype.toggle = function () {
56 | var $parent = this.$element.closest('[data-toggle="buttons"]')
57 | var changed = true
58 |
59 | if ($parent.length) {
60 | var $input = this.$element.find('input')
61 | if ($input.prop('type') === 'radio') {
62 | // see if clicking on current one
63 | if ($input.prop('checked') && this.$element.hasClass('active'))
64 | changed = false
65 | else
66 | $parent.find('.active').removeClass('active')
67 | }
68 | if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
69 | }
70 |
71 | if (changed) this.$element.toggleClass('active')
72 | }
73 |
74 |
75 | // BUTTON PLUGIN DEFINITION
76 | // ========================
77 |
78 | var old = $.fn.button
79 |
80 | $.fn.button = function (option) {
81 | return this.each(function () {
82 | var $this = $(this)
83 | var data = $this.data('bs.button')
84 | var options = typeof option == 'object' && option
85 |
86 | if (!data) $this.data('bs.button', (data = new Button(this, options)))
87 |
88 | if (option == 'toggle') data.toggle()
89 | else if (option) data.setState(option)
90 | })
91 | }
92 |
93 | $.fn.button.Constructor = Button
94 |
95 |
96 | // BUTTON NO CONFLICT
97 | // ==================
98 |
99 | $.fn.button.noConflict = function () {
100 | $.fn.button = old
101 | return this
102 | }
103 |
104 |
105 | // BUTTON DATA-API
106 | // ===============
107 |
108 | $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
109 | var $btn = $(e.target)
110 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
111 | $btn.button('toggle')
112 | e.preventDefault()
113 | })
114 |
115 | }(jQuery);
116 |
--------------------------------------------------------------------------------
/assets/js/plugins/bootstrap/carousel.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: carousel.js v3.0.3
3 | * http://getbootstrap.com/javascript/#carousel
4 | * ========================================================================
5 | * Copyright 2013 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 ($) { "use strict";
22 |
23 | // CAROUSEL CLASS DEFINITION
24 | // =========================
25 |
26 | var Carousel = function (element, options) {
27 | this.$element = $(element)
28 | this.$indicators = this.$element.find('.carousel-indicators')
29 | this.options = options
30 | this.paused =
31 | this.sliding =
32 | this.interval =
33 | this.$active =
34 | this.$items = null
35 |
36 | this.options.pause == 'hover' && this.$element
37 | .on('mouseenter', $.proxy(this.pause, this))
38 | .on('mouseleave', $.proxy(this.cycle, this))
39 | }
40 |
41 | Carousel.DEFAULTS = {
42 | interval: 5000
43 | , pause: 'hover'
44 | , wrap: true
45 | }
46 |
47 | Carousel.prototype.cycle = function (e) {
48 | e || (this.paused = false)
49 |
50 | this.interval && clearInterval(this.interval)
51 |
52 | this.options.interval
53 | && !this.paused
54 | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
55 |
56 | return this
57 | }
58 |
59 | Carousel.prototype.getActiveIndex = function () {
60 | this.$active = this.$element.find('.item.active')
61 | this.$items = this.$active.parent().children()
62 |
63 | return this.$items.index(this.$active)
64 | }
65 |
66 | Carousel.prototype.to = function (pos) {
67 | var that = this
68 | var activeIndex = this.getActiveIndex()
69 |
70 | if (pos > (this.$items.length - 1) || pos < 0) return
71 |
72 | if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
73 | if (activeIndex == pos) return this.pause().cycle()
74 |
75 | return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
76 | }
77 |
78 | Carousel.prototype.pause = function (e) {
79 | e || (this.paused = true)
80 |
81 | if (this.$element.find('.next, .prev').length && $.support.transition.end) {
82 | this.$element.trigger($.support.transition.end)
83 | this.cycle(true)
84 | }
85 |
86 | this.interval = clearInterval(this.interval)
87 |
88 | return this
89 | }
90 |
91 | Carousel.prototype.next = function () {
92 | if (this.sliding) return
93 | return this.slide('next')
94 | }
95 |
96 | Carousel.prototype.prev = function () {
97 | if (this.sliding) return
98 | return this.slide('prev')
99 | }
100 |
101 | Carousel.prototype.slide = function (type, next) {
102 | var $active = this.$element.find('.item.active')
103 | var $next = next || $active[type]()
104 | var isCycling = this.interval
105 | var direction = type == 'next' ? 'left' : 'right'
106 | var fallback = type == 'next' ? 'first' : 'last'
107 | var that = this
108 |
109 | if (!$next.length) {
110 | if (!this.options.wrap) return
111 | $next = this.$element.find('.item')[fallback]()
112 | }
113 |
114 | this.sliding = true
115 |
116 | isCycling && this.pause()
117 |
118 | var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
119 |
120 | if ($next.hasClass('active')) return
121 |
122 | if (this.$indicators.length) {
123 | this.$indicators.find('.active').removeClass('active')
124 | this.$element.one('slid.bs.carousel', function () {
125 | var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
126 | $nextIndicator && $nextIndicator.addClass('active')
127 | })
128 | }
129 |
130 | if ($.support.transition && this.$element.hasClass('slide')) {
131 | this.$element.trigger(e)
132 | if (e.isDefaultPrevented()) return
133 | $next.addClass(type)
134 | $next[0].offsetWidth // force reflow
135 | $active.addClass(direction)
136 | $next.addClass(direction)
137 | $active
138 | .one($.support.transition.end, function () {
139 | $next.removeClass([type, direction].join(' ')).addClass('active')
140 | $active.removeClass(['active', direction].join(' '))
141 | that.sliding = false
142 | setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
143 | })
144 | .emulateTransitionEnd(600)
145 | } else {
146 | this.$element.trigger(e)
147 | if (e.isDefaultPrevented()) return
148 | $active.removeClass('active')
149 | $next.addClass('active')
150 | this.sliding = false
151 | this.$element.trigger('slid.bs.carousel')
152 | }
153 |
154 | isCycling && this.cycle()
155 |
156 | return this
157 | }
158 |
159 |
160 | // CAROUSEL PLUGIN DEFINITION
161 | // ==========================
162 |
163 | var old = $.fn.carousel
164 |
165 | $.fn.carousel = function (option) {
166 | return this.each(function () {
167 | var $this = $(this)
168 | var data = $this.data('bs.carousel')
169 | var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
170 | var action = typeof option == 'string' ? option : options.slide
171 |
172 | if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
173 | if (typeof option == 'number') data.to(option)
174 | else if (action) data[action]()
175 | else if (options.interval) data.pause().cycle()
176 | })
177 | }
178 |
179 | $.fn.carousel.Constructor = Carousel
180 |
181 |
182 | // CAROUSEL NO CONFLICT
183 | // ====================
184 |
185 | $.fn.carousel.noConflict = function () {
186 | $.fn.carousel = old
187 | return this
188 | }
189 |
190 |
191 | // CAROUSEL DATA-API
192 | // =================
193 |
194 | $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
195 | var $this = $(this), href
196 | var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
197 | var options = $.extend({}, $target.data(), $this.data())
198 | var slideIndex = $this.attr('data-slide-to')
199 | if (slideIndex) options.interval = false
200 |
201 | $target.carousel(options)
202 |
203 | if (slideIndex = $this.attr('data-slide-to')) {
204 | $target.data('bs.carousel').to(slideIndex)
205 | }
206 |
207 | e.preventDefault()
208 | })
209 |
210 | $(window).on('load', function () {
211 | $('[data-ride="carousel"]').each(function () {
212 | var $carousel = $(this)
213 | $carousel.carousel($carousel.data())
214 | })
215 | })
216 |
217 | }(jQuery);
218 |
--------------------------------------------------------------------------------
/assets/js/plugins/bootstrap/collapse.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: collapse.js v3.0.3
3 | * http://getbootstrap.com/javascript/#collapse
4 | * ========================================================================
5 | * Copyright 2013 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 ($) { "use strict";
22 |
23 | // COLLAPSE PUBLIC CLASS DEFINITION
24 | // ================================
25 |
26 | var Collapse = function (element, options) {
27 | this.$element = $(element)
28 | this.options = $.extend({}, Collapse.DEFAULTS, options)
29 | this.transitioning = null
30 |
31 | if (this.options.parent) this.$parent = $(this.options.parent)
32 | if (this.options.toggle) this.toggle()
33 | }
34 |
35 | Collapse.DEFAULTS = {
36 | toggle: true
37 | }
38 |
39 | Collapse.prototype.dimension = function () {
40 | var hasWidth = this.$element.hasClass('width')
41 | return hasWidth ? 'width' : 'height'
42 | }
43 |
44 | Collapse.prototype.show = function () {
45 | if (this.transitioning || this.$element.hasClass('in')) return
46 |
47 | var startEvent = $.Event('show.bs.collapse')
48 | this.$element.trigger(startEvent)
49 | if (startEvent.isDefaultPrevented()) return
50 |
51 | var actives = this.$parent && this.$parent.find('> .panel > .in')
52 |
53 | if (actives && actives.length) {
54 | var hasData = actives.data('bs.collapse')
55 | if (hasData && hasData.transitioning) return
56 | actives.collapse('hide')
57 | hasData || actives.data('bs.collapse', null)
58 | }
59 |
60 | var dimension = this.dimension()
61 |
62 | this.$element
63 | .removeClass('collapse')
64 | .addClass('collapsing')
65 | [dimension](0)
66 |
67 | this.transitioning = 1
68 |
69 | var complete = function () {
70 | this.$element
71 | .removeClass('collapsing')
72 | .addClass('in')
73 | [dimension]('auto')
74 | this.transitioning = 0
75 | this.$element.trigger('shown.bs.collapse')
76 | }
77 |
78 | if (!$.support.transition) return complete.call(this)
79 |
80 | var scrollSize = $.camelCase(['scroll', dimension].join('-'))
81 |
82 | this.$element
83 | .one($.support.transition.end, $.proxy(complete, this))
84 | .emulateTransitionEnd(350)
85 | [dimension](this.$element[0][scrollSize])
86 | }
87 |
88 | Collapse.prototype.hide = function () {
89 | if (this.transitioning || !this.$element.hasClass('in')) return
90 |
91 | var startEvent = $.Event('hide.bs.collapse')
92 | this.$element.trigger(startEvent)
93 | if (startEvent.isDefaultPrevented()) return
94 |
95 | var dimension = this.dimension()
96 |
97 | this.$element
98 | [dimension](this.$element[dimension]())
99 | [0].offsetHeight
100 |
101 | this.$element
102 | .addClass('collapsing')
103 | .removeClass('collapse')
104 | .removeClass('in')
105 |
106 | this.transitioning = 1
107 |
108 | var complete = function () {
109 | this.transitioning = 0
110 | this.$element
111 | .trigger('hidden.bs.collapse')
112 | .removeClass('collapsing')
113 | .addClass('collapse')
114 | }
115 |
116 | if (!$.support.transition) return complete.call(this)
117 |
118 | this.$element
119 | [dimension](0)
120 | .one($.support.transition.end, $.proxy(complete, this))
121 | .emulateTransitionEnd(350)
122 | }
123 |
124 | Collapse.prototype.toggle = function () {
125 | this[this.$element.hasClass('in') ? 'hide' : 'show']()
126 | }
127 |
128 |
129 | // COLLAPSE PLUGIN DEFINITION
130 | // ==========================
131 |
132 | var old = $.fn.collapse
133 |
134 | $.fn.collapse = function (option) {
135 | return this.each(function () {
136 | var $this = $(this)
137 | var data = $this.data('bs.collapse')
138 | var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
139 |
140 | if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
141 | if (typeof option == 'string') data[option]()
142 | })
143 | }
144 |
145 | $.fn.collapse.Constructor = Collapse
146 |
147 |
148 | // COLLAPSE NO CONFLICT
149 | // ====================
150 |
151 | $.fn.collapse.noConflict = function () {
152 | $.fn.collapse = old
153 | return this
154 | }
155 |
156 |
157 | // COLLAPSE DATA-API
158 | // =================
159 |
160 | $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
161 | var $this = $(this), href
162 | var target = $this.attr('data-target')
163 | || e.preventDefault()
164 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
165 | var $target = $(target)
166 | var data = $target.data('bs.collapse')
167 | var option = data ? 'toggle' : $this.data()
168 | var parent = $this.attr('data-parent')
169 | var $parent = parent && $(parent)
170 |
171 | if (!data || !data.transitioning) {
172 | if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
173 | $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
174 | }
175 |
176 | $target.collapse(option)
177 | })
178 |
179 | }(jQuery);
180 |
--------------------------------------------------------------------------------
/assets/js/plugins/bootstrap/dropdown.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: dropdown.js v3.0.3
3 | * http://getbootstrap.com/javascript/#dropdowns
4 | * ========================================================================
5 | * Copyright 2013 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 ($) { "use strict";
22 |
23 | // DROPDOWN CLASS DEFINITION
24 | // =========================
25 |
26 | var backdrop = '.dropdown-backdrop'
27 | var toggle = '[data-toggle=dropdown]'
28 | var Dropdown = function (element) {
29 | $(element).on('click.bs.dropdown', this.toggle)
30 | }
31 |
32 | Dropdown.prototype.toggle = function (e) {
33 | var $this = $(this)
34 |
35 | if ($this.is('.disabled, :disabled')) return
36 |
37 | var $parent = getParent($this)
38 | var isActive = $parent.hasClass('open')
39 |
40 | clearMenus()
41 |
42 | if (!isActive) {
43 | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
44 | // if mobile we use a backdrop because click events don't delegate
45 | $('
' . $element['#description'] . "
\n"; 109 | } 110 | 111 | $output .= "14 | | 15 | | 16 | | 17 | | |
---|---|---|---|---|
24 | | ||||
block_title; ?> |
31 | region_select; ?> | 32 |weight_select; ?> | 33 |configure_link; ?> | 34 |delete_link; ?> | 35 |