Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-38016 Themes - Add a bootstrap theme to core

This theme has been contributed by:
Bas Brands <bmbrands@gmail.com>
David Scotson <david.scotson@glasgow.ac.uk>
Michael Aherne <michael.aherne@strath.ac.uk>
Stuart Lamour <thisismyrice@gmail.com>

Thanks for your hard work.
  • Loading branch information...
commit 8903b17b01463def54d329fc9c4283341e1ff3d1 1 parent 6363769
@bmbrands bmbrands authored damyon committed
Showing with 15,485 additions and 0 deletions.
  1. +151 −0 theme/bootstrap/README.txt
  2. +166 −0 theme/bootstrap/config.php
  3. +224 −0 theme/bootstrap/javascript/bootstrapcollapse.js
  4. +115 −0 theme/bootstrap/javascript/bootstrapdropdown.js
  5. +274 −0 theme/bootstrap/javascript/bootstrapengine.js
  6. +10 −0 theme/bootstrap/javascript/headercollapse.js
  7. +301 −0 theme/bootstrap/javascript/html5shiv.js
  8. +28 −0 theme/bootstrap/javascript/moodlebootstrap.js
  9. +70 −0 theme/bootstrap/lang/en/theme_bootstrap.php
  10. +171 −0 theme/bootstrap/layout/general.php
  11. +19 −0 theme/bootstrap/less/README
  12. +34 −0 theme/bootstrap/less/bootstrap/accordion.less
  13. +79 −0 theme/bootstrap/less/bootstrap/alerts.less
  14. +63 −0 theme/bootstrap/less/bootstrap/bootstrap.less
  15. +24 −0 theme/bootstrap/less/bootstrap/breadcrumbs.less
  16. +229 −0 theme/bootstrap/less/bootstrap/button-groups.less
  17. +228 −0 theme/bootstrap/less/bootstrap/buttons.less
  18. +158 −0 theme/bootstrap/less/bootstrap/carousel.less
  19. +32 −0 theme/bootstrap/less/bootstrap/close.less
  20. +61 −0 theme/bootstrap/less/bootstrap/code.less
  21. +22 −0 theme/bootstrap/less/bootstrap/component-animations.less
  22. +237 −0 theme/bootstrap/less/bootstrap/dropdowns.less
  23. +690 −0 theme/bootstrap/less/bootstrap/forms.less
  24. +21 −0 theme/bootstrap/less/bootstrap/grid.less
  25. +25 −0 theme/bootstrap/less/bootstrap/hero-unit.less
  26. +84 −0 theme/bootstrap/less/bootstrap/labels-badges.less
  27. +16 −0 theme/bootstrap/less/bootstrap/layouts.less
  28. +55 −0 theme/bootstrap/less/bootstrap/media.less
  29. +702 −0 theme/bootstrap/less/bootstrap/mixins.less
  30. +95 −0 theme/bootstrap/less/bootstrap/modals.less
  31. +497 −0 theme/bootstrap/less/bootstrap/navbar.less
  32. +409 −0 theme/bootstrap/less/bootstrap/navs.less
  33. +43 −0 theme/bootstrap/less/bootstrap/pager.less
  34. +123 −0 theme/bootstrap/less/bootstrap/pagination.less
  35. +133 −0 theme/bootstrap/less/bootstrap/popovers.less
  36. +122 −0 theme/bootstrap/less/bootstrap/progress-bars.less
  37. +216 −0 theme/bootstrap/less/bootstrap/reset.less
  38. +28 −0 theme/bootstrap/less/bootstrap/responsive-1200px-min.less
  39. +193 −0 theme/bootstrap/less/bootstrap/responsive-767px-max.less
  40. +19 −0 theme/bootstrap/less/bootstrap/responsive-768px-979px.less
  41. +189 −0 theme/bootstrap/less/bootstrap/responsive-navbar.less
  42. +59 −0 theme/bootstrap/less/bootstrap/responsive-utilities.less
  43. +48 −0 theme/bootstrap/less/bootstrap/responsive.less
  44. +53 −0 theme/bootstrap/less/bootstrap/scaffolding.less
  45. +197 −0 theme/bootstrap/less/bootstrap/sprites.less
  46. +244 −0 theme/bootstrap/less/bootstrap/tables.less
  47. +53 −0 theme/bootstrap/less/bootstrap/thumbnails.less
  48. +70 −0 theme/bootstrap/less/bootstrap/tooltip.less
  49. +247 −0 theme/bootstrap/less/bootstrap/type.less
  50. +30 −0 theme/bootstrap/less/bootstrap/utilities.less
  51. +301 −0 theme/bootstrap/less/bootstrap/variables.less
  52. +29 −0 theme/bootstrap/less/bootstrap/wells.less
  53. +30 −0 theme/bootstrap/less/editor.less
  54. +55 −0 theme/bootstrap/less/moodle.less
  55. +720 −0 theme/bootstrap/less/moodle/admin.less
  56. +164 −0 theme/bootstrap/less/moodle/backup-restore.less
  57. +313 −0 theme/bootstrap/less/moodle/blocks.less
  58. +62 −0 theme/bootstrap/less/moodle/buttons.less
  59. +186 −0 theme/bootstrap/less/moodle/calendar.less
  60. +1,703 −0 theme/bootstrap/less/moodle/core.less
  61. +565 −0 theme/bootstrap/less/moodle/course.less
  62. +67 −0 theme/bootstrap/less/moodle/debug.less
  63. +76 −0 theme/bootstrap/less/moodle/expendable.less
  64. +1,150 −0 theme/bootstrap/less/moodle/filemanager.less
  65. +318 −0 theme/bootstrap/less/moodle/forms.less
  66. +588 −0 theme/bootstrap/less/moodle/grade.less
  67. +183 −0 theme/bootstrap/less/moodle/message.less
  68. +133 −0 theme/bootstrap/less/moodle/modules.less
  69. +394 −0 theme/bootstrap/less/moodle/question.less
  70. +5 −0 theme/bootstrap/less/moodle/recess.txt
  71. +367 −0 theme/bootstrap/less/moodle/responsive.less
  72. +6 −0 theme/bootstrap/less/moodle/tables.less
  73. +65 −0 theme/bootstrap/less/moodle/tabs.less
  74. +187 −0 theme/bootstrap/less/moodle/undo.less
  75. +172 −0 theme/bootstrap/less/moodle/user.less
  76. +10 −0 theme/bootstrap/less/moodle/yui_fixes.less
  77. BIN  theme/bootstrap/pix/favicon.ico
  78. BIN  theme/bootstrap/pix/fp/alias.png
  79. BIN  theme/bootstrap/pix/fp/alias_sm.png
  80. BIN  theme/bootstrap/pix/fp/check.png
  81. BIN  theme/bootstrap/pix/fp/cross.png
  82. BIN  theme/bootstrap/pix/fp/dnd_arrow.gif
  83. BIN  theme/bootstrap/pix/fp/link.png
  84. BIN  theme/bootstrap/pix/fp/link_sm.png
  85. BIN  theme/bootstrap/pix/fp/path_folder.png
  86. BIN  theme/bootstrap/pix/fp/path_folder_rtl.png
  87. BIN  theme/bootstrap/pix/fp/view_icon_active.png
  88. BIN  theme/bootstrap/pix/fp/view_icon_inactive.png
  89. BIN  theme/bootstrap/pix/fp/view_icon_selected.png
  90. BIN  theme/bootstrap/pix/fp/view_list_active.png
  91. BIN  theme/bootstrap/pix/fp/view_list_inactive.png
  92. BIN  theme/bootstrap/pix/fp/view_list_selected.png
  93. BIN  theme/bootstrap/pix/fp/view_tree_active.png
  94. BIN  theme/bootstrap/pix/fp/view_tree_inactive.png
  95. BIN  theme/bootstrap/pix/fp/view_tree_selected.png
  96. BIN  theme/bootstrap/pix/glyphicons-halflings-white.png
  97. BIN  theme/bootstrap/pix/glyphicons-halflings.png
  98. BIN  theme/bootstrap/pix/header.jpg
  99. BIN  theme/bootstrap/pix/horizontal-menu-submenu-indicator.png
  100. BIN  theme/bootstrap/pix/screenshot.jpg
  101. BIN  theme/bootstrap/pix/sprite.png
  102. BIN  theme/bootstrap/pix/vertical-menu-submenu-indicator.png
  103. BIN  theme/bootstrap/pix/yui2-treeview-sprite-rtl.gif
  104. +47 −0 theme/bootstrap/readme_moodle.txt
  105. +26 −0 theme/bootstrap/renderers.php
  106. +160 −0 theme/bootstrap/renderers/core.php
  107. +3 −0  theme/bootstrap/style/README
  108. +1 −0  theme/bootstrap/style/editor.css
  109. +9 −0 theme/bootstrap/style/generated.css
  110. +33 −0 theme/bootstrap/version.php
