diff --git a/lib/pluginlib.php b/lib/pluginlib.php index 6b30b43d49e..0a3dd825f8f 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -809,7 +809,7 @@ class plugin_manager { ), 'theme' => array( - 'afterburner', 'anomaly', 'arialist', 'base', 'binarius', 'bootstrap', + 'afterburner', 'anomaly', 'arialist', 'base', 'binarius', 'bootstrapbase', 'boxxie', 'brick', 'canvas', 'clean', 'formal_white', 'formfactor', 'fusion', 'leatherbound', 'magazine', 'mymobile', 'nimble', 'nonzero', 'overlay', 'serenity', 'sky_high', 'splash', diff --git a/theme/bootstrap/javascript/moodlebootstrap.js b/theme/bootstrap/javascript/moodlebootstrap.js deleted file mode 100644 index 52a79b8005b..00000000000 --- a/theme/bootstrap/javascript/moodlebootstrap.js +++ /dev/null @@ -1,5 +0,0 @@ -// We need to actually use the code manually here as this is tricky do in -// themes at present. -YUI().use('moodle-theme_bootstrap-bootstrap', function(Y) { - Y.Moodle.theme_bootstrap.bootstrap.init(); -}); diff --git a/theme/bootstrap/README.txt b/theme/bootstrapbase/README.txt similarity index 100% rename from theme/bootstrap/README.txt rename to theme/bootstrapbase/README.txt diff --git a/theme/bootstrap/config.php b/theme/bootstrapbase/config.php similarity index 99% rename from theme/bootstrap/config.php rename to theme/bootstrapbase/config.php index 38c167068e9..df6b44c5864 100644 --- a/theme/bootstrap/config.php +++ b/theme/bootstrapbase/config.php @@ -31,7 +31,7 @@ $THEME->doctype = 'html5'; $THEME->yuicssmodules = array(); -$THEME->name = 'bootstrap'; +$THEME->name = 'bootstrapbase'; $THEME->parents = array(''); $THEME->sheets = array('generated'); $THEME->supportscssoptimisation = false; diff --git a/theme/bootstrap/javascript/html5shiv.js b/theme/bootstrapbase/javascript/html5shiv.js similarity index 100% rename from theme/bootstrap/javascript/html5shiv.js rename to theme/bootstrapbase/javascript/html5shiv.js diff --git a/theme/bootstrapbase/javascript/moodlebootstrap.js b/theme/bootstrapbase/javascript/moodlebootstrap.js new file mode 100644 index 00000000000..a8092192ffa --- /dev/null +++ b/theme/bootstrapbase/javascript/moodlebootstrap.js @@ -0,0 +1,5 @@ +// We need to actually use the code manually here as this is tricky do in +// themes at present. +YUI().use('moodle-theme_bootstrapbase-bootstrap', function(Y) { + Y.Moodle.theme_bootstrapbase.bootstrap.init(); +}); diff --git a/theme/bootstrap/lang/en/theme_bootstrap.php b/theme/bootstrapbase/lang/en/theme_bootstrapbase.php similarity index 97% rename from theme/bootstrap/lang/en/theme_bootstrap.php rename to theme/bootstrapbase/lang/en/theme_bootstrapbase.php index 0acf3cc35c9..215d8064868 100644 --- a/theme/bootstrap/lang/en/theme_bootstrap.php +++ b/theme/bootstrapbase/lang/en/theme_bootstrapbase.php @@ -21,12 +21,12 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['pluginname'] = 'Bootstrap'; +$string['pluginname'] = 'Bootstrap Base'; $string['region-side-post'] = 'Right'; $string['region-side-pre'] = 'Left'; $string['choosereadme'] = ' -

Bootstrap

+

Bootstrap Base

Theme Credits

diff --git a/theme/bootstrap/layout/general.php b/theme/bootstrapbase/layout/general.php similarity index 100% rename from theme/bootstrap/layout/general.php rename to theme/bootstrapbase/layout/general.php diff --git a/theme/bootstrap/less/README b/theme/bootstrapbase/less/README similarity index 92% rename from theme/bootstrap/less/README rename to theme/bootstrapbase/less/README index ccc6048b0ec..19f5756cccd 100644 --- a/theme/bootstrap/less/README +++ b/theme/bootstrapbase/less/README @@ -1,6 +1,6 @@ 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: +then run these commands in the bootstrapbase/less/ folder: recess --compile --compress moodle.less > ../style/generated.css diff --git a/theme/bootstrap/less/bootstrap/accordion.less b/theme/bootstrapbase/less/bootstrap/accordion.less similarity index 100% rename from theme/bootstrap/less/bootstrap/accordion.less rename to theme/bootstrapbase/less/bootstrap/accordion.less diff --git a/theme/bootstrap/less/bootstrap/alerts.less b/theme/bootstrapbase/less/bootstrap/alerts.less similarity index 100% rename from theme/bootstrap/less/bootstrap/alerts.less rename to theme/bootstrapbase/less/bootstrap/alerts.less diff --git a/theme/bootstrap/less/bootstrap/bootstrap.less b/theme/bootstrapbase/less/bootstrap/bootstrap.less similarity index 100% rename from theme/bootstrap/less/bootstrap/bootstrap.less rename to theme/bootstrapbase/less/bootstrap/bootstrap.less diff --git a/theme/bootstrap/less/bootstrap/breadcrumbs.less b/theme/bootstrapbase/less/bootstrap/breadcrumbs.less similarity index 100% rename from theme/bootstrap/less/bootstrap/breadcrumbs.less rename to theme/bootstrapbase/less/bootstrap/breadcrumbs.less diff --git a/theme/bootstrap/less/bootstrap/button-groups.less b/theme/bootstrapbase/less/bootstrap/button-groups.less similarity index 100% rename from theme/bootstrap/less/bootstrap/button-groups.less rename to theme/bootstrapbase/less/bootstrap/button-groups.less diff --git a/theme/bootstrap/less/bootstrap/buttons.less b/theme/bootstrapbase/less/bootstrap/buttons.less similarity index 100% rename from theme/bootstrap/less/bootstrap/buttons.less rename to theme/bootstrapbase/less/bootstrap/buttons.less diff --git a/theme/bootstrap/less/bootstrap/carousel.less b/theme/bootstrapbase/less/bootstrap/carousel.less similarity index 100% rename from theme/bootstrap/less/bootstrap/carousel.less rename to theme/bootstrapbase/less/bootstrap/carousel.less diff --git a/theme/bootstrap/less/bootstrap/close.less b/theme/bootstrapbase/less/bootstrap/close.less similarity index 100% rename from theme/bootstrap/less/bootstrap/close.less rename to theme/bootstrapbase/less/bootstrap/close.less diff --git a/theme/bootstrap/less/bootstrap/code.less b/theme/bootstrapbase/less/bootstrap/code.less similarity index 100% rename from theme/bootstrap/less/bootstrap/code.less rename to theme/bootstrapbase/less/bootstrap/code.less diff --git a/theme/bootstrap/less/bootstrap/component-animations.less b/theme/bootstrapbase/less/bootstrap/component-animations.less similarity index 100% rename from theme/bootstrap/less/bootstrap/component-animations.less rename to theme/bootstrapbase/less/bootstrap/component-animations.less diff --git a/theme/bootstrap/less/bootstrap/dropdowns.less b/theme/bootstrapbase/less/bootstrap/dropdowns.less similarity index 100% rename from theme/bootstrap/less/bootstrap/dropdowns.less rename to theme/bootstrapbase/less/bootstrap/dropdowns.less diff --git a/theme/bootstrap/less/bootstrap/forms.less b/theme/bootstrapbase/less/bootstrap/forms.less similarity index 100% rename from theme/bootstrap/less/bootstrap/forms.less rename to theme/bootstrapbase/less/bootstrap/forms.less diff --git a/theme/bootstrap/less/bootstrap/grid.less b/theme/bootstrapbase/less/bootstrap/grid.less similarity index 100% rename from theme/bootstrap/less/bootstrap/grid.less rename to theme/bootstrapbase/less/bootstrap/grid.less diff --git a/theme/bootstrap/less/bootstrap/hero-unit.less b/theme/bootstrapbase/less/bootstrap/hero-unit.less similarity index 100% rename from theme/bootstrap/less/bootstrap/hero-unit.less rename to theme/bootstrapbase/less/bootstrap/hero-unit.less diff --git a/theme/bootstrap/less/bootstrap/labels-badges.less b/theme/bootstrapbase/less/bootstrap/labels-badges.less similarity index 100% rename from theme/bootstrap/less/bootstrap/labels-badges.less rename to theme/bootstrapbase/less/bootstrap/labels-badges.less diff --git a/theme/bootstrap/less/bootstrap/layouts.less b/theme/bootstrapbase/less/bootstrap/layouts.less similarity index 100% rename from theme/bootstrap/less/bootstrap/layouts.less rename to theme/bootstrapbase/less/bootstrap/layouts.less diff --git a/theme/bootstrap/less/bootstrap/media.less b/theme/bootstrapbase/less/bootstrap/media.less similarity index 100% rename from theme/bootstrap/less/bootstrap/media.less rename to theme/bootstrapbase/less/bootstrap/media.less diff --git a/theme/bootstrap/less/bootstrap/mixins.less b/theme/bootstrapbase/less/bootstrap/mixins.less similarity index 100% rename from theme/bootstrap/less/bootstrap/mixins.less rename to theme/bootstrapbase/less/bootstrap/mixins.less diff --git a/theme/bootstrap/less/bootstrap/modals.less b/theme/bootstrapbase/less/bootstrap/modals.less similarity index 100% rename from theme/bootstrap/less/bootstrap/modals.less rename to theme/bootstrapbase/less/bootstrap/modals.less diff --git a/theme/bootstrap/less/bootstrap/navbar.less b/theme/bootstrapbase/less/bootstrap/navbar.less similarity index 100% rename from theme/bootstrap/less/bootstrap/navbar.less rename to theme/bootstrapbase/less/bootstrap/navbar.less diff --git a/theme/bootstrap/less/bootstrap/navs.less b/theme/bootstrapbase/less/bootstrap/navs.less similarity index 100% rename from theme/bootstrap/less/bootstrap/navs.less rename to theme/bootstrapbase/less/bootstrap/navs.less diff --git a/theme/bootstrap/less/bootstrap/pager.less b/theme/bootstrapbase/less/bootstrap/pager.less similarity index 100% rename from theme/bootstrap/less/bootstrap/pager.less rename to theme/bootstrapbase/less/bootstrap/pager.less diff --git a/theme/bootstrap/less/bootstrap/pagination.less b/theme/bootstrapbase/less/bootstrap/pagination.less similarity index 100% rename from theme/bootstrap/less/bootstrap/pagination.less rename to theme/bootstrapbase/less/bootstrap/pagination.less diff --git a/theme/bootstrap/less/bootstrap/popovers.less b/theme/bootstrapbase/less/bootstrap/popovers.less similarity index 100% rename from theme/bootstrap/less/bootstrap/popovers.less rename to theme/bootstrapbase/less/bootstrap/popovers.less diff --git a/theme/bootstrap/less/bootstrap/progress-bars.less b/theme/bootstrapbase/less/bootstrap/progress-bars.less similarity index 100% rename from theme/bootstrap/less/bootstrap/progress-bars.less rename to theme/bootstrapbase/less/bootstrap/progress-bars.less diff --git a/theme/bootstrap/less/bootstrap/reset.less b/theme/bootstrapbase/less/bootstrap/reset.less similarity index 100% rename from theme/bootstrap/less/bootstrap/reset.less rename to theme/bootstrapbase/less/bootstrap/reset.less diff --git a/theme/bootstrap/less/bootstrap/responsive-1200px-min.less b/theme/bootstrapbase/less/bootstrap/responsive-1200px-min.less similarity index 100% rename from theme/bootstrap/less/bootstrap/responsive-1200px-min.less rename to theme/bootstrapbase/less/bootstrap/responsive-1200px-min.less diff --git a/theme/bootstrap/less/bootstrap/responsive-767px-max.less b/theme/bootstrapbase/less/bootstrap/responsive-767px-max.less similarity index 100% rename from theme/bootstrap/less/bootstrap/responsive-767px-max.less rename to theme/bootstrapbase/less/bootstrap/responsive-767px-max.less diff --git a/theme/bootstrap/less/bootstrap/responsive-768px-979px.less b/theme/bootstrapbase/less/bootstrap/responsive-768px-979px.less similarity index 100% rename from theme/bootstrap/less/bootstrap/responsive-768px-979px.less rename to theme/bootstrapbase/less/bootstrap/responsive-768px-979px.less diff --git a/theme/bootstrap/less/bootstrap/responsive-navbar.less b/theme/bootstrapbase/less/bootstrap/responsive-navbar.less similarity index 100% rename from theme/bootstrap/less/bootstrap/responsive-navbar.less rename to theme/bootstrapbase/less/bootstrap/responsive-navbar.less diff --git a/theme/bootstrap/less/bootstrap/responsive-utilities.less b/theme/bootstrapbase/less/bootstrap/responsive-utilities.less similarity index 100% rename from theme/bootstrap/less/bootstrap/responsive-utilities.less rename to theme/bootstrapbase/less/bootstrap/responsive-utilities.less diff --git a/theme/bootstrap/less/bootstrap/responsive.less b/theme/bootstrapbase/less/bootstrap/responsive.less similarity index 100% rename from theme/bootstrap/less/bootstrap/responsive.less rename to theme/bootstrapbase/less/bootstrap/responsive.less diff --git a/theme/bootstrap/less/bootstrap/scaffolding.less b/theme/bootstrapbase/less/bootstrap/scaffolding.less similarity index 100% rename from theme/bootstrap/less/bootstrap/scaffolding.less rename to theme/bootstrapbase/less/bootstrap/scaffolding.less diff --git a/theme/bootstrap/less/bootstrap/sprites.less b/theme/bootstrapbase/less/bootstrap/sprites.less similarity index 100% rename from theme/bootstrap/less/bootstrap/sprites.less rename to theme/bootstrapbase/less/bootstrap/sprites.less diff --git a/theme/bootstrap/less/bootstrap/tables.less b/theme/bootstrapbase/less/bootstrap/tables.less similarity index 100% rename from theme/bootstrap/less/bootstrap/tables.less rename to theme/bootstrapbase/less/bootstrap/tables.less diff --git a/theme/bootstrap/less/bootstrap/thumbnails.less b/theme/bootstrapbase/less/bootstrap/thumbnails.less similarity index 100% rename from theme/bootstrap/less/bootstrap/thumbnails.less rename to theme/bootstrapbase/less/bootstrap/thumbnails.less diff --git a/theme/bootstrap/less/bootstrap/tooltip.less b/theme/bootstrapbase/less/bootstrap/tooltip.less similarity index 100% rename from theme/bootstrap/less/bootstrap/tooltip.less rename to theme/bootstrapbase/less/bootstrap/tooltip.less diff --git a/theme/bootstrap/less/bootstrap/type.less b/theme/bootstrapbase/less/bootstrap/type.less similarity index 100% rename from theme/bootstrap/less/bootstrap/type.less rename to theme/bootstrapbase/less/bootstrap/type.less diff --git a/theme/bootstrap/less/bootstrap/utilities.less b/theme/bootstrapbase/less/bootstrap/utilities.less similarity index 100% rename from theme/bootstrap/less/bootstrap/utilities.less rename to theme/bootstrapbase/less/bootstrap/utilities.less diff --git a/theme/bootstrap/less/bootstrap/variables.less b/theme/bootstrapbase/less/bootstrap/variables.less similarity index 100% rename from theme/bootstrap/less/bootstrap/variables.less rename to theme/bootstrapbase/less/bootstrap/variables.less diff --git a/theme/bootstrap/less/bootstrap/wells.less b/theme/bootstrapbase/less/bootstrap/wells.less similarity index 100% rename from theme/bootstrap/less/bootstrap/wells.less rename to theme/bootstrapbase/less/bootstrap/wells.less diff --git a/theme/bootstrap/less/editor.less b/theme/bootstrapbase/less/editor.less similarity index 100% rename from theme/bootstrap/less/editor.less rename to theme/bootstrapbase/less/editor.less diff --git a/theme/bootstrap/less/moodle.less b/theme/bootstrapbase/less/moodle.less similarity index 100% rename from theme/bootstrap/less/moodle.less rename to theme/bootstrapbase/less/moodle.less diff --git a/theme/bootstrap/less/moodle/admin.less b/theme/bootstrapbase/less/moodle/admin.less similarity index 100% rename from theme/bootstrap/less/moodle/admin.less rename to theme/bootstrapbase/less/moodle/admin.less diff --git a/theme/bootstrap/less/moodle/backup-restore.less b/theme/bootstrapbase/less/moodle/backup-restore.less similarity index 100% rename from theme/bootstrap/less/moodle/backup-restore.less rename to theme/bootstrapbase/less/moodle/backup-restore.less diff --git a/theme/bootstrap/less/moodle/blocks.less b/theme/bootstrapbase/less/moodle/blocks.less similarity index 100% rename from theme/bootstrap/less/moodle/blocks.less rename to theme/bootstrapbase/less/moodle/blocks.less diff --git a/theme/bootstrap/less/moodle/buttons.less b/theme/bootstrapbase/less/moodle/buttons.less similarity index 100% rename from theme/bootstrap/less/moodle/buttons.less rename to theme/bootstrapbase/less/moodle/buttons.less diff --git a/theme/bootstrap/less/moodle/calendar.less b/theme/bootstrapbase/less/moodle/calendar.less similarity index 100% rename from theme/bootstrap/less/moodle/calendar.less rename to theme/bootstrapbase/less/moodle/calendar.less diff --git a/theme/bootstrap/less/moodle/core.less b/theme/bootstrapbase/less/moodle/core.less similarity index 100% rename from theme/bootstrap/less/moodle/core.less rename to theme/bootstrapbase/less/moodle/core.less diff --git a/theme/bootstrap/less/moodle/course.less b/theme/bootstrapbase/less/moodle/course.less similarity index 100% rename from theme/bootstrap/less/moodle/course.less rename to theme/bootstrapbase/less/moodle/course.less diff --git a/theme/bootstrap/less/moodle/debug.less b/theme/bootstrapbase/less/moodle/debug.less similarity index 100% rename from theme/bootstrap/less/moodle/debug.less rename to theme/bootstrapbase/less/moodle/debug.less diff --git a/theme/bootstrap/less/moodle/expendable.less b/theme/bootstrapbase/less/moodle/expendable.less similarity index 100% rename from theme/bootstrap/less/moodle/expendable.less rename to theme/bootstrapbase/less/moodle/expendable.less diff --git a/theme/bootstrap/less/moodle/filemanager.less b/theme/bootstrapbase/less/moodle/filemanager.less similarity index 100% rename from theme/bootstrap/less/moodle/filemanager.less rename to theme/bootstrapbase/less/moodle/filemanager.less diff --git a/theme/bootstrap/less/moodle/forms.less b/theme/bootstrapbase/less/moodle/forms.less similarity index 100% rename from theme/bootstrap/less/moodle/forms.less rename to theme/bootstrapbase/less/moodle/forms.less diff --git a/theme/bootstrap/less/moodle/grade.less b/theme/bootstrapbase/less/moodle/grade.less similarity index 100% rename from theme/bootstrap/less/moodle/grade.less rename to theme/bootstrapbase/less/moodle/grade.less diff --git a/theme/bootstrap/less/moodle/message.less b/theme/bootstrapbase/less/moodle/message.less similarity index 100% rename from theme/bootstrap/less/moodle/message.less rename to theme/bootstrapbase/less/moodle/message.less diff --git a/theme/bootstrap/less/moodle/modules.less b/theme/bootstrapbase/less/moodle/modules.less similarity index 100% rename from theme/bootstrap/less/moodle/modules.less rename to theme/bootstrapbase/less/moodle/modules.less diff --git a/theme/bootstrap/less/moodle/question.less b/theme/bootstrapbase/less/moodle/question.less similarity index 100% rename from theme/bootstrap/less/moodle/question.less rename to theme/bootstrapbase/less/moodle/question.less diff --git a/theme/bootstrap/less/moodle/recess.txt b/theme/bootstrapbase/less/moodle/recess.txt similarity index 100% rename from theme/bootstrap/less/moodle/recess.txt rename to theme/bootstrapbase/less/moodle/recess.txt diff --git a/theme/bootstrap/less/moodle/responsive.less b/theme/bootstrapbase/less/moodle/responsive.less similarity index 100% rename from theme/bootstrap/less/moodle/responsive.less rename to theme/bootstrapbase/less/moodle/responsive.less diff --git a/theme/bootstrap/less/moodle/tables.less b/theme/bootstrapbase/less/moodle/tables.less similarity index 100% rename from theme/bootstrap/less/moodle/tables.less rename to theme/bootstrapbase/less/moodle/tables.less diff --git a/theme/bootstrap/less/moodle/tabs.less b/theme/bootstrapbase/less/moodle/tabs.less similarity index 100% rename from theme/bootstrap/less/moodle/tabs.less rename to theme/bootstrapbase/less/moodle/tabs.less diff --git a/theme/bootstrap/less/moodle/undo.less b/theme/bootstrapbase/less/moodle/undo.less similarity index 100% rename from theme/bootstrap/less/moodle/undo.less rename to theme/bootstrapbase/less/moodle/undo.less diff --git a/theme/bootstrap/less/moodle/user.less b/theme/bootstrapbase/less/moodle/user.less similarity index 100% rename from theme/bootstrap/less/moodle/user.less rename to theme/bootstrapbase/less/moodle/user.less diff --git a/theme/bootstrap/less/moodle/yui_fixes.less b/theme/bootstrapbase/less/moodle/yui_fixes.less similarity index 100% rename from theme/bootstrap/less/moodle/yui_fixes.less rename to theme/bootstrapbase/less/moodle/yui_fixes.less diff --git a/theme/bootstrap/pix/favicon.ico b/theme/bootstrapbase/pix/favicon.ico similarity index 100% rename from theme/bootstrap/pix/favicon.ico rename to theme/bootstrapbase/pix/favicon.ico diff --git a/theme/bootstrap/pix/fp/alias.png b/theme/bootstrapbase/pix/fp/alias.png similarity index 100% rename from theme/bootstrap/pix/fp/alias.png rename to theme/bootstrapbase/pix/fp/alias.png diff --git a/theme/bootstrap/pix/fp/alias_sm.png b/theme/bootstrapbase/pix/fp/alias_sm.png similarity index 100% rename from theme/bootstrap/pix/fp/alias_sm.png rename to theme/bootstrapbase/pix/fp/alias_sm.png diff --git a/theme/bootstrap/pix/fp/check.png b/theme/bootstrapbase/pix/fp/check.png similarity index 100% rename from theme/bootstrap/pix/fp/check.png rename to theme/bootstrapbase/pix/fp/check.png diff --git a/theme/bootstrap/pix/fp/cross.png b/theme/bootstrapbase/pix/fp/cross.png similarity index 100% rename from theme/bootstrap/pix/fp/cross.png rename to theme/bootstrapbase/pix/fp/cross.png diff --git a/theme/bootstrap/pix/fp/dnd_arrow.gif b/theme/bootstrapbase/pix/fp/dnd_arrow.gif similarity index 100% rename from theme/bootstrap/pix/fp/dnd_arrow.gif rename to theme/bootstrapbase/pix/fp/dnd_arrow.gif diff --git a/theme/bootstrap/pix/fp/link.png b/theme/bootstrapbase/pix/fp/link.png similarity index 100% rename from theme/bootstrap/pix/fp/link.png rename to theme/bootstrapbase/pix/fp/link.png diff --git a/theme/bootstrap/pix/fp/link_sm.png b/theme/bootstrapbase/pix/fp/link_sm.png similarity index 100% rename from theme/bootstrap/pix/fp/link_sm.png rename to theme/bootstrapbase/pix/fp/link_sm.png diff --git a/theme/bootstrap/pix/fp/path_folder.png b/theme/bootstrapbase/pix/fp/path_folder.png similarity index 100% rename from theme/bootstrap/pix/fp/path_folder.png rename to theme/bootstrapbase/pix/fp/path_folder.png diff --git a/theme/bootstrap/pix/fp/path_folder_rtl.png b/theme/bootstrapbase/pix/fp/path_folder_rtl.png similarity index 100% rename from theme/bootstrap/pix/fp/path_folder_rtl.png rename to theme/bootstrapbase/pix/fp/path_folder_rtl.png diff --git a/theme/bootstrap/pix/fp/view_icon_active.png b/theme/bootstrapbase/pix/fp/view_icon_active.png similarity index 100% rename from theme/bootstrap/pix/fp/view_icon_active.png rename to theme/bootstrapbase/pix/fp/view_icon_active.png diff --git a/theme/bootstrap/pix/fp/view_icon_inactive.png b/theme/bootstrapbase/pix/fp/view_icon_inactive.png similarity index 100% rename from theme/bootstrap/pix/fp/view_icon_inactive.png rename to theme/bootstrapbase/pix/fp/view_icon_inactive.png diff --git a/theme/bootstrap/pix/fp/view_icon_selected.png b/theme/bootstrapbase/pix/fp/view_icon_selected.png similarity index 100% rename from theme/bootstrap/pix/fp/view_icon_selected.png rename to theme/bootstrapbase/pix/fp/view_icon_selected.png diff --git a/theme/bootstrap/pix/fp/view_list_active.png b/theme/bootstrapbase/pix/fp/view_list_active.png similarity index 100% rename from theme/bootstrap/pix/fp/view_list_active.png rename to theme/bootstrapbase/pix/fp/view_list_active.png diff --git a/theme/bootstrap/pix/fp/view_list_inactive.png b/theme/bootstrapbase/pix/fp/view_list_inactive.png similarity index 100% rename from theme/bootstrap/pix/fp/view_list_inactive.png rename to theme/bootstrapbase/pix/fp/view_list_inactive.png diff --git a/theme/bootstrap/pix/fp/view_list_selected.png b/theme/bootstrapbase/pix/fp/view_list_selected.png similarity index 100% rename from theme/bootstrap/pix/fp/view_list_selected.png rename to theme/bootstrapbase/pix/fp/view_list_selected.png diff --git a/theme/bootstrap/pix/fp/view_tree_active.png b/theme/bootstrapbase/pix/fp/view_tree_active.png similarity index 100% rename from theme/bootstrap/pix/fp/view_tree_active.png rename to theme/bootstrapbase/pix/fp/view_tree_active.png diff --git a/theme/bootstrap/pix/fp/view_tree_inactive.png b/theme/bootstrapbase/pix/fp/view_tree_inactive.png similarity index 100% rename from theme/bootstrap/pix/fp/view_tree_inactive.png rename to theme/bootstrapbase/pix/fp/view_tree_inactive.png diff --git a/theme/bootstrap/pix/fp/view_tree_selected.png b/theme/bootstrapbase/pix/fp/view_tree_selected.png similarity index 100% rename from theme/bootstrap/pix/fp/view_tree_selected.png rename to theme/bootstrapbase/pix/fp/view_tree_selected.png diff --git a/theme/bootstrap/pix/glyphicons-halflings-white.png b/theme/bootstrapbase/pix/glyphicons-halflings-white.png similarity index 100% rename from theme/bootstrap/pix/glyphicons-halflings-white.png rename to theme/bootstrapbase/pix/glyphicons-halflings-white.png diff --git a/theme/bootstrap/pix/glyphicons-halflings.png b/theme/bootstrapbase/pix/glyphicons-halflings.png similarity index 100% rename from theme/bootstrap/pix/glyphicons-halflings.png rename to theme/bootstrapbase/pix/glyphicons-halflings.png diff --git a/theme/bootstrap/pix/header.jpg b/theme/bootstrapbase/pix/header.jpg similarity index 100% rename from theme/bootstrap/pix/header.jpg rename to theme/bootstrapbase/pix/header.jpg diff --git a/theme/bootstrap/pix/horizontal-menu-submenu-indicator.png b/theme/bootstrapbase/pix/horizontal-menu-submenu-indicator.png similarity index 100% rename from theme/bootstrap/pix/horizontal-menu-submenu-indicator.png rename to theme/bootstrapbase/pix/horizontal-menu-submenu-indicator.png diff --git a/theme/bootstrap/pix/screenshot.jpg b/theme/bootstrapbase/pix/screenshot.jpg similarity index 100% rename from theme/bootstrap/pix/screenshot.jpg rename to theme/bootstrapbase/pix/screenshot.jpg diff --git a/theme/bootstrap/pix/sprite.png b/theme/bootstrapbase/pix/sprite.png similarity index 100% rename from theme/bootstrap/pix/sprite.png rename to theme/bootstrapbase/pix/sprite.png diff --git a/theme/bootstrap/pix/vertical-menu-submenu-indicator.png b/theme/bootstrapbase/pix/vertical-menu-submenu-indicator.png similarity index 100% rename from theme/bootstrap/pix/vertical-menu-submenu-indicator.png rename to theme/bootstrapbase/pix/vertical-menu-submenu-indicator.png diff --git a/theme/bootstrap/pix/yui2-treeview-sprite-rtl.gif b/theme/bootstrapbase/pix/yui2-treeview-sprite-rtl.gif similarity index 100% rename from theme/bootstrap/pix/yui2-treeview-sprite-rtl.gif rename to theme/bootstrapbase/pix/yui2-treeview-sprite-rtl.gif diff --git a/theme/bootstrap/readme_moodle.txt b/theme/bootstrapbase/readme_moodle.txt similarity index 89% rename from theme/bootstrap/readme_moodle.txt rename to theme/bootstrapbase/readme_moodle.txt index 96d5f75237d..f4959c3adc7 100644 --- a/theme/bootstrap/readme_moodle.txt +++ b/theme/bootstrapbase/readme_moodle.txt @@ -15,7 +15,7 @@ To update to the latest release of twitter bootstrap: ** 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: +then run these commands in the bootstrapbase/less/ folder: html5shiv.js @@ -44,6 +44,6 @@ The YUI port of the Twitter bootstrap libs are now longer maintained. If you nee functionality consider switching to the original jQuery version of these file If you do want to update use these file locations: -theme/bootstrap/yui/src/bootstrap/js/bootstrap-collapse.js -theme/bootstrap/yui/src/bootstrap/js/bootstrap-dropdown.js -theme/bootstrap/yui/src/bootstrap/js/bootstrap-engine.js +theme/bootstrapbase/yui/src/bootstrap/js/bootstrap-collapse.js +theme/bootstrapbase/yui/src/bootstrap/js/bootstrap-dropdown.js +theme/bootstrapbase/yui/src/bootstrap/js/bootstrap-engine.js diff --git a/theme/bootstrap/renderers.php b/theme/bootstrapbase/renderers.php similarity index 100% rename from theme/bootstrap/renderers.php rename to theme/bootstrapbase/renderers.php diff --git a/theme/bootstrap/renderers/core.php b/theme/bootstrapbase/renderers/core.php similarity index 98% rename from theme/bootstrap/renderers/core.php rename to theme/bootstrapbase/renderers/core.php index 203826b08c1..056d334df7e 100644 --- a/theme/bootstrap/renderers/core.php +++ b/theme/bootstrapbase/renderers/core.php @@ -17,12 +17,12 @@ /** * Renderers to align Moodle's HTML with that expected by Bootstrap * - * @package theme_bootstrap + * @package theme_bootstrapbase * @copyright 2012 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class theme_bootstrap_core_renderer extends core_renderer { +class theme_bootstrapbase_core_renderer extends core_renderer { /* * This renders a notification message. diff --git a/theme/bootstrap/style/README b/theme/bootstrapbase/style/README similarity index 100% rename from theme/bootstrap/style/README rename to theme/bootstrapbase/style/README diff --git a/theme/bootstrap/style/editor.css b/theme/bootstrapbase/style/editor.css similarity index 100% rename from theme/bootstrap/style/editor.css rename to theme/bootstrapbase/style/editor.css diff --git a/theme/bootstrap/style/generated.css b/theme/bootstrapbase/style/generated.css similarity index 100% rename from theme/bootstrap/style/generated.css rename to theme/bootstrapbase/style/generated.css diff --git a/theme/bootstrap/version.php b/theme/bootstrapbase/version.php similarity index 93% rename from theme/bootstrap/version.php rename to theme/bootstrapbase/version.php index 773ff81b8e3..f1319cec409 100644 --- a/theme/bootstrap/version.php +++ b/theme/bootstrapbase/version.php @@ -18,7 +18,7 @@ * Theme version info * * @package theme - * @subpackage bootstrap + * @subpackage bootstrapbase * @copyright 2013 Bas Brands, www.basbrands.nl * @authors Bas Brands, David Scotson * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -28,4 +28,4 @@ defined('MOODLE_INTERNAL') || die; $plugin->version = 2013032800; $plugin->requires = 2012112900; -$plugin->component = 'theme_bootstrap'; +$plugin->component = 'theme_bootstrapbase'; diff --git a/theme/bootstrap/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-debug.js b/theme/bootstrapbase/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-debug.js similarity index 100% rename from theme/bootstrap/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-debug.js rename to theme/bootstrapbase/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-debug.js diff --git a/theme/bootstrap/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-min.js b/theme/bootstrapbase/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-min.js similarity index 100% rename from theme/bootstrap/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-min.js rename to theme/bootstrapbase/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap-min.js diff --git a/theme/bootstrap/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap.js b/theme/bootstrapbase/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap.js similarity index 100% rename from theme/bootstrap/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap.js rename to theme/bootstrapbase/yui/build/moodle-theme_bootstrap-bootstrap/moodle-theme_bootstrap-bootstrap.js diff --git a/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap-debug.js b/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap-debug.js new file mode 100644 index 00000000000..4284bd141fc --- /dev/null +++ b/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap-debug.js @@ -0,0 +1,722 @@ +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']}); +; + +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 data-toggle=collapse 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 + * data-target or href 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 + * data-target or href 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 data-target or href + attribute. Calls the show or hide 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 _transition 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 _transition 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']}); +; +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 +data-toggle=dropdown 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']}); +; +YUI.add('moodle-theme_bootstrapbase-bootstrap', function (Y, NAME) { + +/** +The Moodle Bootstrap theme's bootstrap JavaScript + +@namespace Moodle +@module theme_bootstrapbase-bootstrap +**/ + +/** +The Moodle Bootstrap theme's bootstrap JavaScript + +@class Moodle.theme_bootstrapbase.bootstrap +@uses node +@uses selector-css3 +@constructor +**/ +var CSS = { + ACTIVE: 'active' + }, + SELECTORS = { + NAVBAR_BUTTON: '.btn-navbar', + // FIXME This is deliberately wrong because of a breaking issue in the upstream library. + TOGGLECOLLAPSE: '*[data-disabledtoggle="collapse"]', + NAV_COLLAPSE: '.nav-collapse' + }, + NS = Y.namespace('Moodle.theme_bootstrapbase.bootstrap'); + +/** + * Initialise the Moodle Bootstrap theme JavaScript + * + * @method init + */ +NS.init = function() { + // We must use these here and *must not* add them to the list of dependencies until + // Moodle fully supports the gallery. + // When debugging is disabled and we seed the Loader with out configuration, if these + // are in the requires array, then the Loader will try to load them from the CDN. It + // does not know that we have added them to the module rollup. + Y.use('gallery-bootstrap-dropdown', + 'gallery-bootstrap-collapse', + 'gallery-bootstrap-engine', function() { + + // Set up expandable and show. + NS.setup_toggle_expandable(); + NS.setup_toggle_show(); + + // Set up upstream dropdown delegation. + Y.Bootstrap.dropdown_delegation(); + }); +}; + +/** + * Setup toggling of the Toggle Collapse + * + * @method setup_toggle_expandable + * @private + */ +NS.setup_toggle_expandable = function() { + Y.delegate('click', this.toggle_expandable, Y.config.doc, SELECTORS.TOGGLECOLLAPSE, this); +}; + +/** + * Use the Y.Bootstrap.Collapse plugin to toggle collapse. + * + * @method toggle_expandable + * @private + * @param {EventFacade} e + */ +NS.toggle_expandable = function(e) { + if (typeof e.currentTarget.collapse === 'undefined') { + // Only plug if we haven't already. + e.currentTarget.plug(Y.Bootstrap.Collapse); + + // The plugin will now catch the click and handle the toggle. + // We only need to do this when we plug the node for the first + // time. + e.currentTarget.collapse.toggle(); + e.preventDefault(); + } +}; + +/** + * Set up the show toggler for activating the navigation bar + * + * @method setup_toggle_show + * @private + */ +NS.setup_toggle_show = function() { + Y.delegate('click', this.toggle_show, Y.config.doc, SELECTORS.NAVBAR_BUTTON); +}; + +/** + * Toggle hiding of the navigation bar + * + * @method toggle_show + * @private + * @param {EventFacade} e + */ +NS.toggle_show = function(e) { + // Toggle the active class on both the clicked .btn-navbar and the .nav-collapse. + // Our CSS will set the height for these. + Y.one(SELECTORS.NAV_COLLAPSE).toggleClass(CSS.ACTIVE); + e.currentTarget.toggleClass(CSS.ACTIVE); +}; + + +}, '@VERSION@', {"requires": ["node", "selector-css3"]}); diff --git a/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap-min.js b/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap-min.js new file mode 100644 index 00000000000..ebc87bfd954 --- /dev/null +++ b/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap-min.js @@ -0,0 +1 @@ +YUI.add("gallery-bootstrap-engine",function(e){function n(){n.superclass.constructor.apply(this,arguments)}var t="host";e.mix(n,{NAME:"bootstrap",ATTRS:{container:{getter:function(e){var n=this.get(t);return n&&n.one(e)}},iframe:{getter:function(){var e=this.get("container");return e&&e.one("iframe")}},host:{readyOnly:!0},ready:{value:!1,readyOnly:!0}}}),e.extend(n,e.Base,{EXTRAS:[],initializer:function(){var n=this,r,i,s,o=e.Array(n.EXTRAS),u,a=function(){e.later(0,n,function(){n._boot()})};try{r=e.config.win.parent,i=r&&r.window,s=i&&i.document}catch(f){}r&&i&&s?(u=YUI({bootstrap:!1,win:i,doc:s}),o.push("node",function(){a()}),n._set(t,u.use.apply(u,o))):a()},_boot:function(){var e=this,t;t=e._connect(),e._styleIframe(),e._init(),e._bind(),t&&e._ready(),e._set("ready",!0)},_connect:function(){var n=e.config.guid,r=this.get(t),i=r&&r.config.win,s=n&&i&&i.YUI&&i.YUI.Env[n];return s?s(this):!1},_init:function(){},_bind:function(){},_ready:function(){},_styleIframe:function(){var t=this.get("iframe");t&&e.each(["border","marginWidth","marginHeight","leftMargin","topMargin"],function(e){t.setAttribute(e,0)})}}),e.BootstrapEngine=n},"@VERSION@",{requires:["node","base-base"]}),YUI.add("gallery-bootstrap-collapse",function(e){function t(e){t.superclass.constructor.apply(this,arguments)}t.NAME="Bootstrap.Collapse",t.NS="collapse",e.extend(t,e.Plugin.Base,{defaults:{duration:.25,easing:"ease-in",showClass:"in",hideClass:"out",groupSelector:"> .accordion-group > .in"},transitioning:!1,initializer:function(t){this._node=t.host,this.config=e.mix(t,this.defaults),this.publish("show",{preventable:!0,defaultFn:this.show}),this.publish("hide",{preventable:!0,defaultFn:this.hide}),this._node.on("click",this.toggle,this)},_getTarget:function(){var t=this._node,n;return t.getData("target")?n=e.one(t.getData("target")):t.getAttribute("href").indexOf("#")>=0&&(n=e.one(t.getAttribute("href").substr(t.getAttribute("href").indexOf("#")))),n},hide:function(){var e=this.config.showClass,t=this.config.hideClass,n=this._getTarget();if(this.transitioning)return;n&&this._hideElement(n)},show:function(){var t=this.config.showClass,n=this.config.hideClass,r=this._getTarget(),i=this._node,s=this,o,u=this.config.groupSelector;if(this.transitioning)return;i.getData("parent")&&(o=e.one(i.getData("parent")),o&&o.all(u).each(function(e){s._hideElement(e)})),this._showElement(r)},toggle:function(t){t&&e.Lang.isFunction(t.preventDefault)&&t.preventDefault();var n=this._getTarget();n.hasClass(this.config.showClass)?this.fire("hide"):this.fire("show")},_transition:function(e,t){var n=this,r=this.config,i=r.duration,s=r.easing,o=t==="hide"?r.showClass:r.hideClass,u=t==="hide"?r.hideClass:r.showClass,a=t==="hide"?0:null,f=t==="hide"?"hidden":"shown",l=function(){e.removeClass(o),e.addClass(u),n.transitioning=!1,this.fire(f)};a===null&&(a=0,e.all("> *").each(function(e){a+=e.get("scrollHeight")})),this.transitioning=!0,e.transition({height:a+"px",duration:i,easing:s},l)},_hideElement:function(e){this._transition(e,"hide")},_showElement:function(e){this._transition(e,"show")}}),e.namespace("Bootstrap").Collapse=t},"@VERSION@",{requires:["plugin","transition","event","event-delegate"]}),YUI.add("gallery-bootstrap-dropdown",function(e){function n(e){n.superclass.constructor.apply(this,arguments)}var t=e.namespace("Bootstrap");n.NAME="Bootstrap.Dropdown",n.NS="dropdown",e.extend(n,e.Plugin.Base,{defaults:{className:"open",target:"target",selector:""},initializer:function(t){this._node=t.host,this.config=e.mix(t,this.defaults),this.publish("show",{preventable:!0,defaultFn:this.show}),this.publish("hide",{preventable:!0,defaultFn:this.hide}),this._node.on("click",this.toggle,this)},toggle:function(){var e=this.getTarget(),t=this.config.className;e.toggleClass(t),e.once("clickoutside",function(n){e.toggleClass(t)})},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)},getTarget:function(){var t=this._node,n=t.getData(this.config.target),r;return n||(n=t.getAttribute("href"),n=r&&r.replace(/.*(?=#[^\s]*$)/,"")),r=e.all(n),r.size()===0&&(r=t.get("parentNode")),r}}),t.Dropdown=n,t.dropdown_delegation=function(){e.delegate("click",function(e){var t=e.currentTarget;e.preventDefault(),typeof e.target.dropdown=="undefined"&&(t.plug(n),t.dropdown.toggle())},document.body,"*[data-toggle=dropdown]")}},"@VERSION@",{requires:["plugin","event","event-outside"]}),YUI.add("moodle-theme_bootstrapbase-bootstrap",function(e,t){var n={ACTIVE:"active"},r={NAVBAR_BUTTON:".btn-navbar",TOGGLECOLLAPSE:'*[data-disabledtoggle="collapse"]',NAV_COLLAPSE:".nav-collapse"},i=e.namespace("Moodle.theme_bootstrapbase.bootstrap");i.init=function(){e.use("gallery-bootstrap-dropdown","gallery-bootstrap-collapse","gallery-bootstrap-engine",function(){i.setup_toggle_expandable(),i.setup_toggle_show(),e.Bootstrap.dropdown_delegation()})},i.setup_toggle_expandable=function(){e.delegate("click",this.toggle_expandable,e.config.doc,r.TOGGLECOLLAPSE,this)},i.toggle_expandable=function(t){typeof t.currentTarget.collapse=="undefined"&&(t.currentTarget.plug(e.Bootstrap.Collapse),t.currentTarget.collapse.toggle(),t.preventDefault())},i.setup_toggle_show=function(){e.delegate("click",this.toggle_show,e.config.doc,r.NAVBAR_BUTTON)},i.toggle_show=function(t){e.one(r.NAV_COLLAPSE).toggleClass(n.ACTIVE),t.currentTarget.toggleClass(n.ACTIVE)}},"@VERSION@",{requires:["node","selector-css3"]}); diff --git a/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap.js b/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap.js new file mode 100644 index 00000000000..9d753b31095 --- /dev/null +++ b/theme/bootstrapbase/yui/build/moodle-theme_bootstrapbase-bootstrap/moodle-theme_bootstrapbase-bootstrap.js @@ -0,0 +1,712 @@ +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) { + } + + // 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; + // 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]; + + // 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 () { + }, + + /** + * 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 () { + }, + + /** + * 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 () { + }, + + /** + * 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.each (['border', 'marginWidth', 'marginHeight', 'leftMargin', 'topMargin'], function (name) { + iframe.setAttribute(name, 0); + }); + } + } + +}); + +Y.BootstrapEngine = BootstrapEngine; + + +}, '@VERSION@' ,{requires:['node','base-base']}); +; + +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 data-toggle=collapse 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 ) { + 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 + * data-target or href 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 + * data-target or href 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) { + self._hideElement(el); + }); + } + } + this._showElement(node); + }, + + /** + @method toggle + @description Toggle the state of the collapsible target, specified + by the host's data-target or href + attribute. Calls the show or hide 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 _transition 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 _transition 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']}); +; +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 +data-toggle=dropdown 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']}); +; +YUI.add('moodle-theme_bootstrapbase-bootstrap', function (Y, NAME) { + +/** +The Moodle Bootstrap theme's bootstrap JavaScript + +@namespace Moodle +@module theme_bootstrapbase-bootstrap +**/ + +/** +The Moodle Bootstrap theme's bootstrap JavaScript + +@class Moodle.theme_bootstrapbase.bootstrap +@uses node +@uses selector-css3 +@constructor +**/ +var CSS = { + ACTIVE: 'active' + }, + SELECTORS = { + NAVBAR_BUTTON: '.btn-navbar', + // FIXME This is deliberately wrong because of a breaking issue in the upstream library. + TOGGLECOLLAPSE: '*[data-disabledtoggle="collapse"]', + NAV_COLLAPSE: '.nav-collapse' + }, + NS = Y.namespace('Moodle.theme_bootstrapbase.bootstrap'); + +/** + * Initialise the Moodle Bootstrap theme JavaScript + * + * @method init + */ +NS.init = function() { + // We must use these here and *must not* add them to the list of dependencies until + // Moodle fully supports the gallery. + // When debugging is disabled and we seed the Loader with out configuration, if these + // are in the requires array, then the Loader will try to load them from the CDN. It + // does not know that we have added them to the module rollup. + Y.use('gallery-bootstrap-dropdown', + 'gallery-bootstrap-collapse', + 'gallery-bootstrap-engine', function() { + + // Set up expandable and show. + NS.setup_toggle_expandable(); + NS.setup_toggle_show(); + + // Set up upstream dropdown delegation. + Y.Bootstrap.dropdown_delegation(); + }); +}; + +/** + * Setup toggling of the Toggle Collapse + * + * @method setup_toggle_expandable + * @private + */ +NS.setup_toggle_expandable = function() { + Y.delegate('click', this.toggle_expandable, Y.config.doc, SELECTORS.TOGGLECOLLAPSE, this); +}; + +/** + * Use the Y.Bootstrap.Collapse plugin to toggle collapse. + * + * @method toggle_expandable + * @private + * @param {EventFacade} e + */ +NS.toggle_expandable = function(e) { + if (typeof e.currentTarget.collapse === 'undefined') { + // Only plug if we haven't already. + e.currentTarget.plug(Y.Bootstrap.Collapse); + + // The plugin will now catch the click and handle the toggle. + // We only need to do this when we plug the node for the first + // time. + e.currentTarget.collapse.toggle(); + e.preventDefault(); + } +}; + +/** + * Set up the show toggler for activating the navigation bar + * + * @method setup_toggle_show + * @private + */ +NS.setup_toggle_show = function() { + Y.delegate('click', this.toggle_show, Y.config.doc, SELECTORS.NAVBAR_BUTTON); +}; + +/** + * Toggle hiding of the navigation bar + * + * @method toggle_show + * @private + * @param {EventFacade} e + */ +NS.toggle_show = function(e) { + // Toggle the active class on both the clicked .btn-navbar and the .nav-collapse. + // Our CSS will set the height for these. + Y.one(SELECTORS.NAV_COLLAPSE).toggleClass(CSS.ACTIVE); + e.currentTarget.toggleClass(CSS.ACTIVE); +}; + + +}, '@VERSION@', {"requires": ["node", "selector-css3"]}); diff --git a/theme/bootstrap/yui/src/bootstrap/build.json b/theme/bootstrapbase/yui/src/bootstrap/build.json similarity index 68% rename from theme/bootstrap/yui/src/bootstrap/build.json rename to theme/bootstrapbase/yui/src/bootstrap/build.json index b8b6ac62c28..6854b964afe 100644 --- a/theme/bootstrap/yui/src/bootstrap/build.json +++ b/theme/bootstrapbase/yui/src/bootstrap/build.json @@ -1,7 +1,7 @@ { - "name": "moodle-theme_bootstrap-bootstrap", + "name": "moodle-theme_bootstrapbase-bootstrap", "builds": { - "moodle-theme_bootstrap-bootstrap": { + "moodle-theme_bootstrapbase-bootstrap": { "prependfiles": [ "bootstrapengine.js", "bootstrapcollapse.js", diff --git a/theme/bootstrap/yui/src/bootstrap/js/bootstrap.js b/theme/bootstrapbase/yui/src/bootstrap/js/bootstrap.js similarity index 95% rename from theme/bootstrap/yui/src/bootstrap/js/bootstrap.js rename to theme/bootstrapbase/yui/src/bootstrap/js/bootstrap.js index 2757862ed16..4de310305dc 100644 --- a/theme/bootstrap/yui/src/bootstrap/js/bootstrap.js +++ b/theme/bootstrapbase/yui/src/bootstrap/js/bootstrap.js @@ -2,13 +2,13 @@ The Moodle Bootstrap theme's bootstrap JavaScript @namespace Moodle -@module theme_bootstrap-bootstrap +@module theme_bootstrapbase-bootstrap **/ /** The Moodle Bootstrap theme's bootstrap JavaScript -@class Moodle.theme_bootstrap.bootstrap +@class Moodle.theme_bootstrapbase.bootstrap @uses node @uses selector-css3 @constructor @@ -22,7 +22,7 @@ var CSS = { TOGGLECOLLAPSE: '*[data-disabledtoggle="collapse"]', NAV_COLLAPSE: '.nav-collapse' }, - NS = Y.namespace('Moodle.theme_bootstrap.bootstrap'); + NS = Y.namespace('Moodle.theme_bootstrapbase.bootstrap'); /** * Initialise the Moodle Bootstrap theme JavaScript diff --git a/theme/bootstrap/yui/src/bootstrap/js/bootstrapcollapse.js b/theme/bootstrapbase/yui/src/bootstrap/js/bootstrapcollapse.js similarity index 100% rename from theme/bootstrap/yui/src/bootstrap/js/bootstrapcollapse.js rename to theme/bootstrapbase/yui/src/bootstrap/js/bootstrapcollapse.js diff --git a/theme/bootstrap/yui/src/bootstrap/js/bootstrapdropdown.js b/theme/bootstrapbase/yui/src/bootstrap/js/bootstrapdropdown.js similarity index 100% rename from theme/bootstrap/yui/src/bootstrap/js/bootstrapdropdown.js rename to theme/bootstrapbase/yui/src/bootstrap/js/bootstrapdropdown.js diff --git a/theme/bootstrap/yui/src/bootstrap/js/bootstrapengine.js b/theme/bootstrapbase/yui/src/bootstrap/js/bootstrapengine.js similarity index 100% rename from theme/bootstrap/yui/src/bootstrap/js/bootstrapengine.js rename to theme/bootstrapbase/yui/src/bootstrap/js/bootstrapengine.js diff --git a/theme/bootstrap/yui/src/bootstrap/meta/bootstrap.json b/theme/bootstrapbase/yui/src/bootstrap/meta/bootstrap.json similarity index 62% rename from theme/bootstrap/yui/src/bootstrap/meta/bootstrap.json rename to theme/bootstrapbase/yui/src/bootstrap/meta/bootstrap.json index d267ab3ebf1..a82a4600a87 100644 --- a/theme/bootstrap/yui/src/bootstrap/meta/bootstrap.json +++ b/theme/bootstrapbase/yui/src/bootstrap/meta/bootstrap.json @@ -1,5 +1,5 @@ { - "moodle-theme_bootstrap-bootstrap": { + "moodle-theme_bootstrapbase-bootstrap": { "requires": [ "node", "selector-css3" diff --git a/theme/clean/config.php b/theme/clean/config.php index 7a33c1f8ebb..2aeac085bc2 100644 --- a/theme/clean/config.php +++ b/theme/clean/config.php @@ -37,7 +37,7 @@ $THEME->name = 'clean'; ////////////////////////////////// // $THEME->doctype = 'html5'; -$THEME->parents = array('bootstrap'); +$THEME->parents = array('bootstrapbase'); $THEME->sheets = array('custom'); $THEME->supportscssoptimisation = false; $THEME->yuicssmodules = array();