From 3c2494aa83b7d5f1667ff04cad5d24a75074ed16 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Tue, 24 Mar 2015 20:10:24 +1100 Subject: [PATCH 01/47] Improve DataTable form widget, fixes vague error in RecordFinder --- modules/backend/formwidgets/DataTable.php | 53 ++++++++++++++++--- modules/backend/formwidgets/RecordFinder.php | 15 +----- .../backend/widgets/table/assets/js/table.js | 11 ++-- 3 files changed, 55 insertions(+), 24 deletions(-) diff --git a/modules/backend/formwidgets/DataTable.php b/modules/backend/formwidgets/DataTable.php index b401d9a05..1adf51e20 100644 --- a/modules/backend/formwidgets/DataTable.php +++ b/modules/backend/formwidgets/DataTable.php @@ -14,15 +14,29 @@ use ApplicationException; */ class DataTable extends FormWidgetBase { - /** - * {@inheritDoc} - */ - protected $defaultAlias = 'datatable'; + // + // Configurable properties + // /** * @var string Table size */ - protected $size = 'large'; + public $size = 'large'; + + /** + * @var bool Allow rows to be sorted + * @todo Not implemented... + */ + public $rowSorting = false; + + // + // Object properties + // + + /** + * {@inheritDoc} + */ + protected $defaultAlias = 'datatable'; /** * @var Backend\Widgets\Table Table widget @@ -34,7 +48,11 @@ class DataTable extends FormWidgetBase */ public function init() { - $this->size = $this->getConfig('size', $this->size); + $this->fillFromConfig([ + 'size', + 'rowSorting', + ]); + $this->table = $this->makeTableWidget(); $this->table->bindToController(); } @@ -64,6 +82,23 @@ class DataTable extends FormWidgetBase $this->populateTableWidget(); $this->vars['table'] = $this->table; $this->vars['size'] = $this->size; + $this->vars['rowSorting'] = $this->rowSorting; + } + + /** + * {@inheritDoc} + */ + public function getLoadValue() + { + $value = (array) parent::getLoadValue(); + + // Sync the array keys as the ID to make the + // table widget happy! + foreach ($value as $key => $_value) { + $value[$key] = ['id' => $key] + (array) $_value; + } + + return $value; } /** @@ -82,6 +117,12 @@ class DataTable extends FormWidgetBase $result += $records; } + // We should be dealing with a simple array, so + // strip out the id columns in the final array. + foreach ($result as $key => $_result) { + unset($result[$key]['id']); + } + return $result; } diff --git a/modules/backend/formwidgets/RecordFinder.php b/modules/backend/formwidgets/RecordFinder.php index 889e0cf9f..6be00aa49 100644 --- a/modules/backend/formwidgets/RecordFinder.php +++ b/modules/backend/formwidgets/RecordFinder.php @@ -101,11 +101,11 @@ class RecordFinder extends FormWidgetBase } /** - * Returns the value as a relation object from the model, + * Returns the model of a relation type, * supports nesting via HTML array. * @return Relation */ - protected function getRelationObject() + protected function getRelationModel() { list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom); @@ -116,17 +116,6 @@ class RecordFinder extends FormWidgetBase ])); } - return $model->{$attribute}(); - } - - /** - * Returns the model of a relation type, - * supports nesting via HTML array. - * @return Relation - */ - protected function getRelationModel() - { - list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom); return $model->makeRelation($attribute); } diff --git a/modules/backend/widgets/table/assets/js/table.js b/modules/backend/widgets/table/assets/js/table.js index 89c200ab8..687af3c4b 100644 --- a/modules/backend/widgets/table/assets/js/table.js +++ b/modules/backend/widgets/table/assets/js/table.js @@ -353,9 +353,9 @@ dataContainer.setAttribute('type', 'hidden') dataContainer.setAttribute('data-container', 'data-container') - dataContainer.value = records[i][columnName] !== undefined ? - records[i][columnName] : - "" + dataContainer.value = records[i][columnName] !== undefined + ? records[i][columnName] + : "" cellContentContainer.setAttribute('class', 'content-container') @@ -391,9 +391,10 @@ Table.prototype.fetchRecords = function(onSuccess) { this.dataSource.getRecords( - this.navigation.getPageFirstRowOffset(), + this.navigation.getPageFirstRowOffset(), this.options.recordsPerPage, - onSuccess) + onSuccess + ) } Table.prototype.updateScrollbar = function() { From 8d93c9ffabca25950ca63dab40dbd014c1671952 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 25 Mar 2015 19:33:00 +1100 Subject: [PATCH 02/47] List query is now AND where instead of OR where Refs #775 to support soft deletes --- modules/backend/widgets/Lists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index d88c11427..11295ea70 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -432,7 +432,7 @@ class Lists extends WidgetBase * Apply a supplied search term for primary columns */ if (count($primarySearchable) > 0) { - $query->orWhere(function ($innerQuery) use ($primarySearchable) { + $query->where(function ($innerQuery) use ($primarySearchable) { $innerQuery->searchWhere($this->searchTerm, $primarySearchable); }); } From 44b037c21c07dc5e857aa5a2b9f46ec23d7506bf Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 25 Mar 2015 19:33:19 +1100 Subject: [PATCH 03/47] Prevents doubling up of dataset --- modules/backend/formwidgets/DataTable.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/backend/formwidgets/DataTable.php b/modules/backend/formwidgets/DataTable.php index 1adf51e20..c9e37a955 100644 --- a/modules/backend/formwidgets/DataTable.php +++ b/modules/backend/formwidgets/DataTable.php @@ -138,6 +138,8 @@ class DataTable extends FormWidgetBase // all records at once. -ab $records = $this->getLoadValue() ?: []; + + $dataSource->purge(); $dataSource->initRecords((array) $records); } From 15a016a338e7d60bdb82bb722dc2bd8fccde1049 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 25 Mar 2015 19:34:09 +1100 Subject: [PATCH 04/47] Disable route persistence for static menus --- modules/cms/classes/Page.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/cms/classes/Page.php b/modules/cms/classes/Page.php index dc0886d78..88210bde6 100644 --- a/modules/cms/classes/Page.php +++ b/modules/cms/classes/Page.php @@ -114,10 +114,7 @@ class Page extends CmsCompoundObject * assuming that the method is called not during the front-end * request processing. */ - $controller = Controller::getController(); - if (!$controller) { - $controller = new Controller; - } + $controller = Controller::getController() ?: new Controller; return $controller->pageUrl($page, $params, true); } @@ -188,7 +185,8 @@ class Page extends CmsCompoundObject } $page = self::loadCached($theme, $item->reference); - $pageUrl = self::url($item->reference); + $controller = Controller::getController() ?: new Controller; + $pageUrl = $controller->pageUrl($item->reference, [], false); $result = []; $result['url'] = $pageUrl; From a743d786580dfff82ef7eb9a04ad8d8cbcd316ed Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Wed, 25 Mar 2015 19:35:00 +1100 Subject: [PATCH 05/47] List Column of type switch now has text-center CSS List Column now have getName and getId accessors --- modules/backend/assets/css/controls.css | 1 + .../backend/assets/less/controls/lists.less | 5 ++++ modules/backend/classes/FormField.php | 2 ++ modules/backend/classes/ListColumn.php | 29 +++++++++++++++++++ .../widgets/lists/partials/_list_body_row.htm | 2 +- .../widgets/lists/partials/_list_head_row.htm | 4 +-- 6 files changed, 40 insertions(+), 3 deletions(-) diff --git a/modules/backend/assets/css/controls.css b/modules/backend/assets/css/controls.css index fb80373c0..ea48e48df 100644 --- a/modules/backend/assets/css/controls.css +++ b/modules/backend/assets/css/controls.css @@ -181,6 +181,7 @@ table.table.data tbody td.column-slim{padding-left:0;padding-right:0} table.table.data tbody td.column-compact{padding:0} table.table.data tfoot a{color:#666666;text-decoration:none} table.table.data tfoot td,table.table.data tfoot th{border-color:#e2e2e2;padding:10px 15px} +table.table.data th.list-cell-type-switch,table.table.data td.list-cell-type-switch{text-align:center} table.table.data .list-checkbox{padding-left:16px;padding-right:8px;width:52px;vertical-align:top;border-right:1px solid #eeeeee} table.table.data .list-checkbox .checkbox{margin:0} table.table.data .list-checkbox .custom-checkbox{position:relative;top:5px;left:-2px} diff --git a/modules/backend/assets/less/controls/lists.less b/modules/backend/assets/less/controls/lists.less index cdab8fe12..be6b83f91 100644 --- a/modules/backend/assets/less/controls/lists.less +++ b/modules/backend/assets/less/controls/lists.less @@ -256,6 +256,11 @@ table.table.data { } } + th.list-cell-type-switch, + td.list-cell-type-switch { + text-align: center; + } + .list-checkbox { padding-left: 16px; padding-right: 8px; diff --git a/modules/backend/classes/FormField.php b/modules/backend/classes/FormField.php index 2a9a2ec06..1c198fcb6 100644 --- a/modules/backend/classes/FormField.php +++ b/modules/backend/classes/FormField.php @@ -487,6 +487,8 @@ class FormField /** * Returns a value suitable for the field id property. + * @param string $suffix Specify a suffix string + * @return string */ public function getId($suffix = null) { diff --git a/modules/backend/classes/ListColumn.php b/modules/backend/classes/ListColumn.php index c85cb5862..e352ef35b 100644 --- a/modules/backend/classes/ListColumn.php +++ b/modules/backend/classes/ListColumn.php @@ -1,5 +1,7 @@ columnName); + } + + /** + * Returns a value suitable for the column id property. + * @param string $suffix Specify a suffix string + * @return string + */ + public function getId($suffix = null) + { + $id = 'column'; + + $id .= '-'.$this->columnName; + + if ($suffix) { + $id .= '-'.$suffix; + } + + return HtmlHelper::nameToId($id); + } } diff --git a/modules/backend/widgets/lists/partials/_list_body_row.htm b/modules/backend/widgets/lists/partials/_list_body_row.htm index 4c0525b28..e7cabcde2 100644 --- a/modules/backend/widgets/lists/partials/_list_body_row.htm +++ b/modules/backend/widgets/lists/partials/_list_body_row.htm @@ -19,7 +19,7 @@ $column): ?> - + getRecordUrl($record))): ?> getRecordOnClick($record) ?> href=""> getColumnValue($record, $column) ?> diff --git a/modules/backend/widgets/lists/partials/_list_head_row.htm b/modules/backend/widgets/lists/partials/_list_head_row.htm index d1385f062..45f93d1c5 100644 --- a/modules/backend/widgets/lists/partials/_list_head_row.htm +++ b/modules/backend/widgets/lists/partials/_list_head_row.htm @@ -18,7 +18,7 @@ sortable): ?> width): ?>style="width: width ?>" - class="sortColumn==$column->columnName?'sort-'.$this->sortDirection.' active':'sort-desc' ?> list-cell-name-columnName ?>" + class="sortColumn==$column->columnName?'sort-'.$this->sortDirection.' active':'sort-desc' ?> list-cell-name-getName() ?> list-cell-type-type ?>" > width): ?>style="width: width ?>" - class="list-cell-name-columnName ?>" + class="list-cell-name-getName() ?> list-cell-type-type ?>" > getHeaderValue($column) ?> From f64497c5f32b5d0c96f31ffc8b7e5ce1f69a0af6 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 26 Mar 2015 19:05:07 +1100 Subject: [PATCH 06/47] Minor bug fix blocking new config approach --- modules/backend/behaviors/RelationController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 2022691df..ac10a4d98 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -971,7 +971,7 @@ class RelationController extends ControllerBehavior /* * Pivot */ - if ($this->manageMode == 'pivot' && isset($this->config->pivot)) { + if ($this->manageMode == 'pivot') { $config = $this->makeConfigForMode('manage', 'list'); $config->model = $this->relationModel; $config->alias = $this->alias . 'ManagePivotList'; @@ -1004,7 +1004,7 @@ class RelationController extends ControllerBehavior /* * List */ - elseif ($this->manageMode == 'list' && isset($this->config->list)) { + elseif ($this->manageMode == 'list') { $config = $this->makeConfigForMode('manage', 'list'); $config->model = $this->relationModel; $config->alias = $this->alias . 'ManageList'; @@ -1042,7 +1042,7 @@ class RelationController extends ControllerBehavior /* * Form */ - elseif ($this->manageMode == 'form' && isset($this->config->form)) { + elseif ($this->manageMode == 'form') { /* * Determine supplied form context From 5503705576f95662e1922eeae4f1dea8b9dbdeaf Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 26 Mar 2015 21:56:04 +1100 Subject: [PATCH 07/47] Define more backend permissions Addresses some of the concerns raised in #218 (fixes #218) --- modules/backend/ServiceProvider.php | 7 ++++++- modules/backend/controllers/AccessLogs.php | 2 +- modules/cms/ServiceProvider.php | 2 ++ modules/system/ServiceProvider.php | 10 +++++++--- modules/system/controllers/EventLogs.php | 2 +- modules/system/controllers/RequestLogs.php | 2 +- modules/system/lang/en/lang.php | 4 +++- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/modules/backend/ServiceProvider.php b/modules/backend/ServiceProvider.php index 35d063548..4f23977b8 100644 --- a/modules/backend/ServiceProvider.php +++ b/modules/backend/ServiceProvider.php @@ -98,6 +98,7 @@ class ServiceProvider extends ModuleServiceProvider 'category' => SettingsManager::CATEGORY_SYSTEM, 'icon' => 'icon-paint-brush', 'class' => 'Backend\Models\BrandSettings', + 'permissions' => ['backend.manage_branding'], 'order' => 500 ], 'editor' => [ @@ -134,7 +135,7 @@ class ServiceProvider extends ModuleServiceProvider 'category' => SettingsManager::CATEGORY_LOGS, 'icon' => 'icon-lock', 'url' => Backend::url('backend/accesslogs'), - 'permissions' => ['backend.access_admin_logs'], + 'permissions' => ['system.access_logs'], 'order' => 800 ] ]); @@ -152,6 +153,10 @@ class ServiceProvider extends ModuleServiceProvider 'backend.manage_users' => [ 'label' => 'system::lang.permissions.manage_other_administrators', 'tab' => 'system::lang.permissions.name' + ], + 'backend.manage_branding' => [ + 'label' => 'system::lang.permissions.manage_branding', + 'tab' => 'system::lang.permissions.name' ] ]); }); diff --git a/modules/backend/controllers/AccessLogs.php b/modules/backend/controllers/AccessLogs.php index 9662e1f5b..6d790df88 100644 --- a/modules/backend/controllers/AccessLogs.php +++ b/modules/backend/controllers/AccessLogs.php @@ -25,7 +25,7 @@ class AccessLogs extends Controller 'Backend.Behaviors.ListController' ]; - public $requiredPermissions = ['system.access_access_logs']; + public $requiredPermissions = ['system.access_logs']; public $listConfig = 'config_list.yaml'; diff --git a/modules/cms/ServiceProvider.php b/modules/cms/ServiceProvider.php index 8584bf077..e604b993f 100644 --- a/modules/cms/ServiceProvider.php +++ b/modules/cms/ServiceProvider.php @@ -138,6 +138,7 @@ class ServiceProvider extends ModuleServiceProvider 'category' => SettingsManager::CATEGORY_CMS, 'icon' => 'icon-picture-o', 'url' => Backend::URL('cms/themes'), + 'permissions' => ['system.manage_themes'], 'order' => 200 ], 'maintenance_settings' => [ @@ -146,6 +147,7 @@ class ServiceProvider extends ModuleServiceProvider 'category' => SettingsManager::CATEGORY_CMS, 'icon' => 'icon-plug', 'class' => 'Cms\Models\MaintenanceSettings', + 'permissions' => ['system.manage_themes'], 'order' => 400 ], ]); diff --git a/modules/system/ServiceProvider.php b/modules/system/ServiceProvider.php index efcb147ed..b38879fed 100644 --- a/modules/system/ServiceProvider.php +++ b/modules/system/ServiceProvider.php @@ -150,7 +150,7 @@ class ServiceProvider extends ModuleServiceProvider 'label' => 'system::lang.settings.menu_label', 'icon' => 'icon-cog', 'url' => Backend::url('system/settings'), - 'permissions' => ['backend.manage_users', 'system.*'], + 'permissions' => [], 'order' => 1000 ] ]); @@ -175,6 +175,10 @@ class ServiceProvider extends ModuleServiceProvider 'label' => 'system::lang.permissions.manage_software_updates', 'tab' => 'system::lang.permissions.name' ], + 'system.access_logs' => [ + 'label' => 'system::lang.permissions.access_logs', + 'tab' => 'system::lang.permissions.name' + ], 'system.manage_mail_settings' => [ 'label' => 'system::lang.permissions.manage_mail_settings', 'tab' => 'system::lang.permissions.name' @@ -258,7 +262,7 @@ class ServiceProvider extends ModuleServiceProvider 'category' => SettingsManager::CATEGORY_LOGS, 'icon' => 'icon-exclamation-triangle', 'url' => Backend::url('system/eventlogs'), - 'permissions' => ['system.access_event_logs'], + 'permissions' => ['system.access_logs'], 'order' => 800 ], 'request_logs' => [ @@ -267,7 +271,7 @@ class ServiceProvider extends ModuleServiceProvider 'category' => SettingsManager::CATEGORY_LOGS, 'icon' => 'icon-file-o', 'url' => Backend::url('system/requestlogs'), - 'permissions' => ['system.access_request_logs'], + 'permissions' => ['system.access_logs'], 'order' => 800 ], 'mail_settings' => [ diff --git a/modules/system/controllers/EventLogs.php b/modules/system/controllers/EventLogs.php index 50bc0fcda..2bccedb57 100644 --- a/modules/system/controllers/EventLogs.php +++ b/modules/system/controllers/EventLogs.php @@ -26,7 +26,7 @@ class EventLogs extends Controller 'Backend.Behaviors.ListController' ]; - public $requiredPermissions = ['system.access_event_logs']; + public $requiredPermissions = ['system.access_logs']; public $formConfig = 'config_form.yaml'; diff --git a/modules/system/controllers/RequestLogs.php b/modules/system/controllers/RequestLogs.php index 7d38ccf25..f7f77472b 100644 --- a/modules/system/controllers/RequestLogs.php +++ b/modules/system/controllers/RequestLogs.php @@ -26,7 +26,7 @@ class RequestLogs extends Controller 'Backend.Behaviors.ListController' ]; - public $requiredPermissions = ['system.access_request_logs']; + public $requiredPermissions = ['system.access_logs']; public $formConfig = 'config_form.yaml'; diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index 82cf5aec1..440086139 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -254,9 +254,11 @@ return [ 'name' => 'System', 'manage_system_settings' => 'Manage system settings', 'manage_software_updates' => 'Manage software updates', + 'access_logs' => 'View system logs', 'manage_mail_templates' => 'Manage mail templates', 'manage_mail_settings' => 'Manage mail settings', 'manage_other_administrators' => 'Manage other administrators', - 'view_the_dashboard' => 'View the dashboard' + 'view_the_dashboard' => 'View the dashboard', + 'manage_branding' => 'Customize the back-end' ] ]; From 5f9acc2e8d21cab60b096d70560329a4b733c433 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Thu, 26 Mar 2015 22:06:01 +1100 Subject: [PATCH 08/47] Fixes #358 - Main menu / Tabs no longer use inverted scrolling when horizontal --- modules/backend/assets/js/october-min.js | 4 ++-- modules/backend/assets/js/october.dragscroll.js | 2 +- modules/backend/assets/js/october.scrollbar.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/backend/assets/js/october-min.js b/modules/backend/assets/js/october-min.js index d960a8189..d9ec92aad 100644 --- a/modules/backend/assets/js/october-min.js +++ b/modules/backend/assets/js/october-min.js @@ -120,7 +120,7 @@ this.scrollClassContainer=this.options.scrollClassContainer?$(this.options.scrol if(this.options.scrollMarkerContainer) $(this.options.scrollMarkerContainer).append($('')) $el.mousewheel(function(event){if(!self.options.allowScroll) -return;var offset=self.options.vertical?((event.deltaFactor*event.deltaY)*-1):((event.deltaFactor*event.deltaX)*-1) +return;var offset=self.options.vertical?((event.deltaFactor*event.deltaY)*-1):(event.deltaFactor*event.deltaX) return!scrollWheel(offset)}) $el.on('mousedown',function(event){startDrag(event) return false}) @@ -788,7 +788,7 @@ if(isTouch){this.$el.on('touchstart',function(event){var touchEvent=event.origin event.stopPropagation()}})} else{this.$thumb.on('mousedown',function(event){startDrag(event)}) this.$track.on('mouseup',function(event){moveDrag(event)})} -$el.mousewheel(function(event){var offset=self.options.vertical?((event.deltaFactor*event.deltaY)*-1):((event.deltaFactor*event.deltaX)*-1) +$el.mousewheel(function(event){var offset=self.options.vertical?((event.deltaFactor*event.deltaY)*-1):(event.deltaFactor*event.deltaX) return!scrollWheel(offset*self.options.scrollSpeed)}) $el.on('oc.scrollbar.gotoStart',function(event){self.options.vertical?$el.scrollTop(0):$el.scrollLeft(0) self.update() diff --git a/modules/backend/assets/js/october.dragscroll.js b/modules/backend/assets/js/october.dragscroll.js index c7436e705..c2ccef89e 100644 --- a/modules/backend/assets/js/october.dragscroll.js +++ b/modules/backend/assets/js/october.dragscroll.js @@ -60,7 +60,7 @@ var offset = self.options.vertical ? ((event.deltaFactor * event.deltaY) * -1) - : ((event.deltaFactor * event.deltaX) * -1) + : (event.deltaFactor * event.deltaX) return !scrollWheel(offset) }) diff --git a/modules/backend/assets/js/october.scrollbar.js b/modules/backend/assets/js/october.scrollbar.js index cbc95db3c..14f09e920 100644 --- a/modules/backend/assets/js/october.scrollbar.js +++ b/modules/backend/assets/js/october.scrollbar.js @@ -68,7 +68,7 @@ $el.mousewheel(function (event){ var offset = self.options.vertical ? ((event.deltaFactor * event.deltaY) * -1) - : ((event.deltaFactor * event.deltaX) * -1) + : (event.deltaFactor * event.deltaX) return !scrollWheel(offset * self.options.scrollSpeed) }) From aa7f831a4e79bdb04ef81f1d3234b3f9779a6a46 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Fri, 27 Mar 2015 17:36:28 +1100 Subject: [PATCH 09/47] Fixes a conflict with triggerapi and popup scripts The hide event wasn't namespaced and caused the backdrop to hide --- modules/backend/assets/js/october-min.js | 10 +++++----- modules/backend/assets/js/october.triggerapi.js | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/backend/assets/js/october-min.js b/modules/backend/assets/js/october-min.js index d9ec92aad..0b806275d 100644 --- a/modules/backend/assets/js/october-min.js +++ b/modules/backend/assets/js/october-min.js @@ -89,15 +89,15 @@ self.onConditionChanged()} TriggerOn.prototype.onConditionChanged=function(){if(this.triggerCondition=='checked'){this.updateTarget($(this.options.trigger+':checked',this.triggerParent).length>0)} else if(this.triggerCondition=='value'){var trigger=$(this.options.trigger+':checked',this.triggerParent);if(trigger.length){this.updateTarget(trigger.val()==this.triggerConditionValue)}else{this.updateTarget($(this.options.trigger,this.triggerParent).val()==this.triggerConditionValue)}}} TriggerOn.prototype.updateTarget=function(status){if(this.options.triggerAction=='show') -this.$el.toggleClass('hide',!status).trigger('hide',[!status]) +this.$el.toggleClass('hide',!status).trigger('hide.oc.triggerapi',[!status]) else if(this.options.triggerAction=='hide') -this.$el.toggleClass('hide',status).trigger('hide',[status]) +this.$el.toggleClass('hide',status).trigger('hide.oc.triggerapi',[status]) else if(this.options.triggerAction=='enable') -this.$el.prop('disabled',!status).trigger('disable',[!status]).toggleClass('control-disabled',!status) +this.$el.prop('disabled',!status).trigger('disable.oc.triggerapi',[!status]).toggleClass('control-disabled',!status) else if(this.options.triggerAction=='disable') -this.$el.prop('disabled',status).trigger('disable',[status]).toggleClass('control-disabled',status) +this.$el.prop('disabled',status).trigger('disable.oc.triggerapi',[status]).toggleClass('control-disabled',status) else if(this.options.triggerAction=='empty'&&status) -this.$el.trigger('empty').val('') +this.$el.trigger('empty.oc.triggerapi').val('') if(this.options.triggerAction=='show'||this.options.triggerAction=='hide') this.fixButtonClasses() $(window).trigger('resize')} diff --git a/modules/backend/assets/js/october.triggerapi.js b/modules/backend/assets/js/october.triggerapi.js index c0be46ff8..f9af7a5a9 100644 --- a/modules/backend/assets/js/october.triggerapi.js +++ b/modules/backend/assets/js/october.triggerapi.js @@ -81,7 +81,8 @@ var trigger = $(this.options.trigger + ':checked', this.triggerParent); if (trigger.length) { this.updateTarget(trigger.val() == this.triggerConditionValue) - } else { + } + else { this.updateTarget($(this.options.trigger, this.triggerParent).val() == this.triggerConditionValue) } } @@ -89,15 +90,15 @@ TriggerOn.prototype.updateTarget = function(status) { if (this.options.triggerAction == 'show') - this.$el.toggleClass('hide', !status).trigger('hide', [!status]) + this.$el.toggleClass('hide', !status).trigger('hide.oc.triggerapi', [!status]) else if (this.options.triggerAction == 'hide') - this.$el.toggleClass('hide', status).trigger('hide', [status]) + this.$el.toggleClass('hide', status).trigger('hide.oc.triggerapi', [status]) else if (this.options.triggerAction == 'enable') - this.$el.prop('disabled', !status).trigger('disable', [!status]).toggleClass('control-disabled', !status) + this.$el.prop('disabled', !status).trigger('disable.oc.triggerapi', [!status]).toggleClass('control-disabled', !status) else if (this.options.triggerAction == 'disable') - this.$el.prop('disabled', status).trigger('disable', [status]).toggleClass('control-disabled', status) + this.$el.prop('disabled', status).trigger('disable.oc.triggerapi', [status]).toggleClass('control-disabled', status) else if (this.options.triggerAction == 'empty' && status) - this.$el.trigger('empty').val('') + this.$el.trigger('empty.oc.triggerapi').val('') if (this.options.triggerAction == 'show' || this.options.triggerAction == 'hide') this.fixButtonClasses() From 3eede4a7b774b104b384f3b27cc338c0eff162c3 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Fri, 27 Mar 2015 22:20:52 +1100 Subject: [PATCH 10/47] Reorganise and improve RelationController Fix bug in DataTable limited to 10 records --- .../backend/behaviors/RelationController.php | 825 +++++++++--------- .../assets/js/october.relation.js | 28 +- .../partials/_manage_pivot.htm | 12 + modules/backend/formwidgets/DataTable.php | 2 +- .../widgets/lists/assets/js/october.list.js | 10 +- 5 files changed, 450 insertions(+), 427 deletions(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index ac10a4d98..b09c7e37f 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -187,6 +187,69 @@ class RelationController extends ControllerBehavior $this->config = $this->originalConfig = $this->makeConfig($controller->relationConfig, $this->requiredConfig); } + /** + * Validates the supplied field and initializes the relation manager. + * @param string $field The relationship field. + * @return string The active field name. + */ + protected function validateField($field = null) + { + $field = $field ?: post(self::PARAM_FIELD); + + if ($field && $field != $this->field) { + $this->initRelation($this->model, $field); + } + + if (!$field && !$this->field) { + throw new ApplicationException(Lang::get('backend::lang.relation.missing_definition', compact('field'))); + } + + return $field ?: $this->field; + } + + /** + * Prepares the view data. + * @return void + */ + public function prepareVars() + { + $this->vars['relationManageId'] = $this->manageId; + $this->vars['relationLabel'] = $this->config->label ?: $this->field; + $this->vars['relationField'] = $this->field; + $this->vars['relationType'] = $this->relationType; + $this->vars['relationSearchWidget'] = $this->searchWidget; + $this->vars['relationToolbarWidget'] = $this->toolbarWidget; + $this->vars['relationManageMode'] = $this->manageMode; + $this->vars['relationManageWidget'] = $this->manageWidget; + $this->vars['relationToolbarButtons'] = $this->toolbarButtons; + $this->vars['relationViewMode'] = $this->viewMode; + $this->vars['relationViewWidget'] = $this->viewWidget; + $this->vars['relationViewModel'] = $this->viewModel; + $this->vars['relationPivotWidget'] = $this->pivotWidget; + $this->vars['relationSessionKey'] = $this->relationGetSessionKey(); + } + + /** + * The controller action is responsible for supplying the parent model + * so it's action must be fired. Additionally, each AJAX request must + * supply the relation's field name (_relation_field). + */ + protected function beforeAjax() + { + if ($this->initialized) { + return; + } + + $this->controller->pageAction(); + $this->validateField(); + $this->prepareVars(); + $this->initialized = true; + } + + // + // Interface + // + /** * Prepare the widgets used by this behavior * @param Model $model @@ -354,65 +417,6 @@ class RelationController extends ControllerBehavior return $this->relationRender($field, ['section' => 'view']); } - /** - * Validates the supplied field and initializes the relation manager. - * @param string $field The relationship field. - * @return string The active field name. - */ - protected function validateField($field = null) - { - $field = $field ?: post(self::PARAM_FIELD); - - if ($field && $field != $this->field) { - $this->initRelation($this->model, $field); - } - - if (!$field && !$this->field) { - throw new ApplicationException(Lang::get('backend::lang.relation.missing_definition', compact('field'))); - } - - return $field ?: $this->field; - } - - /** - * Prepares the view data. - * @return void - */ - public function prepareVars() - { - $this->vars['relationManageId'] = $this->manageId; - $this->vars['relationLabel'] = $this->config->label ?: $this->field; - $this->vars['relationField'] = $this->field; - $this->vars['relationType'] = $this->relationType; - $this->vars['relationSearchWidget'] = $this->searchWidget; - $this->vars['relationToolbarWidget'] = $this->toolbarWidget; - $this->vars['relationManageMode'] = $this->manageMode; - $this->vars['relationManageWidget'] = $this->manageWidget; - $this->vars['relationToolbarButtons'] = $this->toolbarButtons; - $this->vars['relationViewMode'] = $this->viewMode; - $this->vars['relationViewWidget'] = $this->viewWidget; - $this->vars['relationViewModel'] = $this->viewModel; - $this->vars['relationPivotWidget'] = $this->pivotWidget; - $this->vars['relationSessionKey'] = $this->relationGetSessionKey(); - } - - /** - * The controller action is responsible for supplying the parent model - * so it's action must be fired. Additionally, each AJAX request must - * supply the relation's field name (_relation_field). - */ - protected function beforeAjax() - { - if ($this->initialized) { - return; - } - - $this->controller->pageAction(); - $this->validateField(); - $this->prepareVars(); - $this->initialized = true; - } - /** * Controller accessor for making partials within this behavior. * @param string $partial @@ -449,39 +453,317 @@ class RelationController extends ControllerBehavior } /** - * Returns the existing record IDs for the relation. + * Returns the active session key. */ - protected function findExistingRelationIds($checkIds = null) + public function relationGetSessionKey($force = false) { - $foreignKeyName = $this->relationModel->getQualifiedKeyName(); - - $results = $this->relationObject - ->getBaseQuery() - ->select($foreignKeyName); - - if ($checkIds !== null && is_array($checkIds) && count($checkIds)) { - $results = $results->whereIn($foreignKeyName, $checkIds); + if ($this->sessionKey && !$force) { + return $this->sessionKey; } - return $results->lists($foreignKeyName); + if (post('_relation_session_key')) { + return $this->sessionKey = post('_relation_session_key'); + } + + if (post('_session_key')) { + return $this->sessionKey = post('_session_key'); + } + + return $this->sessionKey = FormHelper::getSessionKey(); } // - // Overrides + // Widgets // - /** - * Controller override: Extend the query used for populating the list - * after the default query is processed. - * @param October\Rain\Database\Builder $query - * @param string $field - */ - public function relationExtendQuery($query, $field) + protected function makeSearchWidget() { + $config = $this->makeConfig(); + $config->alias = $this->alias . 'ManageSearch'; + $config->growable = false; + $config->prompt = 'backend::lang.list.search_prompt'; + $widget = $this->makeWidget('Backend\Widgets\Search', $config); + $widget->cssClasses[] = 'recordfinder-search'; + return $widget; } - public function relationExtendRefreshResults($field) + protected function makeToolbarWidget() { + $defaultConfig = []; + + /* + * Add buttons to toolbar + */ + $defaultButtons = null; + + if (!$this->readOnly) { + $defaultButtons = '~/modules/backend/behaviors/relationcontroller/partials/_toolbar.htm'; + } + + $defaultConfig['buttons'] = $this->getConfig('view[toolbarPartial]', $defaultButtons); + + /* + * Make config + */ + $toolbarConfig = $this->makeConfig($this->getConfig('toolbar', $defaultConfig)); + $toolbarConfig->alias = $this->alias . 'Toolbar'; + + /* + * Add search to toolbar + */ + $useSearch = $this->viewMode == 'multi' && $this->getConfig('view[showSearch]'); + + if ($useSearch) { + $toolbarConfig->search = [ + 'prompt' => 'backend::lang.list.search_prompt' + ]; + } + + /* + * No buttons, no search should mean no toolbar + */ + if (empty($toolbarConfig->search) && empty($toolbarConfig->buttons)) + return; + + $toolbarWidget = $this->makeWidget('Backend\Widgets\Toolbar', $toolbarConfig); + $toolbarWidget->cssClasses[] = 'list-header'; + + return $toolbarWidget; + } + + protected function makeViewWidget() + { + /* + * Multiple (has many, belongs to many) + */ + if ($this->viewMode == 'multi') { + $config = $this->makeConfigForMode('view', 'list'); + $config->model = $this->relationModel; + $config->alias = $this->alias . 'ViewList'; + $config->showSorting = $this->getConfig('view[showSorting]', true); + $config->defaultSort = $this->getConfig('view[defaultSort]'); + $config->recordsPerPage = $this->getConfig('view[recordsPerPage]'); + $config->showCheckboxes = $this->getConfig('view[showCheckboxes]', !$this->readOnly); + + $defaultOnClick = sprintf( + "$.oc.relationBehavior.clickViewListRecord(':id', '%s', '%s')", + $this->field, + $this->relationGetSessionKey() + ); + + $config->recordOnClick = $this->getConfig('view[recordOnClick]', $defaultOnClick); + $config->recordUrl = $this->getConfig('view[recordUrl]', null); + + if ($emptyMessage = $this->getConfig('emptyMessage')) { + $config->noRecordsMessage = $emptyMessage; + } + + /* + * Constrain the query by the relationship and deferred items + */ + $widget = $this->makeWidget('Backend\Widgets\Lists', $config); + $widget->bindEvent('list.extendQuery', function ($query) { + $this->controller->relationExtendQuery($query, $this->field); + + $this->relationObject->setQuery($query); + if ($sessionKey = $this->relationGetSessionKey()) { + $this->relationObject->withDeferred($sessionKey); + } + elseif ($this->model->exists) { + $this->relationObject->addConstraints(); + } + + /* + * Allows pivot data to enter the fray + */ + if ($this->relationType == 'belongsToMany') { + $this->relationObject->setQuery($query->getQuery()); + return $this->relationObject; + } + }); + + /* + * Constrain the list by the search widget, if available + */ + if ($this->toolbarWidget && $this->getConfig('view[showSearch]')) { + if ($searchWidget = $this->toolbarWidget->getSearchWidget()) { + $searchWidget->bindEvent('search.submit', function () use ($widget, $searchWidget) { + $widget->setSearchTerm($searchWidget->getActiveTerm()); + return $widget->onRefresh(); + }); + + $searchWidget->setActiveTerm(null); + } + } + } + /* + * Single (belongs to, has one) + */ + elseif ($this->viewMode == 'single') { + $query = $this->relationObject; + $this->controller->relationExtendQuery($query, $this->field); + $this->viewModel = $query->getResults() ?: $this->relationModel; + + $config = $this->makeConfigForMode('view', 'form'); + $config->model = $this->viewModel; + $config->arrayName = class_basename($this->relationModel); + $config->context = 'relation'; + $config->alias = $this->alias . 'ViewForm'; + + $widget = $this->makeWidget('Backend\Widgets\Form', $config); + $widget->previewMode = true; + } + + return $widget; + } + + protected function makeManageWidget() + { + $widget = null; + + /* + * List / Pivot + */ + if ($this->manageMode == 'list' || $this->manageMode == 'pivot') { + $isPivot = $this->manageMode == 'pivot'; + + $config = $this->makeConfigForMode('manage', 'list'); + $config->model = $this->relationModel; + $config->alias = $this->alias . 'ManageList'; + $config->showSetup = false; + $config->showCheckboxes = $this->getConfig('manage[showCheckboxes]', !$isPivot); + $config->showSorting = $this->getConfig('manage[showSorting]', !$isPivot); + $config->defaultSort = $this->getConfig('manage[defaultSort]'); + $config->recordsPerPage = $this->getConfig('manage[recordsPerPage]'); + + if ($this->viewMode == 'single') { + $config->showCheckboxes = false; + $config->recordOnClick = sprintf( + "$.oc.relationBehavior.clickManageListRecord(:id, '%s', '%s')", + $this->field, + $this->relationGetSessionKey() + ); + } + elseif ($config->showCheckboxes) { + $config->recordOnClick = "$.oc.relationBehavior.toggleListCheckbox(this)"; + } + elseif ($isPivot) { + $config->recordOnClick = sprintf( + "$.oc.relationBehavior.clickManagePivotListRecord(:id, '%s', '%s')", + $this->field, + $this->relationGetSessionKey() + ); + } + + $widget = $this->makeWidget('Backend\Widgets\Lists', $config); + + /* + * Link the Search Widget to the List Widget + */ + if ($this->getConfig('manage[showSearch]')) { + $this->searchWidget = $this->makeSearchWidget(); + $this->searchWidget->bindToController(); + $this->searchWidget->bindEvent('search.submit', function () use ($widget) { + $widget->setSearchTerm($this->searchWidget->getActiveTerm()); + return $widget->onRefresh(); + }); + + $this->searchWidget->setActiveTerm(null); + } + } + /* + * Form + */ + elseif ($this->manageMode == 'form') { + + /* + * Determine supplied form context + */ + $manageConfig = isset($this->config->manage) ? $this->config->manage : []; + + if ($context = array_get($manageConfig, 'context')) { + if (is_array($context)) { + $context = $this->manageId + ? array_get($context, 'update') + : array_get($context, 'create'); + } + } + + $config = $this->makeConfigForMode('manage', 'form'); + $config->model = $this->relationModel; + $config->arrayName = class_basename($this->relationModel); + $config->context = $context ?: 'relation'; + $config->alias = $this->alias . 'ManageForm'; + + /* + * Existing record + */ + if ($this->manageId) { + $config->model = $config->model->find($this->manageId); + if (!$config->model) { + throw new ApplicationException(Lang::get('backend::lang.model.not_found', [ + 'class' => get_class($config->model), 'id' => $this->manageId + ])); + } + } + + $widget = $this->makeWidget('Backend\Widgets\Form', $config); + } + + if (!$widget) { + return null; + } + + /* + * Exclude existing relationships + */ + if ($this->manageMode == 'pivot' || $this->manageMode == 'list') { + $widget->bindEvent('list.extendQuery', function ($query) { + $this->controller->relationExtendQuery($query, $this->field); + + /* + * Where not in the current list of related records + */ + $existingIds = $this->findExistingRelationIds(); + if (count($existingIds)) { + $query->whereNotIn($this->relationModel->getQualifiedKeyName(), $existingIds); + } + + }); + } + + return $widget; + } + + protected function makePivotWidget() + { + $config = $this->makeConfigForMode('pivot', 'form'); + $config->model = $this->relationModel; + $config->arrayName = class_basename($this->relationModel); + $config->context = 'relation'; + $config->alias = $this->alias . 'ManagePivotForm'; + + /* + * Existing record + */ + if ($this->manageId) { + $foreignKeyName = $this->relationModel->getQualifiedKeyName(); + $hydratedModel = $this->relationObject->where($foreignKeyName, $this->manageId)->first(); + + $config->model = $hydratedModel; + if (!$config->model) { + throw new ApplicationException(Lang::get('backend::lang.model.not_found', [ + 'class' => get_class($config->model), 'id' => $this->manageId + ])); + } + } + else { + $pivotModel = $this->relationObject->newPivot(); + $config->model->setRelation('pivot', $pivotModel); + } + + $widget = $this->makeWidget('Backend\Widgets\Form', $config); + return $widget; } // @@ -775,11 +1057,19 @@ class RelationController extends ControllerBehavior return $this->relationRefresh(); } + /** + * Add multiple items using a single pivot form. + */ + public function onRelationManageAddPivot() + { + return $this->onRelationManagePivotForm(); + } + public function onRelationManagePivotForm() { $this->beforeAjax(); - $this->vars['foreignId'] = post('foreign_id'); + $this->vars['foreignId'] = post('foreign_id', post('checked')); return $this->relationMakePartial('pivot_form'); } @@ -787,18 +1077,26 @@ class RelationController extends ControllerBehavior { $this->beforeAjax(); - $foreignId = post('foreign_id'); - $foreignModel = $this->relationModel->find($foreignId); - $saveData = $this->pivotWidget->getSaveData(); + $foreignIds = (array) post('foreign_id'); + foreach ($foreignIds as $foreignId) { - /* - * Check for existing relation - */ - $foreignKeyName = $this->relationModel->getQualifiedKeyName(); - $existing = $this->relationObject->where($foreignKeyName, $foreignId)->count(); + /* + * Check for existing relation + */ + $foreignKeyName = $this->relationModel->getQualifiedKeyName(); + $existing = $this->relationObject->where($foreignKeyName, $foreignId)->count(); + + if (!$existing) { + /* + * Add related model to the parent model + */ + $saveData = $this->pivotWidget->getSaveData(); + $pivotData = array_get($saveData, 'pivot', []); + + $foreignModel = $this->relationModel->find($foreignId); + $this->relationObject->add($foreignModel, null, $pivotData); + } - if (!$existing) { - $this->relationObject->add($foreignModel, null, $saveData); } return ['#'.$this->relationGetId('view') => $this->relationRenderView()]; @@ -821,339 +1119,44 @@ class RelationController extends ControllerBehavior } // - // Widgets + // Overrides // - protected function makeSearchWidget() - { - $config = $this->makeConfig(); - $config->alias = $this->alias . 'ManageSearch'; - $config->growable = false; - $config->prompt = 'backend::lang.list.search_prompt'; - $widget = $this->makeWidget('Backend\Widgets\Search', $config); - $widget->cssClasses[] = 'recordfinder-search'; - return $widget; - } - - protected function makeToolbarWidget() - { - $defaultConfig = []; - - /* - * Add buttons to toolbar - */ - $defaultButtons = null; - - if (!$this->readOnly) { - $defaultButtons = '~/modules/backend/behaviors/relationcontroller/partials/_toolbar.htm'; - } - - $defaultConfig['buttons'] = $this->getConfig('view[toolbarPartial]', $defaultButtons); - - /* - * Make config - */ - $toolbarConfig = $this->makeConfig($this->getConfig('toolbar', $defaultConfig)); - $toolbarConfig->alias = $this->alias . 'Toolbar'; - - /* - * Add search to toolbar - */ - $useSearch = $this->viewMode == 'multi' && $this->getConfig('view[showSearch]'); - - if ($useSearch) { - $toolbarConfig->search = [ - 'prompt' => 'backend::lang.list.search_prompt' - ]; - } - - /* - * No buttons, no search should mean no toolbar - */ - if (empty($toolbarConfig->search) && empty($toolbarConfig->buttons)) - return; - - $toolbarWidget = $this->makeWidget('Backend\Widgets\Toolbar', $toolbarConfig); - $toolbarWidget->cssClasses[] = 'list-header'; - - return $toolbarWidget; - } - - protected function makeViewWidget() - { - /* - * Multiple (has many, belongs to many) - */ - if ($this->viewMode == 'multi') { - $config = $this->makeConfigForMode('view', 'list'); - $config->model = $this->relationModel; - $config->alias = $this->alias . 'ViewList'; - $config->showSorting = $this->getConfig('view[showSorting]', true); - $config->defaultSort = $this->getConfig('view[defaultSort]'); - $config->recordsPerPage = $this->getConfig('view[recordsPerPage]'); - $config->showCheckboxes = $this->getConfig('view[showCheckboxes]', !$this->readOnly); - - $defaultOnClick = sprintf( - "$.oc.relationBehavior.clickViewListRecord(':id', '%s', '%s')", - $this->field, - $this->relationGetSessionKey() - ); - - $config->recordOnClick = $this->getConfig('view[recordOnClick]', $defaultOnClick); - $config->recordUrl = $this->getConfig('view[recordUrl]', null); - - if ($emptyMessage = $this->getConfig('emptyMessage')) { - $config->noRecordsMessage = $emptyMessage; - } - - /* - * Constrain the query by the relationship and deferred items - */ - $widget = $this->makeWidget('Backend\Widgets\Lists', $config); - $widget->bindEvent('list.extendQuery', function ($query) { - $this->controller->relationExtendQuery($query, $this->field); - - $this->relationObject->setQuery($query); - if ($sessionKey = $this->relationGetSessionKey()) { - $this->relationObject->withDeferred($sessionKey); - } - elseif ($this->model->exists) { - $this->relationObject->addConstraints(); - } - - /* - * Allows pivot data to enter the fray - */ - if ($this->relationType == 'belongsToMany') { - $this->relationObject->setQuery($query->getQuery()); - return $this->relationObject; - } - }); - - /* - * Constrain the list by the search widget, if available - */ - if ($this->toolbarWidget && $this->getConfig('view[showSearch]')) { - if ($searchWidget = $this->toolbarWidget->getSearchWidget()) { - $searchWidget->bindEvent('search.submit', function () use ($widget, $searchWidget) { - $widget->setSearchTerm($searchWidget->getActiveTerm()); - return $widget->onRefresh(); - }); - - $searchWidget->setActiveTerm(null); - } - } - } - /* - * Single (belongs to, has one) - */ - elseif ($this->viewMode == 'single') { - $query = $this->relationObject; - $this->controller->relationExtendQuery($query, $this->field); - $this->viewModel = $query->getResults() ?: $this->relationModel; - - $config = $this->makeConfigForMode('view', 'form'); - $config->model = $this->viewModel; - $config->arrayName = class_basename($this->relationModel); - $config->context = 'relation'; - $config->alias = $this->alias . 'ViewForm'; - - $widget = $this->makeWidget('Backend\Widgets\Form', $config); - $widget->previewMode = true; - } - - return $widget; - } - - protected function makeManageWidget() - { - $widget = null; - /* - * Pivot - */ - if ($this->manageMode == 'pivot') { - $config = $this->makeConfigForMode('manage', 'list'); - $config->model = $this->relationModel; - $config->alias = $this->alias . 'ManagePivotList'; - $config->showSetup = false; - $config->showSorting = $this->getConfig('manage[showSorting]', false); - $config->defaultSort = $this->getConfig('manage[defaultSort]'); - $config->recordsPerPage = $this->getConfig('manage[recordsPerPage]'); - $config->recordOnClick = sprintf( - "$.oc.relationBehavior.clickManagePivotListRecord(:id, '%s', '%s')", - $this->field, - $this->relationGetSessionKey() - ); - - $widget = $this->makeWidget('Backend\Widgets\Lists', $config); - - /* - * Link the Search Widget to the List Widget - */ - if ($this->getConfig('pivot[showSearch]')) { - $this->searchWidget = $this->makeSearchWidget(); - $this->searchWidget->bindToController(); - $this->searchWidget->bindEvent('search.submit', function () use ($widget) { - $widget->setSearchTerm($this->searchWidget->getActiveTerm()); - return $widget->onRefresh(); - }); - - $this->searchWidget->setActiveTerm(null); - } - } - /* - * List - */ - elseif ($this->manageMode == 'list') { - $config = $this->makeConfigForMode('manage', 'list'); - $config->model = $this->relationModel; - $config->alias = $this->alias . 'ManageList'; - $config->showSetup = false; - $config->showCheckboxes = true; - $config->showSorting = $this->getConfig('manage[showSorting]', true); - $config->defaultSort = $this->getConfig('manage[defaultSort]'); - $config->recordsPerPage = $this->getConfig('manage[recordsPerPage]'); - - if ($this->viewMode == 'single') { - $config->showCheckboxes = false; - $config->recordOnClick = sprintf( - "$.oc.relationBehavior.clickManageListRecord(:id, '%s', '%s')", - $this->field, - $this->relationGetSessionKey() - ); - } - - $widget = $this->makeWidget('Backend\Widgets\Lists', $config); - - /* - * Link the Search Widget to the List Widget - */ - if ($this->getConfig('manage[showSearch]')) { - $this->searchWidget = $this->makeSearchWidget(); - $this->searchWidget->bindToController(); - $this->searchWidget->bindEvent('search.submit', function () use ($widget) { - $widget->setSearchTerm($this->searchWidget->getActiveTerm()); - return $widget->onRefresh(); - }); - - $this->searchWidget->setActiveTerm(null); - } - } - /* - * Form - */ - elseif ($this->manageMode == 'form') { - - /* - * Determine supplied form context - */ - $manageConfig = isset($this->config->manage) ? $this->config->manage : []; - - if ($context = array_get($manageConfig, 'context')) { - if (is_array($context)) { - $context = $this->manageId - ? array_get($context, 'update') - : array_get($context, 'create'); - } - } - - $config = $this->makeConfigForMode('manage', 'form'); - $config->model = $this->relationModel; - $config->arrayName = class_basename($this->relationModel); - $config->context = $context ?: 'relation'; - $config->alias = $this->alias . 'ManageForm'; - - /* - * Existing record - */ - if ($this->manageId) { - $config->model = $config->model->find($this->manageId); - if (!$config->model) { - throw new ApplicationException(Lang::get('backend::lang.model.not_found', [ - 'class' => get_class($config->model), 'id' => $this->manageId - ])); - } - } - - $widget = $this->makeWidget('Backend\Widgets\Form', $config); - } - - if (!$widget) { - return null; - } - - /* - * Exclude existing relationships - */ - if ($this->manageMode == 'pivot' || $this->manageMode == 'list') { - $widget->bindEvent('list.extendQuery', function ($query) { - $this->controller->relationExtendQuery($query, $this->field); - - /* - * Where not in the current list of related records - */ - $existingIds = $this->findExistingRelationIds(); - if (count($existingIds)) { - $query->whereNotIn($this->relationModel->getQualifiedKeyName(), $existingIds); - } - - }); - } - - return $widget; - } - - protected function makePivotWidget() - { - $config = $this->makeConfigForMode('pivot', 'form'); - $config->model = $this->relationModel; - $config->arrayName = class_basename($this->relationModel); - $config->context = 'relation'; - $config->alias = $this->alias . 'ManagePivotForm'; - - /* - * Existing record - */ - if ($this->manageId) { - $foreignKeyName = $this->relationModel->getQualifiedKeyName(); - $hydratedModel = $this->relationObject->where($foreignKeyName, $this->manageId)->first(); - - $config->model = $hydratedModel; - if (!$config->model) { - throw new ApplicationException(Lang::get('backend::lang.model.not_found', [ - 'class' => get_class($config->model), 'id' => $this->manageId - ])); - } - } - - $widget = $this->makeWidget('Backend\Widgets\Form', $config); - return $widget; - } - /** - * Returns the active session key. + * Controller override: Extend the query used for populating the list + * after the default query is processed. + * @param October\Rain\Database\Builder $query + * @param string $field */ - public function relationGetSessionKey($force = false) + public function relationExtendQuery($query, $field) { - if ($this->sessionKey && !$force) { - return $this->sessionKey; - } + } - if (post('_relation_session_key')) { - return $this->sessionKey = post('_relation_session_key'); - } - - if (post('_session_key')) { - return $this->sessionKey = post('_session_key'); - } - - return $this->sessionKey = FormHelper::getSessionKey(); + public function relationExtendRefreshResults($field) + { } // // Helpers // + /** + * Returns the existing record IDs for the relation. + */ + protected function findExistingRelationIds($checkIds = null) + { + $foreignKeyName = $this->relationModel->getQualifiedKeyName(); + + $results = $this->relationObject + ->getBaseQuery() + ->select($foreignKeyName); + + if ($checkIds !== null && is_array($checkIds) && count($checkIds)) { + $results = $results->whereIn($foreignKeyName, $checkIds); + } + + return $results->lists($foreignKeyName); + } /** * Determine the default buttons based on the model relationship type. diff --git a/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js b/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js index b541f593d..581feb4ff 100644 --- a/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js +++ b/modules/backend/behaviors/relationcontroller/assets/js/october.relation.js @@ -5,18 +5,8 @@ var RelationBehavior = function() { - this.clickManageListRecord = function(recordId, relationField, sessionKey) { - var oldPopup = $('#relationManagePopup') - - $.request('onRelationClickManageList', { - data: { - 'record_id': recordId, - '_relation_field': relationField, - '_session_key': sessionKey - } - }) - - oldPopup.popup('hide') + this.toggleListCheckbox = function(el) { + $(el).closest('.control-list').listWidget('toggleChecked', [el]) } this.clickViewListRecord = function(recordId, relationField, sessionKey) { @@ -33,6 +23,20 @@ }) } + this.clickManageListRecord = function(recordId, relationField, sessionKey) { + var oldPopup = $('#relationManagePopup') + + $.request('onRelationClickManageList', { + data: { + 'record_id': recordId, + '_relation_field': relationField, + '_session_key': sessionKey + } + }) + + oldPopup.popup('hide') + } + this.clickManagePivotListRecord = function(foreignId, relationField, sessionKey) { var oldPopup = $('#relationManagePivotPopup'), newPopup = $('') diff --git a/modules/backend/behaviors/relationcontroller/partials/_manage_pivot.htm b/modules/backend/behaviors/relationcontroller/partials/_manage_pivot.htm index 02f0ca616..6572dc1be 100644 --- a/modules/backend/behaviors/relationcontroller/partials/_manage_pivot.htm +++ b/modules/backend/behaviors/relationcontroller/partials/_manage_pivot.htm @@ -17,6 +17,18 @@ + + +
+ + +
+

Recommended

+
+
+
+
+ +
+ + + + + + diff --git a/modules/system/controllers/updates/_install_themes.htm b/modules/system/controllers/updates/_install_themes.htm new file mode 100644 index 000000000..9ea744a83 --- /dev/null +++ b/modules/system/controllers/updates/_install_themes.htm @@ -0,0 +1,104 @@ + +
+ + +
+ +
+ +
+ +
+ + +
+ +

+ Installed themes + (0) +

+ + +
+

There are no themes installed from the marketplace.

+
+ +
    + + +
  • +
    + +
    +
    +

    +

    by

    +
    + +
  • + + +
+ + +
+ +
+
+ + +
+

Recommended

+
+
+
+
+ +
+ +
+ +
+ + diff --git a/modules/system/controllers/updates/_list_search.htm b/modules/system/controllers/updates/_list_search.htm deleted file mode 100644 index edddfa2f1..000000000 --- a/modules/system/controllers/updates/_list_search.htm +++ /dev/null @@ -1,24 +0,0 @@ - - -
- - - - - -
- - diff --git a/modules/system/controllers/updates/_list_toolbar.htm b/modules/system/controllers/updates/_list_toolbar.htm index 8639e2672..c680e089d 100644 --- a/modules/system/controllers/updates/_list_toolbar.htm +++ b/modules/system/controllers/updates/_list_toolbar.htm @@ -11,4 +11,9 @@ class="btn btn-default oc-icon-puzzle-piece"> + + Install plugins + \ No newline at end of file diff --git a/modules/system/controllers/updates/_theme_form.htm b/modules/system/controllers/updates/_theme_form.htm new file mode 100644 index 000000000..8729e8974 --- /dev/null +++ b/modules/system/controllers/updates/_theme_form.htm @@ -0,0 +1,47 @@ + 'themeForm']) ?> + + + + + + \ No newline at end of file diff --git a/modules/system/controllers/updates/config_list.yaml b/modules/system/controllers/updates/config_list.yaml index 02b043b32..5bda9f802 100644 --- a/modules/system/controllers/updates/config_list.yaml +++ b/modules/system/controllers/updates/config_list.yaml @@ -9,4 +9,3 @@ noRecordsMessage: backend::lang.list.no_records toolbar: buttons: list_toolbar - search: list_search \ No newline at end of file diff --git a/modules/system/controllers/updates/install.htm b/modules/system/controllers/updates/install.htm new file mode 100644 index 000000000..5043e13da --- /dev/null +++ b/modules/system/controllers/updates/install.htm @@ -0,0 +1,49 @@ + +
    +
  • +
  • pageTitle)) ?>
  • +