View
151 theme/bootstrap/README.txt
@@ -0,0 +1,151 @@
+About this theme
+================
+
+This is the Bootstrap theme for Moodle.
+
+* package Moodle Bootstrap theme
+* copyright 2013 Bas Brands. www.sonsbeekmedia.nl
+* authors Bas Brands, David Scotson
+* license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+
+This theme has been created with the help of:
+Stuart Lamour, Mark Aberdour, Paul Hibbitts, Mary Evans
+
+This theme is based on the Twitter Bootstrap CSS framework version 2.3.
+It contains all unmodified less* CSS sources from the Twitter Bootstrap CSS
+framework in folder /less/bootstrap.
+On top of the Bootstrap less CSS sources Moodle CSS is added to create this
+theme.
+
+HTML5 is tags are used in the /layout/general.php file. The structure of this file
+provides a 2-1-3 layout when looking at your Moodle page source. This improves
+accessibility and Search Engine Optimization (SEO).
+
+*less CSS
+Less CSS is a Object Oriented way of writing CSS code. All Less CSS files
+for this theme are stored in the /less folder. A developer can run a command
+line script to generate the single CSS file called /style/generated.css. For more
+information read /less/README
+
+JavaScript Libraries
+
+html5shiv.js
+------------
+To provide backwards compatibility for HTML5 for Internet Explorer 7 (IE7) and Internet
+Explorer 8 (IE8) a javascript library call /javascript/html5shiv.js was added. This
+JavaScript converts HTML tags and CSS into Tag that are understood by IE7 and IE8.
+The config.php makes sure these libraries are only loaded for IE7 and IE8.
+
+bootstrapcollapse.js, bootstrapdropdown.js, bootstrapengine.js
+--------------------------------------------------------------
+These are the 3 out of 12 original YUI ports of the Twitter Bootstrap jQuery libraries by
+Jay Shirley. The full list of the ported libraries can be found here:
+https://github.com/jshirley/bootstrap/tree/master/js
+
+moodlebootstrap.js
+------------------
+This file initiates the bootstrap*.js libraries.
+
+headercollapse.js
+-----------------
+Workaround for the collapse button on the Moodle custom menu. Without this
+Submenu items cannot be opened
+
+
+Updating Twitter bootstrap and Libraries
+========================================
+
+Twitter bootstrap
+-----------------
+This theme uses the original unmodified version 2.3.0 Twitter bootstrap less files. These are
+Object Oriented CSS files. The bootstrap repository is available on:
+
+https://github.com/twitter/bootstrap.git
+
+To update to the latest release of twitter bootstrap remove all files from less/bootstrap,
+download the new less files and store them in less/bootstrap
+Inclusion of bootstrap files is configured in less/moodle.less. To generate the new
+Moodle CSS read /less/README
+
+html5shiv.js
+------------
+This theme uses the original unmodified html5shiv.js JavaScript library to enable HTML5 tags in IE7 and IE8.
+This library is available on:
+
+https://github.com/aFarkas/html5shiv/blob/master/src/html5shiv.js
+
+To update to the latest release of html5shiv download and replace:
+javascript/html5shiv.js
+
+bootstrapcollapse.js, bootstrapdropdown.js, bootstrapengine.js
+--------------------------------------------------------------
+This them uses YUI ports of the Twitter bootstrap jQuery based libs. These ported files are available on:
+
+https://github.com/jshirley/yui3-gallery/blob/master/src/gallery-bootstrap-collapse/js/bootstrap-collapse.js
+https://github.com/jshirley/yui3-gallery/blob/master/src/gallery-bootstrap-dropdown/js/bootstrap-dropdown.js
+https://github.com/jshirley/yui3-gallery/blob/master/src/gallery-bootstrap-engine/js/bootstrap-engine.js
+
+The content of these files are slightly modified to make sure all required YUI libraries are loaded. To achieve
+that the first and last line of each of these files has been modified.
+
+The YUI port of the Twitter bootstrap libs are now longer maintained. If you need all of the Bootstrap JavaScript
+functionality consider switching to the original jQuery version of these file
+
+If you do want to update use these file locations:
+javascript/bootstrap-collapse.js
+javascript/bootstrap-dropdown.js
+javascript/bootstrap-engine.js
+
+
+Licenses & Authors
+==================
+
+Twitter Bootstrap Copyright and license
+---------------------------------------
+Authors: Mark Otto, Jacob Thornton
+URL: http://twitter.github.com/bootstrap/
+License:
+
+Copyright 2012 Twitter, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this work except in compliance with the License.
+You may obtain a copy of the License in the LICENSE file, or at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Html5shiv.js
+------------
+Author: Sjoerd Visscher
+URL: http://en.wikipedia.org/wiki/HTML5_Shiv, https://github.com/aFarkas/html5shiv
+License: MIT/GPL2 Licensed
+
+bootstrapcollapse.js, bootstrapdropdown.js, bootstrapengine.js
+--------------------------------------------------------------
+Author: Jay Shirley
+URL: http://jshirley.github.com/bootstrap/
+License:
+Copyright 2012 Twitter, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this work except in compliance with the License.
+You may obtain a copy of the License in the LICENSE file, or at:
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+moodlebootstrap.js
+------------------
+Author: 2013 Bas Brands. www.sonsbeekmedia.nl
+license: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
View
166 theme/bootstrap/config.php
@@ -0,0 +1,166 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Configuration for Moodle's bootstrap theme.
+ *
+ * DO NOT MODIFY THIS THEME!
+ * COPY IT FIRST, THEN RENAME THE COPY AND MODIFY IT INSTEAD.
+ *
+ * For full information about creating Moodle themes, see:
+ * http://docs.moodle.org/dev/Themes_2.0
+ *
+ * @package Moodle Bootstrap theme
+ * @copyright 2013 Bas Brands. www.sonsbeekmedia.nl
+ * @authors Bas Brands, David Scotson
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$THEME->doctype = 'html5';
+$THEME->yuicssmodules = array();
+$THEME->name = 'bootstrap';
+$THEME->parents = array('');
+$THEME->sheets = array('generated');
+$THEME->supportscssoptimisation = false;
+
+$THEME->editor_sheets = array('editor');
+
+
+$THEME->plugins_exclude_sheets = array(
+ 'block' => array(
+ 'settings',
+ 'navigation',
+ 'html'
+ ),
+ 'gradereport' => array(
+ 'grader',
+ ),
+);
+
+$THEME->rendererfactory = 'theme_overridden_renderer_factory';
+
+$THEME->layouts = array(
+ 'base' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre',
+ ),
+ 'standard' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre',
+ ),
+ 'course' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre'
+ ),
+ 'coursecategory' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre',
+ ),
+ 'incourse' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre',
+ ),
+ 'frontpage' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre'),
+ 'defaultregion' => 'side-pre',
+ 'options' => array('nonavbar'=>true),
+ ),
+ 'admin' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre'),
+ 'defaultregion' => 'side-pre',
+ ),
+ 'mydashboard' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre',
+ 'options' => array('langmenu'=>true),
+ ),
+ 'mypublic' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre',
+ ),
+ 'login' => array(
+ 'file' => 'general.php',
+ 'regions' => array(),
+ 'options' => array('langmenu'=>true),
+ 'options' => array('nonavbar'=>true, 'noheader'=>true),
+ ),
+ 'popup' => array(
+ 'file' => 'general.php',
+ 'regions' => array(),
+ 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true),
+ ),
+ 'frametop' => array(
+ 'file' => 'general.php',
+ 'regions' => array(),
+ 'options' => array('nofooter'=>true),
+ ),
+ 'maintenance' => array(
+ 'file' => 'general.php',
+ 'regions' => array(),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ ),
+ 'embedded' => array(
+ 'theme' => 'canvas',
+ 'file' => 'embedded.php',
+ 'regions' => array(),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ ),
+ 'print' => array(
+ 'file' => 'general.php',
+ 'regions' => array(),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
+ ),
+ 'redirect' => array(
+ 'file' => 'general.php',
+ 'regions' => array(),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
+ ),
+ 'report' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre'),
+ 'defaultregion' => 'side-pre',
+ ),
+ // The pagelayout used for safebrowser and securewindow.
+ 'secure' => array(
+ 'file' => 'general.php',
+ 'regions' => array('side-pre', 'side-post'),
+ 'defaultregion' => 'side-pre',
+ 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true,
+ 'nologinlinks'=>true, 'nocourseheaderfooter'=>true),
+ ),
+);
+
+$THEME->javascripts = array(
+ 'bootstrapengine',
+ 'moodlebootstrap',
+ 'bootstrapcollapse',
+ 'bootstrapdropdown',
+ 'headercollapse',
+);
+
+if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8') || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') ) {
+ $THEME->javascripts[] = 'html5shiv';
+}
+
View
224 theme/bootstrap/javascript/bootstrapcollapse.js
@@ -0,0 +1,224 @@
+YUI.add('gallery-bootstrap-collapse', function(Y) {
+
+/**
+A Plugin which provides collapsing/expanding behaviors on a Node with
+compatible syntax and markup from Twitter's Bootstrap project.
+
+@module gallery-bootstrap-collapse
+**/
+
+/**
+A Plugin which provides collapsing and expanding behaviors on a Node with
+compatible syntax and markup from Twitter's Bootstrap project.
+
+It possible to have dynamic behaviors without incorporating any
+JavaScript by setting <code>data-toggle=collapse</code> on any element.
+
+However, it can be manually plugged into any node or node list.
+
+@example
+
+ var node = Y.one('.someNode');
+ node.plug( Y.Bootstrap.Collapse, config );
+
+ node.collapse.show();
+
+@class Bootstrap.Collapse
+**/
+
+function CollapsePlugin(config) {
+ CollapsePlugin.superclass.constructor.apply(this, arguments);
+}
+
+CollapsePlugin.NAME = 'Bootstrap.Collapse';
+CollapsePlugin.NS = 'collapse';
+
+Y.extend(CollapsePlugin, Y.Plugin.Base, {
+ defaults : {
+ duration : 0.25,
+ easing : 'ease-in',
+ showClass : 'in',
+ hideClass : 'out',
+
+ groupSelector : '> .accordion-group > .in'
+ },
+
+ transitioning: false,
+
+ initializer : function(config) {
+ this._node = config.host;
+
+ this.config = Y.mix( config, this.defaults );
+
+ this.publish('show', { preventable : true, defaultFn : this.show });
+ this.publish('hide', { preventable : true, defaultFn : this.hide });
+
+ this._node.on('click', this.toggle, this);
+ },
+
+ _getTarget: function() {
+ var node = this._node,
+ container;
+
+ if ( node.getData('target') ) {
+ container = Y.one( node.getData('target') );
+ }
+ else if ( node.getAttribute('href').indexOf('#') >= 0 ) {
+ Y.log('No target, looking at href: ' + node.getAttribute('href'), 'debug', 'Bootstrap.Collapse');
+ container = Y.one( node.getAttribute('href').substr( node.getAttribute('href').indexOf('#') ) );
+ }
+ return container;
+ },
+
+ /**
+ * @method hide
+ * @description Hide the collapsible target, specified by the host's
+ * <code>data-target</code> or <code>href</code> attribute.
+ */
+ hide: function() {
+ var showClass = this.config.showClass,
+ hideClass = this.config.hideClass,
+ node = this._getTarget();
+
+ if ( this.transitioning ) {
+ return;
+ }
+
+ if ( node ) {
+ this._hideElement(node);
+ }
+ },
+
+ /**
+ * @method show
+ * @description Show the collapsible target, specified by the host's
+ * <code>data-target</code> or <code>href</code> attribute.
+ */
+ show: function() {
+ var showClass = this.config.showClass,
+ hideClass = this.config.hideClass,
+ node = this._getTarget(),
+ host = this._node,
+ self = this,
+ parent,
+ group_selector = this.config.groupSelector;
+
+ if ( this.transitioning ) {
+ return;
+ }
+
+ if ( host.getData('parent') ) {
+ parent = Y.one( host.getData('parent') );
+ if ( parent ) {
+ parent.all(group_selector).each( function(el) {
+ Y.log('Hiding element: ' + el, 'debug', 'Bootstrap.Collapse');
+ self._hideElement(el);
+ });
+ }
+ }
+ this._showElement(node);
+ },
+
+ /**
+ @method toggle
+ @description Toggle the state of the collapsible target, specified
+ by the host's <code>data-target</code> or <code>href</code>
+ attribute. Calls the <code>show</code> or <code>hide</code> method.
+ **/
+ toggle : function(e) {
+ if ( e && Y.Lang.isFunction(e.preventDefault) ) {
+ e.preventDefault();
+ }
+
+ var target = this._getTarget();
+
+ if ( target.hasClass( this.config.showClass ) ) {
+ this.fire('hide');
+ } else {
+ this.fire('show');
+ }
+ },
+
+ /**
+ @method _transition
+ @description Handles the transition between showing and hiding.
+ @protected
+ @param node {Node} node to apply transitions to
+ @param method {String} 'hide' or 'show'
+ **/
+ _transition : function(node, method) {
+ var self = this,
+ config = this.config,
+ duration = config.duration,
+ easing = config.easing,
+ // If we are hiding, then remove the show class.
+ removeClass = method === 'hide' ? config.showClass : config.hideClass,
+ // And if we are hiding, add the hide class.
+ addClass = method === 'hide' ? config.hideClass : config.showClass,
+
+ to_height = method === 'hide' ? 0 : null,
+ event = method === 'hide' ? 'hidden' : 'shown',
+
+ complete = function() {
+ node.removeClass(removeClass);
+ node.addClass(addClass);
+ self.transitioning = false;
+ this.fire( event );
+ };
+
+ if ( to_height === null ) {
+ to_height = 0;
+ node.all('> *').each(function(el) {
+ to_height += el.get('scrollHeight');
+ });
+ }
+
+ this.transitioning = true;
+
+ node.transition({
+ height : to_height +'px',
+ duration : duration,
+ easing : easing
+ }, complete);
+ },
+
+ /**
+ @method _hideElement
+ @description Calls the <code>_transition</code> method to hide a node.
+ @protected
+ @param node {Node} node to hide.
+ **/
+ _hideElement : function(node) {
+ this._transition(node, 'hide');
+/*
+ var showClass = this.showClass,
+ hideClass = this.hideClass;
+
+ node.removeClass(showClass);
+ node.addClass(hideClass);
+*/
+ },
+
+ /**
+ @method _showElement
+ @description Calls the <code>_transition</code> method to show a node.
+ @protected
+ @param node {Node} node to show.
+ **/
+ _showElement : function(node) {
+ this._transition(node, 'show');
+/*
+ var showClass = this.showClass,
+ hideClass = this.hideClass;
+ node.removeClass(hideClass);
+ node.addClass(showClass);
+*/
+ }
+});
+
+Y.namespace('Bootstrap').Collapse = CollapsePlugin;
+
+
+
+}, '@VERSION@' ,{requires:['plugin','transition','event','event-delegate']});
+;
View
115 theme/bootstrap/javascript/bootstrapdropdown.js
@@ -0,0 +1,115 @@
+YUI.add('gallery-bootstrap-dropdown', function(Y) {
+
+/**
+A Plugin which provides dropdown behaviors for dropdown buttons and menu
+groups. This utilizes the markup from the Twitter Bootstrap Project.
+
+@module gallery-bootstrap-dropdown
+**/
+
+/**
+A Plugin which provides dropdown behaviors for dropdown buttons and menu
+groups. This utilizes the markup from the Twitter Bootstrap Project.
+
+To automatically gain this functionality, you can simply add the
+<code>data-toggle=dropdown</code> attribute to any element.
+
+It can also be plugged into any node or node list.
+
+@example
+
+ var node = Y.one('.someNode');
+ node.plug( Y.Bootstrap.Dropdown );
+ node.dropdown.show();
+
+@class Bootstrap.Dropdown
+**/
+
+var NS = Y.namespace('Bootstrap');
+
+function DropdownPlugin(config) {
+ DropdownPlugin.superclass.constructor.apply(this, arguments);
+}
+
+DropdownPlugin.NAME = 'Bootstrap.Dropdown';
+DropdownPlugin.NS = 'dropdown';
+
+Y.extend( DropdownPlugin, Y.Plugin.Base, {
+ defaults : {
+ className : 'open',
+ target : 'target',
+ selector : ''
+ },
+ initializer : function(config) {
+ this._node = config.host;
+
+ this.config = Y.mix( config, this.defaults );
+
+ this.publish('show', { preventable : true, defaultFn : this.show });
+ this.publish('hide', { preventable : true, defaultFn : this.hide });
+
+ this._node.on('click', this.toggle, this);
+ },
+
+ toggle : function() {
+ var target = this.getTarget(),
+ className = this.config.className;
+
+ target.toggleClass( className );
+ target.once('clickoutside', function(e) {
+ target.toggleClass( className );
+ });
+ },
+
+ show : function() {
+ this.getTarget().addClass( this.config.className );
+ },
+ hide : function() {
+ this.getTarget().removeClass( this.config.className );
+ },
+ open : function() {
+ this.getTarget().addClass( this.config.className );
+ },
+ close : function() {
+ this.getTarget().removeClass( this.config.className );
+ },
+
+ /**
+ @method getTarget
+ @description Fetches a Y.NodeList or Y.Node that should be used to modify class names
+ **/
+ getTarget : function() {
+ var node = this._node,
+ selector = node.getData( this.config.target ),
+ target;
+
+ if ( !selector ) {
+ selector = node.getAttribute('href');
+ selector = target && target.replace(/.*(?=#[^\s]*$)/, ''); //strip for ie7
+ }
+
+ target = Y.all(selector);
+ if ( target.size() === 0 ) {
+ target = node.get('parentNode');
+ }
+
+ return target;
+ }
+});
+
+NS.Dropdown = DropdownPlugin;
+NS.dropdown_delegation = function() {
+ Y.delegate('click', function(e) {
+ var target = e.currentTarget;
+ e.preventDefault();
+
+ if ( typeof e.target.dropdown === 'undefined' ) {
+ target.plug( DropdownPlugin );
+ target.dropdown.toggle();
+ }
+ }, document.body, '*[data-toggle=dropdown]' );
+};
+
+
+}, '@VERSION@' ,{requires:['plugin','event','event-outside']});
+;
View
274 theme/bootstrap/javascript/bootstrapengine.js
@@ -0,0 +1,274 @@
+YUI.add('gallery-bootstrap-engine', function(Y) {
+
+/**
+ * Bootstrap Engine for Plug and Play widgets. This class is meant to be used in
+ * conjuntion with the Injection Engine (gallery-bootstrap-engine). It facilitates the use of
+ * an iframe as a sandbox to execute certain tasks and/or a presention element.
+ *
+ * @module gallery-bootstrap-engine
+ * @requires node, base-base
+ * @class Y.BootstrapEngine
+ * @param config {Object} Configuration object
+ * @extends Y.Base
+ * @constructor
+ */
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Private shorthands, constants and variables
+//
+///////////////////////////////////////////////////////////////////////////
+
+var ATTR_HOST = 'host';
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Class definition
+//
+///////////////////////////////////////////////////////////////////////////
+
+function BootstrapEngine () {
+ BootstrapEngine.superclass.constructor.apply(this, arguments);
+}
+
+Y.mix(BootstrapEngine, {
+
+ /**
+ * The identity of the class.
+ * @property BootstrapEngine.NAME
+ * @type string
+ * @static
+ * @final
+ * @readOnly
+ * @default 'bootstrap'
+ */
+ NAME: 'bootstrap',
+
+ /**
+ * Static property used to define the default attribute configuration of
+ * the class.
+ * @property BootstrapEngine.ATTRS
+ * @type Object
+ * @protected
+ * @static
+ */
+ ATTRS: {
+ /**
+ * @attribute container
+ * @type {Selector|Node}
+ * @writeOnce
+ * @description selector or node for the iframe's container. This is relative to the parent document.
+ */
+ container: {
+ getter: function (v) {
+ var host = this.get(ATTR_HOST);
+ return host && host.one( v );
+ }
+ },
+ /**
+ * @attribute iframe
+ * @type {Node}
+ * @readyOnly
+ * @description Node reference to the iframe on the parent document.
+ */
+ iframe: {
+ getter: function () {
+ var c = this.get('container');
+ return c && c.one('iframe' );
+ }
+ },
+ /**
+ * @attribute host
+ * @type {Object}
+ * @readyOnly
+ * @description A "Y" reference bound to the parent document.
+ */
+ host: {
+ readyOnly: true
+ },
+ /**
+ * @attribute ready
+ * @type {Boolean}
+ * @readyOnly
+ * @description A "Y" reference bound to the parent document.
+ */
+ ready: {
+ value: false,
+ readyOnly: true
+ }
+ }
+
+});
+
+Y.extend(BootstrapEngine, Y.Base, {
+ /**
+ * Any extra YUI module that you want to use by default in HOST YUI instance.
+ * "node" module will be added automatically since it's required by bootstrap.
+ * @property EXTRAS
+ * @type Array
+ * @default []
+ */
+ EXTRAS: [],
+
+ /**
+ * Construction logic executed during Bootstrap Engine instantiation.
+ *
+ * @method initializer
+ * @param cfg {Object} Initial configuration
+ * @protected
+ */
+ initializer: function () {
+ var instance = this,
+ parent, win, doc,
+ use = Y.Array(instance.EXTRAS),
+ host,
+ callBootFn = function () {
+ // finishing the initialization process async to facilitate
+ // addons to hook into _boot/_init/_bind/_ready if needed.
+ // todo: after migrating to 3.4 this is not longer needed, and we can use initializer and destroyer
+ // in each extension
+ Y.later(0, instance, function() {
+ instance._boot();
+ });
+ };
+
+ try {
+ parent = Y.config.win.parent;
+ win = parent && parent.window;
+ doc = win && win.document;
+ } catch(e) {
+ Y.log ('Parent window is not available or is a different domain', 'warn', 'bootstrap');
+ }
+
+ Y.log ('Initialization', 'info', 'bootstrap');
+ // parent is optional to facilitate testing and headless execution
+ if (parent && win && doc) {
+ host = YUI({
+ bootstrap: false,
+ win: win,
+ doc: doc
+ });
+ use.push('node', function() {
+ callBootFn();
+ });
+
+ // Creating a new YUI instance bound to the parent window
+ instance._set(ATTR_HOST, host.use.apply(host, use));
+ } else {
+ callBootFn();
+ }
+ },
+
+ /**
+ * Basic initialization routine, styling the iframe, binding events and
+ * connecting the bootstrap engine with the injection engine.
+ *
+ * @method _boot
+ * @protected
+ */
+ _boot: function () {
+ var instance = this,
+ auto;
+ Y.log ('Boot', 'info', 'bootstrap');
+ // connecting with the injection engine before doing anything else
+ auto = instance._connect();
+ // adjust the iframe container in preparation for the first display action
+ instance._styleIframe();
+ // create some objects and markup
+ instance._init();
+ // binding some extra events
+ instance._bind();
+ // if the connect process wants to automatically execute the _ready, it should returns true.
+ if (auto) {
+ // connecting the bootstrap with the injection engine
+ instance._ready();
+ }
+ // marking the system as ready
+ instance._set('ready', true);
+ },
+
+ /**
+ * Connects the bootstrap with the injection engine running in the parent window. This method
+ * defines the hand-shake process between them. This method is meant to be called by
+ * the bootstrap engine _init method to start the connection.
+ *
+ * @method _connect
+ * @protected
+ */
+ _connect: function () {
+ var guid = Y.config.guid, // injection engine guid value
+ host = this.get(ATTR_HOST),
+ pwin = host && host.config.win,
+ // getting a reference to the parent window callback function to notify
+ // to the injection engine that the bootstrap is ready
+ callback = guid && pwin && pwin.YUI && pwin.YUI.Env[guid];
+
+ Y.log ('Bootstrap connect', 'info', 'bootstrap');
+ // connecting bootstrap with the injection engines
+ return ( callback ? callback ( this ) : false );
+ },
+
+ /**
+ * Basic initialization routine, usually to create markup, new objects and attributes, etc.
+ * Overrides/Extends this prototype method to do your mojo.
+ *
+ * @method _init
+ * @protected
+ */
+ _init: function () {
+ Y.log ('Init bootstrap', 'info', 'bootstrap');
+ },
+
+ /**
+ * Defines the binding logic for the bootstrap engine, listening for some attributes
+ * that might change, and defining the set of events that can be exposed to the injection engine.
+ * Overrides/Extends this prototype method to do your mojo.
+ *
+ * @method _bind
+ * @protected
+ */
+ _bind: function () {
+ Y.log ('Binding bootstrap', 'info', 'bootstrap');
+ },
+
+ /**
+ * This method will be called only if the connect response with "true", you can use this
+ * to control the state of the initialization from the injection engine since it might
+ * take some time to load the stuff in the iframe, and the user might interact with the page
+ * invalidating the initialization routine.
+ * Overrides/Extends this prototype method to do your mojo.
+ *
+ * @method _ready
+ * @protected
+ */
+ _ready : function () {
+ Y.log ('Bootstrap is ready', 'info', 'bootstrap');
+ },
+
+ /**
+ * The iframe that holds the bootstrap engine sometimes is used as a UI overlay.
+ * In this case, you can style it through this method. By default, it will set
+ * border, frameBorder, marginWidth, marginHeight, leftMargin and topMargin to
+ * cero, and allowTransparency to true.
+ *
+ * @method _styleIframe
+ * @protected
+ */
+ _styleIframe: function () {
+ var iframe = this.get('iframe');
+ // making the iframe optional to facilitate tests
+ if (iframe) {
+ Y.log ('Styling the iframe', 'info', 'bootstrap');
+ Y.each (['border', 'marginWidth', 'marginHeight', 'leftMargin', 'topMargin'], function (name) {
+ iframe.setAttribute(name, 0);
+ });
+ }
+ }
+
+});
+
+Y.BootstrapEngine = BootstrapEngine;
+
+
+}, '@VERSION@' ,{requires:['node','base-base']});
+;
View
10 theme/bootstrap/javascript/headercollapse.js
@@ -0,0 +1,10 @@
+YUI().use('node', function(Y) {
+ var toggleShow = function(e) {
+ // Toggle the active class on both the clicked .btn-navbar and the .nav-collapse.
+ // Our CSS will set the height for these
+ var togglemenu = Y.one('.nav-collapse');
+ togglemenu.toggleClass('active');
+ this.toggleClass('active');
+ };
+ Y.delegate('click', toggleShow, Y.config.doc, '.btn-navbar');
+});
View
301 theme/bootstrap/javascript/html5shiv.js
@@ -0,0 +1,301 @@
+/**
+* @preserve HTML5 Shiv v3.6.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
+*/
+;(function(window, document) {
+/*jshint evil:true */
+ /** version */
+ var version = '3.6.2';
+
+ /** Preset options */
+ var options = window.html5 || {};
+
+ /** Used to skip problem elements */
+ var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
+
+ /** Not all elements can be cloned in IE **/
+ var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
+
+ /** Detect whether the browser supports default html5 styles */
+ var supportsHtml5Styles;
+
+ /** Name of the expando, to work with multiple documents or to re-shiv one document */
+ var expando = '_html5shiv';
+
+ /** The id for the the documents expando */
+ var expanID = 0;
+
+ /** Cached data for each document */
+ var expandoData = {};
+
+ /** Detect whether the browser supports unknown elements */
+ var supportsUnknownElements;
+
+ (function() {
+ try {
+ var a = document.createElement('a');
+ a.innerHTML = '<xyz></xyz>';
+ //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
+ supportsHtml5Styles = ('hidden' in a);
+
+ supportsUnknownElements = a.childNodes.length == 1 || (function() {
+ // assign a false positive if unable to shiv
+ (document.createElement)('a');
+ var frag = document.createDocumentFragment();
+ return (
+ typeof frag.cloneNode == 'undefined' ||
+ typeof frag.createDocumentFragment == 'undefined' ||
+ typeof frag.createElement == 'undefined'
+ );
+ }());
+ } catch(e) {
+ // assign a false positive if detection fails => unable to shiv
+ supportsHtml5Styles = true;
+ supportsUnknownElements = true;
+ }
+
+ }());
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * Creates a style sheet with the given CSS text and adds it to the document.
+ * @private
+ * @param {Document} ownerDocument The document.
+ * @param {String} cssText The CSS text.
+ * @returns {StyleSheet} The style element.
+ */
+ function addStyleSheet(ownerDocument, cssText) {
+ var p = ownerDocument.createElement('p'),
+ parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
+
+ p.innerHTML = 'x<style>' + cssText + '</style>';
+ return parent.insertBefore(p.lastChild, parent.firstChild);
+ }
+
+ /**
+ * Returns the value of `html5.elements` as an array.
+ * @private
+ * @returns {Array} An array of shived element node names.
+ */
+ function getElements() {
+ var elements = html5.elements;
+ return typeof elements == 'string' ? elements.split(' ') : elements;
+ }
+
+ /**
+ * Returns the data associated to the given document
+ * @private
+ * @param {Document} ownerDocument The document.
+ * @returns {Object} An object of data.
+ */
+ function getExpandoData(ownerDocument) {
+ var data = expandoData[ownerDocument[expando]];
+ if (!data) {
+ data = {};
+ expanID++;
+ ownerDocument[expando] = expanID;
+ expandoData[expanID] = data;
+ }
+ return data;
+ }
+
+ /**
+ * returns a shived element for the given nodeName and document
+ * @memberOf html5
+ * @param {String} nodeName name of the element
+ * @param {Document} ownerDocument The context document.
+ * @returns {Object} The shived element.
+ */
+ function createElement(nodeName, ownerDocument, data){
+ if (!ownerDocument) {
+ ownerDocument = document;
+ }
+ if(supportsUnknownElements){
+ return ownerDocument.createElement(nodeName);
+ }
+ if (!data) {
+ data = getExpandoData(ownerDocument);
+ }
+ var node;
+
+ if (data.cache[nodeName]) {
+ node = data.cache[nodeName].cloneNode();
+ } else if (saveClones.test(nodeName)) {
+ node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
+ } else {
+ node = data.createElem(nodeName);
+ }
+
+ // Avoid adding some elements to fragments in IE < 9 because
+ // * Attributes like `name` or `type` cannot be set/changed once an element
+ // is inserted into a document/fragment
+ // * Link elements with `src` attributes that are inaccessible, as with
+ // a 403 response, will cause the tab/window to crash
+ // * Script elements appended to fragments will execute when their `src`
+ // or `text` property is set
+ return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
+ }
+
+ /**
+ * returns a shived DocumentFragment for the given document
+ * @memberOf html5
+ * @param {Document} ownerDocument The context document.
+ * @returns {Object} The shived DocumentFragment.
+ */
+ function createDocumentFragment(ownerDocument, data){
+ if (!ownerDocument) {
+ ownerDocument = document;
+ }
+ if(supportsUnknownElements){
+ return ownerDocument.createDocumentFragment();
+ }
+ data = data || getExpandoData(ownerDocument);
+ var clone = data.frag.cloneNode(),
+ i = 0,
+ elems = getElements(),
+ l = elems.length;
+ for(;i<l;i++){
+ clone.createElement(elems[i]);
+ }
+ return clone;
+ }
+
+ /**
+ * Shivs the `createElement` and `createDocumentFragment` methods of the document.
+ * @private
+ * @param {Document|DocumentFragment} ownerDocument The document.
+ * @param {Object} data of the document.
+ */
+ function shivMethods(ownerDocument, data) {
+ if (!data.cache) {
+ data.cache = {};
+ data.createElem = ownerDocument.createElement;
+ data.createFrag = ownerDocument.createDocumentFragment;
+ data.frag = data.createFrag();
+ }
+
+
+ ownerDocument.createElement = function(nodeName) {
+ //abort shiv
+ if (!html5.shivMethods) {
+ return data.createElem(nodeName);
+ }
+ return createElement(nodeName, ownerDocument, data);
+ };
+
+ ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
+ 'var n=f.cloneNode(),c=n.createElement;' +
+ 'h.shivMethods&&(' +
+ // unroll the `createElement` calls
+ getElements().join().replace(/\w+/g, function(nodeName) {
+ data.createElem(nodeName);
+ data.frag.createElement(nodeName);
+ return 'c("' + nodeName + '")';
+ }) +
+ ');return n}'
+ )(html5, data.frag);
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * Shivs the given document.
+ * @memberOf html5
+ * @param {Document} ownerDocument The document to shiv.
+ * @returns {Document} The shived document.
+ */
+ function shivDocument(ownerDocument) {
+ if (!ownerDocument) {
+ ownerDocument = document;
+ }
+ var data = getExpandoData(ownerDocument);
+
+ if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
+ data.hasCSS = !!addStyleSheet(ownerDocument,
+ // corrects block display not defined in IE6/7/8/9
+ 'article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
+ // adds styling not present in IE6/7/8/9
+ 'mark{background:#FF0;color:#000}' +
+ // hides non-rendered elements
+ 'template{display:none}'
+ );
+ }
+ if (!supportsUnknownElements) {
+ shivMethods(ownerDocument, data);
+ }
+ return ownerDocument;
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * The `html5` object is exposed so that more elements can be shived and
+ * existing shiving can be detected on iframes.
+ * @type Object
+ * @example
+ *
+ * // options can be changed before the script is included
+ * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
+ */
+ var html5 = {
+
+ /**
+ * An array or space separated string of node names of the elements to shiv.
+ * @memberOf html5
+ * @type Array|String
+ */
+ 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
+
+ /**
+ * current version of html5shiv
+ */
+ 'version': version,
+
+ /**
+ * A flag to indicate that the HTML5 style sheet should be inserted.
+ * @memberOf html5
+ * @type Boolean
+ */
+ 'shivCSS': (options.shivCSS !== false),
+
+ /**
+ * Is equal to true if a browser supports creating unknown/HTML5 elements
+ * @memberOf html5
+ * @type boolean
+ */
+ 'supportsUnknownElements': supportsUnknownElements,
+
+ /**
+ * A flag to indicate that the document's `createElement` and `createDocumentFragment`
+ * methods should be overwritten.
+ * @memberOf html5
+ * @type Boolean
+ */
+ 'shivMethods': (options.shivMethods !== false),
+
+ /**
+ * A string to describe the type of `html5` object ("default" or "default print").
+ * @memberOf html5
+ * @type String
+ */
+ 'type': 'default',
+
+ // shivs the document according to the specified `html5` object options
+ 'shivDocument': shivDocument,
+
+ //creates a shived element
+ createElement: createElement,
+
+ //creates a shived documentFragment
+ createDocumentFragment: createDocumentFragment
+ };
+
+ /*--------------------------------------------------------------------------*/
+
+ // expose html5
+ window.html5 = html5;
+
+ // shiv the document
+ shivDocument(document);
+
+}(this, document));
View
28 theme/bootstrap/javascript/moodlebootstrap.js
@@ -0,0 +1,28 @@
+YUI().use('gallery-bootstrap');
+
+YUI.add('gallery-bootstrap', function(Y) {
+
+var NS = Y.namespace('Bootstrap');
+
+NS.initializer = function(e) {
+ //console.log('initializer!');
+ NS.dropdown_delegation();
+ NS.expandable_delegation();
+};
+
+NS.expandable_delegation = function() {
+ Y.delegate('click', function(e) {
+ e.preventDefault();
+
+ var target = e.currentTarget;
+ if ( ! target.collapse ) {
+ target.plug( Y.Bootstrap.Collapse );
+ }
+ target.collapse.toggle();
+ }, document.body, '*[data-toggle="collapse"]' );
+};
+
+Y.on('domready', NS.initializer);
+
+}, '@VERSION@' ,{requires:[ 'gallery-bootstrap-dropdown', 'gallery-bootstrap-collapse', 'gallery-bootstrap-engine']});
+;
View
70 theme/bootstrap/lang/en/theme_bootstrap.php
@@ -0,0 +1,70 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * Strings for component 'theme_bootstrap', language 'en', branch 'MOODLE_23_STABLE'
+ *
+ * @package Bootstrap theme
+ * @copyright 2012 Bas Brands, www.basbrands.nl
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$string['pluginname'] = 'Bootstrap';
+$string['region-side-post'] = 'Right';
+$string['region-side-pre'] = 'Left';
+
+$string['choosereadme'] = '
+<div class="clearfix"><div class="theme_screenshot"><h2>Bootstrap</h2>
+<img class=img-polaroid src="bootstrap/pix/screenshot.jpg" />
+<h3>Theme Credits</h3>
+<p>
+<h3>Moodle twitter Bootstrap theme</h3>
+<p>
+This theme is based on the Bootstrap CSS framework, version 2.3
+</p>
+<p>
+<a href="http://getbootstrap.com">http://getbootstrap.com</a>
+</p>
+<p>
+This is a GPL theme that is available on GitHub:
+</p>
+<p>
+<a href=https://github.com/bmbrands/theme_bootstrap">https://github.com/bmbrands/theme_bootstrap</a>
+</p>
+<p>
+Feel free to modify / improve / share
+</p>
+<p>
+This theme has been created with the help of:
+Stuart Lamour, Mark Aberdour, Paul Hibbitts, Mary Evans
+</p>
+<p>
+Authors: Bas Brands, David Scotson<br>
+Contact: bas@sonsbeekmedia.nl<br>
+Website: <a href="http://www.basbrands.nl">www.basbrands.nl</a><br>
+</p>
+
+<h3>Reporting bugs</h3>
+
+<p>You can report bugs on the <a href="https://github.com/bmbrands/theme_bootstrap/issues">github page</a> for this theme or
+on the Moodle tracker</p>
+
+<h3>More information</h3>
+<ul>
+<li><a href="https://github.com/bmbrands/theme_bootstrap/wiki">Wiki page for this theme</a>
+<li><a href="http://docs.moodle.org/23/en/bootstrap-Theme">Bootstrap on Moodle docs</a></li>
+<li><a href="http://theming.sonsbeekmedia.nl/">Theme testing playground </a></li>
+</ul>';
+
View
171 theme/bootstrap/layout/general.php
@@ -0,0 +1,171 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+$hasheading = ($PAGE->heading);
+$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
+$hasfooter = (empty($PAGE->layout_options['nofooter']));
+$hasheader = (empty($PAGE->layout_options['noheader']));
+
+$hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT));
+$hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT));
+
+$showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
+$showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
+
+$custommenu = $OUTPUT->custom_menu();
+$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
+
+$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
+
+if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
+ $courseheader = $OUTPUT->course_header();
+ $coursecontentheader = $OUTPUT->course_content_header();
+ if (empty($PAGE->layout_options['nocoursefooter'])) {
+ $coursecontentfooter = $OUTPUT->course_content_footer();
+ $coursefooter = $OUTPUT->course_footer();
+ }
+}
+
+$layout = 'pre-and-post';
+if ($showsidepre && !$showsidepost) {
+ if (!right_to_left()) {
+ $layout = 'side-pre-only';
+ } else {
+ $layout = 'side-post-only';
+ }
+} else if ($showsidepost && !$showsidepre) {
+ if (!right_to_left()) {
+ $layout = 'side-post-only';
+ } else {
+ $layout = 'side-pre-only';
+ }
+} else if (!$showsidepost && !$showsidepre) {
+ $layout = 'content-only';
+}
+$bodyclasses[] = $layout;
+
+echo $OUTPUT->doctype() ?>
+<html <?php echo $OUTPUT->htmlattributes() ?>>
+<head>
+ <title><?php echo $PAGE->title ?></title>
+ <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
+ <?php echo $OUTPUT->standard_head_html() ?>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+</head>
+
+<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join($bodyclasses)) ?>">
+
+<?php echo $OUTPUT->standard_top_of_body_html() ?>
+
+<header role="banner" class="navbar navbar-fixed-top">
+ <nav role="navigation" class="navbar-inner">
+ <div class="container-fluid">
+ <a class="brand" href="<?php echo $CFG->wwwroot;?>"><?php echo $SITE->shortname; ?></a>
+ <a class="btn btn-navbar" data-toggle="workaround-collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </a>
+ <div class="nav-collapse collapse">
+ <?php if ($hascustommenu) {
+ echo $custommenu;
+ } ?>
+ <ul class="nav pull-right">
+ <li><?php echo $PAGE->headingmenu ?></li>
+ <li class="navbar-text"><?php echo $OUTPUT->login_info() ?></li>
+ </ul>
+ </div>
+ </div>
+ </nav>
+</header>
+
+<div id="page" class="container-fluid">
+
+<?php if ($hasheader) { ?>
+<header id="page-header" class="clearfix">
+ <?php if ($hasnavbar) { ?>
+ <nav class="breadcrumb-button"><?php echo $PAGE->button; ?></nav>
+ <?php echo $OUTPUT->navbar(); ?>
+ <?php } ?>
+ <h1><?php echo $PAGE->heading ?></h1>
+
+ <?php if (!empty($courseheader)) { ?>
+ <div id="course-header"><?php echo $courseheader; ?></div>
+ <?php } ?>
+</header>
+<?php } ?>
+
+<div id="page-content" class="row-fluid">
+
+<?php if ($layout === 'pre-and-post') { ?>
+ <div id="region-bs-main-and-pre" class="span9">
+ <div class="row-fluid">
+ <section id="region-bs-main" class="span8 pull-right">
+<?php } else if ($layout === 'side-post-only') { ?>
+ <section id="region-bs-main" class="span9">
+<?php } else if ($layout === 'side-pre-only') { ?>
+ <section id="region-bs-main" class="span9 pull-right">
+<?php } else if ($layout === 'content-only') { ?>
+ <section id="region-bs-main" class="span12">
+<?php } ?>
+
+
+ <?php echo $coursecontentheader; ?>
+ <?php echo $OUTPUT->main_content() ?>
+ <?php echo $coursecontentfooter; ?>
+ </section>
+
+
+<?php if ($layout !== 'content-only') {
+ if ($layout === 'pre-and-post') { ?>
+ <aside id="region-pre" class="span4 block-region desktop-first-column region-content">
+ <?php } else if ($layout === 'side-pre-only') { ?>
+ <aside id="region-pre" class="span3 block-region desktop-first-column region-content">
+ <?php } ?>
+ <?php
+ if (!right_to_left()) {
+ echo $OUTPUT->blocks_for_region('side-pre');
+ } else if ($hassidepost) {
+ echo $OUTPUT->blocks_for_region('side-post');
+ }
+ ?>
+ </aside>
+ <?php if ($layout === 'pre-and-post') {
+ ?></div></div><?php // Close row-fluid and span9.
+ }
+
+ if ($layout === 'side-post-only' OR $layout === 'pre-and-post') { ?>
+ <aside id="region-post" class="span3 block-region region-content">
+ <?php if (!right_to_left()) {
+ echo $OUTPUT->blocks_for_region('side-post');
+ } else {
+ echo $OUTPUT->blocks_for_region('side-pre');
+ } ?>
+ </aside>
+ <?php } ?>
+<?php } ?>
+</div>
+
+<footer id="page-footer">
+ <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
+ <?php echo $OUTPUT->standard_footer_html(); ?>
+</footer>
+
+<?php echo $OUTPUT->standard_end_of_body_html() ?>
+
+</div>
+</body>
+</html>
View
19 theme/bootstrap/less/README
@@ -0,0 +1,19 @@
+If you want to make changes to the .css generated from these .less files then you
+need to install recess (https://github.com/twitter/recess) to compile the .less files,
+then run these commands in the bootstrap/less/ folder:
+
+recess --compile --compress moodle.less > ../style/generated.css
+
+You can add --watch to make sure it updates every time you make a change.
+
+And for the subset of styles of interest to the TinyMCE editor:
+
+recess --compile --compress editor.less > ../style/editor.css
+
+Non-command line options for .less compilation are available, see their github for more info.
+
+If the compilation is failing and you're not getting any useful error message, try using lessc instead i.e.:
+
+lessc moodle.less
+
+This is the same tool that's getting called by recess, but the errors seems better if you go direct.
View
34 theme/bootstrap/less/bootstrap/accordion.less
@@ -0,0 +1,34 @@
+//
+// Accordion
+// --------------------------------------------------
+
+
+// Parent container
+.accordion {
+ margin-bottom: @baseLineHeight;
+}
+
+// Group == heading + body
+.accordion-group {
+ margin-bottom: 2px;
+ border: 1px solid #e5e5e5;
+ .border-radius(@baseBorderRadius);
+}
+.accordion-heading {
+ border-bottom: 0;
+}
+.accordion-heading .accordion-toggle {
+ display: block;
+ padding: 8px 15px;
+}
+
+// General toggle styles
+.accordion-toggle {
+ cursor: pointer;
+}
+
+// Inner needs the styles because you can't animate properly with any styles on the element
+.accordion-inner {
+ padding: 9px 15px;
+ border-top: 1px solid #e5e5e5;
+}
View
79 theme/bootstrap/less/bootstrap/alerts.less
@@ -0,0 +1,79 @@
+//
+// Alerts
+// --------------------------------------------------
+
+
+// Base styles
+// -------------------------
+
+.alert {
+ padding: 8px 35px 8px 14px;
+ margin-bottom: @baseLineHeight;
+ text-shadow: 0 1px 0 rgba(255,255,255,.5);
+ background-color: @warningBackground;
+ border: 1px solid @warningBorder;
+ .border-radius(@baseBorderRadius);
+}
+.alert,
+.alert h4 {
+ // Specified for the h4 to prevent conflicts of changing @headingsColor
+ color: @warningText;
+}
+.alert h4 {
+ margin: 0;
+}
+
+// Adjust close link position
+.alert .close {
+ position: relative;
+ top: -2px;
+ right: -21px;
+ line-height: @baseLineHeight;
+}
+
+
+// Alternate styles
+// -------------------------
+
+.alert-success {
+ background-color: @successBackground;
+ border-color: @successBorder;
+ color: @successText;
+}
+.alert-success h4 {
+ color: @successText;
+}
+.alert-danger,
+.alert-error {
+ background-color: @errorBackground;
+ border-color: @errorBorder;
+ color: @errorText;
+}
+.alert-danger h4,
+.alert-error h4 {
+ color: @errorText;
+}
+.alert-info {
+ background-color: @infoBackground;
+ border-color: @infoBorder;
+ color: @infoText;
+}
+.alert-info h4 {
+ color: @infoText;
+}
+
+
+// Block alerts
+// -------------------------
+
+.alert-block {
+ padding-top: 14px;
+ padding-bottom: 14px;
+}
+.alert-block > p,
+.alert-block > ul {
+ margin-bottom: 0;
+}
+.alert-block p + p {
+ margin-top: 5px;
+}
View
63 theme/bootstrap/less/bootstrap/bootstrap.less
@@ -0,0 +1,63 @@
+/*!
+ * Bootstrap v2.3.0
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */
+
+// Core variables and mixins
+@import "variables.less"; // Modify this for custom colors, font-sizes, etc
+@import "mixins.less";
+
+// CSS Reset
+@import "reset.less";
+
+// Grid system and page structure
+@import "scaffolding.less";
+@import "grid.less";
+@import "layouts.less";
+
+// Base CSS
+@import "type.less";
+@import "code.less";
+@import "forms.less";
+@import "tables.less";
+
+// Components: common
+@import "sprites.less";
+@import "dropdowns.less";
+@import "wells.less";
+@import "component-animations.less";
+@import "close.less";
+
+// Components: Buttons & Alerts
+@import "buttons.less";
+@import "button-groups.less";
+@import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
+
+// Components: Nav
+@import "navs.less";
+@import "navbar.less";
+@import "breadcrumbs.less";
+@import "pagination.less";
+@import "pager.less";
+
+// Components: Popovers
+@import "modals.less";
+@import "tooltip.less";
+@import "popovers.less";
+
+// Components: Misc
+@import "thumbnails.less";
+@import "media.less";
+@import "labels-badges.less";
+@import "progress-bars.less";
+@import "accordion.less";
+@import "carousel.less";
+@import "hero-unit.less";
+
+// Utility classes
+@import "utilities.less"; // Has to be last to override when necessary
View
24 theme/bootstrap/less/bootstrap/breadcrumbs.less
@@ -0,0 +1,24 @@
+//
+// Breadcrumbs
+// --------------------------------------------------
+
+
+.breadcrumb {
+ padding: 8px 15px;
+ margin: 0 0 @baseLineHeight;
+ list-style: none;
+ background-color: #f5f5f5;
+ .border-radius(@baseBorderRadius);
+ > li {
+ display: inline-block;
+ .ie7-inline-block();
+ text-shadow: 0 1px 0 @white;
+ > .divider {
+ padding: 0 5px;
+ color: #ccc;
+ }
+ }
+ > .active {
+ color: @grayLight;
+ }
+}
View
229 theme/bootstrap/less/bootstrap/button-groups.less
@@ -0,0 +1,229 @@
+//
+// Button groups
+// --------------------------------------------------
+
+
+// Make the div behave like a button
+.btn-group {
+ position: relative;
+ display: inline-block;
+ .ie7-inline-block();
+ font-size: 0; // remove as part 1 of font-size inline-block hack
+ vertical-align: middle; // match .btn alignment given font-size hack above
+ white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page)
+ .ie7-restore-left-whitespace();
+}
+
+// Space out series of button groups
+.btn-group + .btn-group {
+ margin-left: 5px;
+}
+
+// Optional: Group multiple button groups together for a toolbar
+.btn-toolbar {
+ font-size: 0; // Hack to remove whitespace that results from using inline-block
+ margin-top: @baseLineHeight / 2;
+ margin-bottom: @baseLineHeight / 2;
+ > .btn + .btn,
+ > .btn-group + .btn,
+ > .btn + .btn-group {
+ margin-left: 5px;
+ }
+}
+
+// Float them, remove border radius, then re-add to first and last elements
+.btn-group > .btn {
+ position: relative;
+ .border-radius(0);
+}
+.btn-group > .btn + .btn {
+ margin-left: -1px;
+}
+.btn-group > .btn,
+.btn-group > .dropdown-menu,
+.btn-group > .popover {
+ font-size: @baseFontSize; // redeclare as part 2 of font-size inline-block hack
+}
+
+// Reset fonts for other sizes
+.btn-group > .btn-mini {
+ font-size: @fontSizeMini;
+}
+.btn-group > .btn-small {
+ font-size: @fontSizeSmall;
+}
+.btn-group > .btn-large {
+ font-size: @fontSizeLarge;
+}
+
+// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
+.btn-group > .btn:first-child {
+ margin-left: 0;
+ .border-top-left-radius(@baseBorderRadius);
+ .border-bottom-left-radius(@baseBorderRadius);
+}
+// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
+.btn-group > .btn:last-child,
+.btn-group > .dropdown-toggle {
+ .border-top-right-radius(@baseBorderRadius);
+ .border-bottom-right-radius(@baseBorderRadius);
+}
+// Reset corners for large buttons
+.btn-group > .btn.large:first-child {
+ margin-left: 0;
+ .border-top-left-radius(@borderRadiusLarge);
+ .border-bottom-left-radius(@borderRadiusLarge);
+}
+.btn-group > .btn.large:last-child,
+.btn-group > .large.dropdown-toggle {
+ .border-top-right-radius(@borderRadiusLarge);
+ .border-bottom-right-radius(@borderRadiusLarge);
+}
+
+// On hover/focus/active, bring the proper btn to front
+.btn-group > .btn:hover,
+.btn-group > .btn:focus,
+.btn-group > .btn:active,
+.btn-group > .btn.active {
+ z-index: 2;
+}
+
+// On active and open, don't show outline
+.btn-group .dropdown-toggle:active,
+.btn-group.open .dropdown-toggle {
+ outline: 0;
+}
+
+
+
+// Split button dropdowns
+// ----------------------
+
+// Give the line between buttons some depth
+.btn-group > .btn + .dropdown-toggle {
+ padding-left: 8px;
+ padding-right: 8px;
+ .box-shadow(~"inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
+ *padding-top: 5px;
+ *padding-bottom: 5px;
+}
+.btn-group > .btn-mini + .dropdown-toggle {
+ padding-left: 5px;
+ padding-right: 5px;
+ *padding-top: 2px;
+ *padding-bottom: 2px;
+}
+.btn-group > .btn-small + .dropdown-toggle {
+ *padding-top: 5px;
+ *padding-bottom: 4px;
+}
+.btn-group > .btn-large + .dropdown-toggle {
+ padding-left: 12px;
+ padding-right: 12px;
+ *padding-top: 7px;
+ *padding-bottom: 7px;
+}
+
+.btn-group.open {
+
+ // The clickable button for toggling the menu
+ // Remove the gradient and set the same inset shadow as the :active state
+ .dropdown-toggle {
+ background-image: none;
+ .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
+ }
+
+ // Keep the hover's background when dropdown is open
+ .btn.dropdown-toggle {
+ background-color: @btnBackgroundHighlight;
+ }
+ .btn-primary.dropdown-toggle {
+ background-color: @btnPrimaryBackgroundHighlight;
+ }
+ .btn-warning.dropdown-toggle {
+ background-color: @btnWarningBackgroundHighlight;
+ }
+ .btn-danger.dropdown-toggle {
+ background-color: @btnDangerBackgroundHighlight;
+ }
+ .btn-success.dropdown-toggle {
+ background-color: @btnSuccessBackgroundHighlight;
+ }
+ .btn-info.dropdown-toggle {
+ background-color: @btnInfoBackgroundHighlight;
+ }
+ .btn-inverse.dropdown-toggle {
+ background-color: @btnInverseBackgroundHighlight;
+ }
+}
+
+
+// Reposition the caret
+.btn .caret {
+ margin-top: 8px;
+ margin-left: 0;
+}
+// Carets in other button sizes
+.btn-large .caret {
+ margin-top: 6px;
+}
+.btn-large .caret {
+ border-left-width: 5px;
+ border-right-width: 5px;
+ border-top-width: 5px;
+}
+.btn-mini .caret,
+.btn-small .caret {
+ margin-top: 8px;
+}
+// Upside down carets for .dropup
+.dropup .btn-large .caret {
+ border-bottom-width: 5px;
+}
+
+
+
+// Account for other colors
+.btn-primary,
+.btn-warning,
+.btn-danger,
+.btn-info,
+.btn-success,
+.btn-inverse {
+ .caret {
+ border-top-color: @white;
+ border-bottom-color: @white;
+ }
+}
+
+
+
+// Vertical button groups
+// ----------------------
+
+.btn-group-vertical {
+ display: inline-block; // makes buttons only take up the width they need
+ .ie7-inline-block();
+}
+.btn-group-vertical > .btn {
+ display: block;
+ float: none;
+ max-width: 100%;
+ .border-radius(0);
+}
+.btn-group-vertical > .btn + .btn {
+ margin-left: 0;
+ margin-top: -1px;
+}
+.btn-group-vertical > .btn:first-child {
+ .border-radius(@baseBorderRadius @baseBorderRadius 0 0);
+}
+.btn-group-vertical > .btn:last-child {
+ .border-radius(0 0 @baseBorderRadius @baseBorderRadius);
+}
+.btn-group-vertical > .btn-large:first-child {
+ .border-radius(@borderRadiusLarge @borderRadiusLarge 0 0);
+}
+.btn-group-vertical > .btn-large:last-child {
+ .border-radius(0 0 @borderRadiusLarge @borderRadiusLarge);
+}
View
228 theme/bootstrap/less/bootstrap/buttons.less
@@ -0,0 +1,228 @@
+//
+// Buttons
+// --------------------------------------------------
+
+
+// Base styles
+// --------------------------------------------------
+
+// Core
+.btn {
+ display: inline-block;
+ .ie7-inline-block();
+ padding: 4px 12px;
+ margin-bottom: 0; // For input.btn
+ font-size: @baseFontSize;
+ line-height: @baseLineHeight;
+ text-align: center;
+ vertical-align: middle;
+ cursor: pointer;
+ .buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark, 0 1px 1px rgba(255,255,255,.75));
+ border: 1px solid @btnBorder;
+ *border: 0; // Remove the border to prevent IE7's black border on input:focus
+ border-bottom-color: darken(@btnBorder, 10%);
+ .border-radius(@baseBorderRadius);
+ .ie7-restore-left-whitespace(); // Give IE7 some love
+ .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
+
+ // Hover/focus state
+ &:hover,
+ &:focus {
+ color: @grayDark;
+ text-decoration: none;
+ background-position: 0 -15px;
+
+ // transition is only when going to hover/focus, otherwise the background
+ // behind the gradient (there for IE<=9 fallback) gets mismatched
+ .transition(background-position .1s linear);
+ }
+
+ // Focus state for keyboard and accessibility
+ &:focus {
+ .tab-focus();
+ }
+
+ // Active state
+ &.active,
+ &:active {
+ background-image: none;
+ outline: 0;
+ .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
+ }
+
+ // Disabled state
+ &.disabled,
+ &[disabled] {
+ cursor: default;
+ background-image: none;
+ .opacity(65);
+ .box-shadow(none);
+ }
+
+}
+
+
+
+// Button Sizes
+// --------------------------------------------------
+
+// Large
+.btn-large {
+ padding: @paddingLarge;
+ font-size: @fontSizeLarge;
+ .border-radius(@borderRadiusLarge);
+}
+.btn-large [class^="icon-"],
+.btn-large [class*=" icon-"] {
+ margin-top: 4px;
+}
+
+// Small
+.btn-small {
+ padding: @paddingSmall;
+ font-size: @fontSizeSmall;
+ .border-radius(@borderRadiusSmall);
+}
+.btn-small [class^="icon-"],
+.btn-small [class*=" icon-"] {
+ margin-top: 0;
+}
+.btn-mini [class^="icon-"],
+.btn-mini [class*=" icon-"] {
+ margin-top: -1px;
+}
+
+// Mini
+.btn-mini {
+ padding: @paddingMini;
+ font-size: @fontSizeMini;
+ .border-radius(@borderRadiusSmall);
+}
+
+
+// Block button
+// -------------------------
+
+.btn-block {
+ display: block;
+ width: 100%;
+ padding-left: 0;
+ padding-right: 0;
+ .box-sizing(border-box);
+}
+
+// Vertically space out multiple block buttons
+.btn-block + .btn-block {
+ margin-top: 5px;
+}
+
+// Specificity overrides
+input[type="submit"],
+input[type="reset"],
+input[type="button"] {
+ &.btn-block {
+ width: 100%;
+ }
+}
+
+
+
+// Alternate buttons
+// --------------------------------------------------
+
+// Provide *some* extra contrast for those who can get it
+.btn-primary.active,
+.btn-warning.active,
+.btn-danger.active,
+.btn-success.active,
+.btn-info.active,
+.btn-inverse.active {
+ color: rgba(255,255,255,.75);
+}
+
+// Set the backgrounds
+// -------------------------
+.btn-primary {
+ .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
+}
+// Warning appears are orange
+.btn-warning {
+ .buttonBackground(@btnWarningBackground, @btnWarningBackgroundHighlight);
+}
+// Danger and error appear as red
+.btn-danger {
+ .buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
+}
+// Success appears as green
+.btn-success {
+ .buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight);
+}
+// Info appears as a neutral blue
+.btn-info {
+ .buttonBackground(@btnInfoBackground, @btnInfoBackgroundHighlight);
+}
+// Inverse appears as dark gray
+.btn-inverse {
+ .buttonBackground(@btnInverseBackground, @btnInverseBackgroundHighlight);
+}
+
+
+// Cross-browser Jank
+// --------------------------------------------------
+
+button.btn,
+input[type="submit"].btn {
+
+ // Firefox 3.6 only I believe
+ &::-moz-focus-inner {
+ padding: 0;
+ border: 0;
+ }
+
+ // IE7 has some default padding on button controls
+ *padding-top: 3px;
+ *padding-bottom: 3px;
+
+ &.btn-large {
+ *padding-top: 7px;
+ *padding-bottom: 7px;
+ }
+ &.btn-small {
+ *padding-top: 3px;
+ *padding-bottom: 3px;
+ }
+ &.btn-mini {
+ *padding-top: 1px;
+ *padding-bottom: 1px;
+ }
+}
+
+
+// Link buttons
+// --------------------------------------------------
+
+// Make a button look and behave like a link
+.btn-link,
+.btn-link:active,
+.btn-link[disabled] {
+ background-color: transparent;
+ background-image: none;
+ .box-shadow(none);
+}
+.btn-link {
+ border-color: transparent;