├── .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 | [![Gitter](https://badges.gitter.im/Join Chat.svg)](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 | $('\n"; 112 | 113 | return $output; 114 | } 115 | } 116 | 117 | 118 | /** 119 | * Implimenting hook_form_element_label() 120 | */ 121 | function BootstrapBlocks_form_element_label(&$variables) { 122 | $element = $variables['element']; 123 | //This is also used in the installer, pre-database setup. 124 | $t = get_t(); 125 | 126 | //If title and required marker are both empty, output no label. 127 | if ((!isset($element['#title']) || $element['#title'] === '') && empty($element['#required'])) { 128 | return ''; 129 | } 130 | 131 | //If the element is required, a required marker is appended to the label. 132 | $required = !empty($element['#required']) ? theme('form_required_marker', array('element' => $element)) : ''; 133 | 134 | $title = filter_xss_admin($element['#title']); 135 | 136 | $attributes = array(); 137 | //Style the label as class option to display inline with the element. 138 | if ($element['#title_display'] == 'after') { 139 | $attributes['class'][] = 'option'; 140 | $attributes['class'][] = $element['#type']; 141 | } 142 | //Show label only to screen readers to avoid disruption in flows. 143 | elseif ($element['#title_display'] == 'invisible') { 144 | $attributes['class'][] = 'element-invisible'; 145 | } 146 | 147 | if (!empty($element['#id'])) { 148 | $attributes['for'] = $element['#id']; 149 | } 150 | 151 | $attributes['class'][] = 'control-label'; 152 | 153 | $output = ''; 154 | if ( isset($variables['#children']) ) { 155 | $output .= $variables['#children']; 156 | } 157 | 158 | $output .= $t('!title !required', array('!title' => $title, '!required' => $required)); 159 | 160 | //The leading whitespace helps visually separate fields from inline labels. 161 | return ' ' . $output . "\n"; 162 | } 163 | 164 | /** 165 | * Overriding theme_progress_bar() 166 | */ 167 | function BootstrapBlocks_progress_bar($variables) { 168 | $variables['attributes']['class'][] = 'progress'; 169 | $variables['attributes']['class'][] = 'progress-striped'; 170 | 171 | return '
'; 172 | } 173 | 174 | /** 175 | * Overrides theme_date(). 176 | */ 177 | function BootstrapBlocks_date($variables) { 178 | $element = $variables['element']; 179 | 180 | $attributes = array(); 181 | if (isset($element['#id'])) { 182 | $attributes['id'] = $element['#id']; 183 | } 184 | if (!empty($element['#attributes']['class'])) { 185 | $attributes['class'] = (array) $element['#attributes']['class']; 186 | } 187 | $attributes['class'][] = 'form-inline'; 188 | 189 | return '' . drupal_render_children($element) . ''; 190 | } 191 | -------------------------------------------------------------------------------- /lib/lists.inc: -------------------------------------------------------------------------------- 1 | ' . $title . ''; 19 | } 20 | 21 | if (!empty($items)) { 22 | $output .= "<$type" . drupal_attributes($attributes) . '>'; 23 | $num_items = count($items); 24 | $i = 0; 25 | foreach ($items as $item) { 26 | $attributes = array(); 27 | $children = array(); 28 | $data = ''; 29 | $i++; 30 | if (is_array($item)) { 31 | foreach ($item as $key => $value) { 32 | if ($key == 'data') { 33 | $data = $value; 34 | } 35 | elseif ($key == 'children') { 36 | $children = $value; 37 | } 38 | else { 39 | $attributes[$key] = $value; 40 | } 41 | } 42 | } 43 | else { 44 | $data = $item; 45 | } 46 | if (count($children) > 0) { 47 | // Render nested list. 48 | $data .= theme('item_list', array( 49 | 'items' => $children, 50 | 'title' => NULL, 51 | 'type' => $type, 52 | 'attributes' => $attributes, 53 | )); 54 | } 55 | if ($i == 1) { 56 | $attributes['class'][] = 'first'; 57 | } 58 | if ($i == $num_items) { 59 | $attributes['class'][] = 'last'; 60 | } 61 | $output .= '' . $data . "\n"; 62 | } 63 | $output .= ""; 64 | } 65 | 66 | return $output; 67 | } 68 | -------------------------------------------------------------------------------- /lib/menus.inc: -------------------------------------------------------------------------------- 1 | ' . $vars['tree'] . ''; 13 | } 14 | 15 | /** 16 | * Implimenting hook_menu_tree() 17 | * Adding active class to active LIs 18 | */ 19 | function BootstrapBlocks_preprocess_menu_link(&$vars) { 20 | if ($vars['element']['#href'] == $_GET['q'] || (drupal_is_front_page() && $vars['element']['#href'] === '')) { 21 | $vars['element']['#attributes']['class'][] = 'active'; 22 | } 23 | } 24 | 25 | /** 26 | * Implimenting hook_menu_local_tasks() 27 | * Bootstrapping Tabs 28 | */ 29 | function BootstrapBlocks_menu_local_tasks(&$vars) { 30 | $output = ''; 31 | 32 | if (!empty($vars['primary'])) { 33 | $vars['primary']['#prefix'] = ''; 35 | $output .= drupal_render($vars['primary']); 36 | } 37 | 38 | if (!empty($vars['secondary'])) { 39 | $vars['secondary']['#prefix'] = ''; 41 | $output .= drupal_render($vars['secondary']); 42 | } 43 | 44 | return $output; 45 | } 46 | -------------------------------------------------------------------------------- /lib/messages.inc: -------------------------------------------------------------------------------- 1 | $messages) { 34 | $output .= '
35 | '; 36 | 37 | foreach ($messages as $message) { 38 | $output .= $message . '
'; 39 | } 40 | $output .= '
'; 41 | } 42 | return $output; 43 | } 44 | -------------------------------------------------------------------------------- /lib/pagers.inc: -------------------------------------------------------------------------------- 1 | $pager_max) { 26 | $i = $i + ($pager_max - $pager_last); 27 | $pager_last = $pager_max; 28 | } 29 | if ($i <= 0) { 30 | $pager_last = $pager_last + (1 - $i); 31 | $i = 1; 32 | } 33 | 34 | // End of generation loop preparation. 35 | $li_first = theme('pager_first', array('text' => (isset($tags[0]) ? $tags[0] : t('first')), 'element' => $element, 'parameters' => $parameters)); 36 | $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('previous')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters)); 37 | $li_next = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('next')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters)); 38 | $li_last = theme('pager_last', array('text' => (isset($tags[4]) ? $tags[4] : t('last')), 'element' => $element, 'parameters' => $parameters)); 39 | 40 | if ($pager_total[$element] > 1) { 41 | if ($li_previous) { 42 | $items[] = array( 43 | 'class' => array('prev'), 44 | 'data' => $li_previous, 45 | ); 46 | } 47 | 48 | // When there is more than one page, create the pager list. 49 | if ($i != $pager_max) { 50 | if ($i > 1) { 51 | $items[] = array( 52 | 'class' => array('pager-ellipsis'), 53 | 'data' => '…', 54 | ); 55 | } 56 | // Now generate the actual pager piece. 57 | for (; $i <= $pager_last && $i <= $pager_max; $i++) { 58 | if ($i < $pager_current) { 59 | $items[] = array( 60 | 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($pager_current - $i), 'parameters' => $parameters)), 61 | ); 62 | } 63 | if ($i == $pager_current) { 64 | $items[] = array( 65 | 'class' => array('active'), // Add the active class 66 | 'data' => l($i, '#', array('fragment' => '','external' => TRUE)), 67 | ); 68 | } 69 | if ($i > $pager_current) { 70 | $items[] = array( 71 | 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $pager_current), 'parameters' => $parameters)), 72 | ); 73 | } 74 | } 75 | if ($i < $pager_max) { 76 | $items[] = array( 77 | 'class' => array('pager-ellipsis'), 78 | 'data' => '…', 79 | ); 80 | } 81 | } 82 | // End generation. 83 | if ($li_next) { 84 | $items[] = array( 85 | 'class' => array('next'), 86 | 'data' => $li_next, 87 | ); 88 | } 89 | 90 | return theme('item_list', array( 91 | 'items' => $items, 92 | 'attributes' => array('class' => array('pagination')) 93 | )); 94 | } 95 | 96 | return $output; 97 | } 98 | -------------------------------------------------------------------------------- /lib/tables.inc: -------------------------------------------------------------------------------- 1 | '. theme_get_setting('footer_scripts') . ''; 21 | } 22 | return NULL; 23 | } 24 | 25 | /* 26 | * Return touch icons 27 | * @return 28 | * Apple Touch Icons in all the right sizes. 29 | */ 30 | function BootstrapBlocks_touch_icons() { 31 | if (theme_get_setting('touch_icons_on_off') == 0) { return; } 32 | 33 | $windows_title = theme_get_setting('windows_title'); 34 | if (empty($windows_title)) { $windows_title = variable_get('site_name'); } 35 | 36 | $path = '/'.drupal_get_path('theme', 'BootstrapBlocks').'/assets/img/icons/'; 37 | $output = '' . "\n"; 38 | $output .= '' . "\n"; 39 | $output .= '' . "\n"; 40 | $output .= '' . "\n"; 41 | $output .= ''; 42 | $output .= ''; 43 | $output .= ''; 44 | return $output; 45 | } 46 | 47 | /* 48 | * Return Author Link 49 | * @return 50 | * Link tag for the Google+ author that owns the site 51 | */ 52 | function BootstrapBlocks_author() { 53 | if (theme_get_setting('author_id')) { 54 | return ''; 55 | } 56 | return NULL; 57 | } 58 | -------------------------------------------------------------------------------- /lib/templates/block-admin-display-form.tpl.php: -------------------------------------------------------------------------------- 1 | $title) { 6 | drupal_add_tabledrag('blocks', 'match', 'sibling', 'block-region-select', 'block-region-' . $region, NULL, FALSE); 7 | drupal_add_tabledrag('blocks', 'order', 'sibling', 'block-weight', 'block-weight-' . $region); 8 | } 9 | ?> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | $title): ?> 22 | 23 | 24 | 25 | 26 | 27 | 28 | $data): ?> 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |

block_title; ?>

region_select; ?>weight_select; ?>configure_link; ?>delete_link; ?>
41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/logo.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BootstrapBlocks", 3 | "version": "3.0.0", 4 | "author": "Patrick Coffey ", 5 | "homepage": "http://basethe.me", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/patrickocoffeyo/BaseBuildingBlocks" 9 | }, 10 | "bugs": { 11 | "url" : "https://github.com/patrickocoffeyo/BaseBuildingBlocks/issues" 12 | }, 13 | "licenses": [{ 14 | "type": "MIT", 15 | "url": "http://opensource.org/licenses/MIT" 16 | }], 17 | "engines": { 18 | "node": ">= 0.10.0" 19 | }, 20 | "devDependencies": { 21 | "grunt": "~0.4.2", 22 | "grunt-contrib-clean": "~0.5.0", 23 | "grunt-contrib-jshint": "~0.6.4", 24 | "grunt-contrib-uglify": "~0.2.4", 25 | "grunt-contrib-watch": "~0.5.3", 26 | "grunt-contrib-less": "~0.8.1" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/patrickocoffeyo/BootstrapBlocks/5de35b025b478131db045a531ee5bcc75477c66f/screenshot.png -------------------------------------------------------------------------------- /template.php: -------------------------------------------------------------------------------- 1 | type; 14 | $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->vid; 15 | } 16 | 17 | if (module_exists('jquery_update') == FALSE) { 18 | drupal_set_message(t('You must install the jQuery Update module for Bootstrap to work properly.', array('@url' => 'https://drupal.org/project/jquery_update')), 'error'); 19 | } 20 | } 21 | 22 | /** 23 | * Implimenting hook_css_alter() 24 | * Turning off some system.css files 25 | */ 26 | function BootstrapBlocks_css_alter(&$css) { 27 | // Turn off some styles from the system module 28 | unset($css[drupal_get_path('module', 'book') . '/book.css']); 29 | unset($css[drupal_get_path('module', 'comment') . '/comment.css']); 30 | unset($css[drupal_get_path('module', 'dblog') . '/dblog.css']); 31 | unset($css[drupal_get_path('module', 'file') . '/file.css']); 32 | unset($css[drupal_get_path('module', 'filter') . '/filter.css']); 33 | unset($css[drupal_get_path('module', 'forum') . '/forum.css']); 34 | unset($css[drupal_get_path('module', 'help') . '/help.css']); 35 | unset($css[drupal_get_path('module', 'menu') . '/menu.css']); 36 | unset($css[drupal_get_path('module', 'node') . '/node.css']); 37 | unset($css[drupal_get_path('module', 'openid') . '/openid.css']); 38 | unset($css[drupal_get_path('module', 'poll') . '/poll.css']); 39 | unset($css[drupal_get_path('module', 'search') . '/search.css']); 40 | unset($css[drupal_get_path('module', 'statistics') . '/statistics.css']); 41 | unset($css[drupal_get_path('module', 'syslog') . '/syslog.css']); 42 | unset($css[drupal_get_path('module', 'system') . '/system.maintenance.css']); 43 | unset($css[drupal_get_path('module', 'system') . '/system.menus.css']); 44 | unset($css[drupal_get_path('module', 'system') . '/system.messages.css']); 45 | unset($css[drupal_get_path('module', 'system') . '/system.theme.css']); 46 | unset($css[drupal_get_path('module', 'system') . '/system.admin.css']); 47 | unset($css[drupal_get_path('module', 'system') . '/system.base.css']); 48 | unset($css[drupal_get_path('module', 'system') . '/system.css']); 49 | unset($css[drupal_get_path('module', 'taxonomy') . '/taxonomy.css']); 50 | unset($css[drupal_get_path('module', 'tracker') . '/tracker.css']); 51 | unset($css[drupal_get_path('module', 'update') . '/update.css']); 52 | unset($css[drupal_get_path('module', 'user') . '/user.css']); 53 | unset($css[drupal_get_path('module', 'user') . '/user.css']); 54 | } 55 | 56 | 57 | /** 58 | * Implimenting hook_html_head_alter() 59 | */ 60 | function BootstrapBlocks_html_head_alter(&$vars) { 61 | //Change the meta content type to HTML5 content type 62 | $vars['system_meta_content_type']['#attributes'] = array( 63 | 'charset' => 'utf-8' 64 | ); 65 | 66 | //Unsetting the content generator. (Why keep it?) 67 | unset($vars['system_meta_generator']); 68 | 69 | //Adding the mobile viewport 70 | $vars['viewport'] = array( 71 | '#type' => 'html_tag', 72 | '#tag' => 'meta', 73 | '#attributes' => array( 74 | 'name' => 'viewport', 75 | 'content' => 'width=device-width, initial-scale=1.0', 76 | ) 77 | ); 78 | } 79 | -------------------------------------------------------------------------------- /templates/blocks/block.tpl.php: -------------------------------------------------------------------------------- 1 |
> 2 | 3 | subject): ?> 4 | >subject ?> 5 | 6 | 7 |
> 8 | 9 |
10 |
-------------------------------------------------------------------------------- /templates/fields/field.tpl.php: -------------------------------------------------------------------------------- 1 |
> 2 | 3 |
>
4 | 5 |
> 6 | $item): ?> 7 |
>
8 | 9 |
10 |
-------------------------------------------------------------------------------- /templates/html.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | > 6 | 7 | 8 | <?php echo $head_title; ?> 9 | 10 | 11 | 12 | 13 | 14 | > 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /templates/includes/page-head.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /templates/includes/page-title.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /templates/includes/page-utility.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /templates/nodes/node.tpl.php: -------------------------------------------------------------------------------- 1 |
> 2 | 3 | 4 | 5 | > 6 | 7 | 8 | 9 | 12 | 13 |
> 14 | 20 |
21 | 22 | 23 |
-------------------------------------------------------------------------------- /templates/page.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 |
26 | -------------------------------------------------------------------------------- /templates/regions/region--footer.tpl.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 | -------------------------------------------------------------------------------- /templates/regions/region--menu.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /templates/regions/region--sidebar_right.tpl.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /theme-settings.php: -------------------------------------------------------------------------------- 1 | 'fieldset', 8 | '#title' => t('Forms'), 9 | '#collapsible' => TRUE, 10 | '#collapsed' => TRUE, 11 | '#required' => TRUE, 12 | '#weight' => -20, 13 | ); 14 | $form['forms']['ignore_element_ids'] = array( 15 | '#type' => 'textarea', 16 | '#title' => t('Ignore Forms Elements'), 17 | '#description' => t('Some form elements do not jive well with being bootstrap-ized. List all form IDs that should not be modified, separated by |. A default list is provided.'), 18 | '#default_value' => theme_get_setting('ignore_element_ids'), 19 | ); 20 | $form['buttons'] = array( 21 | '#type' => 'fieldset', 22 | '#title' => t('Button Settings'), 23 | '#collapsible' => TRUE, 24 | '#collapsed' => TRUE, 25 | '#weight' => -40, 26 | ); 27 | $form['buttons']['button_classes'] = array( 28 | '#type' => 'textarea', 29 | '#title' => t('Button Classes'), 30 | '#description' => t('Determines what bootstrap classes should be added to buttons based off of the button title. (For example: Button Title | btn-class)'), 31 | '#default_value' => theme_get_setting('button_classes'), 32 | ); 33 | $form['touch_icons'] = array( 34 | '#type' => 'fieldset', 35 | '#title' => 'Touch Icons', 36 | '#collapsible' => TRUE, 37 | '#description' => t('Settings for touch icons. All touch icons are located in themedir/assets/img/icons/touch-icon-*device.png.'), 38 | '#collapsed' => TRUE, 39 | '#required' => TRUE, 40 | '#weight' => -20, 41 | ); 42 | $form['touch_icons']['touch_icons_on_off'] = array( 43 | '#type' => 'checkbox', 44 | '#title' => t('Touch Icons'), 45 | '#description' => t('If enabled, adds touch icons to your site.'), 46 | '#default_value' => theme_get_setting('touch_icons_on_off'), 47 | ); 48 | $form['touch_icons']['windows_title'] = array( 49 | '#type' => 'textfield', 50 | '#title' => t('Windows Start Screen Title'), 51 | '#description' => t('Your site can be added to the Windows 8 start screen. This title will be used. Defaults to site name.'), 52 | '#default_value' => theme_get_setting('windows_title'), 53 | ); 54 | $form['touch_icons']['windows_color'] = array( 55 | '#type' => 'textfield', 56 | '#title' => t('Windows Start Screen Color'), 57 | '#description' => t('This color will be used as the tile color on the Windows 8 start screen. Defaults to white.'), 58 | '#default_value' => theme_get_setting('windows_color'), 59 | ); 60 | $form['seo'] = array( 61 | '#type' => 'fieldset', 62 | '#title' => 'SEO and Social Settings', 63 | '#collapsible' => TRUE, 64 | '#collapsed' => TRUE, 65 | '#required' => TRUE, 66 | '#weight' => -20, 67 | ); 68 | $form['seo']['footer_scripts'] = array( 69 | '#type' => 'textarea', 70 | '#title' => t('Footer Scripts'), 71 | '#description' => t('Footer scripts for external services, such as Google Analytic tracking scripts, Online Chat Assistance scripts, etc. Do not add any script tags.'), 72 | '#default_value' => theme_get_setting('footer_scripts'), 73 | ); 74 | $form['seo']['author_id'] = array( 75 | '#type' => 'textfield', 76 | '#title' => t('Google+ Author ID'), 77 | '#description' => t('Adds a rel="author" link to the head of your site.'), 78 | '#default_value' => theme_get_setting('author_id'), 79 | ); 80 | $form['seo']['social'] = array( 81 | '#type' => 'fieldset', 82 | '#title' => 'Social Links', 83 | '#description' => t('Links to social accounts related to the site. For use in your theming. (echo theme_get_setting("servicename_link");). These are not used by default in BBB, and you can add more in theme-settings.php.'), 84 | '#collapsible' => TRUE, 85 | '#collapsed' => TRUE, 86 | '#required' => TRUE, 87 | '#weight' => -20, 88 | ); 89 | $form['seo']['social']['twitter_link'] = array( 90 | '#type' => 'textfield', 91 | '#title' => t('Twitter Link'), 92 | '#description' => t('Full URL to Twitter account belonging to site.'), 93 | '#default_value' => theme_get_setting('twitter_link'), 94 | ); 95 | $form['seo']['social']['facebook_link'] = array( 96 | '#type' => 'textfield', 97 | '#title' => t('Facebook Link'), 98 | '#description' => t('Full URL to Facebook account belonging to site.'), 99 | '#default_value' => theme_get_setting('facebook_link'), 100 | ); 101 | $form['seo']['social']['youtube_link'] = array( 102 | '#type' => 'textfield', 103 | '#title' => t('Youtube Link'), 104 | '#description' => t('Full URL to Youtube account belonging to site.'), 105 | '#default_value' => theme_get_setting('youtube_link'), 106 | ); 107 | $form['seo']['social']['linkedin_link'] = array( 108 | '#type' => 'textfield', 109 | '#title' => t('LinkedIn Link'), 110 | '#description' => t('Full URL to LinkedIn account belonging to site.'), 111 | '#default_value' => theme_get_setting('linkedin_link'), 112 | ); 113 | $form['seo']['social']['google+_link'] = array( 114 | '#type' => 'textfield', 115 | '#title' => t('Google+ Link'), 116 | '#description' => t('Full URL to Google+ account belonging to site.'), 117 | '#default_value' => theme_get_setting('google+_link'), 118 | ); 119 | return $form; 120 | } 121 | --------------------------------------------------------------------------------