+ + +fatalError): ?> + +
+ +
+
+
+ makePartial('install_plugins') ?> +
+
+
+
+ makePartial('install_themes') ?> +
+
+
+
+ + + +
+

fatalError) ?>

+

+

+
+ + diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index 440086139..6c5e9e02e 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -52,6 +52,12 @@ return [ 'my_settings' => 'My Settings' ] ], + 'theme' => [ + 'name' => [ + 'label' => 'Theme Name', + 'help' => 'Name the theme by its unique code. For example, RainLab.Vanilla' + ] + ], 'plugin' => [ 'unnamed' => 'Unnamed plugin', 'name' => [ @@ -156,7 +162,9 @@ return [ 'install' => [ 'project_label' => 'Attach to Project', 'plugin_label' => 'Install Plugin', + 'theme_label' => 'Install Theme', 'missing_plugin_name' => 'Please specify a Plugin name to install.', + 'missing_theme_name' => 'Please specify a Theme name to install.', 'install_completing' => 'Finishing installation process', 'install_success' => 'The plugin has been installed successfully.' ], diff --git a/modules/system/models/pluginversion/columns.yaml b/modules/system/models/pluginversion/columns.yaml index 5bd7b41e5..8d49f9085 100644 --- a/modules/system/models/pluginversion/columns.yaml +++ b/modules/system/models/pluginversion/columns.yaml @@ -4,20 +4,20 @@ columns: - name: - label: system::lang.updates.plugin_name - sortable: false + name: + label: system::lang.updates.plugin_name + sortable: false - description: - label: system::lang.updates.plugin_description - sortable: false + description: + label: system::lang.updates.plugin_description + sortable: false - version: - label: system::lang.updates.plugin_version - sortable: false + version: + label: system::lang.updates.plugin_version + sortable: false - author: - label: system::lang.updates.plugin_author - sortable: false - type: partial - path: column_author \ No newline at end of file + author: + label: system::lang.updates.plugin_author + sortable: false + type: partial + path: column_author \ No newline at end of file From a921201d6d1f71484c992040e85e29c6abfa4110 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 4 Apr 2015 17:31:39 +1100 Subject: [PATCH 35/47] Fixes broken search --- modules/system/controllers/Updates.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index 2f8646b0e..21c7889ff 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -643,7 +643,7 @@ class Updates extends Controller // Product install // - public function install_onSearchProducts() + public function onSearchProducts() { $searchType = get('search', 'plugins'); $serverUri = $searchType == 'plugins' ? 'plugin/search' : 'theme/search'; @@ -652,7 +652,7 @@ class Updates extends Controller return $manager->requestServerData($serverUri, ['query' => get('query')]); } - public function install_onGetPopularPlugins() + public function onGetPopularPlugins() { $installed = $this->getInstalledPlugins(); $popular = UpdateManager::instance()->requestPopularProducts('plugin'); @@ -661,7 +661,7 @@ class Updates extends Controller return ['result' => $popular]; } - public function install_onGetPopularThemes() + public function onGetPopularThemes() { $installed = $this->getInstalledThemes(); $popular = UpdateManager::instance()->requestPopularProducts('theme'); From 4b1f1b767bb950a83fc89f3837f1f36a06b33060 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 15:03:51 +1000 Subject: [PATCH 36/47] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35981416b..30e04e06e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +* **Build 23x** (2015-03-xx) + - Installing plugins in the back-end has a new interface. + - Marketplace themes can now be installed using the back-end. + * **Build 236** (2015-03-28) - Default context of `manage` and `pivot` forms is now *create* and *update* respectively, instead of the old value *relation*. Use the `context` option to set it back to the old value (see Backend > Relations docs). From 885dd70060a1cb98fa54fd97e00f46863839e3db Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 15:28:23 +1000 Subject: [PATCH 37/47] * Build 239 --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30e04e06e..bdb7a20b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ -* **Build 23x** (2015-03-xx) - - Installing plugins in the back-end has a new interface. - - Marketplace themes can now be installed using the back-end. +* **Build 239** (2015-04-06) + - Installing plugins has a new interface and themes can now be installed using the back-end. * **Build 236** (2015-03-28) - Default context of `manage` and `pivot` forms is now *create* and *update* respectively, instead of the old value *relation*. Use the `context` option to set it back to the old value (see Backend > Relations docs). From b806bd072084cbe2796e0e88250ef8141f425737 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 15:31:33 +1000 Subject: [PATCH 38/47] Fixes installed theme count --- modules/system/controllers/updates/_install_themes.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/controllers/updates/_install_themes.htm b/modules/system/controllers/updates/_install_themes.htm index 9ea744a83..9b1f3d803 100644 --- a/modules/system/controllers/updates/_install_themes.htm +++ b/modules/system/controllers/updates/_install_themes.htm @@ -29,7 +29,7 @@

Installed themes - (0) + ()

From 93dd61efc71e64092a53fe21fd3ef4b630d8e9be Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 16:25:43 +1000 Subject: [PATCH 39/47] Move the search term constraint under the same query group Refs https://github.com/octobercms/october/pull/775 --- modules/backend/widgets/Lists.php | 61 +++++++++++++++++-------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index 11295ea70..09abec637 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -361,25 +361,6 @@ class Lists extends WidgetBase $joins[] = $column->relation; } - /* - * Include any relation constraints - */ - if ($joins) { - foreach (array_unique($joins) as $join) { - /* - * Apply a supplied search term for relation columns and - * constrain the query only if there is something to search for - */ - $columnsToSearch = array_get($relationSearchable, $join, []); - - if (count($columnsToSearch) > 0) { - $query->whereHas($join, function ($_query) use ($columnsToSearch) { - $_query->searchWhere($this->searchTerm, $columnsToSearch); - }); - } - } - } - /* * Add eager loads to the query */ @@ -387,6 +368,39 @@ class Lists extends WidgetBase $query->with(array_unique($withs)); } + /* + * Apply search term + */ + $query->where(function ($innerQuery) use ($primarySearchable, $relationSearchable, $joins) { + + /* + * Search primary columns + */ + if (count($primarySearchable) > 0) { + $innerQuery->orSearchWhere($this->searchTerm, $primarySearchable); + } + + /* + * Search relation columns + */ + if ($joins) { + foreach (array_unique($joins) as $join) { + /* + * Apply a supplied search term for relation columns and + * constrain the query only if there is something to search for + */ + $columnsToSearch = array_get($relationSearchable, $join, []); + + if (count($columnsToSearch) > 0) { + $innerQuery->orWhereHas($join, function ($_query) use ($columnsToSearch) { + $_query->searchWhere($this->searchTerm, $columnsToSearch); + }); + } + } + } + + }); + /* * Custom select queries */ @@ -428,15 +442,6 @@ class Lists extends WidgetBase } } - /* - * Apply a supplied search term for primary columns - */ - if (count($primarySearchable) > 0) { - $query->where(function ($innerQuery) use ($primarySearchable) { - $innerQuery->searchWhere($this->searchTerm, $primarySearchable); - }); - } - /* * Apply sorting */ From 13b14729fd04a345a9735256c6d657969634a661 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 16:57:53 +1000 Subject: [PATCH 40/47] Don't allow a record to be clicked if there is no form to display --- modules/backend/behaviors/RelationController.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 0c5d97140..d26dddedd 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -561,6 +561,12 @@ class RelationController extends ControllerBehavior if ($config->recordUrl) { $defaultOnClick = null; } + elseif ( + !$this->makeConfigForMode('manage', 'form', false) && + !$this->makeConfigForMode('pivot', 'form', false) + ) { + $defaultOnClick = null; + } $config->recordOnClick = $this->getConfig('view[recordOnClick]', $defaultOnClick); @@ -1267,7 +1273,7 @@ class RelationController extends ControllerBehavior * Returns the configuration for a mode (view, manage, pivot) for an * expected type (list, form). Uses fallback configuration. */ - protected function makeConfigForMode($mode = 'view', $type = 'list') + protected function makeConfigForMode($mode = 'view', $type = 'list', $throwException = true) { $config = null; @@ -1293,12 +1299,16 @@ class RelationController extends ControllerBehavior * - view.list => manage.list */ if (!$config) { - if ($mode == 'manage' && $type == 'list') { return $this->makeConfigForMode('view', $type); } - throw new ApplicationException('Missing configuration for '.$mode.'.'.$type.' in RelationController definition '.$this->field); + if ($throwException) { + throw new ApplicationException('Missing configuration for '.$mode.'.'.$type.' in RelationController definition '.$this->field); + } + else { + return false; + } } return $this->makeConfig($config); From bc64201f02721bdfc44f7e628f5e819765d62411 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 18:01:03 +1000 Subject: [PATCH 41/47] Fixes bug not displaying recommended plugins --- modules/system/controllers/Updates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index 21c7889ff..d6aec0024 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -711,7 +711,7 @@ class Updates extends Controller } } - return $popular; + return array_values($popular); } } From ace4175fdd05072c73a68a68d1a690db56476895 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 18:05:56 +1000 Subject: [PATCH 42/47] CSS -> LESS --- modules/system/assets/css/updates/install.css | 15 +- .../system/assets/less/updates/install.less | 438 +++++++++--------- 2 files changed, 230 insertions(+), 223 deletions(-) diff --git a/modules/system/assets/css/updates/install.css b/modules/system/assets/css/updates/install.css index ddf0db7df..7bcd70388 100644 --- a/modules/system/assets/css/updates/install.css +++ b/modules/system/assets/css/updates/install.css @@ -7,14 +7,6 @@ margin: 0; padding: 10px 0; overflow: hidden; - /* clearfix */ -} -.product-list li button, -.product-list li .image, -.product-list li .details { - -webkit-transition: opacity .2s linear; - -moz-transition: opacity .2s linear; - transition: opacity .2s linear; } .product-list li button { position: absolute; @@ -25,6 +17,13 @@ opacity: 0; outline: none; } +.product-list li button, +.product-list li .image, +.product-list li .details { + -webkit-transition: opacity .2s linear; + -moz-transition: opacity .2s linear; + transition: opacity .2s linear; +} .product-list li:hover button { opacity: .3; } diff --git a/modules/system/assets/less/updates/install.less b/modules/system/assets/less/updates/install.less index 08c3694ca..338e0d84e 100644 --- a/modules/system/assets/less/updates/install.less +++ b/modules/system/assets/less/updates/install.less @@ -5,187 +5,194 @@ font-size: 16px; color: #999; } + .product-list { margin: 0; padding: 10px 0; overflow: hidden; /* clearfix */ -} -.product-list li button, -.product-list li .image, -.product-list li .details { - -webkit-transition: opacity .2s linear; - -moz-transition: opacity .2s linear; - transition: opacity .2s linear; -} -.product-list li button { - position: absolute; - top: 0; - right: 0; - width: 20px; - height: 20px; - opacity: 0; - outline: none; -} -.product-list li:hover button { - opacity: .3; -} -.product-list li:hover button:hover { - opacity: .8; + li { + button { + position: absolute; + top: 0; + right: 0; + width: 20px; + height: 20px; + opacity: 0; + outline: none; + } + + button, .image, .details { + -webkit-transition: opacity .2s linear; + -moz-transition: opacity .2s linear; + transition: opacity .2s linear; + } + } + li:hover { + button { + opacity: .3; + } + button:hover { + opacity: .8; + } + } } .plugin-list { - + li { + list-style: none; + position: relative; + border-bottom: 1px solid #E6E9E9; + margin-bottom: 10px; + padding-bottom: 10px; + overflow: hidden; + .image { + float: left; + margin-right: 15px; + margin-left: 5px; + img { + width: 50px; + height: 50px; + } + } + .details { + p { + padding: 0; + margin: 3px 0 0 0; + color: #808C8D; + } + } + h4 { + padding: 5px 0 0; + margin: 0; + color: #C03F31; + font-weight: 400; + } + } + li:last-child { + border-bottom: none; + } } -.plugin-list li { - list-style: none; - position: relative; - border-bottom: 1px solid #E6E9E9; - margin-bottom: 10px; - padding-bottom: 10px; - overflow: hidden; -} -.plugin-list li:last-child { - border-bottom: none; -} -.plugin-list li .image { - float: left; - margin-right: 15px; - margin-left: 5px; -} -.plugin-list li .image img { - width: 50px; - height: 50px; -} -.plugin-list li .details p { - padding: 0; - margin: 3px 0 0 0; - color: #808C8D; -} -.plugin-list li h4 { - padding: 5px 0 0; - margin: 0; - color: #C03F31; - font-weight: 400; +.theme-list { + li { + float: left; + padding: 0; + margin: 0 10px 10px 0; + list-style: none; + border: 1px solid #E6E9E9; + background: #fff; + position: relative; + border-radius: 3px; + -webkit-transition: border .2s linear; + -moz-transition: border .2s linear; + transition: border .2s linear; + .image { + padding: 5px; + img { + width: 210px; + height: 140px; + } + } + .details { + position: absolute; + bottom: 0; + left: 0; + opacity: 0; + padding: 10px; + overflow: hidden; + } + h4 { + padding: 15px 0 0; + margin: 0; + } + p { + padding: 0; + margin: 0; + color: #999; + text-transform: uppercase; + font-size: 12px; + } + } + li:hover { + border-color: transparent; + .image { + opacity: 0; + } + .details { + opacity: 1; + } + } } -.theme-list li { - float: left; - padding: 0; - margin: 0 10px 10px 0; - list-style: none; - border: 1px solid #E6E9E9; - background: #fff; - position: relative; - border-radius: 3px; -} -.theme-list li:hover { - border-color: transparent; -} -.theme-list li { - -webkit-transition: border .2s linear; - -moz-transition: border .2s linear; - transition: border .2s linear; -} -.theme-list li .image { - padding: 5px; -} -.theme-list li .image img { - width: 210px; - height: 140px; -} -.theme-list li:hover .image { - opacity: 0; -} -.theme-list li .details { - position: absolute; - bottom: 0; - left: 0; - opacity: 0; - padding: 10px; - overflow: hidden; -} -.theme-list li:hover .details { - opacity: 1; -} -.theme-list li h4 { - padding: 15px 0 0; - margin: 0; -} -.theme-list li p { - padding: 0; - margin: 0; - color: #999; - text-transform: uppercase; - font-size: 12px; -} - -.suggested-products-container { -} .suggested-products { padding: 0; + .product { + padding: 0; + } + .image { + float: left; + position: relative; + img { + width: 40px; + height: 40px; + margin-top: 10px; + } + } + .details { + margin-left: 50px; + padding: 10px 0; + h5 { + margin: 0 0 3px; + font-size: 14px; + color: #C03F31; + font-weight: 400; + } + p { + font-size: 12px; + } + } + a { + color: #777; + background: #fff; + padding: 5px; + text-decoration: none; + display: block; + overflow: hidden; + border-bottom: 1px solid #E6E9E9; + } + a:hover { + color: #333; + background: #f9f9f9; + .image:after { + content: "+"; + color: #999; + font-size: 32px; + display: block; + width: 40px; + height: 40px; + text-align: center; + line-height: 40px; + position: absolute; + top: 7px; + left: 0; + } + .image { + img { + opacity: .5; + } + } + } } -.suggested-products .product { - padding: 0; -} -.suggested-products .image img { - width: 40px; - height: 40px; - margin-top: 10px; -} -.suggested-themes .image img { - width: 60px; - height: 40px; -} -.suggested-products .image { - float: left; - position: relative; -} -.suggested-products .details { - margin-left: 50px; - padding: 10px 0; -} -.suggested-themes .details { - margin-left: 70px; -} -.suggested-products .details h5 { - margin: 0 0 3px; - font-size: 14px; - color: #C03F31; - font-weight: 400; -} -.suggested-products .details p { - font-size: 12px; -} -.suggested-products a { - color: #777; - background: #fff; - padding: 5px; - text-decoration: none; - display: block; - overflow: hidden; - border-bottom: 1px solid #E6E9E9; -} -.suggested-products a:hover { - color: #333; - background: #f9f9f9; -} -.suggested-products a:hover .image { -} -.suggested-products a:hover .image:after { - content: "+"; - color: #999; - font-size: 32px; - display: block; - width: 40px; - height: 40px; - text-align: center; - line-height: 40px; - position: absolute; - top: 7px; - left: 0; -} -.suggested-products a:hover .image img { - opacity: .5; + +.suggested-themes { + .image { + img { + width: 60px; + height: 40px; + } + } + .details { + margin-left: 70px; + } } /*! @@ -199,12 +206,10 @@ text-align: left; padding-bottom: 15px; } - .twitter-typeahead { width: 100%; } -.typeahead, -.tt-hint { +.typeahead, .tt-hint { width: 100%; height: 46px; padding: 8px 12px; @@ -242,52 +247,55 @@ .tt-suggestion { font-size: 14px; line-height: 18px; + + { + .tt-suggestion { + font-size: 14px; + border-top: 1px solid #ccc; + } + } } -.tt-suggestion + .tt-suggestion { - font-size: 14px; - border-top: 1px solid #ccc; +.tt-suggestions { + .product-details { + padding: 5px; + overflow: hidden; + position: relative; + } + .product-image { + float: left; + margin-right: 10px; + img { + height: 45px; + width: 45px; + } + } + .product-name { + font-size: 20px; + padding-top: 5px; + } } -.tt-suggestions .product-details { - padding: 5px; - overflow: hidden; - position: relative; -} -.tt-suggestions .product-image { - float: left; - margin-right: 10px; -} -.tt-suggestions .product-image img { - height: 45px; - width: 45px; -} -.tt-suggestions .product-name { - font-size: 20px; - padding-top: 5px; -} -.tt-suggestions .product-description { -} - .tt-suggestion.tt-cursor { cursor: pointer; -} -.tt-suggestion.tt-cursor .product-details { - color: #333; - background: #f9f9f9; - border-color: #f0f0f0; -} -.tt-suggestion.tt-cursor .product-details .product-image:after { - content: "+"; - color: #999; - font-size: 38px; - display: block; - width: 45px; - height: 45px; - text-align: center; - line-height: 45px; - position: absolute; - top: 5px; - left: 5px; -} -.tt-suggestion.tt-cursor .product-details .product-image img { - opacity: .5; + .product-details { + color: #333; + background: #f9f9f9; + border-color: #f0f0f0; + .product-image:after { + content: "+"; + color: #999; + font-size: 38px; + display: block; + width: 45px; + height: 45px; + text-align: center; + line-height: 45px; + position: absolute; + top: 5px; + left: 5px; + } + .product-image { + img { + opacity: .5; + } + } + } } From ce29b92fe3d788cdb694bdc124edde68678aed66 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Mon, 6 Apr 2015 22:27:47 +1000 Subject: [PATCH 43/47] Update Demo theme: Bootstrap v3.3.4 --- themes/demo/assets/css/theme.css | 1340 ++++++++++++----- .../demo/assets/vendor/bootstrap/js/affix.js | 95 +- .../demo/assets/vendor/bootstrap/js/alert.js | 24 +- .../demo/assets/vendor/bootstrap/js/button.js | 37 +- .../assets/vendor/bootstrap/js/carousel.js | 126 +- .../assets/vendor/bootstrap/js/collapse.js | 127 +- .../assets/vendor/bootstrap/js/dropdown.js | 56 +- .../demo/assets/vendor/bootstrap/js/modal.js | 174 ++- .../assets/vendor/bootstrap/js/popover.js | 26 +- .../assets/vendor/bootstrap/js/scrollspy.js | 97 +- themes/demo/assets/vendor/bootstrap/js/tab.js | 76 +- .../assets/vendor/bootstrap/js/tooltip.js | 243 ++- .../assets/vendor/bootstrap/js/transition.js | 27 +- .../assets/vendor/bootstrap/less/alerts.less | 12 +- .../assets/vendor/bootstrap/less/badges.less | 51 +- .../vendor/bootstrap/less/bootstrap.less | 5 +- .../vendor/bootstrap/less/button-groups.less | 43 +- .../assets/vendor/bootstrap/less/buttons.less | 21 +- .../vendor/bootstrap/less/carousel.less | 51 +- .../assets/vendor/bootstrap/less/close.less | 1 + .../assets/vendor/bootstrap/less/code.less | 8 +- .../bootstrap/less/component-animations.less | 14 +- .../vendor/bootstrap/less/dropdowns.less | 15 +- .../assets/vendor/bootstrap/less/forms.less | 279 +++- .../vendor/bootstrap/less/glyphicons.less | 84 +- .../assets/vendor/bootstrap/less/grid.less | 24 +- .../vendor/bootstrap/less/input-groups.less | 13 +- .../vendor/bootstrap/less/jumbotron.less | 16 +- .../assets/vendor/bootstrap/less/labels.less | 2 +- .../vendor/bootstrap/less/list-group.less | 32 +- .../assets/vendor/bootstrap/less/media.less | 71 +- .../assets/vendor/bootstrap/less/mixins.less | 957 +----------- .../vendor/bootstrap/less/mixins/alerts.less | 14 + .../less/mixins/background-variant.less | 8 + .../bootstrap/less/mixins/border-radius.less | 18 + .../vendor/bootstrap/less/mixins/buttons.less | 52 + .../bootstrap/less/mixins/center-block.less | 7 + .../bootstrap/less/mixins/clearfix.less | 22 + .../vendor/bootstrap/less/mixins/forms.less | 85 ++ .../bootstrap/less/mixins/gradients.less | 59 + .../bootstrap/less/mixins/grid-framework.less | 91 ++ .../vendor/bootstrap/less/mixins/grid.less | 122 ++ .../bootstrap/less/mixins/hide-text.less | 21 + .../vendor/bootstrap/less/mixins/image.less | 33 + .../vendor/bootstrap/less/mixins/labels.less | 12 + .../bootstrap/less/mixins/list-group.less | 29 + .../bootstrap/less/mixins/nav-divider.less | 10 + .../less/mixins/nav-vertical-align.less | 9 + .../vendor/bootstrap/less/mixins/opacity.less | 8 + .../bootstrap/less/mixins/pagination.less | 23 + .../vendor/bootstrap/less/mixins/panels.less | 24 + .../bootstrap/less/mixins/progress-bar.less | 10 + .../bootstrap/less/mixins/reset-filter.less | 8 + .../vendor/bootstrap/less/mixins/resize.less | 6 + .../less/mixins/responsive-visibility.less | 15 + .../vendor/bootstrap/less/mixins/size.less | 10 + .../bootstrap/less/mixins/tab-focus.less | 9 + .../bootstrap/less/mixins/table-row.less | 28 + .../bootstrap/less/mixins/text-emphasis.less | 8 + .../bootstrap/less/mixins/text-overflow.less | 8 + .../less/mixins/vendor-prefixes.less | 227 +++ .../assets/vendor/bootstrap/less/modals.less | 30 +- .../assets/vendor/bootstrap/less/navbar.less | 94 +- .../assets/vendor/bootstrap/less/navs.less | 4 +- .../vendor/bootstrap/less/normalize.less | 44 +- .../assets/vendor/bootstrap/less/pager.less | 3 +- .../vendor/bootstrap/less/pagination.less | 2 +- .../assets/vendor/bootstrap/less/panels.less | 133 +- .../vendor/bootstrap/less/popovers.less | 34 +- .../assets/vendor/bootstrap/less/print.less | 194 +-- .../vendor/bootstrap/less/progress-bars.less | 17 +- .../bootstrap/less/responsive-embed.less | 35 + .../bootstrap/less/responsive-utilities.less | 117 +- .../vendor/bootstrap/less/scaffolding.less | 32 +- .../assets/vendor/bootstrap/less/tables.less | 33 +- .../assets/vendor/bootstrap/less/theme.less | 48 +- .../vendor/bootstrap/less/thumbnails.less | 4 +- .../assets/vendor/bootstrap/less/tooltip.less | 17 +- .../assets/vendor/bootstrap/less/type.less | 56 +- .../vendor/bootstrap/less/utilities.less | 1 - .../vendor/bootstrap/less/variables.less | 154 +- 81 files changed, 3908 insertions(+), 2267 deletions(-) create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/alerts.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/background-variant.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/border-radius.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/buttons.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/center-block.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/clearfix.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/forms.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/gradients.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/grid-framework.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/grid.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/hide-text.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/image.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/labels.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/list-group.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/nav-divider.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/nav-vertical-align.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/opacity.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/pagination.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/panels.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/progress-bar.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/reset-filter.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/resize.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/responsive-visibility.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/size.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/tab-focus.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/table-row.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/text-emphasis.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/text-overflow.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/mixins/vendor-prefixes.less create mode 100644 themes/demo/assets/vendor/bootstrap/less/responsive-embed.less diff --git a/themes/demo/assets/css/theme.css b/themes/demo/assets/css/theme.css index d9fe365fe..b41e904cd 100644 --- a/themes/demo/assets/css/theme.css +++ b/themes/demo/assets/css/theme.css @@ -9,7 +9,7 @@ * !! YOU HAVE BEEN WARNED !! MODIFY THIS FILE AT YOUR OWN RISK !! * */ -/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ html { font-family: sans-serif; -ms-text-size-adjust: 100%; @@ -27,6 +27,7 @@ footer, header, hgroup, main, +menu, nav, section, summary { @@ -48,7 +49,7 @@ template { display: none; } a { - background: transparent; + background-color: transparent; } a:active, a:hover { @@ -189,12 +190,15 @@ td, th { padding: 0; } +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { - * { - text-shadow: none !important; - color: #000 !important; + *, + *:before, + *:after { background: transparent !important; + color: #000 !important; box-shadow: none !important; + text-shadow: none !important; } a, a:visited { @@ -206,8 +210,8 @@ th { abbr[title]:after { content: " (" attr(title) ")"; } - a[href^="javascript:"]:after, - a[href^="#"]:after { + a[href^="#"]:after, + a[href^="javascript:"]:after { content: ""; } pre, @@ -241,10 +245,6 @@ th { .navbar { display: none; } - .table td, - .table th { - background-color: #fff !important; - } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; @@ -255,6 +255,10 @@ th { .table { border-collapse: collapse !important; } + .table td, + .table th { + background-color: #fff !important; + } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; @@ -272,7 +276,7 @@ th { box-sizing: border-box; } html { - font-size: 62.5%; + font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { @@ -291,12 +295,12 @@ textarea { line-height: inherit; } a { - color: #428bca; + color: #337ab7; text-decoration: none; } a:hover, a:focus { - color: #2a6496; + color: #23527c; text-decoration: underline; } a:focus { @@ -310,7 +314,11 @@ figure { img { vertical-align: middle; } -.img-responsive { +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; @@ -325,6 +333,7 @@ img { border: 1px solid #dddddd; border-radius: 4px; -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; max-width: 100%; @@ -349,6 +358,18 @@ hr { clip: rect(0, 0, 0, 0); border: 0; } +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +[role="button"] { + cursor: pointer; +} h1, h2, h3, @@ -392,7 +413,7 @@ h6 .small, .h6 .small { font-weight: normal; line-height: 1; - color: #999999; + color: #777777; } h1, .h1, @@ -470,7 +491,7 @@ p { .lead { margin-bottom: 20px; font-size: 16px; - font-weight: 200; + font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { @@ -482,8 +503,10 @@ small, .small { font-size: 85%; } -cite { - font-style: normal; +mark, +.mark { + background-color: #fcf8e3; + padding: .2em; } .text-left { text-align: left; @@ -497,14 +520,26 @@ cite { .text-justify { text-align: justify; } +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} .text-muted { - color: #999999; + color: #777777; } .text-primary { - color: #428bca; + color: #337ab7; } a.text-primary:hover { - color: #3071a9; + color: #286090; } .text-success { color: #3c763d; @@ -532,10 +567,10 @@ a.text-danger:hover { } .bg-primary { color: #fff; - background-color: #428bca; + background-color: #337ab7; } a.bg-primary:hover { - background-color: #3071a9; + background-color: #286090; } .bg-success { background-color: #dff0d8; @@ -584,15 +619,13 @@ ol ol { .list-inline { padding-left: 0; list-style: none; + margin-left: -5px; } .list-inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; } -.list-inline > li:first-child { - padding-left: 0; -} dl { margin-top: 0; margin-bottom: 20px; @@ -624,7 +657,7 @@ dd { abbr[title], abbr[data-original-title] { cursor: help; - border-bottom: 1px dotted #999999; + border-bottom: 1px dotted #777777; } .initialism { font-size: 90%; @@ -647,7 +680,7 @@ blockquote .small { display: block; font-size: 80%; line-height: 1.428571429; - color: #999999; + color: #777777; } blockquote footer:before, blockquote small:before, @@ -678,10 +711,6 @@ blockquote.pull-right small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } -blockquote:before, -blockquote:after { - content: ""; -} address { margin-bottom: 20px; font-style: normal; @@ -698,7 +727,6 @@ code { font-size: 90%; color: #c7254e; background-color: #f9f2f4; - white-space: nowrap; border-radius: 4px; } kbd { @@ -709,6 +737,12 @@ kbd { border-radius: 3px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + box-shadow: none; +} pre { display: block; padding: 9.5px; @@ -847,7 +881,7 @@ pre code { right: 8.333333333333332%; } .col-xs-pull-0 { - right: 0%; + right: auto; } .col-xs-push-12 { left: 100%; @@ -886,7 +920,7 @@ pre code { left: 8.333333333333332%; } .col-xs-push-0 { - left: 0%; + left: auto; } .col-xs-offset-12 { margin-left: 100%; @@ -1004,7 +1038,7 @@ pre code { right: 8.333333333333332%; } .col-sm-pull-0 { - right: 0%; + right: auto; } .col-sm-push-12 { left: 100%; @@ -1043,7 +1077,7 @@ pre code { left: 8.333333333333332%; } .col-sm-push-0 { - left: 0%; + left: auto; } .col-sm-offset-12 { margin-left: 100%; @@ -1162,7 +1196,7 @@ pre code { right: 8.333333333333332%; } .col-md-pull-0 { - right: 0%; + right: auto; } .col-md-push-12 { left: 100%; @@ -1201,7 +1235,7 @@ pre code { left: 8.333333333333332%; } .col-md-push-0 { - left: 0%; + left: auto; } .col-md-offset-12 { margin-left: 100%; @@ -1320,7 +1354,7 @@ pre code { right: 8.333333333333332%; } .col-lg-pull-0 { - right: 0%; + right: auto; } .col-lg-push-12 { left: 100%; @@ -1359,7 +1393,7 @@ pre code { left: 8.333333333333332%; } .col-lg-push-0 { - left: 0%; + left: auto; } .col-lg-offset-12 { margin-left: 100%; @@ -1402,14 +1436,20 @@ pre code { } } table { - max-width: 100%; background-color: transparent; } +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #777777; + text-align: left; +} th { text-align: left; } .table { width: 100%; + max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, @@ -1464,12 +1504,10 @@ th { .table-bordered > thead > tr > td { border-bottom-width: 2px; } -.table-striped > tbody > tr:nth-child(odd) > td, -.table-striped > tbody > tr:nth-child(odd) > th { +.table-striped > tbody > tr:nth-of-type(odd) { background-color: #f9f9f9; } -.table-hover > tbody > tr:hover > td, -.table-hover > tbody > tr:hover > th { +.table-hover > tbody > tr:hover { background-color: #f5f5f5; } table col[class*="col-"] { @@ -1500,6 +1538,7 @@ table th[class*="col-"] { .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } @@ -1520,6 +1559,7 @@ table th[class*="col-"] { .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } @@ -1540,6 +1580,7 @@ table th[class*="col-"] { .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #c4e3f3; } @@ -1560,6 +1601,7 @@ table th[class*="col-"] { .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #faf2cc; } @@ -1580,18 +1622,21 @@ table th[class*="col-"] { .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #ebcccc; } -@media (max-width: 767px) { +.table-responsive { + overflow-x: auto; + min-height: 0.01%; +} +@media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; - overflow-x: scroll; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #dddddd; - -webkit-overflow-scrolling: touch; } .table-responsive > .table { margin-bottom: 0; @@ -1649,6 +1694,7 @@ legend { } label { display: inline-block; + max-width: 100%; margin-bottom: 5px; font-weight: bold; } @@ -1661,7 +1707,6 @@ input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; - /* IE8-9 */ line-height: normal; } input[type="file"] { @@ -1704,6 +1749,7 @@ output { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus { @@ -1712,9 +1758,6 @@ output { -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } -.form-control:-moz-placeholder { - color: #999999; -} .form-control::-moz-placeholder { color: #999999; opacity: 1; @@ -1728,30 +1771,62 @@ output { .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { - cursor: not-allowed; background-color: #eeeeee; opacity: 1; } +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} textarea.form-control { height: auto; } -input[type="date"] { - line-height: 34px; +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"], + input[type="time"], + input[type="datetime-local"], + input[type="month"] { + line-height: 34px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm, + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"] { + line-height: 30px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg, + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"] { + line-height: 46px; + } } .form-group { margin-bottom: 15px; } .radio, .checkbox { + position: relative; display: block; - min-height: 20px; margin-top: 10px; margin-bottom: 10px; - padding-left: 20px; } .radio label, .checkbox label { - display: inline; + min-height: 20px; + padding-left: 20px; + margin-bottom: 0; font-weight: normal; cursor: pointer; } @@ -1759,8 +1834,9 @@ input[type="date"] { .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { - float: left; + position: absolute; margin-left: -20px; + margin-top: 4px \9; } .radio + .radio, .checkbox + .checkbox { @@ -1768,6 +1844,7 @@ input[type="date"] { } .radio-inline, .checkbox-inline { + position: relative; display: inline-block; padding-left: 20px; margin-bottom: 0; @@ -1782,18 +1859,35 @@ input[type="date"] { } input[type="radio"][disabled], input[type="checkbox"][disabled], -.radio[disabled], -.radio-inline[disabled], -.checkbox[disabled], -.checkbox-inline[disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, fieldset[disabled] input[type="radio"], -fieldset[disabled] input[type="checkbox"], -fieldset[disabled] .radio, +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, fieldset[disabled] .radio-inline, -fieldset[disabled] .checkbox, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; + min-height: 34px; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-left: 0; + padding-right: 0; +} .input-sm { height: 30px; padding: 5px 10px; @@ -1809,11 +1903,33 @@ textarea.input-sm, select[multiple].input-sm { height: auto; } +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.form-group-sm .form-control { + height: 30px; + line-height: 30px; +} +textarea.form-group-sm .form-control, +select[multiple].form-group-sm .form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + min-height: 32px; +} .input-lg { height: 46px; padding: 10px 16px; font-size: 18px; - line-height: 1.33; + line-height: 1.3333333; border-radius: 6px; } select.input-lg { @@ -1824,28 +1940,66 @@ textarea.input-lg, select[multiple].input-lg { height: auto; } +.form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.form-group-lg .form-control { + height: 46px; + line-height: 46px; +} +textarea.form-group-lg .form-control, +select[multiple].form-group-lg .form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + min-height: 38px; +} .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 42.5px; } -.has-feedback .form-control-feedback { +.form-control-feedback { position: absolute; - top: 25px; + top: 0; right: 0; + z-index: 2; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; +} +.input-sm + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, -.has-success .checkbox-inline { +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { color: #3c763d; } .has-success .form-control { @@ -1871,7 +2025,11 @@ select[multiple].input-lg { .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, -.has-warning .checkbox-inline { +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { color: #8a6d3b; } .has-warning .form-control { @@ -1897,7 +2055,11 @@ select[multiple].input-lg { .has-error .radio, .has-error .checkbox, .has-error .radio-inline, -.has-error .checkbox-inline { +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { color: #a94442; } .has-error .form-control { @@ -1918,8 +2080,11 @@ select[multiple].input-lg { .has-error .form-control-feedback { color: #a94442; } -.form-control-static { - margin-bottom: 0; +.has-feedback label ~ .form-control-feedback { + top: 25px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; } .help-block { display: block; @@ -1938,6 +2103,21 @@ select[multiple].input-lg { width: auto; vertical-align: middle; } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } .form-inline .control-label { margin-bottom: 0; vertical-align: middle; @@ -1947,19 +2127,21 @@ select[multiple].input-lg { display: inline-block; margin-top: 0; margin-bottom: 0; - padding-left: 0; vertical-align: middle; } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { - float: none; + position: relative; margin-left: 0; } .form-inline .has-feedback .form-control-feedback { top: 0; } } -.form-horizontal .control-label, .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, @@ -1976,24 +2158,33 @@ select[multiple].input-lg { margin-left: -15px; margin-right: -15px; } -.form-horizontal .form-control-static { - padding-top: 7px; -} @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; + margin-bottom: 0; + padding-top: 7px; } } .form-horizontal .has-feedback .form-control-feedback { - top: 0; right: 15px; } +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 14.333333px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + } +} .btn { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; + touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; @@ -2005,16 +2196,21 @@ select[multiple].input-lg { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; - -o-user-select: none; user-select: none; } -.btn:focus { +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, -.btn:focus { +.btn:focus, +.btn.focus { color: #333333; text-decoration: none; } @@ -2042,16 +2238,17 @@ fieldset[disabled] .btn { } .btn-default:hover, .btn-default:focus, +.btn-default.focus, .btn-default:active, .btn-default.active, -.open .dropdown-toggle.btn-default { +.open > .dropdown-toggle.btn-default { color: #333333; - background-color: #ebebeb; + background-color: #e6e6e6; border-color: #adadad; } .btn-default:active, .btn-default.active, -.open .dropdown-toggle.btn-default { +.open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled, @@ -2063,6 +2260,9 @@ fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, @@ -2078,21 +2278,22 @@ fieldset[disabled] .btn-default.active { } .btn-primary { color: #ffffff; - background-color: #428bca; - border-color: #357ebd; + background-color: #337ab7; + border-color: #2e6da4; } .btn-primary:hover, .btn-primary:focus, +.btn-primary.focus, .btn-primary:active, .btn-primary.active, -.open .dropdown-toggle.btn-primary { +.open > .dropdown-toggle.btn-primary { color: #ffffff; - background-color: #3276b1; - border-color: #285e8e; + background-color: #286090; + border-color: #204d74; } .btn-primary:active, .btn-primary.active, -.open .dropdown-toggle.btn-primary { +.open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, @@ -2104,17 +2305,20 @@ fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { - background-color: #428bca; - border-color: #357ebd; + background-color: #337ab7; + border-color: #2e6da4; } .btn-primary .badge { - color: #428bca; + color: #337ab7; background-color: #ffffff; } .btn-success { @@ -2124,16 +2328,17 @@ fieldset[disabled] .btn-primary.active { } .btn-success:hover, .btn-success:focus, +.btn-success.focus, .btn-success:active, .btn-success.active, -.open .dropdown-toggle.btn-success { +.open > .dropdown-toggle.btn-success { color: #ffffff; - background-color: #47a447; + background-color: #449d44; border-color: #398439; } .btn-success:active, .btn-success.active, -.open .dropdown-toggle.btn-success { +.open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled, @@ -2145,6 +2350,9 @@ fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, @@ -2165,16 +2373,17 @@ fieldset[disabled] .btn-success.active { } .btn-info:hover, .btn-info:focus, +.btn-info.focus, .btn-info:active, .btn-info.active, -.open .dropdown-toggle.btn-info { +.open > .dropdown-toggle.btn-info { color: #ffffff; - background-color: #39b3d7; + background-color: #31b0d5; border-color: #269abc; } .btn-info:active, .btn-info.active, -.open .dropdown-toggle.btn-info { +.open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled, @@ -2186,6 +2395,9 @@ fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, @@ -2206,16 +2418,17 @@ fieldset[disabled] .btn-info.active { } .btn-warning:hover, .btn-warning:focus, +.btn-warning.focus, .btn-warning:active, .btn-warning.active, -.open .dropdown-toggle.btn-warning { +.open > .dropdown-toggle.btn-warning { color: #ffffff; - background-color: #ed9c28; + background-color: #ec971f; border-color: #d58512; } .btn-warning:active, .btn-warning.active, -.open .dropdown-toggle.btn-warning { +.open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled, @@ -2227,6 +2440,9 @@ fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, @@ -2247,16 +2463,17 @@ fieldset[disabled] .btn-warning.active { } .btn-danger:hover, .btn-danger:focus, +.btn-danger.focus, .btn-danger:active, .btn-danger.active, -.open .dropdown-toggle.btn-danger { +.open > .dropdown-toggle.btn-danger { color: #ffffff; - background-color: #d2322d; + background-color: #c9302c; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, -.open .dropdown-toggle.btn-danger { +.open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled, @@ -2268,6 +2485,9 @@ fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, @@ -2282,13 +2502,13 @@ fieldset[disabled] .btn-danger.active { background-color: #ffffff; } .btn-link { - color: #428bca; + color: #337ab7; font-weight: normal; - cursor: pointer; border-radius: 0; } .btn-link, .btn-link:active, +.btn-link.active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; @@ -2303,7 +2523,7 @@ fieldset[disabled] .btn-link { } .btn-link:hover, .btn-link:focus { - color: #2a6496; + color: #23527c; text-decoration: underline; background-color: transparent; } @@ -2311,22 +2531,25 @@ fieldset[disabled] .btn-link { fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { - color: #999999; + color: #777777; text-decoration: none; } -.btn-lg { +.btn-lg, +.btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; - line-height: 1.33; + line-height: 1.3333333; border-radius: 6px; } -.btn-sm { +.btn-sm, +.btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } -.btn-xs { +.btn-xs, +.btn-group-xs > .btn { padding: 1px 5px; font-size: 12px; line-height: 1.5; @@ -2335,8 +2558,6 @@ fieldset[disabled] .btn-link:focus { .btn-block { display: block; width: 100%; - padding-left: 0; - padding-right: 0; } .btn-block + .btn-block { margin-top: 5px; @@ -2349,6 +2570,7 @@ input[type="button"].btn-block { .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { @@ -2360,12 +2582,22 @@ input[type="button"].btn-block { .collapse.in { display: block; } +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} .collapsing { position: relative; height: 0; overflow: hidden; - -webkit-transition: height 0.35s ease; - transition: height 0.35s ease; + -webkit-transition-property: height, visibility; + transition-property: height, visibility; + -webkit-transition-duration: 0.35s; + transition-duration: 0.35s; + -webkit-transition-timing-function: ease; + transition-timing-function: ease; } .caret { display: inline-block; @@ -2373,10 +2605,11 @@ input[type="button"].btn-block { height: 0; margin-left: 2px; vertical-align: middle; - border-top: 4px solid; + border-top: 4px dashed; border-right: 4px solid transparent; border-left: 4px solid transparent; } +.dropup, .dropdown { position: relative; } @@ -2395,6 +2628,7 @@ input[type="button"].btn-block { margin: 2px 0 0; list-style: none; font-size: 14px; + text-align: left; background-color: #ffffff; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.15); @@ -2434,12 +2668,12 @@ input[type="button"].btn-block { color: #ffffff; text-decoration: none; outline: 0; - background-color: #428bca; + background-color: #337ab7; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { - color: #999999; + color: #777777; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { @@ -2468,7 +2702,8 @@ input[type="button"].btn-block { padding: 3px 20px; font-size: 12px; line-height: 1.428571429; - color: #999999; + color: #777777; + white-space: nowrap; } .dropdown-backdrop { position: fixed; @@ -2492,7 +2727,7 @@ input[type="button"].btn-block { .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; - margin-bottom: 1px; + margin-bottom: 2px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { @@ -2525,10 +2760,6 @@ input[type="button"].btn-block { .btn-group-vertical > .btn.active { z-index: 2; } -.btn-group > .btn:focus, -.btn-group-vertical > .btn:focus { - outline: none; -} .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, @@ -2568,12 +2799,12 @@ input[type="button"].btn-block { .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } -.btn-group > .btn-group:first-child > .btn:last-child, -.btn-group > .btn-group:first-child > .dropdown-toggle { +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-top-right-radius: 0; } -.btn-group > .btn-group:last-child > .btn:first-child { +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { border-bottom-left-radius: 0; border-top-left-radius: 0; } @@ -2581,24 +2812,6 @@ input[type="button"].btn-block { .btn-group.open .dropdown-toggle { outline: 0; } -.btn-group-xs > .btn { - padding: 1px 5px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.btn-group-sm > .btn { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.btn-group-lg > .btn { - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; - border-radius: 6px; -} .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; @@ -2683,9 +2896,16 @@ input[type="button"].btn-block { .btn-group-justified > .btn-group .btn { width: 100%; } -[data-toggle="buttons"] > .btn > input[type="radio"], -[data-toggle="buttons"] > .btn > input[type="checkbox"] { - display: none; +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; } .input-group { position: relative; @@ -2698,6 +2918,8 @@ input[type="button"].btn-block { padding-right: 0; } .input-group .form-control { + position: relative; + z-index: 2; float: left; width: 100%; margin-bottom: 0; @@ -2708,7 +2930,7 @@ input[type="button"].btn-block { height: 46px; padding: 10px 16px; font-size: 18px; - line-height: 1.33; + line-height: 1.3333333; border-radius: 6px; } select.input-group-lg > .form-control, @@ -2859,11 +3081,11 @@ select[multiple].input-group-sm > .input-group-btn > .btn { background-color: #eeeeee; } .nav > li.disabled > a { - color: #999999; + color: #777777; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { - color: #999999; + color: #777777; text-decoration: none; background-color: transparent; cursor: not-allowed; @@ -2872,7 +3094,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .nav .open > a:hover, .nav .open > a:focus { background-color: #eeeeee; - border-color: #428bca; + border-color: #337ab7; } .nav .nav-divider { height: 1px; @@ -2965,7 +3187,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #ffffff; - background-color: #428bca; + background-color: #337ab7; } .nav-stacked > li { float: none; @@ -3048,7 +3270,6 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } } .navbar-collapse { - max-height: 340px; overflow-x: visible; padding-right: 15px; padding-left: 15px; @@ -3081,6 +3302,16 @@ select[multiple].input-group-sm > .input-group-btn > .btn { padding-right: 0; } } +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, @@ -3139,6 +3370,9 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .navbar-brand:focus { text-decoration: none; } +.navbar-brand > img { + display: block; +} @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { @@ -3158,7 +3392,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { border-radius: 4px; } .navbar-toggle:focus { - outline: none; + outline: 0; } .navbar-toggle .icon-bar { display: block; @@ -3216,19 +3450,6 @@ select[multiple].input-group-sm > .input-group-btn > .btn { padding-top: 15px; padding-bottom: 15px; } - .navbar-nav.navbar-right:last-child { - margin-right: -15px; - } -} -@media (min-width: 768px) { - .navbar-left { - float: left !important; - float: left; - } - .navbar-right { - float: right !important; - float: right; - } } .navbar-form { margin-left: -15px; @@ -3252,6 +3473,21 @@ select[multiple].input-group-sm > .input-group-btn > .btn { width: auto; vertical-align: middle; } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } .navbar-form .control-label { margin-bottom: 0; vertical-align: middle; @@ -3261,12 +3497,15 @@ select[multiple].input-group-sm > .input-group-btn > .btn { display: inline-block; margin-top: 0; margin-bottom: 0; - padding-left: 0; vertical-align: middle; } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { - float: none; + position: relative; margin-left: 0; } .navbar-form .has-feedback .form-control-feedback { @@ -3277,6 +3516,9 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .navbar-form .form-group { margin-bottom: 5px; } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } } @media (min-width: 768px) { .navbar-form { @@ -3289,9 +3531,6 @@ select[multiple].input-group-sm > .input-group-btn > .btn { -webkit-box-shadow: none; box-shadow: none; } - .navbar-form.navbar-right:last-child { - margin-right: -15px; - } } .navbar-nav > li > .dropdown-menu { margin-top: 0; @@ -3299,6 +3538,9 @@ select[multiple].input-group-sm > .input-group-btn > .btn { border-top-left-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-right-radius: 4px; + border-top-left-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } @@ -3324,7 +3566,18 @@ select[multiple].input-group-sm > .input-group-btn > .btn { margin-left: 15px; margin-right: 15px; } - .navbar-text.navbar-right:last-child { +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + float: left; + } + .navbar-right { + float: right !important; + float: right; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { margin-right: 0; } } @@ -3411,12 +3664,25 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .navbar-default .navbar-link:hover { color: #333333; } +.navbar-default .btn-link { + color: #777777; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #333333; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #cccccc; +} .navbar-inverse { background-color: #222222; border-color: #080808; } .navbar-inverse .navbar-brand { - color: #999999; + color: #9d9d9d; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { @@ -3424,10 +3690,10 @@ select[multiple].input-group-sm > .input-group-btn > .btn { background-color: transparent; } .navbar-inverse .navbar-text { - color: #999999; + color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a { - color: #999999; + color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { @@ -3474,7 +3740,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { - color: #999999; + color: #9d9d9d; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { @@ -3495,11 +3761,24 @@ select[multiple].input-group-sm > .input-group-btn > .btn { } } .navbar-inverse .navbar-link { - color: #999999; + color: #9d9d9d; } .navbar-inverse .navbar-link:hover { color: #ffffff; } +.navbar-inverse .btn-link { + color: #9d9d9d; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #ffffff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #444444; +} .breadcrumb { padding: 8px 15px; margin-bottom: 20px; @@ -3516,7 +3795,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { color: #cccccc; } .breadcrumb > .active { - color: #999999; + color: #777777; } .pagination { display: inline-block; @@ -3534,7 +3813,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { padding: 6px 12px; line-height: 1.428571429; text-decoration: none; - color: #428bca; + color: #337ab7; background-color: #ffffff; border: 1px solid #dddddd; margin-left: -1px; @@ -3554,7 +3833,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { - color: #2a6496; + color: #23527c; background-color: #eeeeee; border-color: #dddddd; } @@ -3566,8 +3845,8 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .pagination > .active > span:focus { z-index: 2; color: #ffffff; - background-color: #428bca; - border-color: #428bca; + background-color: #337ab7; + border-color: #337ab7; cursor: default; } .pagination > .disabled > span, @@ -3576,7 +3855,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { - color: #999999; + color: #777777; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; @@ -3645,7 +3924,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { - color: #999999; + color: #777777; background-color: #ffffff; cursor: not-allowed; } @@ -3661,8 +3940,8 @@ select[multiple].input-group-sm > .input-group-btn > .btn { vertical-align: baseline; border-radius: .25em; } -.label[href]:hover, -.label[href]:focus { +a.label:hover, +a.label:focus { color: #ffffff; text-decoration: none; cursor: pointer; @@ -3675,18 +3954,18 @@ select[multiple].input-group-sm > .input-group-btn > .btn { top: -1px; } .label-default { - background-color: #999999; + background-color: #777777; } .label-default[href]:hover, .label-default[href]:focus { - background-color: #808080; + background-color: #5e5e5e; } .label-primary { - background-color: #428bca; + background-color: #337ab7; } .label-primary[href]:hover, .label-primary[href]:focus { - background-color: #3071a9; + background-color: #286090; } .label-success { background-color: #5cb85c; @@ -3727,7 +4006,7 @@ select[multiple].input-group-sm > .input-group-btn > .btn { vertical-align: baseline; white-space: nowrap; text-align: center; - background-color: #999999; + background-color: #777777; border-radius: 10px; } .badge:empty { @@ -3737,7 +4016,8 @@ select[multiple].input-group-sm > .input-group-btn > .btn { position: relative; top: -1px; } -.btn-xs .badge { +.btn-xs .badge, +.btn-group-xs > .btn .badge { top: 0; padding: 1px 5px; } @@ -3747,16 +4027,22 @@ a.badge:focus { text-decoration: none; cursor: pointer; } -a.list-group-item.active > .badge, +.list-group-item.active > .badge, .nav-pills > .active > a > .badge { - color: #428bca; + color: #337ab7; background-color: #ffffff; } +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { - padding: 30px; + padding: 30px 15px; margin-bottom: 30px; color: inherit; background-color: #eeeeee; @@ -3770,7 +4056,11 @@ a.list-group-item.active > .badge, font-size: 21px; font-weight: 200; } -.container .jumbotron { +.jumbotron > hr { + border-top-color: #d5d5d5; +} +.container .jumbotron, +.container-fluid .jumbotron { border-radius: 6px; } .jumbotron .container { @@ -3778,10 +4068,10 @@ a.list-group-item.active > .badge, } @media screen and (min-width: 768px) { .jumbotron { - padding-top: 48px; - padding-bottom: 48px; + padding: 48px 0; } - .container .jumbotron { + .container .jumbotron, + .container-fluid .jumbotron { padding-left: 60px; padding-right: 60px; } @@ -3798,21 +4088,19 @@ a.list-group-item.active > .badge, background-color: #ffffff; border: 1px solid #dddddd; border-radius: 4px; - -webkit-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; + -webkit-transition: border 0.2s ease-in-out; + -o-transition: border 0.2s ease-in-out; + transition: border 0.2s ease-in-out; } .thumbnail > img, .thumbnail a > img { - display: block; - max-width: 100%; - height: auto; margin-left: auto; margin-right: auto; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { - border-color: #428bca; + border-color: #337ab7; } .thumbnail .caption { padding: 9px; @@ -3838,10 +4126,12 @@ a.thumbnail.active { .alert > p + p { margin-top: 5px; } -.alert-dismissable { +.alert-dismissable, +.alert-dismissible { padding-right: 35px; } -.alert-dismissable .close { +.alert-dismissable .close, +.alert-dismissible .close { position: relative; top: -2px; right: -21px; @@ -3924,19 +4214,24 @@ a.thumbnail.active { line-height: 20px; color: #ffffff; text-align: center; - background-color: #428bca; + background-color: #337ab7; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; + -o-transition: width 0.6s ease; transition: width 0.6s ease; } -.progress-striped .progress-bar { +.progress-striped .progress-bar, +.progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 40px 40px; } -.progress.active .progress-bar { +.progress.active .progress-bar, +.progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar-success { @@ -3944,6 +4239,7 @@ a.thumbnail.active { } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { @@ -3951,6 +4247,7 @@ a.thumbnail.active { } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { @@ -3958,6 +4255,7 @@ a.thumbnail.active { } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { @@ -3965,31 +4263,49 @@ a.thumbnail.active { } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } -.media, -.media-body { - overflow: hidden; - zoom: 1; -} -.media, -.media .media { +.media { margin-top: 15px; } .media:first-child { margin-top: 0; } +.media, +.media-body { + zoom: 1; + overflow: hidden; +} +.media-body { + width: 10000px; +} .media-object { display: block; } -.media-heading { - margin: 0 0 5px; -} -.media > .pull-left { - margin-right: 10px; -} +.media-right, .media > .pull-right { - margin-left: 10px; + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; } .media-list { padding-left: 0; @@ -4016,12 +4332,6 @@ a.thumbnail.active { border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } -.list-group-item > .badge { - float: right; -} -.list-group-item > .badge + .badge { - margin-right: 5px; -} a.list-group-item { color: #555555; } @@ -4031,25 +4341,49 @@ a.list-group-item .list-group-item-heading { a.list-group-item:hover, a.list-group-item:focus { text-decoration: none; + color: #555555; background-color: #f5f5f5; } -a.list-group-item.active, -a.list-group-item.active:hover, -a.list-group-item.active:focus { - z-index: 2; - color: #ffffff; - background-color: #428bca; - border-color: #428bca; +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + background-color: #eeeeee; + color: #777777; + cursor: not-allowed; } -a.list-group-item.active .list-group-item-heading, -a.list-group-item.active:hover .list-group-item-heading, -a.list-group-item.active:focus .list-group-item-heading { +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { color: inherit; } -a.list-group-item.active .list-group-item-text, -a.list-group-item.active:hover .list-group-item-text, -a.list-group-item.active:focus .list-group-item-text { - color: #e1edf7; +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #c7ddef; } .list-group-item-success { color: #3c763d; @@ -4158,34 +4492,85 @@ a.list-group-item-danger.active:focus { .panel-body { padding: 15px; } -.panel > .list-group { - margin-bottom: 0; -} -.panel > .list-group .list-group-item { - border-width: 1px 0; - border-radius: 0; -} -.panel > .list-group .list-group-item:first-child { - border-top: 0; -} -.panel > .list-group .list-group-item:last-child { - border-bottom: 0; -} -.panel > .list-group:first-child .list-group-item:first-child { +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; border-top-right-radius: 3px; border-top-left-radius: 3px; } -.panel > .list-group:last-child .list-group-item:last-child { +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } +.list-group + .panel-footer { + border-top-width: 0; +} .panel > .table, -.panel > .table-responsive > .table { +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { margin-bottom: 0; } +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-left: 15px; + padding-right: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, @@ -4206,6 +4591,18 @@ a.list-group-item-danger.active:focus { .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 3px; } +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, @@ -4227,7 +4624,9 @@ a.list-group-item-danger.active:focus { border-bottom-right-radius: 3px; } .panel > .panel-body + .table, -.panel > .panel-body + .table-responsive { +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { border-top: 1px solid #dddddd; } .panel > .table > tbody:first-child > tr:first-child th, @@ -4266,70 +4665,36 @@ a.list-group-item-danger.active:focus { .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } -.panel > .table-bordered > thead > tr:first-child > th, -.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, -.panel > .table-bordered > tbody > tr:first-child > th, -.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th, -.panel > .table-bordered > tfoot > tr:first-child > th, -.panel > .table-responsive > .table-bordered > tfoot > tr:first-child > th, .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, -.panel > .table-bordered > tfoot > tr:first-child > td, -.panel > .table-responsive > .table-bordered > tfoot > tr:first-child > td { - border-top: 0; +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; } -.panel > .table-bordered > thead > tr:last-child > th, -.panel > .table-responsive > .table-bordered > thead > tr:last-child > th, -.panel > .table-bordered > tbody > tr:last-child > th, -.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, -.panel > .table-bordered > tfoot > tr:last-child > th, -.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th, -.panel > .table-bordered > thead > tr:last-child > td, -.panel > .table-responsive > .table-bordered > thead > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > td, -.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td { +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { border: 0; margin-bottom: 0; } -.panel-heading { - padding: 10px 15px; - border-bottom: 1px solid transparent; - border-top-right-radius: 3px; - border-top-left-radius: 3px; -} -.panel-heading > .dropdown .dropdown-toggle { - color: inherit; -} -.panel-title { - margin-top: 0; - margin-bottom: 0; - font-size: 16px; - color: inherit; -} -.panel-title > a { - color: inherit; -} -.panel-footer { - padding: 10px 15px; - background-color: #f5f5f5; - border-top: 1px solid #dddddd; - border-bottom-right-radius: 3px; - border-bottom-left-radius: 3px; -} .panel-group { margin-bottom: 20px; } .panel-group .panel { margin-bottom: 0; border-radius: 4px; - overflow: hidden; } .panel-group .panel + .panel { margin-top: 5px; @@ -4337,7 +4702,8 @@ a.list-group-item-danger.active:focus { .panel-group .panel-heading { border-bottom: 0; } -.panel-group .panel-heading + .panel-collapse .panel-body { +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { border-top: 1px solid #dddddd; } .panel-group .panel-footer { @@ -4354,25 +4720,33 @@ a.list-group-item-danger.active:focus { background-color: #f5f5f5; border-color: #dddddd; } -.panel-default > .panel-heading + .panel-collapse .panel-body { +.panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #dddddd; } -.panel-default > .panel-footer + .panel-collapse .panel-body { +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #dddddd; } .panel-primary { - border-color: #428bca; + border-color: #337ab7; } .panel-primary > .panel-heading { color: #ffffff; - background-color: #428bca; - border-color: #428bca; + background-color: #337ab7; + border-color: #337ab7; } -.panel-primary > .panel-heading + .panel-collapse .panel-body { - border-top-color: #428bca; +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; } -.panel-primary > .panel-footer + .panel-collapse .panel-body { - border-bottom-color: #428bca; +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #ffffff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; } .panel-success { border-color: #d6e9c6; @@ -4382,10 +4756,14 @@ a.list-group-item-danger.active:focus { background-color: #dff0d8; border-color: #d6e9c6; } -.panel-success > .panel-heading + .panel-collapse .panel-body { +.panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } -.panel-success > .panel-footer + .panel-collapse .panel-body { +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { @@ -4396,10 +4774,14 @@ a.list-group-item-danger.active:focus { background-color: #d9edf7; border-color: #bce8f1; } -.panel-info > .panel-heading + .panel-collapse .panel-body { +.panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bce8f1; } -.panel-info > .panel-footer + .panel-collapse .panel-body { +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bce8f1; } .panel-warning { @@ -4410,10 +4792,14 @@ a.list-group-item-danger.active:focus { background-color: #fcf8e3; border-color: #faebcc; } -.panel-warning > .panel-heading + .panel-collapse .panel-body { +.panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #faebcc; } -.panel-warning > .panel-footer + .panel-collapse .panel-body { +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #faebcc; } .panel-danger { @@ -4424,10 +4810,14 @@ a.list-group-item-danger.active:focus { background-color: #f2dede; border-color: #ebccd1; } -.panel-danger > .panel-heading + .panel-collapse .panel-body { +.panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ebccd1; } -.panel-danger > .panel-footer + .panel-collapse .panel-body { +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ebccd1; } .well { @@ -4482,8 +4872,7 @@ button.close { } .modal { display: none; - overflow: auto; - overflow-y: scroll; + overflow: hidden; position: fixed; top: 0; right: 0; @@ -4496,6 +4885,7 @@ button.close { .modal.fade .modal-dialog { -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); transform: translate(0, -25%); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; @@ -4505,8 +4895,13 @@ button.close { .modal.in .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); transform: translate(0, 0); } +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} .modal-dialog { position: relative; width: auto; @@ -4521,7 +4916,7 @@ button.close { -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); background-clip: padding-box; - outline: none; + outline: 0; } .modal-backdrop { position: fixed; @@ -4554,11 +4949,10 @@ button.close { } .modal-body { position: relative; - padding: 20px; + padding: 15px; } .modal-footer { - margin-top: 15px; - padding: 19px 20px 20px; + padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } @@ -4572,6 +4966,13 @@ button.close { .modal-footer .btn-block + .btn-block { margin-left: 0; } +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} @media (min-width: 768px) { .modal-dialog { width: 600px; @@ -4584,16 +4985,19 @@ button.close { .modal-sm { width: 300px; } +} +@media (min-width: 992px) { .modal-lg { width: 900px; } } .tooltip { position: absolute; - z-index: 1030; + z-index: 1070; display: block; - visibility: visible; + font-family: "lato", sans-serif; font-size: 12px; + font-weight: normal; line-height: 1.4; opacity: 0; filter: alpha(opacity=0); @@ -4643,13 +5047,15 @@ button.close { } .tooltip.top-left .tooltip-arrow { bottom: 0; - left: 5px; + right: 5px; + margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-right .tooltip-arrow { bottom: 0; - right: 5px; + left: 5px; + margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000000; } @@ -4676,13 +5082,15 @@ button.close { } .tooltip.bottom-left .tooltip-arrow { top: 0; - left: 5px; + right: 5px; + margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-right .tooltip-arrow { top: 0; - right: 5px; + left: 5px; + margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } @@ -4690,10 +5098,14 @@ button.close { position: absolute; top: 0; left: 0; - z-index: 1010; + z-index: 1060; display: none; max-width: 276px; padding: 1px; + font-family: "lato", sans-serif; + font-size: 14px; + font-weight: normal; + line-height: 1.428571429; text-align: left; background-color: #ffffff; background-clip: padding-box; @@ -4720,8 +5132,6 @@ button.close { margin: 0; padding: 8px 14px; font-size: 14px; - font-weight: normal; - line-height: 18px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; @@ -4729,8 +5139,8 @@ button.close { .popover-content { padding: 9px 14px; } -.popover .arrow, -.popover .arrow:after { +.popover > .arrow, +.popover > .arrow:after { position: absolute; display: block; width: 0; @@ -4738,14 +5148,14 @@ button.close { border-color: transparent; border-style: solid; } -.popover .arrow { +.popover > .arrow { border-width: 11px; } -.popover .arrow:after { +.popover > .arrow:after { border-width: 10px; content: ""; } -.popover.top .arrow { +.popover.top > .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; @@ -4753,14 +5163,14 @@ button.close { border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; } -.popover.top .arrow:after { +.popover.top > .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #ffffff; } -.popover.right .arrow { +.popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; @@ -4768,14 +5178,14 @@ button.close { border-right-color: #999999; border-right-color: rgba(0, 0, 0, 0.25); } -.popover.right .arrow:after { +.popover.right > .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #ffffff; } -.popover.bottom .arrow { +.popover.bottom > .arrow { left: 50%; margin-left: -11px; border-top-width: 0; @@ -4783,14 +5193,14 @@ button.close { border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; } -.popover.bottom .arrow:after { +.popover.bottom > .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #ffffff; } -.popover.left .arrow { +.popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; @@ -4798,7 +5208,7 @@ button.close { border-left-color: #999999; border-left-color: rgba(0, 0, 0, 0.25); } -.popover.left .arrow:after { +.popover.left > .arrow:after { content: " "; right: 1px; border-right-width: 0; @@ -4817,15 +5227,46 @@ button.close { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { - display: block; - max-width: 100%; - height: auto; line-height: 1; } +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform 0.6s ease-in-out; + -moz-transition: -moz-transform 0.6s ease-in-out; + -o-transition: -o-transform 0.6s ease-in-out; + transition: transform 0.6s ease-in-out; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + -moz-perspective: 1000; + perspective: 1000; + } + .carousel-inner > .item.next, + .carousel-inner > .item.active.right { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + left: 0; + } + .carousel-inner > .item.prev, + .carousel-inner > .item.active.left { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + left: 0; + } + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right, + .carousel-inner > .item.active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + left: 0; + } +} .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { @@ -4870,7 +5311,8 @@ button.close { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-control.left { - background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%)); + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); @@ -4878,14 +5320,15 @@ button.close { .carousel-control.right { left: auto; right: 0; - background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%)); + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } .carousel-control:hover, .carousel-control:focus { - outline: none; + outline: 0; color: #ffffff; text-decoration: none; opacity: 0.9; @@ -4903,17 +5346,19 @@ button.close { .carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { left: 50%; + margin-left: -10px; } .carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { right: 50%; + margin-right: -10px; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; margin-top: -10px; - margin-left: -10px; + line-height: 1; font-family: serif; } .carousel-control .icon-prev:before { @@ -4967,16 +5412,23 @@ button.close { text-shadow: none; } @media screen and (min-width: 768px) { - .carousel-control .glyphicons-chevron-left, - .carousel-control .glyphicons-chevron-right, + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -15px; - margin-left: -15px; font-size: 30px; } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -15px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -15px; + } .carousel-caption { left: 20%; right: 20%; @@ -4988,6 +5440,8 @@ button.close { } .clearfix:before, .clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, @@ -5018,6 +5472,7 @@ button.close { display: table; } .clearfix:after, +.dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after, @@ -5062,7 +5517,6 @@ button.close { } .hidden { display: none !important; - visibility: hidden !important; } .affix { position: fixed; @@ -5071,9 +5525,23 @@ button.close { width: device-width; } .visible-xs, -tr.visible-xs, -th.visible-xs, -td.visible-xs { +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { @@ -5091,11 +5559,20 @@ td.visible-xs { display: table-cell !important; } } -.visible-sm, -tr.visible-sm, -th.visible-sm, -td.visible-sm { - display: none !important; +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { @@ -5112,11 +5589,20 @@ td.visible-sm { display: table-cell !important; } } -.visible-md, -tr.visible-md, -th.visible-md, -td.visible-md { - display: none !important; +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { @@ -5133,11 +5619,20 @@ td.visible-md { display: table-cell !important; } } -.visible-lg, -tr.visible-lg, -th.visible-lg, -td.visible-lg { - display: none !important; +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } } @media (min-width: 1200px) { .visible-lg { @@ -5154,42 +5649,42 @@ td.visible-lg { display: table-cell !important; } } +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} @media (max-width: 767px) { - .hidden-xs, - tr.hidden-xs, - th.hidden-xs, - td.hidden-xs { + .hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { - .hidden-sm, - tr.hidden-sm, - th.hidden-sm, - td.hidden-sm { + .hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { - .hidden-md, - tr.hidden-md, - th.hidden-md, - td.hidden-md { + .hidden-md { display: none !important; } } @media (min-width: 1200px) { - .hidden-lg, - tr.hidden-lg, - th.hidden-lg, - td.hidden-lg { + .hidden-lg { display: none !important; } } -.visible-print, -tr.visible-print, -th.visible-print, -td.visible-print { +.visible-print { display: none !important; } @media print { @@ -5207,11 +5702,32 @@ td.visible-print { display: table-cell !important; } } +.visible-print-block { + display: none !important; +} @media print { - .hidden-print, - tr.hidden-print, - th.hidden-print, - td.hidden-print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { display: none !important; } } diff --git a/themes/demo/assets/vendor/bootstrap/js/affix.js b/themes/demo/assets/vendor/bootstrap/js/affix.js index d447b0947..98197642a 100644 --- a/themes/demo/assets/vendor/bootstrap/js/affix.js +++ b/themes/demo/assets/vendor/bootstrap/js/affix.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: affix.js v3.1.0 + * Bootstrap: affix.js v3.3.4 * http://getbootstrap.com/javascript/#affix * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -15,28 +15,54 @@ var Affix = function (element, options) { this.options = $.extend({}, Affix.DEFAULTS, options) - this.$window = $(window) + + this.$target = $(this.options.target) .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) this.$element = $(element) - this.affixed = - this.unpin = + this.affixed = null + this.unpin = null this.pinnedOffset = null this.checkPosition() } - Affix.RESET = 'affix affix-top affix-bottom' + Affix.VERSION = '3.3.4' + + Affix.RESET = 'affix affix-top affix-bottom' Affix.DEFAULTS = { - offset: 0 + offset: 0, + target: window + } + + Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { + var scrollTop = this.$target.scrollTop() + var position = this.$element.offset() + var targetHeight = this.$target.height() + + if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false + + if (this.affixed == 'bottom') { + if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' + return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' + } + + var initializing = this.affixed == null + var colliderTop = initializing ? scrollTop : position.top + var colliderHeight = initializing ? targetHeight : height + + if (offsetTop != null && scrollTop <= offsetTop) return 'top' + if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' + + return false } Affix.prototype.getPinnedOffset = function () { if (this.pinnedOffset) return this.pinnedOffset this.$element.removeClass(Affix.RESET).addClass('affix') - var scrollTop = this.$window.scrollTop() + var scrollTop = this.$target.scrollTop() var position = this.$element.offset() return (this.pinnedOffset = position.top - scrollTop) } @@ -48,43 +74,41 @@ Affix.prototype.checkPosition = function () { if (!this.$element.is(':visible')) return - var scrollHeight = $(document).height() - var scrollTop = this.$window.scrollTop() - var position = this.$element.offset() + var height = this.$element.height() var offset = this.options.offset var offsetTop = offset.top var offsetBottom = offset.bottom - - if (this.affixed == 'top') position.top += scrollTop + var scrollHeight = $(document.body).height() if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) - var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : - offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : - offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false + var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) - if (this.affixed === affix) return - if (this.unpin) this.$element.css('top', '') + if (this.affixed != affix) { + if (this.unpin != null) this.$element.css('top', '') - var affixType = 'affix' + (affix ? '-' + affix : '') - var e = $.Event(affixType + '.bs.affix') + var affixType = 'affix' + (affix ? '-' + affix : '') + var e = $.Event(affixType + '.bs.affix') - this.$element.trigger(e) + this.$element.trigger(e) - if (e.isDefaultPrevented()) return + if (e.isDefaultPrevented()) return - this.affixed = affix - this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null + this.affixed = affix + this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null - this.$element - .removeClass(Affix.RESET) - .addClass(affixType) - .trigger($.Event(affixType.replace('affix', 'affixed'))) + this.$element + .removeClass(Affix.RESET) + .addClass(affixType) + .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') + } if (affix == 'bottom') { - this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) + this.$element.offset({ + top: scrollHeight - height - offsetBottom + }) } } @@ -92,9 +116,7 @@ // AFFIX PLUGIN DEFINITION // ======================= - var old = $.fn.affix - - $.fn.affix = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.affix') @@ -105,6 +127,9 @@ }) } + var old = $.fn.affix + + $.fn.affix = Plugin $.fn.affix.Constructor = Affix @@ -127,10 +152,10 @@ data.offset = data.offset || {} - if (data.offsetBottom) data.offset.bottom = data.offsetBottom - if (data.offsetTop) data.offset.top = data.offsetTop + if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom + if (data.offsetTop != null) data.offset.top = data.offsetTop - $spy.affix(data) + Plugin.call($spy, data) }) }) diff --git a/themes/demo/assets/vendor/bootstrap/js/alert.js b/themes/demo/assets/vendor/bootstrap/js/alert.js index 1c0756a95..1925ef011 100644 --- a/themes/demo/assets/vendor/bootstrap/js/alert.js +++ b/themes/demo/assets/vendor/bootstrap/js/alert.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: alert.js v3.1.0 + * Bootstrap: alert.js v3.3.4 * http://getbootstrap.com/javascript/#alerts * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -18,6 +18,10 @@ $(el).on('click', dismiss, this.close) } + Alert.VERSION = '3.3.4' + + Alert.TRANSITION_DURATION = 150 + Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') @@ -32,7 +36,7 @@ if (e) e.preventDefault() if (!$parent.length) { - $parent = $this.hasClass('alert') ? $this : $this.parent() + $parent = $this.closest('.alert') } $parent.trigger(e = $.Event('close.bs.alert')) @@ -42,13 +46,14 @@ $parent.removeClass('in') function removeElement() { - $parent.trigger('closed.bs.alert').remove() + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ? $parent - .one($.support.transition.end, removeElement) - .emulateTransitionEnd(150) : + .one('bsTransitionEnd', removeElement) + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement() } @@ -56,9 +61,7 @@ // ALERT PLUGIN DEFINITION // ======================= - var old = $.fn.alert - - $.fn.alert = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') @@ -68,6 +71,9 @@ }) } + var old = $.fn.alert + + $.fn.alert = Plugin $.fn.alert.Constructor = Alert diff --git a/themes/demo/assets/vendor/bootstrap/js/button.js b/themes/demo/assets/vendor/bootstrap/js/button.js index 2be72d53d..7c7c021f9 100644 --- a/themes/demo/assets/vendor/bootstrap/js/button.js +++ b/themes/demo/assets/vendor/bootstrap/js/button.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: button.js v3.1.0 + * Bootstrap: button.js v3.3.4 * http://getbootstrap.com/javascript/#buttons * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -19,6 +19,8 @@ this.isLoading = false } + Button.VERSION = '3.3.4' + Button.DEFAULTS = { loadingText: 'loading...' } @@ -31,12 +33,12 @@ state = state + 'Text' - if (!data.resetText) $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) + if (data.resetText == null) $el.data('resetText', $el[val]()) // push to event loop to allow forms to submit setTimeout($.proxy(function () { + $el[val](data[state] == null ? this.options[state] : data[state]) + if (state == 'loadingText') { this.isLoading = true $el.addClass(d).attr(d, d) @@ -58,6 +60,8 @@ else $parent.find('.active').removeClass('active') } if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } else { + this.$element.attr('aria-pressed', !this.$element.hasClass('active')) } if (changed) this.$element.toggleClass('active') @@ -67,9 +71,7 @@ // BUTTON PLUGIN DEFINITION // ======================== - var old = $.fn.button - - $.fn.button = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') @@ -82,6 +84,9 @@ }) } + var old = $.fn.button + + $.fn.button = Plugin $.fn.button.Constructor = Button @@ -97,11 +102,15 @@ // BUTTON DATA-API // =============== - $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - e.preventDefault() - }) + $(document) + .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + Plugin.call($btn, 'toggle') + e.preventDefault() + }) + .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { + $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) + }) }(jQuery); diff --git a/themes/demo/assets/vendor/bootstrap/js/carousel.js b/themes/demo/assets/vendor/bootstrap/js/carousel.js index 88c9b23da..a38ef14d0 100644 --- a/themes/demo/assets/vendor/bootstrap/js/carousel.js +++ b/themes/demo/assets/vendor/bootstrap/js/carousel.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: carousel.js v3.1.0 + * Bootstrap: carousel.js v3.3.4 * http://getbootstrap.com/javascript/#carousel * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -17,24 +17,42 @@ this.$element = $(element) this.$indicators = this.$element.find('.carousel-indicators') this.options = options - this.paused = - this.sliding = - this.interval = - this.$active = + this.paused = null + this.sliding = null + this.interval = null + this.$active = null this.$items = null - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) + this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) + + this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element + .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) + .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) } + Carousel.VERSION = '3.3.4' + + Carousel.TRANSITION_DURATION = 600 + Carousel.DEFAULTS = { interval: 5000, pause: 'hover', - wrap: true + wrap: true, + keyboard: true } - Carousel.prototype.cycle = function (e) { + Carousel.prototype.keydown = function (e) { + if (/input|textarea/i.test(e.target.tagName)) return + switch (e.which) { + case 37: this.prev(); break + case 39: this.next(); break + default: return + } + + e.preventDefault() + } + + Carousel.prototype.cycle = function (e) { e || (this.paused = false) this.interval && clearInterval(this.interval) @@ -46,23 +64,31 @@ return this } - Carousel.prototype.getActiveIndex = function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() + Carousel.prototype.getItemIndex = function (item) { + this.$items = item.parent().children('.item') + return this.$items.index(item || this.$active) + } - return this.$items.index(this.$active) + Carousel.prototype.getItemForDirection = function (direction, active) { + var activeIndex = this.getItemIndex(active) + var willWrap = (direction == 'prev' && activeIndex === 0) + || (direction == 'next' && activeIndex == (this.$items.length - 1)) + if (willWrap && !this.options.wrap) return active + var delta = direction == 'prev' ? -1 : 1 + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) } Carousel.prototype.to = function (pos) { var that = this - var activeIndex = this.getActiveIndex() + var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) if (pos > (this.$items.length - 1) || pos < 0) return - if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } Carousel.prototype.pause = function (e) { @@ -90,22 +116,20 @@ Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') - var $next = next || $active[type]() + var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' - var fallback = type == 'next' ? 'first' : 'last' var that = this - if (!$next.length) { - if (!this.options.wrap) return - $next = this.$element.find('.item')[fallback]() - } + if ($next.hasClass('active')) return (this.sliding = false) - if ($next.hasClass('active')) return this.sliding = false - - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) - this.$element.trigger(e) - if (e.isDefaultPrevented()) return + var relatedTarget = $next[0] + var slideEvent = $.Event('slide.bs.carousel', { + relatedTarget: relatedTarget, + direction: direction + }) + this.$element.trigger(slideEvent) + if (slideEvent.isDefaultPrevented()) return this.sliding = true @@ -113,30 +137,31 @@ if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') - this.$element.one('slid.bs.carousel', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) + var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) + $nextIndicator && $nextIndicator.addClass('active') } + var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" if ($.support.transition && this.$element.hasClass('slide')) { $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active - .one($.support.transition.end, function () { + .one('bsTransitionEnd', function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false - setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) + setTimeout(function () { + that.$element.trigger(slidEvent) + }, 0) }) - .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) } else { $active.removeClass('active') $next.addClass('active') this.sliding = false - this.$element.trigger('slid.bs.carousel') + this.$element.trigger(slidEvent) } isCycling && this.cycle() @@ -148,9 +173,7 @@ // CAROUSEL PLUGIN DEFINITION // ========================== - var old = $.fn.carousel - - $.fn.carousel = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') @@ -164,6 +187,9 @@ }) } + var old = $.fn.carousel + + $.fn.carousel = Plugin $.fn.carousel.Constructor = Carousel @@ -179,26 +205,32 @@ // CAROUSEL DATA-API // ================= - $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var clickHandler = function (e) { + var href + var $this = $(this) + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 + if (!$target.hasClass('carousel')) return var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false - $target.carousel(options) + Plugin.call($target, options) - if (slideIndex = $this.attr('data-slide-to')) { + if (slideIndex) { $target.data('bs.carousel').to(slideIndex) } e.preventDefault() - }) + } + + $(document) + .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) + .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) $(window).on('load', function () { $('[data-ride="carousel"]').each(function () { var $carousel = $(this) - $carousel.carousel($carousel.data()) + Plugin.call($carousel, $carousel.data()) }) }) diff --git a/themes/demo/assets/vendor/bootstrap/js/collapse.js b/themes/demo/assets/vendor/bootstrap/js/collapse.js index 1abafd6a5..954513c5e 100644 --- a/themes/demo/assets/vendor/bootstrap/js/collapse.js +++ b/themes/demo/assets/vendor/bootstrap/js/collapse.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: collapse.js v3.1.0 + * Bootstrap: collapse.js v3.3.4 * http://getbootstrap.com/javascript/#collapse * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -16,12 +16,23 @@ var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, Collapse.DEFAULTS, options) + this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + + '[data-toggle="collapse"][data-target="#' + element.id + '"]') this.transitioning = null - if (this.options.parent) this.$parent = $(this.options.parent) + if (this.options.parent) { + this.$parent = this.getParent() + } else { + this.addAriaAndCollapsedClass(this.$element, this.$trigger) + } + if (this.options.toggle) this.toggle() } + Collapse.VERSION = '3.3.4' + + Collapse.TRANSITION_DURATION = 350 + Collapse.DEFAULTS = { toggle: true } @@ -34,35 +45,43 @@ Collapse.prototype.show = function () { if (this.transitioning || this.$element.hasClass('in')) return + var activesData + var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') + + if (actives && actives.length) { + activesData = actives.data('bs.collapse') + if (activesData && activesData.transitioning) return + } + var startEvent = $.Event('show.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return - var actives = this.$parent && this.$parent.find('> .panel > .in') - if (actives && actives.length) { - var hasData = actives.data('bs.collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('bs.collapse', null) + Plugin.call(actives, 'hide') + activesData || actives.data('bs.collapse', null) } var dimension = this.dimension() this.$element .removeClass('collapse') - .addClass('collapsing') - [dimension](0) + .addClass('collapsing')[dimension](0) + .attr('aria-expanded', true) + + this.$trigger + .removeClass('collapsed') + .attr('aria-expanded', true) this.transitioning = 1 var complete = function () { this.$element .removeClass('collapsing') - .addClass('collapse in') - [dimension]('auto') + .addClass('collapse in')[dimension]('') this.transitioning = 0 - this.$element.trigger('shown.bs.collapse') + this.$element + .trigger('shown.bs.collapse') } if (!$.support.transition) return complete.call(this) @@ -70,9 +89,8 @@ var scrollSize = $.camelCase(['scroll', dimension].join('-')) this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - [dimension](this.$element[0][scrollSize]) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { @@ -84,55 +102,85 @@ var dimension = this.dimension() - this.$element - [dimension](this.$element[dimension]()) - [0].offsetHeight + this.$element[dimension](this.$element[dimension]())[0].offsetHeight this.$element .addClass('collapsing') - .removeClass('collapse') - .removeClass('in') + .removeClass('collapse in') + .attr('aria-expanded', false) + + this.$trigger + .addClass('collapsed') + .attr('aria-expanded', false) this.transitioning = 1 var complete = function () { this.transitioning = 0 this.$element - .trigger('hidden.bs.collapse') .removeClass('collapsing') .addClass('collapse') + .trigger('hidden.bs.collapse') } if (!$.support.transition) return complete.call(this) this.$element [dimension](0) - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) + .one('bsTransitionEnd', $.proxy(complete, this)) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } Collapse.prototype.toggle = function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } + Collapse.prototype.getParent = function () { + return $(this.options.parent) + .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') + .each($.proxy(function (i, element) { + var $element = $(element) + this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) + }, this)) + .end() + } + + Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { + var isOpen = $element.hasClass('in') + + $element.attr('aria-expanded', isOpen) + $trigger + .toggleClass('collapsed', !isOpen) + .attr('aria-expanded', isOpen) + } + + function getTargetFromTrigger($trigger) { + var href + var target = $trigger.attr('data-target') + || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 + + return $(target) + } + // COLLAPSE PLUGIN DEFINITION // ========================== - var old = $.fn.collapse - - $.fn.collapse = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - if (!data && options.toggle && option == 'show') option = !option + if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } + var old = $.fn.collapse + + $.fn.collapse = Plugin $.fn.collapse.Constructor = Collapse @@ -148,23 +196,16 @@ // COLLAPSE DATA-API // ================= - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - var target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $target = $(target) + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { + var $this = $(this) + + if (!$this.attr('data-target')) e.preventDefault() + + var $target = getTargetFromTrigger($this) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() - var parent = $this.attr('data-parent') - var $parent = parent && $(parent) - if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') - $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - } - - $target.collapse(option) + Plugin.call($target, option) }) }(jQuery); diff --git a/themes/demo/assets/vendor/bootstrap/js/dropdown.js b/themes/demo/assets/vendor/bootstrap/js/dropdown.js index 9c13aac97..9874600f9 100644 --- a/themes/demo/assets/vendor/bootstrap/js/dropdown.js +++ b/themes/demo/assets/vendor/bootstrap/js/dropdown.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: dropdown.js v3.1.0 + * Bootstrap: dropdown.js v3.3.4 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -14,11 +14,13 @@ // ========================= var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle=dropdown]' + var toggle = '[data-toggle="dropdown"]' var Dropdown = function (element) { $(element).on('click.bs.dropdown', this.toggle) } + Dropdown.VERSION = '3.3.4' + Dropdown.prototype.toggle = function (e) { var $this = $(this) @@ -40,18 +42,20 @@ if (e.isDefaultPrevented()) return + $this + .trigger('focus') + .attr('aria-expanded', 'true') + $parent .toggleClass('open') .trigger('shown.bs.dropdown', relatedTarget) - - $this.focus() } return false } Dropdown.prototype.keydown = function (e) { - if (!/(38|40|27)/.test(e.keyCode)) return + if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return var $this = $(this) @@ -63,33 +67,40 @@ var $parent = getParent($this) var isActive = $parent.hasClass('open') - if (!isActive || (isActive && e.keyCode == 27)) { - if (e.which == 27) $parent.find(toggle).focus() - return $this.click() + if ((!isActive && e.which != 27) || (isActive && e.which == 27)) { + if (e.which == 27) $parent.find(toggle).trigger('focus') + return $this.trigger('click') } - var desc = ' li:not(.divider):visible a' - var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc) + var desc = ' li:not(.disabled):visible a' + var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) if (!$items.length) return - var index = $items.index($items.filter(':focus')) + var index = $items.index(e.target) - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down + if (e.which == 38 && index > 0) index-- // up + if (e.which == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0 - $items.eq(index).focus() + $items.eq(index).trigger('focus') } function clearMenus(e) { + if (e && e.which === 3) return $(backdrop).remove() $(toggle).each(function () { - var $parent = getParent($(this)) + var $this = $(this) + var $parent = getParent($this) var relatedTarget = { relatedTarget: this } + if (!$parent.hasClass('open')) return + $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) + if (e.isDefaultPrevented()) return + + $this.attr('aria-expanded', 'false') $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) }) } @@ -99,7 +110,7 @@ if (!selector) { selector = $this.attr('href') - selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } var $parent = selector && $(selector) @@ -111,9 +122,7 @@ // DROPDOWN PLUGIN DEFINITION // ========================== - var old = $.fn.dropdown - - $.fn.dropdown = function (option) { + function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.dropdown') @@ -123,6 +132,9 @@ }) } + var old = $.fn.dropdown + + $.fn.dropdown = Plugin $.fn.dropdown.Constructor = Dropdown @@ -142,6 +154,8 @@ .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) - .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown) + .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown) }(jQuery); diff --git a/themes/demo/assets/vendor/bootstrap/js/modal.js b/themes/demo/assets/vendor/bootstrap/js/modal.js index 24506ea28..c1eb2a852 100644 --- a/themes/demo/assets/vendor/bootstrap/js/modal.js +++ b/themes/demo/assets/vendor/bootstrap/js/modal.js @@ -1,8 +1,8 @@ /* ======================================================================== - * Bootstrap: modal.js v3.1.0 + * Bootstrap: modal.js v3.3.4 * http://getbootstrap.com/javascript/#modals * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -14,10 +14,15 @@ // ====================== var Modal = function (element, options) { - this.options = options - this.$element = $(element) - this.$backdrop = - this.isShown = null + this.options = options + this.$body = $(document.body) + this.$element = $(element) + this.$dialog = this.$element.find('.modal-dialog') + this.$backdrop = null + this.isShown = null + this.originalBodyPad = null + this.scrollbarWidth = 0 + this.ignoreBackdropClick = false if (this.options.remote) { this.$element @@ -28,6 +33,11 @@ } } + Modal.VERSION = '3.3.4' + + Modal.TRANSITION_DURATION = 300 + Modal.BACKDROP_TRANSITION_DURATION = 150 + Modal.DEFAULTS = { backdrop: true, keyboard: true, @@ -35,7 +45,7 @@ } Modal.prototype.toggle = function (_relatedTarget) { - return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) + return this.isShown ? this.hide() : this.show(_relatedTarget) } Modal.prototype.show = function (_relatedTarget) { @@ -48,21 +58,34 @@ this.isShown = true + this.checkScrollbar() + this.setScrollbar() + this.$body.addClass('modal-open') + this.escape() + this.resize() this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) + this.$dialog.on('mousedown.dismiss.bs.modal', function () { + that.$element.one('mouseup.dismiss.bs.modal', function (e) { + if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true + }) + }) + this.backdrop(function () { var transition = $.support.transition && that.$element.hasClass('fade') if (!that.$element.parent().length) { - that.$element.appendTo(document.body) // don't move modals dom position + that.$element.appendTo(that.$body) // don't move modals dom position } that.$element .show() .scrollTop(0) + that.adjustDialog() + if (transition) { that.$element[0].offsetWidth // force reflow } @@ -76,12 +99,12 @@ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) transition ? - that.$element.find('.modal-dialog') // wait for modal to slide in - .one($.support.transition.end, function () { - that.$element.focus().trigger(e) + that.$dialog // wait for modal to slide in + .one('bsTransitionEnd', function () { + that.$element.trigger('focus').trigger(e) }) - .emulateTransitionEnd(300) : - that.$element.focus().trigger(e) + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : + that.$element.trigger('focus').trigger(e) }) } @@ -97,6 +120,7 @@ this.isShown = false this.escape() + this.resize() $(document).off('focusin.bs.modal') @@ -104,11 +128,14 @@ .removeClass('in') .attr('aria-hidden', true) .off('click.dismiss.bs.modal') + .off('mouseup.dismiss.bs.modal') + + this.$dialog.off('mousedown.dismiss.bs.modal') $.support.transition && this.$element.hasClass('fade') ? this.$element - .one($.support.transition.end, $.proxy(this.hideModal, this)) - .emulateTransitionEnd(300) : + .one('bsTransitionEnd', $.proxy(this.hideModal, this)) + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal() } @@ -117,18 +144,26 @@ .off('focusin.bs.modal') // guard against infinite focus loop .on('focusin.bs.modal', $.proxy(function (e) { if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { - this.$element.focus() + this.$element.trigger('focus') } }, this)) } Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { + this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 && this.hide() }, this)) } else if (!this.isShown) { - this.$element.off('keyup.dismiss.bs.modal') + this.$element.off('keydown.dismiss.bs.modal') + } + } + + Modal.prototype.resize = function () { + if (this.isShown) { + $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) + } else { + $(window).off('resize.bs.modal') } } @@ -136,7 +171,9 @@ var that = this this.$element.hide() this.backdrop(function () { - that.removeBackdrop() + that.$body.removeClass('modal-open') + that.resetAdjustments() + that.resetScrollbar() that.$element.trigger('hidden.bs.modal') }) } @@ -147,19 +184,24 @@ } Modal.prototype.backdrop = function (callback) { + var that = this var animate = this.$element.hasClass('fade') ? 'fade' : '' if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate this.$backdrop = $('