diff --git a/dist/angular-strap.js b/dist/angular-strap.js
index 28e842395..ce7b5170a 100644
--- a/dist/angular-strap.js
+++ b/dist/angular-strap.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -24,7 +24,8 @@ angular.module('mgcrea.ngStrap', [
'mgcrea.ngStrap.scrollspy',
'mgcrea.ngStrap.affix',
'mgcrea.ngStrap.tab',
- 'mgcrea.ngStrap.collapse'
+ 'mgcrea.ngStrap.collapse',
+ 'mgcrea.ngStrap.progressbar'
]);
// Source: affix.js
@@ -382,95 +383,6 @@ angular.module('mgcrea.ngStrap.alert', ['mgcrea.ngStrap.modal'])
}]);
-// Source: aside.js
-angular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])
-
- .provider('$aside', function() {
-
- var defaults = this.defaults = {
- animation: 'am-fade-and-slide-right',
- prefixClass: 'aside',
- prefixEvent: 'aside',
- placement: 'right',
- template: 'aside/aside.tpl.html',
- contentTemplate: false,
- container: false,
- element: null,
- backdrop: true,
- keyboard: true,
- html: false,
- show: true
- };
-
- this.$get = ["$modal", function($modal) {
-
- function AsideFactory(config) {
-
- var $aside = {};
-
- // Common vars
- var options = angular.extend({}, defaults, config);
-
- $aside = $modal(options);
-
- return $aside;
-
- }
-
- return AsideFactory;
-
- }];
-
- })
-
- .directive('bsAside', ["$window", "$sce", "$aside", function($window, $sce, $aside) {
-
- var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
-
- return {
- restrict: 'EAC',
- scope: true,
- link: function postLink(scope, element, attr, transclusion) {
- // Directive options
- var options = {scope: scope, element: element, show: false};
- angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {
- if(angular.isDefined(attr[key])) options[key] = attr[key];
- });
-
- // Support scope as data-attrs
- angular.forEach(['title', 'content'], function(key) {
- attr[key] && attr.$observe(key, function(newValue, oldValue) {
- scope[key] = $sce.trustAsHtml(newValue);
- });
- });
-
- // Support scope as an object
- attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {
- if(angular.isObject(newValue)) {
- angular.extend(scope, newValue);
- } else {
- scope.content = newValue;
- }
- }, true);
-
- // Initialize aside
- var aside = $aside(options);
-
- // Trigger
- element.on(attr.trigger || 'click', aside.toggle);
-
- // Garbage collection
- scope.$on('$destroy', function() {
- if (aside) aside.destroy();
- options = null;
- aside = null;
- });
-
- }
- };
-
- }]);
-
// Source: button.js
angular.module('mgcrea.ngStrap.button', [])
@@ -641,322 +553,133 @@ angular.module('mgcrea.ngStrap.button', [])
}]);
-// Source: collapse.js
-angular.module('mgcrea.ngStrap.collapse', [])
+// Source: datepicker.js
+angular.module('mgcrea.ngStrap.datepicker', [
+ 'mgcrea.ngStrap.helpers.dateParser',
+ 'mgcrea.ngStrap.helpers.dateFormatter',
+ 'mgcrea.ngStrap.tooltip'])
- .provider('$collapse', function() {
+ .provider('$datepicker', function() {
var defaults = this.defaults = {
- animation: 'am-collapse',
- disallowToggle: false,
- activeClass: 'in',
- startCollapsed: false
+ animation: 'am-fade',
+ prefixClass: 'datepicker',
+ placement: 'bottom-left',
+ template: 'datepicker/datepicker.tpl.html',
+ trigger: 'focus',
+ container: false,
+ keyboard: true,
+ html: false,
+ delay: 0,
+ // lang: $locale.id,
+ useNative: false,
+ dateType: 'date',
+ dateFormat: 'shortDate',
+ modelDateFormat: null,
+ dayFormat: 'dd',
+ monthFormat: 'MMM',
+ yearFormat: 'yyyy',
+ monthTitleFormat: 'MMMM yyyy',
+ yearTitleFormat: 'yyyy',
+ strictFormat: false,
+ autoclose: false,
+ minDate: -Infinity,
+ maxDate: +Infinity,
+ startView: 0,
+ minView: 0,
+ startWeek: 0,
+ daysOfWeekDisabled: '',
+ iconLeft: 'glyphicon glyphicon-chevron-left',
+ iconRight: 'glyphicon glyphicon-chevron-right'
};
- var controller = this.controller = function($scope, $element, $attrs) {
- var self = this;
+ this.$get = ["$window", "$document", "$rootScope", "$sce", "$dateFormatter", "datepickerViews", "$tooltip", "$timeout", function($window, $document, $rootScope, $sce, $dateFormatter, datepickerViews, $tooltip, $timeout) {
- // Attributes options
- self.$options = angular.copy(defaults);
- angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed'], function (key) {
- if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];
- });
+ var bodyEl = angular.element($window.document.body);
+ var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
+ var isTouch = ('createTouch' in $window.document) && isNative;
+ if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();
- self.$toggles = [];
- self.$targets = [];
+ function DatepickerFactory(element, controller, config) {
- self.$viewChangeListeners = [];
+ var $datepicker = $tooltip(element, angular.extend({}, defaults, config));
+ var parentScope = config.scope;
+ var options = $datepicker.$options;
+ var scope = $datepicker.$scope;
+ if(options.startView) options.startView -= options.minView;
- self.$registerToggle = function(element) {
- self.$toggles.push(element);
- };
- self.$registerTarget = function(element) {
- self.$targets.push(element);
- };
+ // View vars
- self.$unregisterToggle = function(element) {
- var index = self.$toggles.indexOf(element);
- // remove toggle from $toggles array
- self.$toggles.splice(index, 1);
- };
- self.$unregisterTarget = function(element) {
- var index = self.$targets.indexOf(element);
- var activeIndex = self.$targets.$active;
+ var pickerViews = datepickerViews($datepicker);
+ $datepicker.$views = pickerViews.views;
+ var viewDate = pickerViews.viewDate;
+ scope.$mode = options.startView;
+ scope.$iconLeft = options.iconLeft;
+ scope.$iconRight = options.iconRight;
+ var $picker = $datepicker.$views[scope.$mode];
- // remove element from $targets array
- self.$targets.splice(index, 1);
+ // Scope methods
- if (index < activeIndex) {
- // we removed a target before the active target, so we need to
- // decrement the active target index
- activeIndex--;
- }
- else if (index === activeIndex && activeIndex === self.$targets.length) {
- // we remove the active target and it was the one at the end,
- // so select the previous one
- activeIndex--;
- }
- self.$setActive(activeIndex);
- };
+ scope.$select = function(date) {
+ $datepicker.select(date);
+ };
+ scope.$selectPane = function(value) {
+ $datepicker.$selectPane(value);
+ };
+ scope.$toggleMode = function() {
+ $datepicker.setMode((scope.$mode + 1) % $datepicker.$views.length);
+ };
- self.$targets.$active = !self.$options.startCollapsed ? 0 : -1;
- self.$setActive = $scope.$setActive = function(value) {
- if(!self.$options.disallowToggle) {
- self.$targets.$active = self.$targets.$active === value ? -1 : value;
- } else {
- self.$targets.$active = value;
- }
- self.$viewChangeListeners.forEach(function(fn) {
- fn();
- });
- };
+ // Public methods
- };
+ $datepicker.update = function(date) {
+ // console.warn('$datepicker.update() newValue=%o', date);
+ if(angular.isDate(date) && !isNaN(date.getTime())) {
+ $datepicker.$date = date;
+ $picker.update.call($picker, date);
+ }
+ // Build only if pristine
+ $datepicker.$build(true);
+ };
- this.$get = function() {
- var $collapse = {};
- $collapse.defaults = defaults;
- $collapse.controller = controller;
- return $collapse;
- };
+ $datepicker.updateDisabledDates = function(dateRanges) {
+ options.disabledDateRanges = dateRanges;
+ for(var i = 0, l = scope.rows.length; i < l; i++) {
+ angular.forEach(scope.rows[i], $datepicker.$setDisabledEl);
+ }
+ };
- })
+ $datepicker.select = function(date, keep) {
+ // console.warn('$datepicker.select', date, scope.$mode);
+ if(!angular.isDate(controller.$dateValue)) controller.$dateValue = new Date(date);
+ if(!scope.$mode || keep) {
+ controller.$setViewValue(angular.copy(date));
+ controller.$render();
+ if(options.autoclose && !keep) {
+ $timeout(function() { $datepicker.hide(true); });
+ }
+ } else {
+ angular.extend(viewDate, {year: date.getFullYear(), month: date.getMonth(), date: date.getDate()});
+ $datepicker.setMode(scope.$mode - 1);
+ $datepicker.$build();
+ }
+ };
- .directive('bsCollapse', ["$window", "$animate", "$collapse", function($window, $animate, $collapse) {
+ $datepicker.setMode = function(mode) {
+ // console.warn('$datepicker.setMode', mode);
+ scope.$mode = mode;
+ $picker = $datepicker.$views[scope.$mode];
+ $datepicker.$build();
+ };
- var defaults = $collapse.defaults;
+ // Protected methods
- return {
- require: ['?ngModel', 'bsCollapse'],
- controller: ['$scope', '$element', '$attrs', $collapse.controller],
- link: function postLink(scope, element, attrs, controllers) {
-
- var ngModelCtrl = controllers[0];
- var bsCollapseCtrl = controllers[1];
-
- if(ngModelCtrl) {
-
- // Update the modelValue following
- bsCollapseCtrl.$viewChangeListeners.push(function() {
- ngModelCtrl.$setViewValue(bsCollapseCtrl.$targets.$active);
- });
-
- // modelValue -> $formatters -> viewValue
- ngModelCtrl.$formatters.push(function(modelValue) {
- // console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
- if (bsCollapseCtrl.$targets.$active !== modelValue * 1) {
- bsCollapseCtrl.$setActive(modelValue * 1);
- }
- return modelValue;
- });
-
- }
-
- }
- };
-
- }])
-
- .directive('bsCollapseToggle', function() {
-
- return {
- require: ['^?ngModel', '^bsCollapse'],
- link: function postLink(scope, element, attrs, controllers) {
-
- var ngModelCtrl = controllers[0];
- var bsCollapseCtrl = controllers[1];
-
- // Add base attr
- element.attr('data-toggle', 'collapse');
-
- // Push pane to parent bsCollapse controller
- bsCollapseCtrl.$registerToggle(element);
-
- // remove toggle from collapse controller when toggle is destroyed
- scope.$on('$destroy', function() {
- bsCollapseCtrl.$unregisterToggle(element);
- });
-
- element.on('click', function() {
- var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);
- bsCollapseCtrl.$setActive(index * 1);
- scope.$apply();
- });
-
- }
- };
-
- })
-
- .directive('bsCollapseTarget', ["$animate", function($animate) {
-
- return {
- require: ['^?ngModel', '^bsCollapse'],
- // scope: true,
- link: function postLink(scope, element, attrs, controllers) {
-
- var ngModelCtrl = controllers[0];
- var bsCollapseCtrl = controllers[1];
-
- // Add base class
- element.addClass('collapse');
-
- // Add animation class
- if(bsCollapseCtrl.$options.animation) {
- element.addClass(bsCollapseCtrl.$options.animation);
- }
-
- // Push pane to parent bsCollapse controller
- bsCollapseCtrl.$registerTarget(element);
-
- // remove pane target from collapse controller when target is destroyed
- scope.$on('$destroy', function() {
- bsCollapseCtrl.$unregisterTarget(element);
- });
-
- function render() {
- var index = bsCollapseCtrl.$targets.indexOf(element);
- var active = bsCollapseCtrl.$targets.$active;
- $animate[index === active ? 'addClass' : 'removeClass'](element, bsCollapseCtrl.$options.activeClass);
- }
-
- bsCollapseCtrl.$viewChangeListeners.push(function() {
- render();
- });
- render();
-
- }
- };
-
- }]);
-
-// Source: datepicker.js
-angular.module('mgcrea.ngStrap.datepicker', [
- 'mgcrea.ngStrap.helpers.dateParser',
- 'mgcrea.ngStrap.helpers.dateFormatter',
- 'mgcrea.ngStrap.tooltip'])
-
- .provider('$datepicker', function() {
-
- var defaults = this.defaults = {
- animation: 'am-fade',
- prefixClass: 'datepicker',
- placement: 'bottom-left',
- template: 'datepicker/datepicker.tpl.html',
- trigger: 'focus',
- container: false,
- keyboard: true,
- html: false,
- delay: 0,
- // lang: $locale.id,
- useNative: false,
- dateType: 'date',
- dateFormat: 'shortDate',
- modelDateFormat: null,
- dayFormat: 'dd',
- monthFormat: 'MMM',
- yearFormat: 'yyyy',
- monthTitleFormat: 'MMMM yyyy',
- yearTitleFormat: 'yyyy',
- strictFormat: false,
- autoclose: false,
- minDate: -Infinity,
- maxDate: +Infinity,
- startView: 0,
- minView: 0,
- startWeek: 0,
- daysOfWeekDisabled: '',
- iconLeft: 'glyphicon glyphicon-chevron-left',
- iconRight: 'glyphicon glyphicon-chevron-right'
- };
-
- this.$get = ["$window", "$document", "$rootScope", "$sce", "$dateFormatter", "datepickerViews", "$tooltip", "$timeout", function($window, $document, $rootScope, $sce, $dateFormatter, datepickerViews, $tooltip, $timeout) {
-
- var bodyEl = angular.element($window.document.body);
- var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
- var isTouch = ('createTouch' in $window.document) && isNative;
- if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();
-
- function DatepickerFactory(element, controller, config) {
-
- var $datepicker = $tooltip(element, angular.extend({}, defaults, config));
- var parentScope = config.scope;
- var options = $datepicker.$options;
- var scope = $datepicker.$scope;
- if(options.startView) options.startView -= options.minView;
-
- // View vars
-
- var pickerViews = datepickerViews($datepicker);
- $datepicker.$views = pickerViews.views;
- var viewDate = pickerViews.viewDate;
- scope.$mode = options.startView;
- scope.$iconLeft = options.iconLeft;
- scope.$iconRight = options.iconRight;
- var $picker = $datepicker.$views[scope.$mode];
-
- // Scope methods
-
- scope.$select = function(date) {
- $datepicker.select(date);
- };
- scope.$selectPane = function(value) {
- $datepicker.$selectPane(value);
- };
- scope.$toggleMode = function() {
- $datepicker.setMode((scope.$mode + 1) % $datepicker.$views.length);
- };
-
- // Public methods
-
- $datepicker.update = function(date) {
- // console.warn('$datepicker.update() newValue=%o', date);
- if(angular.isDate(date) && !isNaN(date.getTime())) {
- $datepicker.$date = date;
- $picker.update.call($picker, date);
- }
- // Build only if pristine
- $datepicker.$build(true);
- };
-
- $datepicker.updateDisabledDates = function(dateRanges) {
- options.disabledDateRanges = dateRanges;
- for(var i = 0, l = scope.rows.length; i < l; i++) {
- angular.forEach(scope.rows[i], $datepicker.$setDisabledEl);
- }
- };
-
- $datepicker.select = function(date, keep) {
- // console.warn('$datepicker.select', date, scope.$mode);
- if(!angular.isDate(controller.$dateValue)) controller.$dateValue = new Date(date);
- if(!scope.$mode || keep) {
- controller.$setViewValue(angular.copy(date));
- controller.$render();
- if(options.autoclose && !keep) {
- $timeout(function() { $datepicker.hide(true); });
- }
- } else {
- angular.extend(viewDate, {year: date.getFullYear(), month: date.getMonth(), date: date.getDate()});
- $datepicker.setMode(scope.$mode - 1);
- $datepicker.$build();
- }
- };
-
- $datepicker.setMode = function(mode) {
- // console.warn('$datepicker.setMode', mode);
- scope.$mode = mode;
- $picker = $datepicker.$views[scope.$mode];
- $datepicker.$build();
- };
-
- // Protected methods
-
- $datepicker.$build = function(pristine) {
- // console.warn('$datepicker.$build() viewDate=%o', viewDate);
- if(pristine === true && $picker.built) return;
- if(pristine === false && !$picker.built) return;
- $picker.build.call($picker);
- };
+ $datepicker.$build = function(pristine) {
+ // console.warn('$datepicker.$build() viewDate=%o', viewDate);
+ if(pristine === true && $picker.built) return;
+ if(pristine === false && !$picker.built) return;
+ $picker.build.call($picker);
+ };
$datepicker.$updateSelected = function() {
for(var i = 0, l = scope.rows.length; i < l; i++) {
@@ -1461,34 +1184,300 @@ angular.module('mgcrea.ngStrap.datepicker', [
});
-// Source: dropdown.js
-angular.module('mgcrea.ngStrap.dropdown', ['mgcrea.ngStrap.tooltip'])
+// Source: collapse.js
+angular.module('mgcrea.ngStrap.collapse', [])
- .provider('$dropdown', function() {
+ .provider('$collapse', function() {
var defaults = this.defaults = {
- animation: 'am-fade',
- prefixClass: 'dropdown',
- placement: 'bottom-left',
- template: 'dropdown/dropdown.tpl.html',
- trigger: 'click',
- container: false,
- keyboard: true,
- html: false,
- delay: 0
+ animation: 'am-collapse',
+ disallowToggle: false,
+ activeClass: 'in',
+ startCollapsed: false,
+ allowMultiple: false
};
- this.$get = ["$window", "$rootScope", "$tooltip", "$timeout", function($window, $rootScope, $tooltip, $timeout) {
+ var controller = this.controller = function($scope, $element, $attrs) {
+ var self = this;
- var bodyEl = angular.element($window.document.body);
- var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;
+ // Attributes options
+ self.$options = angular.copy(defaults);
+ angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed', 'allowMultiple'], function (key) {
+ if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];
+ });
- function DropdownFactory(element, config) {
+ self.$toggles = [];
+ self.$targets = [];
- var $dropdown = {};
+ self.$viewChangeListeners = [];
- // Common vars
- var options = angular.extend({}, defaults, config);
+ self.$registerToggle = function(element) {
+ self.$toggles.push(element);
+ };
+ self.$registerTarget = function(element) {
+ self.$targets.push(element);
+ };
+
+ self.$unregisterToggle = function(element) {
+ var index = self.$toggles.indexOf(element);
+ // remove toggle from $toggles array
+ self.$toggles.splice(index, 1);
+ };
+ self.$unregisterTarget = function(element) {
+ var index = self.$targets.indexOf(element);
+
+ // remove element from $targets array
+ self.$targets.splice(index, 1);
+
+ if (self.$options.allowMultiple) {
+ // remove target index from $active array values
+ deactivateItem(element);
+ }
+
+ // fix active item indexes
+ fixActiveItemIndexes(index);
+
+ self.$viewChangeListeners.forEach(function(fn) {
+ fn();
+ });
+ };
+
+ // use array to store all the currently open panels
+ self.$targets.$active = !self.$options.startCollapsed ? [0] : [];
+ self.$setActive = $scope.$setActive = function(value) {
+ if(angular.isArray(value)) {
+ self.$targets.$active = angular.copy(value);
+ }
+ else if(!self.$options.disallowToggle) {
+ // toogle element active status
+ isActive(value) ? deactivateItem(value) : activateItem(value);
+ } else {
+ activateItem(value);
+ }
+
+ self.$viewChangeListeners.forEach(function(fn) {
+ fn();
+ });
+ };
+
+ self.$activeIndexes = function() {
+ return self.$options.allowMultiple ? self.$targets.$active :
+ self.$targets.$active.length === 1 ? self.$targets.$active[0] : -1;
+ };
+
+ function fixActiveItemIndexes(index) {
+ // item with index was removed, so we
+ // need to adjust other items index values
+ var activeIndexes = self.$targets.$active;
+ for(var i = 0; i < activeIndexes.length; i++) {
+ if (index < activeIndexes[i]) {
+ activeIndexes[i] = activeIndexes[i] - 1;
+ }
+
+ // the last item is active, so we need to
+ // adjust its index
+ if (activeIndexes[i] === self.$targets.length) {
+ activeIndexes[i] = self.$targets.length - 1;
+ }
+ }
+ }
+
+ function isActive(value) {
+ var activeItems = self.$targets.$active;
+ return activeItems.indexOf(value) === -1 ? false : true;
+ }
+
+ function deactivateItem(value) {
+ var index = self.$targets.$active.indexOf(value);
+ if (index !== -1) {
+ self.$targets.$active.splice(index, 1);
+ }
+ }
+
+ function activateItem(value) {
+ if (!self.$options.allowMultiple) {
+ // remove current selected item
+ self.$targets.$active.splice(0, 1);
+ }
+
+ if (self.$targets.$active.indexOf(value) === -1) {
+ self.$targets.$active.push(value);
+ }
+ }
+
+ };
+
+ this.$get = function() {
+ var $collapse = {};
+ $collapse.defaults = defaults;
+ $collapse.controller = controller;
+ return $collapse;
+ };
+
+ })
+
+ .directive('bsCollapse', ["$window", "$animate", "$collapse", function($window, $animate, $collapse) {
+
+ var defaults = $collapse.defaults;
+
+ return {
+ require: ['?ngModel', 'bsCollapse'],
+ controller: ['$scope', '$element', '$attrs', $collapse.controller],
+ link: function postLink(scope, element, attrs, controllers) {
+
+ var ngModelCtrl = controllers[0];
+ var bsCollapseCtrl = controllers[1];
+
+ if(ngModelCtrl) {
+
+ // Update the modelValue following
+ bsCollapseCtrl.$viewChangeListeners.push(function() {
+ ngModelCtrl.$setViewValue(bsCollapseCtrl.$activeIndexes());
+ });
+
+ // modelValue -> $formatters -> viewValue
+ ngModelCtrl.$formatters.push(function(modelValue) {
+ // console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
+ if (angular.isArray(modelValue)) {
+ // model value is an array, so just replace
+ // the active items directly
+ bsCollapseCtrl.$setActive(modelValue);
+ }
+ else {
+ var activeIndexes = bsCollapseCtrl.$activeIndexes();
+
+ if (angular.isArray(activeIndexes)) {
+ // we have an array of selected indexes
+ if (activeIndexes.indexOf(modelValue * 1) === -1) {
+ // item with modelValue index is not active
+ bsCollapseCtrl.$setActive(modelValue * 1);
+ }
+ }
+ else if (activeIndexes !== modelValue * 1) {
+ bsCollapseCtrl.$setActive(modelValue * 1);
+ }
+ }
+ return modelValue;
+ });
+
+ }
+
+ }
+ };
+
+ }])
+
+ .directive('bsCollapseToggle', function() {
+
+ return {
+ require: ['^?ngModel', '^bsCollapse'],
+ link: function postLink(scope, element, attrs, controllers) {
+
+ var ngModelCtrl = controllers[0];
+ var bsCollapseCtrl = controllers[1];
+
+ // Add base attr
+ element.attr('data-toggle', 'collapse');
+
+ // Push pane to parent bsCollapse controller
+ bsCollapseCtrl.$registerToggle(element);
+
+ // remove toggle from collapse controller when toggle is destroyed
+ scope.$on('$destroy', function() {
+ bsCollapseCtrl.$unregisterToggle(element);
+ });
+
+ element.on('click', function() {
+ var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);
+ bsCollapseCtrl.$setActive(index * 1);
+ scope.$apply();
+ });
+
+ }
+ };
+
+ })
+
+ .directive('bsCollapseTarget', ["$animate", function($animate) {
+
+ return {
+ require: ['^?ngModel', '^bsCollapse'],
+ // scope: true,
+ link: function postLink(scope, element, attrs, controllers) {
+
+ var ngModelCtrl = controllers[0];
+ var bsCollapseCtrl = controllers[1];
+
+ // Add base class
+ element.addClass('collapse');
+
+ // Add animation class
+ if(bsCollapseCtrl.$options.animation) {
+ element.addClass(bsCollapseCtrl.$options.animation);
+ }
+
+ // Push pane to parent bsCollapse controller
+ bsCollapseCtrl.$registerTarget(element);
+
+ // remove pane target from collapse controller when target is destroyed
+ scope.$on('$destroy', function() {
+ bsCollapseCtrl.$unregisterTarget(element);
+ });
+
+ function render() {
+ var index = bsCollapseCtrl.$targets.indexOf(element);
+ var active = bsCollapseCtrl.$activeIndexes();
+ var action = 'removeClass';
+ if (angular.isArray(active)) {
+ if (active.indexOf(index) !== -1) {
+ action = 'addClass';
+ }
+ }
+ else if (index === active) {
+ action = 'addClass';
+ }
+
+ $animate[action](element, bsCollapseCtrl.$options.activeClass);
+ }
+
+ bsCollapseCtrl.$viewChangeListeners.push(function() {
+ render();
+ });
+ render();
+
+ }
+ };
+
+ }]);
+
+// Source: dropdown.js
+angular.module('mgcrea.ngStrap.dropdown', ['mgcrea.ngStrap.tooltip'])
+
+ .provider('$dropdown', function() {
+
+ var defaults = this.defaults = {
+ animation: 'am-fade',
+ prefixClass: 'dropdown',
+ placement: 'bottom-left',
+ template: 'dropdown/dropdown.tpl.html',
+ trigger: 'click',
+ container: false,
+ keyboard: true,
+ html: false,
+ delay: 0
+ };
+
+ this.$get = ["$window", "$rootScope", "$tooltip", "$timeout", function($window, $rootScope, $tooltip, $timeout) {
+
+ var bodyEl = angular.element($window.document.body);
+ var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;
+
+ function DropdownFactory(element, config) {
+
+ var $dropdown = {};
+
+ // Common vars
+ var options = angular.extend({}, defaults, config);
var scope = $dropdown.$scope = options.scope && options.scope.$new() || $rootScope.$new();
$dropdown = $tooltip(element, options);
@@ -2249,18 +2238,17 @@ angular.module('mgcrea.ngStrap.helpers.parseOptions', [])
// });
-// Source: modal.js
-angular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])
+// Source: aside.js
+angular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])
- .provider('$modal', function() {
+ .provider('$aside', function() {
var defaults = this.defaults = {
- animation: 'am-fade',
- backdropAnimation: 'am-fade',
- prefixClass: 'modal',
- prefixEvent: 'modal',
- placement: 'top',
- template: 'modal/modal.tpl.html',
+ animation: 'am-fade-and-slide-right',
+ prefixClass: 'aside',
+ prefixEvent: 'aside',
+ placement: 'right',
+ template: 'aside/aside.tpl.html',
contentTemplate: false,
container: false,
element: null,
@@ -2270,40 +2258,130 @@ angular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])
show: true
};
- this.$get = ["$window", "$rootScope", "$compile", "$q", "$templateCache", "$http", "$animate", "$timeout", "$sce", "dimensions", function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {
-
- var forEach = angular.forEach;
- var trim = String.prototype.trim;
- var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
- var bodyElement = angular.element($window.document.body);
- var htmlReplaceRegExp = /ng-bind="/ig;
+ this.$get = ["$modal", function($modal) {
- function ModalFactory(config) {
+ function AsideFactory(config) {
- var $modal = {};
+ var $aside = {};
// Common vars
- var options = $modal.$options = angular.extend({}, defaults, config);
- $modal.$promise = fetchTemplate(options.template);
- var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();
- if(!options.element && !options.container) {
- options.container = 'body';
- }
+ var options = angular.extend({}, defaults, config);
- // Support scope as string options
- forEach(['title', 'content'], function(key) {
- if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);
- });
+ $aside = $modal(options);
- // Provide scope helpers
- scope.$hide = function() {
- scope.$$postDigest(function() {
- $modal.hide();
- });
- };
- scope.$show = function() {
- scope.$$postDigest(function() {
- $modal.show();
+ return $aside;
+
+ }
+
+ return AsideFactory;
+
+ }];
+
+ })
+
+ .directive('bsAside', ["$window", "$sce", "$aside", function($window, $sce, $aside) {
+
+ var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
+
+ return {
+ restrict: 'EAC',
+ scope: true,
+ link: function postLink(scope, element, attr, transclusion) {
+ // Directive options
+ var options = {scope: scope, element: element, show: false};
+ angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {
+ if(angular.isDefined(attr[key])) options[key] = attr[key];
+ });
+
+ // Support scope as data-attrs
+ angular.forEach(['title', 'content'], function(key) {
+ attr[key] && attr.$observe(key, function(newValue, oldValue) {
+ scope[key] = $sce.trustAsHtml(newValue);
+ });
+ });
+
+ // Support scope as an object
+ attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {
+ if(angular.isObject(newValue)) {
+ angular.extend(scope, newValue);
+ } else {
+ scope.content = newValue;
+ }
+ }, true);
+
+ // Initialize aside
+ var aside = $aside(options);
+
+ // Trigger
+ element.on(attr.trigger || 'click', aside.toggle);
+
+ // Garbage collection
+ scope.$on('$destroy', function() {
+ if (aside) aside.destroy();
+ options = null;
+ aside = null;
+ });
+
+ }
+ };
+
+ }]);
+
+// Source: modal.js
+angular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])
+
+ .provider('$modal', function() {
+
+ var defaults = this.defaults = {
+ animation: 'am-fade',
+ backdropAnimation: 'am-fade',
+ prefixClass: 'modal',
+ prefixEvent: 'modal',
+ placement: 'top',
+ template: 'modal/modal.tpl.html',
+ contentTemplate: false,
+ container: false,
+ element: null,
+ backdrop: true,
+ keyboard: true,
+ html: false,
+ show: true
+ };
+
+ this.$get = ["$window", "$rootScope", "$compile", "$q", "$templateCache", "$http", "$animate", "$timeout", "$sce", "dimensions", function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {
+
+ var forEach = angular.forEach;
+ var trim = String.prototype.trim;
+ var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
+ var bodyElement = angular.element($window.document.body);
+ var htmlReplaceRegExp = /ng-bind="/ig;
+
+ function ModalFactory(config) {
+
+ var $modal = {};
+
+ // Common vars
+ var options = $modal.$options = angular.extend({}, defaults, config);
+ $modal.$promise = fetchTemplate(options.template);
+ var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();
+ if(!options.element && !options.container) {
+ options.container = 'body';
+ }
+
+ // Support scope as string options
+ forEach(['title', 'content'], function(key) {
+ if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);
+ });
+
+ // Provide scope helpers
+ scope.$hide = function() {
+ scope.$$postDigest(function() {
+ $modal.hide();
+ });
+ };
+ scope.$show = function() {
+ scope.$$postDigest(function() {
+ $modal.show();
});
};
scope.$toggle = function() {
@@ -2651,111 +2729,6 @@ angular.module('mgcrea.ngStrap.navbar', [])
}]);
-// Source: popover.js
-angular.module('mgcrea.ngStrap.popover', ['mgcrea.ngStrap.tooltip'])
-
- .provider('$popover', function() {
-
- var defaults = this.defaults = {
- animation: 'am-fade',
- customClass: '',
- container: false,
- target: false,
- placement: 'right',
- template: 'popover/popover.tpl.html',
- contentTemplate: false,
- trigger: 'click',
- keyboard: true,
- html: false,
- title: '',
- content: '',
- delay: 0,
- autoClose: false
- };
-
- this.$get = ["$tooltip", function($tooltip) {
-
- function PopoverFactory(element, config) {
-
- // Common vars
- var options = angular.extend({}, defaults, config);
-
- var $popover = $tooltip(element, options);
-
- // Support scope as string options [/*title, */content]
- if(options.content) {
- $popover.$scope.content = options.content;
- }
-
- return $popover;
-
- }
-
- return PopoverFactory;
-
- }];
-
- })
-
- .directive('bsPopover', ["$window", "$sce", "$popover", function($window, $sce, $popover) {
-
- var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
-
- return {
- restrict: 'EAC',
- scope: true,
- link: function postLink(scope, element, attr) {
-
- // Directive options
- var options = {scope: scope};
- angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'customClass', 'autoClose'], function(key) {
- if(angular.isDefined(attr[key])) options[key] = attr[key];
- });
-
- // Support scope as data-attrs
- angular.forEach(['title', 'content'], function(key) {
- attr[key] && attr.$observe(key, function(newValue, oldValue) {
- scope[key] = $sce.trustAsHtml(newValue);
- angular.isDefined(oldValue) && requestAnimationFrame(function() {
- popover && popover.$applyPlacement();
- });
- });
- });
-
- // Support scope as an object
- attr.bsPopover && scope.$watch(attr.bsPopover, function(newValue, oldValue) {
- if(angular.isObject(newValue)) {
- angular.extend(scope, newValue);
- } else {
- scope.content = newValue;
- }
- angular.isDefined(oldValue) && requestAnimationFrame(function() {
- popover && popover.$applyPlacement();
- });
- }, true);
-
- // Visibility binding support
- attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {
- if(!popover || !angular.isDefined(newValue)) return;
- if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(popover),?/i);
- newValue === true ? popover.show() : popover.hide();
- });
-
- // Initialize popover
- var popover = $popover(element, options);
-
- // Garbage collection
- scope.$on('$destroy', function() {
- if (popover) popover.destroy();
- options = null;
- popover = null;
- });
-
- }
- };
-
- }]);
-
// Source: scrollspy.js
angular.module('mgcrea.ngStrap.scrollspy', ['mgcrea.ngStrap.helpers.debounce', 'mgcrea.ngStrap.helpers.dimensions'])
@@ -3010,6 +2983,47 @@ angular.module('mgcrea.ngStrap.scrollspy', ['mgcrea.ngStrap.helpers.debounce', '
}]);
+// Source: progressbar.js
+angular.module('mgcrea.ngStrap.progressbar', [])
+.provider('$progressbar', function (){
+ var defaults = {
+ barType: '',
+ animate: function (){ return true;}
+ };
+
+ this.$get = function (){
+ return {
+ defaults: defaults
+ };
+ };
+ })
+ .directive('bsProgressbar', ["$progressbar", function ($progressbar){
+ return {
+ restrict: 'E',
+ transclude: true,
+ replace: true,
+ templateUrl: 'progressbar/progressbar.tpl.html',
+ scope:{
+ value: '=',
+ type: '@',
+ animate: '&'
+ },
+ link: function (scope, element, attr){
+ scope.type = scope.type || $progressbar.defaults.barType;
+ scope.animate = angular.isDefined(scope.animate()) ? scope.animate : $progressbar.defaults.animate;
+ console.log(scope.animate(), $progressbar.defaults.animate, angular.isDefined(scope.animate));
+ scope.$watch('type', function (){
+ if(scope.type) {
+ scope.barClass = 'progress-bar-' + scope.type;
+ }
+ else{
+ scope.barClass = null;
+ }
+ });
+ }
+ };
+ }]);
+
// Source: select.js
angular.module('mgcrea.ngStrap.select', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])
@@ -3507,30 +3521,135 @@ angular.module('mgcrea.ngStrap.tab', [])
}]);
-// Source: tooltip.js
-angular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])
+// Source: popover.js
+angular.module('mgcrea.ngStrap.popover', ['mgcrea.ngStrap.tooltip'])
- .provider('$tooltip', function() {
+ .provider('$popover', function() {
var defaults = this.defaults = {
animation: 'am-fade',
customClass: '',
- prefixClass: 'tooltip',
- prefixEvent: 'tooltip',
container: false,
target: false,
- placement: 'top',
- template: 'tooltip/tooltip.tpl.html',
+ placement: 'right',
+ template: 'popover/popover.tpl.html',
contentTemplate: false,
- trigger: 'hover focus',
- keyboard: false,
+ trigger: 'click',
+ keyboard: true,
html: false,
- show: false,
title: '',
- type: '',
+ content: '',
delay: 0,
- autoClose: false,
- bsEnabled: true
+ autoClose: false
+ };
+
+ this.$get = ["$tooltip", function($tooltip) {
+
+ function PopoverFactory(element, config) {
+
+ // Common vars
+ var options = angular.extend({}, defaults, config);
+
+ var $popover = $tooltip(element, options);
+
+ // Support scope as string options [/*title, */content]
+ if(options.content) {
+ $popover.$scope.content = options.content;
+ }
+
+ return $popover;
+
+ }
+
+ return PopoverFactory;
+
+ }];
+
+ })
+
+ .directive('bsPopover', ["$window", "$sce", "$popover", function($window, $sce, $popover) {
+
+ var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
+
+ return {
+ restrict: 'EAC',
+ scope: true,
+ link: function postLink(scope, element, attr) {
+
+ // Directive options
+ var options = {scope: scope};
+ angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'customClass', 'autoClose'], function(key) {
+ if(angular.isDefined(attr[key])) options[key] = attr[key];
+ });
+
+ // Support scope as data-attrs
+ angular.forEach(['title', 'content'], function(key) {
+ attr[key] && attr.$observe(key, function(newValue, oldValue) {
+ scope[key] = $sce.trustAsHtml(newValue);
+ angular.isDefined(oldValue) && requestAnimationFrame(function() {
+ popover && popover.$applyPlacement();
+ });
+ });
+ });
+
+ // Support scope as an object
+ attr.bsPopover && scope.$watch(attr.bsPopover, function(newValue, oldValue) {
+ if(angular.isObject(newValue)) {
+ angular.extend(scope, newValue);
+ } else {
+ scope.content = newValue;
+ }
+ angular.isDefined(oldValue) && requestAnimationFrame(function() {
+ popover && popover.$applyPlacement();
+ });
+ }, true);
+
+ // Visibility binding support
+ attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {
+ if(!popover || !angular.isDefined(newValue)) return;
+ if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(popover),?/i);
+ newValue === true ? popover.show() : popover.hide();
+ });
+
+ // Initialize popover
+ var popover = $popover(element, options);
+
+ // Garbage collection
+ scope.$on('$destroy', function() {
+ if (popover) popover.destroy();
+ options = null;
+ popover = null;
+ });
+
+ }
+ };
+
+ }]);
+
+// Source: tooltip.js
+angular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])
+
+ .provider('$tooltip', function() {
+
+ var defaults = this.defaults = {
+ animation: 'am-fade',
+ customClass: '',
+ prefixClass: 'tooltip',
+ prefixEvent: 'tooltip',
+ container: false,
+ target: false,
+ placement: 'top',
+ template: 'tooltip/tooltip.tpl.html',
+ contentTemplate: false,
+ trigger: 'hover focus',
+ keyboard: false,
+ html: false,
+ show: false,
+ title: '',
+ type: '',
+ delay: 0,
+ autoClose: false,
+ bsEnabled: true
};
this.$get = ["$window", "$rootScope", "$compile", "$q", "$templateCache", "$http", "$animate", "$sce", "dimensions", "$$rAF", "$timeout", function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {
@@ -4175,174 +4294,345 @@ angular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])
}]);
-// Source: typeahead.js
-angular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])
+// Source: timepicker.js
+angular.module('mgcrea.ngStrap.timepicker', [
+ 'mgcrea.ngStrap.helpers.dateParser',
+ 'mgcrea.ngStrap.helpers.dateFormatter',
+ 'mgcrea.ngStrap.tooltip'])
- .provider('$typeahead', function() {
+ .provider('$timepicker', function() {
var defaults = this.defaults = {
animation: 'am-fade',
- prefixClass: 'typeahead',
- prefixEvent: '$typeahead',
+ prefixClass: 'timepicker',
placement: 'bottom-left',
- template: 'typeahead/typeahead.tpl.html',
+ template: 'timepicker/timepicker.tpl.html',
trigger: 'focus',
container: false,
keyboard: true,
html: false,
delay: 0,
- minLength: 1,
- filter: 'filter',
- limit: 6,
- comparator: ''
+ // lang: $locale.id,
+ useNative: true,
+ timeType: 'date',
+ timeFormat: 'shortTime',
+ modelTimeFormat: null,
+ autoclose: false,
+ minTime: -Infinity,
+ maxTime: +Infinity,
+ length: 5,
+ hourStep: 1,
+ minuteStep: 5,
+ iconUp: 'glyphicon glyphicon-chevron-up',
+ iconDown: 'glyphicon glyphicon-chevron-down',
+ arrowBehavior: 'pager'
};
- this.$get = ["$window", "$rootScope", "$tooltip", "$timeout", function($window, $rootScope, $tooltip, $timeout) {
+ this.$get = ["$window", "$document", "$rootScope", "$sce", "$dateFormatter", "$tooltip", "$timeout", function($window, $document, $rootScope, $sce, $dateFormatter, $tooltip, $timeout) {
var bodyEl = angular.element($window.document.body);
+ var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
+ var isTouch = ('createTouch' in $window.document) && isNative;
+ if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();
- function TypeaheadFactory(element, controller, config) {
-
- var $typeahead = {};
-
- // Common vars
- var options = angular.extend({}, defaults, config);
+ function timepickerFactory(element, controller, config) {
- $typeahead = $tooltip(element, options);
+ var $timepicker = $tooltip(element, angular.extend({}, defaults, config));
var parentScope = config.scope;
- var scope = $typeahead.$scope;
+ var options = $timepicker.$options;
+ var scope = $timepicker.$scope;
- scope.$resetMatches = function(){
- scope.$matches = [];
- scope.$activeIndex = 0;
+ var lang = options.lang;
+ var formatDate = function(date, format) {
+ return $dateFormatter.formatDate(date, format, lang);
};
- scope.$resetMatches();
- scope.$activate = function(index) {
- scope.$$postDigest(function() {
- $typeahead.activate(index);
- });
- };
+ // View vars
- scope.$select = function(index, evt) {
- scope.$$postDigest(function() {
- $typeahead.select(index);
- });
- };
+ var selectedIndex = 0;
+ var startDate = controller.$dateValue || new Date();
+ var viewDate = {hour: startDate.getHours(), meridian: startDate.getHours() < 12, minute: startDate.getMinutes(), second: startDate.getSeconds(), millisecond: startDate.getMilliseconds()};
- scope.$isVisible = function() {
- return $typeahead.$isVisible();
+ var format = $dateFormatter.getDatetimeFormat(options.timeFormat, lang);
+
+ var hoursFormat = $dateFormatter.hoursFormat(format),
+ timeSeparator = $dateFormatter.timeSeparator(format),
+ minutesFormat = $dateFormatter.minutesFormat(format),
+ showAM = $dateFormatter.showAM(format);
+
+ scope.$iconUp = options.iconUp;
+ scope.$iconDown = options.iconDown;
+
+ // Scope methods
+
+ scope.$select = function(date, index) {
+ $timepicker.select(date, index);
+ };
+ scope.$moveIndex = function(value, index) {
+ $timepicker.$moveIndex(value, index);
+ };
+ scope.$switchMeridian = function(date) {
+ $timepicker.switchMeridian(date);
};
// Public methods
- $typeahead.update = function(matches) {
- scope.$matches = matches;
- if(scope.$activeIndex >= matches.length) {
- scope.$activeIndex = 0;
+ $timepicker.update = function(date) {
+ // console.warn('$timepicker.update() newValue=%o', date);
+ if(angular.isDate(date) && !isNaN(date.getTime())) {
+ $timepicker.$date = date;
+ angular.extend(viewDate, {hour: date.getHours(), minute: date.getMinutes(), second: date.getSeconds(), millisecond: date.getMilliseconds()});
+ $timepicker.$build();
+ } else if(!$timepicker.$isBuilt) {
+ $timepicker.$build();
}
};
- $typeahead.activate = function(index) {
- scope.$activeIndex = index;
+ $timepicker.select = function(date, index, keep) {
+ // console.warn('$timepicker.select', date, scope.$mode);
+ if(!controller.$dateValue || isNaN(controller.$dateValue.getTime())) controller.$dateValue = new Date(1970, 0, 1);
+ if(!angular.isDate(date)) date = new Date(date);
+ if(index === 0) controller.$dateValue.setHours(date.getHours());
+ else if(index === 1) controller.$dateValue.setMinutes(date.getMinutes());
+ controller.$setViewValue(angular.copy(controller.$dateValue));
+ controller.$render();
+ if(options.autoclose && !keep) {
+ $timeout(function() { $timepicker.hide(true); });
+ }
};
- $typeahead.select = function(index) {
- var value = scope.$matches[index].value;
- // console.log('$setViewValue', value);
- controller.$setViewValue(value);
+ $timepicker.switchMeridian = function(date) {
+ if (!controller.$dateValue || isNaN(controller.$dateValue.getTime())) {
+ return;
+ }
+ var hours = (date || controller.$dateValue).getHours();
+ controller.$dateValue.setHours(hours < 12 ? hours + 12 : hours - 12);
+ controller.$setViewValue(angular.copy(controller.$dateValue));
controller.$render();
- scope.$resetMatches();
- if(parentScope) parentScope.$digest();
- // Emit event
- scope.$emit(options.prefixEvent + '.select', value, index);
};
// Protected methods
- $typeahead.$isVisible = function() {
- if(!options.minLength || !controller) {
- return !!scope.$matches.length;
+ $timepicker.$build = function() {
+ // console.warn('$timepicker.$build() viewDate=%o', viewDate);
+ var i, midIndex = scope.midIndex = parseInt(options.length / 2, 10);
+ var hours = [], hour;
+ for(i = 0; i < options.length; i++) {
+ hour = new Date(1970, 0, 1, viewDate.hour - (midIndex - i) * options.hourStep);
+ hours.push({date: hour, label: formatDate(hour, hoursFormat), selected: $timepicker.$date && $timepicker.$isSelected(hour, 0), disabled: $timepicker.$isDisabled(hour, 0)});
}
- // minLength support
- return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;
- };
-
- $typeahead.$getIndex = function(value) {
- var l = scope.$matches.length, i = l;
- if(!l) return;
- for(i = l; i--;) {
- if(scope.$matches[i].value === value) break;
+ var minutes = [], minute;
+ for(i = 0; i < options.length; i++) {
+ minute = new Date(1970, 0, 1, 0, viewDate.minute - (midIndex - i) * options.minuteStep);
+ minutes.push({date: minute, label: formatDate(minute, minutesFormat), selected: $timepicker.$date && $timepicker.$isSelected(minute, 1), disabled: $timepicker.$isDisabled(minute, 1)});
}
- if(i < 0) return;
- return i;
+
+ var rows = [];
+ for(i = 0; i < options.length; i++) {
+ rows.push([hours[i], minutes[i]]);
+ }
+ scope.rows = rows;
+ scope.showAM = showAM;
+ scope.isAM = ($timepicker.$date || hours[midIndex].date).getHours() < 12;
+ scope.timeSeparator = timeSeparator;
+ $timepicker.$isBuilt = true;
};
- $typeahead.$onMouseDown = function(evt) {
- // Prevent blur on mousedown
- evt.preventDefault();
- evt.stopPropagation();
+ $timepicker.$isSelected = function(date, index) {
+ if(!$timepicker.$date) return false;
+ else if(index === 0) {
+ return date.getHours() === $timepicker.$date.getHours();
+ } else if(index === 1) {
+ return date.getMinutes() === $timepicker.$date.getMinutes();
+ }
};
- $typeahead.$onKeyDown = function(evt) {
- if(!/(38|40|13)/.test(evt.keyCode)) return;
+ $timepicker.$isDisabled = function(date, index) {
+ var selectedTime;
+ if(index === 0) {
+ selectedTime = date.getTime() + viewDate.minute * 6e4;
+ } else if(index === 1) {
+ selectedTime = date.getTime() + viewDate.hour * 36e5;
+ }
+ return selectedTime < options.minTime * 1 || selectedTime > options.maxTime * 1;
+ };
- // Let ngSubmit pass if the typeahead tip is hidden
- if($typeahead.$isVisible()) {
- evt.preventDefault();
- evt.stopPropagation();
+ scope.$arrowAction = function (value, index) {
+ if (options.arrowBehavior === 'picker') {
+ $timepicker.$setTimeByStep(value,index);
+ } else {
+ $timepicker.$moveIndex(value,index);
}
+ };
- // Select with enter
- if(evt.keyCode === 13 && scope.$matches.length) {
- $typeahead.select(scope.$activeIndex);
+ $timepicker.$setTimeByStep = function(value, index) {
+ var newDate = new Date($timepicker.$date);
+ var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;
+ var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;
+ if (index === 0) {
+ newDate.setHours(hours - (parseInt(options.hourStep, 10) * value));
+ }
+ else {
+ newDate.setMinutes(minutes - (parseInt(options.minuteStep, 10) * value));
}
+ $timepicker.select(newDate, index, true);
+ };
+
+ $timepicker.$moveIndex = function(value, index) {
+ var targetDate;
+ if(index === 0) {
+ targetDate = new Date(1970, 0, 1, viewDate.hour + (value * options.length), viewDate.minute);
+ angular.extend(viewDate, {hour: targetDate.getHours()});
+ } else if(index === 1) {
+ targetDate = new Date(1970, 0, 1, viewDate.hour, viewDate.minute + (value * options.length * options.minuteStep));
+ angular.extend(viewDate, {minute: targetDate.getMinutes()});
+ }
+ $timepicker.$build();
+ };
+
+ $timepicker.$onMouseDown = function(evt) {
+ // Prevent blur on mousedown on .dropdown-menu
+ if(evt.target.nodeName.toLowerCase() !== 'input') evt.preventDefault();
+ evt.stopPropagation();
+ // Emulate click for mobile devices
+ if(isTouch) {
+ var targetEl = angular.element(evt.target);
+ if(targetEl[0].nodeName.toLowerCase() !== 'button') {
+ targetEl = targetEl.parent();
+ }
+ targetEl.triggerHandler('click');
+ }
+ };
+
+ $timepicker.$onKeyDown = function(evt) {
+ if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;
+ evt.preventDefault();
+ evt.stopPropagation();
+
+ // Close on enter
+ if(evt.keyCode === 13) return $timepicker.hide(true);
// Navigate with keyboard
- else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;
- else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;
- else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;
- scope.$digest();
+ var newDate = new Date($timepicker.$date);
+ var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;
+ var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;
+ var lateralMove = /(37|39)/.test(evt.keyCode);
+ var count = 2 + showAM * 1;
+
+ // Navigate indexes (left, right)
+ if (lateralMove) {
+ if(evt.keyCode === 37) selectedIndex = selectedIndex < 1 ? count - 1 : selectedIndex - 1;
+ else if(evt.keyCode === 39) selectedIndex = selectedIndex < count - 1 ? selectedIndex + 1 : 0;
+ }
+
+ // Update values (up, down)
+ var selectRange = [0, hoursLength];
+ if(selectedIndex === 0) {
+ if(evt.keyCode === 38) newDate.setHours(hours - parseInt(options.hourStep, 10));
+ else if(evt.keyCode === 40) newDate.setHours(hours + parseInt(options.hourStep, 10));
+ // re-calculate hours length because we have changed hours value
+ hoursLength = formatDate(newDate, hoursFormat).length;
+ selectRange = [0, hoursLength];
+ } else if(selectedIndex === 1) {
+ if(evt.keyCode === 38) newDate.setMinutes(minutes - parseInt(options.minuteStep, 10));
+ else if(evt.keyCode === 40) newDate.setMinutes(minutes + parseInt(options.minuteStep, 10));
+ // re-calculate minutes length because we have changes minutes value
+ minutesLength = formatDate(newDate, minutesFormat).length;
+ selectRange = [hoursLength + 1, hoursLength + 1 + minutesLength];
+ } else if(selectedIndex === 2) {
+ if(!lateralMove) $timepicker.switchMeridian();
+ selectRange = [hoursLength + 1 + minutesLength + 1, hoursLength + 1 + minutesLength + 3];
+ }
+ $timepicker.select(newDate, selectedIndex, true);
+ createSelection(selectRange[0], selectRange[1]);
+ parentScope.$digest();
};
+ // Private
+
+ function createSelection(start, end) {
+ if(element[0].createTextRange) {
+ var selRange = element[0].createTextRange();
+ selRange.collapse(true);
+ selRange.moveStart('character', start);
+ selRange.moveEnd('character', end);
+ selRange.select();
+ } else if(element[0].setSelectionRange) {
+ element[0].setSelectionRange(start, end);
+ } else if(angular.isUndefined(element[0].selectionStart)) {
+ element[0].selectionStart = start;
+ element[0].selectionEnd = end;
+ }
+ }
+
+ function focusElement() {
+ element[0].focus();
+ }
+
// Overrides
- var show = $typeahead.show;
- $typeahead.show = function() {
- show();
- // use timeout to hookup the events to prevent
- // event bubbling from being processed imediately.
+ var _init = $timepicker.init;
+ $timepicker.init = function() {
+ if(isNative && options.useNative) {
+ element.prop('type', 'time');
+ element.css('-webkit-appearance', 'textfield');
+ return;
+ } else if(isTouch) {
+ element.prop('type', 'text');
+ element.attr('readonly', 'true');
+ element.on('click', focusElement);
+ }
+ _init();
+ };
+
+ var _destroy = $timepicker.destroy;
+ $timepicker.destroy = function() {
+ if(isNative && options.useNative) {
+ element.off('click', focusElement);
+ }
+ _destroy();
+ };
+
+ var _show = $timepicker.show;
+ $timepicker.show = function() {
+ _show();
+ // use timeout to hookup the events to prevent
+ // event bubbling from being processed imediately.
$timeout(function() {
- $typeahead.$element.on('mousedown', $typeahead.$onMouseDown);
+ $timepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);
if(options.keyboard) {
- element.on('keydown', $typeahead.$onKeyDown);
+ element.on('keydown', $timepicker.$onKeyDown);
}
}, 0, false);
};
- var hide = $typeahead.hide;
- $typeahead.hide = function() {
- $typeahead.$element.off('mousedown', $typeahead.$onMouseDown);
+ var _hide = $timepicker.hide;
+ $timepicker.hide = function(blur) {
+ if(!$timepicker.$isShown) return;
+ $timepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);
if(options.keyboard) {
- element.off('keydown', $typeahead.$onKeyDown);
+ element.off('keydown', $timepicker.$onKeyDown);
}
- hide();
+ _hide(blur);
};
- return $typeahead;
+ return $timepicker;
}
- TypeaheadFactory.defaults = defaults;
- return TypeaheadFactory;
+ timepickerFactory.defaults = defaults;
+ return timepickerFactory;
}];
})
- .directive('bsTypeahead', ["$window", "$parse", "$q", "$typeahead", "$parseOptions", function($window, $parse, $q, $typeahead, $parseOptions) {
- var defaults = $typeahead.defaults;
+ .directive('bsTimepicker', ["$window", "$parse", "$q", "$dateFormatter", "$dateParser", "$timepicker", function($window, $parse, $q, $dateFormatter, $dateParser, $timepicker) {
+
+ var defaults = $timepicker.defaults;
+ var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
+ var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
return {
restrict: 'EAC',
@@ -4350,83 +4640,131 @@ angular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ng
link: function postLink(scope, element, attr, controller) {
// Directive options
- var options = {scope: scope};
- angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator'], function(key) {
+ var options = {scope: scope, controller: controller};
+ angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'timeType', 'timeFormat', 'modelTimeFormat', 'useNative', 'hourStep', 'minuteStep', 'length', 'arrowBehavior', 'iconUp', 'iconDown'], function(key) {
if(angular.isDefined(attr[key])) options[key] = attr[key];
});
- // Build proper ngOptions
- var filter = options.filter || defaults.filter;
- var limit = options.limit || defaults.limit;
- var comparator = options.comparator || defaults.comparator;
+ // Visibility binding support
+ attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {
+ if(!timepicker || !angular.isDefined(newValue)) return;
+ if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(timepicker),?/i);
+ newValue === true ? timepicker.show() : timepicker.hide();
+ });
- var ngOptions = attr.ngOptions;
- if(filter) ngOptions += ' | ' + filter + ':$viewValue';
- if (comparator) ngOptions += ':' + comparator;
- if(limit) ngOptions += ' | limitTo:' + limit;
- var parsedOptions = $parseOptions(ngOptions);
+ // Initialize timepicker
+ if(isNative && (options.useNative || defaults.useNative)) options.timeFormat = 'HH:mm';
+ var timepicker = $timepicker(element, controller, options);
+ options = timepicker.$options;
- // Initialize typeahead
- var typeahead = $typeahead(element, controller, options);
+ var lang = options.lang;
+ var formatDate = function(date, format) {
+ return $dateFormatter.formatDate(date, format, lang);
+ };
- // Watch options on demand
- if(options.watchOptions) {
- // Watch ngOptions values before filtering for changes, drop function calls
- var watchedOptions = parsedOptions.$match[7].replace(/\|.+/, '').replace(/\(.*\)/g, '').trim();
- scope.$watch(watchedOptions, function (newValue, oldValue) {
- // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);
- parsedOptions.valuesFn(scope, controller).then(function (values) {
- typeahead.update(values);
- controller.$render();
- });
- }, true);
- }
+ // Initialize parser
+ var dateParser = $dateParser({format: options.timeFormat, lang: lang});
+
+ // Observe attributes for changes
+ angular.forEach(['minTime', 'maxTime'], function(key) {
+ // console.warn('attr.$observe(%s)', key, attr[key]);
+ angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {
+ timepicker.$options[key] = dateParser.getTimeForAttribute(key, newValue);
+ !isNaN(timepicker.$options[key]) && timepicker.$build();
+ validateAgainstMinMaxTime(controller.$dateValue);
+ });
+ });
// Watch model for changes
scope.$watch(attr.ngModel, function(newValue, oldValue) {
- // console.warn('$watch', element.attr('ng-model'), newValue);
- scope.$modelValue = newValue; // Publish modelValue on scope for custom templates
- parsedOptions.valuesFn(scope, controller)
- .then(function(values) {
- // Prevent input with no future prospect if selectMode is truthy
- // @TODO test selectMode
- if(options.selectMode && !values.length && newValue.length > 0) {
- controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));
+ // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue, controller.$dateValue);
+ timepicker.update(controller.$dateValue);
+ }, true);
+
+ function validateAgainstMinMaxTime(parsedTime) {
+ if (!angular.isDate(parsedTime)) return;
+ var isMinValid = isNaN(options.minTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) >= options.minTime;
+ var isMaxValid = isNaN(options.maxTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) <= options.maxTime;
+ var isValid = isMinValid && isMaxValid;
+ controller.$setValidity('date', isValid);
+ controller.$setValidity('min', isMinValid);
+ controller.$setValidity('max', isMaxValid);
+ // Only update the model when we have a valid date
+ if(!isValid) {
return;
- }
- if(values.length > limit) values = values.slice(0, limit);
- var isVisible = typeahead.$isVisible();
- isVisible && typeahead.update(values);
- // Do not re-queue an update if a correct value has been selected
- if(values.length === 1 && values[0].value === newValue) return;
- !isVisible && typeahead.update(values);
- // Queue a new rendering that will leverage collection loading
- controller.$render();
- });
+ }
+ controller.$dateValue = parsedTime;
+ }
+
+ // viewValue -> $parsers -> modelValue
+ controller.$parsers.unshift(function(viewValue) {
+ // console.warn('$parser("%s"): viewValue=%o', element.attr('ng-model'), viewValue);
+ // Null values should correctly reset the model value & validity
+ if(!viewValue) {
+ // BREAKING CHANGE:
+ // return null (not undefined) when input value is empty, so angularjs 1.3
+ // ngModelController can go ahead and run validators, like ngRequired
+ controller.$setValidity('date', true);
+ return null;
+ }
+ var parsedTime = angular.isDate(viewValue) ? viewValue : dateParser.parse(viewValue, controller.$dateValue);
+ if(!parsedTime || isNaN(parsedTime.getTime())) {
+ controller.$setValidity('date', false);
+ // return undefined, causes ngModelController to
+ // invalidate model value
+ return;
+ } else {
+ validateAgainstMinMaxTime(parsedTime);
+ }
+ if(options.timeType === 'string') {
+ return formatDate(parsedTime, options.modelTimeFormat || options.timeFormat);
+ } else if(options.timeType === 'number') {
+ return controller.$dateValue.getTime();
+ } else if(options.timeType === 'unix') {
+ return controller.$dateValue.getTime() / 1000;
+ } else if(options.timeType === 'iso') {
+ return controller.$dateValue.toISOString();
+ } else {
+ return new Date(controller.$dateValue);
+ }
});
// modelValue -> $formatters -> viewValue
controller.$formatters.push(function(modelValue) {
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
- var displayValue = parsedOptions.displayValue(modelValue);
- return displayValue === undefined ? '' : displayValue;
+ var date;
+ if(angular.isUndefined(modelValue) || modelValue === null) {
+ date = NaN;
+ } else if(angular.isDate(modelValue)) {
+ date = modelValue;
+ } else if(options.timeType === 'string') {
+ date = dateParser.parse(modelValue, null, options.modelTimeFormat);
+ } else if(options.timeType === 'unix') {
+ date = new Date(modelValue * 1000);
+ } else {
+ date = new Date(modelValue);
+ }
+ // Setup default value?
+ // if(isNaN(date.getTime())) date = new Date(new Date().setMinutes(0) + 36e5);
+ controller.$dateValue = date;
+ return getTimeFormattedString();
});
- // Model rendering in view
- controller.$render = function () {
- // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);
- if(controller.$isEmpty(controller.$viewValue)) return element.val('');
- var index = typeahead.$getIndex(controller.$modelValue);
- var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;
- selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;
- element.val(selected ? selected.toString().replace(/<(?:.|\n)*?>/gm, '').trim() : '');
+ // viewValue -> element
+ controller.$render = function() {
+ // console.warn('$render("%s"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);
+ element.val(getTimeFormattedString());
};
+ function getTimeFormattedString() {
+ return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.timeFormat);
+ }
+
// Garbage collection
scope.$on('$destroy', function() {
- if (typeahead) typeahead.destroy();
+ if (timepicker) timepicker.destroy();
options = null;
- typeahead = null;
+ timepicker = null;
});
}
@@ -4434,345 +4772,174 @@ angular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ng
}]);
-// Source: timepicker.js
-angular.module('mgcrea.ngStrap.timepicker', [
- 'mgcrea.ngStrap.helpers.dateParser',
- 'mgcrea.ngStrap.helpers.dateFormatter',
- 'mgcrea.ngStrap.tooltip'])
+// Source: typeahead.js
+angular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])
- .provider('$timepicker', function() {
+ .provider('$typeahead', function() {
var defaults = this.defaults = {
animation: 'am-fade',
- prefixClass: 'timepicker',
+ prefixClass: 'typeahead',
+ prefixEvent: '$typeahead',
placement: 'bottom-left',
- template: 'timepicker/timepicker.tpl.html',
+ template: 'typeahead/typeahead.tpl.html',
trigger: 'focus',
container: false,
keyboard: true,
html: false,
delay: 0,
- // lang: $locale.id,
- useNative: true,
- timeType: 'date',
- timeFormat: 'shortTime',
- modelTimeFormat: null,
- autoclose: false,
- minTime: -Infinity,
- maxTime: +Infinity,
- length: 5,
- hourStep: 1,
- minuteStep: 5,
- iconUp: 'glyphicon glyphicon-chevron-up',
- iconDown: 'glyphicon glyphicon-chevron-down',
- arrowBehavior: 'pager'
+ minLength: 1,
+ filter: 'filter',
+ limit: 6,
+ comparator: ''
};
- this.$get = ["$window", "$document", "$rootScope", "$sce", "$dateFormatter", "$tooltip", "$timeout", function($window, $document, $rootScope, $sce, $dateFormatter, $tooltip, $timeout) {
+ this.$get = ["$window", "$rootScope", "$tooltip", "$timeout", function($window, $rootScope, $tooltip, $timeout) {
var bodyEl = angular.element($window.document.body);
- var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
- var isTouch = ('createTouch' in $window.document) && isNative;
- if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();
-
- function timepickerFactory(element, controller, config) {
-
- var $timepicker = $tooltip(element, angular.extend({}, defaults, config));
- var parentScope = config.scope;
- var options = $timepicker.$options;
- var scope = $timepicker.$scope;
-
- var lang = options.lang;
- var formatDate = function(date, format) {
- return $dateFormatter.formatDate(date, format, lang);
- };
-
- // View vars
-
- var selectedIndex = 0;
- var startDate = controller.$dateValue || new Date();
- var viewDate = {hour: startDate.getHours(), meridian: startDate.getHours() < 12, minute: startDate.getMinutes(), second: startDate.getSeconds(), millisecond: startDate.getMilliseconds()};
-
- var format = $dateFormatter.getDatetimeFormat(options.timeFormat, lang);
- var hoursFormat = $dateFormatter.hoursFormat(format),
- timeSeparator = $dateFormatter.timeSeparator(format),
- minutesFormat = $dateFormatter.minutesFormat(format),
- showAM = $dateFormatter.showAM(format);
-
- scope.$iconUp = options.iconUp;
- scope.$iconDown = options.iconDown;
-
- // Scope methods
-
- scope.$select = function(date, index) {
- $timepicker.select(date, index);
- };
- scope.$moveIndex = function(value, index) {
- $timepicker.$moveIndex(value, index);
- };
- scope.$switchMeridian = function(date) {
- $timepicker.switchMeridian(date);
- };
-
- // Public methods
-
- $timepicker.update = function(date) {
- // console.warn('$timepicker.update() newValue=%o', date);
- if(angular.isDate(date) && !isNaN(date.getTime())) {
- $timepicker.$date = date;
- angular.extend(viewDate, {hour: date.getHours(), minute: date.getMinutes(), second: date.getSeconds(), millisecond: date.getMilliseconds()});
- $timepicker.$build();
- } else if(!$timepicker.$isBuilt) {
- $timepicker.$build();
- }
- };
-
- $timepicker.select = function(date, index, keep) {
- // console.warn('$timepicker.select', date, scope.$mode);
- if(!controller.$dateValue || isNaN(controller.$dateValue.getTime())) controller.$dateValue = new Date(1970, 0, 1);
- if(!angular.isDate(date)) date = new Date(date);
- if(index === 0) controller.$dateValue.setHours(date.getHours());
- else if(index === 1) controller.$dateValue.setMinutes(date.getMinutes());
- controller.$setViewValue(angular.copy(controller.$dateValue));
- controller.$render();
- if(options.autoclose && !keep) {
- $timeout(function() { $timepicker.hide(true); });
- }
- };
+ function TypeaheadFactory(element, controller, config) {
- $timepicker.switchMeridian = function(date) {
- if (!controller.$dateValue || isNaN(controller.$dateValue.getTime())) {
- return;
- }
- var hours = (date || controller.$dateValue).getHours();
- controller.$dateValue.setHours(hours < 12 ? hours + 12 : hours - 12);
- controller.$setViewValue(angular.copy(controller.$dateValue));
- controller.$render();
- };
+ var $typeahead = {};
- // Protected methods
+ // Common vars
+ var options = angular.extend({}, defaults, config);
- $timepicker.$build = function() {
- // console.warn('$timepicker.$build() viewDate=%o', viewDate);
- var i, midIndex = scope.midIndex = parseInt(options.length / 2, 10);
- var hours = [], hour;
- for(i = 0; i < options.length; i++) {
- hour = new Date(1970, 0, 1, viewDate.hour - (midIndex - i) * options.hourStep);
- hours.push({date: hour, label: formatDate(hour, hoursFormat), selected: $timepicker.$date && $timepicker.$isSelected(hour, 0), disabled: $timepicker.$isDisabled(hour, 0)});
- }
- var minutes = [], minute;
- for(i = 0; i < options.length; i++) {
- minute = new Date(1970, 0, 1, 0, viewDate.minute - (midIndex - i) * options.minuteStep);
- minutes.push({date: minute, label: formatDate(minute, minutesFormat), selected: $timepicker.$date && $timepicker.$isSelected(minute, 1), disabled: $timepicker.$isDisabled(minute, 1)});
- }
+ $typeahead = $tooltip(element, options);
+ var parentScope = config.scope;
+ var scope = $typeahead.$scope;
- var rows = [];
- for(i = 0; i < options.length; i++) {
- rows.push([hours[i], minutes[i]]);
- }
- scope.rows = rows;
- scope.showAM = showAM;
- scope.isAM = ($timepicker.$date || hours[midIndex].date).getHours() < 12;
- scope.timeSeparator = timeSeparator;
- $timepicker.$isBuilt = true;
+ scope.$resetMatches = function(){
+ scope.$matches = [];
+ scope.$activeIndex = 0;
};
+ scope.$resetMatches();
- $timepicker.$isSelected = function(date, index) {
- if(!$timepicker.$date) return false;
- else if(index === 0) {
- return date.getHours() === $timepicker.$date.getHours();
- } else if(index === 1) {
- return date.getMinutes() === $timepicker.$date.getMinutes();
- }
+ scope.$activate = function(index) {
+ scope.$$postDigest(function() {
+ $typeahead.activate(index);
+ });
};
- $timepicker.$isDisabled = function(date, index) {
- var selectedTime;
- if(index === 0) {
- selectedTime = date.getTime() + viewDate.minute * 6e4;
- } else if(index === 1) {
- selectedTime = date.getTime() + viewDate.hour * 36e5;
- }
- return selectedTime < options.minTime * 1 || selectedTime > options.maxTime * 1;
+ scope.$select = function(index, evt) {
+ scope.$$postDigest(function() {
+ $typeahead.select(index);
+ });
};
- scope.$arrowAction = function (value, index) {
- if (options.arrowBehavior === 'picker') {
- $timepicker.$setTimeByStep(value,index);
- } else {
- $timepicker.$moveIndex(value,index);
- }
+ scope.$isVisible = function() {
+ return $typeahead.$isVisible();
};
- $timepicker.$setTimeByStep = function(value, index) {
- var newDate = new Date($timepicker.$date);
- var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;
- var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;
- if (index === 0) {
- newDate.setHours(hours - (parseInt(options.hourStep, 10) * value));
- }
- else {
- newDate.setMinutes(minutes - (parseInt(options.minuteStep, 10) * value));
- }
- $timepicker.select(newDate, index, true);
- };
+ // Public methods
- $timepicker.$moveIndex = function(value, index) {
- var targetDate;
- if(index === 0) {
- targetDate = new Date(1970, 0, 1, viewDate.hour + (value * options.length), viewDate.minute);
- angular.extend(viewDate, {hour: targetDate.getHours()});
- } else if(index === 1) {
- targetDate = new Date(1970, 0, 1, viewDate.hour, viewDate.minute + (value * options.length * options.minuteStep));
- angular.extend(viewDate, {minute: targetDate.getMinutes()});
+ $typeahead.update = function(matches) {
+ scope.$matches = matches;
+ if(scope.$activeIndex >= matches.length) {
+ scope.$activeIndex = 0;
}
- $timepicker.$build();
};
- $timepicker.$onMouseDown = function(evt) {
- // Prevent blur on mousedown on .dropdown-menu
- if(evt.target.nodeName.toLowerCase() !== 'input') evt.preventDefault();
- evt.stopPropagation();
- // Emulate click for mobile devices
- if(isTouch) {
- var targetEl = angular.element(evt.target);
- if(targetEl[0].nodeName.toLowerCase() !== 'button') {
- targetEl = targetEl.parent();
- }
- targetEl.triggerHandler('click');
- }
+ $typeahead.activate = function(index) {
+ scope.$activeIndex = index;
};
- $timepicker.$onKeyDown = function(evt) {
- if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;
- evt.preventDefault();
- evt.stopPropagation();
-
- // Close on enter
- if(evt.keyCode === 13) return $timepicker.hide(true);
-
- // Navigate with keyboard
- var newDate = new Date($timepicker.$date);
- var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;
- var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;
- var lateralMove = /(37|39)/.test(evt.keyCode);
- var count = 2 + showAM * 1;
-
- // Navigate indexes (left, right)
- if (lateralMove) {
- if(evt.keyCode === 37) selectedIndex = selectedIndex < 1 ? count - 1 : selectedIndex - 1;
- else if(evt.keyCode === 39) selectedIndex = selectedIndex < count - 1 ? selectedIndex + 1 : 0;
- }
-
- // Update values (up, down)
- var selectRange = [0, hoursLength];
- if(selectedIndex === 0) {
- if(evt.keyCode === 38) newDate.setHours(hours - parseInt(options.hourStep, 10));
- else if(evt.keyCode === 40) newDate.setHours(hours + parseInt(options.hourStep, 10));
- // re-calculate hours length because we have changed hours value
- hoursLength = formatDate(newDate, hoursFormat).length;
- selectRange = [0, hoursLength];
- } else if(selectedIndex === 1) {
- if(evt.keyCode === 38) newDate.setMinutes(minutes - parseInt(options.minuteStep, 10));
- else if(evt.keyCode === 40) newDate.setMinutes(minutes + parseInt(options.minuteStep, 10));
- // re-calculate minutes length because we have changes minutes value
- minutesLength = formatDate(newDate, minutesFormat).length;
- selectRange = [hoursLength + 1, hoursLength + 1 + minutesLength];
- } else if(selectedIndex === 2) {
- if(!lateralMove) $timepicker.switchMeridian();
- selectRange = [hoursLength + 1 + minutesLength + 1, hoursLength + 1 + minutesLength + 3];
- }
- $timepicker.select(newDate, selectedIndex, true);
- createSelection(selectRange[0], selectRange[1]);
- parentScope.$digest();
+ $typeahead.select = function(index) {
+ var value = scope.$matches[index].value;
+ // console.log('$setViewValue', value);
+ controller.$setViewValue(value);
+ controller.$render();
+ scope.$resetMatches();
+ if(parentScope) parentScope.$digest();
+ // Emit event
+ scope.$emit(options.prefixEvent + '.select', value, index);
};
- // Private
+ // Protected methods
- function createSelection(start, end) {
- if(element[0].createTextRange) {
- var selRange = element[0].createTextRange();
- selRange.collapse(true);
- selRange.moveStart('character', start);
- selRange.moveEnd('character', end);
- selRange.select();
- } else if(element[0].setSelectionRange) {
- element[0].setSelectionRange(start, end);
- } else if(angular.isUndefined(element[0].selectionStart)) {
- element[0].selectionStart = start;
- element[0].selectionEnd = end;
+ $typeahead.$isVisible = function() {
+ if(!options.minLength || !controller) {
+ return !!scope.$matches.length;
}
- }
+ // minLength support
+ return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;
+ };
- function focusElement() {
- element[0].focus();
- }
+ $typeahead.$getIndex = function(value) {
+ var l = scope.$matches.length, i = l;
+ if(!l) return;
+ for(i = l; i--;) {
+ if(scope.$matches[i].value === value) break;
+ }
+ if(i < 0) return;
+ return i;
+ };
- // Overrides
+ $typeahead.$onMouseDown = function(evt) {
+ // Prevent blur on mousedown
+ evt.preventDefault();
+ evt.stopPropagation();
+ };
- var _init = $timepicker.init;
- $timepicker.init = function() {
- if(isNative && options.useNative) {
- element.prop('type', 'time');
- element.css('-webkit-appearance', 'textfield');
- return;
- } else if(isTouch) {
- element.prop('type', 'text');
- element.attr('readonly', 'true');
- element.on('click', focusElement);
+ $typeahead.$onKeyDown = function(evt) {
+ if(!/(38|40|13)/.test(evt.keyCode)) return;
+
+ // Let ngSubmit pass if the typeahead tip is hidden
+ if($typeahead.$isVisible()) {
+ evt.preventDefault();
+ evt.stopPropagation();
}
- _init();
- };
- var _destroy = $timepicker.destroy;
- $timepicker.destroy = function() {
- if(isNative && options.useNative) {
- element.off('click', focusElement);
+ // Select with enter
+ if(evt.keyCode === 13 && scope.$matches.length) {
+ $typeahead.select(scope.$activeIndex);
}
- _destroy();
+
+ // Navigate with keyboard
+ else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;
+ else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;
+ else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;
+ scope.$digest();
};
- var _show = $timepicker.show;
- $timepicker.show = function() {
- _show();
- // use timeout to hookup the events to prevent
- // event bubbling from being processed imediately.
+ // Overrides
+
+ var show = $typeahead.show;
+ $typeahead.show = function() {
+ show();
+ // use timeout to hookup the events to prevent
+ // event bubbling from being processed imediately.
$timeout(function() {
- $timepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);
+ $typeahead.$element.on('mousedown', $typeahead.$onMouseDown);
if(options.keyboard) {
- element.on('keydown', $timepicker.$onKeyDown);
+ element.on('keydown', $typeahead.$onKeyDown);
}
}, 0, false);
};
- var _hide = $timepicker.hide;
- $timepicker.hide = function(blur) {
- if(!$timepicker.$isShown) return;
- $timepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);
+ var hide = $typeahead.hide;
+ $typeahead.hide = function() {
+ $typeahead.$element.off('mousedown', $typeahead.$onMouseDown);
if(options.keyboard) {
- element.off('keydown', $timepicker.$onKeyDown);
+ element.off('keydown', $typeahead.$onKeyDown);
}
- _hide(blur);
+ hide();
};
- return $timepicker;
+ return $typeahead;
}
- timepickerFactory.defaults = defaults;
- return timepickerFactory;
+ TypeaheadFactory.defaults = defaults;
+ return TypeaheadFactory;
}];
})
+ .directive('bsTypeahead', ["$window", "$parse", "$q", "$typeahead", "$parseOptions", function($window, $parse, $q, $typeahead, $parseOptions) {
- .directive('bsTimepicker', ["$window", "$parse", "$q", "$dateFormatter", "$dateParser", "$timepicker", function($window, $parse, $q, $dateFormatter, $dateParser, $timepicker) {
-
- var defaults = $timepicker.defaults;
- var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
- var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
+ var defaults = $typeahead.defaults;
return {
restrict: 'EAC',
@@ -4780,131 +4947,83 @@ angular.module('mgcrea.ngStrap.timepicker', [
link: function postLink(scope, element, attr, controller) {
// Directive options
- var options = {scope: scope, controller: controller};
- angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'timeType', 'timeFormat', 'modelTimeFormat', 'useNative', 'hourStep', 'minuteStep', 'length', 'arrowBehavior', 'iconUp', 'iconDown'], function(key) {
+ var options = {scope: scope};
+ angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator'], function(key) {
if(angular.isDefined(attr[key])) options[key] = attr[key];
});
- // Visibility binding support
- attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {
- if(!timepicker || !angular.isDefined(newValue)) return;
- if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(timepicker),?/i);
- newValue === true ? timepicker.show() : timepicker.hide();
- });
-
- // Initialize timepicker
- if(isNative && (options.useNative || defaults.useNative)) options.timeFormat = 'HH:mm';
- var timepicker = $timepicker(element, controller, options);
- options = timepicker.$options;
+ // Build proper ngOptions
+ var filter = options.filter || defaults.filter;
+ var limit = options.limit || defaults.limit;
+ var comparator = options.comparator || defaults.comparator;
- var lang = options.lang;
- var formatDate = function(date, format) {
- return $dateFormatter.formatDate(date, format, lang);
- };
+ var ngOptions = attr.ngOptions;
+ if(filter) ngOptions += ' | ' + filter + ':$viewValue';
+ if (comparator) ngOptions += ':' + comparator;
+ if(limit) ngOptions += ' | limitTo:' + limit;
+ var parsedOptions = $parseOptions(ngOptions);
- // Initialize parser
- var dateParser = $dateParser({format: options.timeFormat, lang: lang});
+ // Initialize typeahead
+ var typeahead = $typeahead(element, controller, options);
- // Observe attributes for changes
- angular.forEach(['minTime', 'maxTime'], function(key) {
- // console.warn('attr.$observe(%s)', key, attr[key]);
- angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {
- timepicker.$options[key] = dateParser.getTimeForAttribute(key, newValue);
- !isNaN(timepicker.$options[key]) && timepicker.$build();
- validateAgainstMinMaxTime(controller.$dateValue);
- });
- });
+ // Watch options on demand
+ if(options.watchOptions) {
+ // Watch ngOptions values before filtering for changes, drop function calls
+ var watchedOptions = parsedOptions.$match[7].replace(/\|.+/, '').replace(/\(.*\)/g, '').trim();
+ scope.$watch(watchedOptions, function (newValue, oldValue) {
+ // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);
+ parsedOptions.valuesFn(scope, controller).then(function (values) {
+ typeahead.update(values);
+ controller.$render();
+ });
+ }, true);
+ }
// Watch model for changes
scope.$watch(attr.ngModel, function(newValue, oldValue) {
- // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue, controller.$dateValue);
- timepicker.update(controller.$dateValue);
- }, true);
-
- function validateAgainstMinMaxTime(parsedTime) {
- if (!angular.isDate(parsedTime)) return;
- var isMinValid = isNaN(options.minTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) >= options.minTime;
- var isMaxValid = isNaN(options.maxTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) <= options.maxTime;
- var isValid = isMinValid && isMaxValid;
- controller.$setValidity('date', isValid);
- controller.$setValidity('min', isMinValid);
- controller.$setValidity('max', isMaxValid);
- // Only update the model when we have a valid date
- if(!isValid) {
+ // console.warn('$watch', element.attr('ng-model'), newValue);
+ scope.$modelValue = newValue; // Publish modelValue on scope for custom templates
+ parsedOptions.valuesFn(scope, controller)
+ .then(function(values) {
+ // Prevent input with no future prospect if selectMode is truthy
+ // @TODO test selectMode
+ if(options.selectMode && !values.length && newValue.length > 0) {
+ controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));
return;
- }
- controller.$dateValue = parsedTime;
- }
-
- // viewValue -> $parsers -> modelValue
- controller.$parsers.unshift(function(viewValue) {
- // console.warn('$parser("%s"): viewValue=%o', element.attr('ng-model'), viewValue);
- // Null values should correctly reset the model value & validity
- if(!viewValue) {
- // BREAKING CHANGE:
- // return null (not undefined) when input value is empty, so angularjs 1.3
- // ngModelController can go ahead and run validators, like ngRequired
- controller.$setValidity('date', true);
- return null;
- }
- var parsedTime = angular.isDate(viewValue) ? viewValue : dateParser.parse(viewValue, controller.$dateValue);
- if(!parsedTime || isNaN(parsedTime.getTime())) {
- controller.$setValidity('date', false);
- // return undefined, causes ngModelController to
- // invalidate model value
- return;
- } else {
- validateAgainstMinMaxTime(parsedTime);
- }
- if(options.timeType === 'string') {
- return formatDate(parsedTime, options.modelTimeFormat || options.timeFormat);
- } else if(options.timeType === 'number') {
- return controller.$dateValue.getTime();
- } else if(options.timeType === 'unix') {
- return controller.$dateValue.getTime() / 1000;
- } else if(options.timeType === 'iso') {
- return controller.$dateValue.toISOString();
- } else {
- return new Date(controller.$dateValue);
- }
+ }
+ if(values.length > limit) values = values.slice(0, limit);
+ var isVisible = typeahead.$isVisible();
+ isVisible && typeahead.update(values);
+ // Do not re-queue an update if a correct value has been selected
+ if(values.length === 1 && values[0].value === newValue) return;
+ !isVisible && typeahead.update(values);
+ // Queue a new rendering that will leverage collection loading
+ controller.$render();
+ });
});
// modelValue -> $formatters -> viewValue
controller.$formatters.push(function(modelValue) {
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
- var date;
- if(angular.isUndefined(modelValue) || modelValue === null) {
- date = NaN;
- } else if(angular.isDate(modelValue)) {
- date = modelValue;
- } else if(options.timeType === 'string') {
- date = dateParser.parse(modelValue, null, options.modelTimeFormat);
- } else if(options.timeType === 'unix') {
- date = new Date(modelValue * 1000);
- } else {
- date = new Date(modelValue);
- }
- // Setup default value?
- // if(isNaN(date.getTime())) date = new Date(new Date().setMinutes(0) + 36e5);
- controller.$dateValue = date;
- return getTimeFormattedString();
+ var displayValue = parsedOptions.displayValue(modelValue);
+ return displayValue === undefined ? '' : displayValue;
});
- // viewValue -> element
- controller.$render = function() {
- // console.warn('$render("%s"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);
- element.val(getTimeFormattedString());
+ // Model rendering in view
+ controller.$render = function () {
+ // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);
+ if(controller.$isEmpty(controller.$viewValue)) return element.val('');
+ var index = typeahead.$getIndex(controller.$modelValue);
+ var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;
+ selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;
+ element.val(selected ? selected.toString().replace(/<(?:.|\n)*?>/gm, '').trim() : '');
};
- function getTimeFormattedString() {
- return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.timeFormat);
- }
-
// Garbage collection
scope.$on('$destroy', function() {
- if (timepicker) timepicker.destroy();
+ if (typeahead) typeahead.destroy();
options = null;
- timepicker = null;
+ typeahead = null;
});
}
diff --git a/dist/angular-strap.min.js b/dist/angular-strap.min.js
index fbbc2cf1f..07d2617b9 100644
--- a/dist/angular-strap.min.js
+++ b/dist/angular-strap.min.js
@@ -1,11 +1,11 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
-!function(e,t,n){"use strict";angular.module("mgcrea.ngStrap",["mgcrea.ngStrap.modal","mgcrea.ngStrap.aside","mgcrea.ngStrap.alert","mgcrea.ngStrap.button","mgcrea.ngStrap.select","mgcrea.ngStrap.datepicker","mgcrea.ngStrap.timepicker","mgcrea.ngStrap.navbar","mgcrea.ngStrap.tooltip","mgcrea.ngStrap.popover","mgcrea.ngStrap.dropdown","mgcrea.ngStrap.typeahead","mgcrea.ngStrap.scrollspy","mgcrea.ngStrap.affix","mgcrea.ngStrap.tab","mgcrea.ngStrap.collapse"]),angular.module("mgcrea.ngStrap.affix",["mgcrea.ngStrap.helpers.dimensions","mgcrea.ngStrap.helpers.debounce"]).provider("$affix",function(){var e=this.defaults={offsetTop:"auto"};this.$get=["$window","debounce","dimensions",function(t,n,a){function o(o,s){function l(e,t,n){var a=u(),o=c();return v>=a?"top":null!==e&&a+e<=t.top?"middle":null!==y&&t.top+n+$>=o-y?"bottom":"middle"}function u(){return p[0]===t?t.pageYOffset:p[0].scrollTop}function c(){return p[0]===t?t.document.body.scrollHeight:p[0].scrollHeight}var d={},f=angular.extend({},e,s),p=f.target,g="affix affix-top affix-bottom",m=!1,$=0,h=0,v=0,y=0,w=null,b=null,D=o.parent();if(f.offsetParent)if(f.offsetParent.match(/^\d+$/))for(var k=0;k<1*f.offsetParent-1;k++)D=D.parent();else D=angular.element(f.offsetParent);return d.init=function(){this.$parseOffsets(),h=a.offset(o[0]).top+$,m=!o[0].style.width,p.on("scroll",this.checkPosition),p.on("click",this.checkPositionWithEventLoop),r.on("resize",this.$debouncedOnResize),this.checkPosition(),this.checkPositionWithEventLoop()},d.destroy=function(){p.off("scroll",this.checkPosition),p.off("click",this.checkPositionWithEventLoop),r.off("resize",this.$debouncedOnResize)},d.checkPositionWithEventLoop=function(){setTimeout(d.checkPosition,1)},d.checkPosition=function(){var e=u(),t=a.offset(o[0]),n=a.height(o[0]),r=l(b,t,n);w!==r&&(w=r,o.removeClass(g).addClass("affix"+("middle"!==r?"-"+r:"")),"top"===r?(b=null,o.css("position",f.offsetParent?"":"relative"),m&&o.css("width",""),o.css("top","")):"bottom"===r?(b=f.offsetUnpin?-(1*f.offsetUnpin):t.top-e,m&&o.css("width",""),o.css("position",f.offsetParent?"":"relative"),o.css("top",f.offsetParent?"":i[0].offsetHeight-y-n-h+"px")):(b=null,m&&o.css("width",o[0].offsetWidth+"px"),o.css("position","fixed"),o.css("top",$+"px")))},d.$onResize=function(){d.$parseOffsets(),d.checkPosition()},d.$debouncedOnResize=n(d.$onResize,50),d.$parseOffsets=function(){var e=o.css("position");o.css("position",f.offsetParent?"":"relative"),f.offsetTop&&("auto"===f.offsetTop&&(f.offsetTop="+0"),f.offsetTop.match(/^[-+]\d+$/)?($=1*-f.offsetTop,v=f.offsetParent?a.offset(D[0]).top+1*f.offsetTop:a.offset(o[0]).top-a.css(o[0],"marginTop",!0)+1*f.offsetTop):v=1*f.offsetTop),f.offsetBottom&&(y=f.offsetParent&&f.offsetBottom.match(/^[-+]\d+$/)?c()-(a.offset(D[0]).top+a.height(D[0]))+1*f.offsetBottom+1:1*f.offsetBottom),o.css("position",e)},d.init(),d}var i=angular.element(t.document.body),r=angular.element(t);return o}]}).directive("bsAffix",["$affix","$window",function(e,t){return{restrict:"EAC",require:"^?bsAffixTarget",link:function(n,a,o,i){var r={scope:n,offsetTop:"auto",target:i?i.$element:angular.element(t)};angular.forEach(["offsetTop","offsetBottom","offsetParent","offsetUnpin"],function(e){angular.isDefined(o[e])&&(r[e]=o[e])});var s=e(a,r);n.$on("$destroy",function(){s&&s.destroy(),r=null,s=null})}}}]).directive("bsAffixTarget",function(){return{controller:["$element",function(e){this.$element=e}]}}),angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var e=this.defaults={animation:"am-fade",prefixClass:"alert",prefixEvent:"alert",placement:null,template:"alert/alert.tpl.html",container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=["$modal","$timeout",function(t,n){function a(a){var o={},i=angular.extend({},e,a);o=t(i),o.$scope.dismissable=!!i.dismissable,i.type&&(o.$scope.type=i.type);var r=o.show;return i.duration&&(o.show=function(){r(),n(function(){o.hide()},1e3*i.duration)}),o}return a}]}).directive("bsAlert",["$window","$sce","$alert",function(e,t,n){e.requestAnimationFrame||e.setTimeout;return{restrict:"EAC",scope:!0,link:function(e,a,o){var i={scope:e,element:a,show:!1};angular.forEach(["template","placement","keyboard","html","container","animation","duration","dismissable"],function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),angular.forEach(["title","content","type"],function(n){o[n]&&o.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),o.bsAlert&&e.$watch(o.bsAlert,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var r=n(i);a.on(o.trigger||"click",r.toggle),e.$on("$destroy",function(){r&&r.destroy(),i=null,r=null})}}}]),angular.module("mgcrea.ngStrap.aside",["mgcrea.ngStrap.modal"]).provider("$aside",function(){var e=this.defaults={animation:"am-fade-and-slide-right",prefixClass:"aside",prefixEvent:"aside",placement:"right",template:"aside/aside.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$modal",function(t){function n(n){var a={},o=angular.extend({},e,n);return a=t(o)}return n}]}).directive("bsAside",["$window","$sce","$aside",function(e,t,n){e.requestAnimationFrame||e.setTimeout;return{restrict:"EAC",scope:!0,link:function(e,a,o){var i={scope:e,element:a,show:!1};angular.forEach(["template","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),angular.forEach(["title","content"],function(n){o[n]&&o.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),o.bsAside&&e.$watch(o.bsAside,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var r=n(i);a.on(o.trigger||"click",r.toggle),e.$on("$destroy",function(){r&&r.destroy(),i=null,r=null})}}}]),angular.module("mgcrea.ngStrap.button",[]).provider("$button",function(){var e=this.defaults={activeClass:"active",toggleEvent:"click"};this.$get=function(){return{defaults:e}}}).directive("bsCheckboxGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var n=e[0].querySelectorAll('input[type="checkbox"]');angular.forEach(n,function(e){var n=angular.element(e);n.attr("bs-checkbox",""),n.attr("ng-model",t.ngModel+"."+n.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function(e,t){var n=e.defaults,a=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,o,i,r){var s=n,l="INPUT"===o[0].nodeName,u=l?o.parent():o,c=angular.isDefined(i.trueValue)?i.trueValue:!0;a.test(i.trueValue)&&(c=e.$eval(i.trueValue));var d=angular.isDefined(i.falseValue)?i.falseValue:!1;a.test(i.falseValue)&&(d=e.$eval(i.falseValue));var f="boolean"!=typeof c||"boolean"!=typeof d;f&&(r.$parsers.push(function(e){return e?c:d}),r.$formatters.push(function(e){return angular.equals(e,c)}),e.$watch(i.ngModel,function(){r.$render()})),r.$render=function(){var e=angular.equals(r.$modelValue,c);t(function(){l&&(o[0].checked=e),u.toggleClass(s.activeClass,e)})},o.bind(s.toggleEvent,function(){e.$apply(function(){l||r.$setViewValue(!u.hasClass("active")),f||r.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var n=e[0].querySelectorAll('input[type="radio"]');angular.forEach(n,function(e){angular.element(e).attr("bs-radio",""),angular.element(e).attr("ng-model",t.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function(e,t){var n=e.defaults,a=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,o,i,r){var s=n,l="INPUT"===o[0].nodeName,u=l?o.parent():o,c=a.test(i.value)?e.$eval(i.value):i.value;r.$render=function(){var e=angular.equals(r.$modelValue,c);t(function(){l&&(o[0].checked=e),u.toggleClass(s.activeClass,e)})},o.bind(s.toggleEvent,function(){e.$apply(function(){r.$setViewValue(c),r.$render()})})}}}]),angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var e=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1},t=this.controller=function(t,n,a){var o=this;o.$options=angular.copy(e),angular.forEach(["animation","disallowToggle","activeClass","startCollapsed"],function(e){angular.isDefined(a[e])&&(o.$options[e]=a[e])}),o.$toggles=[],o.$targets=[],o.$viewChangeListeners=[],o.$registerToggle=function(e){o.$toggles.push(e)},o.$registerTarget=function(e){o.$targets.push(e)},o.$unregisterToggle=function(e){var t=o.$toggles.indexOf(e);o.$toggles.splice(t,1)},o.$unregisterTarget=function(e){var t=o.$targets.indexOf(e),n=o.$targets.$active;o.$targets.splice(t,1),n>t?n--:t===n&&n===o.$targets.length&&n--,o.$setActive(n)},o.$targets.$active=o.$options.startCollapsed?-1:0,o.$setActive=t.$setActive=function(e){o.$targets.$active=o.$options.disallowToggle?e:o.$targets.$active===e?-1:e,o.$viewChangeListeners.forEach(function(e){e()})}};this.$get=function(){var n={};return n.defaults=e,n.controller=t,n}}).directive("bsCollapse",["$window","$animate","$collapse",function(e,t,n){n.defaults;return{require:["?ngModel","bsCollapse"],controller:["$scope","$element","$attrs",n.controller],link:function(e,t,n,a){var o=a[0],i=a[1];o&&(i.$viewChangeListeners.push(function(){o.$setViewValue(i.$targets.$active)}),o.$formatters.push(function(e){return i.$targets.$active!==1*e&&i.$setActive(1*e),e}))}}}]).directive("bsCollapseToggle",function(){return{require:["^?ngModel","^bsCollapse"],link:function(e,t,n,a){var o=(a[0],a[1]);t.attr("data-toggle","collapse"),o.$registerToggle(t),e.$on("$destroy",function(){o.$unregisterToggle(t)}),t.on("click",function(){var a=n.bsCollapseToggle||o.$toggles.indexOf(t);o.$setActive(1*a),e.$apply()})}}}).directive("bsCollapseTarget",["$animate",function(e){return{require:["^?ngModel","^bsCollapse"],link:function(t,n,a,o){function i(){var t=r.$targets.indexOf(n),a=r.$targets.$active;e[t===a?"addClass":"removeClass"](n,r.$options.activeClass)}var r=(o[0],o[1]);n.addClass("collapse"),r.$options.animation&&n.addClass(r.$options.animation),r.$registerTarget(n),t.$on("$destroy",function(){r.$unregisterTarget(n)}),r.$viewChangeListeners.push(function(){i()}),i()}}}]),angular.module("mgcrea.ngStrap.datepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$datepicker",function(){var e=this.defaults={animation:"am-fade",prefixClass:"datepicker",placement:"bottom-left",template:"datepicker/datepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!1,dateType:"date",dateFormat:"shortDate",modelDateFormat:null,dayFormat:"dd",monthFormat:"MMM",yearFormat:"yyyy",monthTitleFormat:"MMMM yyyy",yearTitleFormat:"yyyy",strictFormat:!1,autoclose:!1,minDate:-1/0,maxDate:+1/0,startView:0,minView:0,startWeek:0,daysOfWeekDisabled:"",iconLeft:"glyphicon glyphicon-chevron-left",iconRight:"glyphicon glyphicon-chevron-right"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","datepickerViews","$tooltip","$timeout",function(t,n,a,o,i,r,s,l){function u(t,n,a){function o(e){e.selected=u.$isSelected(e.date)}function i(){t[0].focus()}var u=s(t,angular.extend({},e,a)),f=a.scope,p=u.$options,g=u.$scope;p.startView&&(p.startView-=p.minView);var m=r(u);u.$views=m.views;var $=m.viewDate;g.$mode=p.startView,g.$iconLeft=p.iconLeft,g.$iconRight=p.iconRight;var h=u.$views[g.$mode];g.$select=function(e){u.select(e)},g.$selectPane=function(e){u.$selectPane(e)},g.$toggleMode=function(){u.setMode((g.$mode+1)%u.$views.length)},u.update=function(e){angular.isDate(e)&&!isNaN(e.getTime())&&(u.$date=e,h.update.call(h,e)),u.$build(!0)},u.updateDisabledDates=function(e){p.disabledDateRanges=e;for(var t=0,n=g.rows.length;n>t;t++)angular.forEach(g.rows[t],u.$setDisabledEl)},u.select=function(e,t){angular.isDate(n.$dateValue)||(n.$dateValue=new Date(e)),!g.$mode||t?(n.$setViewValue(angular.copy(e)),n.$render(),p.autoclose&&!t&&l(function(){u.hide(!0)})):(angular.extend($,{year:e.getFullYear(),month:e.getMonth(),date:e.getDate()}),u.setMode(g.$mode-1),u.$build())},u.setMode=function(e){g.$mode=e,h=u.$views[g.$mode],u.$build()},u.$build=function(e){e===!0&&h.built||(e!==!1||h.built)&&h.build.call(h)},u.$updateSelected=function(){for(var e=0,t=g.rows.length;t>e;e++)angular.forEach(g.rows[e],o)},u.$isSelected=function(e){return h.isSelected(e)},u.$setDisabledEl=function(e){e.disabled=h.isDisabled(e.date)},u.$selectPane=function(e){var t=h.steps,n=new Date(Date.UTC($.year+(t.year||0)*e,$.month+(t.month||0)*e,1));angular.extend($,{year:n.getUTCFullYear(),month:n.getUTCMonth(),date:n.getUTCDate()}),u.$build()},u.$onMouseDown=function(e){if(e.preventDefault(),e.stopPropagation(),d){var t=angular.element(e.target);"button"!==t[0].nodeName.toLowerCase()&&(t=t.parent()),t.triggerHandler("click")}},u.$onKeyDown=function(e){if(/(38|37|39|40|13)/.test(e.keyCode)&&!e.shiftKey&&!e.altKey){if(e.preventDefault(),e.stopPropagation(),13===e.keyCode)return g.$mode?g.$apply(function(){u.setMode(g.$mode-1)}):u.hide(!0);h.onKeyDown(e),f.$digest()}};var v=u.init;u.init=function(){return c&&p.useNative?(t.prop("type","date"),void t.css("-webkit-appearance","textfield")):(d&&(t.prop("type","text"),t.attr("readonly","true"),t.on("click",i)),void v())};var y=u.destroy;u.destroy=function(){c&&p.useNative&&t.off("click",i),y()};var w=u.show;u.show=function(){w(),l(function(){u.$element.on(d?"touchstart":"mousedown",u.$onMouseDown),p.keyboard&&t.on("keydown",u.$onKeyDown)},0,!1)};var b=u.hide;return u.hide=function(e){u.$isShown&&(u.$element.off(d?"touchstart":"mousedown",u.$onMouseDown),p.keyboard&&t.off("keydown",u.$onKeyDown),b(e))},u}var c=(angular.element(t.document.body),/(ip(a|o)d|iphone|android)/gi.test(t.navigator.userAgent)),d="createTouch"in t.document&&c;return e.lang||(e.lang=i.getDefaultLocale()),u.defaults=e,u}]}).directive("bsDatepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$datepicker",function(e,t,n,a,o,i){var r=(i.defaults,/(ip(a|o)d|iphone|android)/gi.test(e.navigator.userAgent));return{restrict:"EAC",require:"ngModel",link:function(e,t,n,s){function l(e){return e&&e.length?e:null}function u(e){if(angular.isDate(e)){var t=isNaN(f.$options.minDate)||e.getTime()>=f.$options.minDate,n=isNaN(f.$options.maxDate)||e.getTime()<=f.$options.maxDate,a=t&&n;s.$setValidity("date",a),s.$setValidity("min",t),s.$setValidity("max",n),a&&(s.$dateValue=e)}}function c(){return!s.$dateValue||isNaN(s.$dateValue.getTime())?"":g(s.$dateValue,d.dateFormat)}var d={scope:e,controller:s};angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","autoclose","dateType","dateFormat","modelDateFormat","dayFormat","strictFormat","startWeek","startDate","useNative","lang","startView","minView","iconLeft","iconRight","daysOfWeekDisabled"],function(e){angular.isDefined(n[e])&&(d[e]=n[e])}),n.bsShow&&e.$watch(n.bsShow,function(e){f&&angular.isDefined(e)&&(angular.isString(e)&&(e=!!e.match(/true|,?(datepicker),?/i)),e===!0?f.show():f.hide())});var f=i(t,s,d);d=f.$options,r&&d.useNative&&(d.dateFormat="yyyy-MM-dd");var p=d.lang,g=function(e,t){return a.formatDate(e,t,p)},m=o({format:d.dateFormat,lang:p,strict:d.strictFormat});angular.forEach(["minDate","maxDate"],function(e){angular.isDefined(n[e])&&n.$observe(e,function(t){f.$options[e]=m.getDateForAttribute(e,t),!isNaN(f.$options[e])&&f.$build(!1),u(s.$dateValue)})}),e.$watch(n.ngModel,function(){f.update(s.$dateValue)},!0),angular.isDefined(n.disabledDates)&&e.$watch(n.disabledDates,function(e,t){e=l(e),t=l(t),e&&f.updateDisabledDates(e)}),s.$parsers.unshift(function(e){if(!e)return s.$setValidity("date",!0),null;var t=m.parse(e,s.$dateValue);return!t||isNaN(t.getTime())?void s.$setValidity("date",!1):(u(t),"string"===d.dateType?g(t,d.modelDateFormat||d.dateFormat):"number"===d.dateType?s.$dateValue.getTime():"unix"===d.dateType?s.$dateValue.getTime()/1e3:"iso"===d.dateType?s.$dateValue.toISOString():new Date(s.$dateValue))}),s.$formatters.push(function(e){var t;return t=angular.isUndefined(e)||null===e?0/0:angular.isDate(e)?e:"string"===d.dateType?m.parse(e,null,d.modelDateFormat):new Date("unix"===d.dateType?1e3*e:e),s.$dateValue=t,c()}),s.$render=function(){t.val(c())},e.$on("$destroy",function(){f&&f.destroy(),d=null,f=null})}}}]).provider("datepickerViews",function(){function e(e,t){for(var n=[];e.length>0;)n.push(e.splice(0,t));return n}function t(e,t){return(e%t+t)%t}this.defaults={dayFormat:"dd",daySplit:7};this.$get=["$dateFormatter","$dateParser","$sce",function(n,a,o){return function(i){var r=i.$scope,s=i.$options,l=s.lang,u=function(e,t){return n.formatDate(e,t,l)},c=a({format:s.dateFormat,lang:l,strict:s.strictFormat}),d=n.weekdaysShort(l),f=d.slice(s.startWeek).concat(d.slice(0,s.startWeek)),p=o.trustAsHtml('
'+f.join(' ')+" "),g=i.$date||(s.startDate?c.getDateForAttribute("startDate",s.startDate):new Date),m={year:g.getFullYear(),month:g.getMonth(),date:g.getDate()},$=(6e4*g.getTimezoneOffset(),[{format:s.dayFormat,split:7,steps:{month:1},update:function(e,t){!this.built||t||e.getFullYear()!==m.year||e.getMonth()!==m.month?(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$build()):e.getDate()!==m.date&&(m.date=i.$date.getDate(),i.$updateSelected())},build:function(){var n=new Date(m.year,m.month,1),a=n.getTimezoneOffset(),o=new Date(+n-864e5*t(n.getDay()-s.startWeek,7)),l=o.getTimezoneOffset(),d=(new Date).toDateString();l!==a&&(o=new Date(+o+6e4*(l-a)));for(var f,g=[],$=0;42>$;$++)f=c.daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth(),o.getDate()+$)),g.push({date:f,isToday:f.toDateString()===d,label:u(f,this.format),selected:i.$date&&this.isSelected(f),muted:f.getMonth()!==m.month,disabled:this.isDisabled(f)});r.title=u(n,s.monthTitleFormat),r.showLabels=!0,r.labels=p,r.rows=e(g,this.split),this.built=!0},isSelected:function(e){return i.$date&&e.getFullYear()===i.$date.getFullYear()&&e.getMonth()===i.$date.getMonth()&&e.getDate()===i.$date.getDate()},isDisabled:function(e){var t=e.getTime();if(ts.maxDate)return!0;if(-1!==s.daysOfWeekDisabled.indexOf(e.getDay()))return!0;if(s.disabledDateRanges)for(var n=0;n=s.disabledDateRanges[n].start&&t<=s.disabledDateRanges[n].end)return!0;return!1},onKeyDown:function(e){if(i.$date){var t,n=i.$date.getTime();37===e.keyCode?t=new Date(n-864e5):38===e.keyCode?t=new Date(n-6048e5):39===e.keyCode?t=new Date(n+864e5):40===e.keyCode&&(t=new Date(n+6048e5)),this.isDisabled(t)||i.select(t,!0)}}},{name:"month",format:s.monthFormat,split:4,steps:{year:1},update:function(e){this.built&&e.getFullYear()===m.year?e.getMonth()!==m.month&&(angular.extend(m,{month:i.$date.getMonth(),date:i.$date.getDate()}),i.$updateSelected()):(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$build())},build:function(){for(var t,n=(new Date(m.year,0,1),[]),a=0;12>a;a++)t=new Date(m.year,a,1),n.push({date:t,label:u(t,this.format),selected:i.$isSelected(t),disabled:this.isDisabled(t)});r.title=u(t,s.yearTitleFormat),r.showLabels=!1,r.rows=e(n,this.split),this.built=!0},isSelected:function(e){return i.$date&&e.getFullYear()===i.$date.getFullYear()&&e.getMonth()===i.$date.getMonth()},isDisabled:function(e){var t=+new Date(e.getFullYear(),e.getMonth()+1,0);return ts.maxDate},onKeyDown:function(e){if(i.$date){var t=i.$date.getMonth(),n=new Date(i.$date);37===e.keyCode?n.setMonth(t-1):38===e.keyCode?n.setMonth(t-4):39===e.keyCode?n.setMonth(t+1):40===e.keyCode&&n.setMonth(t+4),this.isDisabled(n)||i.select(n,!0)}}},{name:"year",format:s.yearFormat,split:4,steps:{year:12},update:function(e,t){!this.built||t||parseInt(e.getFullYear()/20,10)!==parseInt(m.year/20,10)?(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$build()):e.getFullYear()!==m.year&&(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$updateSelected())},build:function(){for(var t,n=m.year-m.year%(3*this.split),a=[],o=0;12>o;o++)t=new Date(n+o,0,1),a.push({date:t,label:u(t,this.format),selected:i.$isSelected(t),disabled:this.isDisabled(t)});r.title=a[0].label+"-"+a[a.length-1].label,r.showLabels=!1,r.rows=e(a,this.split),this.built=!0},isSelected:function(e){return i.$date&&e.getFullYear()===i.$date.getFullYear()},isDisabled:function(e){var t=+new Date(e.getFullYear()+1,0,0);return ts.maxDate},onKeyDown:function(e){if(i.$date){var t=i.$date.getFullYear(),n=new Date(i.$date);37===e.keyCode?n.setYear(t-1):38===e.keyCode?n.setYear(t-4):39===e.keyCode?n.setYear(t+1):40===e.keyCode&&n.setYear(t+4),this.isDisabled(n)||i.select(n,!0)}}}]);return{views:s.minView?Array.prototype.slice.call($,s.minView):$,viewDate:m}}}]}),angular.module("mgcrea.ngStrap.dropdown",["mgcrea.ngStrap.tooltip"]).provider("$dropdown",function(){var e=this.defaults={animation:"am-fade",prefixClass:"dropdown",placement:"bottom-left",template:"dropdown/dropdown.tpl.html",trigger:"click",container:!1,keyboard:!0,html:!1,delay:0};this.$get=["$window","$rootScope","$tooltip","$timeout",function(t,n,a,o){function i(t,i){function l(e){return e.target!==t[0]?e.target!==t[0]&&u.hide():void 0}{var u={},c=angular.extend({},e,i);u.$scope=c.scope&&c.scope.$new()||n.$new()}u=a(t,c);var d=t.parent();u.$onKeyDown=function(e){if(/(38|40)/.test(e.keyCode)){e.preventDefault(),e.stopPropagation();var t=angular.element(u.$element[0].querySelectorAll("li:not(.divider) a"));if(t.length){var n;angular.forEach(t,function(e,t){s&&s.call(e,":focus")&&(n=t)}),38===e.keyCode&&n>0?n--:40===e.keyCode&&no;o++)if(e[o].toLowerCase()===a)return o;return-1}e.prototype.setMilliseconds=function(e){this.milliseconds=e},e.prototype.setSeconds=function(e){this.seconds=e},e.prototype.setMinutes=function(e){this.minutes=e},e.prototype.setHours=function(e){this.hours=e},e.prototype.getHours=function(){return this.hours},e.prototype.setDate=function(e){this.day=e},e.prototype.setMonth=function(e){this.month=e},e.prototype.setFullYear=function(e){this.year=e},e.prototype.fromDate=function(e){return this.year=e.getFullYear(),this.month=e.getMonth(),this.day=e.getDate(),this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this.milliseconds=e.getMilliseconds(),this},e.prototype.toDate=function(){return new Date(this.year,this.month,this.day,this.hours,this.minutes,this.seconds,this.milliseconds)};var o=e.prototype,i=this.defaults={format:"shortDate",strict:!1};this.$get=["$locale","dateFilter",function(r,s){var l=function(l){function u(e){var t,n=Object.keys(h),a=[],o=[],i=e;for(t=0;t1){var r=i.search(n[t]);e=e.split(n[t]).join(""),h[n[t]]&&(a[r]=h[n[t]])}return angular.forEach(a,function(e){e&&o.push(e)}),o}function c(e){return e.replace(/\//g,"[\\/]").replace("/-/g","[-]").replace(/\./g,"[.]").replace(/\\s/g,"[\\s]")}function d(e){var t,n=Object.keys($),a=e;for(t=0;t12?e.getHours()+2:0),e):null},m.init(),m};return l}]}]),angular.module("mgcrea.ngStrap.helpers.debounce",[]).factory("debounce",["$timeout",function(e){return function(t,n,a){var o=null;return function(){var i=this,r=arguments,s=a&&!o;return o&&e.cancel(o),o=e(function(){o=null,a||t.apply(i,r)},n,!1),s&&t.apply(i,r),o}}}]).factory("throttle",["$timeout",function(e){return function(t,n,a){var o=null;return a||(a={}),function(){var i=this,r=arguments;o||(a.leading!==!1&&t.apply(i,r),o=e(function(){o=null,a.trailing!==!1&&t.apply(i,r)},n,!1))}}}]),angular.module("mgcrea.ngStrap.helpers.dimensions",[]).factory("dimensions",["$document","$window",function(){var t=(angular.element,{}),n=t.nodeName=function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()};t.css=function(t,n,a){var o;return o=t.currentStyle?t.currentStyle[n]:e.getComputedStyle?e.getComputedStyle(t)[n]:t.style[n],a===!0?parseFloat(o)||0:o},t.offset=function(t){var n=t.getBoundingClientRect(),a=t.ownerDocument;return{width:n.width||t.offsetWidth,height:n.height||t.offsetHeight,top:n.top+(e.pageYOffset||a.documentElement.scrollTop)-(a.documentElement.clientTop||0),left:n.left+(e.pageXOffset||a.documentElement.scrollLeft)-(a.documentElement.clientLeft||0)}},t.position=function(e){var o,i,r={top:0,left:0};return"fixed"===t.css(e,"position")?i=e.getBoundingClientRect():(o=a(e),i=t.offset(e),n(o,"html")||(r=t.offset(o)),r.top+=t.css(o,"borderTopWidth",!0),r.left+=t.css(o,"borderLeftWidth",!0)),{width:e.offsetWidth,height:e.offsetHeight,top:i.top-r.top-t.css(e,"marginTop",!0),left:i.left-r.left-t.css(e,"marginLeft",!0)}};var a=function(e){var a=e.ownerDocument,o=e.offsetParent||a;if(n(o,"#document"))return a.documentElement;for(;o&&!n(o,"html")&&"static"===t.css(o,"position");)o=o.offsetParent;return o||a.documentElement};return t.height=function(e,n){var a=e.offsetHeight;return n?a+=t.css(e,"marginTop",!0)+t.css(e,"marginBottom",!0):a-=t.css(e,"paddingTop",!0)+t.css(e,"paddingBottom",!0)+t.css(e,"borderTopWidth",!0)+t.css(e,"borderBottomWidth",!0),a},t.width=function(e,n){var a=e.offsetWidth;return n?a+=t.css(e,"marginLeft",!0)+t.css(e,"marginRight",!0):a-=t.css(e,"paddingLeft",!0)+t.css(e,"paddingRight",!0)+t.css(e,"borderLeftWidth",!0)+t.css(e,"borderRightWidth",!0),a},t}]),angular.module("mgcrea.ngStrap.helpers.parseOptions",[]).provider("$parseOptions",function(){var e=this.defaults={regexp:/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/};this.$get=["$parse","$q",function(t,n){function a(a,o){function i(e,t){return e.map(function(e,n){var a,o,i={};return i[c]=e,a=u(t,i),o=p(t,i),{label:a,value:o,index:n}})}var r={},s=angular.extend({},e,o);r.$values=[];var l,u,c,d,f,p,g;return r.init=function(){r.$match=l=a.match(s.regexp),u=t(l[2]||l[1]),c=l[4]||l[6],d=l[5],f=t(l[3]||""),p=t(l[2]?l[1]:c),g=t(l[7])},r.valuesFn=function(e,t){return n.when(g(e,t)).then(function(t){return r.$values=t?i(t,e):{},r.$values})},r.displayValue=function(e){var t={};return t[c]=e,u(t)},r.init(),r}return a}]}),angular.version.minor<3&&angular.version.dot<14&&angular.module("ng").factory("$$rAF",["$window","$timeout",function(e,t){var n=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame,a=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelRequestAnimationFrame,o=!!n,i=o?function(e){var t=n(e);return function(){a(t)}}:function(e){var n=t(e,16.66,!1);return function(){t.cancel(n)}};return i.supported=o,i}]),angular.module("mgcrea.ngStrap.modal",["mgcrea.ngStrap.helpers.dimensions"]).provider("$modal",function(){var e=this.defaults={animation:"am-fade",backdropAnimation:"am-fade",prefixClass:"modal",prefixEvent:"modal",placement:"top",template:"modal/modal.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};
-this.$get=["$window","$rootScope","$compile","$q","$templateCache","$http","$animate","$timeout","$sce","dimensions",function(n,a,o,i,r,s,l,u,c){function d(t){function n(){w.$emit(d.prefixEvent+".show",u)}function i(){w.$emit(d.prefixEvent+".hide",u),v.removeClass(d.prefixClass+"-open"),d.animation&&v.removeClass(d.prefixClass+"-with-"+d.animation)}function r(e){e.target===e.currentTarget&&("static"===d.backdrop?u.focus():u.hide())}function s(e){e.preventDefault()}var u={},d=u.$options=angular.extend({},e,t);u.$promise=g(d.template);var w=u.$scope=d.scope&&d.scope.$new()||a.$new();d.element||d.container||(d.container="body"),m(["title","content"],function(e){d[e]&&(w[e]=c.trustAsHtml(d[e]))}),w.$hide=function(){w.$$postDigest(function(){u.hide()})},w.$show=function(){w.$$postDigest(function(){u.show()})},w.$toggle=function(){w.$$postDigest(function(){u.toggle()})},u.$isShown=w.$isShown=!1,d.contentTemplate&&(u.$promise=u.$promise.then(function(e){var n=angular.element(e);return g(d.contentTemplate).then(function(e){var a=p('[ng-bind="content"]',n[0]).removeAttr("ng-bind").html(e);return t.template||a.next().remove(),n[0].outerHTML})}));var b,D,k=angular.element('
');return u.$promise.then(function(e){angular.isObject(e)&&(e=e.data),d.html&&(e=e.replace(y,'ng-bind-html="')),e=$.apply(e),b=o(e),u.init()}),u.init=function(){d.show&&w.$$postDigest(function(){u.show()})},u.destroy=function(){D&&(D.remove(),D=null),k&&(k.remove(),k=null),w.$destroy()},u.show=function(){if(!u.$isShown&&!w.$emit(d.prefixEvent+".show.before",u).defaultPrevented){var e,t;angular.isElement(d.container)?(e=d.container,t=d.container[0].lastChild?angular.element(d.container[0].lastChild):null):d.container?(e=p(d.container),t=e[0].lastChild?angular.element(e[0].lastChild):null):(e=null,t=d.element),D=u.$element=b(w,function(){}),D.css({display:"block"}).addClass(d.placement),d.animation&&(d.backdrop&&k.addClass(d.backdropAnimation),D.addClass(d.animation)),d.backdrop&&l.enter(k,v,null);var a=l.enter(D,e,t,n);a&&a.then&&a.then(n),u.$isShown=w.$isShown=!0,f(w);var o=D[0];h(function(){o.focus()}),v.addClass(d.prefixClass+"-open"),d.animation&&v.addClass(d.prefixClass+"-with-"+d.animation),d.backdrop&&(D.on("click",r),k.on("click",r),k.on("wheel",s)),d.keyboard&&D.on("keyup",u.$onKeyUp)}},u.hide=function(){if(u.$isShown&&!w.$emit(d.prefixEvent+".hide.before",u).defaultPrevented){var e=l.leave(D,i);e&&e.then&&e.then(i),d.backdrop&&l.leave(k),u.$isShown=w.$isShown=!1,f(w),d.backdrop&&(D.off("click",r),k.off("click",r),k.off("wheel",s)),d.keyboard&&D.off("keyup",u.$onKeyUp)}},u.toggle=function(){u.$isShown?u.hide():u.show()},u.focus=function(){D[0].focus()},u.$onKeyUp=function(e){27===e.which&&u.$isShown&&(u.hide(),e.stopPropagation())},u}function f(e){e.$$phase||e.$root&&e.$root.$$phase||e.$digest()}function p(e,n){return angular.element((n||t).querySelectorAll(e))}function g(e){return w[e]?w[e]:w[e]=i.when(r.get(e)||s.get(e)).then(function(t){return angular.isObject(t)?(r.put(e,t.data),t.data):t})}var m=angular.forEach,$=String.prototype.trim,h=n.requestAnimationFrame||n.setTimeout,v=angular.element(n.document.body),y=/ng-bind="/gi,w={};return d}]}).directive("bsModal",["$window","$sce","$modal",function(e,t,n){return{restrict:"EAC",scope:!0,link:function(e,a,o){var i={scope:e,element:a,show:!1};angular.forEach(["template","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),angular.forEach(["title","content"],function(n){o[n]&&o.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),o.bsModal&&e.$watch(o.bsModal,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var r=n(i);a.on(o.trigger||"click",r.toggle),e.$on("$destroy",function(){r&&r.destroy(),i=null,r=null})}}}]),angular.module("mgcrea.ngStrap.navbar",[]).provider("$navbar",function(){var e=this.defaults={activeClass:"active",routeAttr:"data-match-route",strict:!1};this.$get=function(){return{defaults:e}}}).directive("bsNavbar",["$window","$location","$navbar",function(e,t,n){var a=n.defaults;return{restrict:"A",link:function(e,n,o){var i=angular.copy(a);angular.forEach(Object.keys(a),function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),e.$watch(function(){return t.path()},function(e){var t=n[0].querySelectorAll("li["+i.routeAttr+"]");angular.forEach(t,function(t){var n=angular.element(t),a=n.attr(i.routeAttr).replace("/","\\/");i.strict&&(a="^"+a+"$");var o=new RegExp(a,["i"]);o.test(e)?n.addClass(i.activeClass):n.removeClass(i.activeClass)})})}}}]),angular.module("mgcrea.ngStrap.popover",["mgcrea.ngStrap.tooltip"]).provider("$popover",function(){var e=this.defaults={animation:"am-fade",customClass:"",container:!1,target:!1,placement:"right",template:"popover/popover.tpl.html",contentTemplate:!1,trigger:"click",keyboard:!0,html:!1,title:"",content:"",delay:0,autoClose:!1};this.$get=["$tooltip",function(t){function n(n,a){var o=angular.extend({},e,a),i=t(n,o);return o.content&&(i.$scope.content=o.content),i}return n}]}).directive("bsPopover",["$window","$sce","$popover",function(e,t,n){var a=e.requestAnimationFrame||e.setTimeout;return{restrict:"EAC",scope:!0,link:function(e,o,i){var r={scope:e};angular.forEach(["template","contentTemplate","placement","container","target","delay","trigger","keyboard","html","animation","customClass","autoClose"],function(e){angular.isDefined(i[e])&&(r[e]=i[e])}),angular.forEach(["title","content"],function(n){i[n]&&i.$observe(n,function(o,i){e[n]=t.trustAsHtml(o),angular.isDefined(i)&&a(function(){s&&s.$applyPlacement()})})}),i.bsPopover&&e.$watch(i.bsPopover,function(t,n){angular.isObject(t)?angular.extend(e,t):e.content=t,angular.isDefined(n)&&a(function(){s&&s.$applyPlacement()})},!0),i.bsShow&&e.$watch(i.bsShow,function(e){s&&angular.isDefined(e)&&(angular.isString(e)&&(e=!!e.match(/true|,?(popover),?/i)),e===!0?s.show():s.hide())});var s=n(o,r);e.$on("$destroy",function(){s&&s.destroy(),r=null,s=null})}}}]),angular.module("mgcrea.ngStrap.scrollspy",["mgcrea.ngStrap.helpers.debounce","mgcrea.ngStrap.helpers.dimensions"]).provider("$scrollspy",function(){var e=this.$$spies={},n=this.defaults={debounce:150,throttle:100,offset:100};this.$get=["$window","$document","$rootScope","dimensions","debounce","throttle",function(a,o,i,r,s,l){function u(e,t){return e[0].nodeName&&e[0].nodeName.toLowerCase()===t.toLowerCase()}function c(o){var c=angular.extend({},n,o);c.element||(c.element=p);var g=u(c.element,"body"),m=g?d:c.element,$=g?"window":c.id;if(e[$])return e[$].$$count++,e[$];var h,v,y,w,b,D,k,T,S={},x=S.$trackedElements=[],C=[];return S.init=function(){this.$$count=1,w=s(this.checkPosition,c.debounce),b=l(this.checkPosition,c.throttle),m.on("click",this.checkPositionWithEventLoop),d.on("resize",w),m.on("scroll",b),D=s(this.checkOffsets,c.debounce),h=i.$on("$viewContentLoaded",D),v=i.$on("$includeContentLoaded",D),D(),$&&(e[$]=S)},S.destroy=function(){this.$$count--,this.$$count>0||(m.off("click",this.checkPositionWithEventLoop),d.off("resize",w),m.off("scroll",b),h(),v(),$&&delete e[$])},S.checkPosition=function(){if(C.length){if(T=(g?a.pageYOffset:m.prop("scrollTop"))||0,k=Math.max(a.innerHeight,f.prop("clientHeight")),TC[e+1].offsetTop))return S.$activateElement(C[e])}},S.checkPositionWithEventLoop=function(){setTimeout(S.checkPosition,1)},S.$activateElement=function(e){if(y){var t=S.$getTrackedElement(y);t&&(t.source.removeClass("active"),u(t.source,"li")&&u(t.source.parent().parent(),"li")&&t.source.parent().parent().removeClass("active"))}y=e.target,e.source.addClass("active"),u(e.source,"li")&&u(e.source.parent().parent(),"li")&&e.source.parent().parent().addClass("active")},S.$getTrackedElement=function(e){return x.filter(function(t){return t.target===e})[0]},S.checkOffsets=function(){angular.forEach(x,function(e){var n=t.querySelector(e.target);e.offsetTop=n?r.offset(n).top:null,c.offset&&null!==e.offsetTop&&(e.offsetTop-=1*c.offset)}),C=x.filter(function(e){return null!==e.offsetTop}).sort(function(e,t){return e.offsetTop-t.offsetTop}),w()},S.trackElement=function(e,t){x.push({target:e,source:t})},S.untrackElement=function(e,t){for(var n,a=x.length;a--;)if(x[a].target===e&&x[a].source===t){n=a;break}x=x.splice(n,1)},S.activate=function(e){x[e].addClass("active")},S.init(),S}var d=angular.element(a),f=angular.element(o.prop("documentElement")),p=angular.element(a.document.body);return c}]}).directive("bsScrollspy",["$rootScope","debounce","dimensions","$scrollspy",function(e,t,n,a){return{restrict:"EAC",link:function(e,t,n){var o={scope:e};angular.forEach(["offset","target"],function(e){angular.isDefined(n[e])&&(o[e]=n[e])});var i=a(o);i.trackElement(o.target,t),e.$on("$destroy",function(){i&&(i.untrackElement(o.target,t),i.destroy()),o=null,i=null})}}}]).directive("bsScrollspyList",["$rootScope","debounce","dimensions","$scrollspy",function(){return{restrict:"A",compile:function(e){var t=e[0].querySelectorAll("li > a[href]");angular.forEach(t,function(e){var t=angular.element(e);t.parent().attr("bs-scrollspy","").attr("data-target",t.attr("href"))})}}}]),angular.module("mgcrea.ngStrap.select",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$select",function(){var e=this.defaults={animation:"am-fade",prefixClass:"select",prefixEvent:"$select",placement:"bottom-left",template:"select/select.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,multiple:!1,allNoneButtons:!1,sort:!0,caretHtml:' ',placeholder:"Choose among the following...",allText:"All",noneText:"None",maxLength:3,maxLengthHtml:"selected",iconCheckmark:"glyphicon glyphicon-ok"};this.$get=["$window","$document","$rootScope","$tooltip","$timeout",function(t,n,a,o,i){function r(t,n,a){var r={},s=angular.extend({},e,a);r=o(t,s);var u=r.$scope;u.$matches=[],u.$activeIndex=0,u.$isMultiple=s.multiple,u.$showAllNoneButtons=s.allNoneButtons&&s.multiple,u.$iconCheckmark=s.iconCheckmark,u.$allText=s.allText,u.$noneText=s.noneText,u.$activate=function(e){u.$$postDigest(function(){r.activate(e)})},u.$select=function(e){u.$$postDigest(function(){r.select(e)})},u.$isVisible=function(){return r.$isVisible()},u.$isActive=function(e){return r.$isActive(e)},u.$selectAll=function(){for(var e=0;e=u.$matches.length&&(u.$activeIndex=s.multiple?[]:0)},r.$isVisible=function(){return s.minLength&&n?u.$matches.length&&n.$viewValue.length>=s.minLength:u.$matches.length},r.$isActive=function(e){return s.multiple?-1!==u.$activeIndex.indexOf(e):u.$activeIndex===e},r.$getIndex=function(e){var t=u.$matches.length,n=t;if(t){for(n=t;n--&&u.$matches[n].value!==e;);if(!(0>n))return n}},r.$onMouseDown=function(e){if(e.preventDefault(),e.stopPropagation(),l){var t=angular.element(e.target);t.triggerHandler("click")}},r.$onKeyDown=function(e){if(/(9|13|38|40)/.test(e.keyCode)){if(e.preventDefault(),e.stopPropagation(),!s.multiple&&(13===e.keyCode||9===e.keyCode))return r.select(u.$activeIndex);38===e.keyCode&&u.$activeIndex>0?u.$activeIndex--:40===e.keyCode&&u.$activeIndex'),l.after(t)}var u=o(n.ngOptions),c=a(t,r,s),d=u.$match[7].replace(/\|.+/,"").trim();e.$watch(d,function(){u.valuesFn(e,r).then(function(e){c.update(e),r.$render()})},!0),e.$watch(n.ngModel,function(){c.$updateActiveIndex(),r.$render()},!0),r.$render=function(){var e,n;s.multiple&&angular.isArray(r.$modelValue)?(e=r.$modelValue.map(function(e){return n=c.$getIndex(e),angular.isDefined(n)?c.$scope.$matches[n].label:!1}).filter(angular.isDefined),e=e.length>(s.maxLength||i.maxLength)?e.length+" "+(s.maxLengthHtml||i.maxLengthHtml):e.join(", ")):(n=c.$getIndex(r.$modelValue),e=angular.isDefined(n)?c.$scope.$matches[n].label:!1),t.html((e?e:s.placeholder)+i.caretHtml)},s.multiple&&(r.$isEmpty=function(e){return!e||0===e.length}),e.$on("$destroy",function(){c&&c.destroy(),s=null,c=null})}}}]),angular.module("mgcrea.ngStrap.tab",[]).provider("$tab",function(){var e=this.defaults={animation:"am-fade",template:"tab/tab.tpl.html",navClass:"nav-tabs",activeClass:"active"},t=this.controller=function(t,n,a){var o=this;o.$options=angular.copy(e),angular.forEach(["animation","navClass","activeClass"],function(e){angular.isDefined(a[e])&&(o.$options[e]=a[e])}),t.$navClass=o.$options.navClass,t.$activeClass=o.$options.activeClass,o.$panes=t.$panes=[],o.$activePaneChangeListeners=o.$viewChangeListeners=[],o.$push=function(e){o.$panes.push(e)},o.$remove=function(e){var t=o.$panes.indexOf(e),n=o.$panes.$active;o.$panes.splice(t,1),n>t?n--:t===n&&n===o.$panes.length&&n--,o.$setActive(n)},o.$panes.$active=0,o.$setActive=t.$setActive=function(e){o.$panes.$active=e,o.$activePaneChangeListeners.forEach(function(e){e()})}};this.$get=function(){var n={};return n.defaults=e,n.controller=t,n}}).directive("bsTabs",["$window","$animate","$tab","$parse",function(e,t,n,a){var o=n.defaults;return{require:["?ngModel","bsTabs"],transclude:!0,scope:!0,controller:["$scope","$element","$attrs",n.controller],templateUrl:function(e,t){return t.template||o.template},link:function(e,t,n,o){var i=o[0],r=o[1];if(i&&(console.warn("Usage of ngModel is deprecated, please use bsActivePane instead!"),r.$activePaneChangeListeners.push(function(){i.$setViewValue(r.$panes.$active)}),i.$formatters.push(function(e){return r.$setActive(1*e),e})),n.bsActivePane){var s=a(n.bsActivePane);r.$activePaneChangeListeners.push(function(){s.assign(e,r.$panes.$active)}),e.$watch(n.bsActivePane,function(e){r.$setActive(1*e)},!0)}}}}]).directive("bsPane",["$window","$animate","$sce",function(e,t,n){return{require:["^?ngModel","^bsTabs"],scope:!0,link:function(e,a,o,i){function r(){var n=s.$panes.indexOf(e),o=s.$panes.$active;t[n===o?"addClass":"removeClass"](a,s.$options.activeClass)}var s=(i[0],i[1]);a.addClass("tab-pane"),o.$observe("title",function(t){e.title=n.trustAsHtml(t)}),s.$options.animation&&a.addClass(s.$options.animation),s.$push(e),e.$on("$destroy",function(){s.$remove(e)}),s.$activePaneChangeListeners.push(function(){r()}),r()}}}]),angular.module("mgcrea.ngStrap.tooltip",["mgcrea.ngStrap.helpers.dimensions"]).provider("$tooltip",function(){var e=this.defaults={animation:"am-fade",customClass:"",prefixClass:"tooltip",prefixEvent:"tooltip",container:!1,target:!1,placement:"top",template:"tooltip/tooltip.tpl.html",contentTemplate:!1,trigger:"hover focus",keyboard:!1,html:!1,show:!1,title:"",type:"",delay:0,autoClose:!1,bsEnabled:!0};this.$get=["$window","$rootScope","$compile","$q","$templateCache","$http","$animate","$sce","dimensions","$$rAF","$timeout",function(n,a,o,i,r,s,l,u,c,d,f){function p(n,i){function r(){O.$emit(P.prefixEvent+".show",F)}function s(){return O.$emit(P.prefixEvent+".hide",F),U&&"focus"===P.trigger?n[0].blur():void A()}function p(){var e=P.trigger.split(" ");angular.forEach(e,function(e){"click"===e?n.on("click",F.toggle):"manual"!==e&&(n.on("hover"===e?"mouseenter":"focus",F.enter),n.on("hover"===e?"mouseleave":"blur",F.leave),"button"===V&&"hover"!==e&&n.on(v?"touchstart":"mousedown",F.$onFocusElementMouseDown))})}function b(){for(var e=P.trigger.split(" "),t=e.length;t--;){var a=e[t];"click"===a?n.off("click",F.toggle):"manual"!==a&&(n.off("hover"===a?"mouseenter":"focus",F.enter),n.off("hover"===a?"mouseleave":"blur",F.leave),"button"===V&&"hover"!==a&&n.off(v?"touchstart":"mousedown",F.$onFocusElementMouseDown))}}function D(){"focus"!==P.trigger?R.on("keyup",F.$onKeyUp):n.on("keyup",F.$onFocusKeyUp)}function k(){"focus"!==P.trigger?R.off("keyup",F.$onKeyUp):n.off("keyup",F.$onFocusKeyUp)}function T(){f(function(){R.on("click",x),w.on("click",F.hide),W=!0},0,!1)}function S(){W&&(R.off("click",x),w.off("click",F.hide),W=!1)}function x(e){e.stopPropagation()}function C(e){e=e||P.target||n;var t=e[0],a=t.getBoundingClientRect();null===a.width&&(a=angular.extend({},a,{width:a.right-a.left,height:a.bottom-a.top}));var o;return o="body"===P.container?c.offset(t):c.position(t),angular.extend({},a,o)}function M(e,t,n,a){var o,i=e.split("-");switch(i[0]){case"right":o={top:t.top+t.height/2-a/2,left:t.left+t.width};break;case"bottom":o={top:t.top+t.height,left:t.left+t.width/2-n/2};break;case"left":o={top:t.top+t.height/2-a/2,left:t.left-n};break;default:o={top:t.top-a,left:t.left+t.width/2-n/2}}if(!i[1])return o;if("top"===i[0]||"bottom"===i[0])switch(i[1]){case"left":o.left=t.left;break;case"right":o.left=t.left+t.width-n}else if("left"===i[0]||"right"===i[0])switch(i[1]){case"top":o.top=t.top-a;break;case"bottom":o.top=t.top+t.height}return o}function E(e,t){R.css({top:e+"px",left:t+"px"})}function A(){clearTimeout(I),F.$isShown&&null!==R&&(P.autoClose&&S(),P.keyboard&&k()),K&&(K.$destroy(),K=null),R&&(R.remove(),R=F.$element=null)}var F={},V=n[0].nodeName.toLowerCase(),P=F.$options=angular.extend({},e,i);F.$promise=$(P.template);var O=F.$scope=P.scope&&P.scope.$new()||a.$new();if(P.delay&&angular.isString(P.delay)){var H=P.delay.split(",").map(parseFloat);P.delay=H.length>1?{show:H[0],hide:H[1]}:H[0]}P.title&&(O.title=u.trustAsHtml(P.title)),O.$setEnabled=function(e){O.$$postDigest(function(){F.setEnabled(e)})},O.$hide=function(){O.$$postDigest(function(){F.hide()})},O.$show=function(){O.$$postDigest(function(){F.show()})},O.$toggle=function(){O.$$postDigest(function(){F.toggle()})},F.$isShown=O.$isShown=!1;var I,N;P.contentTemplate&&(F.$promise=F.$promise.then(function(e){var t=angular.element(e);return $(P.contentTemplate).then(function(e){var n=m('[ng-bind="content"]',t[0]);return n.length||(n=m('[ng-bind="title"]',t[0])),n.removeAttr("ng-bind").html(e),t[0].outerHTML})}));var L,R,q,Y,K;F.$promise.then(function(e){angular.isObject(e)&&(e=e.data),P.html&&(e=e.replace(y,'ng-bind-html="')),e=h.apply(e),q=e,L=o(e),F.init()}),F.init=function(){P.delay&&angular.isNumber(P.delay)&&(P.delay={show:P.delay,hide:P.delay}),"self"===P.container?Y=n:angular.isElement(P.container)?Y=P.container:P.container&&(Y=m(P.container)),p(),P.target&&(P.target=angular.isElement(P.target)?P.target:m(P.target)),P.show&&O.$$postDigest(function(){"focus"===P.trigger?n[0].focus():F.show()})},F.destroy=function(){b(),A(),O.$destroy()},F.enter=function(){return clearTimeout(I),N="in",P.delay&&P.delay.show?void(I=setTimeout(function(){"in"===N&&F.show()},P.delay.show)):F.show()},F.show=function(){if(P.bsEnabled&&!F.$isShown){O.$emit(P.prefixEvent+".show.before",F);var e,t;P.container?(e=Y,t=Y[0].lastChild?angular.element(Y[0].lastChild):null):(e=null,t=n),R&&A(),K=F.$scope.$new(),R=F.$element=L(K,function(){}),R.css({top:"-9999px",left:"-9999px",display:"block",visibility:"hidden"}),P.animation&&R.addClass(P.animation),P.type&&R.addClass(P.prefixClass+"-"+P.type),P.customClass&&R.addClass(P.customClass);var a=l.enter(R,e,t,r);a&&a.then&&a.then(r),F.$isShown=O.$isShown=!0,g(O),d(function(){F.$applyPlacement(),R&&R.css({visibility:"visible"})}),P.keyboard&&("focus"!==P.trigger&&F.focus(),D()),P.autoClose&&T()}},F.leave=function(){return clearTimeout(I),N="out",P.delay&&P.delay.hide?void(I=setTimeout(function(){"out"===N&&F.hide()},P.delay.hide)):F.hide()};var U;F.hide=function(e){if(F.$isShown){O.$emit(P.prefixEvent+".hide.before",F),U=e;var t=l.leave(R,s);t&&t.then&&t.then(s),F.$isShown=O.$isShown=!1,g(O),P.keyboard&&null!==R&&k(),P.autoClose&&null!==R&&S()}},F.toggle=function(){F.$isShown?F.leave():F.enter()},F.focus=function(){R[0].focus()},F.setEnabled=function(e){P.bsEnabled=e},F.$applyPlacement=function(){if(R){var a=P.placement,o=/\s?auto?\s?/i,i=o.test(a);i&&(a=a.replace(o,"")||e.placement),R.addClass(P.placement);var r=C(),s=R.prop("offsetWidth"),l=R.prop("offsetHeight");if(i){var u=a,c=P.container?angular.element(t.querySelector(P.container)):n.parent(),d=C(c);u.indexOf("bottom")>=0&&r.bottom+l>d.bottom?a=u.replace("bottom","top"):u.indexOf("top")>=0&&r.top-ld.width?a="right"===u?"left":a.replace("left","right"):("left"===u||"bottom-right"===u||"top-right"===u)&&r.left-s=e.length&&(u.$activeIndex=0)},r.activate=function(e){u.$activeIndex=e},r.select=function(e){var t=u.$matches[e].value;n.$setViewValue(t),n.$render(),u.$resetMatches(),l&&l.$digest(),u.$emit(s.prefixEvent+".select",t,e)},r.$isVisible=function(){return s.minLength&&n?u.$matches.length&&angular.isString(n.$viewValue)&&n.$viewValue.length>=s.minLength:!!u.$matches.length},r.$getIndex=function(e){var t=u.$matches.length,n=t;if(t){for(n=t;n--&&u.$matches[n].value!==e;);if(!(0>n))return n}},r.$onMouseDown=function(e){e.preventDefault(),e.stopPropagation()},r.$onKeyDown=function(e){/(38|40|13)/.test(e.keyCode)&&(r.$isVisible()&&(e.preventDefault(),e.stopPropagation()),13===e.keyCode&&u.$matches.length?r.select(u.$activeIndex):38===e.keyCode&&u.$activeIndex>0?u.$activeIndex--:40===e.keyCode&&u.$activeIndex0)return void s.$setViewValue(s.$viewValue.substring(0,s.$viewValue.length-1));e.length>c&&(e=e.slice(0,c));var n=g.$isVisible();n&&g.update(e),(1!==e.length||e[0].value!==t)&&(!n&&g.update(e),s.$render())})}),s.$formatters.push(function(e){var t=p.displayValue(e);return t===n?"":t}),s.$render=function(){if(s.$isEmpty(s.$viewValue))return t.val("");var e=g.$getIndex(s.$modelValue),n=angular.isDefined(e)?g.$scope.$matches[e].label:s.$viewValue;n=angular.isObject(n)?p.displayValue(n):n,t.val(n?n.toString().replace(/<(?:.|\n)*?>/gm,"").trim():"")},e.$on("$destroy",function(){g&&g.destroy(),l=null,g=null})}}}]),angular.module("mgcrea.ngStrap.timepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$timepicker",function(){var e=this.defaults={animation:"am-fade",prefixClass:"timepicker",placement:"bottom-left",template:"timepicker/timepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!0,timeType:"date",timeFormat:"shortTime",modelTimeFormat:null,autoclose:!1,minTime:-1/0,maxTime:+1/0,length:5,hourStep:1,minuteStep:5,iconUp:"glyphicon glyphicon-chevron-up",iconDown:"glyphicon glyphicon-chevron-down",arrowBehavior:"pager"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","$tooltip","$timeout",function(t,n,a,o,i,r,s){function l(t,n,a){function o(e,n){if(t[0].createTextRange){var a=t[0].createTextRange();a.collapse(!0),a.moveStart("character",e),a.moveEnd("character",n),a.select()}else t[0].setSelectionRange?t[0].setSelectionRange(e,n):angular.isUndefined(t[0].selectionStart)&&(t[0].selectionStart=e,t[0].selectionEnd=n)}function l(){t[0].focus()}var d=r(t,angular.extend({},e,a)),f=a.scope,p=d.$options,g=d.$scope,m=p.lang,$=function(e,t){return i.formatDate(e,t,m)},h=0,v=n.$dateValue||new Date,y={hour:v.getHours(),meridian:v.getHours()<12,minute:v.getMinutes(),second:v.getSeconds(),millisecond:v.getMilliseconds()},w=i.getDatetimeFormat(p.timeFormat,m),b=i.hoursFormat(w),D=i.timeSeparator(w),k=i.minutesFormat(w),T=i.showAM(w);g.$iconUp=p.iconUp,g.$iconDown=p.iconDown,g.$select=function(e,t){d.select(e,t)},g.$moveIndex=function(e,t){d.$moveIndex(e,t)},g.$switchMeridian=function(e){d.switchMeridian(e)},d.update=function(e){angular.isDate(e)&&!isNaN(e.getTime())?(d.$date=e,angular.extend(y,{hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()}),d.$build()):d.$isBuilt||d.$build()},d.select=function(e,t,a){(!n.$dateValue||isNaN(n.$dateValue.getTime()))&&(n.$dateValue=new Date(1970,0,1)),angular.isDate(e)||(e=new Date(e)),0===t?n.$dateValue.setHours(e.getHours()):1===t&&n.$dateValue.setMinutes(e.getMinutes()),n.$setViewValue(angular.copy(n.$dateValue)),n.$render(),p.autoclose&&!a&&s(function(){d.hide(!0)})},d.switchMeridian=function(e){if(n.$dateValue&&!isNaN(n.$dateValue.getTime())){var t=(e||n.$dateValue).getHours();n.$dateValue.setHours(12>t?t+12:t-12),n.$setViewValue(angular.copy(n.$dateValue)),n.$render()}},d.$build=function(){var e,t,n=g.midIndex=parseInt(p.length/2,10),a=[];for(e=0;e1*p.maxTime},g.$arrowAction=function(e,t){"picker"===p.arrowBehavior?d.$setTimeByStep(e,t):d.$moveIndex(e,t)},d.$setTimeByStep=function(e,t){{var n=new Date(d.$date),a=n.getHours(),o=($(n,b).length,n.getMinutes());$(n,k).length}0===t?n.setHours(a-parseInt(p.hourStep,10)*e):n.setMinutes(o-parseInt(p.minuteStep,10)*e),d.select(n,t,!0)},d.$moveIndex=function(e,t){var n;0===t?(n=new Date(1970,0,1,y.hour+e*p.length,y.minute),angular.extend(y,{hour:n.getHours()})):1===t&&(n=new Date(1970,0,1,y.hour,y.minute+e*p.length*p.minuteStep),angular.extend(y,{minute:n.getMinutes()})),d.$build()},d.$onMouseDown=function(e){if("input"!==e.target.nodeName.toLowerCase()&&e.preventDefault(),e.stopPropagation(),c){var t=angular.element(e.target);"button"!==t[0].nodeName.toLowerCase()&&(t=t.parent()),t.triggerHandler("click")}},d.$onKeyDown=function(e){if(/(38|37|39|40|13)/.test(e.keyCode)&&!e.shiftKey&&!e.altKey){if(e.preventDefault(),e.stopPropagation(),13===e.keyCode)return d.hide(!0);
-var t=new Date(d.$date),n=t.getHours(),a=$(t,b).length,i=t.getMinutes(),r=$(t,k).length,s=/(37|39)/.test(e.keyCode),l=2+1*T;s&&(37===e.keyCode?h=1>h?l-1:h-1:39===e.keyCode&&(h=l-1>h?h+1:0));var u=[0,a];0===h?(38===e.keyCode?t.setHours(n-parseInt(p.hourStep,10)):40===e.keyCode&&t.setHours(n+parseInt(p.hourStep,10)),a=$(t,b).length,u=[0,a]):1===h?(38===e.keyCode?t.setMinutes(i-parseInt(p.minuteStep,10)):40===e.keyCode&&t.setMinutes(i+parseInt(p.minuteStep,10)),r=$(t,k).length,u=[a+1,a+1+r]):2===h&&(s||d.switchMeridian(),u=[a+1+r+1,a+1+r+3]),d.select(t,h,!0),o(u[0],u[1]),f.$digest()}};var S=d.init;d.init=function(){return u&&p.useNative?(t.prop("type","time"),void t.css("-webkit-appearance","textfield")):(c&&(t.prop("type","text"),t.attr("readonly","true"),t.on("click",l)),void S())};var x=d.destroy;d.destroy=function(){u&&p.useNative&&t.off("click",l),x()};var C=d.show;d.show=function(){C(),s(function(){d.$element.on(c?"touchstart":"mousedown",d.$onMouseDown),p.keyboard&&t.on("keydown",d.$onKeyDown)},0,!1)};var M=d.hide;return d.hide=function(e){d.$isShown&&(d.$element.off(c?"touchstart":"mousedown",d.$onMouseDown),p.keyboard&&t.off("keydown",d.$onKeyDown),M(e))},d}var u=(angular.element(t.document.body),/(ip(a|o)d|iphone|android)/gi.test(t.navigator.userAgent)),c="createTouch"in t.document&&u;return e.lang||(e.lang=i.getDefaultLocale()),l.defaults=e,l}]}).directive("bsTimepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$timepicker",function(e,t,n,a,o,i){{var r=i.defaults,s=/(ip(a|o)d|iphone|android)/gi.test(e.navigator.userAgent);e.requestAnimationFrame||e.setTimeout}return{restrict:"EAC",require:"ngModel",link:function(e,t,n,l){function u(e){if(angular.isDate(e)){var t=isNaN(d.minTime)||new Date(e.getTime()).setFullYear(1970,0,1)>=d.minTime,n=isNaN(d.maxTime)||new Date(e.getTime()).setFullYear(1970,0,1)<=d.maxTime,a=t&&n;l.$setValidity("date",a),l.$setValidity("min",t),l.$setValidity("max",n),a&&(l.$dateValue=e)}}function c(){return!l.$dateValue||isNaN(l.$dateValue.getTime())?"":g(l.$dateValue,d.timeFormat)}var d={scope:e,controller:l};angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","autoclose","timeType","timeFormat","modelTimeFormat","useNative","hourStep","minuteStep","length","arrowBehavior","iconUp","iconDown"],function(e){angular.isDefined(n[e])&&(d[e]=n[e])}),n.bsShow&&e.$watch(n.bsShow,function(e){f&&angular.isDefined(e)&&(angular.isString(e)&&(e=!!e.match(/true|,?(timepicker),?/i)),e===!0?f.show():f.hide())}),s&&(d.useNative||r.useNative)&&(d.timeFormat="HH:mm");var f=i(t,l,d);d=f.$options;var p=d.lang,g=function(e,t){return a.formatDate(e,t,p)},m=o({format:d.timeFormat,lang:p});angular.forEach(["minTime","maxTime"],function(e){angular.isDefined(n[e])&&n.$observe(e,function(t){f.$options[e]=m.getTimeForAttribute(e,t),!isNaN(f.$options[e])&&f.$build(),u(l.$dateValue)})}),e.$watch(n.ngModel,function(){f.update(l.$dateValue)},!0),l.$parsers.unshift(function(e){if(!e)return l.$setValidity("date",!0),null;var t=angular.isDate(e)?e:m.parse(e,l.$dateValue);return!t||isNaN(t.getTime())?void l.$setValidity("date",!1):(u(t),"string"===d.timeType?g(t,d.modelTimeFormat||d.timeFormat):"number"===d.timeType?l.$dateValue.getTime():"unix"===d.timeType?l.$dateValue.getTime()/1e3:"iso"===d.timeType?l.$dateValue.toISOString():new Date(l.$dateValue))}),l.$formatters.push(function(e){var t;return t=angular.isUndefined(e)||null===e?0/0:angular.isDate(e)?e:"string"===d.timeType?m.parse(e,null,d.modelTimeFormat):new Date("unix"===d.timeType?1e3*e:e),l.$dateValue=t,c()}),l.$render=function(){t.val(c())},e.$on("$destroy",function(){f&&f.destroy(),d=null,f=null})}}}])}(window,document);
+!function(e,t,n){"use strict";angular.module("mgcrea.ngStrap",["mgcrea.ngStrap.modal","mgcrea.ngStrap.aside","mgcrea.ngStrap.alert","mgcrea.ngStrap.button","mgcrea.ngStrap.select","mgcrea.ngStrap.datepicker","mgcrea.ngStrap.timepicker","mgcrea.ngStrap.navbar","mgcrea.ngStrap.tooltip","mgcrea.ngStrap.popover","mgcrea.ngStrap.dropdown","mgcrea.ngStrap.typeahead","mgcrea.ngStrap.scrollspy","mgcrea.ngStrap.affix","mgcrea.ngStrap.tab","mgcrea.ngStrap.collapse","mgcrea.ngStrap.progressbar"]),angular.module("mgcrea.ngStrap.affix",["mgcrea.ngStrap.helpers.dimensions","mgcrea.ngStrap.helpers.debounce"]).provider("$affix",function(){var e=this.defaults={offsetTop:"auto"};this.$get=["$window","debounce","dimensions",function(t,n,a){function o(o,s){function l(e,t,n){var a=u(),o=c();return v>=a?"top":null!==e&&a+e<=t.top?"middle":null!==y&&t.top+n+$>=o-y?"bottom":"middle"}function u(){return p[0]===t?t.pageYOffset:p[0].scrollTop}function c(){return p[0]===t?t.document.body.scrollHeight:p[0].scrollHeight}var d={},f=angular.extend({},e,s),p=f.target,g="affix affix-top affix-bottom",m=!1,$=0,h=0,v=0,y=0,w=null,b=null,D=o.parent();if(f.offsetParent)if(f.offsetParent.match(/^\d+$/))for(var k=0;k<1*f.offsetParent-1;k++)D=D.parent();else D=angular.element(f.offsetParent);return d.init=function(){this.$parseOffsets(),h=a.offset(o[0]).top+$,m=!o[0].style.width,p.on("scroll",this.checkPosition),p.on("click",this.checkPositionWithEventLoop),r.on("resize",this.$debouncedOnResize),this.checkPosition(),this.checkPositionWithEventLoop()},d.destroy=function(){p.off("scroll",this.checkPosition),p.off("click",this.checkPositionWithEventLoop),r.off("resize",this.$debouncedOnResize)},d.checkPositionWithEventLoop=function(){setTimeout(d.checkPosition,1)},d.checkPosition=function(){var e=u(),t=a.offset(o[0]),n=a.height(o[0]),r=l(b,t,n);w!==r&&(w=r,o.removeClass(g).addClass("affix"+("middle"!==r?"-"+r:"")),"top"===r?(b=null,o.css("position",f.offsetParent?"":"relative"),m&&o.css("width",""),o.css("top","")):"bottom"===r?(b=f.offsetUnpin?-(1*f.offsetUnpin):t.top-e,m&&o.css("width",""),o.css("position",f.offsetParent?"":"relative"),o.css("top",f.offsetParent?"":i[0].offsetHeight-y-n-h+"px")):(b=null,m&&o.css("width",o[0].offsetWidth+"px"),o.css("position","fixed"),o.css("top",$+"px")))},d.$onResize=function(){d.$parseOffsets(),d.checkPosition()},d.$debouncedOnResize=n(d.$onResize,50),d.$parseOffsets=function(){var e=o.css("position");o.css("position",f.offsetParent?"":"relative"),f.offsetTop&&("auto"===f.offsetTop&&(f.offsetTop="+0"),f.offsetTop.match(/^[-+]\d+$/)?($=1*-f.offsetTop,v=f.offsetParent?a.offset(D[0]).top+1*f.offsetTop:a.offset(o[0]).top-a.css(o[0],"marginTop",!0)+1*f.offsetTop):v=1*f.offsetTop),f.offsetBottom&&(y=f.offsetParent&&f.offsetBottom.match(/^[-+]\d+$/)?c()-(a.offset(D[0]).top+a.height(D[0]))+1*f.offsetBottom+1:1*f.offsetBottom),o.css("position",e)},d.init(),d}var i=angular.element(t.document.body),r=angular.element(t);return o}]}).directive("bsAffix",["$affix","$window",function(e,t){return{restrict:"EAC",require:"^?bsAffixTarget",link:function(n,a,o,i){var r={scope:n,offsetTop:"auto",target:i?i.$element:angular.element(t)};angular.forEach(["offsetTop","offsetBottom","offsetParent","offsetUnpin"],function(e){angular.isDefined(o[e])&&(r[e]=o[e])});var s=e(a,r);n.$on("$destroy",function(){s&&s.destroy(),r=null,s=null})}}}]).directive("bsAffixTarget",function(){return{controller:["$element",function(e){this.$element=e}]}}),angular.module("mgcrea.ngStrap.alert",["mgcrea.ngStrap.modal"]).provider("$alert",function(){var e=this.defaults={animation:"am-fade",prefixClass:"alert",prefixEvent:"alert",placement:null,template:"alert/alert.tpl.html",container:!1,element:null,backdrop:!1,keyboard:!0,show:!0,duration:!1,type:!1,dismissable:!0};this.$get=["$modal","$timeout",function(t,n){function a(a){var o={},i=angular.extend({},e,a);o=t(i),o.$scope.dismissable=!!i.dismissable,i.type&&(o.$scope.type=i.type);var r=o.show;return i.duration&&(o.show=function(){r(),n(function(){o.hide()},1e3*i.duration)}),o}return a}]}).directive("bsAlert",["$window","$sce","$alert",function(e,t,n){e.requestAnimationFrame||e.setTimeout;return{restrict:"EAC",scope:!0,link:function(e,a,o){var i={scope:e,element:a,show:!1};angular.forEach(["template","placement","keyboard","html","container","animation","duration","dismissable"],function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),angular.forEach(["title","content","type"],function(n){o[n]&&o.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),o.bsAlert&&e.$watch(o.bsAlert,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var r=n(i);a.on(o.trigger||"click",r.toggle),e.$on("$destroy",function(){r&&r.destroy(),i=null,r=null})}}}]),angular.module("mgcrea.ngStrap.button",[]).provider("$button",function(){var e=this.defaults={activeClass:"active",toggleEvent:"click"};this.$get=function(){return{defaults:e}}}).directive("bsCheckboxGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var n=e[0].querySelectorAll('input[type="checkbox"]');angular.forEach(n,function(e){var n=angular.element(e);n.attr("bs-checkbox",""),n.attr("ng-model",t.ngModel+"."+n.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function(e,t){var n=e.defaults,a=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,o,i,r){var s=n,l="INPUT"===o[0].nodeName,u=l?o.parent():o,c=angular.isDefined(i.trueValue)?i.trueValue:!0;a.test(i.trueValue)&&(c=e.$eval(i.trueValue));var d=angular.isDefined(i.falseValue)?i.falseValue:!1;a.test(i.falseValue)&&(d=e.$eval(i.falseValue));var f="boolean"!=typeof c||"boolean"!=typeof d;f&&(r.$parsers.push(function(e){return e?c:d}),r.$formatters.push(function(e){return angular.equals(e,c)}),e.$watch(i.ngModel,function(){r.$render()})),r.$render=function(){var e=angular.equals(r.$modelValue,c);t(function(){l&&(o[0].checked=e),u.toggleClass(s.activeClass,e)})},o.bind(s.toggleEvent,function(){e.$apply(function(){l||r.$setViewValue(!u.hasClass("active")),f||r.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var n=e[0].querySelectorAll('input[type="radio"]');angular.forEach(n,function(e){angular.element(e).attr("bs-radio",""),angular.element(e).attr("ng-model",t.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function(e,t){var n=e.defaults,a=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,o,i,r){var s=n,l="INPUT"===o[0].nodeName,u=l?o.parent():o,c=a.test(i.value)?e.$eval(i.value):i.value;r.$render=function(){var e=angular.equals(r.$modelValue,c);t(function(){l&&(o[0].checked=e),u.toggleClass(s.activeClass,e)})},o.bind(s.toggleEvent,function(){e.$apply(function(){r.$setViewValue(c),r.$render()})})}}}]),angular.module("mgcrea.ngStrap.datepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$datepicker",function(){var e=this.defaults={animation:"am-fade",prefixClass:"datepicker",placement:"bottom-left",template:"datepicker/datepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!1,dateType:"date",dateFormat:"shortDate",modelDateFormat:null,dayFormat:"dd",monthFormat:"MMM",yearFormat:"yyyy",monthTitleFormat:"MMMM yyyy",yearTitleFormat:"yyyy",strictFormat:!1,autoclose:!1,minDate:-1/0,maxDate:+1/0,startView:0,minView:0,startWeek:0,daysOfWeekDisabled:"",iconLeft:"glyphicon glyphicon-chevron-left",iconRight:"glyphicon glyphicon-chevron-right"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","datepickerViews","$tooltip","$timeout",function(t,n,a,o,i,r,s,l){function u(t,n,a){function o(e){e.selected=u.$isSelected(e.date)}function i(){t[0].focus()}var u=s(t,angular.extend({},e,a)),f=a.scope,p=u.$options,g=u.$scope;p.startView&&(p.startView-=p.minView);var m=r(u);u.$views=m.views;var $=m.viewDate;g.$mode=p.startView,g.$iconLeft=p.iconLeft,g.$iconRight=p.iconRight;var h=u.$views[g.$mode];g.$select=function(e){u.select(e)},g.$selectPane=function(e){u.$selectPane(e)},g.$toggleMode=function(){u.setMode((g.$mode+1)%u.$views.length)},u.update=function(e){angular.isDate(e)&&!isNaN(e.getTime())&&(u.$date=e,h.update.call(h,e)),u.$build(!0)},u.updateDisabledDates=function(e){p.disabledDateRanges=e;for(var t=0,n=g.rows.length;n>t;t++)angular.forEach(g.rows[t],u.$setDisabledEl)},u.select=function(e,t){angular.isDate(n.$dateValue)||(n.$dateValue=new Date(e)),!g.$mode||t?(n.$setViewValue(angular.copy(e)),n.$render(),p.autoclose&&!t&&l(function(){u.hide(!0)})):(angular.extend($,{year:e.getFullYear(),month:e.getMonth(),date:e.getDate()}),u.setMode(g.$mode-1),u.$build())},u.setMode=function(e){g.$mode=e,h=u.$views[g.$mode],u.$build()},u.$build=function(e){e===!0&&h.built||(e!==!1||h.built)&&h.build.call(h)},u.$updateSelected=function(){for(var e=0,t=g.rows.length;t>e;e++)angular.forEach(g.rows[e],o)},u.$isSelected=function(e){return h.isSelected(e)},u.$setDisabledEl=function(e){e.disabled=h.isDisabled(e.date)},u.$selectPane=function(e){var t=h.steps,n=new Date(Date.UTC($.year+(t.year||0)*e,$.month+(t.month||0)*e,1));angular.extend($,{year:n.getUTCFullYear(),month:n.getUTCMonth(),date:n.getUTCDate()}),u.$build()},u.$onMouseDown=function(e){if(e.preventDefault(),e.stopPropagation(),d){var t=angular.element(e.target);"button"!==t[0].nodeName.toLowerCase()&&(t=t.parent()),t.triggerHandler("click")}},u.$onKeyDown=function(e){if(/(38|37|39|40|13)/.test(e.keyCode)&&!e.shiftKey&&!e.altKey){if(e.preventDefault(),e.stopPropagation(),13===e.keyCode)return g.$mode?g.$apply(function(){u.setMode(g.$mode-1)}):u.hide(!0);h.onKeyDown(e),f.$digest()}};var v=u.init;u.init=function(){return c&&p.useNative?(t.prop("type","date"),void t.css("-webkit-appearance","textfield")):(d&&(t.prop("type","text"),t.attr("readonly","true"),t.on("click",i)),void v())};var y=u.destroy;u.destroy=function(){c&&p.useNative&&t.off("click",i),y()};var w=u.show;u.show=function(){w(),l(function(){u.$element.on(d?"touchstart":"mousedown",u.$onMouseDown),p.keyboard&&t.on("keydown",u.$onKeyDown)},0,!1)};var b=u.hide;return u.hide=function(e){u.$isShown&&(u.$element.off(d?"touchstart":"mousedown",u.$onMouseDown),p.keyboard&&t.off("keydown",u.$onKeyDown),b(e))},u}var c=(angular.element(t.document.body),/(ip(a|o)d|iphone|android)/gi.test(t.navigator.userAgent)),d="createTouch"in t.document&&c;return e.lang||(e.lang=i.getDefaultLocale()),u.defaults=e,u}]}).directive("bsDatepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$datepicker",function(e,t,n,a,o,i){var r=(i.defaults,/(ip(a|o)d|iphone|android)/gi.test(e.navigator.userAgent));return{restrict:"EAC",require:"ngModel",link:function(e,t,n,s){function l(e){return e&&e.length?e:null}function u(e){if(angular.isDate(e)){var t=isNaN(f.$options.minDate)||e.getTime()>=f.$options.minDate,n=isNaN(f.$options.maxDate)||e.getTime()<=f.$options.maxDate,a=t&&n;s.$setValidity("date",a),s.$setValidity("min",t),s.$setValidity("max",n),a&&(s.$dateValue=e)}}function c(){return!s.$dateValue||isNaN(s.$dateValue.getTime())?"":g(s.$dateValue,d.dateFormat)}var d={scope:e,controller:s};angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","autoclose","dateType","dateFormat","modelDateFormat","dayFormat","strictFormat","startWeek","startDate","useNative","lang","startView","minView","iconLeft","iconRight","daysOfWeekDisabled"],function(e){angular.isDefined(n[e])&&(d[e]=n[e])}),n.bsShow&&e.$watch(n.bsShow,function(e){f&&angular.isDefined(e)&&(angular.isString(e)&&(e=!!e.match(/true|,?(datepicker),?/i)),e===!0?f.show():f.hide())});var f=i(t,s,d);d=f.$options,r&&d.useNative&&(d.dateFormat="yyyy-MM-dd");var p=d.lang,g=function(e,t){return a.formatDate(e,t,p)},m=o({format:d.dateFormat,lang:p,strict:d.strictFormat});angular.forEach(["minDate","maxDate"],function(e){angular.isDefined(n[e])&&n.$observe(e,function(t){f.$options[e]=m.getDateForAttribute(e,t),!isNaN(f.$options[e])&&f.$build(!1),u(s.$dateValue)})}),e.$watch(n.ngModel,function(){f.update(s.$dateValue)},!0),angular.isDefined(n.disabledDates)&&e.$watch(n.disabledDates,function(e,t){e=l(e),t=l(t),e&&f.updateDisabledDates(e)}),s.$parsers.unshift(function(e){if(!e)return s.$setValidity("date",!0),null;var t=m.parse(e,s.$dateValue);return!t||isNaN(t.getTime())?void s.$setValidity("date",!1):(u(t),"string"===d.dateType?g(t,d.modelDateFormat||d.dateFormat):"number"===d.dateType?s.$dateValue.getTime():"unix"===d.dateType?s.$dateValue.getTime()/1e3:"iso"===d.dateType?s.$dateValue.toISOString():new Date(s.$dateValue))}),s.$formatters.push(function(e){var t;return t=angular.isUndefined(e)||null===e?0/0:angular.isDate(e)?e:"string"===d.dateType?m.parse(e,null,d.modelDateFormat):new Date("unix"===d.dateType?1e3*e:e),s.$dateValue=t,c()}),s.$render=function(){t.val(c())},e.$on("$destroy",function(){f&&f.destroy(),d=null,f=null})}}}]).provider("datepickerViews",function(){function e(e,t){for(var n=[];e.length>0;)n.push(e.splice(0,t));return n}function t(e,t){return(e%t+t)%t}this.defaults={dayFormat:"dd",daySplit:7};this.$get=["$dateFormatter","$dateParser","$sce",function(n,a,o){return function(i){var r=i.$scope,s=i.$options,l=s.lang,u=function(e,t){return n.formatDate(e,t,l)},c=a({format:s.dateFormat,lang:l,strict:s.strictFormat}),d=n.weekdaysShort(l),f=d.slice(s.startWeek).concat(d.slice(0,s.startWeek)),p=o.trustAsHtml(''+f.join(' ')+" "),g=i.$date||(s.startDate?c.getDateForAttribute("startDate",s.startDate):new Date),m={year:g.getFullYear(),month:g.getMonth(),date:g.getDate()},$=(6e4*g.getTimezoneOffset(),[{format:s.dayFormat,split:7,steps:{month:1},update:function(e,t){!this.built||t||e.getFullYear()!==m.year||e.getMonth()!==m.month?(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$build()):e.getDate()!==m.date&&(m.date=i.$date.getDate(),i.$updateSelected())},build:function(){var n=new Date(m.year,m.month,1),a=n.getTimezoneOffset(),o=new Date(+n-864e5*t(n.getDay()-s.startWeek,7)),l=o.getTimezoneOffset(),d=(new Date).toDateString();l!==a&&(o=new Date(+o+6e4*(l-a)));for(var f,g=[],$=0;42>$;$++)f=c.daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth(),o.getDate()+$)),g.push({date:f,isToday:f.toDateString()===d,label:u(f,this.format),selected:i.$date&&this.isSelected(f),muted:f.getMonth()!==m.month,disabled:this.isDisabled(f)});r.title=u(n,s.monthTitleFormat),r.showLabels=!0,r.labels=p,r.rows=e(g,this.split),this.built=!0},isSelected:function(e){return i.$date&&e.getFullYear()===i.$date.getFullYear()&&e.getMonth()===i.$date.getMonth()&&e.getDate()===i.$date.getDate()},isDisabled:function(e){var t=e.getTime();if(ts.maxDate)return!0;if(-1!==s.daysOfWeekDisabled.indexOf(e.getDay()))return!0;if(s.disabledDateRanges)for(var n=0;n=s.disabledDateRanges[n].start&&t<=s.disabledDateRanges[n].end)return!0;return!1},onKeyDown:function(e){if(i.$date){var t,n=i.$date.getTime();37===e.keyCode?t=new Date(n-864e5):38===e.keyCode?t=new Date(n-6048e5):39===e.keyCode?t=new Date(n+864e5):40===e.keyCode&&(t=new Date(n+6048e5)),this.isDisabled(t)||i.select(t,!0)}}},{name:"month",format:s.monthFormat,split:4,steps:{year:1},update:function(e){this.built&&e.getFullYear()===m.year?e.getMonth()!==m.month&&(angular.extend(m,{month:i.$date.getMonth(),date:i.$date.getDate()}),i.$updateSelected()):(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$build())},build:function(){for(var t,n=(new Date(m.year,0,1),[]),a=0;12>a;a++)t=new Date(m.year,a,1),n.push({date:t,label:u(t,this.format),selected:i.$isSelected(t),disabled:this.isDisabled(t)});r.title=u(t,s.yearTitleFormat),r.showLabels=!1,r.rows=e(n,this.split),this.built=!0},isSelected:function(e){return i.$date&&e.getFullYear()===i.$date.getFullYear()&&e.getMonth()===i.$date.getMonth()},isDisabled:function(e){var t=+new Date(e.getFullYear(),e.getMonth()+1,0);return ts.maxDate},onKeyDown:function(e){if(i.$date){var t=i.$date.getMonth(),n=new Date(i.$date);37===e.keyCode?n.setMonth(t-1):38===e.keyCode?n.setMonth(t-4):39===e.keyCode?n.setMonth(t+1):40===e.keyCode&&n.setMonth(t+4),this.isDisabled(n)||i.select(n,!0)}}},{name:"year",format:s.yearFormat,split:4,steps:{year:12},update:function(e,t){!this.built||t||parseInt(e.getFullYear()/20,10)!==parseInt(m.year/20,10)?(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$build()):e.getFullYear()!==m.year&&(angular.extend(m,{year:i.$date.getFullYear(),month:i.$date.getMonth(),date:i.$date.getDate()}),i.$updateSelected())},build:function(){for(var t,n=m.year-m.year%(3*this.split),a=[],o=0;12>o;o++)t=new Date(n+o,0,1),a.push({date:t,label:u(t,this.format),selected:i.$isSelected(t),disabled:this.isDisabled(t)});r.title=a[0].label+"-"+a[a.length-1].label,r.showLabels=!1,r.rows=e(a,this.split),this.built=!0},isSelected:function(e){return i.$date&&e.getFullYear()===i.$date.getFullYear()},isDisabled:function(e){var t=+new Date(e.getFullYear()+1,0,0);return ts.maxDate},onKeyDown:function(e){if(i.$date){var t=i.$date.getFullYear(),n=new Date(i.$date);37===e.keyCode?n.setYear(t-1):38===e.keyCode?n.setYear(t-4):39===e.keyCode?n.setYear(t+1):40===e.keyCode&&n.setYear(t+4),this.isDisabled(n)||i.select(n,!0)}}}]);return{views:s.minView?Array.prototype.slice.call($,s.minView):$,viewDate:m}}}]}),angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var e=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1,allowMultiple:!1},t=this.controller=function(t,n,a){function o(e){for(var t=l.$targets.$active,n=0;n0?n--:40===e.keyCode&&no;o++)if(e[o].toLowerCase()===a)return o;return-1}e.prototype.setMilliseconds=function(e){this.milliseconds=e},e.prototype.setSeconds=function(e){this.seconds=e},e.prototype.setMinutes=function(e){this.minutes=e},e.prototype.setHours=function(e){this.hours=e},e.prototype.getHours=function(){return this.hours},e.prototype.setDate=function(e){this.day=e},e.prototype.setMonth=function(e){this.month=e},e.prototype.setFullYear=function(e){this.year=e},e.prototype.fromDate=function(e){return this.year=e.getFullYear(),this.month=e.getMonth(),this.day=e.getDate(),this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this.milliseconds=e.getMilliseconds(),this},e.prototype.toDate=function(){return new Date(this.year,this.month,this.day,this.hours,this.minutes,this.seconds,this.milliseconds)};var o=e.prototype,i=this.defaults={format:"shortDate",strict:!1};this.$get=["$locale","dateFilter",function(r,s){var l=function(l){function u(e){var t,n=Object.keys(h),a=[],o=[],i=e;for(t=0;t1){var r=i.search(n[t]);e=e.split(n[t]).join(""),h[n[t]]&&(a[r]=h[n[t]])}return angular.forEach(a,function(e){e&&o.push(e)}),o}function c(e){return e.replace(/\//g,"[\\/]").replace("/-/g","[-]").replace(/\./g,"[.]").replace(/\\s/g,"[\\s]")}function d(e){var t,n=Object.keys($),a=e;for(t=0;t12?e.getHours()+2:0),e):null},m.init(),m};return l}]}]),angular.module("mgcrea.ngStrap.helpers.debounce",[]).factory("debounce",["$timeout",function(e){return function(t,n,a){var o=null;return function(){var i=this,r=arguments,s=a&&!o;return o&&e.cancel(o),o=e(function(){o=null,a||t.apply(i,r)},n,!1),s&&t.apply(i,r),o}}}]).factory("throttle",["$timeout",function(e){return function(t,n,a){var o=null;return a||(a={}),function(){var i=this,r=arguments;o||(a.leading!==!1&&t.apply(i,r),o=e(function(){o=null,a.trailing!==!1&&t.apply(i,r)},n,!1))}}}]),angular.module("mgcrea.ngStrap.helpers.dimensions",[]).factory("dimensions",["$document","$window",function(){var t=(angular.element,{}),n=t.nodeName=function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()};t.css=function(t,n,a){var o;return o=t.currentStyle?t.currentStyle[n]:e.getComputedStyle?e.getComputedStyle(t)[n]:t.style[n],a===!0?parseFloat(o)||0:o},t.offset=function(t){var n=t.getBoundingClientRect(),a=t.ownerDocument;return{width:n.width||t.offsetWidth,height:n.height||t.offsetHeight,top:n.top+(e.pageYOffset||a.documentElement.scrollTop)-(a.documentElement.clientTop||0),left:n.left+(e.pageXOffset||a.documentElement.scrollLeft)-(a.documentElement.clientLeft||0)}},t.position=function(e){var o,i,r={top:0,left:0};return"fixed"===t.css(e,"position")?i=e.getBoundingClientRect():(o=a(e),i=t.offset(e),n(o,"html")||(r=t.offset(o)),r.top+=t.css(o,"borderTopWidth",!0),r.left+=t.css(o,"borderLeftWidth",!0)),{width:e.offsetWidth,height:e.offsetHeight,top:i.top-r.top-t.css(e,"marginTop",!0),left:i.left-r.left-t.css(e,"marginLeft",!0)}};var a=function(e){var a=e.ownerDocument,o=e.offsetParent||a;if(n(o,"#document"))return a.documentElement;for(;o&&!n(o,"html")&&"static"===t.css(o,"position");)o=o.offsetParent;return o||a.documentElement};return t.height=function(e,n){var a=e.offsetHeight;return n?a+=t.css(e,"marginTop",!0)+t.css(e,"marginBottom",!0):a-=t.css(e,"paddingTop",!0)+t.css(e,"paddingBottom",!0)+t.css(e,"borderTopWidth",!0)+t.css(e,"borderBottomWidth",!0),a},t.width=function(e,n){var a=e.offsetWidth;return n?a+=t.css(e,"marginLeft",!0)+t.css(e,"marginRight",!0):a-=t.css(e,"paddingLeft",!0)+t.css(e,"paddingRight",!0)+t.css(e,"borderLeftWidth",!0)+t.css(e,"borderRightWidth",!0),a},t}]),angular.module("mgcrea.ngStrap.helpers.parseOptions",[]).provider("$parseOptions",function(){var e=this.defaults={regexp:/^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/};this.$get=["$parse","$q",function(t,n){function a(a,o){function i(e,t){return e.map(function(e,n){var a,o,i={};return i[c]=e,a=u(t,i),o=p(t,i),{label:a,value:o,index:n}})}var r={},s=angular.extend({},e,o);r.$values=[];var l,u,c,d,f,p,g;return r.init=function(){r.$match=l=a.match(s.regexp),u=t(l[2]||l[1]),c=l[4]||l[6],d=l[5],f=t(l[3]||""),p=t(l[2]?l[1]:c),g=t(l[7])},r.valuesFn=function(e,t){return n.when(g(e,t)).then(function(t){return r.$values=t?i(t,e):{},r.$values})},r.displayValue=function(e){var t={};return t[c]=e,u(t)},r.init(),r}return a}]}),angular.version.minor<3&&angular.version.dot<14&&angular.module("ng").factory("$$rAF",["$window","$timeout",function(e,t){var n=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame,a=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame||e.webkitCancelRequestAnimationFrame,o=!!n,i=o?function(e){var t=n(e);return function(){a(t)}}:function(e){var n=t(e,16.66,!1);return function(){t.cancel(n)}};return i.supported=o,i}]),angular.module("mgcrea.ngStrap.aside",["mgcrea.ngStrap.modal"]).provider("$aside",function(){var e=this.defaults={animation:"am-fade-and-slide-right",prefixClass:"aside",prefixEvent:"aside",placement:"right",template:"aside/aside.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$modal",function(t){function n(n){var a={},o=angular.extend({},e,n);return a=t(o)}return n}]}).directive("bsAside",["$window","$sce","$aside",function(e,t,n){e.requestAnimationFrame||e.setTimeout;
+return{restrict:"EAC",scope:!0,link:function(e,a,o){var i={scope:e,element:a,show:!1};angular.forEach(["template","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),angular.forEach(["title","content"],function(n){o[n]&&o.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),o.bsAside&&e.$watch(o.bsAside,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var r=n(i);a.on(o.trigger||"click",r.toggle),e.$on("$destroy",function(){r&&r.destroy(),i=null,r=null})}}}]),angular.module("mgcrea.ngStrap.modal",["mgcrea.ngStrap.helpers.dimensions"]).provider("$modal",function(){var e=this.defaults={animation:"am-fade",backdropAnimation:"am-fade",prefixClass:"modal",prefixEvent:"modal",placement:"top",template:"modal/modal.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$window","$rootScope","$compile","$q","$templateCache","$http","$animate","$timeout","$sce","dimensions",function(n,a,o,i,r,s,l,u,c){function d(t){function n(){w.$emit(d.prefixEvent+".show",u)}function i(){w.$emit(d.prefixEvent+".hide",u),v.removeClass(d.prefixClass+"-open"),d.animation&&v.removeClass(d.prefixClass+"-with-"+d.animation)}function r(e){e.target===e.currentTarget&&("static"===d.backdrop?u.focus():u.hide())}function s(e){e.preventDefault()}var u={},d=u.$options=angular.extend({},e,t);u.$promise=g(d.template);var w=u.$scope=d.scope&&d.scope.$new()||a.$new();d.element||d.container||(d.container="body"),m(["title","content"],function(e){d[e]&&(w[e]=c.trustAsHtml(d[e]))}),w.$hide=function(){w.$$postDigest(function(){u.hide()})},w.$show=function(){w.$$postDigest(function(){u.show()})},w.$toggle=function(){w.$$postDigest(function(){u.toggle()})},u.$isShown=w.$isShown=!1,d.contentTemplate&&(u.$promise=u.$promise.then(function(e){var n=angular.element(e);return g(d.contentTemplate).then(function(e){var a=p('[ng-bind="content"]',n[0]).removeAttr("ng-bind").html(e);return t.template||a.next().remove(),n[0].outerHTML})}));var b,D,k=angular.element('
');return u.$promise.then(function(e){angular.isObject(e)&&(e=e.data),d.html&&(e=e.replace(y,'ng-bind-html="')),e=$.apply(e),b=o(e),u.init()}),u.init=function(){d.show&&w.$$postDigest(function(){u.show()})},u.destroy=function(){D&&(D.remove(),D=null),k&&(k.remove(),k=null),w.$destroy()},u.show=function(){if(!u.$isShown&&!w.$emit(d.prefixEvent+".show.before",u).defaultPrevented){var e,t;angular.isElement(d.container)?(e=d.container,t=d.container[0].lastChild?angular.element(d.container[0].lastChild):null):d.container?(e=p(d.container),t=e[0].lastChild?angular.element(e[0].lastChild):null):(e=null,t=d.element),D=u.$element=b(w,function(){}),D.css({display:"block"}).addClass(d.placement),d.animation&&(d.backdrop&&k.addClass(d.backdropAnimation),D.addClass(d.animation)),d.backdrop&&l.enter(k,v,null);var a=l.enter(D,e,t,n);a&&a.then&&a.then(n),u.$isShown=w.$isShown=!0,f(w);var o=D[0];h(function(){o.focus()}),v.addClass(d.prefixClass+"-open"),d.animation&&v.addClass(d.prefixClass+"-with-"+d.animation),d.backdrop&&(D.on("click",r),k.on("click",r),k.on("wheel",s)),d.keyboard&&D.on("keyup",u.$onKeyUp)}},u.hide=function(){if(u.$isShown&&!w.$emit(d.prefixEvent+".hide.before",u).defaultPrevented){var e=l.leave(D,i);e&&e.then&&e.then(i),d.backdrop&&l.leave(k),u.$isShown=w.$isShown=!1,f(w),d.backdrop&&(D.off("click",r),k.off("click",r),k.off("wheel",s)),d.keyboard&&D.off("keyup",u.$onKeyUp)}},u.toggle=function(){u.$isShown?u.hide():u.show()},u.focus=function(){D[0].focus()},u.$onKeyUp=function(e){27===e.which&&u.$isShown&&(u.hide(),e.stopPropagation())},u}function f(e){e.$$phase||e.$root&&e.$root.$$phase||e.$digest()}function p(e,n){return angular.element((n||t).querySelectorAll(e))}function g(e){return w[e]?w[e]:w[e]=i.when(r.get(e)||s.get(e)).then(function(t){return angular.isObject(t)?(r.put(e,t.data),t.data):t})}var m=angular.forEach,$=String.prototype.trim,h=n.requestAnimationFrame||n.setTimeout,v=angular.element(n.document.body),y=/ng-bind="/gi,w={};return d}]}).directive("bsModal",["$window","$sce","$modal",function(e,t,n){return{restrict:"EAC",scope:!0,link:function(e,a,o){var i={scope:e,element:a,show:!1};angular.forEach(["template","contentTemplate","placement","backdrop","keyboard","html","container","animation"],function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),angular.forEach(["title","content"],function(n){o[n]&&o.$observe(n,function(a){e[n]=t.trustAsHtml(a)})}),o.bsModal&&e.$watch(o.bsModal,function(t){angular.isObject(t)?angular.extend(e,t):e.content=t},!0);var r=n(i);a.on(o.trigger||"click",r.toggle),e.$on("$destroy",function(){r&&r.destroy(),i=null,r=null})}}}]),angular.module("mgcrea.ngStrap.navbar",[]).provider("$navbar",function(){var e=this.defaults={activeClass:"active",routeAttr:"data-match-route",strict:!1};this.$get=function(){return{defaults:e}}}).directive("bsNavbar",["$window","$location","$navbar",function(e,t,n){var a=n.defaults;return{restrict:"A",link:function(e,n,o){var i=angular.copy(a);angular.forEach(Object.keys(a),function(e){angular.isDefined(o[e])&&(i[e]=o[e])}),e.$watch(function(){return t.path()},function(e){var t=n[0].querySelectorAll("li["+i.routeAttr+"]");angular.forEach(t,function(t){var n=angular.element(t),a=n.attr(i.routeAttr).replace("/","\\/");i.strict&&(a="^"+a+"$");var o=new RegExp(a,["i"]);o.test(e)?n.addClass(i.activeClass):n.removeClass(i.activeClass)})})}}}]),angular.module("mgcrea.ngStrap.scrollspy",["mgcrea.ngStrap.helpers.debounce","mgcrea.ngStrap.helpers.dimensions"]).provider("$scrollspy",function(){var e=this.$$spies={},n=this.defaults={debounce:150,throttle:100,offset:100};this.$get=["$window","$document","$rootScope","dimensions","debounce","throttle",function(a,o,i,r,s,l){function u(e,t){return e[0].nodeName&&e[0].nodeName.toLowerCase()===t.toLowerCase()}function c(o){var c=angular.extend({},n,o);c.element||(c.element=p);var g=u(c.element,"body"),m=g?d:c.element,$=g?"window":c.id;if(e[$])return e[$].$$count++,e[$];var h,v,y,w,b,D,k,T,S={},x=S.$trackedElements=[],C=[];return S.init=function(){this.$$count=1,w=s(this.checkPosition,c.debounce),b=l(this.checkPosition,c.throttle),m.on("click",this.checkPositionWithEventLoop),d.on("resize",w),m.on("scroll",b),D=s(this.checkOffsets,c.debounce),h=i.$on("$viewContentLoaded",D),v=i.$on("$includeContentLoaded",D),D(),$&&(e[$]=S)},S.destroy=function(){this.$$count--,this.$$count>0||(m.off("click",this.checkPositionWithEventLoop),d.off("resize",w),m.off("scroll",b),h(),v(),$&&delete e[$])},S.checkPosition=function(){if(C.length){if(T=(g?a.pageYOffset:m.prop("scrollTop"))||0,k=Math.max(a.innerHeight,f.prop("clientHeight")),TC[e+1].offsetTop))return S.$activateElement(C[e])}},S.checkPositionWithEventLoop=function(){setTimeout(S.checkPosition,1)},S.$activateElement=function(e){if(y){var t=S.$getTrackedElement(y);t&&(t.source.removeClass("active"),u(t.source,"li")&&u(t.source.parent().parent(),"li")&&t.source.parent().parent().removeClass("active"))}y=e.target,e.source.addClass("active"),u(e.source,"li")&&u(e.source.parent().parent(),"li")&&e.source.parent().parent().addClass("active")},S.$getTrackedElement=function(e){return x.filter(function(t){return t.target===e})[0]},S.checkOffsets=function(){angular.forEach(x,function(e){var n=t.querySelector(e.target);e.offsetTop=n?r.offset(n).top:null,c.offset&&null!==e.offsetTop&&(e.offsetTop-=1*c.offset)}),C=x.filter(function(e){return null!==e.offsetTop}).sort(function(e,t){return e.offsetTop-t.offsetTop}),w()},S.trackElement=function(e,t){x.push({target:e,source:t})},S.untrackElement=function(e,t){for(var n,a=x.length;a--;)if(x[a].target===e&&x[a].source===t){n=a;break}x=x.splice(n,1)},S.activate=function(e){x[e].addClass("active")},S.init(),S}var d=angular.element(a),f=angular.element(o.prop("documentElement")),p=angular.element(a.document.body);return c}]}).directive("bsScrollspy",["$rootScope","debounce","dimensions","$scrollspy",function(e,t,n,a){return{restrict:"EAC",link:function(e,t,n){var o={scope:e};angular.forEach(["offset","target"],function(e){angular.isDefined(n[e])&&(o[e]=n[e])});var i=a(o);i.trackElement(o.target,t),e.$on("$destroy",function(){i&&(i.untrackElement(o.target,t),i.destroy()),o=null,i=null})}}}]).directive("bsScrollspyList",["$rootScope","debounce","dimensions","$scrollspy",function(){return{restrict:"A",compile:function(e){var t=e[0].querySelectorAll("li > a[href]");angular.forEach(t,function(e){var t=angular.element(e);t.parent().attr("bs-scrollspy","").attr("data-target",t.attr("href"))})}}}]),angular.module("mgcrea.ngStrap.progressbar",[]).provider("$progressbar",function(){var e={barType:"",animate:function(){return!0}};this.$get=function(){return{defaults:e}}}).directive("bsProgressbar",["$progressbar",function(e){return{restrict:"E",transclude:!0,replace:!0,templateUrl:"progressbar/progressbar.tpl.html",scope:{value:"=",type:"@",animate:"&"},link:function(t){t.type=t.type||e.defaults.barType,t.animate=angular.isDefined(t.animate())?t.animate:e.defaults.animate,console.log(t.animate(),e.defaults.animate,angular.isDefined(t.animate)),t.$watch("type",function(){t.barClass=t.type?"progress-bar-"+t.type:null})}}}]),angular.module("mgcrea.ngStrap.select",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$select",function(){var e=this.defaults={animation:"am-fade",prefixClass:"select",prefixEvent:"$select",placement:"bottom-left",template:"select/select.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,multiple:!1,allNoneButtons:!1,sort:!0,caretHtml:' ',placeholder:"Choose among the following...",allText:"All",noneText:"None",maxLength:3,maxLengthHtml:"selected",iconCheckmark:"glyphicon glyphicon-ok"};this.$get=["$window","$document","$rootScope","$tooltip","$timeout",function(t,n,a,o,i){function r(t,n,a){var r={},s=angular.extend({},e,a);r=o(t,s);var u=r.$scope;u.$matches=[],u.$activeIndex=0,u.$isMultiple=s.multiple,u.$showAllNoneButtons=s.allNoneButtons&&s.multiple,u.$iconCheckmark=s.iconCheckmark,u.$allText=s.allText,u.$noneText=s.noneText,u.$activate=function(e){u.$$postDigest(function(){r.activate(e)})},u.$select=function(e){u.$$postDigest(function(){r.select(e)})},u.$isVisible=function(){return r.$isVisible()},u.$isActive=function(e){return r.$isActive(e)},u.$selectAll=function(){for(var e=0;e=u.$matches.length&&(u.$activeIndex=s.multiple?[]:0)},r.$isVisible=function(){return s.minLength&&n?u.$matches.length&&n.$viewValue.length>=s.minLength:u.$matches.length},r.$isActive=function(e){return s.multiple?-1!==u.$activeIndex.indexOf(e):u.$activeIndex===e},r.$getIndex=function(e){var t=u.$matches.length,n=t;if(t){for(n=t;n--&&u.$matches[n].value!==e;);if(!(0>n))return n}},r.$onMouseDown=function(e){if(e.preventDefault(),e.stopPropagation(),l){var t=angular.element(e.target);t.triggerHandler("click")}},r.$onKeyDown=function(e){if(/(9|13|38|40)/.test(e.keyCode)){if(e.preventDefault(),e.stopPropagation(),!s.multiple&&(13===e.keyCode||9===e.keyCode))return r.select(u.$activeIndex);38===e.keyCode&&u.$activeIndex>0?u.$activeIndex--:40===e.keyCode&&u.$activeIndex'),l.after(t)}var u=o(n.ngOptions),c=a(t,r,s),d=u.$match[7].replace(/\|.+/,"").trim();e.$watch(d,function(){u.valuesFn(e,r).then(function(e){c.update(e),r.$render()})},!0),e.$watch(n.ngModel,function(){c.$updateActiveIndex(),r.$render()},!0),r.$render=function(){var e,n;s.multiple&&angular.isArray(r.$modelValue)?(e=r.$modelValue.map(function(e){return n=c.$getIndex(e),angular.isDefined(n)?c.$scope.$matches[n].label:!1}).filter(angular.isDefined),e=e.length>(s.maxLength||i.maxLength)?e.length+" "+(s.maxLengthHtml||i.maxLengthHtml):e.join(", ")):(n=c.$getIndex(r.$modelValue),e=angular.isDefined(n)?c.$scope.$matches[n].label:!1),t.html((e?e:s.placeholder)+i.caretHtml)},s.multiple&&(r.$isEmpty=function(e){return!e||0===e.length}),e.$on("$destroy",function(){c&&c.destroy(),s=null,c=null})}}}]),angular.module("mgcrea.ngStrap.tab",[]).provider("$tab",function(){var e=this.defaults={animation:"am-fade",template:"tab/tab.tpl.html",navClass:"nav-tabs",activeClass:"active"},t=this.controller=function(t,n,a){var o=this;o.$options=angular.copy(e),angular.forEach(["animation","navClass","activeClass"],function(e){angular.isDefined(a[e])&&(o.$options[e]=a[e])}),t.$navClass=o.$options.navClass,t.$activeClass=o.$options.activeClass,o.$panes=t.$panes=[],o.$activePaneChangeListeners=o.$viewChangeListeners=[],o.$push=function(e){o.$panes.push(e)},o.$remove=function(e){var t=o.$panes.indexOf(e),n=o.$panes.$active;o.$panes.splice(t,1),n>t?n--:t===n&&n===o.$panes.length&&n--,o.$setActive(n)},o.$panes.$active=0,o.$setActive=t.$setActive=function(e){o.$panes.$active=e,o.$activePaneChangeListeners.forEach(function(e){e()})}};this.$get=function(){var n={};return n.defaults=e,n.controller=t,n}}).directive("bsTabs",["$window","$animate","$tab","$parse",function(e,t,n,a){var o=n.defaults;return{require:["?ngModel","bsTabs"],transclude:!0,scope:!0,controller:["$scope","$element","$attrs",n.controller],templateUrl:function(e,t){return t.template||o.template},link:function(e,t,n,o){var i=o[0],r=o[1];if(i&&(console.warn("Usage of ngModel is deprecated, please use bsActivePane instead!"),r.$activePaneChangeListeners.push(function(){i.$setViewValue(r.$panes.$active)}),i.$formatters.push(function(e){return r.$setActive(1*e),e})),n.bsActivePane){var s=a(n.bsActivePane);r.$activePaneChangeListeners.push(function(){s.assign(e,r.$panes.$active)}),e.$watch(n.bsActivePane,function(e){r.$setActive(1*e)},!0)}}}}]).directive("bsPane",["$window","$animate","$sce",function(e,t,n){return{require:["^?ngModel","^bsTabs"],scope:!0,link:function(e,a,o,i){function r(){var n=s.$panes.indexOf(e),o=s.$panes.$active;t[n===o?"addClass":"removeClass"](a,s.$options.activeClass)}var s=(i[0],i[1]);a.addClass("tab-pane"),o.$observe("title",function(t){e.title=n.trustAsHtml(t)}),s.$options.animation&&a.addClass(s.$options.animation),s.$push(e),e.$on("$destroy",function(){s.$remove(e)}),s.$activePaneChangeListeners.push(function(){r()}),r()}}}]),angular.module("mgcrea.ngStrap.popover",["mgcrea.ngStrap.tooltip"]).provider("$popover",function(){var e=this.defaults={animation:"am-fade",customClass:"",container:!1,target:!1,placement:"right",template:"popover/popover.tpl.html",contentTemplate:!1,trigger:"click",keyboard:!0,html:!1,title:"",content:"",delay:0,autoClose:!1};this.$get=["$tooltip",function(t){function n(n,a){var o=angular.extend({},e,a),i=t(n,o);return o.content&&(i.$scope.content=o.content),i}return n}]}).directive("bsPopover",["$window","$sce","$popover",function(e,t,n){var a=e.requestAnimationFrame||e.setTimeout;return{restrict:"EAC",scope:!0,link:function(e,o,i){var r={scope:e};angular.forEach(["template","contentTemplate","placement","container","target","delay","trigger","keyboard","html","animation","customClass","autoClose"],function(e){angular.isDefined(i[e])&&(r[e]=i[e])}),angular.forEach(["title","content"],function(n){i[n]&&i.$observe(n,function(o,i){e[n]=t.trustAsHtml(o),angular.isDefined(i)&&a(function(){s&&s.$applyPlacement()})})}),i.bsPopover&&e.$watch(i.bsPopover,function(t,n){angular.isObject(t)?angular.extend(e,t):e.content=t,angular.isDefined(n)&&a(function(){s&&s.$applyPlacement()})},!0),i.bsShow&&e.$watch(i.bsShow,function(e){s&&angular.isDefined(e)&&(angular.isString(e)&&(e=!!e.match(/true|,?(popover),?/i)),e===!0?s.show():s.hide())});var s=n(o,r);e.$on("$destroy",function(){s&&s.destroy(),r=null,s=null})}}}]),angular.module("mgcrea.ngStrap.tooltip",["mgcrea.ngStrap.helpers.dimensions"]).provider("$tooltip",function(){var e=this.defaults={animation:"am-fade",customClass:"",prefixClass:"tooltip",prefixEvent:"tooltip",container:!1,target:!1,placement:"top",template:"tooltip/tooltip.tpl.html",contentTemplate:!1,trigger:"hover focus",keyboard:!1,html:!1,show:!1,title:"",type:"",delay:0,autoClose:!1,bsEnabled:!0};this.$get=["$window","$rootScope","$compile","$q","$templateCache","$http","$animate","$sce","dimensions","$$rAF","$timeout",function(n,a,o,i,r,s,l,u,c,d,f){function p(n,i){function r(){O.$emit(P.prefixEvent+".show",F)}function s(){return O.$emit(P.prefixEvent+".hide",F),U&&"focus"===P.trigger?n[0].blur():void A()}function p(){var e=P.trigger.split(" ");angular.forEach(e,function(e){"click"===e?n.on("click",F.toggle):"manual"!==e&&(n.on("hover"===e?"mouseenter":"focus",F.enter),n.on("hover"===e?"mouseleave":"blur",F.leave),"button"===V&&"hover"!==e&&n.on(v?"touchstart":"mousedown",F.$onFocusElementMouseDown))})}function b(){for(var e=P.trigger.split(" "),t=e.length;t--;){var a=e[t];"click"===a?n.off("click",F.toggle):"manual"!==a&&(n.off("hover"===a?"mouseenter":"focus",F.enter),n.off("hover"===a?"mouseleave":"blur",F.leave),"button"===V&&"hover"!==a&&n.off(v?"touchstart":"mousedown",F.$onFocusElementMouseDown))}}function D(){"focus"!==P.trigger?R.on("keyup",F.$onKeyUp):n.on("keyup",F.$onFocusKeyUp)}function k(){"focus"!==P.trigger?R.off("keyup",F.$onKeyUp):n.off("keyup",F.$onFocusKeyUp)}function T(){f(function(){R.on("click",x),w.on("click",F.hide),W=!0},0,!1)}function S(){W&&(R.off("click",x),w.off("click",F.hide),W=!1)}function x(e){e.stopPropagation()}function C(e){e=e||P.target||n;var t=e[0],a=t.getBoundingClientRect();null===a.width&&(a=angular.extend({},a,{width:a.right-a.left,height:a.bottom-a.top}));var o;return o="body"===P.container?c.offset(t):c.position(t),angular.extend({},a,o)}function M(e,t,n,a){var o,i=e.split("-");switch(i[0]){case"right":o={top:t.top+t.height/2-a/2,left:t.left+t.width};break;case"bottom":o={top:t.top+t.height,left:t.left+t.width/2-n/2};break;case"left":o={top:t.top+t.height/2-a/2,left:t.left-n};break;default:o={top:t.top-a,left:t.left+t.width/2-n/2}}if(!i[1])return o;if("top"===i[0]||"bottom"===i[0])switch(i[1]){case"left":o.left=t.left;break;case"right":o.left=t.left+t.width-n}else if("left"===i[0]||"right"===i[0])switch(i[1]){case"top":o.top=t.top-a;break;case"bottom":o.top=t.top+t.height}return o}function E(e,t){R.css({top:e+"px",left:t+"px"})}function A(){clearTimeout(H),F.$isShown&&null!==R&&(P.autoClose&&S(),P.keyboard&&k()),K&&(K.$destroy(),K=null),R&&(R.remove(),R=F.$element=null)}var F={},V=n[0].nodeName.toLowerCase(),P=F.$options=angular.extend({},e,i);F.$promise=$(P.template);var O=F.$scope=P.scope&&P.scope.$new()||a.$new();if(P.delay&&angular.isString(P.delay)){var I=P.delay.split(",").map(parseFloat);P.delay=I.length>1?{show:I[0],hide:I[1]}:I[0]}P.title&&(O.title=u.trustAsHtml(P.title)),O.$setEnabled=function(e){O.$$postDigest(function(){F.setEnabled(e)})},O.$hide=function(){O.$$postDigest(function(){F.hide()})},O.$show=function(){O.$$postDigest(function(){F.show()})},O.$toggle=function(){O.$$postDigest(function(){F.toggle()})},F.$isShown=O.$isShown=!1;var H,N;P.contentTemplate&&(F.$promise=F.$promise.then(function(e){var t=angular.element(e);return $(P.contentTemplate).then(function(e){var n=m('[ng-bind="content"]',t[0]);return n.length||(n=m('[ng-bind="title"]',t[0])),n.removeAttr("ng-bind").html(e),t[0].outerHTML})}));var L,R,q,Y,K;F.$promise.then(function(e){angular.isObject(e)&&(e=e.data),P.html&&(e=e.replace(y,'ng-bind-html="')),e=h.apply(e),q=e,L=o(e),F.init()}),F.init=function(){P.delay&&angular.isNumber(P.delay)&&(P.delay={show:P.delay,hide:P.delay}),"self"===P.container?Y=n:angular.isElement(P.container)?Y=P.container:P.container&&(Y=m(P.container)),p(),P.target&&(P.target=angular.isElement(P.target)?P.target:m(P.target)),P.show&&O.$$postDigest(function(){"focus"===P.trigger?n[0].focus():F.show()})},F.destroy=function(){b(),A(),O.$destroy()},F.enter=function(){return clearTimeout(H),N="in",P.delay&&P.delay.show?void(H=setTimeout(function(){"in"===N&&F.show()},P.delay.show)):F.show()},F.show=function(){if(P.bsEnabled&&!F.$isShown){O.$emit(P.prefixEvent+".show.before",F);var e,t;P.container?(e=Y,t=Y[0].lastChild?angular.element(Y[0].lastChild):null):(e=null,t=n),R&&A(),K=F.$scope.$new(),R=F.$element=L(K,function(){}),R.css({top:"-9999px",left:"-9999px",display:"block",visibility:"hidden"}),P.animation&&R.addClass(P.animation),P.type&&R.addClass(P.prefixClass+"-"+P.type),P.customClass&&R.addClass(P.customClass);var a=l.enter(R,e,t,r);a&&a.then&&a.then(r),F.$isShown=O.$isShown=!0,g(O),d(function(){F.$applyPlacement(),R&&R.css({visibility:"visible"})}),P.keyboard&&("focus"!==P.trigger&&F.focus(),D()),P.autoClose&&T()}},F.leave=function(){return clearTimeout(H),N="out",P.delay&&P.delay.hide?void(H=setTimeout(function(){"out"===N&&F.hide()},P.delay.hide)):F.hide()};var U;F.hide=function(e){if(F.$isShown){O.$emit(P.prefixEvent+".hide.before",F),U=e;var t=l.leave(R,s);t&&t.then&&t.then(s),F.$isShown=O.$isShown=!1,g(O),P.keyboard&&null!==R&&k(),P.autoClose&&null!==R&&S()}},F.toggle=function(){F.$isShown?F.leave():F.enter()},F.focus=function(){R[0].focus()},F.setEnabled=function(e){P.bsEnabled=e},F.$applyPlacement=function(){if(R){var a=P.placement,o=/\s?auto?\s?/i,i=o.test(a);i&&(a=a.replace(o,"")||e.placement),R.addClass(P.placement);var r=C(),s=R.prop("offsetWidth"),l=R.prop("offsetHeight");if(i){var u=a,c=P.container?angular.element(t.querySelector(P.container)):n.parent(),d=C(c);u.indexOf("bottom")>=0&&r.bottom+l>d.bottom?a=u.replace("bottom","top"):u.indexOf("top")>=0&&r.top-ld.width?a="right"===u?"left":a.replace("left","right"):("left"===u||"bottom-right"===u||"top-right"===u)&&r.left-st?t+12:t-12),n.$setViewValue(angular.copy(n.$dateValue)),n.$render()}},d.$build=function(){var e,t,n=g.midIndex=parseInt(p.length/2,10),a=[];for(e=0;e1*p.maxTime},g.$arrowAction=function(e,t){"picker"===p.arrowBehavior?d.$setTimeByStep(e,t):d.$moveIndex(e,t)},d.$setTimeByStep=function(e,t){{var n=new Date(d.$date),a=n.getHours(),o=($(n,b).length,n.getMinutes());$(n,k).length}0===t?n.setHours(a-parseInt(p.hourStep,10)*e):n.setMinutes(o-parseInt(p.minuteStep,10)*e),d.select(n,t,!0)},d.$moveIndex=function(e,t){var n;0===t?(n=new Date(1970,0,1,y.hour+e*p.length,y.minute),angular.extend(y,{hour:n.getHours()})):1===t&&(n=new Date(1970,0,1,y.hour,y.minute+e*p.length*p.minuteStep),angular.extend(y,{minute:n.getMinutes()})),d.$build()},d.$onMouseDown=function(e){if("input"!==e.target.nodeName.toLowerCase()&&e.preventDefault(),e.stopPropagation(),c){var t=angular.element(e.target);"button"!==t[0].nodeName.toLowerCase()&&(t=t.parent()),t.triggerHandler("click")}},d.$onKeyDown=function(e){if(/(38|37|39|40|13)/.test(e.keyCode)&&!e.shiftKey&&!e.altKey){if(e.preventDefault(),e.stopPropagation(),13===e.keyCode)return d.hide(!0);var t=new Date(d.$date),n=t.getHours(),a=$(t,b).length,i=t.getMinutes(),r=$(t,k).length,s=/(37|39)/.test(e.keyCode),l=2+1*T;s&&(37===e.keyCode?h=1>h?l-1:h-1:39===e.keyCode&&(h=l-1>h?h+1:0));var u=[0,a];0===h?(38===e.keyCode?t.setHours(n-parseInt(p.hourStep,10)):40===e.keyCode&&t.setHours(n+parseInt(p.hourStep,10)),a=$(t,b).length,u=[0,a]):1===h?(38===e.keyCode?t.setMinutes(i-parseInt(p.minuteStep,10)):40===e.keyCode&&t.setMinutes(i+parseInt(p.minuteStep,10)),r=$(t,k).length,u=[a+1,a+1+r]):2===h&&(s||d.switchMeridian(),u=[a+1+r+1,a+1+r+3]),d.select(t,h,!0),o(u[0],u[1]),f.$digest()}};var S=d.init;d.init=function(){return u&&p.useNative?(t.prop("type","time"),void t.css("-webkit-appearance","textfield")):(c&&(t.prop("type","text"),t.attr("readonly","true"),t.on("click",l)),void S())};var x=d.destroy;d.destroy=function(){u&&p.useNative&&t.off("click",l),x()};var C=d.show;d.show=function(){C(),s(function(){d.$element.on(c?"touchstart":"mousedown",d.$onMouseDown),p.keyboard&&t.on("keydown",d.$onKeyDown)},0,!1)};var M=d.hide;return d.hide=function(e){d.$isShown&&(d.$element.off(c?"touchstart":"mousedown",d.$onMouseDown),p.keyboard&&t.off("keydown",d.$onKeyDown),M(e))},d}var u=(angular.element(t.document.body),/(ip(a|o)d|iphone|android)/gi.test(t.navigator.userAgent)),c="createTouch"in t.document&&u;return e.lang||(e.lang=i.getDefaultLocale()),l.defaults=e,l}]}).directive("bsTimepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$timepicker",function(e,t,n,a,o,i){{var r=i.defaults,s=/(ip(a|o)d|iphone|android)/gi.test(e.navigator.userAgent);e.requestAnimationFrame||e.setTimeout}return{restrict:"EAC",require:"ngModel",link:function(e,t,n,l){function u(e){if(angular.isDate(e)){var t=isNaN(d.minTime)||new Date(e.getTime()).setFullYear(1970,0,1)>=d.minTime,n=isNaN(d.maxTime)||new Date(e.getTime()).setFullYear(1970,0,1)<=d.maxTime,a=t&&n;l.$setValidity("date",a),l.$setValidity("min",t),l.$setValidity("max",n),a&&(l.$dateValue=e)}}function c(){return!l.$dateValue||isNaN(l.$dateValue.getTime())?"":g(l.$dateValue,d.timeFormat)
+}var d={scope:e,controller:l};angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","autoclose","timeType","timeFormat","modelTimeFormat","useNative","hourStep","minuteStep","length","arrowBehavior","iconUp","iconDown"],function(e){angular.isDefined(n[e])&&(d[e]=n[e])}),n.bsShow&&e.$watch(n.bsShow,function(e){f&&angular.isDefined(e)&&(angular.isString(e)&&(e=!!e.match(/true|,?(timepicker),?/i)),e===!0?f.show():f.hide())}),s&&(d.useNative||r.useNative)&&(d.timeFormat="HH:mm");var f=i(t,l,d);d=f.$options;var p=d.lang,g=function(e,t){return a.formatDate(e,t,p)},m=o({format:d.timeFormat,lang:p});angular.forEach(["minTime","maxTime"],function(e){angular.isDefined(n[e])&&n.$observe(e,function(t){f.$options[e]=m.getTimeForAttribute(e,t),!isNaN(f.$options[e])&&f.$build(),u(l.$dateValue)})}),e.$watch(n.ngModel,function(){f.update(l.$dateValue)},!0),l.$parsers.unshift(function(e){if(!e)return l.$setValidity("date",!0),null;var t=angular.isDate(e)?e:m.parse(e,l.$dateValue);return!t||isNaN(t.getTime())?void l.$setValidity("date",!1):(u(t),"string"===d.timeType?g(t,d.modelTimeFormat||d.timeFormat):"number"===d.timeType?l.$dateValue.getTime():"unix"===d.timeType?l.$dateValue.getTime()/1e3:"iso"===d.timeType?l.$dateValue.toISOString():new Date(l.$dateValue))}),l.$formatters.push(function(e){var t;return t=angular.isUndefined(e)||null===e?0/0:angular.isDate(e)?e:"string"===d.timeType?m.parse(e,null,d.modelTimeFormat):new Date("unix"===d.timeType?1e3*e:e),l.$dateValue=t,c()}),l.$render=function(){t.val(c())},e.$on("$destroy",function(){f&&f.destroy(),d=null,f=null})}}}]),angular.module("mgcrea.ngStrap.typeahead",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$typeahead",function(){var e=this.defaults={animation:"am-fade",prefixClass:"typeahead",prefixEvent:"$typeahead",placement:"bottom-left",template:"typeahead/typeahead.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,minLength:1,filter:"filter",limit:6,comparator:""};this.$get=["$window","$rootScope","$tooltip","$timeout",function(t,n,a,o){function i(t,n,i){var r={},s=angular.extend({},e,i);r=a(t,s);var l=i.scope,u=r.$scope;u.$resetMatches=function(){u.$matches=[],u.$activeIndex=0},u.$resetMatches(),u.$activate=function(e){u.$$postDigest(function(){r.activate(e)})},u.$select=function(e){u.$$postDigest(function(){r.select(e)})},u.$isVisible=function(){return r.$isVisible()},r.update=function(e){u.$matches=e,u.$activeIndex>=e.length&&(u.$activeIndex=0)},r.activate=function(e){u.$activeIndex=e},r.select=function(e){var t=u.$matches[e].value;n.$setViewValue(t),n.$render(),u.$resetMatches(),l&&l.$digest(),u.$emit(s.prefixEvent+".select",t,e)},r.$isVisible=function(){return s.minLength&&n?u.$matches.length&&angular.isString(n.$viewValue)&&n.$viewValue.length>=s.minLength:!!u.$matches.length},r.$getIndex=function(e){var t=u.$matches.length,n=t;if(t){for(n=t;n--&&u.$matches[n].value!==e;);if(!(0>n))return n}},r.$onMouseDown=function(e){e.preventDefault(),e.stopPropagation()},r.$onKeyDown=function(e){/(38|40|13)/.test(e.keyCode)&&(r.$isVisible()&&(e.preventDefault(),e.stopPropagation()),13===e.keyCode&&u.$matches.length?r.select(u.$activeIndex):38===e.keyCode&&u.$activeIndex>0?u.$activeIndex--:40===e.keyCode&&u.$activeIndex0)return void s.$setViewValue(s.$viewValue.substring(0,s.$viewValue.length-1));e.length>c&&(e=e.slice(0,c));var n=g.$isVisible();n&&g.update(e),(1!==e.length||e[0].value!==t)&&(!n&&g.update(e),s.$render())})}),s.$formatters.push(function(e){var t=p.displayValue(e);return t===n?"":t}),s.$render=function(){if(s.$isEmpty(s.$viewValue))return t.val("");var e=g.$getIndex(s.$modelValue),n=angular.isDefined(e)?g.$scope.$matches[e].label:s.$viewValue;n=angular.isObject(n)?p.displayValue(n):n,t.val(n?n.toString().replace(/<(?:.|\n)*?>/gm,"").trim():"")},e.$on("$destroy",function(){g&&g.destroy(),l=null,g=null})}}}])}(window,document);
//# sourceMappingURL=angular-strap.min.js.map
\ No newline at end of file
diff --git a/dist/angular-strap.min.js.map b/dist/angular-strap.min.js.map
index 23a9007d2..06d365b38 100644
--- a/dist/angular-strap.min.js.map
+++ b/dist/angular-strap.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["module.js","affix/affix.js","alert/alert.js","aside/aside.js","button/button.js","collapse/collapse.js","datepicker/datepicker.js","dropdown/dropdown.js","helpers/date-formatter.js","helpers/date-parser.js","helpers/debounce.js","helpers/dimensions.js","helpers/parse-options.js","helpers/raf.js","modal/modal.js","navbar/navbar.js","popover/popover.js","scrollspy/scrollspy.js","select/select.js","tab/tab.js","tooltip/tooltip.js","typeahead/typeahead.js","timepicker/timepicker.js"],"names":[],"mappings":"UAOE,EAAA,EAAA,wBAGA,OAAA,kBACA,uBACA,uBACA,uBACA,wBACA,wBACA,4BACA,6ECjBF,mDAEA,sIAQI,OAAK,wBAAA,oCAAyB,6CAExB,SAAS,gCAGb,UAAS,6FAwKH,GAAO,EAAA,EAAA,MAEP,GAAO,MACF,oDAMe,OAAf,GAAe,EAAA,IAAA,EAAA,GAAA,EAAA,EACf,kBAOT,QAAO,KACP,MAAO,GAAA,KAAA,EAAA,EAAA,YAAA,EAAA,GAAA,uBAIT,MAAO,GAAA,KAAA,EAAA,EAAA,SAAA,KAAA,aAAA,EAAA,GAAA,gBApLD,MAGA,EAAA,QAAY,UAAA,EAAA,GACZ,EAAA,EAAe,wCAIf,GAAS,MAET,EAAQ,EACV,EAAY,EACV,EAAa,IACX,cAGC,EAAA,iGAKP,EAAc,EAAA,aAIZ,GAAW,QAAC,QAAW,EAAM,uBAI7B,KAAY,kMAaZ,KAAA,gBACA,KAAA,qIASA,EAAA,IAAW,SAAO,KAAA,qBAIpB,EAAO,2BAA2B,WAIhC,WAAI,EAAW,cAAkB,MAI7B,cAAQ,WAGZ,GAAG,GAAY,IACf,EAAU,EAAA,OAAA,EAAA,+BAOR,KAAY,MACT,IAGH,YAAY,GAAO,SAAA,SAAA,WAA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AKH,QAAjB,EAAA,oCAGN,GAAQ,MAAA,EAAY,iBAKd,YAAW,KAAM,SAAA,MAExB,SAEA,WADK,YAAA,IAAA,OAAA,EACE,8CAIT,EAAW,MAAa,EAAA,KAAA,EAAA,0BACjB,SAAA,EAAA,4DAcT,EAAU,IAAA,kCASb,GAAA,EAAA","file":"angular-strap.min.js","sourcesContent":["\nangular.module('mgcrea.ngStrap', [\n 'mgcrea.ngStrap.modal',\n 'mgcrea.ngStrap.aside',\n 'mgcrea.ngStrap.alert',\n 'mgcrea.ngStrap.button',\n 'mgcrea.ngStrap.select',\n 'mgcrea.ngStrap.datepicker',\n 'mgcrea.ngStrap.timepicker',\n 'mgcrea.ngStrap.navbar',\n 'mgcrea.ngStrap.tooltip',\n 'mgcrea.ngStrap.popover',\n 'mgcrea.ngStrap.dropdown',\n 'mgcrea.ngStrap.typeahead',\n 'mgcrea.ngStrap.scrollspy',\n 'mgcrea.ngStrap.affix',\n 'mgcrea.ngStrap.tab',\n 'mgcrea.ngStrap.collapse'\n]);\n","'use strict';\n\nangular.module('mgcrea.ngStrap.affix', ['mgcrea.ngStrap.helpers.dimensions', 'mgcrea.ngStrap.helpers.debounce'])\n\n .provider('$affix', function() {\n\n var defaults = this.defaults = {\n offsetTop: 'auto'\n };\n\n this.$get = function($window, debounce, dimensions) {\n\n var bodyEl = angular.element($window.document.body);\n var windowEl = angular.element($window);\n\n function AffixFactory(element, config) {\n\n var $affix = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n var targetEl = options.target;\n\n // Initial private vars\n var reset = 'affix affix-top affix-bottom',\n setWidth = false,\n initialAffixTop = 0,\n initialOffsetTop = 0,\n offsetTop = 0,\n offsetBottom = 0,\n affixed = null,\n unpin = null;\n\n var parent = element.parent();\n // Options: custom parent\n if (options.offsetParent) {\n if (options.offsetParent.match(/^\\d+$/)) {\n for (var i = 0; i < (options.offsetParent * 1) - 1; i++) {\n parent = parent.parent();\n }\n }\n else {\n parent = angular.element(options.offsetParent);\n }\n }\n\n $affix.init = function() {\n\n this.$parseOffsets();\n initialOffsetTop = dimensions.offset(element[0]).top + initialAffixTop;\n setWidth = !element[0].style.width;\n\n // Bind events\n targetEl.on('scroll', this.checkPosition);\n targetEl.on('click', this.checkPositionWithEventLoop);\n windowEl.on('resize', this.$debouncedOnResize);\n\n // Both of these checkPosition() calls are necessary for the case where\n // the user hits refresh after scrolling to the bottom of the page.\n this.checkPosition();\n this.checkPositionWithEventLoop();\n\n };\n\n $affix.destroy = function() {\n\n // Unbind events\n targetEl.off('scroll', this.checkPosition);\n targetEl.off('click', this.checkPositionWithEventLoop);\n windowEl.off('resize', this.$debouncedOnResize);\n\n };\n\n $affix.checkPositionWithEventLoop = function() {\n\n // IE 9 throws an error if we use 'this' instead of '$affix'\n // in this setTimeout call\n setTimeout($affix.checkPosition, 1);\n\n };\n\n $affix.checkPosition = function() {\n // if (!this.$element.is(':visible')) return\n\n var scrollTop = getScrollTop();\n var position = dimensions.offset(element[0]);\n var elementHeight = dimensions.height(element[0]);\n\n // Get required affix class according to position\n var affix = getRequiredAffixClass(unpin, position, elementHeight);\n\n // Did affix status changed this last check?\n if(affixed === affix) return;\n affixed = affix;\n\n // Add proper affix class\n element.removeClass(reset).addClass('affix' + ((affix !== 'middle') ? '-' + affix : ''));\n\n if(affix === 'top') {\n unpin = null;\n element.css('position', (options.offsetParent) ? '' : 'relative');\n if(setWidth) {\n element.css('width', '');\n }\n element.css('top', '');\n } else if(affix === 'bottom') {\n if (options.offsetUnpin) {\n unpin = -(options.offsetUnpin * 1);\n }\n else {\n // Calculate unpin threshold when affixed to bottom.\n // Hopefully the browser scrolls pixel by pixel.\n unpin = position.top - scrollTop;\n }\n if(setWidth) {\n element.css('width', '');\n }\n element.css('position', (options.offsetParent) ? '' : 'relative');\n element.css('top', (options.offsetParent) ? '' : ((bodyEl[0].offsetHeight - offsetBottom - elementHeight - initialOffsetTop) + 'px'));\n } else { // affix === 'middle'\n unpin = null;\n if(setWidth) {\n element.css('width', element[0].offsetWidth + 'px');\n }\n element.css('position', 'fixed');\n element.css('top', initialAffixTop + 'px');\n }\n\n };\n\n $affix.$onResize = function() {\n $affix.$parseOffsets();\n $affix.checkPosition();\n };\n $affix.$debouncedOnResize = debounce($affix.$onResize, 50);\n\n $affix.$parseOffsets = function() {\n var initialPosition = element.css('position');\n // Reset position to calculate correct offsetTop\n element.css('position', (options.offsetParent) ? '' : 'relative');\n\n if(options.offsetTop) {\n if(options.offsetTop === 'auto') {\n options.offsetTop = '+0';\n }\n if(options.offsetTop.match(/^[-+]\\d+$/)) {\n initialAffixTop = - options.offsetTop * 1;\n if(options.offsetParent) {\n offsetTop = dimensions.offset(parent[0]).top + (options.offsetTop * 1);\n }\n else {\n offsetTop = dimensions.offset(element[0]).top - dimensions.css(element[0], 'marginTop', true) + (options.offsetTop * 1);\n }\n }\n else {\n offsetTop = options.offsetTop * 1;\n }\n }\n\n if(options.offsetBottom) {\n if(options.offsetParent && options.offsetBottom.match(/^[-+]\\d+$/)) {\n // add 1 pixel due to rounding problems...\n offsetBottom = getScrollHeight() - (dimensions.offset(parent[0]).top + dimensions.height(parent[0])) + (options.offsetBottom * 1) + 1;\n }\n else {\n offsetBottom = options.offsetBottom * 1;\n }\n }\n\n // Bring back the element's position after calculations\n element.css('position', initialPosition);\n };\n\n // Private methods\n\n function getRequiredAffixClass(unpin, position, elementHeight) {\n\n var scrollTop = getScrollTop();\n var scrollHeight = getScrollHeight();\n\n if(scrollTop <= offsetTop) {\n return 'top';\n } else if(unpin !== null && (scrollTop + unpin <= position.top)) {\n return 'middle';\n } else if(offsetBottom !== null && (position.top + elementHeight + initialAffixTop >= scrollHeight - offsetBottom)) {\n return 'bottom';\n } else {\n return 'middle';\n }\n\n }\n\n function getScrollTop() {\n return targetEl[0] === $window ? $window.pageYOffset : targetEl[0].scrollTop;\n }\n\n function getScrollHeight() {\n return targetEl[0] === $window ? $window.document.body.scrollHeight : targetEl[0].scrollHeight;\n }\n\n $affix.init();\n return $affix;\n\n }\n\n return AffixFactory;\n\n };\n\n })\n\n .directive('bsAffix', function($affix, $window) {\n\n return {\n restrict: 'EAC',\n require: '^?bsAffixTarget',\n link: function postLink(scope, element, attr, affixTarget) {\n\n var options = {scope: scope, offsetTop: 'auto', target: affixTarget ? affixTarget.$element : angular.element($window)};\n angular.forEach(['offsetTop', 'offsetBottom', 'offsetParent', 'offsetUnpin'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n var affix = $affix(element, options);\n scope.$on('$destroy', function() {\n affix && affix.destroy();\n options = null;\n affix = null;\n });\n\n }\n };\n\n })\n\n .directive('bsAffixTarget', function() {\n return {\n controller: function($element) {\n this.$element = $element;\n }\n };\n });\n","'use strict';\n\n// @BUG: following snippet won't compile correctly\n// @TODO: submit issue to core\n// ' ' +\n\nangular.module('mgcrea.ngStrap.alert', ['mgcrea.ngStrap.modal'])\n\n .provider('$alert', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'alert',\n prefixEvent: 'alert',\n placement: null,\n template: 'alert/alert.tpl.html',\n container: false,\n element: null,\n backdrop: false,\n keyboard: true,\n show: true,\n // Specific options\n duration: false,\n type: false,\n dismissable: true\n };\n\n this.$get = function($modal, $timeout) {\n\n function AlertFactory(config) {\n\n var $alert = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $alert = $modal(options);\n\n // Support scope as string options [/*title, content, */ type, dismissable]\n $alert.$scope.dismissable = !!options.dismissable;\n if(options.type) {\n $alert.$scope.type = options.type;\n }\n\n // Support auto-close duration\n var show = $alert.show;\n if(options.duration) {\n $alert.show = function() {\n show();\n $timeout(function() {\n $alert.hide();\n }, options.duration * 1000);\n };\n }\n\n return $alert;\n\n }\n\n return AlertFactory;\n\n };\n\n })\n\n .directive('bsAlert', function($window, $sce, $alert) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content', 'type'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsAlert && scope.$watch(attr.bsAlert, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize alert\n var alert = $alert(options);\n\n // Trigger\n element.on(attr.trigger || 'click', alert.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (alert) alert.destroy();\n options = null;\n alert = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])\n\n .provider('$aside', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade-and-slide-right',\n prefixClass: 'aside',\n prefixEvent: 'aside',\n placement: 'right',\n template: 'aside/aside.tpl.html',\n contentTemplate: false,\n container: false,\n element: null,\n backdrop: true,\n keyboard: true,\n html: false,\n show: true\n };\n\n this.$get = function($modal) {\n\n function AsideFactory(config) {\n\n var $aside = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $aside = $modal(options);\n\n return $aside;\n\n }\n\n return AsideFactory;\n\n };\n\n })\n\n .directive('bsAside', function($window, $sce, $aside) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize aside\n var aside = $aside(options);\n\n // Trigger\n element.on(attr.trigger || 'click', aside.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (aside) aside.destroy();\n options = null;\n aside = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.button', [])\n\n .provider('$button', function() {\n\n var defaults = this.defaults = {\n activeClass:'active',\n toggleEvent:'click'\n };\n\n this.$get = function() {\n return {defaults: defaults};\n };\n\n })\n\n .directive('bsCheckboxGroup', function() {\n\n return {\n restrict: 'A',\n require: 'ngModel',\n compile: function postLink(element, attr) {\n element.attr('data-toggle', 'buttons');\n element.removeAttr('ng-model');\n var children = element[0].querySelectorAll('input[type=\"checkbox\"]');\n angular.forEach(children, function(child) {\n var childEl = angular.element(child);\n childEl.attr('bs-checkbox', '');\n childEl.attr('ng-model', attr.ngModel + '.' + childEl.attr('value'));\n });\n }\n\n };\n\n })\n\n .directive('bsCheckbox', function($button, $$rAF) {\n\n var defaults = $button.defaults;\n var constantValueRegExp = /^(true|false|\\d+)$/;\n\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n var options = defaults;\n\n // Support label > input[type=\"checkbox\"]\n var isInput = element[0].nodeName === 'INPUT';\n var activeElement = isInput ? element.parent() : element;\n\n var trueValue = angular.isDefined(attr.trueValue) ? attr.trueValue : true;\n if(constantValueRegExp.test(attr.trueValue)) {\n trueValue = scope.$eval(attr.trueValue);\n }\n var falseValue = angular.isDefined(attr.falseValue) ? attr.falseValue : false;\n if(constantValueRegExp.test(attr.falseValue)) {\n falseValue = scope.$eval(attr.falseValue);\n }\n\n // Parse exotic values\n var hasExoticValues = typeof trueValue !== 'boolean' || typeof falseValue !== 'boolean';\n if(hasExoticValues) {\n controller.$parsers.push(function(viewValue) {\n // console.warn('$parser', element.attr('ng-model'), 'viewValue', viewValue);\n return viewValue ? trueValue : falseValue;\n });\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n return angular.equals(modelValue, trueValue);\n });\n // Fix rendering for exotic values\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n controller.$render();\n });\n }\n\n // model -> view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n var isActive = angular.equals(controller.$modelValue, trueValue);\n $$rAF(function() {\n if(isInput) element[0].checked = isActive;\n activeElement.toggleClass(options.activeClass, isActive);\n });\n };\n\n // view -> model\n element.bind(options.toggleEvent, function() {\n scope.$apply(function () {\n // console.warn('!click', element.attr('ng-model'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\n if(!isInput) {\n controller.$setViewValue(!activeElement.hasClass('active'));\n }\n if(!hasExoticValues) {\n controller.$render();\n }\n });\n });\n\n }\n\n };\n\n })\n\n .directive('bsRadioGroup', function() {\n\n return {\n restrict: 'A',\n require: 'ngModel',\n compile: function postLink(element, attr) {\n element.attr('data-toggle', 'buttons');\n element.removeAttr('ng-model');\n var children = element[0].querySelectorAll('input[type=\"radio\"]');\n angular.forEach(children, function(child) {\n angular.element(child).attr('bs-radio', '');\n angular.element(child).attr('ng-model', attr.ngModel);\n });\n }\n\n };\n\n })\n\n .directive('bsRadio', function($button, $$rAF) {\n\n var defaults = $button.defaults;\n var constantValueRegExp = /^(true|false|\\d+)$/;\n\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n var options = defaults;\n\n // Support `label > input[type=\"radio\"]` markup\n var isInput = element[0].nodeName === 'INPUT';\n var activeElement = isInput ? element.parent() : element;\n\n var value = constantValueRegExp.test(attr.value) ? scope.$eval(attr.value) : attr.value;\n\n // model -> view\n controller.$render = function () {\n // console.warn('$render', element.attr('value'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n var isActive = angular.equals(controller.$modelValue, value);\n $$rAF(function() {\n if(isInput) element[0].checked = isActive;\n activeElement.toggleClass(options.activeClass, isActive);\n });\n };\n\n // view -> model\n element.bind(options.toggleEvent, function() {\n scope.$apply(function () {\n // console.warn('!click', element.attr('value'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\n controller.$setViewValue(value);\n controller.$render();\n });\n });\n\n }\n\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.collapse', [])\n\n .provider('$collapse', function() {\n\n var defaults = this.defaults = {\n animation: 'am-collapse',\n disallowToggle: false,\n activeClass: 'in',\n startCollapsed: false\n };\n\n var controller = this.controller = function($scope, $element, $attrs) {\n var self = this;\n\n // Attributes options\n self.$options = angular.copy(defaults);\n angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed'], function (key) {\n if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];\n });\n\n self.$toggles = [];\n self.$targets = [];\n\n self.$viewChangeListeners = [];\n\n self.$registerToggle = function(element) {\n self.$toggles.push(element);\n };\n self.$registerTarget = function(element) {\n self.$targets.push(element);\n };\n\n self.$unregisterToggle = function(element) {\n var index = self.$toggles.indexOf(element);\n // remove toggle from $toggles array\n self.$toggles.splice(index, 1);\n };\n self.$unregisterTarget = function(element) {\n var index = self.$targets.indexOf(element);\n var activeIndex = self.$targets.$active;\n\n // remove element from $targets array\n self.$targets.splice(index, 1);\n\n if (index < activeIndex) {\n // we removed a target before the active target, so we need to\n // decrement the active target index\n activeIndex--;\n }\n else if (index === activeIndex && activeIndex === self.$targets.length) {\n // we remove the active target and it was the one at the end,\n // so select the previous one\n activeIndex--;\n }\n self.$setActive(activeIndex);\n };\n\n self.$targets.$active = !self.$options.startCollapsed ? 0 : -1;\n self.$setActive = $scope.$setActive = function(value) {\n if(!self.$options.disallowToggle) {\n self.$targets.$active = self.$targets.$active === value ? -1 : value;\n } else {\n self.$targets.$active = value;\n }\n self.$viewChangeListeners.forEach(function(fn) {\n fn();\n });\n };\n\n };\n\n this.$get = function() {\n var $collapse = {};\n $collapse.defaults = defaults;\n $collapse.controller = controller;\n return $collapse;\n };\n\n })\n\n .directive('bsCollapse', function($window, $animate, $collapse) {\n\n var defaults = $collapse.defaults;\n\n return {\n require: ['?ngModel', 'bsCollapse'],\n controller: ['$scope', '$element', '$attrs', $collapse.controller],\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsCollapseCtrl = controllers[1];\n\n if(ngModelCtrl) {\n\n // Update the modelValue following\n bsCollapseCtrl.$viewChangeListeners.push(function() {\n ngModelCtrl.$setViewValue(bsCollapseCtrl.$targets.$active);\n });\n\n // modelValue -> $formatters -> viewValue\n ngModelCtrl.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n if (bsCollapseCtrl.$targets.$active !== modelValue * 1) {\n bsCollapseCtrl.$setActive(modelValue * 1);\n }\n return modelValue;\n });\n\n }\n\n }\n };\n\n })\n\n .directive('bsCollapseToggle', function() {\n\n return {\n require: ['^?ngModel', '^bsCollapse'],\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsCollapseCtrl = controllers[1];\n\n // Add base attr\n element.attr('data-toggle', 'collapse');\n\n // Push pane to parent bsCollapse controller\n bsCollapseCtrl.$registerToggle(element);\n\n // remove toggle from collapse controller when toggle is destroyed\n scope.$on('$destroy', function() {\n bsCollapseCtrl.$unregisterToggle(element);\n });\n\n element.on('click', function() {\n var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);\n bsCollapseCtrl.$setActive(index * 1);\n scope.$apply();\n });\n\n }\n };\n\n })\n\n .directive('bsCollapseTarget', function($animate) {\n\n return {\n require: ['^?ngModel', '^bsCollapse'],\n // scope: true,\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsCollapseCtrl = controllers[1];\n\n // Add base class\n element.addClass('collapse');\n\n // Add animation class\n if(bsCollapseCtrl.$options.animation) {\n element.addClass(bsCollapseCtrl.$options.animation);\n }\n\n // Push pane to parent bsCollapse controller\n bsCollapseCtrl.$registerTarget(element);\n\n // remove pane target from collapse controller when target is destroyed\n scope.$on('$destroy', function() {\n bsCollapseCtrl.$unregisterTarget(element);\n });\n\n function render() {\n var index = bsCollapseCtrl.$targets.indexOf(element);\n var active = bsCollapseCtrl.$targets.$active;\n $animate[index === active ? 'addClass' : 'removeClass'](element, bsCollapseCtrl.$options.activeClass);\n }\n\n bsCollapseCtrl.$viewChangeListeners.push(function() {\n render();\n });\n render();\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.datepicker', [\n 'mgcrea.ngStrap.helpers.dateParser',\n 'mgcrea.ngStrap.helpers.dateFormatter',\n 'mgcrea.ngStrap.tooltip'])\n\n .provider('$datepicker', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'datepicker',\n placement: 'bottom-left',\n template: 'datepicker/datepicker.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n // lang: $locale.id,\n useNative: false,\n dateType: 'date',\n dateFormat: 'shortDate',\n modelDateFormat: null,\n dayFormat: 'dd',\n monthFormat: 'MMM',\n yearFormat: 'yyyy',\n monthTitleFormat: 'MMMM yyyy',\n yearTitleFormat: 'yyyy',\n strictFormat: false,\n autoclose: false,\n minDate: -Infinity,\n maxDate: +Infinity,\n startView: 0,\n minView: 0,\n startWeek: 0,\n daysOfWeekDisabled: '',\n iconLeft: 'glyphicon glyphicon-chevron-left',\n iconRight: 'glyphicon glyphicon-chevron-right'\n };\n\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, datepickerViews, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var isTouch = ('createTouch' in $window.document) && isNative;\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\n\n function DatepickerFactory(element, controller, config) {\n\n var $datepicker = $tooltip(element, angular.extend({}, defaults, config));\n var parentScope = config.scope;\n var options = $datepicker.$options;\n var scope = $datepicker.$scope;\n if(options.startView) options.startView -= options.minView;\n\n // View vars\n\n var pickerViews = datepickerViews($datepicker);\n $datepicker.$views = pickerViews.views;\n var viewDate = pickerViews.viewDate;\n scope.$mode = options.startView;\n scope.$iconLeft = options.iconLeft;\n scope.$iconRight = options.iconRight;\n var $picker = $datepicker.$views[scope.$mode];\n\n // Scope methods\n\n scope.$select = function(date) {\n $datepicker.select(date);\n };\n scope.$selectPane = function(value) {\n $datepicker.$selectPane(value);\n };\n scope.$toggleMode = function() {\n $datepicker.setMode((scope.$mode + 1) % $datepicker.$views.length);\n };\n\n // Public methods\n\n $datepicker.update = function(date) {\n // console.warn('$datepicker.update() newValue=%o', date);\n if(angular.isDate(date) && !isNaN(date.getTime())) {\n $datepicker.$date = date;\n $picker.update.call($picker, date);\n }\n // Build only if pristine\n $datepicker.$build(true);\n };\n\n $datepicker.updateDisabledDates = function(dateRanges) {\n options.disabledDateRanges = dateRanges;\n for(var i = 0, l = scope.rows.length; i < l; i++) {\n angular.forEach(scope.rows[i], $datepicker.$setDisabledEl);\n }\n };\n\n $datepicker.select = function(date, keep) {\n // console.warn('$datepicker.select', date, scope.$mode);\n if(!angular.isDate(controller.$dateValue)) controller.$dateValue = new Date(date);\n if(!scope.$mode || keep) {\n controller.$setViewValue(angular.copy(date));\n controller.$render();\n if(options.autoclose && !keep) {\n $timeout(function() { $datepicker.hide(true); });\n }\n } else {\n angular.extend(viewDate, {year: date.getFullYear(), month: date.getMonth(), date: date.getDate()});\n $datepicker.setMode(scope.$mode - 1);\n $datepicker.$build();\n }\n };\n\n $datepicker.setMode = function(mode) {\n // console.warn('$datepicker.setMode', mode);\n scope.$mode = mode;\n $picker = $datepicker.$views[scope.$mode];\n $datepicker.$build();\n };\n\n // Protected methods\n\n $datepicker.$build = function(pristine) {\n // console.warn('$datepicker.$build() viewDate=%o', viewDate);\n if(pristine === true && $picker.built) return;\n if(pristine === false && !$picker.built) return;\n $picker.build.call($picker);\n };\n\n $datepicker.$updateSelected = function() {\n for(var i = 0, l = scope.rows.length; i < l; i++) {\n angular.forEach(scope.rows[i], updateSelected);\n }\n };\n\n $datepicker.$isSelected = function(date) {\n return $picker.isSelected(date);\n };\n\n $datepicker.$setDisabledEl = function(el) {\n el.disabled = $picker.isDisabled(el.date);\n };\n\n $datepicker.$selectPane = function(value) {\n var steps = $picker.steps;\n // set targetDate to first day of month to avoid problems with\n // date values rollover. This assumes the viewDate does not\n // depend on the day of the month \n var targetDate = new Date(Date.UTC(viewDate.year + ((steps.year || 0) * value), viewDate.month + ((steps.month || 0) * value), 1));\n angular.extend(viewDate, {year: targetDate.getUTCFullYear(), month: targetDate.getUTCMonth(), date: targetDate.getUTCDate()});\n $datepicker.$build();\n };\n\n $datepicker.$onMouseDown = function(evt) {\n // Prevent blur on mousedown on .dropdown-menu\n evt.preventDefault();\n evt.stopPropagation();\n // Emulate click for mobile devices\n if(isTouch) {\n var targetEl = angular.element(evt.target);\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\n targetEl = targetEl.parent();\n }\n targetEl.triggerHandler('click');\n }\n };\n\n $datepicker.$onKeyDown = function(evt) {\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n if(evt.keyCode === 13) {\n if(!scope.$mode) {\n return $datepicker.hide(true);\n } else {\n return scope.$apply(function() { $datepicker.setMode(scope.$mode - 1); });\n }\n }\n\n // Navigate with keyboard\n $picker.onKeyDown(evt);\n parentScope.$digest();\n };\n\n // Private\n\n function updateSelected(el) {\n el.selected = $datepicker.$isSelected(el.date);\n }\n\n function focusElement() {\n element[0].focus();\n }\n\n // Overrides\n\n var _init = $datepicker.init;\n $datepicker.init = function() {\n if(isNative && options.useNative) {\n element.prop('type', 'date');\n element.css('-webkit-appearance', 'textfield');\n return;\n } else if(isTouch) {\n element.prop('type', 'text');\n element.attr('readonly', 'true');\n element.on('click', focusElement);\n }\n _init();\n };\n\n var _destroy = $datepicker.destroy;\n $datepicker.destroy = function() {\n if(isNative && options.useNative) {\n element.off('click', focusElement);\n }\n _destroy();\n };\n\n var _show = $datepicker.show;\n $datepicker.show = function() {\n _show();\n // use timeout to hookup the events to prevent \n // event bubbling from being processed imediately. \n $timeout(function() {\n $datepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $datepicker.$onKeyDown);\n }\n }, 0, false);\n };\n\n var _hide = $datepicker.hide;\n $datepicker.hide = function(blur) {\n if(!$datepicker.$isShown) return;\n $datepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $datepicker.$onKeyDown);\n }\n _hide(blur);\n };\n\n return $datepicker;\n\n }\n\n DatepickerFactory.defaults = defaults;\n return DatepickerFactory;\n\n };\n\n })\n\n .directive('bsDatepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $datepicker) {\n\n var defaults = $datepicker.defaults;\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope, controller: controller};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'dateType', 'dateFormat', 'modelDateFormat', 'dayFormat', 'strictFormat', 'startWeek', 'startDate', 'useNative', 'lang', 'startView', 'minView', 'iconLeft', 'iconRight', 'daysOfWeekDisabled'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!datepicker || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(datepicker),?/i);\n newValue === true ? datepicker.show() : datepicker.hide();\n });\n\n // Initialize datepicker\n var datepicker = $datepicker(element, controller, options);\n options = datepicker.$options;\n // Set expected iOS format\n if(isNative && options.useNative) options.dateFormat = 'yyyy-MM-dd';\n\n var lang = options.lang;\n\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n \n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\n\n // Observe attributes for changes\n angular.forEach(['minDate', 'maxDate'], function(key) {\n // console.warn('attr.$observe(%s)', key, attr[key]);\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\n // console.warn('attr.$observe(%s)=%o', key, newValue);\n datepicker.$options[key] = dateParser.getDateForAttribute(key, newValue);\n // Build only if dirty\n !isNaN(datepicker.$options[key]) && datepicker.$build(false);\n validateAgainstMinMaxDate(controller.$dateValue);\n });\n });\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n datepicker.update(controller.$dateValue);\n }, true);\n\n // Normalize undefined/null/empty array,\n // so that we don't treat changing from undefined->null as a change.\n function normalizeDateRanges(ranges) {\n if (!ranges || !ranges.length) return null;\n return ranges;\n }\n\n if (angular.isDefined(attr.disabledDates)) {\n scope.$watch(attr.disabledDates, function(disabledRanges, previousValue) {\n disabledRanges = normalizeDateRanges(disabledRanges);\n previousValue = normalizeDateRanges(previousValue);\n\n if (disabledRanges) {\n datepicker.updateDisabledDates(disabledRanges);\n }\n });\n }\n\n function validateAgainstMinMaxDate(parsedDate) {\n if (!angular.isDate(parsedDate)) return;\n var isMinValid = isNaN(datepicker.$options.minDate) || parsedDate.getTime() >= datepicker.$options.minDate;\n var isMaxValid = isNaN(datepicker.$options.maxDate) || parsedDate.getTime() <= datepicker.$options.maxDate;\n var isValid = isMinValid && isMaxValid;\n controller.$setValidity('date', isValid);\n controller.$setValidity('min', isMinValid);\n controller.$setValidity('max', isMaxValid);\n // Only update the model when we have a valid date\n if(isValid) controller.$dateValue = parsedDate;\n }\n\n // viewValue -> $parsers -> modelValue\n controller.$parsers.unshift(function(viewValue) {\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\n // Null values should correctly reset the model value & validity\n if(!viewValue) {\n controller.$setValidity('date', true);\n // BREAKING CHANGE:\n // return null (not undefined) when input value is empty, so angularjs 1.3 \n // ngModelController can go ahead and run validators, like ngRequired\n return null;\n }\n var parsedDate = dateParser.parse(viewValue, controller.$dateValue);\n if(!parsedDate || isNaN(parsedDate.getTime())) {\n controller.$setValidity('date', false);\n // return undefined, causes ngModelController to \n // invalidate model value \n return;\n } else {\n validateAgainstMinMaxDate(parsedDate);\n }\n if(options.dateType === 'string') {\n return formatDate(parsedDate, options.modelDateFormat || options.dateFormat);\n } else if(options.dateType === 'number') {\n return controller.$dateValue.getTime();\n } else if(options.dateType === 'unix') {\n return controller.$dateValue.getTime() / 1000;\n } else if(options.dateType === 'iso') {\n return controller.$dateValue.toISOString();\n } else {\n return new Date(controller.$dateValue);\n }\n });\n\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n var date;\n if(angular.isUndefined(modelValue) || modelValue === null) {\n date = NaN;\n } else if(angular.isDate(modelValue)) {\n date = modelValue;\n } else if(options.dateType === 'string') {\n date = dateParser.parse(modelValue, null, options.modelDateFormat);\n } else if(options.dateType === 'unix') {\n date = new Date(modelValue * 1000);\n } else {\n date = new Date(modelValue);\n }\n // Setup default value?\n // if(isNaN(date.getTime())) {\n // var today = new Date();\n // date = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);\n // }\n controller.$dateValue = date;\n return getDateFormattedString();\n });\n\n // viewValue -> element\n controller.$render = function() {\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\n element.val(getDateFormattedString());\n };\n\n function getDateFormattedString() {\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.dateFormat);\n }\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if(datepicker) datepicker.destroy();\n options = null;\n datepicker = null;\n });\n\n }\n };\n\n })\n\n .provider('datepickerViews', function() {\n\n var defaults = this.defaults = {\n dayFormat: 'dd',\n daySplit: 7\n };\n\n // Split array into smaller arrays\n function split(arr, size) {\n var arrays = [];\n while(arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n }\n\n // Modulus operator\n function mod(n, m) {\n return ((n % m) + m) % m;\n }\n\n this.$get = function($dateFormatter, $dateParser, $sce) {\n\n return function(picker) {\n\n var scope = picker.$scope;\n var options = picker.$options;\n\n var lang = options.lang;\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\n\n var weekDaysMin = $dateFormatter.weekdaysShort(lang);\n var weekDaysLabels = weekDaysMin.slice(options.startWeek).concat(weekDaysMin.slice(0, options.startWeek));\n var weekDaysLabelsHtml = $sce.trustAsHtml('' + weekDaysLabels.join(' ') + ' ');\n\n var startDate = picker.$date || (options.startDate ? dateParser.getDateForAttribute('startDate', options.startDate) : new Date());\n var viewDate = {year: startDate.getFullYear(), month: startDate.getMonth(), date: startDate.getDate()};\n var timezoneOffset = startDate.getTimezoneOffset() * 6e4;\n\n var views = [{\n format: options.dayFormat,\n split: 7,\n steps: { month: 1 },\n update: function(date, force) {\n if(!this.built || force || date.getFullYear() !== viewDate.year || date.getMonth() !== viewDate.month) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$build();\n } else if(date.getDate() !== viewDate.date) {\n viewDate.date = picker.$date.getDate();\n picker.$updateSelected();\n }\n },\n build: function() {\n var firstDayOfMonth = new Date(viewDate.year, viewDate.month, 1), firstDayOfMonthOffset = firstDayOfMonth.getTimezoneOffset();\n var firstDate = new Date(+firstDayOfMonth - mod(firstDayOfMonth.getDay() - options.startWeek, 7) * 864e5), firstDateOffset = firstDate.getTimezoneOffset();\n var today = new Date().toDateString();\n // Handle daylight time switch\n if(firstDateOffset !== firstDayOfMonthOffset) firstDate = new Date(+firstDate + (firstDateOffset - firstDayOfMonthOffset) * 60e3);\n var days = [], day;\n for(var i = 0; i < 42; i++) { // < 7 * 6\n day = dateParser.daylightSavingAdjust(new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate() + i));\n days.push({date: day, isToday: day.toDateString() === today, label: formatDate(day, this.format), selected: picker.$date && this.isSelected(day), muted: day.getMonth() !== viewDate.month, disabled: this.isDisabled(day)});\n }\n scope.title = formatDate(firstDayOfMonth, options.monthTitleFormat);\n scope.showLabels = true;\n scope.labels = weekDaysLabelsHtml;\n scope.rows = split(days, this.split);\n this.built = true;\n },\n isSelected: function(date) {\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth() && date.getDate() === picker.$date.getDate();\n },\n isDisabled: function(date) {\n var time = date.getTime();\n\n // Disabled because of min/max date.\n if (time < options.minDate || time > options.maxDate) return true;\n\n // Disabled due to being a disabled day of the week\n if (options.daysOfWeekDisabled.indexOf(date.getDay()) !== -1) return true;\n\n // Disabled because of disabled date range.\n if (options.disabledDateRanges) {\n for (var i = 0; i < options.disabledDateRanges.length; i++) {\n if (time >= options.disabledDateRanges[i].start && time <= options.disabledDateRanges[i].end) {\n return true;\n }\n }\n }\n\n return false;\n },\n onKeyDown: function(evt) {\n if (!picker.$date) {\n return;\n }\n var actualTime = picker.$date.getTime();\n var newDate;\n\n if(evt.keyCode === 37) newDate = new Date(actualTime - 1 * 864e5);\n else if(evt.keyCode === 38) newDate = new Date(actualTime - 7 * 864e5);\n else if(evt.keyCode === 39) newDate = new Date(actualTime + 1 * 864e5);\n else if(evt.keyCode === 40) newDate = new Date(actualTime + 7 * 864e5);\n\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\n }\n }, {\n name: 'month',\n format: options.monthFormat,\n split: 4,\n steps: { year: 1 },\n update: function(date, force) {\n if(!this.built || date.getFullYear() !== viewDate.year) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$build();\n } else if(date.getMonth() !== viewDate.month) {\n angular.extend(viewDate, {month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$updateSelected();\n }\n },\n build: function() {\n var firstMonth = new Date(viewDate.year, 0, 1);\n var months = [], month;\n for (var i = 0; i < 12; i++) {\n month = new Date(viewDate.year, i, 1);\n months.push({date: month, label: formatDate(month, this.format), selected: picker.$isSelected(month), disabled: this.isDisabled(month)});\n }\n scope.title = formatDate(month, options.yearTitleFormat);\n scope.showLabels = false;\n scope.rows = split(months, this.split);\n this.built = true;\n },\n isSelected: function(date) {\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth();\n },\n isDisabled: function(date) {\n var lastDate = +new Date(date.getFullYear(), date.getMonth() + 1, 0);\n return lastDate < options.minDate || date.getTime() > options.maxDate;\n },\n onKeyDown: function(evt) {\n if (!picker.$date) {\n return;\n }\n var actualMonth = picker.$date.getMonth();\n var newDate = new Date(picker.$date);\n\n if(evt.keyCode === 37) newDate.setMonth(actualMonth - 1);\n else if(evt.keyCode === 38) newDate.setMonth(actualMonth - 4);\n else if(evt.keyCode === 39) newDate.setMonth(actualMonth + 1);\n else if(evt.keyCode === 40) newDate.setMonth(actualMonth + 4);\n\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\n }\n }, {\n name: 'year',\n format: options.yearFormat,\n split: 4,\n steps: { year: 12 },\n update: function(date, force) {\n if(!this.built || force || parseInt(date.getFullYear()/20, 10) !== parseInt(viewDate.year/20, 10)) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$build();\n } else if(date.getFullYear() !== viewDate.year) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$updateSelected();\n }\n },\n build: function() {\n var firstYear = viewDate.year - viewDate.year % (this.split * 3);\n var years = [], year;\n for (var i = 0; i < 12; i++) {\n year = new Date(firstYear + i, 0, 1);\n years.push({date: year, label: formatDate(year, this.format), selected: picker.$isSelected(year), disabled: this.isDisabled(year)});\n }\n scope.title = years[0].label + '-' + years[years.length - 1].label;\n scope.showLabels = false;\n scope.rows = split(years, this.split);\n this.built = true;\n },\n isSelected: function(date) {\n return picker.$date && date.getFullYear() === picker.$date.getFullYear();\n },\n isDisabled: function(date) {\n var lastDate = +new Date(date.getFullYear() + 1, 0, 0);\n return lastDate < options.minDate || date.getTime() > options.maxDate;\n },\n onKeyDown: function(evt) {\n if (!picker.$date) {\n return;\n }\n var actualYear = picker.$date.getFullYear(),\n newDate = new Date(picker.$date);\n\n if(evt.keyCode === 37) newDate.setYear(actualYear - 1);\n else if(evt.keyCode === 38) newDate.setYear(actualYear - 4);\n else if(evt.keyCode === 39) newDate.setYear(actualYear + 1);\n else if(evt.keyCode === 40) newDate.setYear(actualYear + 4);\n\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\n }\n }];\n\n return {\n views: options.minView ? Array.prototype.slice.call(views, options.minView) : views,\n viewDate: viewDate\n };\n\n };\n\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.dropdown', ['mgcrea.ngStrap.tooltip'])\n\n .provider('$dropdown', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'dropdown',\n placement: 'bottom-left',\n template: 'dropdown/dropdown.tpl.html',\n trigger: 'click',\n container: false,\n keyboard: true,\n html: false,\n delay: 0\n };\n\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;\n\n function DropdownFactory(element, config) {\n\n var $dropdown = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n var scope = $dropdown.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n\n $dropdown = $tooltip(element, options);\n var parentEl = element.parent();\n\n // Protected methods\n\n $dropdown.$onKeyDown = function(evt) {\n if (!/(38|40)/.test(evt.keyCode)) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n // Retrieve focused index\n var items = angular.element($dropdown.$element[0].querySelectorAll('li:not(.divider) a'));\n if(!items.length) return;\n var index;\n angular.forEach(items, function(el, i) {\n if(matchesSelector && matchesSelector.call(el, ':focus')) index = i;\n });\n\n // Navigate with keyboard\n if(evt.keyCode === 38 && index > 0) index--;\n else if(evt.keyCode === 40 && index < items.length - 1) index++;\n else if(angular.isUndefined(index)) index = 0;\n items.eq(index)[0].focus();\n\n };\n\n // Overrides\n\n var show = $dropdown.show;\n $dropdown.show = function() {\n show();\n // use timeout to hookup the events to prevent \n // event bubbling from being processed imediately. \n $timeout(function() {\n options.keyboard && $dropdown.$element.on('keydown', $dropdown.$onKeyDown);\n bodyEl.on('click', onBodyClick);\n }, 0, false);\n parentEl.hasClass('dropdown') && parentEl.addClass('open');\n };\n\n var hide = $dropdown.hide;\n $dropdown.hide = function() {\n if(!$dropdown.$isShown) return;\n options.keyboard && $dropdown.$element.off('keydown', $dropdown.$onKeyDown);\n bodyEl.off('click', onBodyClick);\n parentEl.hasClass('dropdown') && parentEl.removeClass('open');\n hide();\n };\n\n var destroy = $dropdown.destroy;\n $dropdown.destroy = function() {\n bodyEl.off('click', onBodyClick);\n destroy();\n };\n\n // Private functions\n\n function onBodyClick(evt) {\n if(evt.target === element[0]) return;\n return evt.target !== element[0] && $dropdown.hide();\n }\n\n return $dropdown;\n\n }\n\n return DropdownFactory;\n\n };\n\n })\n\n .directive('bsDropdown', function($window, $sce, $dropdown) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as an object\n attr.bsDropdown && scope.$watch(attr.bsDropdown, function(newValue, oldValue) {\n scope.content = newValue;\n }, true);\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!dropdown || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(dropdown),?/i);\n newValue === true ? dropdown.show() : dropdown.hide();\n });\n\n // Initialize dropdown\n var dropdown = $dropdown(element, options);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (dropdown) dropdown.destroy();\n options = null;\n dropdown = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.dateFormatter', [])\n\n .service('$dateFormatter', function($locale, dateFilter) {\n\n // The unused `lang` arguments are on purpose. The default implementation does not\n // use them and it always uses the locale loaded into the `$locale` service.\n // Custom implementations might use it, thus allowing different directives to\n // have different languages.\n\n this.getDefaultLocale = function() {\n return $locale.id;\n };\n\n // Format is either a data format name, e.g. \"shortTime\" or \"fullDate\", or a date format\n // Return either the corresponding date format or the given date format.\n this.getDatetimeFormat = function(format, lang) {\n return $locale.DATETIME_FORMATS[format] || format;\n };\n\n this.weekdaysShort = function(lang) {\n return $locale.DATETIME_FORMATS.SHORTDAY;\n };\n\n function splitTimeFormat(format) {\n return /(h+)([:\\.])?(m+)[ ]?(a?)/i.exec(format).slice(1);\n }\n\n // h:mm a => h\n this.hoursFormat = function(timeFormat) {\n return splitTimeFormat(timeFormat)[0];\n };\n\n // h:mm a => mm\n this.minutesFormat = function(timeFormat) {\n return splitTimeFormat(timeFormat)[2];\n };\n\n // h:mm a => :\n this.timeSeparator = function(timeFormat) {\n return splitTimeFormat(timeFormat)[1];\n };\n\n // h:mm a => true, H.mm => false\n this.showAM = function(timeFormat) {\n return !!splitTimeFormat(timeFormat)[3];\n };\n\n this.formatDate = function(date, format, lang){\n return dateFilter(date, format);\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.dateParser', [])\n\n.provider('$dateParser', function($localeProvider) {\n\n // define a custom ParseDate object to use instead of native Date\n // to avoid date values wrapping when setting date component values\n function ParseDate() {\n this.year = 1970;\n this.month = 0;\n this.day = 1;\n this.hours = 0;\n this.minutes = 0;\n this.seconds = 0;\n this.milliseconds = 0;\n }\n\n ParseDate.prototype.setMilliseconds = function(value) { this.milliseconds = value; };\n ParseDate.prototype.setSeconds = function(value) { this.seconds = value; };\n ParseDate.prototype.setMinutes = function(value) { this.minutes = value; };\n ParseDate.prototype.setHours = function(value) { this.hours = value; };\n ParseDate.prototype.getHours = function() { return this.hours; };\n ParseDate.prototype.setDate = function(value) { this.day = value; };\n ParseDate.prototype.setMonth = function(value) { this.month = value; };\n ParseDate.prototype.setFullYear = function(value) { this.year = value; };\n ParseDate.prototype.fromDate = function(value) {\n this.year = value.getFullYear();\n this.month = value.getMonth();\n this.day = value.getDate();\n this.hours = value.getHours();\n this.minutes = value.getMinutes();\n this.seconds = value.getSeconds();\n this.milliseconds = value.getMilliseconds();\n return this;\n };\n\n ParseDate.prototype.toDate = function() {\n return new Date(this.year, this.month, this.day, this.hours, this.minutes, this.seconds, this.milliseconds);\n };\n\n var proto = ParseDate.prototype;\n\n function noop() {\n }\n\n function isNumeric(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function indexOfCaseInsensitive(array, value) {\n var len = array.length, str=value.toString().toLowerCase();\n for (var i=0; i 12 when midnight changeover, but then cannot generate\n * midnight datetime, so jump to 1AM, otherwise reset.\n * @param date (Date) the date to check\n * @return (Date) the corrected date\n *\n * __ copied from jquery ui datepicker __\n */\n $dateParser.daylightSavingAdjust = function(date) {\n if (!date) {\n return null;\n }\n date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\n return date;\n };\n\n // Private functions\n\n function setMapForFormat(format) {\n var keys = Object.keys(setFnMap), i;\n var map = [], sortedMap = [];\n // Map to setFn\n var clonedFormat = format;\n for(i = 0; i < keys.length; i++) {\n if(format.split(keys[i]).length > 1) {\n var index = clonedFormat.search(keys[i]);\n format = format.split(keys[i]).join('');\n if(setFnMap[keys[i]]) {\n map[index] = setFnMap[keys[i]];\n }\n }\n }\n // Sort result map\n angular.forEach(map, function(v) {\n // conditional required since angular.forEach broke around v1.2.21\n // related pr: https://github.com/angular/angular.js/pull/8525\n if(v) sortedMap.push(v);\n });\n return sortedMap;\n }\n\n function escapeReservedSymbols(text) {\n return text.replace(/\\//g, '[\\\\/]').replace('/-/g', '[-]').replace(/\\./g, '[.]').replace(/\\\\s/g, '[\\\\s]');\n }\n\n function regExpForFormat(format) {\n var keys = Object.keys(regExpMap), i;\n\n var re = format;\n // Abstract replaces to avoid collisions\n for(i = 0; i < keys.length; i++) {\n re = re.split(keys[i]).join('${' + i + '}');\n }\n // Replace abstracted values\n for(i = 0; i < keys.length; i++) {\n re = re.split('${' + i + '}').join('(' + regExpMap[keys[i]] + ')');\n }\n format = escapeReservedSymbols(format);\n\n return new RegExp('^' + re + '$', ['i']);\n }\n\n $dateParser.init();\n return $dateParser;\n\n };\n\n return DateParserFactory;\n\n };\n\n});\n","'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.debounce', [])\n\n// @source jashkenas/underscore\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L693\n.factory('debounce', function($timeout) {\n return function(func, wait, immediate) {\n var timeout = null;\n return function() {\n var context = this,\n args = arguments,\n callNow = immediate && !timeout;\n if(timeout) {\n $timeout.cancel(timeout);\n }\n timeout = $timeout(function later() {\n timeout = null;\n if(!immediate) {\n func.apply(context, args);\n }\n }, wait, false);\n if(callNow) {\n func.apply(context, args);\n }\n return timeout;\n };\n };\n})\n\n\n// @source jashkenas/underscore\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L661\n.factory('throttle', function($timeout) {\n return function(func, wait, options) {\n var timeout = null;\n options || (options = {});\n return function() {\n var context = this,\n args = arguments;\n if(!timeout) {\n if(options.leading !== false) {\n func.apply(context, args);\n }\n timeout = $timeout(function later() {\n timeout = null;\n if(options.trailing !== false) {\n func.apply(context, args);\n }\n }, wait, false);\n }\n };\n };\n});\n\n","'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.dimensions', [])\n\n .factory('dimensions', function($document, $window) {\n\n var jqLite = angular.element;\n var fn = {};\n\n /**\n * Test the element nodeName\n * @param element\n * @param name\n */\n var nodeName = fn.nodeName = function(element, name) {\n return element.nodeName && element.nodeName.toLowerCase() === name.toLowerCase();\n };\n\n /**\n * Returns the element computed style\n * @param element\n * @param prop\n * @param extra\n */\n fn.css = function(element, prop, extra) {\n var value;\n if (element.currentStyle) { //IE\n value = element.currentStyle[prop];\n } else if (window.getComputedStyle) {\n value = window.getComputedStyle(element)[prop];\n } else {\n value = element.style[prop];\n }\n return extra === true ? parseFloat(value) || 0 : value;\n };\n\n /**\n * Provides read-only equivalent of jQuery's offset function:\n * @required-by bootstrap-tooltip, bootstrap-affix\n * @url http://api.jquery.com/offset/\n * @param element\n */\n fn.offset = function(element) {\n var boxRect = element.getBoundingClientRect();\n var docElement = element.ownerDocument;\n return {\n width: boxRect.width || element.offsetWidth,\n height: boxRect.height || element.offsetHeight,\n top: boxRect.top + (window.pageYOffset || docElement.documentElement.scrollTop) - (docElement.documentElement.clientTop || 0),\n left: boxRect.left + (window.pageXOffset || docElement.documentElement.scrollLeft) - (docElement.documentElement.clientLeft || 0)\n };\n };\n\n /**\n * Provides read-only equivalent of jQuery's position function\n * @required-by bootstrap-tooltip, bootstrap-affix\n * @url http://api.jquery.com/offset/\n * @param element\n */\n fn.position = function(element) {\n\n var offsetParentRect = {top: 0, left: 0},\n offsetParentElement,\n offset;\n\n // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\n if (fn.css(element, 'position') === 'fixed') {\n\n // We assume that getBoundingClientRect is available when computed position is fixed\n offset = element.getBoundingClientRect();\n\n } else {\n\n // Get *real* offsetParentElement\n offsetParentElement = offsetParent(element);\n\n // Get correct offsets\n offset = fn.offset(element);\n if (!nodeName(offsetParentElement, 'html')) {\n offsetParentRect = fn.offset(offsetParentElement);\n }\n\n // Add offsetParent borders\n offsetParentRect.top += fn.css(offsetParentElement, 'borderTopWidth', true);\n offsetParentRect.left += fn.css(offsetParentElement, 'borderLeftWidth', true);\n }\n\n // Subtract parent offsets and element margins\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n top: offset.top - offsetParentRect.top - fn.css(element, 'marginTop', true),\n left: offset.left - offsetParentRect.left - fn.css(element, 'marginLeft', true)\n };\n\n };\n\n /**\n * Returns the closest, non-statically positioned offsetParent of a given element\n * @required-by fn.position\n * @param element\n */\n var offsetParent = function offsetParentElement(element) {\n var docElement = element.ownerDocument;\n var offsetParent = element.offsetParent || docElement;\n if(nodeName(offsetParent, '#document')) return docElement.documentElement;\n while(offsetParent && !nodeName(offsetParent, 'html') && fn.css(offsetParent, 'position') === 'static') {\n offsetParent = offsetParent.offsetParent;\n }\n return offsetParent || docElement.documentElement;\n };\n\n /**\n * Provides equivalent of jQuery's height function\n * @required-by bootstrap-affix\n * @url http://api.jquery.com/height/\n * @param element\n * @param outer\n */\n fn.height = function(element, outer) {\n var value = element.offsetHeight;\n if(outer) {\n value += fn.css(element, 'marginTop', true) + fn.css(element, 'marginBottom', true);\n } else {\n value -= fn.css(element, 'paddingTop', true) + fn.css(element, 'paddingBottom', true) + fn.css(element, 'borderTopWidth', true) + fn.css(element, 'borderBottomWidth', true);\n }\n return value;\n };\n\n /**\n * Provides equivalent of jQuery's width function\n * @required-by bootstrap-affix\n * @url http://api.jquery.com/width/\n * @param element\n * @param outer\n */\n fn.width = function(element, outer) {\n var value = element.offsetWidth;\n if(outer) {\n value += fn.css(element, 'marginLeft', true) + fn.css(element, 'marginRight', true);\n } else {\n value -= fn.css(element, 'paddingLeft', true) + fn.css(element, 'paddingRight', true) + fn.css(element, 'borderLeftWidth', true) + fn.css(element, 'borderRightWidth', true);\n }\n return value;\n };\n\n return fn;\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.parseOptions', [])\n\n .provider('$parseOptions', function() {\n\n var defaults = this.defaults = {\n regexp: /^\\s*(.*?)(?:\\s+as\\s+(.*?))?(?:\\s+group\\s+by\\s+(.*))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+(.*?)(?:\\s+track\\s+by\\s+(.*?))?$/\n };\n\n this.$get = function($parse, $q) {\n\n function ParseOptionsFactory(attr, config) {\n\n var $parseOptions = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n $parseOptions.$values = [];\n\n // Private vars\n var match, displayFn, valueName, keyName, groupByFn, valueFn, valuesFn;\n\n $parseOptions.init = function() {\n $parseOptions.$match = match = attr.match(options.regexp);\n displayFn = $parse(match[2] || match[1]),\n valueName = match[4] || match[6],\n keyName = match[5],\n groupByFn = $parse(match[3] || ''),\n valueFn = $parse(match[2] ? match[1] : valueName),\n valuesFn = $parse(match[7]);\n };\n\n $parseOptions.valuesFn = function(scope, controller) {\n return $q.when(valuesFn(scope, controller))\n .then(function(values) {\n $parseOptions.$values = values ? parseValues(values, scope) : {};\n return $parseOptions.$values;\n });\n };\n\n $parseOptions.displayValue = function(modelValue) {\n var scope = {};\n scope[valueName] = modelValue;\n return displayFn(scope);\n };\n\n // Private functions\n\n function parseValues(values, scope) {\n return values.map(function(match, index) {\n var locals = {}, label, value;\n locals[valueName] = match;\n label = displayFn(scope, locals);\n value = valueFn(scope, locals);\n return {label: label, value: value, index: index};\n });\n }\n\n $parseOptions.init();\n return $parseOptions;\n\n }\n\n return ParseOptionsFactory;\n\n };\n\n });\n","'use strict';\n\n(angular.version.minor < 3 && angular.version.dot < 14) && angular.module('ng')\n\n.factory('$$rAF', function($window, $timeout) {\n\n var requestAnimationFrame = $window.requestAnimationFrame ||\n $window.webkitRequestAnimationFrame ||\n $window.mozRequestAnimationFrame;\n\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\n $window.webkitCancelAnimationFrame ||\n $window.mozCancelAnimationFrame ||\n $window.webkitCancelRequestAnimationFrame;\n\n var rafSupported = !!requestAnimationFrame;\n var raf = rafSupported ?\n function(fn) {\n var id = requestAnimationFrame(fn);\n return function() {\n cancelAnimationFrame(id);\n };\n } :\n function(fn) {\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n return function() {\n $timeout.cancel(timer);\n };\n };\n\n raf.supported = rafSupported;\n\n return raf;\n\n});\n\n// .factory('$$animateReflow', function($$rAF, $document) {\n\n// var bodyEl = $document[0].body;\n\n// return function(fn) {\n// //the returned function acts as the cancellation function\n// return $$rAF(function() {\n// //the line below will force the browser to perform a repaint\n// //so that all the animated elements within the animation frame\n// //will be properly updated and drawn on screen. This is\n// //required to perform multi-class CSS based animations with\n// //Firefox. DO NOT REMOVE THIS LINE.\n// var a = bodyEl.offsetWidth + 1;\n// fn();\n// });\n// };\n\n// });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$modal', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n backdropAnimation: 'am-fade',\n prefixClass: 'modal',\n prefixEvent: 'modal',\n placement: 'top',\n template: 'modal/modal.tpl.html',\n contentTemplate: false,\n container: false,\n element: null,\n backdrop: true,\n keyboard: true,\n html: false,\n show: true\n };\n\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {\n\n var forEach = angular.forEach;\n var trim = String.prototype.trim;\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n var bodyElement = angular.element($window.document.body);\n var htmlReplaceRegExp = /ng-bind=\"/ig;\n\n function ModalFactory(config) {\n\n var $modal = {};\n\n // Common vars\n var options = $modal.$options = angular.extend({}, defaults, config);\n $modal.$promise = fetchTemplate(options.template);\n var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n if(!options.element && !options.container) {\n options.container = 'body';\n }\n\n // Support scope as string options\n forEach(['title', 'content'], function(key) {\n if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);\n });\n\n // Provide scope helpers\n scope.$hide = function() {\n scope.$$postDigest(function() {\n $modal.hide();\n });\n };\n scope.$show = function() {\n scope.$$postDigest(function() {\n $modal.show();\n });\n };\n scope.$toggle = function() {\n scope.$$postDigest(function() {\n $modal.toggle();\n });\n };\n // Publish isShown as a protected var on scope\n $modal.$isShown = scope.$isShown = false;\n\n // Support contentTemplate option\n if(options.contentTemplate) {\n $modal.$promise = $modal.$promise.then(function(template) {\n var templateEl = angular.element(template);\n return fetchTemplate(options.contentTemplate)\n .then(function(contentTemplate) {\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]).removeAttr('ng-bind').html(contentTemplate);\n // Drop the default footer as you probably don't want it if you use a custom contentTemplate\n if(!config.template) contentEl.next().remove();\n return templateEl[0].outerHTML;\n });\n });\n }\n\n // Fetch, compile then initialize modal\n var modalLinker, modalElement;\n var backdropElement = angular.element('
');\n $modal.$promise.then(function(template) {\n if(angular.isObject(template)) template = template.data;\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\n template = trim.apply(template);\n modalLinker = $compile(template);\n $modal.init();\n });\n\n $modal.init = function() {\n\n // Options: show\n if(options.show) {\n scope.$$postDigest(function() {\n $modal.show();\n });\n }\n\n };\n\n $modal.destroy = function() {\n\n // Remove element\n if(modalElement) {\n modalElement.remove();\n modalElement = null;\n }\n if(backdropElement) {\n backdropElement.remove();\n backdropElement = null;\n }\n\n // Destroy scope\n scope.$destroy();\n\n };\n\n $modal.show = function() {\n if($modal.$isShown) return;\n\n if(scope.$emit(options.prefixEvent + '.show.before', $modal).defaultPrevented) {\n return;\n }\n var parent, after;\n if(angular.isElement(options.container)) {\n parent = options.container;\n after = options.container[0].lastChild ? angular.element(options.container[0].lastChild) : null;\n } else {\n if (options.container) {\n parent = findElement(options.container);\n after = parent[0].lastChild ? angular.element(parent[0].lastChild) : null;\n } else {\n parent = null;\n after = options.element;\n }\n }\n\n // Fetch a cloned element linked from template\n modalElement = $modal.$element = modalLinker(scope, function(clonedElement, scope) {});\n\n // Set the initial positioning.\n modalElement.css({display: 'block'}).addClass(options.placement);\n\n // Options: animation\n if(options.animation) {\n if(options.backdrop) {\n backdropElement.addClass(options.backdropAnimation);\n }\n modalElement.addClass(options.animation);\n }\n\n if(options.backdrop) {\n $animate.enter(backdropElement, bodyElement, null);\n }\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.enter(modalElement, parent, after, enterAnimateCallback);\n if(promise && promise.then) promise.then(enterAnimateCallback);\n\n $modal.$isShown = scope.$isShown = true;\n safeDigest(scope);\n // Focus once the enter-animation has started\n // Weird PhantomJS bug hack\n var el = modalElement[0];\n requestAnimationFrame(function() {\n el.focus();\n });\n\n bodyElement.addClass(options.prefixClass + '-open');\n if(options.animation) {\n bodyElement.addClass(options.prefixClass + '-with-' + options.animation);\n }\n\n // Bind events\n if(options.backdrop) {\n modalElement.on('click', hideOnBackdropClick);\n backdropElement.on('click', hideOnBackdropClick);\n backdropElement.on('wheel', preventEventDefault);\n }\n if(options.keyboard) {\n modalElement.on('keyup', $modal.$onKeyUp);\n }\n };\n\n function enterAnimateCallback() {\n scope.$emit(options.prefixEvent + '.show', $modal);\n }\n\n $modal.hide = function() {\n if(!$modal.$isShown) return;\n\n if(scope.$emit(options.prefixEvent + '.hide.before', $modal).defaultPrevented) {\n return;\n }\n var promise = $animate.leave(modalElement, leaveAnimateCallback);\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n if(promise && promise.then) promise.then(leaveAnimateCallback);\n\n if(options.backdrop) {\n $animate.leave(backdropElement);\n }\n $modal.$isShown = scope.$isShown = false;\n safeDigest(scope);\n\n // Unbind events\n if(options.backdrop) {\n modalElement.off('click', hideOnBackdropClick);\n backdropElement.off('click', hideOnBackdropClick);\n backdropElement.off('wheel', preventEventDefault);\n }\n if(options.keyboard) {\n modalElement.off('keyup', $modal.$onKeyUp);\n }\n };\n\n function leaveAnimateCallback() {\n scope.$emit(options.prefixEvent + '.hide', $modal);\n bodyElement.removeClass(options.prefixClass + '-open');\n if(options.animation) {\n bodyElement.removeClass(options.prefixClass + '-with-' + options.animation);\n }\n }\n\n $modal.toggle = function() {\n\n $modal.$isShown ? $modal.hide() : $modal.show();\n\n };\n\n $modal.focus = function() {\n modalElement[0].focus();\n };\n\n // Protected methods\n\n $modal.$onKeyUp = function(evt) {\n\n if (evt.which === 27 && $modal.$isShown) {\n $modal.hide();\n evt.stopPropagation();\n }\n\n };\n\n // Private methods\n\n function hideOnBackdropClick(evt) {\n if(evt.target !== evt.currentTarget) return;\n options.backdrop === 'static' ? $modal.focus() : $modal.hide();\n }\n\n function preventEventDefault(evt) {\n evt.preventDefault();\n }\n\n return $modal;\n\n }\n\n // Helper functions\n\n function safeDigest(scope) {\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\n }\n\n function findElement(query, element) {\n return angular.element((element || document).querySelectorAll(query));\n }\n\n var fetchPromises = {};\n function fetchTemplate(template) {\n if(fetchPromises[template]) return fetchPromises[template];\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\n .then(function(res) {\n if(angular.isObject(res)) {\n $templateCache.put(template, res.data);\n return res.data;\n }\n return res;\n }));\n }\n\n return ModalFactory;\n\n };\n\n })\n\n .directive('bsModal', function($window, $sce, $modal) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsModal && scope.$watch(attr.bsModal, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize modal\n var modal = $modal(options);\n\n // Trigger\n element.on(attr.trigger || 'click', modal.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (modal) modal.destroy();\n options = null;\n modal = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.navbar', [])\n\n .provider('$navbar', function() {\n\n var defaults = this.defaults = {\n activeClass: 'active',\n routeAttr: 'data-match-route',\n strict: false\n };\n\n this.$get = function() {\n return {defaults: defaults};\n };\n\n })\n\n .directive('bsNavbar', function($window, $location, $navbar) {\n\n var defaults = $navbar.defaults;\n\n return {\n restrict: 'A',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = angular.copy(defaults);\n angular.forEach(Object.keys(defaults), function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Watch for the $location\n scope.$watch(function() {\n\n return $location.path();\n\n }, function(newValue, oldValue) {\n\n var liElements = element[0].querySelectorAll('li[' + options.routeAttr + ']');\n\n angular.forEach(liElements, function(li) {\n\n var liElement = angular.element(li);\n var pattern = liElement.attr(options.routeAttr).replace('/', '\\\\/');\n if(options.strict) {\n pattern = '^' + pattern + '$';\n }\n var regexp = new RegExp(pattern, ['i']);\n\n if(regexp.test(newValue)) {\n liElement.addClass(options.activeClass);\n } else {\n liElement.removeClass(options.activeClass);\n }\n\n });\n\n });\n\n }\n\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.popover', ['mgcrea.ngStrap.tooltip'])\n\n .provider('$popover', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n customClass: '',\n container: false,\n target: false,\n placement: 'right',\n template: 'popover/popover.tpl.html',\n contentTemplate: false,\n trigger: 'click',\n keyboard: true,\n html: false,\n title: '',\n content: '',\n delay: 0,\n autoClose: false\n };\n\n this.$get = function($tooltip) {\n\n function PopoverFactory(element, config) {\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n var $popover = $tooltip(element, options);\n\n // Support scope as string options [/*title, */content]\n if(options.content) {\n $popover.$scope.content = options.content;\n }\n\n return $popover;\n\n }\n\n return PopoverFactory;\n\n };\n\n })\n\n .directive('bsPopover', function($window, $sce, $popover) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'customClass', 'autoClose'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\n popover && popover.$applyPlacement();\n });\n });\n });\n\n // Support scope as an object\n attr.bsPopover && scope.$watch(attr.bsPopover, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\n popover && popover.$applyPlacement();\n });\n }, true);\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!popover || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(popover),?/i);\n newValue === true ? popover.show() : popover.hide();\n });\n\n // Initialize popover\n var popover = $popover(element, options);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (popover) popover.destroy();\n options = null;\n popover = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.scrollspy', ['mgcrea.ngStrap.helpers.debounce', 'mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$scrollspy', function() {\n\n // Pool of registered spies\n var spies = this.$$spies = {};\n\n var defaults = this.defaults = {\n debounce: 150,\n throttle: 100,\n offset: 100\n };\n\n this.$get = function($window, $document, $rootScope, dimensions, debounce, throttle) {\n\n var windowEl = angular.element($window);\n var docEl = angular.element($document.prop('documentElement'));\n var bodyEl = angular.element($window.document.body);\n\n // Helper functions\n\n function nodeName(element, name) {\n return element[0].nodeName && element[0].nodeName.toLowerCase() === name.toLowerCase();\n }\n\n function ScrollSpyFactory(config) {\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n if(!options.element) options.element = bodyEl;\n var isWindowSpy = nodeName(options.element, 'body');\n var scrollEl = isWindowSpy ? windowEl : options.element;\n var scrollId = isWindowSpy ? 'window' : options.id;\n\n // Use existing spy\n if(spies[scrollId]) {\n spies[scrollId].$$count++;\n return spies[scrollId];\n }\n\n var $scrollspy = {};\n\n // Private vars\n var unbindViewContentLoaded, unbindIncludeContentLoaded;\n var trackedElements = $scrollspy.$trackedElements = [];\n var sortedElements = [];\n var activeTarget;\n var debouncedCheckPosition;\n var throttledCheckPosition;\n var debouncedCheckOffsets;\n var viewportHeight;\n var scrollTop;\n\n $scrollspy.init = function() {\n\n // Setup internal ref counter\n this.$$count = 1;\n\n // Bind events\n debouncedCheckPosition = debounce(this.checkPosition, options.debounce);\n throttledCheckPosition = throttle(this.checkPosition, options.throttle);\n scrollEl.on('click', this.checkPositionWithEventLoop);\n windowEl.on('resize', debouncedCheckPosition);\n scrollEl.on('scroll', throttledCheckPosition);\n\n debouncedCheckOffsets = debounce(this.checkOffsets, options.debounce);\n unbindViewContentLoaded = $rootScope.$on('$viewContentLoaded', debouncedCheckOffsets);\n unbindIncludeContentLoaded = $rootScope.$on('$includeContentLoaded', debouncedCheckOffsets);\n debouncedCheckOffsets();\n\n // Register spy for reuse\n if(scrollId) {\n spies[scrollId] = $scrollspy;\n }\n\n };\n\n $scrollspy.destroy = function() {\n\n // Check internal ref counter\n this.$$count--;\n if(this.$$count > 0) {\n return;\n }\n\n // Unbind events\n scrollEl.off('click', this.checkPositionWithEventLoop);\n windowEl.off('resize', debouncedCheckPosition);\n scrollEl.off('scroll', throttledCheckPosition);\n unbindViewContentLoaded();\n unbindIncludeContentLoaded();\n if (scrollId) {\n delete spies[scrollId];\n }\n };\n\n $scrollspy.checkPosition = function() {\n\n // Not ready yet\n if(!sortedElements.length) return;\n\n // Calculate the scroll position\n scrollTop = (isWindowSpy ? $window.pageYOffset : scrollEl.prop('scrollTop')) || 0;\n\n // Calculate the viewport height for use by the components\n viewportHeight = Math.max($window.innerHeight, docEl.prop('clientHeight'));\n\n // Activate first element if scroll is smaller\n if(scrollTop < sortedElements[0].offsetTop && activeTarget !== sortedElements[0].target) {\n return $scrollspy.$activateElement(sortedElements[0]);\n }\n\n // Activate proper element\n for (var i = sortedElements.length; i--;) {\n if(angular.isUndefined(sortedElements[i].offsetTop) || sortedElements[i].offsetTop === null) continue;\n if(activeTarget === sortedElements[i].target) continue;\n if(scrollTop < sortedElements[i].offsetTop) continue;\n if(sortedElements[i + 1] && scrollTop > sortedElements[i + 1].offsetTop) continue;\n return $scrollspy.$activateElement(sortedElements[i]);\n }\n\n };\n\n $scrollspy.checkPositionWithEventLoop = function() {\n // IE 9 throws an error if we use 'this' instead of '$scrollspy'\n // in this setTimeout call\n setTimeout($scrollspy.checkPosition, 1);\n };\n\n // Protected methods\n\n $scrollspy.$activateElement = function(element) {\n if(activeTarget) {\n var activeElement = $scrollspy.$getTrackedElement(activeTarget);\n if(activeElement) {\n activeElement.source.removeClass('active');\n if(nodeName(activeElement.source, 'li') && nodeName(activeElement.source.parent().parent(), 'li')) {\n activeElement.source.parent().parent().removeClass('active');\n }\n }\n }\n activeTarget = element.target;\n element.source.addClass('active');\n if(nodeName(element.source, 'li') && nodeName(element.source.parent().parent(), 'li')) {\n element.source.parent().parent().addClass('active');\n }\n };\n\n $scrollspy.$getTrackedElement = function(target) {\n return trackedElements.filter(function(obj) {\n return obj.target === target;\n })[0];\n };\n\n // Track offsets behavior\n\n $scrollspy.checkOffsets = function() {\n\n angular.forEach(trackedElements, function(trackedElement) {\n var targetElement = document.querySelector(trackedElement.target);\n trackedElement.offsetTop = targetElement ? dimensions.offset(targetElement).top : null;\n if(options.offset && trackedElement.offsetTop !== null) trackedElement.offsetTop -= options.offset * 1;\n });\n\n sortedElements = trackedElements\n .filter(function(el) {\n return el.offsetTop !== null;\n })\n .sort(function(a, b) {\n return a.offsetTop - b.offsetTop;\n });\n\n debouncedCheckPosition();\n\n };\n\n $scrollspy.trackElement = function(target, source) {\n trackedElements.push({target: target, source: source});\n };\n\n $scrollspy.untrackElement = function(target, source) {\n var toDelete;\n for (var i = trackedElements.length; i--;) {\n if(trackedElements[i].target === target && trackedElements[i].source === source) {\n toDelete = i;\n break;\n }\n }\n trackedElements = trackedElements.splice(toDelete, 1);\n };\n\n $scrollspy.activate = function(i) {\n trackedElements[i].addClass('active');\n };\n\n // Initialize plugin\n\n $scrollspy.init();\n return $scrollspy;\n\n }\n\n return ScrollSpyFactory;\n\n };\n\n })\n\n .directive('bsScrollspy', function($rootScope, debounce, dimensions, $scrollspy) {\n\n return {\n restrict: 'EAC',\n link: function postLink(scope, element, attr) {\n\n var options = {scope: scope};\n angular.forEach(['offset', 'target'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n var scrollspy = $scrollspy(options);\n scrollspy.trackElement(options.target, element);\n\n scope.$on('$destroy', function() {\n if (scrollspy) {\n scrollspy.untrackElement(options.target, element);\n scrollspy.destroy();\n }\n options = null;\n scrollspy = null;\n });\n\n }\n };\n\n })\n\n\n .directive('bsScrollspyList', function($rootScope, debounce, dimensions, $scrollspy) {\n\n return {\n restrict: 'A',\n compile: function postLink(element, attr) {\n var children = element[0].querySelectorAll('li > a[href]');\n angular.forEach(children, function(child) {\n var childEl = angular.element(child);\n childEl.parent().attr('bs-scrollspy', '').attr('data-target', childEl.attr('href'));\n });\n }\n\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.select', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\n\n .provider('$select', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'select',\n prefixEvent: '$select',\n placement: 'bottom-left',\n template: 'select/select.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n multiple: false,\n allNoneButtons: false,\n sort: true,\n caretHtml: ' ',\n placeholder: 'Choose among the following...',\n allText: 'All',\n noneText: 'None',\n maxLength: 3,\n maxLengthHtml: 'selected',\n iconCheckmark: 'glyphicon glyphicon-ok'\n };\n\n this.$get = function($window, $document, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var isTouch = ('createTouch' in $window.document) && isNative;\n\n function SelectFactory(element, controller, config) {\n\n var $select = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $select = $tooltip(element, options);\n var scope = $select.$scope;\n\n scope.$matches = [];\n scope.$activeIndex = 0;\n scope.$isMultiple = options.multiple;\n scope.$showAllNoneButtons = options.allNoneButtons && options.multiple;\n scope.$iconCheckmark = options.iconCheckmark;\n scope.$allText = options.allText;\n scope.$noneText = options.noneText;\n\n scope.$activate = function(index) {\n scope.$$postDigest(function() {\n $select.activate(index);\n });\n };\n\n scope.$select = function(index, evt) {\n scope.$$postDigest(function() {\n $select.select(index);\n });\n };\n\n scope.$isVisible = function() {\n return $select.$isVisible();\n };\n\n scope.$isActive = function(index) {\n return $select.$isActive(index);\n };\n\n scope.$selectAll = function () {\n for (var i = 0; i < scope.$matches.length; i++) {\n if (!scope.$isActive(i)) {\n scope.$select(i);\n }\n }\n };\n\n scope.$selectNone = function () {\n for (var i = 0; i < scope.$matches.length; i++) {\n if (scope.$isActive(i)) {\n scope.$select(i);\n }\n }\n };\n\n // Public methods\n\n $select.update = function(matches) {\n scope.$matches = matches;\n $select.$updateActiveIndex();\n };\n\n $select.activate = function(index) {\n if(options.multiple) {\n scope.$activeIndex.sort();\n $select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index);\n if(options.sort) scope.$activeIndex.sort();\n } else {\n scope.$activeIndex = index;\n }\n return scope.$activeIndex;\n };\n\n $select.select = function(index) {\n var value = scope.$matches[index].value;\n scope.$apply(function() {\n $select.activate(index);\n if(options.multiple) {\n controller.$setViewValue(scope.$activeIndex.map(function(index) {\n return scope.$matches[index].value;\n }));\n } else {\n controller.$setViewValue(value);\n // Hide if single select\n $select.hide();\n }\n });\n // Emit event\n scope.$emit(options.prefixEvent + '.select', value, index);\n };\n\n // Protected methods\n\n $select.$updateActiveIndex = function() {\n if(controller.$modelValue && scope.$matches.length) {\n if(options.multiple && angular.isArray(controller.$modelValue)) {\n scope.$activeIndex = controller.$modelValue.map(function(value) {\n return $select.$getIndex(value);\n });\n } else {\n scope.$activeIndex = $select.$getIndex(controller.$modelValue);\n }\n } else if(scope.$activeIndex >= scope.$matches.length) {\n scope.$activeIndex = options.multiple ? [] : 0;\n }\n };\n\n $select.$isVisible = function() {\n if(!options.minLength || !controller) {\n return scope.$matches.length;\n }\n // minLength support\n return scope.$matches.length && controller.$viewValue.length >= options.minLength;\n };\n\n $select.$isActive = function(index) {\n if(options.multiple) {\n return scope.$activeIndex.indexOf(index) !== -1;\n } else {\n return scope.$activeIndex === index;\n }\n };\n\n $select.$getIndex = function(value) {\n var l = scope.$matches.length, i = l;\n if(!l) return;\n for(i = l; i--;) {\n if(scope.$matches[i].value === value) break;\n }\n if(i < 0) return;\n return i;\n };\n\n $select.$onMouseDown = function(evt) {\n // Prevent blur on mousedown on .dropdown-menu\n evt.preventDefault();\n evt.stopPropagation();\n // Emulate click for mobile devices\n if(isTouch) {\n var targetEl = angular.element(evt.target);\n targetEl.triggerHandler('click');\n }\n };\n\n $select.$onKeyDown = function(evt) {\n if (!/(9|13|38|40)/.test(evt.keyCode)) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n // Select with enter\n if(!options.multiple && (evt.keyCode === 13 || evt.keyCode === 9)) {\n return $select.select(scope.$activeIndex);\n }\n\n // Navigate with keyboard\n if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\n scope.$digest();\n };\n\n // Overrides\n\n var _show = $select.show;\n $select.show = function() {\n _show();\n if(options.multiple) {\n $select.$element.addClass('select-multiple');\n }\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n $select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $select.$onKeyDown);\n }\n }, 0, false);\n };\n\n var _hide = $select.hide;\n $select.hide = function() {\n $select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $select.$onKeyDown);\n }\n _hide(true);\n };\n\n return $select;\n\n }\n\n SelectFactory.defaults = defaults;\n return SelectFactory;\n\n };\n\n })\n\n .directive('bsSelect', function($window, $parse, $q, $select, $parseOptions) {\n\n var defaults = $select.defaults;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope, placeholder: defaults.placeholder};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Add support for select markup\n if(element[0].nodeName.toLowerCase() === 'select') {\n var inputEl = element;\n inputEl.css('display', 'none');\n element = angular.element(' ');\n inputEl.after(element);\n }\n\n // Build proper ngOptions\n var parsedOptions = $parseOptions(attr.ngOptions);\n\n // Initialize select\n var select = $select(element, controller, options);\n\n // Watch ngOptions values before filtering for changes\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').trim();\n scope.$watch(watchedOptions, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\n parsedOptions.valuesFn(scope, controller)\n .then(function(values) {\n select.update(values);\n controller.$render();\n });\n }, true);\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue);\n select.$updateActiveIndex();\n controller.$render();\n }, true);\n\n // Model rendering in view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n var selected, index;\n if(options.multiple && angular.isArray(controller.$modelValue)) {\n selected = controller.$modelValue.map(function(value) {\n index = select.$getIndex(value);\n return angular.isDefined(index) ? select.$scope.$matches[index].label : false;\n }).filter(angular.isDefined);\n if(selected.length > (options.maxLength || defaults.maxLength)) {\n selected = selected.length + ' ' + (options.maxLengthHtml || defaults.maxLengthHtml);\n } else {\n selected = selected.join(', ');\n }\n } else {\n index = select.$getIndex(controller.$modelValue);\n selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false;\n }\n element.html((selected ? selected : options.placeholder) + defaults.caretHtml);\n };\n\n if(options.multiple){\n controller.$isEmpty = function(value){\n return !value || value.length === 0;\n };\n }\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (select) select.destroy();\n options = null;\n select = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.tab', [])\n\n .provider('$tab', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n template: 'tab/tab.tpl.html',\n navClass: 'nav-tabs',\n activeClass: 'active'\n };\n\n var controller = this.controller = function($scope, $element, $attrs) {\n var self = this;\n\n // Attributes options\n self.$options = angular.copy(defaults);\n angular.forEach(['animation', 'navClass', 'activeClass'], function(key) {\n if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];\n });\n\n // Publish options on scope\n $scope.$navClass = self.$options.navClass;\n $scope.$activeClass = self.$options.activeClass;\n\n self.$panes = $scope.$panes = [];\n\n // DEPRECATED: $viewChangeListeners, please use $activePaneChangeListeners\n // Because we deprecated ngModel usage, we rename viewChangeListeners to \n // activePaneChangeListeners to make more sense.\n self.$activePaneChangeListeners = self.$viewChangeListeners = [];\n\n self.$push = function(pane) {\n self.$panes.push(pane);\n };\n\n self.$remove = function(pane) {\n var index = self.$panes.indexOf(pane);\n var activeIndex = self.$panes.$active;\n\n // remove pane from $panes array\n self.$panes.splice(index, 1);\n\n if (index < activeIndex) {\n // we removed a pane before the active pane, so we need to \n // decrement the active pane index\n activeIndex--;\n }\n else if (index === activeIndex && activeIndex === self.$panes.length) {\n // we remove the active pane and it was the one at the end,\n // so select the previous one\n activeIndex--;\n }\n self.$setActive(activeIndex);\n };\n\n self.$panes.$active = 0;\n self.$setActive = $scope.$setActive = function(value) {\n self.$panes.$active = value;\n self.$activePaneChangeListeners.forEach(function(fn) {\n fn();\n });\n };\n\n };\n\n this.$get = function() {\n var $tab = {};\n $tab.defaults = defaults;\n $tab.controller = controller;\n return $tab;\n };\n\n })\n\n .directive('bsTabs', function($window, $animate, $tab, $parse) {\n\n var defaults = $tab.defaults;\n\n return {\n require: ['?ngModel', 'bsTabs'],\n transclude: true,\n scope: true,\n controller: ['$scope', '$element', '$attrs', $tab.controller],\n templateUrl: function(element, attr) {\n return attr.template || defaults.template;\n },\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsTabsCtrl = controllers[1];\n\n // DEPRECATED: ngModel, please use bsActivePane\n // 'ngModel' is deprecated bacause if interferes with form validation\n // and status, so avoid using it here.\n if(ngModelCtrl) {\n console.warn('Usage of ngModel is deprecated, please use bsActivePane instead!');\n\n // Update the modelValue following\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\n ngModelCtrl.$setViewValue(bsTabsCtrl.$panes.$active);\n });\n\n // modelValue -> $formatters -> viewValue\n ngModelCtrl.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n bsTabsCtrl.$setActive(modelValue * 1);\n return modelValue;\n });\n\n }\n\n if (attrs.bsActivePane) {\n // adapted from angularjs ngModelController bindings\n // https://github.com/angular/angular.js/blob/v1.3.1/src%2Fng%2Fdirective%2Finput.js#L1730\n var parsedBsActivePane = $parse(attrs.bsActivePane);\n\n // Update bsActivePane value with change\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\n parsedBsActivePane.assign(scope, bsTabsCtrl.$panes.$active);\n });\n\n // watch bsActivePane for value changes\n scope.$watch(attrs.bsActivePane, function(newValue, oldValue) {\n bsTabsCtrl.$setActive(newValue * 1);\n }, true);\n }\n }\n };\n\n })\n\n .directive('bsPane', function($window, $animate, $sce) {\n\n return {\n require: ['^?ngModel', '^bsTabs'],\n scope: true,\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsTabsCtrl = controllers[1];\n\n // Add base class\n element.addClass('tab-pane');\n\n // Observe title attribute for change\n attrs.$observe('title', function(newValue, oldValue) {\n scope.title = $sce.trustAsHtml(newValue);\n });\n\n // Add animation class\n if(bsTabsCtrl.$options.animation) {\n element.addClass(bsTabsCtrl.$options.animation);\n }\n\n // Push pane to parent bsTabs controller\n bsTabsCtrl.$push(scope);\n\n // remove pane from tab controller when pane is destroyed\n scope.$on('$destroy', function() {\n bsTabsCtrl.$remove(scope);\n });\n\n function render() {\n var index = bsTabsCtrl.$panes.indexOf(scope);\n var active = bsTabsCtrl.$panes.$active;\n $animate[index === active ? 'addClass' : 'removeClass'](element, bsTabsCtrl.$options.activeClass);\n }\n\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\n render();\n });\n render();\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$tooltip', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n customClass: '',\n prefixClass: 'tooltip',\n prefixEvent: 'tooltip',\n container: false,\n target: false,\n placement: 'top',\n template: 'tooltip/tooltip.tpl.html',\n contentTemplate: false,\n trigger: 'hover focus',\n keyboard: false,\n html: false,\n show: false,\n title: '',\n type: '',\n delay: 0,\n autoClose: false,\n bsEnabled: true\n };\n\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {\n\n var trim = String.prototype.trim;\n var isTouch = 'createTouch' in $window.document;\n var htmlReplaceRegExp = /ng-bind=\"/ig;\n var $body = angular.element($window.document);\n\n function TooltipFactory(element, config) {\n\n var $tooltip = {};\n\n // Common vars\n var nodeName = element[0].nodeName.toLowerCase();\n var options = $tooltip.$options = angular.extend({}, defaults, config);\n $tooltip.$promise = fetchTemplate(options.template);\n var scope = $tooltip.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n if(options.delay && angular.isString(options.delay)) {\n var split = options.delay.split(',').map(parseFloat);\n options.delay = split.length > 1 ? {show: split[0], hide: split[1]} : split[0];\n }\n\n // Support scope as string options\n if(options.title) {\n scope.title = $sce.trustAsHtml(options.title);\n }\n\n // Provide scope helpers\n scope.$setEnabled = function(isEnabled) {\n scope.$$postDigest(function() {\n $tooltip.setEnabled(isEnabled);\n });\n };\n scope.$hide = function() {\n scope.$$postDigest(function() {\n $tooltip.hide();\n });\n };\n scope.$show = function() {\n scope.$$postDigest(function() {\n $tooltip.show();\n });\n };\n scope.$toggle = function() {\n scope.$$postDigest(function() {\n $tooltip.toggle();\n });\n };\n // Publish isShown as a protected var on scope\n $tooltip.$isShown = scope.$isShown = false;\n\n // Private vars\n var timeout, hoverState;\n\n // Support contentTemplate option\n if(options.contentTemplate) {\n $tooltip.$promise = $tooltip.$promise.then(function(template) {\n var templateEl = angular.element(template);\n return fetchTemplate(options.contentTemplate)\n .then(function(contentTemplate) {\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]);\n if(!contentEl.length) contentEl = findElement('[ng-bind=\"title\"]', templateEl[0]);\n contentEl.removeAttr('ng-bind').html(contentTemplate);\n return templateEl[0].outerHTML;\n });\n });\n }\n\n // Fetch, compile then initialize tooltip\n var tipLinker, tipElement, tipTemplate, tipContainer, tipScope;\n $tooltip.$promise.then(function(template) {\n if(angular.isObject(template)) template = template.data;\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\n template = trim.apply(template);\n tipTemplate = template;\n tipLinker = $compile(template);\n $tooltip.init();\n });\n\n $tooltip.init = function() {\n\n // Options: delay\n if (options.delay && angular.isNumber(options.delay)) {\n options.delay = {\n show: options.delay,\n hide: options.delay\n };\n }\n\n // Replace trigger on touch devices ?\n // if(isTouch && options.trigger === defaults.trigger) {\n // options.trigger.replace(/hover/g, 'click');\n // }\n\n // Options : container\n if(options.container === 'self') {\n tipContainer = element;\n } else if(angular.isElement(options.container)) {\n tipContainer = options.container;\n } else if(options.container) {\n tipContainer = findElement(options.container);\n }\n\n // Options: trigger\n bindTriggerEvents();\n\n // Options: target\n if(options.target) {\n options.target = angular.isElement(options.target) ? options.target : findElement(options.target);\n }\n\n // Options: show\n if(options.show) {\n scope.$$postDigest(function() {\n options.trigger === 'focus' ? element[0].focus() : $tooltip.show();\n });\n }\n\n };\n\n $tooltip.destroy = function() {\n\n // Unbind events\n unbindTriggerEvents();\n\n // Remove element\n destroyTipElement();\n\n // Destroy scope\n scope.$destroy();\n\n };\n\n $tooltip.enter = function() {\n\n clearTimeout(timeout);\n hoverState = 'in';\n if (!options.delay || !options.delay.show) {\n return $tooltip.show();\n }\n\n timeout = setTimeout(function() {\n if (hoverState ==='in') $tooltip.show();\n }, options.delay.show);\n\n };\n\n $tooltip.show = function() {\n if (!options.bsEnabled || $tooltip.$isShown) return;\n\n scope.$emit(options.prefixEvent + '.show.before', $tooltip);\n var parent, after;\n if (options.container) {\n parent = tipContainer;\n if (tipContainer[0].lastChild) {\n after = angular.element(tipContainer[0].lastChild);\n } else {\n after = null;\n }\n } else {\n parent = null;\n after = element;\n }\n\n\n // Hide any existing tipElement\n if(tipElement) destroyTipElement();\n // Fetch a cloned element linked from template\n tipScope = $tooltip.$scope.$new();\n tipElement = $tooltip.$element = tipLinker(tipScope, function(clonedElement, scope) {});\n\n // Set the initial positioning. Make the tooltip invisible\n // so IE doesn't try to focus on it off screen.\n tipElement.css({top: '-9999px', left: '-9999px', display: 'block', visibility: 'hidden'});\n\n // Options: animation\n if(options.animation) tipElement.addClass(options.animation);\n // Options: type\n if(options.type) tipElement.addClass(options.prefixClass + '-' + options.type);\n // Options: custom classes\n if(options.customClass) tipElement.addClass(options.customClass);\n\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.enter(tipElement, parent, after, enterAnimateCallback);\n if(promise && promise.then) promise.then(enterAnimateCallback);\n\n $tooltip.$isShown = scope.$isShown = true;\n safeDigest(scope);\n $$rAF(function () {\n $tooltip.$applyPlacement();\n\n // Once placed, make the tooltip visible\n if(tipElement) tipElement.css({visibility: 'visible'});\n }); // var a = bodyEl.offsetWidth + 1; ?\n\n // Bind events\n if(options.keyboard) {\n if(options.trigger !== 'focus') {\n $tooltip.focus();\n }\n bindKeyboardEvents();\n }\n\n if(options.autoClose) {\n bindAutoCloseEvents();\n }\n\n };\n\n function enterAnimateCallback() {\n scope.$emit(options.prefixEvent + '.show', $tooltip);\n }\n\n $tooltip.leave = function() {\n\n clearTimeout(timeout);\n hoverState = 'out';\n if (!options.delay || !options.delay.hide) {\n return $tooltip.hide();\n }\n timeout = setTimeout(function () {\n if (hoverState === 'out') {\n $tooltip.hide();\n }\n }, options.delay.hide);\n\n };\n\n var _blur;\n $tooltip.hide = function(blur) {\n\n if(!$tooltip.$isShown) return;\n scope.$emit(options.prefixEvent + '.hide.before', $tooltip);\n\n // store blur value for leaveAnimateCallback to use\n _blur = blur;\n\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.leave(tipElement, leaveAnimateCallback);\n if(promise && promise.then) promise.then(leaveAnimateCallback);\n\n $tooltip.$isShown = scope.$isShown = false;\n safeDigest(scope);\n\n // Unbind events\n if(options.keyboard && tipElement !== null) {\n unbindKeyboardEvents();\n }\n\n if(options.autoClose && tipElement !== null) {\n unbindAutoCloseEvents();\n }\n };\n\n function leaveAnimateCallback() {\n scope.$emit(options.prefixEvent + '.hide', $tooltip);\n // Allow to blur the input when hidden, like when pressing enter key\n if(_blur && options.trigger === 'focus') {\n return element[0].blur();\n }\n\n // clean up child scopes\n destroyTipElement();\n }\n\n $tooltip.toggle = function() {\n $tooltip.$isShown ? $tooltip.leave() : $tooltip.enter();\n };\n\n $tooltip.focus = function() {\n tipElement[0].focus();\n };\n\n $tooltip.setEnabled = function(isEnabled) {\n options.bsEnabled = isEnabled;\n };\n\n // Protected methods\n\n $tooltip.$applyPlacement = function() {\n if(!tipElement) return;\n\n // Determine if we're doing an auto or normal placement\n var placement = options.placement,\n autoToken = /\\s?auto?\\s?/i,\n autoPlace = autoToken.test(placement);\n\n if (autoPlace) {\n placement = placement.replace(autoToken, '') || defaults.placement;\n }\n\n // Need to add the position class before we get\n // the offsets\n tipElement.addClass(options.placement);\n\n // Get the position of the target element\n // and the height and width of the tooltip so we can center it.\n var elementPosition = getPosition(),\n tipWidth = tipElement.prop('offsetWidth'),\n tipHeight = tipElement.prop('offsetHeight');\n\n // If we're auto placing, we need to check the positioning\n if (autoPlace) {\n var originalPlacement = placement;\n var container = options.container ? angular.element(document.querySelector(options.container)) : element.parent();\n var containerPosition = getPosition(container);\n\n // Determine if the vertical placement\n if (originalPlacement.indexOf('bottom') >= 0 && elementPosition.bottom + tipHeight > containerPosition.bottom) {\n placement = originalPlacement.replace('bottom', 'top');\n } else if (originalPlacement.indexOf('top') >= 0 && elementPosition.top - tipHeight < containerPosition.top) {\n placement = originalPlacement.replace('top', 'bottom');\n }\n\n // Determine the horizontal placement\n // The exotic placements of left and right are opposite of the standard placements. Their arrows are put on the left/right\n // and flow in the opposite direction of their placement.\n if ((originalPlacement === 'right' || originalPlacement === 'bottom-left' || originalPlacement === 'top-left') &&\n elementPosition.right + tipWidth > containerPosition.width) {\n\n placement = originalPlacement === 'right' ? 'left' : placement.replace('left', 'right');\n } else if ((originalPlacement === 'left' || originalPlacement === 'bottom-right' || originalPlacement === 'top-right') &&\n elementPosition.left - tipWidth < containerPosition.left) {\n\n placement = originalPlacement === 'left' ? 'right' : placement.replace('right', 'left');\n }\n\n tipElement.removeClass(originalPlacement).addClass(placement);\n }\n\n // Get the tooltip's top and left coordinates to center it with this directive.\n var tipPosition = getCalculatedOffset(placement, elementPosition, tipWidth, tipHeight);\n applyPlacementCss(tipPosition.top, tipPosition.left);\n };\n\n $tooltip.$onKeyUp = function(evt) {\n if (evt.which === 27 && $tooltip.$isShown) {\n $tooltip.hide();\n evt.stopPropagation();\n }\n };\n\n $tooltip.$onFocusKeyUp = function(evt) {\n if (evt.which === 27) {\n element[0].blur();\n evt.stopPropagation();\n }\n };\n\n $tooltip.$onFocusElementMouseDown = function(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n // Some browsers do not auto-focus buttons (eg. Safari)\n $tooltip.$isShown ? element[0].blur() : element[0].focus();\n };\n\n // bind/unbind events\n function bindTriggerEvents() {\n var triggers = options.trigger.split(' ');\n angular.forEach(triggers, function(trigger) {\n if(trigger === 'click') {\n element.on('click', $tooltip.toggle);\n } else if(trigger !== 'manual') {\n element.on(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\n element.on(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\n nodeName === 'button' && trigger !== 'hover' && element.on(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\n }\n });\n }\n\n function unbindTriggerEvents() {\n var triggers = options.trigger.split(' ');\n for (var i = triggers.length; i--;) {\n var trigger = triggers[i];\n if(trigger === 'click') {\n element.off('click', $tooltip.toggle);\n } else if(trigger !== 'manual') {\n element.off(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\n element.off(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\n nodeName === 'button' && trigger !== 'hover' && element.off(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\n }\n }\n }\n\n function bindKeyboardEvents() {\n if(options.trigger !== 'focus') {\n tipElement.on('keyup', $tooltip.$onKeyUp);\n } else {\n element.on('keyup', $tooltip.$onFocusKeyUp);\n }\n }\n\n function unbindKeyboardEvents() {\n if(options.trigger !== 'focus') {\n tipElement.off('keyup', $tooltip.$onKeyUp);\n } else {\n element.off('keyup', $tooltip.$onFocusKeyUp);\n }\n }\n\n var _autoCloseEventsBinded = false;\n function bindAutoCloseEvents() {\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n // Stop propagation when clicking inside tooltip\n tipElement.on('click', stopEventPropagation);\n\n // Hide when clicking outside tooltip\n $body.on('click', $tooltip.hide);\n\n _autoCloseEventsBinded = true;\n }, 0, false);\n }\n\n function unbindAutoCloseEvents() {\n if (_autoCloseEventsBinded) {\n tipElement.off('click', stopEventPropagation);\n $body.off('click', $tooltip.hide);\n _autoCloseEventsBinded = false;\n }\n }\n\n function stopEventPropagation(event) {\n event.stopPropagation();\n }\n\n // Private methods\n\n function getPosition($element) {\n $element = $element || (options.target || element);\n\n var el = $element[0];\n\n var elRect = el.getBoundingClientRect();\n if (elRect.width === null) {\n // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093\n elRect = angular.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top });\n }\n\n var elPos;\n if (options.container === 'body') {\n elPos = dimensions.offset(el);\n } else {\n elPos = dimensions.position(el);\n }\n\n return angular.extend({}, elRect, elPos);\n }\n\n function getCalculatedOffset(placement, position, actualWidth, actualHeight) {\n var offset;\n var split = placement.split('-');\n\n switch (split[0]) {\n case 'right':\n offset = {\n top: position.top + position.height / 2 - actualHeight / 2,\n left: position.left + position.width\n };\n break;\n case 'bottom':\n offset = {\n top: position.top + position.height,\n left: position.left + position.width / 2 - actualWidth / 2\n };\n break;\n case 'left':\n offset = {\n top: position.top + position.height / 2 - actualHeight / 2,\n left: position.left - actualWidth\n };\n break;\n default:\n offset = {\n top: position.top - actualHeight,\n left: position.left + position.width / 2 - actualWidth / 2\n };\n break;\n }\n\n if(!split[1]) {\n return offset;\n }\n\n // Add support for corners @todo css\n if(split[0] === 'top' || split[0] === 'bottom') {\n switch (split[1]) {\n case 'left':\n offset.left = position.left;\n break;\n case 'right':\n offset.left = position.left + position.width - actualWidth;\n }\n } else if(split[0] === 'left' || split[0] === 'right') {\n switch (split[1]) {\n case 'top':\n offset.top = position.top - actualHeight;\n break;\n case 'bottom':\n offset.top = position.top + position.height;\n }\n }\n\n return offset;\n }\n\n function applyPlacementCss(top, left) {\n tipElement.css({ top: top + 'px', left: left + 'px' });\n }\n\n function destroyTipElement() {\n // Cancel pending callbacks\n clearTimeout(timeout);\n\n if($tooltip.$isShown && tipElement !== null) {\n if(options.autoClose) {\n unbindAutoCloseEvents();\n }\n\n if(options.keyboard) {\n unbindKeyboardEvents();\n }\n }\n\n if(tipScope) {\n tipScope.$destroy();\n tipScope = null;\n }\n\n if(tipElement) {\n tipElement.remove();\n tipElement = $tooltip.$element = null;\n }\n }\n\n return $tooltip;\n\n }\n\n // Helper functions\n\n function safeDigest(scope) {\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\n }\n\n function findElement(query, element) {\n return angular.element((element || document).querySelectorAll(query));\n }\n\n var fetchPromises = {};\n function fetchTemplate(template) {\n if(fetchPromises[template]) return fetchPromises[template];\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\n .then(function(res) {\n if(angular.isObject(res)) {\n $templateCache.put(template, res.data);\n return res.data;\n }\n return res;\n }));\n }\n\n return TooltipFactory;\n\n };\n\n })\n\n .directive('bsTooltip', function($window, $location, $sce, $tooltip, $$rAF) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'backdropAnimation', 'type', 'customClass'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // overwrite inherited title value when no value specified\n // fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11\n if (!scope.hasOwnProperty('title')){\n scope.title = '';\n }\n\n // Observe scope attributes for change\n attr.$observe('title', function(newValue) {\n if (angular.isDefined(newValue) || !scope.hasOwnProperty('title')) {\n var oldValue = scope.title;\n scope.title = $sce.trustAsHtml(newValue);\n angular.isDefined(oldValue) && $$rAF(function() {\n tooltip && tooltip.$applyPlacement();\n });\n }\n });\n\n // Support scope as an object\n attr.bsTooltip && scope.$watch(attr.bsTooltip, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.title = newValue;\n }\n angular.isDefined(oldValue) && $$rAF(function() {\n tooltip && tooltip.$applyPlacement();\n });\n }, true);\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!tooltip || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(tooltip),?/i);\n newValue === true ? tooltip.show() : tooltip.hide();\n });\n\n // Enabled binding support\n attr.bsEnabled && scope.$watch(attr.bsEnabled, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.bsEnabled, newValue, oldValue);\n if(!tooltip || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|1|,?(tooltip),?/i);\n newValue === false ? tooltip.setEnabled(false) : tooltip.setEnabled(true);\n });\n\n // Initialize popover\n var tooltip = $tooltip(element, options);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if(tooltip) tooltip.destroy();\n options = null;\n tooltip = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\n\n .provider('$typeahead', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'typeahead',\n prefixEvent: '$typeahead',\n placement: 'bottom-left',\n template: 'typeahead/typeahead.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n minLength: 1,\n filter: 'filter',\n limit: 6,\n comparator: ''\n };\n\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n\n function TypeaheadFactory(element, controller, config) {\n\n var $typeahead = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $typeahead = $tooltip(element, options);\n var parentScope = config.scope;\n var scope = $typeahead.$scope;\n\n scope.$resetMatches = function(){\n scope.$matches = [];\n scope.$activeIndex = 0;\n };\n scope.$resetMatches();\n\n scope.$activate = function(index) {\n scope.$$postDigest(function() {\n $typeahead.activate(index);\n });\n };\n\n scope.$select = function(index, evt) {\n scope.$$postDigest(function() {\n $typeahead.select(index);\n });\n };\n\n scope.$isVisible = function() {\n return $typeahead.$isVisible();\n };\n\n // Public methods\n\n $typeahead.update = function(matches) {\n scope.$matches = matches;\n if(scope.$activeIndex >= matches.length) {\n scope.$activeIndex = 0;\n }\n };\n\n $typeahead.activate = function(index) {\n scope.$activeIndex = index;\n };\n\n $typeahead.select = function(index) {\n var value = scope.$matches[index].value;\n // console.log('$setViewValue', value);\n controller.$setViewValue(value);\n controller.$render();\n scope.$resetMatches();\n if(parentScope) parentScope.$digest();\n // Emit event\n scope.$emit(options.prefixEvent + '.select', value, index);\n };\n\n // Protected methods\n\n $typeahead.$isVisible = function() {\n if(!options.minLength || !controller) {\n return !!scope.$matches.length;\n }\n // minLength support\n return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;\n };\n\n $typeahead.$getIndex = function(value) {\n var l = scope.$matches.length, i = l;\n if(!l) return;\n for(i = l; i--;) {\n if(scope.$matches[i].value === value) break;\n }\n if(i < 0) return;\n return i;\n };\n\n $typeahead.$onMouseDown = function(evt) {\n // Prevent blur on mousedown\n evt.preventDefault();\n evt.stopPropagation();\n };\n\n $typeahead.$onKeyDown = function(evt) {\n if(!/(38|40|13)/.test(evt.keyCode)) return;\n\n // Let ngSubmit pass if the typeahead tip is hidden\n if($typeahead.$isVisible()) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n // Select with enter\n if(evt.keyCode === 13 && scope.$matches.length) {\n $typeahead.select(scope.$activeIndex);\n }\n\n // Navigate with keyboard\n else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\n scope.$digest();\n };\n\n // Overrides\n\n var show = $typeahead.show;\n $typeahead.show = function() {\n show();\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n $typeahead.$element.on('mousedown', $typeahead.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $typeahead.$onKeyDown);\n }\n }, 0, false);\n };\n\n var hide = $typeahead.hide;\n $typeahead.hide = function() {\n $typeahead.$element.off('mousedown', $typeahead.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $typeahead.$onKeyDown);\n }\n hide();\n };\n\n return $typeahead;\n\n }\n\n TypeaheadFactory.defaults = defaults;\n return TypeaheadFactory;\n\n };\n\n })\n\n .directive('bsTypeahead', function($window, $parse, $q, $typeahead, $parseOptions) {\n\n var defaults = $typeahead.defaults;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Build proper ngOptions\n var filter = options.filter || defaults.filter;\n var limit = options.limit || defaults.limit;\n var comparator = options.comparator || defaults.comparator;\n\n var ngOptions = attr.ngOptions;\n if(filter) ngOptions += ' | ' + filter + ':$viewValue';\n if (comparator) ngOptions += ':' + comparator;\n if(limit) ngOptions += ' | limitTo:' + limit;\n var parsedOptions = $parseOptions(ngOptions);\n\n // Initialize typeahead\n var typeahead = $typeahead(element, controller, options);\n\n // Watch options on demand\n if(options.watchOptions) {\n // Watch ngOptions values before filtering for changes, drop function calls\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').replace(/\\(.*\\)/g, '').trim();\n scope.$watch(watchedOptions, function (newValue, oldValue) {\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\n parsedOptions.valuesFn(scope, controller).then(function (values) {\n typeahead.update(values);\n controller.$render();\n });\n }, true);\n }\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('$watch', element.attr('ng-model'), newValue);\n scope.$modelValue = newValue; // Publish modelValue on scope for custom templates\n parsedOptions.valuesFn(scope, controller)\n .then(function(values) {\n // Prevent input with no future prospect if selectMode is truthy\n // @TODO test selectMode\n if(options.selectMode && !values.length && newValue.length > 0) {\n controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));\n return;\n }\n if(values.length > limit) values = values.slice(0, limit);\n var isVisible = typeahead.$isVisible();\n isVisible && typeahead.update(values);\n // Do not re-queue an update if a correct value has been selected\n if(values.length === 1 && values[0].value === newValue) return;\n !isVisible && typeahead.update(values);\n // Queue a new rendering that will leverage collection loading\n controller.$render();\n });\n });\n\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n var displayValue = parsedOptions.displayValue(modelValue);\n return displayValue === undefined ? '' : displayValue;\n });\n\n // Model rendering in view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n if(controller.$isEmpty(controller.$viewValue)) return element.val('');\n var index = typeahead.$getIndex(controller.$modelValue);\n var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;\n selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;\n element.val(selected ? selected.toString().replace(/<(?:.|\\n)*?>/gm, '').trim() : '');\n };\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (typeahead) typeahead.destroy();\n options = null;\n typeahead = null;\n });\n\n }\n };\n\n });\n","'use strict';\n\nangular.module('mgcrea.ngStrap.timepicker', [\n 'mgcrea.ngStrap.helpers.dateParser',\n 'mgcrea.ngStrap.helpers.dateFormatter',\n 'mgcrea.ngStrap.tooltip'])\n\n .provider('$timepicker', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'timepicker',\n placement: 'bottom-left',\n template: 'timepicker/timepicker.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n // lang: $locale.id,\n useNative: true,\n timeType: 'date',\n timeFormat: 'shortTime',\n modelTimeFormat: null,\n autoclose: false,\n minTime: -Infinity,\n maxTime: +Infinity,\n length: 5,\n hourStep: 1,\n minuteStep: 5,\n iconUp: 'glyphicon glyphicon-chevron-up',\n iconDown: 'glyphicon glyphicon-chevron-down',\n arrowBehavior: 'pager'\n };\n\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var isTouch = ('createTouch' in $window.document) && isNative;\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\n\n function timepickerFactory(element, controller, config) {\n\n var $timepicker = $tooltip(element, angular.extend({}, defaults, config));\n var parentScope = config.scope;\n var options = $timepicker.$options;\n var scope = $timepicker.$scope;\n\n var lang = options.lang;\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n\n // View vars\n\n var selectedIndex = 0;\n var startDate = controller.$dateValue || new Date();\n var viewDate = {hour: startDate.getHours(), meridian: startDate.getHours() < 12, minute: startDate.getMinutes(), second: startDate.getSeconds(), millisecond: startDate.getMilliseconds()};\n\n var format = $dateFormatter.getDatetimeFormat(options.timeFormat, lang);\n\n var hoursFormat = $dateFormatter.hoursFormat(format),\n timeSeparator = $dateFormatter.timeSeparator(format),\n minutesFormat = $dateFormatter.minutesFormat(format),\n showAM = $dateFormatter.showAM(format);\n\n scope.$iconUp = options.iconUp;\n scope.$iconDown = options.iconDown;\n\n // Scope methods\n\n scope.$select = function(date, index) {\n $timepicker.select(date, index);\n };\n scope.$moveIndex = function(value, index) {\n $timepicker.$moveIndex(value, index);\n };\n scope.$switchMeridian = function(date) {\n $timepicker.switchMeridian(date);\n };\n\n // Public methods\n\n $timepicker.update = function(date) {\n // console.warn('$timepicker.update() newValue=%o', date);\n if(angular.isDate(date) && !isNaN(date.getTime())) {\n $timepicker.$date = date;\n angular.extend(viewDate, {hour: date.getHours(), minute: date.getMinutes(), second: date.getSeconds(), millisecond: date.getMilliseconds()});\n $timepicker.$build();\n } else if(!$timepicker.$isBuilt) {\n $timepicker.$build();\n }\n };\n\n $timepicker.select = function(date, index, keep) {\n // console.warn('$timepicker.select', date, scope.$mode);\n if(!controller.$dateValue || isNaN(controller.$dateValue.getTime())) controller.$dateValue = new Date(1970, 0, 1);\n if(!angular.isDate(date)) date = new Date(date);\n if(index === 0) controller.$dateValue.setHours(date.getHours());\n else if(index === 1) controller.$dateValue.setMinutes(date.getMinutes());\n controller.$setViewValue(angular.copy(controller.$dateValue));\n controller.$render();\n if(options.autoclose && !keep) {\n $timeout(function() { $timepicker.hide(true); });\n }\n };\n\n $timepicker.switchMeridian = function(date) {\n if (!controller.$dateValue || isNaN(controller.$dateValue.getTime())) {\n return;\n }\n var hours = (date || controller.$dateValue).getHours();\n controller.$dateValue.setHours(hours < 12 ? hours + 12 : hours - 12);\n controller.$setViewValue(angular.copy(controller.$dateValue));\n controller.$render();\n };\n\n // Protected methods\n\n $timepicker.$build = function() {\n // console.warn('$timepicker.$build() viewDate=%o', viewDate);\n var i, midIndex = scope.midIndex = parseInt(options.length / 2, 10);\n var hours = [], hour;\n for(i = 0; i < options.length; i++) {\n hour = new Date(1970, 0, 1, viewDate.hour - (midIndex - i) * options.hourStep);\n hours.push({date: hour, label: formatDate(hour, hoursFormat), selected: $timepicker.$date && $timepicker.$isSelected(hour, 0), disabled: $timepicker.$isDisabled(hour, 0)});\n }\n var minutes = [], minute;\n for(i = 0; i < options.length; i++) {\n minute = new Date(1970, 0, 1, 0, viewDate.minute - (midIndex - i) * options.minuteStep);\n minutes.push({date: minute, label: formatDate(minute, minutesFormat), selected: $timepicker.$date && $timepicker.$isSelected(minute, 1), disabled: $timepicker.$isDisabled(minute, 1)});\n }\n\n var rows = [];\n for(i = 0; i < options.length; i++) {\n rows.push([hours[i], minutes[i]]);\n }\n scope.rows = rows;\n scope.showAM = showAM;\n scope.isAM = ($timepicker.$date || hours[midIndex].date).getHours() < 12;\n scope.timeSeparator = timeSeparator;\n $timepicker.$isBuilt = true;\n };\n\n $timepicker.$isSelected = function(date, index) {\n if(!$timepicker.$date) return false;\n else if(index === 0) {\n return date.getHours() === $timepicker.$date.getHours();\n } else if(index === 1) {\n return date.getMinutes() === $timepicker.$date.getMinutes();\n }\n };\n\n $timepicker.$isDisabled = function(date, index) {\n var selectedTime;\n if(index === 0) {\n selectedTime = date.getTime() + viewDate.minute * 6e4;\n } else if(index === 1) {\n selectedTime = date.getTime() + viewDate.hour * 36e5;\n }\n return selectedTime < options.minTime * 1 || selectedTime > options.maxTime * 1;\n };\n\n scope.$arrowAction = function (value, index) {\n if (options.arrowBehavior === 'picker') {\n $timepicker.$setTimeByStep(value,index);\n } else {\n $timepicker.$moveIndex(value,index);\n }\n };\n\n $timepicker.$setTimeByStep = function(value, index) {\n var newDate = new Date($timepicker.$date);\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\n if (index === 0) {\n newDate.setHours(hours - (parseInt(options.hourStep, 10) * value));\n }\n else {\n newDate.setMinutes(minutes - (parseInt(options.minuteStep, 10) * value));\n }\n $timepicker.select(newDate, index, true);\n };\n\n $timepicker.$moveIndex = function(value, index) {\n var targetDate;\n if(index === 0) {\n targetDate = new Date(1970, 0, 1, viewDate.hour + (value * options.length), viewDate.minute);\n angular.extend(viewDate, {hour: targetDate.getHours()});\n } else if(index === 1) {\n targetDate = new Date(1970, 0, 1, viewDate.hour, viewDate.minute + (value * options.length * options.minuteStep));\n angular.extend(viewDate, {minute: targetDate.getMinutes()});\n }\n $timepicker.$build();\n };\n\n $timepicker.$onMouseDown = function(evt) {\n // Prevent blur on mousedown on .dropdown-menu\n if(evt.target.nodeName.toLowerCase() !== 'input') evt.preventDefault();\n evt.stopPropagation();\n // Emulate click for mobile devices\n if(isTouch) {\n var targetEl = angular.element(evt.target);\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\n targetEl = targetEl.parent();\n }\n targetEl.triggerHandler('click');\n }\n };\n\n $timepicker.$onKeyDown = function(evt) {\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n // Close on enter\n if(evt.keyCode === 13) return $timepicker.hide(true);\n\n // Navigate with keyboard\n var newDate = new Date($timepicker.$date);\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\n var lateralMove = /(37|39)/.test(evt.keyCode);\n var count = 2 + showAM * 1;\n\n // Navigate indexes (left, right)\n if (lateralMove) {\n if(evt.keyCode === 37) selectedIndex = selectedIndex < 1 ? count - 1 : selectedIndex - 1;\n else if(evt.keyCode === 39) selectedIndex = selectedIndex < count - 1 ? selectedIndex + 1 : 0;\n }\n\n // Update values (up, down)\n var selectRange = [0, hoursLength];\n if(selectedIndex === 0) {\n if(evt.keyCode === 38) newDate.setHours(hours - parseInt(options.hourStep, 10));\n else if(evt.keyCode === 40) newDate.setHours(hours + parseInt(options.hourStep, 10));\n // re-calculate hours length because we have changed hours value\n hoursLength = formatDate(newDate, hoursFormat).length;\n selectRange = [0, hoursLength];\n } else if(selectedIndex === 1) {\n if(evt.keyCode === 38) newDate.setMinutes(minutes - parseInt(options.minuteStep, 10));\n else if(evt.keyCode === 40) newDate.setMinutes(minutes + parseInt(options.minuteStep, 10));\n // re-calculate minutes length because we have changes minutes value\n minutesLength = formatDate(newDate, minutesFormat).length;\n selectRange = [hoursLength + 1, hoursLength + 1 + minutesLength];\n } else if(selectedIndex === 2) {\n if(!lateralMove) $timepicker.switchMeridian();\n selectRange = [hoursLength + 1 + minutesLength + 1, hoursLength + 1 + minutesLength + 3];\n }\n $timepicker.select(newDate, selectedIndex, true);\n createSelection(selectRange[0], selectRange[1]);\n parentScope.$digest();\n };\n\n // Private\n\n function createSelection(start, end) {\n if(element[0].createTextRange) {\n var selRange = element[0].createTextRange();\n selRange.collapse(true);\n selRange.moveStart('character', start);\n selRange.moveEnd('character', end);\n selRange.select();\n } else if(element[0].setSelectionRange) {\n element[0].setSelectionRange(start, end);\n } else if(angular.isUndefined(element[0].selectionStart)) {\n element[0].selectionStart = start;\n element[0].selectionEnd = end;\n }\n }\n\n function focusElement() {\n element[0].focus();\n }\n\n // Overrides\n\n var _init = $timepicker.init;\n $timepicker.init = function() {\n if(isNative && options.useNative) {\n element.prop('type', 'time');\n element.css('-webkit-appearance', 'textfield');\n return;\n } else if(isTouch) {\n element.prop('type', 'text');\n element.attr('readonly', 'true');\n element.on('click', focusElement);\n }\n _init();\n };\n\n var _destroy = $timepicker.destroy;\n $timepicker.destroy = function() {\n if(isNative && options.useNative) {\n element.off('click', focusElement);\n }\n _destroy();\n };\n\n var _show = $timepicker.show;\n $timepicker.show = function() {\n _show();\n // use timeout to hookup the events to prevent \n // event bubbling from being processed imediately. \n $timeout(function() {\n $timepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $timepicker.$onKeyDown);\n }\n }, 0, false);\n };\n\n var _hide = $timepicker.hide;\n $timepicker.hide = function(blur) {\n if(!$timepicker.$isShown) return;\n $timepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $timepicker.$onKeyDown);\n }\n _hide(blur);\n };\n\n return $timepicker;\n\n }\n\n timepickerFactory.defaults = defaults;\n return timepickerFactory;\n\n };\n\n })\n\n\n .directive('bsTimepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $timepicker) {\n\n var defaults = $timepicker.defaults;\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope, controller: controller};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'timeType', 'timeFormat', 'modelTimeFormat', 'useNative', 'hourStep', 'minuteStep', 'length', 'arrowBehavior', 'iconUp', 'iconDown'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!timepicker || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(timepicker),?/i);\n newValue === true ? timepicker.show() : timepicker.hide();\n });\n\n // Initialize timepicker\n if(isNative && (options.useNative || defaults.useNative)) options.timeFormat = 'HH:mm';\n var timepicker = $timepicker(element, controller, options);\n options = timepicker.$options;\n\n var lang = options.lang;\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n\n // Initialize parser\n var dateParser = $dateParser({format: options.timeFormat, lang: lang});\n\n // Observe attributes for changes\n angular.forEach(['minTime', 'maxTime'], function(key) {\n // console.warn('attr.$observe(%s)', key, attr[key]);\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\n timepicker.$options[key] = dateParser.getTimeForAttribute(key, newValue);\n !isNaN(timepicker.$options[key]) && timepicker.$build();\n validateAgainstMinMaxTime(controller.$dateValue);\n });\n });\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue, controller.$dateValue);\n timepicker.update(controller.$dateValue);\n }, true);\n\n function validateAgainstMinMaxTime(parsedTime) {\n if (!angular.isDate(parsedTime)) return;\n var isMinValid = isNaN(options.minTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) >= options.minTime;\n var isMaxValid = isNaN(options.maxTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) <= options.maxTime;\n var isValid = isMinValid && isMaxValid;\n controller.$setValidity('date', isValid);\n controller.$setValidity('min', isMinValid);\n controller.$setValidity('max', isMaxValid);\n // Only update the model when we have a valid date\n if(!isValid) {\n return;\n }\n controller.$dateValue = parsedTime;\n }\n\n // viewValue -> $parsers -> modelValue\n controller.$parsers.unshift(function(viewValue) {\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\n // Null values should correctly reset the model value & validity\n if(!viewValue) {\n // BREAKING CHANGE:\n // return null (not undefined) when input value is empty, so angularjs 1.3 \n // ngModelController can go ahead and run validators, like ngRequired\n controller.$setValidity('date', true);\n return null;\n }\n var parsedTime = angular.isDate(viewValue) ? viewValue : dateParser.parse(viewValue, controller.$dateValue);\n if(!parsedTime || isNaN(parsedTime.getTime())) {\n controller.$setValidity('date', false);\n // return undefined, causes ngModelController to \n // invalidate model value \n return;\n } else {\n validateAgainstMinMaxTime(parsedTime);\n }\n if(options.timeType === 'string') {\n return formatDate(parsedTime, options.modelTimeFormat || options.timeFormat);\n } else if(options.timeType === 'number') {\n return controller.$dateValue.getTime();\n } else if(options.timeType === 'unix') {\n return controller.$dateValue.getTime() / 1000;\n } else if(options.timeType === 'iso') {\n return controller.$dateValue.toISOString();\n } else {\n return new Date(controller.$dateValue);\n }\n });\n\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n var date;\n if(angular.isUndefined(modelValue) || modelValue === null) {\n date = NaN;\n } else if(angular.isDate(modelValue)) {\n date = modelValue;\n } else if(options.timeType === 'string') {\n date = dateParser.parse(modelValue, null, options.modelTimeFormat);\n } else if(options.timeType === 'unix') {\n date = new Date(modelValue * 1000);\n } else {\n date = new Date(modelValue);\n }\n // Setup default value?\n // if(isNaN(date.getTime())) date = new Date(new Date().setMinutes(0) + 36e5);\n controller.$dateValue = date;\n return getTimeFormattedString();\n });\n\n // viewValue -> element\n controller.$render = function() {\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\n element.val(getTimeFormattedString());\n };\n\n function getTimeFormattedString() {\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.timeFormat);\n }\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (timepicker) timepicker.destroy();\n options = null;\n timepicker = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["module.js","affix/affix.js","alert/alert.js","button/button.js","datepicker/datepicker.js","collapse/collapse.js","dropdown/dropdown.js","helpers/date-formatter.js","helpers/date-parser.js","helpers/debounce.js","helpers/dimensions.js","helpers/parse-options.js","helpers/raf.js","aside/aside.js","modal/modal.js","navbar/navbar.js","scrollspy/scrollspy.js","progressbar/progressbar.js","select/select.js","tab/tab.js","popover/popover.js","tooltip/tooltip.js","timepicker/timepicker.js","typeahead/typeahead.js"],"names":[],"mappings":"UAOE,EAAA,EAAA,wBAGA,OAAA,kBACA,uBACA,uBACA,uBACA,wBACA,wBACA,4BACA,4BACA,0EClBF,qDAEA,wIAQI,OAAK,wBAAA,oCAAyB,6CAExB,SAAS,gCAGb,UAAS,6FAwKH,GAAO,EAAA,EAAA,MAEP,GAAO,MACF,oDAMe,OAAf,GAAe,EAAA,IAAA,EAAA,GAAA,EAAA,EACf,kBAOT,QAAO,KACP,MAAO,GAAA,KAAA,EAAA,EAAA,YAAA,EAAA,GAAA,uBAIT,MAAO,GAAA,KAAA,EAAA,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BAMnC,GAAA,EAAU,SAAY,EAAW,YAAA,MAAA,GAAA,IAAA,GAC/B,IAAI,GAAA,EAAW,UAAU,EAAA,aACzB,EAAU,QAAA,UAAA,GAAA,EAAA,OAAA,SAAA,GAAA,MAAA,EAAA,UACV,GAAA,QAAY,SAAA,GAAA,EAAA,aAAA,GAAA,4FAMjB,GAAA,EAAA","file":"angular-strap.min.js","sourcesContent":["\nangular.module('mgcrea.ngStrap', [\n 'mgcrea.ngStrap.modal',\n 'mgcrea.ngStrap.aside',\n 'mgcrea.ngStrap.alert',\n 'mgcrea.ngStrap.button',\n 'mgcrea.ngStrap.select',\n 'mgcrea.ngStrap.datepicker',\n 'mgcrea.ngStrap.timepicker',\n 'mgcrea.ngStrap.navbar',\n 'mgcrea.ngStrap.tooltip',\n 'mgcrea.ngStrap.popover',\n 'mgcrea.ngStrap.dropdown',\n 'mgcrea.ngStrap.typeahead',\n 'mgcrea.ngStrap.scrollspy',\n 'mgcrea.ngStrap.affix',\n 'mgcrea.ngStrap.tab',\n 'mgcrea.ngStrap.collapse',\n 'mgcrea.ngStrap.progressbar'\n]);\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.affix', ['mgcrea.ngStrap.helpers.dimensions', 'mgcrea.ngStrap.helpers.debounce'])\r\n\r\n .provider('$affix', function() {\r\n\r\n var defaults = this.defaults = {\r\n offsetTop: 'auto'\r\n };\r\n\r\n this.$get = function($window, debounce, dimensions) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var windowEl = angular.element($window);\r\n\r\n function AffixFactory(element, config) {\r\n\r\n var $affix = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n var targetEl = options.target;\r\n\r\n // Initial private vars\r\n var reset = 'affix affix-top affix-bottom',\r\n setWidth = false,\r\n initialAffixTop = 0,\r\n initialOffsetTop = 0,\r\n offsetTop = 0,\r\n offsetBottom = 0,\r\n affixed = null,\r\n unpin = null;\r\n\r\n var parent = element.parent();\r\n // Options: custom parent\r\n if (options.offsetParent) {\r\n if (options.offsetParent.match(/^\\d+$/)) {\r\n for (var i = 0; i < (options.offsetParent * 1) - 1; i++) {\r\n parent = parent.parent();\r\n }\r\n }\r\n else {\r\n parent = angular.element(options.offsetParent);\r\n }\r\n }\r\n\r\n $affix.init = function() {\r\n\r\n this.$parseOffsets();\r\n initialOffsetTop = dimensions.offset(element[0]).top + initialAffixTop;\r\n setWidth = !element[0].style.width;\r\n\r\n // Bind events\r\n targetEl.on('scroll', this.checkPosition);\r\n targetEl.on('click', this.checkPositionWithEventLoop);\r\n windowEl.on('resize', this.$debouncedOnResize);\r\n\r\n // Both of these checkPosition() calls are necessary for the case where\r\n // the user hits refresh after scrolling to the bottom of the page.\r\n this.checkPosition();\r\n this.checkPositionWithEventLoop();\r\n\r\n };\r\n\r\n $affix.destroy = function() {\r\n\r\n // Unbind events\r\n targetEl.off('scroll', this.checkPosition);\r\n targetEl.off('click', this.checkPositionWithEventLoop);\r\n windowEl.off('resize', this.$debouncedOnResize);\r\n\r\n };\r\n\r\n $affix.checkPositionWithEventLoop = function() {\r\n\r\n // IE 9 throws an error if we use 'this' instead of '$affix'\r\n // in this setTimeout call\r\n setTimeout($affix.checkPosition, 1);\r\n\r\n };\r\n\r\n $affix.checkPosition = function() {\r\n // if (!this.$element.is(':visible')) return\r\n\r\n var scrollTop = getScrollTop();\r\n var position = dimensions.offset(element[0]);\r\n var elementHeight = dimensions.height(element[0]);\r\n\r\n // Get required affix class according to position\r\n var affix = getRequiredAffixClass(unpin, position, elementHeight);\r\n\r\n // Did affix status changed this last check?\r\n if(affixed === affix) return;\r\n affixed = affix;\r\n\r\n // Add proper affix class\r\n element.removeClass(reset).addClass('affix' + ((affix !== 'middle') ? '-' + affix : ''));\r\n\r\n if(affix === 'top') {\r\n unpin = null;\r\n element.css('position', (options.offsetParent) ? '' : 'relative');\r\n if(setWidth) {\r\n element.css('width', '');\r\n }\r\n element.css('top', '');\r\n } else if(affix === 'bottom') {\r\n if (options.offsetUnpin) {\r\n unpin = -(options.offsetUnpin * 1);\r\n }\r\n else {\r\n // Calculate unpin threshold when affixed to bottom.\r\n // Hopefully the browser scrolls pixel by pixel.\r\n unpin = position.top - scrollTop;\r\n }\r\n if(setWidth) {\r\n element.css('width', '');\r\n }\r\n element.css('position', (options.offsetParent) ? '' : 'relative');\r\n element.css('top', (options.offsetParent) ? '' : ((bodyEl[0].offsetHeight - offsetBottom - elementHeight - initialOffsetTop) + 'px'));\r\n } else { // affix === 'middle'\r\n unpin = null;\r\n if(setWidth) {\r\n element.css('width', element[0].offsetWidth + 'px');\r\n }\r\n element.css('position', 'fixed');\r\n element.css('top', initialAffixTop + 'px');\r\n }\r\n\r\n };\r\n\r\n $affix.$onResize = function() {\r\n $affix.$parseOffsets();\r\n $affix.checkPosition();\r\n };\r\n $affix.$debouncedOnResize = debounce($affix.$onResize, 50);\r\n\r\n $affix.$parseOffsets = function() {\r\n var initialPosition = element.css('position');\r\n // Reset position to calculate correct offsetTop\r\n element.css('position', (options.offsetParent) ? '' : 'relative');\r\n\r\n if(options.offsetTop) {\r\n if(options.offsetTop === 'auto') {\r\n options.offsetTop = '+0';\r\n }\r\n if(options.offsetTop.match(/^[-+]\\d+$/)) {\r\n initialAffixTop = - options.offsetTop * 1;\r\n if(options.offsetParent) {\r\n offsetTop = dimensions.offset(parent[0]).top + (options.offsetTop * 1);\r\n }\r\n else {\r\n offsetTop = dimensions.offset(element[0]).top - dimensions.css(element[0], 'marginTop', true) + (options.offsetTop * 1);\r\n }\r\n }\r\n else {\r\n offsetTop = options.offsetTop * 1;\r\n }\r\n }\r\n\r\n if(options.offsetBottom) {\r\n if(options.offsetParent && options.offsetBottom.match(/^[-+]\\d+$/)) {\r\n // add 1 pixel due to rounding problems...\r\n offsetBottom = getScrollHeight() - (dimensions.offset(parent[0]).top + dimensions.height(parent[0])) + (options.offsetBottom * 1) + 1;\r\n }\r\n else {\r\n offsetBottom = options.offsetBottom * 1;\r\n }\r\n }\r\n\r\n // Bring back the element's position after calculations\r\n element.css('position', initialPosition);\r\n };\r\n\r\n // Private methods\r\n\r\n function getRequiredAffixClass(unpin, position, elementHeight) {\r\n\r\n var scrollTop = getScrollTop();\r\n var scrollHeight = getScrollHeight();\r\n\r\n if(scrollTop <= offsetTop) {\r\n return 'top';\r\n } else if(unpin !== null && (scrollTop + unpin <= position.top)) {\r\n return 'middle';\r\n } else if(offsetBottom !== null && (position.top + elementHeight + initialAffixTop >= scrollHeight - offsetBottom)) {\r\n return 'bottom';\r\n } else {\r\n return 'middle';\r\n }\r\n\r\n }\r\n\r\n function getScrollTop() {\r\n return targetEl[0] === $window ? $window.pageYOffset : targetEl[0].scrollTop;\r\n }\r\n\r\n function getScrollHeight() {\r\n return targetEl[0] === $window ? $window.document.body.scrollHeight : targetEl[0].scrollHeight;\r\n }\r\n\r\n $affix.init();\r\n return $affix;\r\n\r\n }\r\n\r\n return AffixFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsAffix', function($affix, $window) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: '^?bsAffixTarget',\r\n link: function postLink(scope, element, attr, affixTarget) {\r\n\r\n var options = {scope: scope, offsetTop: 'auto', target: affixTarget ? affixTarget.$element : angular.element($window)};\r\n angular.forEach(['offsetTop', 'offsetBottom', 'offsetParent', 'offsetUnpin'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n var affix = $affix(element, options);\r\n scope.$on('$destroy', function() {\r\n affix && affix.destroy();\r\n options = null;\r\n affix = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsAffixTarget', function() {\r\n return {\r\n controller: function($element) {\r\n this.$element = $element;\r\n }\r\n };\r\n });\r\n","'use strict';\r\n\r\n// @BUG: following snippet won't compile correctly\r\n// @TODO: submit issue to core\r\n// ' ' +\r\n\r\nangular.module('mgcrea.ngStrap.alert', ['mgcrea.ngStrap.modal'])\r\n\r\n .provider('$alert', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'alert',\r\n prefixEvent: 'alert',\r\n placement: null,\r\n template: 'alert/alert.tpl.html',\r\n container: false,\r\n element: null,\r\n backdrop: false,\r\n keyboard: true,\r\n show: true,\r\n // Specific options\r\n duration: false,\r\n type: false,\r\n dismissable: true\r\n };\r\n\r\n this.$get = function($modal, $timeout) {\r\n\r\n function AlertFactory(config) {\r\n\r\n var $alert = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $alert = $modal(options);\r\n\r\n // Support scope as string options [/*title, content, */ type, dismissable]\r\n $alert.$scope.dismissable = !!options.dismissable;\r\n if(options.type) {\r\n $alert.$scope.type = options.type;\r\n }\r\n\r\n // Support auto-close duration\r\n var show = $alert.show;\r\n if(options.duration) {\r\n $alert.show = function() {\r\n show();\r\n $timeout(function() {\r\n $alert.hide();\r\n }, options.duration * 1000);\r\n };\r\n }\r\n\r\n return $alert;\r\n\r\n }\r\n\r\n return AlertFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsAlert', function($window, $sce, $alert) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope, element: element, show: false};\r\n angular.forEach(['template', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content', 'type'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsAlert && scope.$watch(attr.bsAlert, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n }, true);\r\n\r\n // Initialize alert\r\n var alert = $alert(options);\r\n\r\n // Trigger\r\n element.on(attr.trigger || 'click', alert.toggle);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (alert) alert.destroy();\r\n options = null;\r\n alert = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.button', [])\r\n\r\n .provider('$button', function() {\r\n\r\n var defaults = this.defaults = {\r\n activeClass:'active',\r\n toggleEvent:'click'\r\n };\r\n\r\n this.$get = function() {\r\n return {defaults: defaults};\r\n };\r\n\r\n })\r\n\r\n .directive('bsCheckboxGroup', function() {\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n compile: function postLink(element, attr) {\r\n element.attr('data-toggle', 'buttons');\r\n element.removeAttr('ng-model');\r\n var children = element[0].querySelectorAll('input[type=\"checkbox\"]');\r\n angular.forEach(children, function(child) {\r\n var childEl = angular.element(child);\r\n childEl.attr('bs-checkbox', '');\r\n childEl.attr('ng-model', attr.ngModel + '.' + childEl.attr('value'));\r\n });\r\n }\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsCheckbox', function($button, $$rAF) {\r\n\r\n var defaults = $button.defaults;\r\n var constantValueRegExp = /^(true|false|\\d+)$/;\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n var options = defaults;\r\n\r\n // Support label > input[type=\"checkbox\"]\r\n var isInput = element[0].nodeName === 'INPUT';\r\n var activeElement = isInput ? element.parent() : element;\r\n\r\n var trueValue = angular.isDefined(attr.trueValue) ? attr.trueValue : true;\r\n if(constantValueRegExp.test(attr.trueValue)) {\r\n trueValue = scope.$eval(attr.trueValue);\r\n }\r\n var falseValue = angular.isDefined(attr.falseValue) ? attr.falseValue : false;\r\n if(constantValueRegExp.test(attr.falseValue)) {\r\n falseValue = scope.$eval(attr.falseValue);\r\n }\r\n\r\n // Parse exotic values\r\n var hasExoticValues = typeof trueValue !== 'boolean' || typeof falseValue !== 'boolean';\r\n if(hasExoticValues) {\r\n controller.$parsers.push(function(viewValue) {\r\n // console.warn('$parser', element.attr('ng-model'), 'viewValue', viewValue);\r\n return viewValue ? trueValue : falseValue;\r\n });\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n return angular.equals(modelValue, trueValue);\r\n });\r\n // Fix rendering for exotic values\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n controller.$render();\r\n });\r\n }\r\n\r\n // model -> view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n var isActive = angular.equals(controller.$modelValue, trueValue);\r\n $$rAF(function() {\r\n if(isInput) element[0].checked = isActive;\r\n activeElement.toggleClass(options.activeClass, isActive);\r\n });\r\n };\r\n\r\n // view -> model\r\n element.bind(options.toggleEvent, function() {\r\n scope.$apply(function () {\r\n // console.warn('!click', element.attr('ng-model'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\r\n if(!isInput) {\r\n controller.$setViewValue(!activeElement.hasClass('active'));\r\n }\r\n if(!hasExoticValues) {\r\n controller.$render();\r\n }\r\n });\r\n });\r\n\r\n }\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsRadioGroup', function() {\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n compile: function postLink(element, attr) {\r\n element.attr('data-toggle', 'buttons');\r\n element.removeAttr('ng-model');\r\n var children = element[0].querySelectorAll('input[type=\"radio\"]');\r\n angular.forEach(children, function(child) {\r\n angular.element(child).attr('bs-radio', '');\r\n angular.element(child).attr('ng-model', attr.ngModel);\r\n });\r\n }\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsRadio', function($button, $$rAF) {\r\n\r\n var defaults = $button.defaults;\r\n var constantValueRegExp = /^(true|false|\\d+)$/;\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n var options = defaults;\r\n\r\n // Support `label > input[type=\"radio\"]` markup\r\n var isInput = element[0].nodeName === 'INPUT';\r\n var activeElement = isInput ? element.parent() : element;\r\n\r\n var value = constantValueRegExp.test(attr.value) ? scope.$eval(attr.value) : attr.value;\r\n\r\n // model -> view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('value'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n var isActive = angular.equals(controller.$modelValue, value);\r\n $$rAF(function() {\r\n if(isInput) element[0].checked = isActive;\r\n activeElement.toggleClass(options.activeClass, isActive);\r\n });\r\n };\r\n\r\n // view -> model\r\n element.bind(options.toggleEvent, function() {\r\n scope.$apply(function () {\r\n // console.warn('!click', element.attr('value'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\r\n controller.$setViewValue(value);\r\n controller.$render();\r\n });\r\n });\r\n\r\n }\r\n\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.datepicker', [\r\n 'mgcrea.ngStrap.helpers.dateParser',\r\n 'mgcrea.ngStrap.helpers.dateFormatter',\r\n 'mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$datepicker', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'datepicker',\r\n placement: 'bottom-left',\r\n template: 'datepicker/datepicker.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n // lang: $locale.id,\r\n useNative: false,\r\n dateType: 'date',\r\n dateFormat: 'shortDate',\r\n modelDateFormat: null,\r\n dayFormat: 'dd',\r\n monthFormat: 'MMM',\r\n yearFormat: 'yyyy',\r\n monthTitleFormat: 'MMMM yyyy',\r\n yearTitleFormat: 'yyyy',\r\n strictFormat: false,\r\n autoclose: false,\r\n minDate: -Infinity,\r\n maxDate: +Infinity,\r\n startView: 0,\r\n minView: 0,\r\n startWeek: 0,\r\n daysOfWeekDisabled: '',\r\n iconLeft: 'glyphicon glyphicon-chevron-left',\r\n iconRight: 'glyphicon glyphicon-chevron-right'\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, datepickerViews, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var isTouch = ('createTouch' in $window.document) && isNative;\r\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\r\n\r\n function DatepickerFactory(element, controller, config) {\r\n\r\n var $datepicker = $tooltip(element, angular.extend({}, defaults, config));\r\n var parentScope = config.scope;\r\n var options = $datepicker.$options;\r\n var scope = $datepicker.$scope;\r\n if(options.startView) options.startView -= options.minView;\r\n\r\n // View vars\r\n\r\n var pickerViews = datepickerViews($datepicker);\r\n $datepicker.$views = pickerViews.views;\r\n var viewDate = pickerViews.viewDate;\r\n scope.$mode = options.startView;\r\n scope.$iconLeft = options.iconLeft;\r\n scope.$iconRight = options.iconRight;\r\n var $picker = $datepicker.$views[scope.$mode];\r\n\r\n // Scope methods\r\n\r\n scope.$select = function(date) {\r\n $datepicker.select(date);\r\n };\r\n scope.$selectPane = function(value) {\r\n $datepicker.$selectPane(value);\r\n };\r\n scope.$toggleMode = function() {\r\n $datepicker.setMode((scope.$mode + 1) % $datepicker.$views.length);\r\n };\r\n\r\n // Public methods\r\n\r\n $datepicker.update = function(date) {\r\n // console.warn('$datepicker.update() newValue=%o', date);\r\n if(angular.isDate(date) && !isNaN(date.getTime())) {\r\n $datepicker.$date = date;\r\n $picker.update.call($picker, date);\r\n }\r\n // Build only if pristine\r\n $datepicker.$build(true);\r\n };\r\n\r\n $datepicker.updateDisabledDates = function(dateRanges) {\r\n options.disabledDateRanges = dateRanges;\r\n for(var i = 0, l = scope.rows.length; i < l; i++) {\r\n angular.forEach(scope.rows[i], $datepicker.$setDisabledEl);\r\n }\r\n };\r\n\r\n $datepicker.select = function(date, keep) {\r\n // console.warn('$datepicker.select', date, scope.$mode);\r\n if(!angular.isDate(controller.$dateValue)) controller.$dateValue = new Date(date);\r\n if(!scope.$mode || keep) {\r\n controller.$setViewValue(angular.copy(date));\r\n controller.$render();\r\n if(options.autoclose && !keep) {\r\n $timeout(function() { $datepicker.hide(true); });\r\n }\r\n } else {\r\n angular.extend(viewDate, {year: date.getFullYear(), month: date.getMonth(), date: date.getDate()});\r\n $datepicker.setMode(scope.$mode - 1);\r\n $datepicker.$build();\r\n }\r\n };\r\n\r\n $datepicker.setMode = function(mode) {\r\n // console.warn('$datepicker.setMode', mode);\r\n scope.$mode = mode;\r\n $picker = $datepicker.$views[scope.$mode];\r\n $datepicker.$build();\r\n };\r\n\r\n // Protected methods\r\n\r\n $datepicker.$build = function(pristine) {\r\n // console.warn('$datepicker.$build() viewDate=%o', viewDate);\r\n if(pristine === true && $picker.built) return;\r\n if(pristine === false && !$picker.built) return;\r\n $picker.build.call($picker);\r\n };\r\n\r\n $datepicker.$updateSelected = function() {\r\n for(var i = 0, l = scope.rows.length; i < l; i++) {\r\n angular.forEach(scope.rows[i], updateSelected);\r\n }\r\n };\r\n\r\n $datepicker.$isSelected = function(date) {\r\n return $picker.isSelected(date);\r\n };\r\n\r\n $datepicker.$setDisabledEl = function(el) {\r\n el.disabled = $picker.isDisabled(el.date);\r\n };\r\n\r\n $datepicker.$selectPane = function(value) {\r\n var steps = $picker.steps;\r\n // set targetDate to first day of month to avoid problems with\r\n // date values rollover. This assumes the viewDate does not\r\n // depend on the day of the month \r\n var targetDate = new Date(Date.UTC(viewDate.year + ((steps.year || 0) * value), viewDate.month + ((steps.month || 0) * value), 1));\r\n angular.extend(viewDate, {year: targetDate.getUTCFullYear(), month: targetDate.getUTCMonth(), date: targetDate.getUTCDate()});\r\n $datepicker.$build();\r\n };\r\n\r\n $datepicker.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown on .dropdown-menu\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n // Emulate click for mobile devices\r\n if(isTouch) {\r\n var targetEl = angular.element(evt.target);\r\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\r\n targetEl = targetEl.parent();\r\n }\r\n targetEl.triggerHandler('click');\r\n }\r\n };\r\n\r\n $datepicker.$onKeyDown = function(evt) {\r\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n if(evt.keyCode === 13) {\r\n if(!scope.$mode) {\r\n return $datepicker.hide(true);\r\n } else {\r\n return scope.$apply(function() { $datepicker.setMode(scope.$mode - 1); });\r\n }\r\n }\r\n\r\n // Navigate with keyboard\r\n $picker.onKeyDown(evt);\r\n parentScope.$digest();\r\n };\r\n\r\n // Private\r\n\r\n function updateSelected(el) {\r\n el.selected = $datepicker.$isSelected(el.date);\r\n }\r\n\r\n function focusElement() {\r\n element[0].focus();\r\n }\r\n\r\n // Overrides\r\n\r\n var _init = $datepicker.init;\r\n $datepicker.init = function() {\r\n if(isNative && options.useNative) {\r\n element.prop('type', 'date');\r\n element.css('-webkit-appearance', 'textfield');\r\n return;\r\n } else if(isTouch) {\r\n element.prop('type', 'text');\r\n element.attr('readonly', 'true');\r\n element.on('click', focusElement);\r\n }\r\n _init();\r\n };\r\n\r\n var _destroy = $datepicker.destroy;\r\n $datepicker.destroy = function() {\r\n if(isNative && options.useNative) {\r\n element.off('click', focusElement);\r\n }\r\n _destroy();\r\n };\r\n\r\n var _show = $datepicker.show;\r\n $datepicker.show = function() {\r\n _show();\r\n // use timeout to hookup the events to prevent \r\n // event bubbling from being processed imediately. \r\n $timeout(function() {\r\n $datepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $datepicker.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var _hide = $datepicker.hide;\r\n $datepicker.hide = function(blur) {\r\n if(!$datepicker.$isShown) return;\r\n $datepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $datepicker.$onKeyDown);\r\n }\r\n _hide(blur);\r\n };\r\n\r\n return $datepicker;\r\n\r\n }\r\n\r\n DatepickerFactory.defaults = defaults;\r\n return DatepickerFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsDatepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $datepicker) {\r\n\r\n var defaults = $datepicker.defaults;\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope, controller: controller};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'dateType', 'dateFormat', 'modelDateFormat', 'dayFormat', 'strictFormat', 'startWeek', 'startDate', 'useNative', 'lang', 'startView', 'minView', 'iconLeft', 'iconRight', 'daysOfWeekDisabled'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!datepicker || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(datepicker),?/i);\r\n newValue === true ? datepicker.show() : datepicker.hide();\r\n });\r\n\r\n // Initialize datepicker\r\n var datepicker = $datepicker(element, controller, options);\r\n options = datepicker.$options;\r\n // Set expected iOS format\r\n if(isNative && options.useNative) options.dateFormat = 'yyyy-MM-dd';\r\n\r\n var lang = options.lang;\r\n\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n \r\n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\r\n\r\n // Observe attributes for changes\r\n angular.forEach(['minDate', 'maxDate'], function(key) {\r\n // console.warn('attr.$observe(%s)', key, attr[key]);\r\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\r\n // console.warn('attr.$observe(%s)=%o', key, newValue);\r\n datepicker.$options[key] = dateParser.getDateForAttribute(key, newValue);\r\n // Build only if dirty\r\n !isNaN(datepicker.$options[key]) && datepicker.$build(false);\r\n validateAgainstMinMaxDate(controller.$dateValue);\r\n });\r\n });\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n datepicker.update(controller.$dateValue);\r\n }, true);\r\n\r\n // Normalize undefined/null/empty array,\r\n // so that we don't treat changing from undefined->null as a change.\r\n function normalizeDateRanges(ranges) {\r\n if (!ranges || !ranges.length) return null;\r\n return ranges;\r\n }\r\n\r\n if (angular.isDefined(attr.disabledDates)) {\r\n scope.$watch(attr.disabledDates, function(disabledRanges, previousValue) {\r\n disabledRanges = normalizeDateRanges(disabledRanges);\r\n previousValue = normalizeDateRanges(previousValue);\r\n\r\n if (disabledRanges) {\r\n datepicker.updateDisabledDates(disabledRanges);\r\n }\r\n });\r\n }\r\n\r\n function validateAgainstMinMaxDate(parsedDate) {\r\n if (!angular.isDate(parsedDate)) return;\r\n var isMinValid = isNaN(datepicker.$options.minDate) || parsedDate.getTime() >= datepicker.$options.minDate;\r\n var isMaxValid = isNaN(datepicker.$options.maxDate) || parsedDate.getTime() <= datepicker.$options.maxDate;\r\n var isValid = isMinValid && isMaxValid;\r\n controller.$setValidity('date', isValid);\r\n controller.$setValidity('min', isMinValid);\r\n controller.$setValidity('max', isMaxValid);\r\n // Only update the model when we have a valid date\r\n if(isValid) controller.$dateValue = parsedDate;\r\n }\r\n\r\n // viewValue -> $parsers -> modelValue\r\n controller.$parsers.unshift(function(viewValue) {\r\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\r\n // Null values should correctly reset the model value & validity\r\n if(!viewValue) {\r\n controller.$setValidity('date', true);\r\n // BREAKING CHANGE:\r\n // return null (not undefined) when input value is empty, so angularjs 1.3 \r\n // ngModelController can go ahead and run validators, like ngRequired\r\n return null;\r\n }\r\n var parsedDate = dateParser.parse(viewValue, controller.$dateValue);\r\n if(!parsedDate || isNaN(parsedDate.getTime())) {\r\n controller.$setValidity('date', false);\r\n // return undefined, causes ngModelController to \r\n // invalidate model value \r\n return;\r\n } else {\r\n validateAgainstMinMaxDate(parsedDate);\r\n }\r\n if(options.dateType === 'string') {\r\n return formatDate(parsedDate, options.modelDateFormat || options.dateFormat);\r\n } else if(options.dateType === 'number') {\r\n return controller.$dateValue.getTime();\r\n } else if(options.dateType === 'unix') {\r\n return controller.$dateValue.getTime() / 1000;\r\n } else if(options.dateType === 'iso') {\r\n return controller.$dateValue.toISOString();\r\n } else {\r\n return new Date(controller.$dateValue);\r\n }\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n var date;\r\n if(angular.isUndefined(modelValue) || modelValue === null) {\r\n date = NaN;\r\n } else if(angular.isDate(modelValue)) {\r\n date = modelValue;\r\n } else if(options.dateType === 'string') {\r\n date = dateParser.parse(modelValue, null, options.modelDateFormat);\r\n } else if(options.dateType === 'unix') {\r\n date = new Date(modelValue * 1000);\r\n } else {\r\n date = new Date(modelValue);\r\n }\r\n // Setup default value?\r\n // if(isNaN(date.getTime())) {\r\n // var today = new Date();\r\n // date = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);\r\n // }\r\n controller.$dateValue = date;\r\n return getDateFormattedString();\r\n });\r\n\r\n // viewValue -> element\r\n controller.$render = function() {\r\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\r\n element.val(getDateFormattedString());\r\n };\r\n\r\n function getDateFormattedString() {\r\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.dateFormat);\r\n }\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if(datepicker) datepicker.destroy();\r\n options = null;\r\n datepicker = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .provider('datepickerViews', function() {\r\n\r\n var defaults = this.defaults = {\r\n dayFormat: 'dd',\r\n daySplit: 7\r\n };\r\n\r\n // Split array into smaller arrays\r\n function split(arr, size) {\r\n var arrays = [];\r\n while(arr.length > 0) {\r\n arrays.push(arr.splice(0, size));\r\n }\r\n return arrays;\r\n }\r\n\r\n // Modulus operator\r\n function mod(n, m) {\r\n return ((n % m) + m) % m;\r\n }\r\n\r\n this.$get = function($dateFormatter, $dateParser, $sce) {\r\n\r\n return function(picker) {\r\n\r\n var scope = picker.$scope;\r\n var options = picker.$options;\r\n\r\n var lang = options.lang;\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\r\n\r\n var weekDaysMin = $dateFormatter.weekdaysShort(lang);\r\n var weekDaysLabels = weekDaysMin.slice(options.startWeek).concat(weekDaysMin.slice(0, options.startWeek));\r\n var weekDaysLabelsHtml = $sce.trustAsHtml('' + weekDaysLabels.join(' ') + ' ');\r\n\r\n var startDate = picker.$date || (options.startDate ? dateParser.getDateForAttribute('startDate', options.startDate) : new Date());\r\n var viewDate = {year: startDate.getFullYear(), month: startDate.getMonth(), date: startDate.getDate()};\r\n var timezoneOffset = startDate.getTimezoneOffset() * 6e4;\r\n\r\n var views = [{\r\n format: options.dayFormat,\r\n split: 7,\r\n steps: { month: 1 },\r\n update: function(date, force) {\r\n if(!this.built || force || date.getFullYear() !== viewDate.year || date.getMonth() !== viewDate.month) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$build();\r\n } else if(date.getDate() !== viewDate.date) {\r\n viewDate.date = picker.$date.getDate();\r\n picker.$updateSelected();\r\n }\r\n },\r\n build: function() {\r\n var firstDayOfMonth = new Date(viewDate.year, viewDate.month, 1), firstDayOfMonthOffset = firstDayOfMonth.getTimezoneOffset();\r\n var firstDate = new Date(+firstDayOfMonth - mod(firstDayOfMonth.getDay() - options.startWeek, 7) * 864e5), firstDateOffset = firstDate.getTimezoneOffset();\r\n var today = new Date().toDateString();\r\n // Handle daylight time switch\r\n if(firstDateOffset !== firstDayOfMonthOffset) firstDate = new Date(+firstDate + (firstDateOffset - firstDayOfMonthOffset) * 60e3);\r\n var days = [], day;\r\n for(var i = 0; i < 42; i++) { // < 7 * 6\r\n day = dateParser.daylightSavingAdjust(new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate() + i));\r\n days.push({date: day, isToday: day.toDateString() === today, label: formatDate(day, this.format), selected: picker.$date && this.isSelected(day), muted: day.getMonth() !== viewDate.month, disabled: this.isDisabled(day)});\r\n }\r\n scope.title = formatDate(firstDayOfMonth, options.monthTitleFormat);\r\n scope.showLabels = true;\r\n scope.labels = weekDaysLabelsHtml;\r\n scope.rows = split(days, this.split);\r\n this.built = true;\r\n },\r\n isSelected: function(date) {\r\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth() && date.getDate() === picker.$date.getDate();\r\n },\r\n isDisabled: function(date) {\r\n var time = date.getTime();\r\n\r\n // Disabled because of min/max date.\r\n if (time < options.minDate || time > options.maxDate) return true;\r\n\r\n // Disabled due to being a disabled day of the week\r\n if (options.daysOfWeekDisabled.indexOf(date.getDay()) !== -1) return true;\r\n\r\n // Disabled because of disabled date range.\r\n if (options.disabledDateRanges) {\r\n for (var i = 0; i < options.disabledDateRanges.length; i++) {\r\n if (time >= options.disabledDateRanges[i].start && time <= options.disabledDateRanges[i].end) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n onKeyDown: function(evt) {\r\n if (!picker.$date) {\r\n return;\r\n }\r\n var actualTime = picker.$date.getTime();\r\n var newDate;\r\n\r\n if(evt.keyCode === 37) newDate = new Date(actualTime - 1 * 864e5);\r\n else if(evt.keyCode === 38) newDate = new Date(actualTime - 7 * 864e5);\r\n else if(evt.keyCode === 39) newDate = new Date(actualTime + 1 * 864e5);\r\n else if(evt.keyCode === 40) newDate = new Date(actualTime + 7 * 864e5);\r\n\r\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\r\n }\r\n }, {\r\n name: 'month',\r\n format: options.monthFormat,\r\n split: 4,\r\n steps: { year: 1 },\r\n update: function(date, force) {\r\n if(!this.built || date.getFullYear() !== viewDate.year) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$build();\r\n } else if(date.getMonth() !== viewDate.month) {\r\n angular.extend(viewDate, {month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$updateSelected();\r\n }\r\n },\r\n build: function() {\r\n var firstMonth = new Date(viewDate.year, 0, 1);\r\n var months = [], month;\r\n for (var i = 0; i < 12; i++) {\r\n month = new Date(viewDate.year, i, 1);\r\n months.push({date: month, label: formatDate(month, this.format), selected: picker.$isSelected(month), disabled: this.isDisabled(month)});\r\n }\r\n scope.title = formatDate(month, options.yearTitleFormat);\r\n scope.showLabels = false;\r\n scope.rows = split(months, this.split);\r\n this.built = true;\r\n },\r\n isSelected: function(date) {\r\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth();\r\n },\r\n isDisabled: function(date) {\r\n var lastDate = +new Date(date.getFullYear(), date.getMonth() + 1, 0);\r\n return lastDate < options.minDate || date.getTime() > options.maxDate;\r\n },\r\n onKeyDown: function(evt) {\r\n if (!picker.$date) {\r\n return;\r\n }\r\n var actualMonth = picker.$date.getMonth();\r\n var newDate = new Date(picker.$date);\r\n\r\n if(evt.keyCode === 37) newDate.setMonth(actualMonth - 1);\r\n else if(evt.keyCode === 38) newDate.setMonth(actualMonth - 4);\r\n else if(evt.keyCode === 39) newDate.setMonth(actualMonth + 1);\r\n else if(evt.keyCode === 40) newDate.setMonth(actualMonth + 4);\r\n\r\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\r\n }\r\n }, {\r\n name: 'year',\r\n format: options.yearFormat,\r\n split: 4,\r\n steps: { year: 12 },\r\n update: function(date, force) {\r\n if(!this.built || force || parseInt(date.getFullYear()/20, 10) !== parseInt(viewDate.year/20, 10)) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$build();\r\n } else if(date.getFullYear() !== viewDate.year) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$updateSelected();\r\n }\r\n },\r\n build: function() {\r\n var firstYear = viewDate.year - viewDate.year % (this.split * 3);\r\n var years = [], year;\r\n for (var i = 0; i < 12; i++) {\r\n year = new Date(firstYear + i, 0, 1);\r\n years.push({date: year, label: formatDate(year, this.format), selected: picker.$isSelected(year), disabled: this.isDisabled(year)});\r\n }\r\n scope.title = years[0].label + '-' + years[years.length - 1].label;\r\n scope.showLabels = false;\r\n scope.rows = split(years, this.split);\r\n this.built = true;\r\n },\r\n isSelected: function(date) {\r\n return picker.$date && date.getFullYear() === picker.$date.getFullYear();\r\n },\r\n isDisabled: function(date) {\r\n var lastDate = +new Date(date.getFullYear() + 1, 0, 0);\r\n return lastDate < options.minDate || date.getTime() > options.maxDate;\r\n },\r\n onKeyDown: function(evt) {\r\n if (!picker.$date) {\r\n return;\r\n }\r\n var actualYear = picker.$date.getFullYear(),\r\n newDate = new Date(picker.$date);\r\n\r\n if(evt.keyCode === 37) newDate.setYear(actualYear - 1);\r\n else if(evt.keyCode === 38) newDate.setYear(actualYear - 4);\r\n else if(evt.keyCode === 39) newDate.setYear(actualYear + 1);\r\n else if(evt.keyCode === 40) newDate.setYear(actualYear + 4);\r\n\r\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\r\n }\r\n }];\r\n\r\n return {\r\n views: options.minView ? Array.prototype.slice.call(views, options.minView) : views,\r\n viewDate: viewDate\r\n };\r\n\r\n };\r\n\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.collapse', [])\r\n\r\n .provider('$collapse', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-collapse',\r\n disallowToggle: false,\r\n activeClass: 'in',\r\n startCollapsed: false,\r\n allowMultiple: false\r\n };\r\n\r\n var controller = this.controller = function($scope, $element, $attrs) {\r\n var self = this;\r\n\r\n // Attributes options\r\n self.$options = angular.copy(defaults);\r\n angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed', 'allowMultiple'], function (key) {\r\n if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];\r\n });\r\n\r\n self.$toggles = [];\r\n self.$targets = [];\r\n\r\n self.$viewChangeListeners = [];\r\n\r\n self.$registerToggle = function(element) {\r\n self.$toggles.push(element);\r\n };\r\n self.$registerTarget = function(element) {\r\n self.$targets.push(element);\r\n };\r\n\r\n self.$unregisterToggle = function(element) {\r\n var index = self.$toggles.indexOf(element);\r\n // remove toggle from $toggles array\r\n self.$toggles.splice(index, 1);\r\n };\r\n self.$unregisterTarget = function(element) {\r\n var index = self.$targets.indexOf(element);\r\n\r\n // remove element from $targets array\r\n self.$targets.splice(index, 1);\r\n\r\n if (self.$options.allowMultiple) {\r\n // remove target index from $active array values\r\n deactivateItem(element);\r\n }\r\n\r\n // fix active item indexes\r\n fixActiveItemIndexes(index);\r\n\r\n self.$viewChangeListeners.forEach(function(fn) {\r\n fn();\r\n });\r\n };\r\n\r\n // use array to store all the currently open panels\r\n self.$targets.$active = !self.$options.startCollapsed ? [0] : [];\r\n self.$setActive = $scope.$setActive = function(value) {\r\n if(angular.isArray(value)) {\r\n self.$targets.$active = angular.copy(value);\r\n }\r\n else if(!self.$options.disallowToggle) {\r\n // toogle element active status\r\n isActive(value) ? deactivateItem(value) : activateItem(value);\r\n } else {\r\n activateItem(value);\r\n }\r\n\r\n self.$viewChangeListeners.forEach(function(fn) {\r\n fn();\r\n });\r\n };\r\n\r\n self.$activeIndexes = function() {\r\n return self.$options.allowMultiple ? self.$targets.$active :\r\n self.$targets.$active.length === 1 ? self.$targets.$active[0] : -1;\r\n };\r\n\r\n function fixActiveItemIndexes(index) {\r\n // item with index was removed, so we\r\n // need to adjust other items index values\r\n var activeIndexes = self.$targets.$active;\r\n for(var i = 0; i < activeIndexes.length; i++) {\r\n if (index < activeIndexes[i]) {\r\n activeIndexes[i] = activeIndexes[i] - 1;\r\n }\r\n\r\n // the last item is active, so we need to\r\n // adjust its index\r\n if (activeIndexes[i] === self.$targets.length) {\r\n activeIndexes[i] = self.$targets.length - 1;\r\n }\r\n }\r\n }\r\n\r\n function isActive(value) {\r\n var activeItems = self.$targets.$active;\r\n return activeItems.indexOf(value) === -1 ? false : true;\r\n }\r\n\r\n function deactivateItem(value) {\r\n var index = self.$targets.$active.indexOf(value);\r\n if (index !== -1) {\r\n self.$targets.$active.splice(index, 1);\r\n }\r\n }\r\n\r\n function activateItem(value) {\r\n if (!self.$options.allowMultiple) {\r\n // remove current selected item\r\n self.$targets.$active.splice(0, 1);\r\n }\r\n\r\n if (self.$targets.$active.indexOf(value) === -1) {\r\n self.$targets.$active.push(value);\r\n }\r\n }\r\n\r\n };\r\n\r\n this.$get = function() {\r\n var $collapse = {};\r\n $collapse.defaults = defaults;\r\n $collapse.controller = controller;\r\n return $collapse;\r\n };\r\n\r\n })\r\n\r\n .directive('bsCollapse', function($window, $animate, $collapse) {\r\n\r\n var defaults = $collapse.defaults;\r\n\r\n return {\r\n require: ['?ngModel', 'bsCollapse'],\r\n controller: ['$scope', '$element', '$attrs', $collapse.controller],\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsCollapseCtrl = controllers[1];\r\n\r\n if(ngModelCtrl) {\r\n\r\n // Update the modelValue following\r\n bsCollapseCtrl.$viewChangeListeners.push(function() {\r\n ngModelCtrl.$setViewValue(bsCollapseCtrl.$activeIndexes());\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n ngModelCtrl.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n if (angular.isArray(modelValue)) {\r\n // model value is an array, so just replace\r\n // the active items directly\r\n bsCollapseCtrl.$setActive(modelValue);\r\n }\r\n else {\r\n var activeIndexes = bsCollapseCtrl.$activeIndexes();\r\n\r\n if (angular.isArray(activeIndexes)) {\r\n // we have an array of selected indexes\r\n if (activeIndexes.indexOf(modelValue * 1) === -1) {\r\n // item with modelValue index is not active\r\n bsCollapseCtrl.$setActive(modelValue * 1);\r\n }\r\n }\r\n else if (activeIndexes !== modelValue * 1) {\r\n bsCollapseCtrl.$setActive(modelValue * 1);\r\n }\r\n }\r\n return modelValue;\r\n });\r\n\r\n }\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsCollapseToggle', function() {\r\n\r\n return {\r\n require: ['^?ngModel', '^bsCollapse'],\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsCollapseCtrl = controllers[1];\r\n\r\n // Add base attr\r\n element.attr('data-toggle', 'collapse');\r\n\r\n // Push pane to parent bsCollapse controller\r\n bsCollapseCtrl.$registerToggle(element);\r\n\r\n // remove toggle from collapse controller when toggle is destroyed\r\n scope.$on('$destroy', function() {\r\n bsCollapseCtrl.$unregisterToggle(element);\r\n });\r\n\r\n element.on('click', function() {\r\n var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);\r\n bsCollapseCtrl.$setActive(index * 1);\r\n scope.$apply();\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsCollapseTarget', function($animate) {\r\n\r\n return {\r\n require: ['^?ngModel', '^bsCollapse'],\r\n // scope: true,\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsCollapseCtrl = controllers[1];\r\n\r\n // Add base class\r\n element.addClass('collapse');\r\n\r\n // Add animation class\r\n if(bsCollapseCtrl.$options.animation) {\r\n element.addClass(bsCollapseCtrl.$options.animation);\r\n }\r\n\r\n // Push pane to parent bsCollapse controller\r\n bsCollapseCtrl.$registerTarget(element);\r\n\r\n // remove pane target from collapse controller when target is destroyed\r\n scope.$on('$destroy', function() {\r\n bsCollapseCtrl.$unregisterTarget(element);\r\n });\r\n\r\n function render() {\r\n var index = bsCollapseCtrl.$targets.indexOf(element);\r\n var active = bsCollapseCtrl.$activeIndexes();\r\n var action = 'removeClass';\r\n if (angular.isArray(active)) {\r\n if (active.indexOf(index) !== -1) {\r\n action = 'addClass';\r\n }\r\n }\r\n else if (index === active) {\r\n action = 'addClass';\r\n }\r\n\r\n $animate[action](element, bsCollapseCtrl.$options.activeClass);\r\n }\r\n\r\n bsCollapseCtrl.$viewChangeListeners.push(function() {\r\n render();\r\n });\r\n render();\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.dropdown', ['mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$dropdown', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'dropdown',\r\n placement: 'bottom-left',\r\n template: 'dropdown/dropdown.tpl.html',\r\n trigger: 'click',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0\r\n };\r\n\r\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;\r\n\r\n function DropdownFactory(element, config) {\r\n\r\n var $dropdown = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n var scope = $dropdown.$scope = options.scope && options.scope.$new() || $rootScope.$new();\r\n\r\n $dropdown = $tooltip(element, options);\r\n var parentEl = element.parent();\r\n\r\n // Protected methods\r\n\r\n $dropdown.$onKeyDown = function(evt) {\r\n if (!/(38|40)/.test(evt.keyCode)) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n // Retrieve focused index\r\n var items = angular.element($dropdown.$element[0].querySelectorAll('li:not(.divider) a'));\r\n if(!items.length) return;\r\n var index;\r\n angular.forEach(items, function(el, i) {\r\n if(matchesSelector && matchesSelector.call(el, ':focus')) index = i;\r\n });\r\n\r\n // Navigate with keyboard\r\n if(evt.keyCode === 38 && index > 0) index--;\r\n else if(evt.keyCode === 40 && index < items.length - 1) index++;\r\n else if(angular.isUndefined(index)) index = 0;\r\n items.eq(index)[0].focus();\r\n\r\n };\r\n\r\n // Overrides\r\n\r\n var show = $dropdown.show;\r\n $dropdown.show = function() {\r\n show();\r\n // use timeout to hookup the events to prevent \r\n // event bubbling from being processed imediately. \r\n $timeout(function() {\r\n options.keyboard && $dropdown.$element.on('keydown', $dropdown.$onKeyDown);\r\n bodyEl.on('click', onBodyClick);\r\n }, 0, false);\r\n parentEl.hasClass('dropdown') && parentEl.addClass('open');\r\n };\r\n\r\n var hide = $dropdown.hide;\r\n $dropdown.hide = function() {\r\n if(!$dropdown.$isShown) return;\r\n options.keyboard && $dropdown.$element.off('keydown', $dropdown.$onKeyDown);\r\n bodyEl.off('click', onBodyClick);\r\n parentEl.hasClass('dropdown') && parentEl.removeClass('open');\r\n hide();\r\n };\r\n\r\n var destroy = $dropdown.destroy;\r\n $dropdown.destroy = function() {\r\n bodyEl.off('click', onBodyClick);\r\n destroy();\r\n };\r\n\r\n // Private functions\r\n\r\n function onBodyClick(evt) {\r\n if(evt.target === element[0]) return;\r\n return evt.target !== element[0] && $dropdown.hide();\r\n }\r\n\r\n return $dropdown;\r\n\r\n }\r\n\r\n return DropdownFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsDropdown', function($window, $sce, $dropdown) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsDropdown && scope.$watch(attr.bsDropdown, function(newValue, oldValue) {\r\n scope.content = newValue;\r\n }, true);\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!dropdown || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(dropdown),?/i);\r\n newValue === true ? dropdown.show() : dropdown.hide();\r\n });\r\n\r\n // Initialize dropdown\r\n var dropdown = $dropdown(element, options);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (dropdown) dropdown.destroy();\r\n options = null;\r\n dropdown = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.dateFormatter', [])\r\n\r\n .service('$dateFormatter', function($locale, dateFilter) {\r\n\r\n // The unused `lang` arguments are on purpose. The default implementation does not\r\n // use them and it always uses the locale loaded into the `$locale` service.\r\n // Custom implementations might use it, thus allowing different directives to\r\n // have different languages.\r\n\r\n this.getDefaultLocale = function() {\r\n return $locale.id;\r\n };\r\n\r\n // Format is either a data format name, e.g. \"shortTime\" or \"fullDate\", or a date format\r\n // Return either the corresponding date format or the given date format.\r\n this.getDatetimeFormat = function(format, lang) {\r\n return $locale.DATETIME_FORMATS[format] || format;\r\n };\r\n\r\n this.weekdaysShort = function(lang) {\r\n return $locale.DATETIME_FORMATS.SHORTDAY;\r\n };\r\n\r\n function splitTimeFormat(format) {\r\n return /(h+)([:\\.])?(m+)[ ]?(a?)/i.exec(format).slice(1);\r\n }\r\n\r\n // h:mm a => h\r\n this.hoursFormat = function(timeFormat) {\r\n return splitTimeFormat(timeFormat)[0];\r\n };\r\n\r\n // h:mm a => mm\r\n this.minutesFormat = function(timeFormat) {\r\n return splitTimeFormat(timeFormat)[2];\r\n };\r\n\r\n // h:mm a => :\r\n this.timeSeparator = function(timeFormat) {\r\n return splitTimeFormat(timeFormat)[1];\r\n };\r\n\r\n // h:mm a => true, H.mm => false\r\n this.showAM = function(timeFormat) {\r\n return !!splitTimeFormat(timeFormat)[3];\r\n };\r\n\r\n this.formatDate = function(date, format, lang){\r\n return dateFilter(date, format);\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.dateParser', [])\r\n\r\n.provider('$dateParser', function($localeProvider) {\r\n\r\n // define a custom ParseDate object to use instead of native Date\r\n // to avoid date values wrapping when setting date component values\r\n function ParseDate() {\r\n this.year = 1970;\r\n this.month = 0;\r\n this.day = 1;\r\n this.hours = 0;\r\n this.minutes = 0;\r\n this.seconds = 0;\r\n this.milliseconds = 0;\r\n }\r\n\r\n ParseDate.prototype.setMilliseconds = function(value) { this.milliseconds = value; };\r\n ParseDate.prototype.setSeconds = function(value) { this.seconds = value; };\r\n ParseDate.prototype.setMinutes = function(value) { this.minutes = value; };\r\n ParseDate.prototype.setHours = function(value) { this.hours = value; };\r\n ParseDate.prototype.getHours = function() { return this.hours; };\r\n ParseDate.prototype.setDate = function(value) { this.day = value; };\r\n ParseDate.prototype.setMonth = function(value) { this.month = value; };\r\n ParseDate.prototype.setFullYear = function(value) { this.year = value; };\r\n ParseDate.prototype.fromDate = function(value) {\r\n this.year = value.getFullYear();\r\n this.month = value.getMonth();\r\n this.day = value.getDate();\r\n this.hours = value.getHours();\r\n this.minutes = value.getMinutes();\r\n this.seconds = value.getSeconds();\r\n this.milliseconds = value.getMilliseconds();\r\n return this;\r\n };\r\n\r\n ParseDate.prototype.toDate = function() {\r\n return new Date(this.year, this.month, this.day, this.hours, this.minutes, this.seconds, this.milliseconds);\r\n };\r\n\r\n var proto = ParseDate.prototype;\r\n\r\n function noop() {\r\n }\r\n\r\n function isNumeric(n) {\r\n return !isNaN(parseFloat(n)) && isFinite(n);\r\n }\r\n\r\n function indexOfCaseInsensitive(array, value) {\r\n var len = array.length, str=value.toString().toLowerCase();\r\n for (var i=0; i 12 when midnight changeover, but then cannot generate\r\n * midnight datetime, so jump to 1AM, otherwise reset.\r\n * @param date (Date) the date to check\r\n * @return (Date) the corrected date\r\n *\r\n * __ copied from jquery ui datepicker __\r\n */\r\n $dateParser.daylightSavingAdjust = function(date) {\r\n if (!date) {\r\n return null;\r\n }\r\n date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\r\n return date;\r\n };\r\n\r\n // Private functions\r\n\r\n function setMapForFormat(format) {\r\n var keys = Object.keys(setFnMap), i;\r\n var map = [], sortedMap = [];\r\n // Map to setFn\r\n var clonedFormat = format;\r\n for(i = 0; i < keys.length; i++) {\r\n if(format.split(keys[i]).length > 1) {\r\n var index = clonedFormat.search(keys[i]);\r\n format = format.split(keys[i]).join('');\r\n if(setFnMap[keys[i]]) {\r\n map[index] = setFnMap[keys[i]];\r\n }\r\n }\r\n }\r\n // Sort result map\r\n angular.forEach(map, function(v) {\r\n // conditional required since angular.forEach broke around v1.2.21\r\n // related pr: https://github.com/angular/angular.js/pull/8525\r\n if(v) sortedMap.push(v);\r\n });\r\n return sortedMap;\r\n }\r\n\r\n function escapeReservedSymbols(text) {\r\n return text.replace(/\\//g, '[\\\\/]').replace('/-/g', '[-]').replace(/\\./g, '[.]').replace(/\\\\s/g, '[\\\\s]');\r\n }\r\n\r\n function regExpForFormat(format) {\r\n var keys = Object.keys(regExpMap), i;\r\n\r\n var re = format;\r\n // Abstract replaces to avoid collisions\r\n for(i = 0; i < keys.length; i++) {\r\n re = re.split(keys[i]).join('${' + i + '}');\r\n }\r\n // Replace abstracted values\r\n for(i = 0; i < keys.length; i++) {\r\n re = re.split('${' + i + '}').join('(' + regExpMap[keys[i]] + ')');\r\n }\r\n format = escapeReservedSymbols(format);\r\n\r\n return new RegExp('^' + re + '$', ['i']);\r\n }\r\n\r\n $dateParser.init();\r\n return $dateParser;\r\n\r\n };\r\n\r\n return DateParserFactory;\r\n\r\n };\r\n\r\n});\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.debounce', [])\r\n\r\n// @source jashkenas/underscore\r\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L693\r\n.factory('debounce', function($timeout) {\r\n return function(func, wait, immediate) {\r\n var timeout = null;\r\n return function() {\r\n var context = this,\r\n args = arguments,\r\n callNow = immediate && !timeout;\r\n if(timeout) {\r\n $timeout.cancel(timeout);\r\n }\r\n timeout = $timeout(function later() {\r\n timeout = null;\r\n if(!immediate) {\r\n func.apply(context, args);\r\n }\r\n }, wait, false);\r\n if(callNow) {\r\n func.apply(context, args);\r\n }\r\n return timeout;\r\n };\r\n };\r\n})\r\n\r\n\r\n// @source jashkenas/underscore\r\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L661\r\n.factory('throttle', function($timeout) {\r\n return function(func, wait, options) {\r\n var timeout = null;\r\n options || (options = {});\r\n return function() {\r\n var context = this,\r\n args = arguments;\r\n if(!timeout) {\r\n if(options.leading !== false) {\r\n func.apply(context, args);\r\n }\r\n timeout = $timeout(function later() {\r\n timeout = null;\r\n if(options.trailing !== false) {\r\n func.apply(context, args);\r\n }\r\n }, wait, false);\r\n }\r\n };\r\n };\r\n});\r\n\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.dimensions', [])\r\n\r\n .factory('dimensions', function($document, $window) {\r\n\r\n var jqLite = angular.element;\r\n var fn = {};\r\n\r\n /**\r\n * Test the element nodeName\r\n * @param element\r\n * @param name\r\n */\r\n var nodeName = fn.nodeName = function(element, name) {\r\n return element.nodeName && element.nodeName.toLowerCase() === name.toLowerCase();\r\n };\r\n\r\n /**\r\n * Returns the element computed style\r\n * @param element\r\n * @param prop\r\n * @param extra\r\n */\r\n fn.css = function(element, prop, extra) {\r\n var value;\r\n if (element.currentStyle) { //IE\r\n value = element.currentStyle[prop];\r\n } else if (window.getComputedStyle) {\r\n value = window.getComputedStyle(element)[prop];\r\n } else {\r\n value = element.style[prop];\r\n }\r\n return extra === true ? parseFloat(value) || 0 : value;\r\n };\r\n\r\n /**\r\n * Provides read-only equivalent of jQuery's offset function:\r\n * @required-by bootstrap-tooltip, bootstrap-affix\r\n * @url http://api.jquery.com/offset/\r\n * @param element\r\n */\r\n fn.offset = function(element) {\r\n var boxRect = element.getBoundingClientRect();\r\n var docElement = element.ownerDocument;\r\n return {\r\n width: boxRect.width || element.offsetWidth,\r\n height: boxRect.height || element.offsetHeight,\r\n top: boxRect.top + (window.pageYOffset || docElement.documentElement.scrollTop) - (docElement.documentElement.clientTop || 0),\r\n left: boxRect.left + (window.pageXOffset || docElement.documentElement.scrollLeft) - (docElement.documentElement.clientLeft || 0)\r\n };\r\n };\r\n\r\n /**\r\n * Provides read-only equivalent of jQuery's position function\r\n * @required-by bootstrap-tooltip, bootstrap-affix\r\n * @url http://api.jquery.com/offset/\r\n * @param element\r\n */\r\n fn.position = function(element) {\r\n\r\n var offsetParentRect = {top: 0, left: 0},\r\n offsetParentElement,\r\n offset;\r\n\r\n // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\r\n if (fn.css(element, 'position') === 'fixed') {\r\n\r\n // We assume that getBoundingClientRect is available when computed position is fixed\r\n offset = element.getBoundingClientRect();\r\n\r\n } else {\r\n\r\n // Get *real* offsetParentElement\r\n offsetParentElement = offsetParent(element);\r\n\r\n // Get correct offsets\r\n offset = fn.offset(element);\r\n if (!nodeName(offsetParentElement, 'html')) {\r\n offsetParentRect = fn.offset(offsetParentElement);\r\n }\r\n\r\n // Add offsetParent borders\r\n offsetParentRect.top += fn.css(offsetParentElement, 'borderTopWidth', true);\r\n offsetParentRect.left += fn.css(offsetParentElement, 'borderLeftWidth', true);\r\n }\r\n\r\n // Subtract parent offsets and element margins\r\n return {\r\n width: element.offsetWidth,\r\n height: element.offsetHeight,\r\n top: offset.top - offsetParentRect.top - fn.css(element, 'marginTop', true),\r\n left: offset.left - offsetParentRect.left - fn.css(element, 'marginLeft', true)\r\n };\r\n\r\n };\r\n\r\n /**\r\n * Returns the closest, non-statically positioned offsetParent of a given element\r\n * @required-by fn.position\r\n * @param element\r\n */\r\n var offsetParent = function offsetParentElement(element) {\r\n var docElement = element.ownerDocument;\r\n var offsetParent = element.offsetParent || docElement;\r\n if(nodeName(offsetParent, '#document')) return docElement.documentElement;\r\n while(offsetParent && !nodeName(offsetParent, 'html') && fn.css(offsetParent, 'position') === 'static') {\r\n offsetParent = offsetParent.offsetParent;\r\n }\r\n return offsetParent || docElement.documentElement;\r\n };\r\n\r\n /**\r\n * Provides equivalent of jQuery's height function\r\n * @required-by bootstrap-affix\r\n * @url http://api.jquery.com/height/\r\n * @param element\r\n * @param outer\r\n */\r\n fn.height = function(element, outer) {\r\n var value = element.offsetHeight;\r\n if(outer) {\r\n value += fn.css(element, 'marginTop', true) + fn.css(element, 'marginBottom', true);\r\n } else {\r\n value -= fn.css(element, 'paddingTop', true) + fn.css(element, 'paddingBottom', true) + fn.css(element, 'borderTopWidth', true) + fn.css(element, 'borderBottomWidth', true);\r\n }\r\n return value;\r\n };\r\n\r\n /**\r\n * Provides equivalent of jQuery's width function\r\n * @required-by bootstrap-affix\r\n * @url http://api.jquery.com/width/\r\n * @param element\r\n * @param outer\r\n */\r\n fn.width = function(element, outer) {\r\n var value = element.offsetWidth;\r\n if(outer) {\r\n value += fn.css(element, 'marginLeft', true) + fn.css(element, 'marginRight', true);\r\n } else {\r\n value -= fn.css(element, 'paddingLeft', true) + fn.css(element, 'paddingRight', true) + fn.css(element, 'borderLeftWidth', true) + fn.css(element, 'borderRightWidth', true);\r\n }\r\n return value;\r\n };\r\n\r\n return fn;\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.parseOptions', [])\r\n\r\n .provider('$parseOptions', function() {\r\n\r\n var defaults = this.defaults = {\r\n regexp: /^\\s*(.*?)(?:\\s+as\\s+(.*?))?(?:\\s+group\\s+by\\s+(.*))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+(.*?)(?:\\s+track\\s+by\\s+(.*?))?$/\r\n };\r\n\r\n this.$get = function($parse, $q) {\r\n\r\n function ParseOptionsFactory(attr, config) {\r\n\r\n var $parseOptions = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n $parseOptions.$values = [];\r\n\r\n // Private vars\r\n var match, displayFn, valueName, keyName, groupByFn, valueFn, valuesFn;\r\n\r\n $parseOptions.init = function() {\r\n $parseOptions.$match = match = attr.match(options.regexp);\r\n displayFn = $parse(match[2] || match[1]),\r\n valueName = match[4] || match[6],\r\n keyName = match[5],\r\n groupByFn = $parse(match[3] || ''),\r\n valueFn = $parse(match[2] ? match[1] : valueName),\r\n valuesFn = $parse(match[7]);\r\n };\r\n\r\n $parseOptions.valuesFn = function(scope, controller) {\r\n return $q.when(valuesFn(scope, controller))\r\n .then(function(values) {\r\n $parseOptions.$values = values ? parseValues(values, scope) : {};\r\n return $parseOptions.$values;\r\n });\r\n };\r\n\r\n $parseOptions.displayValue = function(modelValue) {\r\n var scope = {};\r\n scope[valueName] = modelValue;\r\n return displayFn(scope);\r\n };\r\n\r\n // Private functions\r\n\r\n function parseValues(values, scope) {\r\n return values.map(function(match, index) {\r\n var locals = {}, label, value;\r\n locals[valueName] = match;\r\n label = displayFn(scope, locals);\r\n value = valueFn(scope, locals);\r\n return {label: label, value: value, index: index};\r\n });\r\n }\r\n\r\n $parseOptions.init();\r\n return $parseOptions;\r\n\r\n }\r\n\r\n return ParseOptionsFactory;\r\n\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\n(angular.version.minor < 3 && angular.version.dot < 14) && angular.module('ng')\r\n\r\n.factory('$$rAF', function($window, $timeout) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame ||\r\n $window.webkitRequestAnimationFrame ||\r\n $window.mozRequestAnimationFrame;\r\n\r\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\r\n $window.webkitCancelAnimationFrame ||\r\n $window.mozCancelAnimationFrame ||\r\n $window.webkitCancelRequestAnimationFrame;\r\n\r\n var rafSupported = !!requestAnimationFrame;\r\n var raf = rafSupported ?\r\n function(fn) {\r\n var id = requestAnimationFrame(fn);\r\n return function() {\r\n cancelAnimationFrame(id);\r\n };\r\n } :\r\n function(fn) {\r\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\r\n return function() {\r\n $timeout.cancel(timer);\r\n };\r\n };\r\n\r\n raf.supported = rafSupported;\r\n\r\n return raf;\r\n\r\n});\r\n\r\n// .factory('$$animateReflow', function($$rAF, $document) {\r\n\r\n// var bodyEl = $document[0].body;\r\n\r\n// return function(fn) {\r\n// //the returned function acts as the cancellation function\r\n// return $$rAF(function() {\r\n// //the line below will force the browser to perform a repaint\r\n// //so that all the animated elements within the animation frame\r\n// //will be properly updated and drawn on screen. This is\r\n// //required to perform multi-class CSS based animations with\r\n// //Firefox. DO NOT REMOVE THIS LINE.\r\n// var a = bodyEl.offsetWidth + 1;\r\n// fn();\r\n// });\r\n// };\r\n\r\n// });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])\r\n\r\n .provider('$aside', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade-and-slide-right',\r\n prefixClass: 'aside',\r\n prefixEvent: 'aside',\r\n placement: 'right',\r\n template: 'aside/aside.tpl.html',\r\n contentTemplate: false,\r\n container: false,\r\n element: null,\r\n backdrop: true,\r\n keyboard: true,\r\n html: false,\r\n show: true\r\n };\r\n\r\n this.$get = function($modal) {\r\n\r\n function AsideFactory(config) {\r\n\r\n var $aside = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $aside = $modal(options);\r\n\r\n return $aside;\r\n\r\n }\r\n\r\n return AsideFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsAside', function($window, $sce, $aside) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n // Directive options\r\n var options = {scope: scope, element: element, show: false};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n }, true);\r\n\r\n // Initialize aside\r\n var aside = $aside(options);\r\n\r\n // Trigger\r\n element.on(attr.trigger || 'click', aside.toggle);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (aside) aside.destroy();\r\n options = null;\r\n aside = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])\r\n\r\n .provider('$modal', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n backdropAnimation: 'am-fade',\r\n prefixClass: 'modal',\r\n prefixEvent: 'modal',\r\n placement: 'top',\r\n template: 'modal/modal.tpl.html',\r\n contentTemplate: false,\r\n container: false,\r\n element: null,\r\n backdrop: true,\r\n keyboard: true,\r\n html: false,\r\n show: true\r\n };\r\n\r\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {\r\n\r\n var forEach = angular.forEach;\r\n var trim = String.prototype.trim;\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n var bodyElement = angular.element($window.document.body);\r\n var htmlReplaceRegExp = /ng-bind=\"/ig;\r\n\r\n function ModalFactory(config) {\r\n\r\n var $modal = {};\r\n\r\n // Common vars\r\n var options = $modal.$options = angular.extend({}, defaults, config);\r\n $modal.$promise = fetchTemplate(options.template);\r\n var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();\r\n if(!options.element && !options.container) {\r\n options.container = 'body';\r\n }\r\n\r\n // Support scope as string options\r\n forEach(['title', 'content'], function(key) {\r\n if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);\r\n });\r\n\r\n // Provide scope helpers\r\n scope.$hide = function() {\r\n scope.$$postDigest(function() {\r\n $modal.hide();\r\n });\r\n };\r\n scope.$show = function() {\r\n scope.$$postDigest(function() {\r\n $modal.show();\r\n });\r\n };\r\n scope.$toggle = function() {\r\n scope.$$postDigest(function() {\r\n $modal.toggle();\r\n });\r\n };\r\n // Publish isShown as a protected var on scope\r\n $modal.$isShown = scope.$isShown = false;\r\n\r\n // Support contentTemplate option\r\n if(options.contentTemplate) {\r\n $modal.$promise = $modal.$promise.then(function(template) {\r\n var templateEl = angular.element(template);\r\n return fetchTemplate(options.contentTemplate)\r\n .then(function(contentTemplate) {\r\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]).removeAttr('ng-bind').html(contentTemplate);\r\n // Drop the default footer as you probably don't want it if you use a custom contentTemplate\r\n if(!config.template) contentEl.next().remove();\r\n return templateEl[0].outerHTML;\r\n });\r\n });\r\n }\r\n\r\n // Fetch, compile then initialize modal\r\n var modalLinker, modalElement;\r\n var backdropElement = angular.element('
');\r\n $modal.$promise.then(function(template) {\r\n if(angular.isObject(template)) template = template.data;\r\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\r\n template = trim.apply(template);\r\n modalLinker = $compile(template);\r\n $modal.init();\r\n });\r\n\r\n $modal.init = function() {\r\n\r\n // Options: show\r\n if(options.show) {\r\n scope.$$postDigest(function() {\r\n $modal.show();\r\n });\r\n }\r\n\r\n };\r\n\r\n $modal.destroy = function() {\r\n\r\n // Remove element\r\n if(modalElement) {\r\n modalElement.remove();\r\n modalElement = null;\r\n }\r\n if(backdropElement) {\r\n backdropElement.remove();\r\n backdropElement = null;\r\n }\r\n\r\n // Destroy scope\r\n scope.$destroy();\r\n\r\n };\r\n\r\n $modal.show = function() {\r\n if($modal.$isShown) return;\r\n\r\n if(scope.$emit(options.prefixEvent + '.show.before', $modal).defaultPrevented) {\r\n return;\r\n }\r\n var parent, after;\r\n if(angular.isElement(options.container)) {\r\n parent = options.container;\r\n after = options.container[0].lastChild ? angular.element(options.container[0].lastChild) : null;\r\n } else {\r\n if (options.container) {\r\n parent = findElement(options.container);\r\n after = parent[0].lastChild ? angular.element(parent[0].lastChild) : null;\r\n } else {\r\n parent = null;\r\n after = options.element;\r\n }\r\n }\r\n\r\n // Fetch a cloned element linked from template\r\n modalElement = $modal.$element = modalLinker(scope, function(clonedElement, scope) {});\r\n\r\n // Set the initial positioning.\r\n modalElement.css({display: 'block'}).addClass(options.placement);\r\n\r\n // Options: animation\r\n if(options.animation) {\r\n if(options.backdrop) {\r\n backdropElement.addClass(options.backdropAnimation);\r\n }\r\n modalElement.addClass(options.animation);\r\n }\r\n\r\n if(options.backdrop) {\r\n $animate.enter(backdropElement, bodyElement, null);\r\n }\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n var promise = $animate.enter(modalElement, parent, after, enterAnimateCallback);\r\n if(promise && promise.then) promise.then(enterAnimateCallback);\r\n\r\n $modal.$isShown = scope.$isShown = true;\r\n safeDigest(scope);\r\n // Focus once the enter-animation has started\r\n // Weird PhantomJS bug hack\r\n var el = modalElement[0];\r\n requestAnimationFrame(function() {\r\n el.focus();\r\n });\r\n\r\n bodyElement.addClass(options.prefixClass + '-open');\r\n if(options.animation) {\r\n bodyElement.addClass(options.prefixClass + '-with-' + options.animation);\r\n }\r\n\r\n // Bind events\r\n if(options.backdrop) {\r\n modalElement.on('click', hideOnBackdropClick);\r\n backdropElement.on('click', hideOnBackdropClick);\r\n backdropElement.on('wheel', preventEventDefault);\r\n }\r\n if(options.keyboard) {\r\n modalElement.on('keyup', $modal.$onKeyUp);\r\n }\r\n };\r\n\r\n function enterAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.show', $modal);\r\n }\r\n\r\n $modal.hide = function() {\r\n if(!$modal.$isShown) return;\r\n\r\n if(scope.$emit(options.prefixEvent + '.hide.before', $modal).defaultPrevented) {\r\n return;\r\n }\r\n var promise = $animate.leave(modalElement, leaveAnimateCallback);\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n if(promise && promise.then) promise.then(leaveAnimateCallback);\r\n\r\n if(options.backdrop) {\r\n $animate.leave(backdropElement);\r\n }\r\n $modal.$isShown = scope.$isShown = false;\r\n safeDigest(scope);\r\n\r\n // Unbind events\r\n if(options.backdrop) {\r\n modalElement.off('click', hideOnBackdropClick);\r\n backdropElement.off('click', hideOnBackdropClick);\r\n backdropElement.off('wheel', preventEventDefault);\r\n }\r\n if(options.keyboard) {\r\n modalElement.off('keyup', $modal.$onKeyUp);\r\n }\r\n };\r\n\r\n function leaveAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.hide', $modal);\r\n bodyElement.removeClass(options.prefixClass + '-open');\r\n if(options.animation) {\r\n bodyElement.removeClass(options.prefixClass + '-with-' + options.animation);\r\n }\r\n }\r\n\r\n $modal.toggle = function() {\r\n\r\n $modal.$isShown ? $modal.hide() : $modal.show();\r\n\r\n };\r\n\r\n $modal.focus = function() {\r\n modalElement[0].focus();\r\n };\r\n\r\n // Protected methods\r\n\r\n $modal.$onKeyUp = function(evt) {\r\n\r\n if (evt.which === 27 && $modal.$isShown) {\r\n $modal.hide();\r\n evt.stopPropagation();\r\n }\r\n\r\n };\r\n\r\n // Private methods\r\n\r\n function hideOnBackdropClick(evt) {\r\n if(evt.target !== evt.currentTarget) return;\r\n options.backdrop === 'static' ? $modal.focus() : $modal.hide();\r\n }\r\n\r\n function preventEventDefault(evt) {\r\n evt.preventDefault();\r\n }\r\n\r\n return $modal;\r\n\r\n }\r\n\r\n // Helper functions\r\n\r\n function safeDigest(scope) {\r\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\r\n }\r\n\r\n function findElement(query, element) {\r\n return angular.element((element || document).querySelectorAll(query));\r\n }\r\n\r\n var fetchPromises = {};\r\n function fetchTemplate(template) {\r\n if(fetchPromises[template]) return fetchPromises[template];\r\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\r\n .then(function(res) {\r\n if(angular.isObject(res)) {\r\n $templateCache.put(template, res.data);\r\n return res.data;\r\n }\r\n return res;\r\n }));\r\n }\r\n\r\n return ModalFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsModal', function($window, $sce, $modal) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope, element: element, show: false};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsModal && scope.$watch(attr.bsModal, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n }, true);\r\n\r\n // Initialize modal\r\n var modal = $modal(options);\r\n\r\n // Trigger\r\n element.on(attr.trigger || 'click', modal.toggle);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (modal) modal.destroy();\r\n options = null;\r\n modal = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.navbar', [])\r\n\r\n .provider('$navbar', function() {\r\n\r\n var defaults = this.defaults = {\r\n activeClass: 'active',\r\n routeAttr: 'data-match-route',\r\n strict: false\r\n };\r\n\r\n this.$get = function() {\r\n return {defaults: defaults};\r\n };\r\n\r\n })\r\n\r\n .directive('bsNavbar', function($window, $location, $navbar) {\r\n\r\n var defaults = $navbar.defaults;\r\n\r\n return {\r\n restrict: 'A',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = angular.copy(defaults);\r\n angular.forEach(Object.keys(defaults), function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Watch for the $location\r\n scope.$watch(function() {\r\n\r\n return $location.path();\r\n\r\n }, function(newValue, oldValue) {\r\n\r\n var liElements = element[0].querySelectorAll('li[' + options.routeAttr + ']');\r\n\r\n angular.forEach(liElements, function(li) {\r\n\r\n var liElement = angular.element(li);\r\n var pattern = liElement.attr(options.routeAttr).replace('/', '\\\\/');\r\n if(options.strict) {\r\n pattern = '^' + pattern + '$';\r\n }\r\n var regexp = new RegExp(pattern, ['i']);\r\n\r\n if(regexp.test(newValue)) {\r\n liElement.addClass(options.activeClass);\r\n } else {\r\n liElement.removeClass(options.activeClass);\r\n }\r\n\r\n });\r\n\r\n });\r\n\r\n }\r\n\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.scrollspy', ['mgcrea.ngStrap.helpers.debounce', 'mgcrea.ngStrap.helpers.dimensions'])\r\n\r\n .provider('$scrollspy', function() {\r\n\r\n // Pool of registered spies\r\n var spies = this.$$spies = {};\r\n\r\n var defaults = this.defaults = {\r\n debounce: 150,\r\n throttle: 100,\r\n offset: 100\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, dimensions, debounce, throttle) {\r\n\r\n var windowEl = angular.element($window);\r\n var docEl = angular.element($document.prop('documentElement'));\r\n var bodyEl = angular.element($window.document.body);\r\n\r\n // Helper functions\r\n\r\n function nodeName(element, name) {\r\n return element[0].nodeName && element[0].nodeName.toLowerCase() === name.toLowerCase();\r\n }\r\n\r\n function ScrollSpyFactory(config) {\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n if(!options.element) options.element = bodyEl;\r\n var isWindowSpy = nodeName(options.element, 'body');\r\n var scrollEl = isWindowSpy ? windowEl : options.element;\r\n var scrollId = isWindowSpy ? 'window' : options.id;\r\n\r\n // Use existing spy\r\n if(spies[scrollId]) {\r\n spies[scrollId].$$count++;\r\n return spies[scrollId];\r\n }\r\n\r\n var $scrollspy = {};\r\n\r\n // Private vars\r\n var unbindViewContentLoaded, unbindIncludeContentLoaded;\r\n var trackedElements = $scrollspy.$trackedElements = [];\r\n var sortedElements = [];\r\n var activeTarget;\r\n var debouncedCheckPosition;\r\n var throttledCheckPosition;\r\n var debouncedCheckOffsets;\r\n var viewportHeight;\r\n var scrollTop;\r\n\r\n $scrollspy.init = function() {\r\n\r\n // Setup internal ref counter\r\n this.$$count = 1;\r\n\r\n // Bind events\r\n debouncedCheckPosition = debounce(this.checkPosition, options.debounce);\r\n throttledCheckPosition = throttle(this.checkPosition, options.throttle);\r\n scrollEl.on('click', this.checkPositionWithEventLoop);\r\n windowEl.on('resize', debouncedCheckPosition);\r\n scrollEl.on('scroll', throttledCheckPosition);\r\n\r\n debouncedCheckOffsets = debounce(this.checkOffsets, options.debounce);\r\n unbindViewContentLoaded = $rootScope.$on('$viewContentLoaded', debouncedCheckOffsets);\r\n unbindIncludeContentLoaded = $rootScope.$on('$includeContentLoaded', debouncedCheckOffsets);\r\n debouncedCheckOffsets();\r\n\r\n // Register spy for reuse\r\n if(scrollId) {\r\n spies[scrollId] = $scrollspy;\r\n }\r\n\r\n };\r\n\r\n $scrollspy.destroy = function() {\r\n\r\n // Check internal ref counter\r\n this.$$count--;\r\n if(this.$$count > 0) {\r\n return;\r\n }\r\n\r\n // Unbind events\r\n scrollEl.off('click', this.checkPositionWithEventLoop);\r\n windowEl.off('resize', debouncedCheckPosition);\r\n scrollEl.off('scroll', throttledCheckPosition);\r\n unbindViewContentLoaded();\r\n unbindIncludeContentLoaded();\r\n if (scrollId) {\r\n delete spies[scrollId];\r\n }\r\n };\r\n\r\n $scrollspy.checkPosition = function() {\r\n\r\n // Not ready yet\r\n if(!sortedElements.length) return;\r\n\r\n // Calculate the scroll position\r\n scrollTop = (isWindowSpy ? $window.pageYOffset : scrollEl.prop('scrollTop')) || 0;\r\n\r\n // Calculate the viewport height for use by the components\r\n viewportHeight = Math.max($window.innerHeight, docEl.prop('clientHeight'));\r\n\r\n // Activate first element if scroll is smaller\r\n if(scrollTop < sortedElements[0].offsetTop && activeTarget !== sortedElements[0].target) {\r\n return $scrollspy.$activateElement(sortedElements[0]);\r\n }\r\n\r\n // Activate proper element\r\n for (var i = sortedElements.length; i--;) {\r\n if(angular.isUndefined(sortedElements[i].offsetTop) || sortedElements[i].offsetTop === null) continue;\r\n if(activeTarget === sortedElements[i].target) continue;\r\n if(scrollTop < sortedElements[i].offsetTop) continue;\r\n if(sortedElements[i + 1] && scrollTop > sortedElements[i + 1].offsetTop) continue;\r\n return $scrollspy.$activateElement(sortedElements[i]);\r\n }\r\n\r\n };\r\n\r\n $scrollspy.checkPositionWithEventLoop = function() {\r\n // IE 9 throws an error if we use 'this' instead of '$scrollspy'\r\n // in this setTimeout call\r\n setTimeout($scrollspy.checkPosition, 1);\r\n };\r\n\r\n // Protected methods\r\n\r\n $scrollspy.$activateElement = function(element) {\r\n if(activeTarget) {\r\n var activeElement = $scrollspy.$getTrackedElement(activeTarget);\r\n if(activeElement) {\r\n activeElement.source.removeClass('active');\r\n if(nodeName(activeElement.source, 'li') && nodeName(activeElement.source.parent().parent(), 'li')) {\r\n activeElement.source.parent().parent().removeClass('active');\r\n }\r\n }\r\n }\r\n activeTarget = element.target;\r\n element.source.addClass('active');\r\n if(nodeName(element.source, 'li') && nodeName(element.source.parent().parent(), 'li')) {\r\n element.source.parent().parent().addClass('active');\r\n }\r\n };\r\n\r\n $scrollspy.$getTrackedElement = function(target) {\r\n return trackedElements.filter(function(obj) {\r\n return obj.target === target;\r\n })[0];\r\n };\r\n\r\n // Track offsets behavior\r\n\r\n $scrollspy.checkOffsets = function() {\r\n\r\n angular.forEach(trackedElements, function(trackedElement) {\r\n var targetElement = document.querySelector(trackedElement.target);\r\n trackedElement.offsetTop = targetElement ? dimensions.offset(targetElement).top : null;\r\n if(options.offset && trackedElement.offsetTop !== null) trackedElement.offsetTop -= options.offset * 1;\r\n });\r\n\r\n sortedElements = trackedElements\r\n .filter(function(el) {\r\n return el.offsetTop !== null;\r\n })\r\n .sort(function(a, b) {\r\n return a.offsetTop - b.offsetTop;\r\n });\r\n\r\n debouncedCheckPosition();\r\n\r\n };\r\n\r\n $scrollspy.trackElement = function(target, source) {\r\n trackedElements.push({target: target, source: source});\r\n };\r\n\r\n $scrollspy.untrackElement = function(target, source) {\r\n var toDelete;\r\n for (var i = trackedElements.length; i--;) {\r\n if(trackedElements[i].target === target && trackedElements[i].source === source) {\r\n toDelete = i;\r\n break;\r\n }\r\n }\r\n trackedElements = trackedElements.splice(toDelete, 1);\r\n };\r\n\r\n $scrollspy.activate = function(i) {\r\n trackedElements[i].addClass('active');\r\n };\r\n\r\n // Initialize plugin\r\n\r\n $scrollspy.init();\r\n return $scrollspy;\r\n\r\n }\r\n\r\n return ScrollSpyFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsScrollspy', function($rootScope, debounce, dimensions, $scrollspy) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n link: function postLink(scope, element, attr) {\r\n\r\n var options = {scope: scope};\r\n angular.forEach(['offset', 'target'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n var scrollspy = $scrollspy(options);\r\n scrollspy.trackElement(options.target, element);\r\n\r\n scope.$on('$destroy', function() {\r\n if (scrollspy) {\r\n scrollspy.untrackElement(options.target, element);\r\n scrollspy.destroy();\r\n }\r\n options = null;\r\n scrollspy = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n\r\n .directive('bsScrollspyList', function($rootScope, debounce, dimensions, $scrollspy) {\r\n\r\n return {\r\n restrict: 'A',\r\n compile: function postLink(element, attr) {\r\n var children = element[0].querySelectorAll('li > a[href]');\r\n angular.forEach(children, function(child) {\r\n var childEl = angular.element(child);\r\n childEl.parent().attr('bs-scrollspy', '').attr('data-target', childEl.attr('href'));\r\n });\r\n }\r\n\r\n };\r\n\r\n });\r\n","'use strict';\n\nangular.module('mgcrea.ngStrap.progressbar', [])\n.provider('$progressbar', function (){\n var defaults = {\n barType: '',\n animate: function (){ return true;}\n };\n\n this.$get = function (){\n return {\n defaults: defaults\n };\n };\n })\n .directive('bsProgressbar', function ($progressbar){\n return {\n restrict: 'E',\n transclude: true,\n replace: true,\n templateUrl: 'progressbar/progressbar.tpl.html',\n scope:{\n value: '=',\n type: '@',\n animate: '&'\n },\n link: function (scope, element, attr){\n scope.type = scope.type || $progressbar.defaults.barType;\n scope.animate = angular.isDefined(scope.animate()) ? scope.animate : $progressbar.defaults.animate;\n console.log(scope.animate(), $progressbar.defaults.animate, angular.isDefined(scope.animate));\n scope.$watch('type', function (){\n if(scope.type) {\n scope.barClass = 'progress-bar-' + scope.type;\n }\n else{\n scope.barClass = null;\n }\n });\n }\n };\n });\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.select', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\r\n\r\n .provider('$select', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'select',\r\n prefixEvent: '$select',\r\n placement: 'bottom-left',\r\n template: 'select/select.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n multiple: false,\r\n allNoneButtons: false,\r\n sort: true,\r\n caretHtml: ' ',\r\n placeholder: 'Choose among the following...',\r\n allText: 'All',\r\n noneText: 'None',\r\n maxLength: 3,\r\n maxLengthHtml: 'selected',\r\n iconCheckmark: 'glyphicon glyphicon-ok'\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var isTouch = ('createTouch' in $window.document) && isNative;\r\n\r\n function SelectFactory(element, controller, config) {\r\n\r\n var $select = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $select = $tooltip(element, options);\r\n var scope = $select.$scope;\r\n\r\n scope.$matches = [];\r\n scope.$activeIndex = 0;\r\n scope.$isMultiple = options.multiple;\r\n scope.$showAllNoneButtons = options.allNoneButtons && options.multiple;\r\n scope.$iconCheckmark = options.iconCheckmark;\r\n scope.$allText = options.allText;\r\n scope.$noneText = options.noneText;\r\n\r\n scope.$activate = function(index) {\r\n scope.$$postDigest(function() {\r\n $select.activate(index);\r\n });\r\n };\r\n\r\n scope.$select = function(index, evt) {\r\n scope.$$postDigest(function() {\r\n $select.select(index);\r\n });\r\n };\r\n\r\n scope.$isVisible = function() {\r\n return $select.$isVisible();\r\n };\r\n\r\n scope.$isActive = function(index) {\r\n return $select.$isActive(index);\r\n };\r\n\r\n scope.$selectAll = function () {\r\n for (var i = 0; i < scope.$matches.length; i++) {\r\n if (!scope.$isActive(i)) {\r\n scope.$select(i);\r\n }\r\n }\r\n };\r\n\r\n scope.$selectNone = function () {\r\n for (var i = 0; i < scope.$matches.length; i++) {\r\n if (scope.$isActive(i)) {\r\n scope.$select(i);\r\n }\r\n }\r\n };\r\n\r\n // Public methods\r\n\r\n $select.update = function(matches) {\r\n scope.$matches = matches;\r\n $select.$updateActiveIndex();\r\n };\r\n\r\n $select.activate = function(index) {\r\n if(options.multiple) {\r\n scope.$activeIndex.sort();\r\n $select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index);\r\n if(options.sort) scope.$activeIndex.sort();\r\n } else {\r\n scope.$activeIndex = index;\r\n }\r\n return scope.$activeIndex;\r\n };\r\n\r\n $select.select = function(index) {\r\n var value = scope.$matches[index].value;\r\n scope.$apply(function() {\r\n $select.activate(index);\r\n if(options.multiple) {\r\n controller.$setViewValue(scope.$activeIndex.map(function(index) {\r\n return scope.$matches[index].value;\r\n }));\r\n } else {\r\n controller.$setViewValue(value);\r\n // Hide if single select\r\n $select.hide();\r\n }\r\n });\r\n // Emit event\r\n scope.$emit(options.prefixEvent + '.select', value, index);\r\n };\r\n\r\n // Protected methods\r\n\r\n $select.$updateActiveIndex = function() {\r\n if(controller.$modelValue && scope.$matches.length) {\r\n if(options.multiple && angular.isArray(controller.$modelValue)) {\r\n scope.$activeIndex = controller.$modelValue.map(function(value) {\r\n return $select.$getIndex(value);\r\n });\r\n } else {\r\n scope.$activeIndex = $select.$getIndex(controller.$modelValue);\r\n }\r\n } else if(scope.$activeIndex >= scope.$matches.length) {\r\n scope.$activeIndex = options.multiple ? [] : 0;\r\n }\r\n };\r\n\r\n $select.$isVisible = function() {\r\n if(!options.minLength || !controller) {\r\n return scope.$matches.length;\r\n }\r\n // minLength support\r\n return scope.$matches.length && controller.$viewValue.length >= options.minLength;\r\n };\r\n\r\n $select.$isActive = function(index) {\r\n if(options.multiple) {\r\n return scope.$activeIndex.indexOf(index) !== -1;\r\n } else {\r\n return scope.$activeIndex === index;\r\n }\r\n };\r\n\r\n $select.$getIndex = function(value) {\r\n var l = scope.$matches.length, i = l;\r\n if(!l) return;\r\n for(i = l; i--;) {\r\n if(scope.$matches[i].value === value) break;\r\n }\r\n if(i < 0) return;\r\n return i;\r\n };\r\n\r\n $select.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown on .dropdown-menu\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n // Emulate click for mobile devices\r\n if(isTouch) {\r\n var targetEl = angular.element(evt.target);\r\n targetEl.triggerHandler('click');\r\n }\r\n };\r\n\r\n $select.$onKeyDown = function(evt) {\r\n if (!/(9|13|38|40)/.test(evt.keyCode)) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n // Select with enter\r\n if(!options.multiple && (evt.keyCode === 13 || evt.keyCode === 9)) {\r\n return $select.select(scope.$activeIndex);\r\n }\r\n\r\n // Navigate with keyboard\r\n if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\r\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\r\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\r\n scope.$digest();\r\n };\r\n\r\n // Overrides\r\n\r\n var _show = $select.show;\r\n $select.show = function() {\r\n _show();\r\n if(options.multiple) {\r\n $select.$element.addClass('select-multiple');\r\n }\r\n // use timeout to hookup the events to prevent\r\n // event bubbling from being processed imediately.\r\n $timeout(function() {\r\n $select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $select.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var _hide = $select.hide;\r\n $select.hide = function() {\r\n $select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $select.$onKeyDown);\r\n }\r\n _hide(true);\r\n };\r\n\r\n return $select;\r\n\r\n }\r\n\r\n SelectFactory.defaults = defaults;\r\n return SelectFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsSelect', function($window, $parse, $q, $select, $parseOptions) {\r\n\r\n var defaults = $select.defaults;\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope, placeholder: defaults.placeholder};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Add support for select markup\r\n if(element[0].nodeName.toLowerCase() === 'select') {\r\n var inputEl = element;\r\n inputEl.css('display', 'none');\r\n element = angular.element(' ');\r\n inputEl.after(element);\r\n }\r\n\r\n // Build proper ngOptions\r\n var parsedOptions = $parseOptions(attr.ngOptions);\r\n\r\n // Initialize select\r\n var select = $select(element, controller, options);\r\n\r\n // Watch ngOptions values before filtering for changes\r\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').trim();\r\n scope.$watch(watchedOptions, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\r\n parsedOptions.valuesFn(scope, controller)\r\n .then(function(values) {\r\n select.update(values);\r\n controller.$render();\r\n });\r\n }, true);\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue);\r\n select.$updateActiveIndex();\r\n controller.$render();\r\n }, true);\r\n\r\n // Model rendering in view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n var selected, index;\r\n if(options.multiple && angular.isArray(controller.$modelValue)) {\r\n selected = controller.$modelValue.map(function(value) {\r\n index = select.$getIndex(value);\r\n return angular.isDefined(index) ? select.$scope.$matches[index].label : false;\r\n }).filter(angular.isDefined);\r\n if(selected.length > (options.maxLength || defaults.maxLength)) {\r\n selected = selected.length + ' ' + (options.maxLengthHtml || defaults.maxLengthHtml);\r\n } else {\r\n selected = selected.join(', ');\r\n }\r\n } else {\r\n index = select.$getIndex(controller.$modelValue);\r\n selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false;\r\n }\r\n element.html((selected ? selected : options.placeholder) + defaults.caretHtml);\r\n };\r\n\r\n if(options.multiple){\r\n controller.$isEmpty = function(value){\r\n return !value || value.length === 0;\r\n };\r\n }\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (select) select.destroy();\r\n options = null;\r\n select = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.tab', [])\r\n\r\n .provider('$tab', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n template: 'tab/tab.tpl.html',\r\n navClass: 'nav-tabs',\r\n activeClass: 'active'\r\n };\r\n\r\n var controller = this.controller = function($scope, $element, $attrs) {\r\n var self = this;\r\n\r\n // Attributes options\r\n self.$options = angular.copy(defaults);\r\n angular.forEach(['animation', 'navClass', 'activeClass'], function(key) {\r\n if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];\r\n });\r\n\r\n // Publish options on scope\r\n $scope.$navClass = self.$options.navClass;\r\n $scope.$activeClass = self.$options.activeClass;\r\n\r\n self.$panes = $scope.$panes = [];\r\n\r\n // DEPRECATED: $viewChangeListeners, please use $activePaneChangeListeners\r\n // Because we deprecated ngModel usage, we rename viewChangeListeners to \r\n // activePaneChangeListeners to make more sense.\r\n self.$activePaneChangeListeners = self.$viewChangeListeners = [];\r\n\r\n self.$push = function(pane) {\r\n self.$panes.push(pane);\r\n };\r\n\r\n self.$remove = function(pane) {\r\n var index = self.$panes.indexOf(pane);\r\n var activeIndex = self.$panes.$active;\r\n\r\n // remove pane from $panes array\r\n self.$panes.splice(index, 1);\r\n\r\n if (index < activeIndex) {\r\n // we removed a pane before the active pane, so we need to \r\n // decrement the active pane index\r\n activeIndex--;\r\n }\r\n else if (index === activeIndex && activeIndex === self.$panes.length) {\r\n // we remove the active pane and it was the one at the end,\r\n // so select the previous one\r\n activeIndex--;\r\n }\r\n self.$setActive(activeIndex);\r\n };\r\n\r\n self.$panes.$active = 0;\r\n self.$setActive = $scope.$setActive = function(value) {\r\n self.$panes.$active = value;\r\n self.$activePaneChangeListeners.forEach(function(fn) {\r\n fn();\r\n });\r\n };\r\n\r\n };\r\n\r\n this.$get = function() {\r\n var $tab = {};\r\n $tab.defaults = defaults;\r\n $tab.controller = controller;\r\n return $tab;\r\n };\r\n\r\n })\r\n\r\n .directive('bsTabs', function($window, $animate, $tab, $parse) {\r\n\r\n var defaults = $tab.defaults;\r\n\r\n return {\r\n require: ['?ngModel', 'bsTabs'],\r\n transclude: true,\r\n scope: true,\r\n controller: ['$scope', '$element', '$attrs', $tab.controller],\r\n templateUrl: function(element, attr) {\r\n return attr.template || defaults.template;\r\n },\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsTabsCtrl = controllers[1];\r\n\r\n // DEPRECATED: ngModel, please use bsActivePane\r\n // 'ngModel' is deprecated bacause if interferes with form validation\r\n // and status, so avoid using it here.\r\n if(ngModelCtrl) {\r\n console.warn('Usage of ngModel is deprecated, please use bsActivePane instead!');\r\n\r\n // Update the modelValue following\r\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\r\n ngModelCtrl.$setViewValue(bsTabsCtrl.$panes.$active);\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n ngModelCtrl.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n bsTabsCtrl.$setActive(modelValue * 1);\r\n return modelValue;\r\n });\r\n\r\n }\r\n\r\n if (attrs.bsActivePane) {\r\n // adapted from angularjs ngModelController bindings\r\n // https://github.com/angular/angular.js/blob/v1.3.1/src%2Fng%2Fdirective%2Finput.js#L1730\r\n var parsedBsActivePane = $parse(attrs.bsActivePane);\r\n\r\n // Update bsActivePane value with change\r\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\r\n parsedBsActivePane.assign(scope, bsTabsCtrl.$panes.$active);\r\n });\r\n\r\n // watch bsActivePane for value changes\r\n scope.$watch(attrs.bsActivePane, function(newValue, oldValue) {\r\n bsTabsCtrl.$setActive(newValue * 1);\r\n }, true);\r\n }\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsPane', function($window, $animate, $sce) {\r\n\r\n return {\r\n require: ['^?ngModel', '^bsTabs'],\r\n scope: true,\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsTabsCtrl = controllers[1];\r\n\r\n // Add base class\r\n element.addClass('tab-pane');\r\n\r\n // Observe title attribute for change\r\n attrs.$observe('title', function(newValue, oldValue) {\r\n scope.title = $sce.trustAsHtml(newValue);\r\n });\r\n\r\n // Add animation class\r\n if(bsTabsCtrl.$options.animation) {\r\n element.addClass(bsTabsCtrl.$options.animation);\r\n }\r\n\r\n // Push pane to parent bsTabs controller\r\n bsTabsCtrl.$push(scope);\r\n\r\n // remove pane from tab controller when pane is destroyed\r\n scope.$on('$destroy', function() {\r\n bsTabsCtrl.$remove(scope);\r\n });\r\n\r\n function render() {\r\n var index = bsTabsCtrl.$panes.indexOf(scope);\r\n var active = bsTabsCtrl.$panes.$active;\r\n $animate[index === active ? 'addClass' : 'removeClass'](element, bsTabsCtrl.$options.activeClass);\r\n }\r\n\r\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\r\n render();\r\n });\r\n render();\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.popover', ['mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$popover', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n customClass: '',\r\n container: false,\r\n target: false,\r\n placement: 'right',\r\n template: 'popover/popover.tpl.html',\r\n contentTemplate: false,\r\n trigger: 'click',\r\n keyboard: true,\r\n html: false,\r\n title: '',\r\n content: '',\r\n delay: 0,\r\n autoClose: false\r\n };\r\n\r\n this.$get = function($tooltip) {\r\n\r\n function PopoverFactory(element, config) {\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n var $popover = $tooltip(element, options);\r\n\r\n // Support scope as string options [/*title, */content]\r\n if(options.content) {\r\n $popover.$scope.content = options.content;\r\n }\r\n\r\n return $popover;\r\n\r\n }\r\n\r\n return PopoverFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsPopover', function($window, $sce, $popover) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'customClass', 'autoClose'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\r\n popover && popover.$applyPlacement();\r\n });\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsPopover && scope.$watch(attr.bsPopover, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\r\n popover && popover.$applyPlacement();\r\n });\r\n }, true);\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!popover || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(popover),?/i);\r\n newValue === true ? popover.show() : popover.hide();\r\n });\r\n\r\n // Initialize popover\r\n var popover = $popover(element, options);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (popover) popover.destroy();\r\n options = null;\r\n popover = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])\r\n\r\n .provider('$tooltip', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n customClass: '',\r\n prefixClass: 'tooltip',\r\n prefixEvent: 'tooltip',\r\n container: false,\r\n target: false,\r\n placement: 'top',\r\n template: 'tooltip/tooltip.tpl.html',\r\n contentTemplate: false,\r\n trigger: 'hover focus',\r\n keyboard: false,\r\n html: false,\r\n show: false,\r\n title: '',\r\n type: '',\r\n delay: 0,\r\n autoClose: false,\r\n bsEnabled: true\r\n };\r\n\r\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {\r\n\r\n var trim = String.prototype.trim;\r\n var isTouch = 'createTouch' in $window.document;\r\n var htmlReplaceRegExp = /ng-bind=\"/ig;\r\n var $body = angular.element($window.document);\r\n\r\n function TooltipFactory(element, config) {\r\n\r\n var $tooltip = {};\r\n\r\n // Common vars\r\n var nodeName = element[0].nodeName.toLowerCase();\r\n var options = $tooltip.$options = angular.extend({}, defaults, config);\r\n $tooltip.$promise = fetchTemplate(options.template);\r\n var scope = $tooltip.$scope = options.scope && options.scope.$new() || $rootScope.$new();\r\n if(options.delay && angular.isString(options.delay)) {\r\n var split = options.delay.split(',').map(parseFloat);\r\n options.delay = split.length > 1 ? {show: split[0], hide: split[1]} : split[0];\r\n }\r\n\r\n // Support scope as string options\r\n if(options.title) {\r\n scope.title = $sce.trustAsHtml(options.title);\r\n }\r\n\r\n // Provide scope helpers\r\n scope.$setEnabled = function(isEnabled) {\r\n scope.$$postDigest(function() {\r\n $tooltip.setEnabled(isEnabled);\r\n });\r\n };\r\n scope.$hide = function() {\r\n scope.$$postDigest(function() {\r\n $tooltip.hide();\r\n });\r\n };\r\n scope.$show = function() {\r\n scope.$$postDigest(function() {\r\n $tooltip.show();\r\n });\r\n };\r\n scope.$toggle = function() {\r\n scope.$$postDigest(function() {\r\n $tooltip.toggle();\r\n });\r\n };\r\n // Publish isShown as a protected var on scope\r\n $tooltip.$isShown = scope.$isShown = false;\r\n\r\n // Private vars\r\n var timeout, hoverState;\r\n\r\n // Support contentTemplate option\r\n if(options.contentTemplate) {\r\n $tooltip.$promise = $tooltip.$promise.then(function(template) {\r\n var templateEl = angular.element(template);\r\n return fetchTemplate(options.contentTemplate)\r\n .then(function(contentTemplate) {\r\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]);\r\n if(!contentEl.length) contentEl = findElement('[ng-bind=\"title\"]', templateEl[0]);\r\n contentEl.removeAttr('ng-bind').html(contentTemplate);\r\n return templateEl[0].outerHTML;\r\n });\r\n });\r\n }\r\n\r\n // Fetch, compile then initialize tooltip\r\n var tipLinker, tipElement, tipTemplate, tipContainer, tipScope;\r\n $tooltip.$promise.then(function(template) {\r\n if(angular.isObject(template)) template = template.data;\r\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\r\n template = trim.apply(template);\r\n tipTemplate = template;\r\n tipLinker = $compile(template);\r\n $tooltip.init();\r\n });\r\n\r\n $tooltip.init = function() {\r\n\r\n // Options: delay\r\n if (options.delay && angular.isNumber(options.delay)) {\r\n options.delay = {\r\n show: options.delay,\r\n hide: options.delay\r\n };\r\n }\r\n\r\n // Replace trigger on touch devices ?\r\n // if(isTouch && options.trigger === defaults.trigger) {\r\n // options.trigger.replace(/hover/g, 'click');\r\n // }\r\n\r\n // Options : container\r\n if(options.container === 'self') {\r\n tipContainer = element;\r\n } else if(angular.isElement(options.container)) {\r\n tipContainer = options.container;\r\n } else if(options.container) {\r\n tipContainer = findElement(options.container);\r\n }\r\n\r\n // Options: trigger\r\n bindTriggerEvents();\r\n\r\n // Options: target\r\n if(options.target) {\r\n options.target = angular.isElement(options.target) ? options.target : findElement(options.target);\r\n }\r\n\r\n // Options: show\r\n if(options.show) {\r\n scope.$$postDigest(function() {\r\n options.trigger === 'focus' ? element[0].focus() : $tooltip.show();\r\n });\r\n }\r\n\r\n };\r\n\r\n $tooltip.destroy = function() {\r\n\r\n // Unbind events\r\n unbindTriggerEvents();\r\n\r\n // Remove element\r\n destroyTipElement();\r\n\r\n // Destroy scope\r\n scope.$destroy();\r\n\r\n };\r\n\r\n $tooltip.enter = function() {\r\n\r\n clearTimeout(timeout);\r\n hoverState = 'in';\r\n if (!options.delay || !options.delay.show) {\r\n return $tooltip.show();\r\n }\r\n\r\n timeout = setTimeout(function() {\r\n if (hoverState ==='in') $tooltip.show();\r\n }, options.delay.show);\r\n\r\n };\r\n\r\n $tooltip.show = function() {\r\n if (!options.bsEnabled || $tooltip.$isShown) return;\r\n\r\n scope.$emit(options.prefixEvent + '.show.before', $tooltip);\r\n var parent, after;\r\n if (options.container) {\r\n parent = tipContainer;\r\n if (tipContainer[0].lastChild) {\r\n after = angular.element(tipContainer[0].lastChild);\r\n } else {\r\n after = null;\r\n }\r\n } else {\r\n parent = null;\r\n after = element;\r\n }\r\n\r\n\r\n // Hide any existing tipElement\r\n if(tipElement) destroyTipElement();\r\n // Fetch a cloned element linked from template\r\n tipScope = $tooltip.$scope.$new();\r\n tipElement = $tooltip.$element = tipLinker(tipScope, function(clonedElement, scope) {});\r\n\r\n // Set the initial positioning. Make the tooltip invisible\r\n // so IE doesn't try to focus on it off screen.\r\n tipElement.css({top: '-9999px', left: '-9999px', display: 'block', visibility: 'hidden'});\r\n\r\n // Options: animation\r\n if(options.animation) tipElement.addClass(options.animation);\r\n // Options: type\r\n if(options.type) tipElement.addClass(options.prefixClass + '-' + options.type);\r\n // Options: custom classes\r\n if(options.customClass) tipElement.addClass(options.customClass);\r\n\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n var promise = $animate.enter(tipElement, parent, after, enterAnimateCallback);\r\n if(promise && promise.then) promise.then(enterAnimateCallback);\r\n\r\n $tooltip.$isShown = scope.$isShown = true;\r\n safeDigest(scope);\r\n $$rAF(function () {\r\n $tooltip.$applyPlacement();\r\n\r\n // Once placed, make the tooltip visible\r\n if(tipElement) tipElement.css({visibility: 'visible'});\r\n }); // var a = bodyEl.offsetWidth + 1; ?\r\n\r\n // Bind events\r\n if(options.keyboard) {\r\n if(options.trigger !== 'focus') {\r\n $tooltip.focus();\r\n }\r\n bindKeyboardEvents();\r\n }\r\n\r\n if(options.autoClose) {\r\n bindAutoCloseEvents();\r\n }\r\n\r\n };\r\n\r\n function enterAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.show', $tooltip);\r\n }\r\n\r\n $tooltip.leave = function() {\r\n\r\n clearTimeout(timeout);\r\n hoverState = 'out';\r\n if (!options.delay || !options.delay.hide) {\r\n return $tooltip.hide();\r\n }\r\n timeout = setTimeout(function () {\r\n if (hoverState === 'out') {\r\n $tooltip.hide();\r\n }\r\n }, options.delay.hide);\r\n\r\n };\r\n\r\n var _blur;\r\n $tooltip.hide = function(blur) {\r\n\r\n if(!$tooltip.$isShown) return;\r\n scope.$emit(options.prefixEvent + '.hide.before', $tooltip);\r\n\r\n // store blur value for leaveAnimateCallback to use\r\n _blur = blur;\r\n\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n var promise = $animate.leave(tipElement, leaveAnimateCallback);\r\n if(promise && promise.then) promise.then(leaveAnimateCallback);\r\n\r\n $tooltip.$isShown = scope.$isShown = false;\r\n safeDigest(scope);\r\n\r\n // Unbind events\r\n if(options.keyboard && tipElement !== null) {\r\n unbindKeyboardEvents();\r\n }\r\n\r\n if(options.autoClose && tipElement !== null) {\r\n unbindAutoCloseEvents();\r\n }\r\n };\r\n\r\n function leaveAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.hide', $tooltip);\r\n // Allow to blur the input when hidden, like when pressing enter key\r\n if(_blur && options.trigger === 'focus') {\r\n return element[0].blur();\r\n }\r\n\r\n // clean up child scopes\r\n destroyTipElement();\r\n }\r\n\r\n $tooltip.toggle = function() {\r\n $tooltip.$isShown ? $tooltip.leave() : $tooltip.enter();\r\n };\r\n\r\n $tooltip.focus = function() {\r\n tipElement[0].focus();\r\n };\r\n\r\n $tooltip.setEnabled = function(isEnabled) {\r\n options.bsEnabled = isEnabled;\r\n };\r\n\r\n // Protected methods\r\n\r\n $tooltip.$applyPlacement = function() {\r\n if(!tipElement) return;\r\n\r\n // Determine if we're doing an auto or normal placement\r\n var placement = options.placement,\r\n autoToken = /\\s?auto?\\s?/i,\r\n autoPlace = autoToken.test(placement);\r\n\r\n if (autoPlace) {\r\n placement = placement.replace(autoToken, '') || defaults.placement;\r\n }\r\n\r\n // Need to add the position class before we get\r\n // the offsets\r\n tipElement.addClass(options.placement);\r\n\r\n // Get the position of the target element\r\n // and the height and width of the tooltip so we can center it.\r\n var elementPosition = getPosition(),\r\n tipWidth = tipElement.prop('offsetWidth'),\r\n tipHeight = tipElement.prop('offsetHeight');\r\n\r\n // If we're auto placing, we need to check the positioning\r\n if (autoPlace) {\r\n var originalPlacement = placement;\r\n var container = options.container ? angular.element(document.querySelector(options.container)) : element.parent();\r\n var containerPosition = getPosition(container);\r\n\r\n // Determine if the vertical placement\r\n if (originalPlacement.indexOf('bottom') >= 0 && elementPosition.bottom + tipHeight > containerPosition.bottom) {\r\n placement = originalPlacement.replace('bottom', 'top');\r\n } else if (originalPlacement.indexOf('top') >= 0 && elementPosition.top - tipHeight < containerPosition.top) {\r\n placement = originalPlacement.replace('top', 'bottom');\r\n }\r\n\r\n // Determine the horizontal placement\r\n // The exotic placements of left and right are opposite of the standard placements. Their arrows are put on the left/right\r\n // and flow in the opposite direction of their placement.\r\n if ((originalPlacement === 'right' || originalPlacement === 'bottom-left' || originalPlacement === 'top-left') &&\r\n elementPosition.right + tipWidth > containerPosition.width) {\r\n\r\n placement = originalPlacement === 'right' ? 'left' : placement.replace('left', 'right');\r\n } else if ((originalPlacement === 'left' || originalPlacement === 'bottom-right' || originalPlacement === 'top-right') &&\r\n elementPosition.left - tipWidth < containerPosition.left) {\r\n\r\n placement = originalPlacement === 'left' ? 'right' : placement.replace('right', 'left');\r\n }\r\n\r\n tipElement.removeClass(originalPlacement).addClass(placement);\r\n }\r\n\r\n // Get the tooltip's top and left coordinates to center it with this directive.\r\n var tipPosition = getCalculatedOffset(placement, elementPosition, tipWidth, tipHeight);\r\n applyPlacementCss(tipPosition.top, tipPosition.left);\r\n };\r\n\r\n $tooltip.$onKeyUp = function(evt) {\r\n if (evt.which === 27 && $tooltip.$isShown) {\r\n $tooltip.hide();\r\n evt.stopPropagation();\r\n }\r\n };\r\n\r\n $tooltip.$onFocusKeyUp = function(evt) {\r\n if (evt.which === 27) {\r\n element[0].blur();\r\n evt.stopPropagation();\r\n }\r\n };\r\n\r\n $tooltip.$onFocusElementMouseDown = function(evt) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n // Some browsers do not auto-focus buttons (eg. Safari)\r\n $tooltip.$isShown ? element[0].blur() : element[0].focus();\r\n };\r\n\r\n // bind/unbind events\r\n function bindTriggerEvents() {\r\n var triggers = options.trigger.split(' ');\r\n angular.forEach(triggers, function(trigger) {\r\n if(trigger === 'click') {\r\n element.on('click', $tooltip.toggle);\r\n } else if(trigger !== 'manual') {\r\n element.on(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\r\n element.on(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\r\n nodeName === 'button' && trigger !== 'hover' && element.on(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\r\n }\r\n });\r\n }\r\n\r\n function unbindTriggerEvents() {\r\n var triggers = options.trigger.split(' ');\r\n for (var i = triggers.length; i--;) {\r\n var trigger = triggers[i];\r\n if(trigger === 'click') {\r\n element.off('click', $tooltip.toggle);\r\n } else if(trigger !== 'manual') {\r\n element.off(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\r\n element.off(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\r\n nodeName === 'button' && trigger !== 'hover' && element.off(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\r\n }\r\n }\r\n }\r\n\r\n function bindKeyboardEvents() {\r\n if(options.trigger !== 'focus') {\r\n tipElement.on('keyup', $tooltip.$onKeyUp);\r\n } else {\r\n element.on('keyup', $tooltip.$onFocusKeyUp);\r\n }\r\n }\r\n\r\n function unbindKeyboardEvents() {\r\n if(options.trigger !== 'focus') {\r\n tipElement.off('keyup', $tooltip.$onKeyUp);\r\n } else {\r\n element.off('keyup', $tooltip.$onFocusKeyUp);\r\n }\r\n }\r\n\r\n var _autoCloseEventsBinded = false;\r\n function bindAutoCloseEvents() {\r\n // use timeout to hookup the events to prevent\r\n // event bubbling from being processed imediately.\r\n $timeout(function() {\r\n // Stop propagation when clicking inside tooltip\r\n tipElement.on('click', stopEventPropagation);\r\n\r\n // Hide when clicking outside tooltip\r\n $body.on('click', $tooltip.hide);\r\n\r\n _autoCloseEventsBinded = true;\r\n }, 0, false);\r\n }\r\n\r\n function unbindAutoCloseEvents() {\r\n if (_autoCloseEventsBinded) {\r\n tipElement.off('click', stopEventPropagation);\r\n $body.off('click', $tooltip.hide);\r\n _autoCloseEventsBinded = false;\r\n }\r\n }\r\n\r\n function stopEventPropagation(event) {\r\n event.stopPropagation();\r\n }\r\n\r\n // Private methods\r\n\r\n function getPosition($element) {\r\n $element = $element || (options.target || element);\r\n\r\n var el = $element[0];\r\n\r\n var elRect = el.getBoundingClientRect();\r\n if (elRect.width === null) {\r\n // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093\r\n elRect = angular.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top });\r\n }\r\n\r\n var elPos;\r\n if (options.container === 'body') {\r\n elPos = dimensions.offset(el);\r\n } else {\r\n elPos = dimensions.position(el);\r\n }\r\n\r\n return angular.extend({}, elRect, elPos);\r\n }\r\n\r\n function getCalculatedOffset(placement, position, actualWidth, actualHeight) {\r\n var offset;\r\n var split = placement.split('-');\r\n\r\n switch (split[0]) {\r\n case 'right':\r\n offset = {\r\n top: position.top + position.height / 2 - actualHeight / 2,\r\n left: position.left + position.width\r\n };\r\n break;\r\n case 'bottom':\r\n offset = {\r\n top: position.top + position.height,\r\n left: position.left + position.width / 2 - actualWidth / 2\r\n };\r\n break;\r\n case 'left':\r\n offset = {\r\n top: position.top + position.height / 2 - actualHeight / 2,\r\n left: position.left - actualWidth\r\n };\r\n break;\r\n default:\r\n offset = {\r\n top: position.top - actualHeight,\r\n left: position.left + position.width / 2 - actualWidth / 2\r\n };\r\n break;\r\n }\r\n\r\n if(!split[1]) {\r\n return offset;\r\n }\r\n\r\n // Add support for corners @todo css\r\n if(split[0] === 'top' || split[0] === 'bottom') {\r\n switch (split[1]) {\r\n case 'left':\r\n offset.left = position.left;\r\n break;\r\n case 'right':\r\n offset.left = position.left + position.width - actualWidth;\r\n }\r\n } else if(split[0] === 'left' || split[0] === 'right') {\r\n switch (split[1]) {\r\n case 'top':\r\n offset.top = position.top - actualHeight;\r\n break;\r\n case 'bottom':\r\n offset.top = position.top + position.height;\r\n }\r\n }\r\n\r\n return offset;\r\n }\r\n\r\n function applyPlacementCss(top, left) {\r\n tipElement.css({ top: top + 'px', left: left + 'px' });\r\n }\r\n\r\n function destroyTipElement() {\r\n // Cancel pending callbacks\r\n clearTimeout(timeout);\r\n\r\n if($tooltip.$isShown && tipElement !== null) {\r\n if(options.autoClose) {\r\n unbindAutoCloseEvents();\r\n }\r\n\r\n if(options.keyboard) {\r\n unbindKeyboardEvents();\r\n }\r\n }\r\n\r\n if(tipScope) {\r\n tipScope.$destroy();\r\n tipScope = null;\r\n }\r\n\r\n if(tipElement) {\r\n tipElement.remove();\r\n tipElement = $tooltip.$element = null;\r\n }\r\n }\r\n\r\n return $tooltip;\r\n\r\n }\r\n\r\n // Helper functions\r\n\r\n function safeDigest(scope) {\r\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\r\n }\r\n\r\n function findElement(query, element) {\r\n return angular.element((element || document).querySelectorAll(query));\r\n }\r\n\r\n var fetchPromises = {};\r\n function fetchTemplate(template) {\r\n if(fetchPromises[template]) return fetchPromises[template];\r\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\r\n .then(function(res) {\r\n if(angular.isObject(res)) {\r\n $templateCache.put(template, res.data);\r\n return res.data;\r\n }\r\n return res;\r\n }));\r\n }\r\n\r\n return TooltipFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsTooltip', function($window, $location, $sce, $tooltip, $$rAF) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'backdropAnimation', 'type', 'customClass'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // overwrite inherited title value when no value specified\r\n // fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11\r\n if (!scope.hasOwnProperty('title')){\r\n scope.title = '';\r\n }\r\n\r\n // Observe scope attributes for change\r\n attr.$observe('title', function(newValue) {\r\n if (angular.isDefined(newValue) || !scope.hasOwnProperty('title')) {\r\n var oldValue = scope.title;\r\n scope.title = $sce.trustAsHtml(newValue);\r\n angular.isDefined(oldValue) && $$rAF(function() {\r\n tooltip && tooltip.$applyPlacement();\r\n });\r\n }\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsTooltip && scope.$watch(attr.bsTooltip, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.title = newValue;\r\n }\r\n angular.isDefined(oldValue) && $$rAF(function() {\r\n tooltip && tooltip.$applyPlacement();\r\n });\r\n }, true);\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!tooltip || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(tooltip),?/i);\r\n newValue === true ? tooltip.show() : tooltip.hide();\r\n });\r\n\r\n // Enabled binding support\r\n attr.bsEnabled && scope.$watch(attr.bsEnabled, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', attr.bsEnabled, newValue, oldValue);\r\n if(!tooltip || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|1|,?(tooltip),?/i);\r\n newValue === false ? tooltip.setEnabled(false) : tooltip.setEnabled(true);\r\n });\r\n\r\n // Initialize popover\r\n var tooltip = $tooltip(element, options);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if(tooltip) tooltip.destroy();\r\n options = null;\r\n tooltip = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.timepicker', [\r\n 'mgcrea.ngStrap.helpers.dateParser',\r\n 'mgcrea.ngStrap.helpers.dateFormatter',\r\n 'mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$timepicker', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'timepicker',\r\n placement: 'bottom-left',\r\n template: 'timepicker/timepicker.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n // lang: $locale.id,\r\n useNative: true,\r\n timeType: 'date',\r\n timeFormat: 'shortTime',\r\n modelTimeFormat: null,\r\n autoclose: false,\r\n minTime: -Infinity,\r\n maxTime: +Infinity,\r\n length: 5,\r\n hourStep: 1,\r\n minuteStep: 5,\r\n iconUp: 'glyphicon glyphicon-chevron-up',\r\n iconDown: 'glyphicon glyphicon-chevron-down',\r\n arrowBehavior: 'pager'\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var isTouch = ('createTouch' in $window.document) && isNative;\r\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\r\n\r\n function timepickerFactory(element, controller, config) {\r\n\r\n var $timepicker = $tooltip(element, angular.extend({}, defaults, config));\r\n var parentScope = config.scope;\r\n var options = $timepicker.$options;\r\n var scope = $timepicker.$scope;\r\n\r\n var lang = options.lang;\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n\r\n // View vars\r\n\r\n var selectedIndex = 0;\r\n var startDate = controller.$dateValue || new Date();\r\n var viewDate = {hour: startDate.getHours(), meridian: startDate.getHours() < 12, minute: startDate.getMinutes(), second: startDate.getSeconds(), millisecond: startDate.getMilliseconds()};\r\n\r\n var format = $dateFormatter.getDatetimeFormat(options.timeFormat, lang);\r\n\r\n var hoursFormat = $dateFormatter.hoursFormat(format),\r\n timeSeparator = $dateFormatter.timeSeparator(format),\r\n minutesFormat = $dateFormatter.minutesFormat(format),\r\n showAM = $dateFormatter.showAM(format);\r\n\r\n scope.$iconUp = options.iconUp;\r\n scope.$iconDown = options.iconDown;\r\n\r\n // Scope methods\r\n\r\n scope.$select = function(date, index) {\r\n $timepicker.select(date, index);\r\n };\r\n scope.$moveIndex = function(value, index) {\r\n $timepicker.$moveIndex(value, index);\r\n };\r\n scope.$switchMeridian = function(date) {\r\n $timepicker.switchMeridian(date);\r\n };\r\n\r\n // Public methods\r\n\r\n $timepicker.update = function(date) {\r\n // console.warn('$timepicker.update() newValue=%o', date);\r\n if(angular.isDate(date) && !isNaN(date.getTime())) {\r\n $timepicker.$date = date;\r\n angular.extend(viewDate, {hour: date.getHours(), minute: date.getMinutes(), second: date.getSeconds(), millisecond: date.getMilliseconds()});\r\n $timepicker.$build();\r\n } else if(!$timepicker.$isBuilt) {\r\n $timepicker.$build();\r\n }\r\n };\r\n\r\n $timepicker.select = function(date, index, keep) {\r\n // console.warn('$timepicker.select', date, scope.$mode);\r\n if(!controller.$dateValue || isNaN(controller.$dateValue.getTime())) controller.$dateValue = new Date(1970, 0, 1);\r\n if(!angular.isDate(date)) date = new Date(date);\r\n if(index === 0) controller.$dateValue.setHours(date.getHours());\r\n else if(index === 1) controller.$dateValue.setMinutes(date.getMinutes());\r\n controller.$setViewValue(angular.copy(controller.$dateValue));\r\n controller.$render();\r\n if(options.autoclose && !keep) {\r\n $timeout(function() { $timepicker.hide(true); });\r\n }\r\n };\r\n\r\n $timepicker.switchMeridian = function(date) {\r\n if (!controller.$dateValue || isNaN(controller.$dateValue.getTime())) {\r\n return;\r\n }\r\n var hours = (date || controller.$dateValue).getHours();\r\n controller.$dateValue.setHours(hours < 12 ? hours + 12 : hours - 12);\r\n controller.$setViewValue(angular.copy(controller.$dateValue));\r\n controller.$render();\r\n };\r\n\r\n // Protected methods\r\n\r\n $timepicker.$build = function() {\r\n // console.warn('$timepicker.$build() viewDate=%o', viewDate);\r\n var i, midIndex = scope.midIndex = parseInt(options.length / 2, 10);\r\n var hours = [], hour;\r\n for(i = 0; i < options.length; i++) {\r\n hour = new Date(1970, 0, 1, viewDate.hour - (midIndex - i) * options.hourStep);\r\n hours.push({date: hour, label: formatDate(hour, hoursFormat), selected: $timepicker.$date && $timepicker.$isSelected(hour, 0), disabled: $timepicker.$isDisabled(hour, 0)});\r\n }\r\n var minutes = [], minute;\r\n for(i = 0; i < options.length; i++) {\r\n minute = new Date(1970, 0, 1, 0, viewDate.minute - (midIndex - i) * options.minuteStep);\r\n minutes.push({date: minute, label: formatDate(minute, minutesFormat), selected: $timepicker.$date && $timepicker.$isSelected(minute, 1), disabled: $timepicker.$isDisabled(minute, 1)});\r\n }\r\n\r\n var rows = [];\r\n for(i = 0; i < options.length; i++) {\r\n rows.push([hours[i], minutes[i]]);\r\n }\r\n scope.rows = rows;\r\n scope.showAM = showAM;\r\n scope.isAM = ($timepicker.$date || hours[midIndex].date).getHours() < 12;\r\n scope.timeSeparator = timeSeparator;\r\n $timepicker.$isBuilt = true;\r\n };\r\n\r\n $timepicker.$isSelected = function(date, index) {\r\n if(!$timepicker.$date) return false;\r\n else if(index === 0) {\r\n return date.getHours() === $timepicker.$date.getHours();\r\n } else if(index === 1) {\r\n return date.getMinutes() === $timepicker.$date.getMinutes();\r\n }\r\n };\r\n\r\n $timepicker.$isDisabled = function(date, index) {\r\n var selectedTime;\r\n if(index === 0) {\r\n selectedTime = date.getTime() + viewDate.minute * 6e4;\r\n } else if(index === 1) {\r\n selectedTime = date.getTime() + viewDate.hour * 36e5;\r\n }\r\n return selectedTime < options.minTime * 1 || selectedTime > options.maxTime * 1;\r\n };\r\n\r\n scope.$arrowAction = function (value, index) {\r\n if (options.arrowBehavior === 'picker') {\r\n $timepicker.$setTimeByStep(value,index);\r\n } else {\r\n $timepicker.$moveIndex(value,index);\r\n }\r\n };\r\n\r\n $timepicker.$setTimeByStep = function(value, index) {\r\n var newDate = new Date($timepicker.$date);\r\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\r\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\r\n if (index === 0) {\r\n newDate.setHours(hours - (parseInt(options.hourStep, 10) * value));\r\n }\r\n else {\r\n newDate.setMinutes(minutes - (parseInt(options.minuteStep, 10) * value));\r\n }\r\n $timepicker.select(newDate, index, true);\r\n };\r\n\r\n $timepicker.$moveIndex = function(value, index) {\r\n var targetDate;\r\n if(index === 0) {\r\n targetDate = new Date(1970, 0, 1, viewDate.hour + (value * options.length), viewDate.minute);\r\n angular.extend(viewDate, {hour: targetDate.getHours()});\r\n } else if(index === 1) {\r\n targetDate = new Date(1970, 0, 1, viewDate.hour, viewDate.minute + (value * options.length * options.minuteStep));\r\n angular.extend(viewDate, {minute: targetDate.getMinutes()});\r\n }\r\n $timepicker.$build();\r\n };\r\n\r\n $timepicker.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown on .dropdown-menu\r\n if(evt.target.nodeName.toLowerCase() !== 'input') evt.preventDefault();\r\n evt.stopPropagation();\r\n // Emulate click for mobile devices\r\n if(isTouch) {\r\n var targetEl = angular.element(evt.target);\r\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\r\n targetEl = targetEl.parent();\r\n }\r\n targetEl.triggerHandler('click');\r\n }\r\n };\r\n\r\n $timepicker.$onKeyDown = function(evt) {\r\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n // Close on enter\r\n if(evt.keyCode === 13) return $timepicker.hide(true);\r\n\r\n // Navigate with keyboard\r\n var newDate = new Date($timepicker.$date);\r\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\r\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\r\n var lateralMove = /(37|39)/.test(evt.keyCode);\r\n var count = 2 + showAM * 1;\r\n\r\n // Navigate indexes (left, right)\r\n if (lateralMove) {\r\n if(evt.keyCode === 37) selectedIndex = selectedIndex < 1 ? count - 1 : selectedIndex - 1;\r\n else if(evt.keyCode === 39) selectedIndex = selectedIndex < count - 1 ? selectedIndex + 1 : 0;\r\n }\r\n\r\n // Update values (up, down)\r\n var selectRange = [0, hoursLength];\r\n if(selectedIndex === 0) {\r\n if(evt.keyCode === 38) newDate.setHours(hours - parseInt(options.hourStep, 10));\r\n else if(evt.keyCode === 40) newDate.setHours(hours + parseInt(options.hourStep, 10));\r\n // re-calculate hours length because we have changed hours value\r\n hoursLength = formatDate(newDate, hoursFormat).length;\r\n selectRange = [0, hoursLength];\r\n } else if(selectedIndex === 1) {\r\n if(evt.keyCode === 38) newDate.setMinutes(minutes - parseInt(options.minuteStep, 10));\r\n else if(evt.keyCode === 40) newDate.setMinutes(minutes + parseInt(options.minuteStep, 10));\r\n // re-calculate minutes length because we have changes minutes value\r\n minutesLength = formatDate(newDate, minutesFormat).length;\r\n selectRange = [hoursLength + 1, hoursLength + 1 + minutesLength];\r\n } else if(selectedIndex === 2) {\r\n if(!lateralMove) $timepicker.switchMeridian();\r\n selectRange = [hoursLength + 1 + minutesLength + 1, hoursLength + 1 + minutesLength + 3];\r\n }\r\n $timepicker.select(newDate, selectedIndex, true);\r\n createSelection(selectRange[0], selectRange[1]);\r\n parentScope.$digest();\r\n };\r\n\r\n // Private\r\n\r\n function createSelection(start, end) {\r\n if(element[0].createTextRange) {\r\n var selRange = element[0].createTextRange();\r\n selRange.collapse(true);\r\n selRange.moveStart('character', start);\r\n selRange.moveEnd('character', end);\r\n selRange.select();\r\n } else if(element[0].setSelectionRange) {\r\n element[0].setSelectionRange(start, end);\r\n } else if(angular.isUndefined(element[0].selectionStart)) {\r\n element[0].selectionStart = start;\r\n element[0].selectionEnd = end;\r\n }\r\n }\r\n\r\n function focusElement() {\r\n element[0].focus();\r\n }\r\n\r\n // Overrides\r\n\r\n var _init = $timepicker.init;\r\n $timepicker.init = function() {\r\n if(isNative && options.useNative) {\r\n element.prop('type', 'time');\r\n element.css('-webkit-appearance', 'textfield');\r\n return;\r\n } else if(isTouch) {\r\n element.prop('type', 'text');\r\n element.attr('readonly', 'true');\r\n element.on('click', focusElement);\r\n }\r\n _init();\r\n };\r\n\r\n var _destroy = $timepicker.destroy;\r\n $timepicker.destroy = function() {\r\n if(isNative && options.useNative) {\r\n element.off('click', focusElement);\r\n }\r\n _destroy();\r\n };\r\n\r\n var _show = $timepicker.show;\r\n $timepicker.show = function() {\r\n _show();\r\n // use timeout to hookup the events to prevent \r\n // event bubbling from being processed imediately. \r\n $timeout(function() {\r\n $timepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $timepicker.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var _hide = $timepicker.hide;\r\n $timepicker.hide = function(blur) {\r\n if(!$timepicker.$isShown) return;\r\n $timepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $timepicker.$onKeyDown);\r\n }\r\n _hide(blur);\r\n };\r\n\r\n return $timepicker;\r\n\r\n }\r\n\r\n timepickerFactory.defaults = defaults;\r\n return timepickerFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n\r\n .directive('bsTimepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $timepicker) {\r\n\r\n var defaults = $timepicker.defaults;\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope, controller: controller};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'timeType', 'timeFormat', 'modelTimeFormat', 'useNative', 'hourStep', 'minuteStep', 'length', 'arrowBehavior', 'iconUp', 'iconDown'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!timepicker || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(timepicker),?/i);\r\n newValue === true ? timepicker.show() : timepicker.hide();\r\n });\r\n\r\n // Initialize timepicker\r\n if(isNative && (options.useNative || defaults.useNative)) options.timeFormat = 'HH:mm';\r\n var timepicker = $timepicker(element, controller, options);\r\n options = timepicker.$options;\r\n\r\n var lang = options.lang;\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n\r\n // Initialize parser\r\n var dateParser = $dateParser({format: options.timeFormat, lang: lang});\r\n\r\n // Observe attributes for changes\r\n angular.forEach(['minTime', 'maxTime'], function(key) {\r\n // console.warn('attr.$observe(%s)', key, attr[key]);\r\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\r\n timepicker.$options[key] = dateParser.getTimeForAttribute(key, newValue);\r\n !isNaN(timepicker.$options[key]) && timepicker.$build();\r\n validateAgainstMinMaxTime(controller.$dateValue);\r\n });\r\n });\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue, controller.$dateValue);\r\n timepicker.update(controller.$dateValue);\r\n }, true);\r\n\r\n function validateAgainstMinMaxTime(parsedTime) {\r\n if (!angular.isDate(parsedTime)) return;\r\n var isMinValid = isNaN(options.minTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) >= options.minTime;\r\n var isMaxValid = isNaN(options.maxTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) <= options.maxTime;\r\n var isValid = isMinValid && isMaxValid;\r\n controller.$setValidity('date', isValid);\r\n controller.$setValidity('min', isMinValid);\r\n controller.$setValidity('max', isMaxValid);\r\n // Only update the model when we have a valid date\r\n if(!isValid) {\r\n return;\r\n }\r\n controller.$dateValue = parsedTime;\r\n }\r\n\r\n // viewValue -> $parsers -> modelValue\r\n controller.$parsers.unshift(function(viewValue) {\r\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\r\n // Null values should correctly reset the model value & validity\r\n if(!viewValue) {\r\n // BREAKING CHANGE:\r\n // return null (not undefined) when input value is empty, so angularjs 1.3 \r\n // ngModelController can go ahead and run validators, like ngRequired\r\n controller.$setValidity('date', true);\r\n return null;\r\n }\r\n var parsedTime = angular.isDate(viewValue) ? viewValue : dateParser.parse(viewValue, controller.$dateValue);\r\n if(!parsedTime || isNaN(parsedTime.getTime())) {\r\n controller.$setValidity('date', false);\r\n // return undefined, causes ngModelController to \r\n // invalidate model value \r\n return;\r\n } else {\r\n validateAgainstMinMaxTime(parsedTime);\r\n }\r\n if(options.timeType === 'string') {\r\n return formatDate(parsedTime, options.modelTimeFormat || options.timeFormat);\r\n } else if(options.timeType === 'number') {\r\n return controller.$dateValue.getTime();\r\n } else if(options.timeType === 'unix') {\r\n return controller.$dateValue.getTime() / 1000;\r\n } else if(options.timeType === 'iso') {\r\n return controller.$dateValue.toISOString();\r\n } else {\r\n return new Date(controller.$dateValue);\r\n }\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n var date;\r\n if(angular.isUndefined(modelValue) || modelValue === null) {\r\n date = NaN;\r\n } else if(angular.isDate(modelValue)) {\r\n date = modelValue;\r\n } else if(options.timeType === 'string') {\r\n date = dateParser.parse(modelValue, null, options.modelTimeFormat);\r\n } else if(options.timeType === 'unix') {\r\n date = new Date(modelValue * 1000);\r\n } else {\r\n date = new Date(modelValue);\r\n }\r\n // Setup default value?\r\n // if(isNaN(date.getTime())) date = new Date(new Date().setMinutes(0) + 36e5);\r\n controller.$dateValue = date;\r\n return getTimeFormattedString();\r\n });\r\n\r\n // viewValue -> element\r\n controller.$render = function() {\r\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\r\n element.val(getTimeFormattedString());\r\n };\r\n\r\n function getTimeFormattedString() {\r\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.timeFormat);\r\n }\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (timepicker) timepicker.destroy();\r\n options = null;\r\n timepicker = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n","'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\r\n\r\n .provider('$typeahead', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'typeahead',\r\n prefixEvent: '$typeahead',\r\n placement: 'bottom-left',\r\n template: 'typeahead/typeahead.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n minLength: 1,\r\n filter: 'filter',\r\n limit: 6,\r\n comparator: ''\r\n };\r\n\r\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n\r\n function TypeaheadFactory(element, controller, config) {\r\n\r\n var $typeahead = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $typeahead = $tooltip(element, options);\r\n var parentScope = config.scope;\r\n var scope = $typeahead.$scope;\r\n\r\n scope.$resetMatches = function(){\r\n scope.$matches = [];\r\n scope.$activeIndex = 0;\r\n };\r\n scope.$resetMatches();\r\n\r\n scope.$activate = function(index) {\r\n scope.$$postDigest(function() {\r\n $typeahead.activate(index);\r\n });\r\n };\r\n\r\n scope.$select = function(index, evt) {\r\n scope.$$postDigest(function() {\r\n $typeahead.select(index);\r\n });\r\n };\r\n\r\n scope.$isVisible = function() {\r\n return $typeahead.$isVisible();\r\n };\r\n\r\n // Public methods\r\n\r\n $typeahead.update = function(matches) {\r\n scope.$matches = matches;\r\n if(scope.$activeIndex >= matches.length) {\r\n scope.$activeIndex = 0;\r\n }\r\n };\r\n\r\n $typeahead.activate = function(index) {\r\n scope.$activeIndex = index;\r\n };\r\n\r\n $typeahead.select = function(index) {\r\n var value = scope.$matches[index].value;\r\n // console.log('$setViewValue', value);\r\n controller.$setViewValue(value);\r\n controller.$render();\r\n scope.$resetMatches();\r\n if(parentScope) parentScope.$digest();\r\n // Emit event\r\n scope.$emit(options.prefixEvent + '.select', value, index);\r\n };\r\n\r\n // Protected methods\r\n\r\n $typeahead.$isVisible = function() {\r\n if(!options.minLength || !controller) {\r\n return !!scope.$matches.length;\r\n }\r\n // minLength support\r\n return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;\r\n };\r\n\r\n $typeahead.$getIndex = function(value) {\r\n var l = scope.$matches.length, i = l;\r\n if(!l) return;\r\n for(i = l; i--;) {\r\n if(scope.$matches[i].value === value) break;\r\n }\r\n if(i < 0) return;\r\n return i;\r\n };\r\n\r\n $typeahead.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n };\r\n\r\n $typeahead.$onKeyDown = function(evt) {\r\n if(!/(38|40|13)/.test(evt.keyCode)) return;\r\n\r\n // Let ngSubmit pass if the typeahead tip is hidden\r\n if($typeahead.$isVisible()) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n }\r\n\r\n // Select with enter\r\n if(evt.keyCode === 13 && scope.$matches.length) {\r\n $typeahead.select(scope.$activeIndex);\r\n }\r\n\r\n // Navigate with keyboard\r\n else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\r\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\r\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\r\n scope.$digest();\r\n };\r\n\r\n // Overrides\r\n\r\n var show = $typeahead.show;\r\n $typeahead.show = function() {\r\n show();\r\n // use timeout to hookup the events to prevent\r\n // event bubbling from being processed imediately.\r\n $timeout(function() {\r\n $typeahead.$element.on('mousedown', $typeahead.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $typeahead.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var hide = $typeahead.hide;\r\n $typeahead.hide = function() {\r\n $typeahead.$element.off('mousedown', $typeahead.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $typeahead.$onKeyDown);\r\n }\r\n hide();\r\n };\r\n\r\n return $typeahead;\r\n\r\n }\r\n\r\n TypeaheadFactory.defaults = defaults;\r\n return TypeaheadFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsTypeahead', function($window, $parse, $q, $typeahead, $parseOptions) {\r\n\r\n var defaults = $typeahead.defaults;\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Build proper ngOptions\r\n var filter = options.filter || defaults.filter;\r\n var limit = options.limit || defaults.limit;\r\n var comparator = options.comparator || defaults.comparator;\r\n\r\n var ngOptions = attr.ngOptions;\r\n if(filter) ngOptions += ' | ' + filter + ':$viewValue';\r\n if (comparator) ngOptions += ':' + comparator;\r\n if(limit) ngOptions += ' | limitTo:' + limit;\r\n var parsedOptions = $parseOptions(ngOptions);\r\n\r\n // Initialize typeahead\r\n var typeahead = $typeahead(element, controller, options);\r\n\r\n // Watch options on demand\r\n if(options.watchOptions) {\r\n // Watch ngOptions values before filtering for changes, drop function calls\r\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').replace(/\\(.*\\)/g, '').trim();\r\n scope.$watch(watchedOptions, function (newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\r\n parsedOptions.valuesFn(scope, controller).then(function (values) {\r\n typeahead.update(values);\r\n controller.$render();\r\n });\r\n }, true);\r\n }\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n // console.warn('$watch', element.attr('ng-model'), newValue);\r\n scope.$modelValue = newValue; // Publish modelValue on scope for custom templates\r\n parsedOptions.valuesFn(scope, controller)\r\n .then(function(values) {\r\n // Prevent input with no future prospect if selectMode is truthy\r\n // @TODO test selectMode\r\n if(options.selectMode && !values.length && newValue.length > 0) {\r\n controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));\r\n return;\r\n }\r\n if(values.length > limit) values = values.slice(0, limit);\r\n var isVisible = typeahead.$isVisible();\r\n isVisible && typeahead.update(values);\r\n // Do not re-queue an update if a correct value has been selected\r\n if(values.length === 1 && values[0].value === newValue) return;\r\n !isVisible && typeahead.update(values);\r\n // Queue a new rendering that will leverage collection loading\r\n controller.$render();\r\n });\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n var displayValue = parsedOptions.displayValue(modelValue);\r\n return displayValue === undefined ? '' : displayValue;\r\n });\r\n\r\n // Model rendering in view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n if(controller.$isEmpty(controller.$viewValue)) return element.val('');\r\n var index = typeahead.$getIndex(controller.$modelValue);\r\n var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;\r\n selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;\r\n element.val(selected ? selected.toString().replace(/<(?:.|\\n)*?>/gm, '').trim() : '');\r\n };\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (typeahead) typeahead.destroy();\r\n options = null;\r\n typeahead = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/angular-strap.tpl.js b/dist/angular-strap.tpl.js
index f1458b4f3..64194c02a 100644
--- a/dist/angular-strap.tpl.js
+++ b/dist/angular-strap.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -15,13 +15,6 @@ angular.module('mgcrea.ngStrap.alert').run(['$templateCache', function($template
}]);
-// Source: aside.tpl.js
-angular.module('mgcrea.ngStrap.aside').run(['$templateCache', function($templateCache) {
-
- $templateCache.put('aside/aside.tpl.html', '');
-
-}]);
-
// Source: datepicker.tpl.js
angular.module('mgcrea.ngStrap.datepicker').run(['$templateCache', function($templateCache) {
@@ -36,6 +29,13 @@ angular.module('mgcrea.ngStrap.dropdown').run(['$templateCache', function($templ
}]);
+// Source: aside.tpl.js
+angular.module('mgcrea.ngStrap.aside').run(['$templateCache', function($templateCache) {
+
+ $templateCache.put('aside/aside.tpl.html', '');
+
+}]);
+
// Source: modal.tpl.js
angular.module('mgcrea.ngStrap.modal').run(['$templateCache', function($templateCache) {
@@ -43,10 +43,10 @@ angular.module('mgcrea.ngStrap.modal').run(['$templateCache', function($template
}]);
-// Source: popover.tpl.js
-angular.module('mgcrea.ngStrap.popover').run(['$templateCache', function($templateCache) {
+// Source: progressbar.tpl.js
+angular.module('mgcrea.ngStrap.progressbar').run(['$templateCache', function($templateCache) {
- $templateCache.put('popover/popover.tpl.html', '');
+ $templateCache.put('progressbar/progressbar.tpl.html', '');
}]);
@@ -64,17 +64,17 @@ angular.module('mgcrea.ngStrap.tab').run(['$templateCache', function($templateCa
}]);
-// Source: tooltip.tpl.js
-angular.module('mgcrea.ngStrap.tooltip').run(['$templateCache', function($templateCache) {
+// Source: popover.tpl.js
+angular.module('mgcrea.ngStrap.popover').run(['$templateCache', function($templateCache) {
- $templateCache.put('tooltip/tooltip.tpl.html', '');
+ $templateCache.put('popover/popover.tpl.html', '');
}]);
-// Source: typeahead.tpl.js
-angular.module('mgcrea.ngStrap.typeahead').run(['$templateCache', function($templateCache) {
+// Source: tooltip.tpl.js
+angular.module('mgcrea.ngStrap.tooltip').run(['$templateCache', function($templateCache) {
- $templateCache.put('typeahead/typeahead.tpl.html', '');
+ $templateCache.put('tooltip/tooltip.tpl.html', '');
}]);
@@ -85,5 +85,12 @@ angular.module('mgcrea.ngStrap.timepicker').run(['$templateCache', function($tem
}]);
+// Source: typeahead.tpl.js
+angular.module('mgcrea.ngStrap.typeahead').run(['$templateCache', function($templateCache) {
+
+ $templateCache.put('typeahead/typeahead.tpl.html', '');
+
+}]);
+
})(window, document);
diff --git a/dist/angular-strap.tpl.min.js b/dist/angular-strap.tpl.min.js
index 99c9e15ce..3f383c0f7 100644
--- a/dist/angular-strap.tpl.min.js
+++ b/dist/angular-strap.tpl.min.js
@@ -1,8 +1,8 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
-!function(){"use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function(t){t.put("alert/alert.tpl.html",'×
')}]),angular.module("mgcrea.ngStrap.aside").run(["$templateCache",function(t){t.put("aside/aside.tpl.html",'')}]),angular.module("mgcrea.ngStrap.datepicker").run(["$templateCache",function(t){t.put("datepicker/datepicker.tpl.html",'')}]),angular.module("mgcrea.ngStrap.dropdown").run(["$templateCache",function(t){t.put("dropdown/dropdown.tpl.html",'')}]),angular.module("mgcrea.ngStrap.modal").run(["$templateCache",function(t){t.put("modal/modal.tpl.html",'')}]),angular.module("mgcrea.ngStrap.popover").run(["$templateCache",function(t){t.put("popover/popover.tpl.html",'')}]),angular.module("mgcrea.ngStrap.select").run(["$templateCache",function(t){t.put("select/select.tpl.html",'')}]),angular.module("mgcrea.ngStrap.tab").run(["$templateCache",function(t){t.put("tab/tab.tpl.html",'
')}]),angular.module("mgcrea.ngStrap.tooltip").run(["$templateCache",function(t){t.put("tooltip/tooltip.tpl.html",'')}]),angular.module("mgcrea.ngStrap.typeahead").run(["$templateCache",function(t){t.put("typeahead/typeahead.tpl.html",'')}]),angular.module("mgcrea.ngStrap.timepicker").run(["$templateCache",function(t){t.put("timepicker/timepicker.tpl.html",'')}])}(window,document);
\ No newline at end of file
+!function(){"use strict";angular.module("mgcrea.ngStrap.alert").run(["$templateCache",function(t){t.put("alert/alert.tpl.html",'×
')}]),angular.module("mgcrea.ngStrap.datepicker").run(["$templateCache",function(t){t.put("datepicker/datepicker.tpl.html",'')}]),angular.module("mgcrea.ngStrap.dropdown").run(["$templateCache",function(t){t.put("dropdown/dropdown.tpl.html",'')}]),angular.module("mgcrea.ngStrap.aside").run(["$templateCache",function(t){t.put("aside/aside.tpl.html",'')}]),angular.module("mgcrea.ngStrap.modal").run(["$templateCache",function(t){t.put("modal/modal.tpl.html",'')}]),angular.module("mgcrea.ngStrap.progressbar").run(["$templateCache",function(t){t.put("progressbar/progressbar.tpl.html",'')}]),angular.module("mgcrea.ngStrap.select").run(["$templateCache",function(t){t.put("select/select.tpl.html",'')}]),angular.module("mgcrea.ngStrap.tab").run(["$templateCache",function(t){t.put("tab/tab.tpl.html",'
')}]),angular.module("mgcrea.ngStrap.popover").run(["$templateCache",function(t){t.put("popover/popover.tpl.html",'')}]),angular.module("mgcrea.ngStrap.tooltip").run(["$templateCache",function(t){t.put("tooltip/tooltip.tpl.html",'')}]),angular.module("mgcrea.ngStrap.timepicker").run(["$templateCache",function(t){t.put("timepicker/timepicker.tpl.html",'')}]),angular.module("mgcrea.ngStrap.typeahead").run(["$templateCache",function(t){t.put("typeahead/typeahead.tpl.html",'')}])}(window,document);
\ No newline at end of file
diff --git a/dist/modules/affix.js b/dist/modules/affix.js
index 217c6f5bc..fd263bb07 100644
--- a/dist/modules/affix.js
+++ b/dist/modules/affix.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/affix.min.js b/dist/modules/affix.min.js
index fe5198560..3eb4a72f2 100644
--- a/dist/modules/affix.min.js
+++ b/dist/modules/affix.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/affix.min.js.map b/dist/modules/affix.min.js.map
index 8030e6919..360fe464c 100644
--- a/dist/modules/affix.min.js.map
+++ b/dist/modules/affix.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["affix/affix.js"],"names":[],"mappings":"4JAaM,GAAI,KAAW,iCAIb,MAAI,UAAS,WAAA,aAAA,SAAA,EAAA,EAAA,2BAqKJ,GAAsB,EAAA,EAAY,SAE/B,IACR,EAAO,UAEA,IAAP,+DAKK,+BAQT,MAAO,GAAA,KAAA,EAAA,EAAA,YAAA,EAAA,GAAA,sFAhLP,GAAI,MAGA,EAAA,QAAA,UAAmB,EAAA,GACnB,EAAA,EAAY,OAGZ,EAAQ,oCAER,EAAiB,MAEjB,EAAQ,EACV,EAAY,EACV,EAAS,OACP,qBAIF,EAAA,oGAOF,GAAA,QAAmB,QAAA,EAAW,uBAI9B,KAAY,WAEZ,KAAA,2DAKA,EAAK,GAAA,SAAA,KAAA,yHAOL,KAAA,sNAiBA,WAAI,EAAY,cAAA,yCAQb,EAAY,EAAO,OAAA,EAAA,IACtB,EAAU,EAAA,OAAA,EAAA,IAGV,EAAQ,EAAmB,EAAS,EAAY,EAG9C,KAAQ,MACA,6DAKA,WACR,EAAI,OACF,IAAU,WAAQ,EAAc,aAAA,GAAA,iBAE7B,IAAA,QAAA,qBAGK,WAAR,GAEF,kBAAa,EAAV,EAAU,aAKR,EAAA,IAAA,EAEF,GACD,EAAQ,IAAI,QAAS,IAEvB,EAAQ,IAAI,WAAY,EAAA,aAAA,GAAA,YACxB,EAAQ,IAAI,MAAO,EAAkB,aAAA,GAAA,EAAA,GAAA,aAAA,EAAA,EAAA,EAAA,uDAMvC,EAAO,IAAA,WAAA,SACP,EAAO,IAAA,MAAA,EAAA,WAKH,UAAA,6BAEJ,EAAA,mBAEG,mBAAmB,EAAA,EAAA,UAAA,MAElB,cAAQ,qCAGR,IAAA,WAAoB,EAAoB,aAAA,GAAA,cAEtC,qCAEG,UAAA,uDAKL,EADG,EAAA,aACS,EAAQ,OAAY,EAAA,IAAA,IAAA,EAAA,EAAA,uEAOhC,EAAe,EAAf,EAAe,6JAenB,EAAI,IAAA,WAAY,sDA7JlB,EAAI,QAAU,QAAe,0BAsMzB,WAAW,SAAO,UAAO,SAAW,EAAQ,wDAK5C,SAAe,EAAS,EAAA,EAAA,MAE1B,IAAS,MAAM,EAAA,UAAA,OAAA,OAAA,EAAA,EAAA,SAAA,QAAA,QAAA,YACf,SAAU,YAAA,eAAA,eAAA,eAAA,SAAA,GACV,QAAQ,UAAA,EAAA,MAAA,EAAA,GAAA,EAAA","file":"affix.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.affix', ['mgcrea.ngStrap.helpers.dimensions', 'mgcrea.ngStrap.helpers.debounce'])\n\n .provider('$affix', function() {\n\n var defaults = this.defaults = {\n offsetTop: 'auto'\n };\n\n this.$get = function($window, debounce, dimensions) {\n\n var bodyEl = angular.element($window.document.body);\n var windowEl = angular.element($window);\n\n function AffixFactory(element, config) {\n\n var $affix = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n var targetEl = options.target;\n\n // Initial private vars\n var reset = 'affix affix-top affix-bottom',\n setWidth = false,\n initialAffixTop = 0,\n initialOffsetTop = 0,\n offsetTop = 0,\n offsetBottom = 0,\n affixed = null,\n unpin = null;\n\n var parent = element.parent();\n // Options: custom parent\n if (options.offsetParent) {\n if (options.offsetParent.match(/^\\d+$/)) {\n for (var i = 0; i < (options.offsetParent * 1) - 1; i++) {\n parent = parent.parent();\n }\n }\n else {\n parent = angular.element(options.offsetParent);\n }\n }\n\n $affix.init = function() {\n\n this.$parseOffsets();\n initialOffsetTop = dimensions.offset(element[0]).top + initialAffixTop;\n setWidth = !element[0].style.width;\n\n // Bind events\n targetEl.on('scroll', this.checkPosition);\n targetEl.on('click', this.checkPositionWithEventLoop);\n windowEl.on('resize', this.$debouncedOnResize);\n\n // Both of these checkPosition() calls are necessary for the case where\n // the user hits refresh after scrolling to the bottom of the page.\n this.checkPosition();\n this.checkPositionWithEventLoop();\n\n };\n\n $affix.destroy = function() {\n\n // Unbind events\n targetEl.off('scroll', this.checkPosition);\n targetEl.off('click', this.checkPositionWithEventLoop);\n windowEl.off('resize', this.$debouncedOnResize);\n\n };\n\n $affix.checkPositionWithEventLoop = function() {\n\n // IE 9 throws an error if we use 'this' instead of '$affix'\n // in this setTimeout call\n setTimeout($affix.checkPosition, 1);\n\n };\n\n $affix.checkPosition = function() {\n // if (!this.$element.is(':visible')) return\n\n var scrollTop = getScrollTop();\n var position = dimensions.offset(element[0]);\n var elementHeight = dimensions.height(element[0]);\n\n // Get required affix class according to position\n var affix = getRequiredAffixClass(unpin, position, elementHeight);\n\n // Did affix status changed this last check?\n if(affixed === affix) return;\n affixed = affix;\n\n // Add proper affix class\n element.removeClass(reset).addClass('affix' + ((affix !== 'middle') ? '-' + affix : ''));\n\n if(affix === 'top') {\n unpin = null;\n element.css('position', (options.offsetParent) ? '' : 'relative');\n if(setWidth) {\n element.css('width', '');\n }\n element.css('top', '');\n } else if(affix === 'bottom') {\n if (options.offsetUnpin) {\n unpin = -(options.offsetUnpin * 1);\n }\n else {\n // Calculate unpin threshold when affixed to bottom.\n // Hopefully the browser scrolls pixel by pixel.\n unpin = position.top - scrollTop;\n }\n if(setWidth) {\n element.css('width', '');\n }\n element.css('position', (options.offsetParent) ? '' : 'relative');\n element.css('top', (options.offsetParent) ? '' : ((bodyEl[0].offsetHeight - offsetBottom - elementHeight - initialOffsetTop) + 'px'));\n } else { // affix === 'middle'\n unpin = null;\n if(setWidth) {\n element.css('width', element[0].offsetWidth + 'px');\n }\n element.css('position', 'fixed');\n element.css('top', initialAffixTop + 'px');\n }\n\n };\n\n $affix.$onResize = function() {\n $affix.$parseOffsets();\n $affix.checkPosition();\n };\n $affix.$debouncedOnResize = debounce($affix.$onResize, 50);\n\n $affix.$parseOffsets = function() {\n var initialPosition = element.css('position');\n // Reset position to calculate correct offsetTop\n element.css('position', (options.offsetParent) ? '' : 'relative');\n\n if(options.offsetTop) {\n if(options.offsetTop === 'auto') {\n options.offsetTop = '+0';\n }\n if(options.offsetTop.match(/^[-+]\\d+$/)) {\n initialAffixTop = - options.offsetTop * 1;\n if(options.offsetParent) {\n offsetTop = dimensions.offset(parent[0]).top + (options.offsetTop * 1);\n }\n else {\n offsetTop = dimensions.offset(element[0]).top - dimensions.css(element[0], 'marginTop', true) + (options.offsetTop * 1);\n }\n }\n else {\n offsetTop = options.offsetTop * 1;\n }\n }\n\n if(options.offsetBottom) {\n if(options.offsetParent && options.offsetBottom.match(/^[-+]\\d+$/)) {\n // add 1 pixel due to rounding problems...\n offsetBottom = getScrollHeight() - (dimensions.offset(parent[0]).top + dimensions.height(parent[0])) + (options.offsetBottom * 1) + 1;\n }\n else {\n offsetBottom = options.offsetBottom * 1;\n }\n }\n\n // Bring back the element's position after calculations\n element.css('position', initialPosition);\n };\n\n // Private methods\n\n function getRequiredAffixClass(unpin, position, elementHeight) {\n\n var scrollTop = getScrollTop();\n var scrollHeight = getScrollHeight();\n\n if(scrollTop <= offsetTop) {\n return 'top';\n } else if(unpin !== null && (scrollTop + unpin <= position.top)) {\n return 'middle';\n } else if(offsetBottom !== null && (position.top + elementHeight + initialAffixTop >= scrollHeight - offsetBottom)) {\n return 'bottom';\n } else {\n return 'middle';\n }\n\n }\n\n function getScrollTop() {\n return targetEl[0] === $window ? $window.pageYOffset : targetEl[0].scrollTop;\n }\n\n function getScrollHeight() {\n return targetEl[0] === $window ? $window.document.body.scrollHeight : targetEl[0].scrollHeight;\n }\n\n $affix.init();\n return $affix;\n\n }\n\n return AffixFactory;\n\n };\n\n })\n\n .directive('bsAffix', function($affix, $window) {\n\n return {\n restrict: 'EAC',\n require: '^?bsAffixTarget',\n link: function postLink(scope, element, attr, affixTarget) {\n\n var options = {scope: scope, offsetTop: 'auto', target: affixTarget ? affixTarget.$element : angular.element($window)};\n angular.forEach(['offsetTop', 'offsetBottom', 'offsetParent', 'offsetUnpin'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n var affix = $affix(element, options);\n scope.$on('$destroy', function() {\n affix && affix.destroy();\n options = null;\n affix = null;\n });\n\n }\n };\n\n })\n\n .directive('bsAffixTarget', function() {\n return {\n controller: function($element) {\n this.$element = $element;\n }\n };\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["affix/affix.js"],"names":[],"mappings":"4JAaM,GAAI,KAAW,iCAIb,MAAI,UAAS,WAAA,aAAA,SAAA,EAAA,EAAA,2BAqKJ,GAAsB,EAAA,EAAY,SAE/B,IACR,EAAO,UAEA,IAAP,+DAKK,+BAQT,MAAO,GAAA,KAAA,EAAA,EAAA,YAAA,EAAA,GAAA,sFAhLP,GAAI,MAGA,EAAA,QAAA,UAAmB,EAAA,GACnB,EAAA,EAAY,OAGZ,EAAQ,oCAER,EAAiB,MAEjB,EAAQ,EACV,EAAY,EACV,EAAS,OACP,qB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n\r\n .provider('$affix', function() {\r\n\r\n var defaults = this.defaults = {\r\n offsetTop: 'auto'\r\n };\r\n\r\n this.$get = function($window, debounce, dimensions) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var windowEl = angular.element($window);\r\n\r\n function AffixFactory(element, config) {\r\n\r\n var $affix = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n var targetEl = options.target;\r\n\r\n // Initial private vars\r\n var reset = 'affix affix-top affix-bottom',\r\n setWidth = false,\r\n initialAffixTop = 0,\r\n initialOffsetTop = 0,\r\n offsetTop = 0,\r\n offsetBottom = 0,\r\n affixed = null,\r\n unpin = null;\r\n\r\n var parent = element.parent();\r\n // Options: custom parent\r\n if (options.offsetParent) {\r\n if (options.offsetParent.match(/^\\d+$/)) {\r\n for (var i = 0; i < (options.offsetParent * 1) - 1; i++) {\r\n parent = parent.parent();\r\n }\r\n }\r\n else {\r\n parent = angular.element(options.offsetParent);\r\n }\r\n }\r\n\r\n $affix.init = function() {\r\n\r\n this.$parseOffsets();\r\n initialOffsetTop = dimensions.offset(element[0]).top + initialAffixTop;\r\n setWidth = !element[0].style.width;\r\n\r\n // Bind events\r\n targetEl.on('scroll', this.checkPosition);\r\n targetEl.on('click', this.checkPositionWithEventLoop);\r\n windowEl.on('resize', this.$debouncedOnResize);\r\n\r\n // Both of these checkPosition() calls are necessary for the case where\r\n // the user hits refresh after scrolling to the bottom of the page.\r\n this.checkPosition();\r\n this.checkPositionWithEventLoop();\r\n\r\n };\r\n\r\n $affix.destroy = function() {\r\n\r\n // Unbind events\r\n targetEl.off('scroll', this.checkPosition);\r\n targetEl.off('click', this.checkPositionWithEventLoop);\r\n windowEl.off('resize', this.$debouncedOnResize);\r\n\r\n };\r\n\r\n $affix.checkPositionWithEventLoop = function() {\r\n\r\n // IE 9 throws an error if we use 'this' instead of '$affix'\r\n // in this setTimeout call\r\n setTimeout($affix.checkPosition, 1);\r\n\r\n };\r\n\r\n $affix.checkPosition = function() {\r\n // if (!this.$element.is(':visible')) return\r\n\r\n var scrollTop = getScrollTop();\r\n var position = dimensions.offset(element[0]);\r\n var elementHeight = dimensions.height(element[0]);\r\n\r\n // Get required affix class according to position\r\n var affix = getRequiredAffixClass(unpin, position, elementHeight);\r\n\r\n // Did affix status changed this last check?\r\n if(affixed === affix) return;\r\n affixed = affix;\r\n\r\n // Add proper affix class\r\n element.removeClass(reset).addClass('affix' + ((affix !== 'middle') ? '-' + affix : ''));\r\n\r\n if(affix === 'top') {\r\n unpin = null;\r\n element.css('position', (options.offsetParent) ? '' : 'relative');\r\n if(setWidth) {\r\n element.css('width', '');\r\n }\r\n element.css('top', '');\r\n } else if(affix === 'bottom') {\r\n if (options.offsetUnpin) {\r\n unpin = -(options.offsetUnpin * 1);\r\n }\r\n else {\r\n // Calculate unpin threshold when affixed to bottom.\r\n // Hopefully the browser scrolls pixel by pixel.\r\n unpin = position.top - scrollTop;\r\n }\r\n if(setWidth) {\r\n element.css('width', '');\r\n }\r\n element.css('position', (options.offsetParent) ? '' : 'relative');\r\n element.css('top', (options.offsetParent) ? '' : ((bodyEl[0].offsetHeight - offsetBottom - elementHeight - initialOffsetTop) + 'px'));\r\n } else { // affix === 'middle'\r\n unpin = null;\r\n if(setWidth) {\r\n element.css('width', element[0].offsetWidth + 'px');\r\n }\r\n element.css('position', 'fixed');\r\n element.css('top', initialAffixTop + 'px');\r\n }\r\n\r\n };\r\n\r\n $affix.$onResize = function() {\r\n $affix.$parseOffsets();\r\n $affix.checkPosition();\r\n };\r\n $affix.$debouncedOnResize = debounce($affix.$onResize, 50);\r\n\r\n $affix.$parseOffsets = function() {\r\n var initialPosition = element.css('position');\r\n // Reset position to calculate correct offsetTop\r\n element.css('position', (options.offsetParent) ? '' : 'relative');\r\n\r\n if(options.offsetTop) {\r\n if(options.offsetTop === 'auto') {\r\n options.offsetTop = '+0';\r\n }\r\n if(options.offsetTop.match(/^[-+]\\d+$/)) {\r\n initialAffixTop = - options.offsetTop * 1;\r\n if(options.offsetParent) {\r\n offsetTop = dimensions.offset(parent[0]).top + (options.offsetTop * 1);\r\n }\r\n else {\r\n offsetTop = dimensions.offset(element[0]).top - dimensions.css(element[0], 'marginTop', true) + (options.offsetTop * 1);\r\n }\r\n }\r\n else {\r\n offsetTop = options.offsetTop * 1;\r\n }\r\n }\r\n\r\n if(options.offsetBottom) {\r\n if(options.offsetParent && options.offsetBottom.match(/^[-+]\\d+$/)) {\r\n // add 1 pixel due to rounding problems...\r\n offsetBottom = getScrollHeight() - (dimensions.offset(parent[0]).top + dimensions.height(parent[0])) + (options.offsetBottom * 1) + 1;\r\n }\r\n else {\r\n offsetBottom = options.offsetBottom * 1;\r\n }\r\n }\r\n\r\n // Bring back the element's position after calculations\r\n element.css('position', initialPosition);\r\n };\r\n\r\n // Private methods\r\n\r\n function getRequiredAffixClass(unpin, position, elementHeight) {\r\n\r\n var scrollTop = getScrollTop();\r\n var scrollHeight = getScrollHeight();\r\n\r\n if(scrollTop <= offsetTop) {\r\n return 'top';\r\n } else if(unpin !== null && (scrollTop + unpin <= position.top)) {\r\n return 'middle';\r\n } else if(offsetBottom !== null && (position.top + elementHeight + initialAffixTop >= scrollHeight - offsetBottom)) {\r\n return 'bottom';\r\n } else {\r\n return 'middle';\r\n }\r\n\r\n }\r\n\r\n function getScrollTop() {\r\n return targetEl[0] === $window ? $window.pageYOffset : targetEl[0].scrollTop;\r\n }\r\n\r\n function getScrollHeight() {\r\n return targetEl[0] === $window ? $window.document.body.scrollHeight : targetEl[0].scrollHeight;\r\n }\r\n\r\n $affix.init();\r\n return $affix;\r\n\r\n }\r\n\r\n return AffixFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsAffix', function($affix, $window) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: '^?bsAffixTarget',\r\n link: function postLink(scope, element, attr, affixTarget) {\r\n\r\n var options = {scope: scope, offsetTop: 'auto', target: affixTarget ? affixTarget.$element : angular.element($window)};\r\n angular.forEach(['offsetTop', 'offsetBottom', 'offsetParent', 'offsetUnpin'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n var affix = $affix(element, options);\r\n scope.$on('$destroy', function() {\r\n affix && affix.destroy();\r\n options = null;\r\n affix = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsAffixTarget', function() {\r\n return {\r\n controller: function($element) {\r\n this.$element = $element;\r\n }\r\n };\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/alert.js b/dist/modules/alert.js
index bc3f85c60..ee8405b08 100644
--- a/dist/modules/alert.js
+++ b/dist/modules/alert.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/alert.min.js b/dist/modules/alert.min.js
index 88f74c1be..a97d81436 100644
--- a/dist/modules/alert.min.js
+++ b/dist/modules/alert.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/alert.min.js.map b/dist/modules/alert.min.js.map
index 1cb98d381..e1c4956a1 100644
--- a/dist/modules/alert.min.js.map
+++ b/dist/modules/alert.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["alert/alert.js"],"names":[],"mappings":"qBAaM,OAAA,wBAAa,kCAEb,SAAU,cAEV,GAAS,KAAA,UACT,UAAU,UACV,YAAU,QACV,YAAM,uBAEN,SAAU,uBACV,WAAM,EACN,QAAA,6BAGF,MAAK,EAEH,UAAS,uBAEH,QAGJ,MAAI,SAAU,WAAe,SAAI,EAAU,WAE3C,GAAgB,YAKd,EAAO,QAAO,UAAe,EAAA,UAK/B,EAAG,OAAQ,cAAU,EAAA,YACnB,EAAO,SACL,OAAA,KAAA,EAAA,yDAOJ,sEAiBI,WAAS,UAAS,OAAO,SAAe,SAAA,EAAc,EAAA,yDAKrD,uCAKH,IAAa,MAAK,EAAS,QAAK,EAAS,MAAU,WACjD,SAAa,WAAK,YAAY,WAAA,OAAA,YAAA,YAAA,WAAA,eAAA,SAAA,0CAKlC,QAAK,SAAW,QAAM,UAAY,QAAS,SAAS,GAClD,EAAG,IAAQ,EAAA,SAAS,EAAW,SAAA,GAC7B,EAAA,GAAQ,EAAO,YAAO,qEAOtB,QAAQ,OAAO,EAAA,uBAOjB,GAAI,EAAa,gFAQtB,EAAA","file":"alert.min.js","sourcesContent":["'use strict';\n\n// @BUG: following snippet won't compile correctly\n// @TODO: submit issue to core\n// ' ' +\n\nangular.module('mgcrea.ngStrap.alert', ['mgcrea.ngStrap.modal'])\n\n .provider('$alert', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'alert',\n prefixEvent: 'alert',\n placement: null,\n template: 'alert/alert.tpl.html',\n container: false,\n element: null,\n backdrop: false,\n keyboard: true,\n show: true,\n // Specific options\n duration: false,\n type: false,\n dismissable: true\n };\n\n this.$get = function($modal, $timeout) {\n\n function AlertFactory(config) {\n\n var $alert = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $alert = $modal(options);\n\n // Support scope as string options [/*title, content, */ type, dismissable]\n $alert.$scope.dismissable = !!options.dismissable;\n if(options.type) {\n $alert.$scope.type = options.type;\n }\n\n // Support auto-close duration\n var show = $alert.show;\n if(options.duration) {\n $alert.show = function() {\n show();\n $timeout(function() {\n $alert.hide();\n }, options.duration * 1000);\n };\n }\n\n return $alert;\n\n }\n\n return AlertFactory;\n\n };\n\n })\n\n .directive('bsAlert', function($window, $sce, $alert) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content', 'type'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsAlert && scope.$watch(attr.bsAlert, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize alert\n var alert = $alert(options);\n\n // Trigger\n element.on(attr.trigger || 'click', alert.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (alert) alert.destroy();\n options = null;\n alert = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["alert/alert.js"],"names":[],"mappings":"qBAaM,OAAA,wBAAa,kCAEb,SAAU,cAEV,GAAS,KAAA,UACT,UAAU,UACV,YAAU,QACV,YAAM,uBAEN,SAAU,uBACV,WAAM,EACN,QAAA,6BAGF,MAAK,EAEH,UAAS,uBAEH,QAGJ,MAAI,SAAU,WAAe,SAAI,EAAU,WAE3C,GAAgB,YAKd,EAAO,QAAO,UAAe,EAAA,UAK/B,EAAG,OAAQ,cAAU,EAAA,YACnB,EAAO,SACL,OAAA,KAAA,EAAA,yDAOJ,sEAiBI,WAAS,UAAS,OAAO,SAAe,SAAA,EAAc,EAAA,yDAKrD,uCAKH,IAAa,MAAK,EAAS,QAAK,EAAS,MAAU,WACjD,SAAa,WAAK,YAAY,WAAA,OAAA,YAAA,YAAA,WAAA,eAAA,SAAA,0CAKlC,QAAK,SAAW,QAAM,UAAY,QAAS,SAAS,GAClD,EAAG,IAAQ,EAAA,SAAS,EAAW,SAAA,GAC7B,EAAA,GAAQ,EAAO,YAAO,qEAOtB,QAAQ,OAAO,EAAA,uBAOjB,GAAI,EAAa,gFAQtB,EAAA","file":"alert.min.js","sourcesContent":["'use strict';\r\n\r\n// @BUG: following snippet won't compile correctly\r\n// @TODO: submit issue to core\r\n// ' ' +\r\n\r\nangular.module('mgcrea.ngStrap.alert', ['mgcrea.ngStrap.modal'])\r\n\r\n .provider('$alert', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'alert',\r\n prefixEvent: 'alert',\r\n placement: null,\r\n template: 'alert/alert.tpl.html',\r\n container: false,\r\n element: null,\r\n backdrop: false,\r\n keyboard: true,\r\n show: true,\r\n // Specific options\r\n duration: false,\r\n type: false,\r\n dismissable: true\r\n };\r\n\r\n this.$get = function($modal, $timeout) {\r\n\r\n function AlertFactory(config) {\r\n\r\n var $alert = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $alert = $modal(options);\r\n\r\n // Support scope as string options [/*title, content, */ type, dismissable]\r\n $alert.$scope.dismissable = !!options.dismissable;\r\n if(options.type) {\r\n $alert.$scope.type = options.type;\r\n }\r\n\r\n // Support auto-close duration\r\n var show = $alert.show;\r\n if(options.duration) {\r\n $alert.show = function() {\r\n show();\r\n $timeout(function() {\r\n $alert.hide();\r\n }, options.duration * 1000);\r\n };\r\n }\r\n\r\n return $alert;\r\n\r\n }\r\n\r\n return AlertFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsAlert', function($window, $sce, $alert) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope, element: element, show: false};\r\n angular.forEach(['template', 'placement', 'keyboard', 'html', 'container', 'animation', 'duration', 'dismissable'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content', 'type'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsAlert && scope.$watch(attr.bsAlert, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n }, true);\r\n\r\n // Initialize alert\r\n var alert = $alert(options);\r\n\r\n // Trigger\r\n element.on(attr.trigger || 'click', alert.toggle);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (alert) alert.destroy();\r\n options = null;\r\n alert = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/alert.tpl.js b/dist/modules/alert.tpl.js
index 6dcb59ab9..b0b22e80f 100644
--- a/dist/modules/alert.tpl.js
+++ b/dist/modules/alert.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/alert.tpl.min.js b/dist/modules/alert.tpl.min.js
index e7de1359b..6b94d2506 100644
--- a/dist/modules/alert.tpl.min.js
+++ b/dist/modules/alert.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/aside.js b/dist/modules/aside.js
index cfeb4f1c3..c27f9e0e4 100644
--- a/dist/modules/aside.js
+++ b/dist/modules/aside.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/aside.min.js b/dist/modules/aside.min.js
index f8f8cdf16..a6ddd46db 100644
--- a/dist/modules/aside.min.js
+++ b/dist/modules/aside.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/aside.min.js.map b/dist/modules/aside.min.js.map
index c95a6a7a7..9210a43b8 100644
--- a/dist/modules/aside.min.js.map
+++ b/dist/modules/aside.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["aside/aside.js"],"names":[],"mappings":"qBASM,OAAA,wBAAa,kCAEb,SAAU,cAEV,GAAW,KAAA,UACX,UAAS,0BACT,YAAU,QACV,YAAU,QACV,UAAM,QACN,SAAM,uDAGR,QAAK,iBAEH,UAAS,gBAEH,QAGJ,MAAI,SAAU,SAAQ,WAEtB,GAAgB,GAEhB,GAAA,oEAiBI,WAAS,UAAS,OAAO,SAAe,SAAA,EAAc,EAAA,GAEpC,EAAO,uBAAwB,EAAA,kEAOnD,IAAa,MAAK,EAAS,QAAK,EAAS,MAAU,WACjD,SAAa,WAAK,kBAAY,YAAA,WAAA,WAAA,OAAA,YAAA,aAAA,SAAA,0CAKlC,QAAK,SAAW,QAAM,WAAY,SAAS,GACzC,EAAG,IAAQ,EAAA,SAAS,EAAW,SAAA,GAC7B,EAAA,GAAQ,EAAO,YAAO,qEAOtB,QAAQ,OAAO,EAAA,uBAOjB,GAAI,EAAa,gFAQtB,EAAA","file":"aside.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])\n\n .provider('$aside', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade-and-slide-right',\n prefixClass: 'aside',\n prefixEvent: 'aside',\n placement: 'right',\n template: 'aside/aside.tpl.html',\n contentTemplate: false,\n container: false,\n element: null,\n backdrop: true,\n keyboard: true,\n html: false,\n show: true\n };\n\n this.$get = function($modal) {\n\n function AsideFactory(config) {\n\n var $aside = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $aside = $modal(options);\n\n return $aside;\n\n }\n\n return AsideFactory;\n\n };\n\n })\n\n .directive('bsAside', function($window, $sce, $aside) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize aside\n var aside = $aside(options);\n\n // Trigger\n element.on(attr.trigger || 'click', aside.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (aside) aside.destroy();\n options = null;\n aside = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["aside/aside.js"],"names":[],"mappings":"qBASM,OAAA,wBAAa,kCAEb,SAAU,cAEV,GAAW,KAAA,UACX,UAAS,0BACT,YAAU,QACV,YAAU,QACV,UAAM,QACN,SAAM,uDAGR,QAAK,iBAEH,UAAS,gBAEH,QAGJ,MAAI,SAAU,SAAQ,WAEtB,GAAgB,GAEhB,GAAA,oEAiBI,WAAS,UAAS,OAAO,SAAe,SAAA,EAAc,EAAA,GAEpC,EAAO,uBAAwB,EAAA,kEAOnD,IAAa,MAAK,EAAS,QAAK,EAAS,MAAU,WACjD,SAAa,WAAK,kBAAY,YAAA,WAAA,WAAA,OAAA,YAAA,aAAA,SAAA,0CAKlC,QAAK,SAAW,QAAM,WAAY,SAAS,GACzC,EAAG,IAAQ,EAAA,SAAS,EAAW,SAAA,GAC7B,EAAA,GAAQ,EAAO,YAAO,qEAOtB,QAAQ,OAAO,EAAA,uBAOjB,GAAI,EAAa,gFAQtB,EAAA","file":"aside.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.aside', ['mgcrea.ngStrap.modal'])\r\n\r\n .provider('$aside', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade-and-slide-right',\r\n prefixClass: 'aside',\r\n prefixEvent: 'aside',\r\n placement: 'right',\r\n template: 'aside/aside.tpl.html',\r\n contentTemplate: false,\r\n container: false,\r\n element: null,\r\n backdrop: true,\r\n keyboard: true,\r\n html: false,\r\n show: true\r\n };\r\n\r\n this.$get = function($modal) {\r\n\r\n function AsideFactory(config) {\r\n\r\n var $aside = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $aside = $modal(options);\r\n\r\n return $aside;\r\n\r\n }\r\n\r\n return AsideFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsAside', function($window, $sce, $aside) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n // Directive options\r\n var options = {scope: scope, element: element, show: false};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsAside && scope.$watch(attr.bsAside, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n }, true);\r\n\r\n // Initialize aside\r\n var aside = $aside(options);\r\n\r\n // Trigger\r\n element.on(attr.trigger || 'click', aside.toggle);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (aside) aside.destroy();\r\n options = null;\r\n aside = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/aside.tpl.js b/dist/modules/aside.tpl.js
index 7dc40f873..5eef71d55 100644
--- a/dist/modules/aside.tpl.js
+++ b/dist/modules/aside.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/aside.tpl.min.js b/dist/modules/aside.tpl.min.js
index 9b0030e0b..2fb8712d5 100644
--- a/dist/modules/aside.tpl.min.js
+++ b/dist/modules/aside.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/button.js b/dist/modules/button.js
index 5112587b0..95b32ef5a 100644
--- a/dist/modules/button.js
+++ b/dist/modules/button.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/button.min.js b/dist/modules/button.min.js
index fc504f3e0..f91204330 100644
--- a/dist/modules/button.min.js
+++ b/dist/modules/button.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/button.min.js.map b/dist/modules/button.min.js.map
index fc8378b2f..09a42e592 100644
--- a/dist/modules/button.min.js.map
+++ b/dist/modules/button.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["button/button.js"],"names":[],"mappings":"iEAWS,UAAO,+FAQZ,OAAO,SAAA,gBAKH,kBAAmB,2BAGb,YACJ,kBACA,SAAa,EAAiB,mQAelC,cAAS,UAAA,QAAA,SAAA,EAAA,oBAGP,EAAc,qCAGV,YACA,iCAGJ,GAAG,GAAA,EAGC,EAA+B,UAA/B,EAAa,GAAQ,SACtB,EAAA,EAAyB,EAAK,SAAa,+FAM9C,IAAG,GAAA,QAAiB,UAAA,EAAA,YAAA,EAAA,YAAA,CAClB,GAAoB,KAAK,EAAA,0CAKzB,GAAqC,iBAAd,IAA0B,iBAAA,SAEvC,SAAQ,KAAO,SAAA,4GAWzB,EAAI,uEAQN,GAAQ,WACN,IAAa,EAAA,GAAY,QAAA,uCAMrB,KAAA,EAAW,YAAA,2GAkBjB,eAAmB,2BAGjB,YACA,+QAeJ,WAAS,UAAA,QAAA,SAAA,EAAA,oBAGP,EAAc,qCAGV,YACA,mEAOF,EAAe,EAAQ,EAAO,SAAW,EAEvC,EAAG,EAAoB,KAAU,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,gEAMrC,GAAQ,WACN,IAAa,EAAA,GAAY,QAAA","file":"button.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.button', [])\n\n .provider('$button', function() {\n\n var defaults = this.defaults = {\n activeClass:'active',\n toggleEvent:'click'\n };\n\n this.$get = function() {\n return {defaults: defaults};\n };\n\n })\n\n .directive('bsCheckboxGroup', function() {\n\n return {\n restrict: 'A',\n require: 'ngModel',\n compile: function postLink(element, attr) {\n element.attr('data-toggle', 'buttons');\n element.removeAttr('ng-model');\n var children = element[0].querySelectorAll('input[type=\"checkbox\"]');\n angular.forEach(children, function(child) {\n var childEl = angular.element(child);\n childEl.attr('bs-checkbox', '');\n childEl.attr('ng-model', attr.ngModel + '.' + childEl.attr('value'));\n });\n }\n\n };\n\n })\n\n .directive('bsCheckbox', function($button, $$rAF) {\n\n var defaults = $button.defaults;\n var constantValueRegExp = /^(true|false|\\d+)$/;\n\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n var options = defaults;\n\n // Support label > input[type=\"checkbox\"]\n var isInput = element[0].nodeName === 'INPUT';\n var activeElement = isInput ? element.parent() : element;\n\n var trueValue = angular.isDefined(attr.trueValue) ? attr.trueValue : true;\n if(constantValueRegExp.test(attr.trueValue)) {\n trueValue = scope.$eval(attr.trueValue);\n }\n var falseValue = angular.isDefined(attr.falseValue) ? attr.falseValue : false;\n if(constantValueRegExp.test(attr.falseValue)) {\n falseValue = scope.$eval(attr.falseValue);\n }\n\n // Parse exotic values\n var hasExoticValues = typeof trueValue !== 'boolean' || typeof falseValue !== 'boolean';\n if(hasExoticValues) {\n controller.$parsers.push(function(viewValue) {\n // console.warn('$parser', element.attr('ng-model'), 'viewValue', viewValue);\n return viewValue ? trueValue : falseValue;\n });\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n return angular.equals(modelValue, trueValue);\n });\n // Fix rendering for exotic values\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n controller.$render();\n });\n }\n\n // model -> view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n var isActive = angular.equals(controller.$modelValue, trueValue);\n $$rAF(function() {\n if(isInput) element[0].checked = isActive;\n activeElement.toggleClass(options.activeClass, isActive);\n });\n };\n\n // view -> model\n element.bind(options.toggleEvent, function() {\n scope.$apply(function () {\n // console.warn('!click', element.attr('ng-model'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\n if(!isInput) {\n controller.$setViewValue(!activeElement.hasClass('active'));\n }\n if(!hasExoticValues) {\n controller.$render();\n }\n });\n });\n\n }\n\n };\n\n })\n\n .directive('bsRadioGroup', function() {\n\n return {\n restrict: 'A',\n require: 'ngModel',\n compile: function postLink(element, attr) {\n element.attr('data-toggle', 'buttons');\n element.removeAttr('ng-model');\n var children = element[0].querySelectorAll('input[type=\"radio\"]');\n angular.forEach(children, function(child) {\n angular.element(child).attr('bs-radio', '');\n angular.element(child).attr('ng-model', attr.ngModel);\n });\n }\n\n };\n\n })\n\n .directive('bsRadio', function($button, $$rAF) {\n\n var defaults = $button.defaults;\n var constantValueRegExp = /^(true|false|\\d+)$/;\n\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n var options = defaults;\n\n // Support `label > input[type=\"radio\"]` markup\n var isInput = element[0].nodeName === 'INPUT';\n var activeElement = isInput ? element.parent() : element;\n\n var value = constantValueRegExp.test(attr.value) ? scope.$eval(attr.value) : attr.value;\n\n // model -> view\n controller.$render = function () {\n // console.warn('$render', element.attr('value'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n var isActive = angular.equals(controller.$modelValue, value);\n $$rAF(function() {\n if(isInput) element[0].checked = isActive;\n activeElement.toggleClass(options.activeClass, isActive);\n });\n };\n\n // view -> model\n element.bind(options.toggleEvent, function() {\n scope.$apply(function () {\n // console.warn('!click', element.attr('value'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\n controller.$setViewValue(value);\n controller.$render();\n });\n });\n\n }\n\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["button/button.js"],"names":[],"mappings":"iEAWS,UAAO,+FAQZ,OAAO,SAAA,gBAKH,kBAAmB,2BAGb,YACJ,kBACA,SAAa,EAAiB,mQAelC,cAAS,UAAA,QAAA,SAAA,EAAA,oBAGP,EAAc,qCAGV,YACA,iCAGJ,GAAG,GAAA,EAGC,EAA+B,UAA/B,EAAa,GAAQ,SACtB,EAAA,EAAyB,EAAK,SAAa,+FAM9C,IAAG,GAAA,QAAiB,UAAA,EAAA,YAAA,EAAA,YAAA,CAClB,GAAoB,KAAK,EAAA,0CAKzB,GAAqC,iBAAd,IAA0B,iBAAA,SAEvC,SAAQ,KAAO,SAAA,4GAWzB,EAAI,uEAQN,GAAQ,WACN,IAAa,EAAA,GAAY,QAAA,uCAMrB,KAAA,EAAW,YAAA,2GAkBjB,eAAmB,2BAGjB,YACA,+QAeJ,WAAS,UAAA,QAAA,SAAA,EAAA,oBAGP,EAAc,qCAGV,YACA,mEAOF,EAAe,EAAQ,EAAO,SAAW,EAEvC,EAAG,EAAoB,KAAU,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,gEAMrC,GAAQ,WACN,IAAa,EAAA,GAAY,QAAA","file":"button.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.button', [])\r\n\r\n .provider('$button', function() {\r\n\r\n var defaults = this.defaults = {\r\n activeClass:'active',\r\n toggleEvent:'click'\r\n };\r\n\r\n this.$get = function() {\r\n return {defaults: defaults};\r\n };\r\n\r\n })\r\n\r\n .directive('bsCheckboxGroup', function() {\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n compile: function postLink(element, attr) {\r\n element.attr('data-toggle', 'buttons');\r\n element.removeAttr('ng-model');\r\n var children = element[0].querySelectorAll('input[type=\"checkbox\"]');\r\n angular.forEach(children, function(child) {\r\n var childEl = angular.element(child);\r\n childEl.attr('bs-checkbox', '');\r\n childEl.attr('ng-model', attr.ngModel + '.' + childEl.attr('value'));\r\n });\r\n }\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsCheckbox', function($button, $$rAF) {\r\n\r\n var defaults = $button.defaults;\r\n var constantValueRegExp = /^(true|false|\\d+)$/;\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n var options = defaults;\r\n\r\n // Support label > input[type=\"checkbox\"]\r\n var isInput = element[0].nodeName === 'INPUT';\r\n var activeElement = isInput ? element.parent() : element;\r\n\r\n var trueValue = angular.isDefined(attr.trueValue) ? attr.trueValue : true;\r\n if(constantValueRegExp.test(attr.trueValue)) {\r\n trueValue = scope.$eval(attr.trueValue);\r\n }\r\n var falseValue = angular.isDefined(attr.falseValue) ? attr.falseValue : false;\r\n if(constantValueRegExp.test(attr.falseValue)) {\r\n falseValue = scope.$eval(attr.falseValue);\r\n }\r\n\r\n // Parse exotic values\r\n var hasExoticValues = typeof trueValue !== 'boolean' || typeof falseValue !== 'boolean';\r\n if(hasExoticValues) {\r\n controller.$parsers.push(function(viewValue) {\r\n // console.warn('$parser', element.attr('ng-model'), 'viewValue', viewValue);\r\n return viewValue ? trueValue : falseValue;\r\n });\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n return angular.equals(modelValue, trueValue);\r\n });\r\n // Fix rendering for exotic values\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n controller.$render();\r\n });\r\n }\r\n\r\n // model -> view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n var isActive = angular.equals(controller.$modelValue, trueValue);\r\n $$rAF(function() {\r\n if(isInput) element[0].checked = isActive;\r\n activeElement.toggleClass(options.activeClass, isActive);\r\n });\r\n };\r\n\r\n // view -> model\r\n element.bind(options.toggleEvent, function() {\r\n scope.$apply(function () {\r\n // console.warn('!click', element.attr('ng-model'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\r\n if(!isInput) {\r\n controller.$setViewValue(!activeElement.hasClass('active'));\r\n }\r\n if(!hasExoticValues) {\r\n controller.$render();\r\n }\r\n });\r\n });\r\n\r\n }\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsRadioGroup', function() {\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n compile: function postLink(element, attr) {\r\n element.attr('data-toggle', 'buttons');\r\n element.removeAttr('ng-model');\r\n var children = element[0].querySelectorAll('input[type=\"radio\"]');\r\n angular.forEach(children, function(child) {\r\n angular.element(child).attr('bs-radio', '');\r\n angular.element(child).attr('ng-model', attr.ngModel);\r\n });\r\n }\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsRadio', function($button, $$rAF) {\r\n\r\n var defaults = $button.defaults;\r\n var constantValueRegExp = /^(true|false|\\d+)$/;\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n var options = defaults;\r\n\r\n // Support `label > input[type=\"radio\"]` markup\r\n var isInput = element[0].nodeName === 'INPUT';\r\n var activeElement = isInput ? element.parent() : element;\r\n\r\n var value = constantValueRegExp.test(attr.value) ? scope.$eval(attr.value) : attr.value;\r\n\r\n // model -> view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('value'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n var isActive = angular.equals(controller.$modelValue, value);\r\n $$rAF(function() {\r\n if(isInput) element[0].checked = isActive;\r\n activeElement.toggleClass(options.activeClass, isActive);\r\n });\r\n };\r\n\r\n // view -> model\r\n element.bind(options.toggleEvent, function() {\r\n scope.$apply(function () {\r\n // console.warn('!click', element.attr('value'), 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue, 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue);\r\n controller.$setViewValue(value);\r\n controller.$render();\r\n });\r\n });\r\n\r\n }\r\n\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/collapse.js b/dist/modules/collapse.js
index c8212f4d5..11c9cfc7d 100644
--- a/dist/modules/collapse.js
+++ b/dist/modules/collapse.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -15,7 +15,8 @@ angular.module('mgcrea.ngStrap.collapse', [])
animation: 'am-collapse',
disallowToggle: false,
activeClass: 'in',
- startCollapsed: false
+ startCollapsed: false,
+ allowMultiple: false
};
var controller = this.controller = function($scope, $element, $attrs) {
@@ -23,7 +24,7 @@ angular.module('mgcrea.ngStrap.collapse', [])
// Attributes options
self.$options = angular.copy(defaults);
- angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed'], function (key) {
+ angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed', 'allowMultiple'], function (key) {
if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];
});
@@ -46,36 +47,86 @@ angular.module('mgcrea.ngStrap.collapse', [])
};
self.$unregisterTarget = function(element) {
var index = self.$targets.indexOf(element);
- var activeIndex = self.$targets.$active;
// remove element from $targets array
self.$targets.splice(index, 1);
- if (index < activeIndex) {
- // we removed a target before the active target, so we need to
- // decrement the active target index
- activeIndex--;
+ if (self.$options.allowMultiple) {
+ // remove target index from $active array values
+ deactivateItem(element);
}
- else if (index === activeIndex && activeIndex === self.$targets.length) {
- // we remove the active target and it was the one at the end,
- // so select the previous one
- activeIndex--;
- }
- self.$setActive(activeIndex);
+
+ // fix active item indexes
+ fixActiveItemIndexes(index);
+
+ self.$viewChangeListeners.forEach(function(fn) {
+ fn();
+ });
};
- self.$targets.$active = !self.$options.startCollapsed ? 0 : -1;
+ // use array to store all the currently open panels
+ self.$targets.$active = !self.$options.startCollapsed ? [0] : [];
self.$setActive = $scope.$setActive = function(value) {
- if(!self.$options.disallowToggle) {
- self.$targets.$active = self.$targets.$active === value ? -1 : value;
+ if(angular.isArray(value)) {
+ self.$targets.$active = angular.copy(value);
+ }
+ else if(!self.$options.disallowToggle) {
+ // toogle element active status
+ isActive(value) ? deactivateItem(value) : activateItem(value);
} else {
- self.$targets.$active = value;
+ activateItem(value);
}
+
self.$viewChangeListeners.forEach(function(fn) {
fn();
});
};
+ self.$activeIndexes = function() {
+ return self.$options.allowMultiple ? self.$targets.$active :
+ self.$targets.$active.length === 1 ? self.$targets.$active[0] : -1;
+ };
+
+ function fixActiveItemIndexes(index) {
+ // item with index was removed, so we
+ // need to adjust other items index values
+ var activeIndexes = self.$targets.$active;
+ for(var i = 0; i < activeIndexes.length; i++) {
+ if (index < activeIndexes[i]) {
+ activeIndexes[i] = activeIndexes[i] - 1;
+ }
+
+ // the last item is active, so we need to
+ // adjust its index
+ if (activeIndexes[i] === self.$targets.length) {
+ activeIndexes[i] = self.$targets.length - 1;
+ }
+ }
+ }
+
+ function isActive(value) {
+ var activeItems = self.$targets.$active;
+ return activeItems.indexOf(value) === -1 ? false : true;
+ }
+
+ function deactivateItem(value) {
+ var index = self.$targets.$active.indexOf(value);
+ if (index !== -1) {
+ self.$targets.$active.splice(index, 1);
+ }
+ }
+
+ function activateItem(value) {
+ if (!self.$options.allowMultiple) {
+ // remove current selected item
+ self.$targets.$active.splice(0, 1);
+ }
+
+ if (self.$targets.$active.indexOf(value) === -1) {
+ self.$targets.$active.push(value);
+ }
+ }
+
};
this.$get = function() {
@@ -103,14 +154,30 @@ angular.module('mgcrea.ngStrap.collapse', [])
// Update the modelValue following
bsCollapseCtrl.$viewChangeListeners.push(function() {
- ngModelCtrl.$setViewValue(bsCollapseCtrl.$targets.$active);
+ ngModelCtrl.$setViewValue(bsCollapseCtrl.$activeIndexes());
});
// modelValue -> $formatters -> viewValue
ngModelCtrl.$formatters.push(function(modelValue) {
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
- if (bsCollapseCtrl.$targets.$active !== modelValue * 1) {
- bsCollapseCtrl.$setActive(modelValue * 1);
+ if (angular.isArray(modelValue)) {
+ // model value is an array, so just replace
+ // the active items directly
+ bsCollapseCtrl.$setActive(modelValue);
+ }
+ else {
+ var activeIndexes = bsCollapseCtrl.$activeIndexes();
+
+ if (angular.isArray(activeIndexes)) {
+ // we have an array of selected indexes
+ if (activeIndexes.indexOf(modelValue * 1) === -1) {
+ // item with modelValue index is not active
+ bsCollapseCtrl.$setActive(modelValue * 1);
+ }
+ }
+ else if (activeIndexes !== modelValue * 1) {
+ bsCollapseCtrl.$setActive(modelValue * 1);
+ }
}
return modelValue;
});
@@ -181,8 +248,18 @@ angular.module('mgcrea.ngStrap.collapse', [])
function render() {
var index = bsCollapseCtrl.$targets.indexOf(element);
- var active = bsCollapseCtrl.$targets.$active;
- $animate[index === active ? 'addClass' : 'removeClass'](element, bsCollapseCtrl.$options.activeClass);
+ var active = bsCollapseCtrl.$activeIndexes();
+ var action = 'removeClass';
+ if (angular.isArray(active)) {
+ if (active.indexOf(index) !== -1) {
+ action = 'addClass';
+ }
+ }
+ else if (index === active) {
+ action = 'addClass';
+ }
+
+ $animate[action](element, bsCollapseCtrl.$options.activeClass);
}
bsCollapseCtrl.$viewChangeListeners.push(function() {
diff --git a/dist/modules/collapse.min.js b/dist/modules/collapse.min.js
index 44334e872..11e96db87 100644
--- a/dist/modules/collapse.min.js
+++ b/dist/modules/collapse.min.js
@@ -1,9 +1,9 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
-"use strict";angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var e=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1},t=this.controller=function(t,s,a){var n=this;n.$options=angular.copy(e),angular.forEach(["animation","disallowToggle","activeClass","startCollapsed"],function(e){angular.isDefined(a[e])&&(n.$options[e]=a[e])}),n.$toggles=[],n.$targets=[],n.$viewChangeListeners=[],n.$registerToggle=function(e){n.$toggles.push(e)},n.$registerTarget=function(e){n.$targets.push(e)},n.$unregisterToggle=function(e){var t=n.$toggles.indexOf(e);n.$toggles.splice(t,1)},n.$unregisterTarget=function(e){var t=n.$targets.indexOf(e),s=n.$targets.$active;n.$targets.splice(t,1),s>t?s--:t===s&&s===n.$targets.length&&s--,n.$setActive(s)},n.$targets.$active=n.$options.startCollapsed?-1:0,n.$setActive=t.$setActive=function(e){n.$targets.$active=n.$options.disallowToggle?e:n.$targets.$active===e?-1:e,n.$viewChangeListeners.forEach(function(e){e()})}};this.$get=function(){var s={};return s.defaults=e,s.controller=t,s}}).directive("bsCollapse",["$window","$animate","$collapse",function(e,t,s){s.defaults;return{require:["?ngModel","bsCollapse"],controller:["$scope","$element","$attrs",s.controller],link:function(e,t,s,a){var n=a[0],i=a[1];n&&(i.$viewChangeListeners.push(function(){n.$setViewValue(i.$targets.$active)}),n.$formatters.push(function(e){return i.$targets.$active!==1*e&&i.$setActive(1*e),e}))}}}]).directive("bsCollapseToggle",function(){return{require:["^?ngModel","^bsCollapse"],link:function(e,t,s,a){var n=(a[0],a[1]);t.attr("data-toggle","collapse"),n.$registerToggle(t),e.$on("$destroy",function(){n.$unregisterToggle(t)}),t.on("click",function(){var a=s.bsCollapseToggle||n.$toggles.indexOf(t);n.$setActive(1*a),e.$apply()})}}}).directive("bsCollapseTarget",["$animate",function(e){return{require:["^?ngModel","^bsCollapse"],link:function(t,s,a,n){function i(){var t=o.$targets.indexOf(s),a=o.$targets.$active;e[t===a?"addClass":"removeClass"](s,o.$options.activeClass)}var o=(n[0],n[1]);s.addClass("collapse"),o.$options.animation&&s.addClass(o.$options.animation),o.$registerTarget(s),t.$on("$destroy",function(){o.$unregisterTarget(s)}),o.$viewChangeListeners.push(function(){i()}),i()}}}]);
+"use strict";angular.module("mgcrea.ngStrap.collapse",[]).provider("$collapse",function(){var e=this.defaults={animation:"am-collapse",disallowToggle:!1,activeClass:"in",startCollapsed:!1,allowMultiple:!1},t=this.controller=function(t,a,n){function i(e){for(var t=o.$targets.$active,a=0;a $formatters -> viewValue\n ngModelCtrl.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n if (bsCollapseCtrl.$targets.$active !== modelValue * 1) {\n bsCollapseCtrl.$setActive(modelValue * 1);\n }\n return modelValue;\n });\n\n }\n\n }\n };\n\n })\n\n .directive('bsCollapseToggle', function() {\n\n return {\n require: ['^?ngModel', '^bsCollapse'],\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsCollapseCtrl = controllers[1];\n\n // Add base attr\n element.attr('data-toggle', 'collapse');\n\n // Push pane to parent bsCollapse controller\n bsCollapseCtrl.$registerToggle(element);\n\n // remove toggle from collapse controller when toggle is destroyed\n scope.$on('$destroy', function() {\n bsCollapseCtrl.$unregisterToggle(element);\n });\n\n element.on('click', function() {\n var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);\n bsCollapseCtrl.$setActive(index * 1);\n scope.$apply();\n });\n\n }\n };\n\n })\n\n .directive('bsCollapseTarget', function($animate) {\n\n return {\n require: ['^?ngModel', '^bsCollapse'],\n // scope: true,\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsCollapseCtrl = controllers[1];\n\n // Add base class\n element.addClass('collapse');\n\n // Add animation class\n if(bsCollapseCtrl.$options.animation) {\n element.addClass(bsCollapseCtrl.$options.animation);\n }\n\n // Push pane to parent bsCollapse controller\n bsCollapseCtrl.$registerTarget(element);\n\n // remove pane target from collapse controller when target is destroyed\n scope.$on('$destroy', function() {\n bsCollapseCtrl.$unregisterTarget(element);\n });\n\n function render() {\n var index = bsCollapseCtrl.$targets.indexOf(element);\n var active = bsCollapseCtrl.$targets.$active;\n $animate[index === active ? 'addClass' : 'removeClass'](element, bsCollapseCtrl.$options.activeClass);\n }\n\n bsCollapseCtrl.$viewChangeListeners.push(function() {\n render();\n });\n render();\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["collapse/collapse.js"],"names":[],"mappings":"qBASM,OAAA,uCAEA,YAAe,gCAGjB,UAAI,cACF,gBAAW,qCAGX,eAAK,uDA2ED,yBAAI,EAAA,EAAA,EAAA,EAA0B,OAAS,IACrC,EAAA,EAAwB,kBAMxB,EAAc,KAAK,EAAS,SAAA,SAChC,EAAO,GAAY,EAAQ,SAAA,OAAgB,WAKvC,GAAW,MACb,GAAc,EAAA,SAAe,sCAIjC,QAAS,GAAa,GACpB,GAAI,GAAM,EAAA,SAAS,QAAe,QAAA,WAEhC,EAAK,SAAS,QAAQ,OAAO,EAAG,WAI3B,GAAS,4DAMG,KAAlB,EAAO,SAAA,QAAW,QAAA,IACjB,EAAA,SAAY,QAAA,KAAA,yCAnGhB,QAAK,SAAA,YAAuB,iBAAA,cAAA,iBAAA,iBAAA,SAAA,iEAK5B,EAAK,sCAIL,EAAK,gBAAA,SAAoB,GACvB,EAAI,SAAQ,KAAK,MAEjB,gBAAqB,SAAO,8IAU1B,GAAA,EAAe,SAAA,QAAA,oDAOf,EAAA,QAMJ,EAAK,qBAAoB,QAAA,SAAa,GACpC,SAKE,SAAS,QAAS,EAAA,SAAe,mBAAS,gBACrC,EAAA,WAAA,SAAA,GACL,QAAA,QAAa,sCAGV,EAAA,SAAA,qCAOH,qBAAsB,QAAA,SAAe,sCAMvC,MAAI,GAAA,SAAgB,cAAc,EAAA,SAAA,QACD,IAAjC,EAAI,SAAW,QAAI,OAAc,EAAQ,SAAK,QAAA,GAAA,kCAiDlD,OAFD,GAAU,SAAA,iBAEL,eAKI,cAAS,UAAgB,WAAS,YAAO,SAAa,EAAA,EAAA,GAEtD,EAAc,yBAGf,WAAa,+FAIZ,GAAY,EAAc,gBAMd,qBAAqB,KAAA,mDAK5B,YAAA,KAAA,SAAA,2BAKG,WAAc,yCAKX,QAAA,wBAIX,EAAO,WAAA,EAAA,yDAiBP,mBAAiB,2BAGb,YAAK,sCAGb,OAAe,EAAA,WAIb,KAAA,cAAe,YAGjB,EAAW,gBAAoB,KAG7B,IAAM,WAAA,yJAeJ,oBAAc,WAAY,SAAA,gHA4BnB,EAAkB,iBACzB,EAAS,qDAGX,EAAS,YAGX,IAAe,IACb,EAAA,2CA7BF,GACE,IADgB,EAAS,GACR,EAAA,iDAOnB,EAAU,SAAA,EAAuB,SAAA,WAIjC,EAAS,gBAAS,KAGZ,IAAA,WAAS,WACb,EAAY,kBAAiB,4CAoBlC","file":"collapse.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.collapse', [])\r\n\r\n .provider('$collapse', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-collapse',\r\n disallowToggle: false,\r\n activeClass: 'in',\r\n startCollapsed: false,\r\n allowMultiple: false\r\n };\r\n\r\n var controller = this.controller = function($scope, $element, $attrs) {\r\n var self = this;\r\n\r\n // Attributes options\r\n self.$options = angular.copy(defaults);\r\n angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed', 'allowMultiple'], function (key) {\r\n if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];\r\n });\r\n\r\n self.$toggles = [];\r\n self.$targets = [];\r\n\r\n self.$viewChangeListeners = [];\r\n\r\n self.$registerToggle = function(element) {\r\n self.$toggles.push(element);\r\n };\r\n self.$registerTarget = function(element) {\r\n self.$targets.push(element);\r\n };\r\n\r\n self.$unregisterToggle = function(element) {\r\n var index = self.$toggles.indexOf(element);\r\n // remove toggle from $toggles array\r\n self.$toggles.splice(index, 1);\r\n };\r\n self.$unregisterTarget = function(element) {\r\n var index = self.$targets.indexOf(element);\r\n\r\n // remove element from $targets array\r\n self.$targets.splice(index, 1);\r\n\r\n if (self.$options.allowMultiple) {\r\n // remove target index from $active array values\r\n deactivateItem(element);\r\n }\r\n\r\n // fix active item indexes\r\n fixActiveItemIndexes(index);\r\n\r\n self.$viewChangeListeners.forEach(function(fn) {\r\n fn();\r\n });\r\n };\r\n\r\n // use array to store all the currently open panels\r\n self.$targets.$active = !self.$options.startCollapsed ? [0] : [];\r\n self.$setActive = $scope.$setActive = function(value) {\r\n if(angular.isArray(value)) {\r\n self.$targets.$active = angular.copy(value);\r\n }\r\n else if(!self.$options.disallowToggle) {\r\n // toogle element active status\r\n isActive(value) ? deactivateItem(value) : activateItem(value);\r\n } else {\r\n activateItem(value);\r\n }\r\n\r\n self.$viewChangeListeners.forEach(function(fn) {\r\n fn();\r\n });\r\n };\r\n\r\n self.$activeIndexes = function() {\r\n return self.$options.allowMultiple ? self.$targets.$active :\r\n self.$targets.$active.length === 1 ? self.$targets.$active[0] : -1;\r\n };\r\n\r\n function fixActiveItemIndexes(index) {\r\n // item with index was removed, so we\r\n // need to adjust other items index values\r\n var activeIndexes = self.$targets.$active;\r\n for(var i = 0; i < activeIndexes.length; i++) {\r\n if (index < activeIndexes[i]) {\r\n activeIndexes[i] = activeIndexes[i] - 1;\r\n }\r\n\r\n // the last item is active, so we need to\r\n // adjust its index\r\n if (activeIndexes[i] === self.$targets.length) {\r\n activeIndexes[i] = self.$targets.length - 1;\r\n }\r\n }\r\n }\r\n\r\n function isActive(value) {\r\n var activeItems = self.$targets.$active;\r\n return activeItems.indexOf(value) === -1 ? false : true;\r\n }\r\n\r\n function deactivateItem(value) {\r\n var index = self.$targets.$active.indexOf(value);\r\n if (index !== -1) {\r\n self.$targets.$active.splice(index, 1);\r\n }\r\n }\r\n\r\n function activateItem(value) {\r\n if (!self.$options.allowMultiple) {\r\n // remove current selected item\r\n self.$targets.$active.splice(0, 1);\r\n }\r\n\r\n if (self.$targets.$active.indexOf(value) === -1) {\r\n self.$targets.$active.push(value);\r\n }\r\n }\r\n\r\n };\r\n\r\n this.$get = function() {\r\n var $collapse = {};\r\n $collapse.defaults = defaults;\r\n $collapse.controller = controller;\r\n return $collapse;\r\n };\r\n\r\n })\r\n\r\n .directive('bsCollapse', function($window, $animate, $collapse) {\r\n\r\n var defaults = $collapse.defaults;\r\n\r\n return {\r\n require: ['?ngModel', 'bsCollapse'],\r\n controller: ['$scope', '$element', '$attrs', $collapse.controller],\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsCollapseCtrl = controllers[1];\r\n\r\n if(ngModelCtrl) {\r\n\r\n // Update the modelValue following\r\n bsCollapseCtrl.$viewChangeListeners.push(function() {\r\n ngModelCtrl.$setViewValue(bsCollapseCtrl.$activeIndexes());\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n ngModelCtrl.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n if (angular.isArray(modelValue)) {\r\n // model value is an array, so just replace\r\n // the active items directly\r\n bsCollapseCtrl.$setActive(modelValue);\r\n }\r\n else {\r\n var activeIndexes = bsCollapseCtrl.$activeIndexes();\r\n\r\n if (angular.isArray(activeIndexes)) {\r\n // we have an array of selected indexes\r\n if (activeIndexes.indexOf(modelValue * 1) === -1) {\r\n // item with modelValue index is not active\r\n bsCollapseCtrl.$setActive(modelValue * 1);\r\n }\r\n }\r\n else if (activeIndexes !== modelValue * 1) {\r\n bsCollapseCtrl.$setActive(modelValue * 1);\r\n }\r\n }\r\n return modelValue;\r\n });\r\n\r\n }\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsCollapseToggle', function() {\r\n\r\n return {\r\n require: ['^?ngModel', '^bsCollapse'],\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsCollapseCtrl = controllers[1];\r\n\r\n // Add base attr\r\n element.attr('data-toggle', 'collapse');\r\n\r\n // Push pane to parent bsCollapse controller\r\n bsCollapseCtrl.$registerToggle(element);\r\n\r\n // remove toggle from collapse controller when toggle is destroyed\r\n scope.$on('$destroy', function() {\r\n bsCollapseCtrl.$unregisterToggle(element);\r\n });\r\n\r\n element.on('click', function() {\r\n var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);\r\n bsCollapseCtrl.$setActive(index * 1);\r\n scope.$apply();\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsCollapseTarget', function($animate) {\r\n\r\n return {\r\n require: ['^?ngModel', '^bsCollapse'],\r\n // scope: true,\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsCollapseCtrl = controllers[1];\r\n\r\n // Add base class\r\n element.addClass('collapse');\r\n\r\n // Add animation class\r\n if(bsCollapseCtrl.$options.animation) {\r\n element.addClass(bsCollapseCtrl.$options.animation);\r\n }\r\n\r\n // Push pane to parent bsCollapse controller\r\n bsCollapseCtrl.$registerTarget(element);\r\n\r\n // remove pane target from collapse controller when target is destroyed\r\n scope.$on('$destroy', function() {\r\n bsCollapseCtrl.$unregisterTarget(element);\r\n });\r\n\r\n function render() {\r\n var index = bsCollapseCtrl.$targets.indexOf(element);\r\n var active = bsCollapseCtrl.$activeIndexes();\r\n var action = 'removeClass';\r\n if (angular.isArray(active)) {\r\n if (active.indexOf(index) !== -1) {\r\n action = 'addClass';\r\n }\r\n }\r\n else if (index === active) {\r\n action = 'addClass';\r\n }\r\n\r\n $animate[action](element, bsCollapseCtrl.$options.activeClass);\r\n }\r\n\r\n bsCollapseCtrl.$viewChangeListeners.push(function() {\r\n render();\r\n });\r\n render();\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/date-formatter.js b/dist/modules/date-formatter.js
index 5b9efbf32..77bc9fa3d 100644
--- a/dist/modules/date-formatter.js
+++ b/dist/modules/date-formatter.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/date-formatter.min.js b/dist/modules/date-formatter.min.js
index b36d7b41a..045dbcc88 100644
--- a/dist/modules/date-formatter.min.js
+++ b/dist/modules/date-formatter.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/date-formatter.min.js.map b/dist/modules/date-formatter.min.js.map
index 060a52a09..148898192 100644
--- a/dist/modules/date-formatter.min.js.map
+++ b/dist/modules/date-formatter.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["helpers/date-formatter.js"],"names":[],"mappings":"+EAWS,kBAAmB,UAAW,aAAA,SAAA,EAAA,yEAOjC,iBAAe,2DAOjB,MAAS,GAAA,iBAAwB,IAAA,wOA4BhC,QAAA,EAAA,GAAA","file":"date-formatter.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.dateFormatter', [])\n\n .service('$dateFormatter', function($locale, dateFilter) {\n\n // The unused `lang` arguments are on purpose. The default implementation does not\n // use them and it always uses the locale loaded into the `$locale` service.\n // Custom implementations might use it, thus allowing different directives to\n // have different languages.\n\n this.getDefaultLocale = function() {\n return $locale.id;\n };\n\n // Format is either a data format name, e.g. \"shortTime\" or \"fullDate\", or a date format\n // Return either the corresponding date format or the given date format.\n this.getDatetimeFormat = function(format, lang) {\n return $locale.DATETIME_FORMATS[format] || format;\n };\n\n this.weekdaysShort = function(lang) {\n return $locale.DATETIME_FORMATS.SHORTDAY;\n };\n\n function splitTimeFormat(format) {\n return /(h+)([:\\.])?(m+)[ ]?(a?)/i.exec(format).slice(1);\n }\n\n // h:mm a => h\n this.hoursFormat = function(timeFormat) {\n return splitTimeFormat(timeFormat)[0];\n };\n\n // h:mm a => mm\n this.minutesFormat = function(timeFormat) {\n return splitTimeFormat(timeFormat)[2];\n };\n\n // h:mm a => :\n this.timeSeparator = function(timeFormat) {\n return splitTimeFormat(timeFormat)[1];\n };\n\n // h:mm a => true, H.mm => false\n this.showAM = function(timeFormat) {\n return !!splitTimeFormat(timeFormat)[3];\n };\n\n this.formatDate = function(date, format, lang){\n return dateFilter(date, format);\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["helpers/date-formatter.js"],"names":[],"mappings":"+EAWS,kBAAmB,UAAW,aAAA,SAAA,EAAA,yEAOjC,iBAAe,2DAOjB,MAAS,GAAA,iBAAwB,IAAA,wOA4BhC,QAAA,EAAA,GAAA","file":"date-formatter.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.dateFormatter', [])\r\n\r\n .service('$dateFormatter', function($locale, dateFilter) {\r\n\r\n // The unused `lang` arguments are on purpose. The default implementation does not\r\n // use them and it always uses the locale loaded into the `$locale` service.\r\n // Custom implementations might use it, thus allowing different directives to\r\n // have different languages.\r\n\r\n this.getDefaultLocale = function() {\r\n return $locale.id;\r\n };\r\n\r\n // Format is either a data format name, e.g. \"shortTime\" or \"fullDate\", or a date format\r\n // Return either the corresponding date format or the given date format.\r\n this.getDatetimeFormat = function(format, lang) {\r\n return $locale.DATETIME_FORMATS[format] || format;\r\n };\r\n\r\n this.weekdaysShort = function(lang) {\r\n return $locale.DATETIME_FORMATS.SHORTDAY;\r\n };\r\n\r\n function splitTimeFormat(format) {\r\n return /(h+)([:\\.])?(m+)[ ]?(a?)/i.exec(format).slice(1);\r\n }\r\n\r\n // h:mm a => h\r\n this.hoursFormat = function(timeFormat) {\r\n return splitTimeFormat(timeFormat)[0];\r\n };\r\n\r\n // h:mm a => mm\r\n this.minutesFormat = function(timeFormat) {\r\n return splitTimeFormat(timeFormat)[2];\r\n };\r\n\r\n // h:mm a => :\r\n this.timeSeparator = function(timeFormat) {\r\n return splitTimeFormat(timeFormat)[1];\r\n };\r\n\r\n // h:mm a => true, H.mm => false\r\n this.showAM = function(timeFormat) {\r\n return !!splitTimeFormat(timeFormat)[3];\r\n };\r\n\r\n this.formatDate = function(date, format, lang){\r\n return dateFilter(date, format);\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/date-parser.js b/dist/modules/date-parser.js
index 7ced2a27d..831a3c047 100644
--- a/dist/modules/date-parser.js
+++ b/dist/modules/date-parser.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/date-parser.min.js b/dist/modules/date-parser.min.js
index 10982b902..2ffacfb03 100644
--- a/dist/modules/date-parser.min.js
+++ b/dist/modules/date-parser.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/date-parser.min.js.map b/dist/modules/date-parser.min.js.map
index 23b2910a7..465c38a89 100644
--- a/dist/modules/date-parser.min.js.map
+++ b/dist/modules/date-parser.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["helpers/date-parser.js"],"names":[],"mappings":"qBASI,OAAK,iDAEA,eAAM,kBAAA,mBAIN,iCAGP,KAAA,IAAU,EACV,KAAA,MAAU,EACV,KAAA,QAAU,EACV,KAAA,QAAU,EACV,KAAA,aAAoB,EA4BpB,QAAS,cAGD,GAAS,4DAMf,IAAA,GADE,GAAA,EAAW,OAAK,EAAA,EAAW,WAAA,cACrB,EAAA,EAAA,EAAA,EAAA,IACR,GAAA,EAAQ,GAAA,gBAAA,EAAA,MAAA,YAnCV,EAAU,UAAU,gBAAc,SAAS,GAAS,KAAK,aAAO,GAChE,EAAU,UAAU,WAAW,SAAS,GAAO,KAAA,QAAA,KACxC,UAAa,WAAA,SAAA,GAAA,KAAA,QAAA,KACb,UAAQ,SAAM,SAAA,GAAA,KAAA,MAAA,KACd,UAAY,SAAA,WAAA,MAAA,MAAA,SACZ,UAAQ,QAAM,SAAA,GAAA,KAAA,IAAA,KACd,UAAU,SAAM,SAAA,GAAA,KAAA,MAAA,KAChB,UAAU,YAAM,SAAA,GAAA,KAAA,KAAA,KAChB,UAAA,SAAqB,SAAA,GAQ5B,MAPE,MAAA,KAAO,EAAA,2DAGT,KAAA,MAAU,EAAU,WAClB,KAAA,QAAW,EAAU,+EAGnB,6JAwBF,EAAI,KAAA,qCAEE,sDAKF,GAAU,SAAA,WAmJN,GAAY,MACe,GAA3B,EAAA,OAAS,KAAO,GAChB,KAAG,+EAMP,GAAQ,EAAQ,MAAK,EAAS,IAAG,KAAA,4BAYnC,oDAAS,UAGH,GAAK,2IAOP,EAAK,CAEP,KAAA,EAAA,EAAS,EAAA,EAAA,OAAA,4DAKX,EAAA,EAAY,MAAA,KAAA,EAAA,KAAA,KAAA,IAAA,EAAA,EAAA,IAAA,uDAt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AM,EAAqB,GAAM,wBAGhD,KAAI,EAAA,OAAe,CAGnB,KAAI,sEAAA,EAAA,EAAS,EAAK,EAAK,OAAQ,EAAQ,IACrC,EAAO,IAAA,EAAA,GAAA,KAAA,EAAA,EAAA,EAAA,GAGT,IAAA,GAAO,EAAA,QAGT,OAAA,UAAY,EAAA,IAAA,MAAA,EAAsB,WAC5B,EAGE,KAGG,oBAAsB,SAAS,EAAA,YAG7B,YAAQ,CACjB,GAAA,GAAO,GAAQ,QACV,GAAA,MAAA,EAAA,cAAA,EAAA,WAAA,EAAA,WAAA,YAAA,EAAA,EAAA,GAAA,EAAA,EAAA,EAAA,YAAA,EAAA,EAAA,WACE,QAAS,SAAA,IAAA,EAAA,MAAA,gDAGX,GAAA,MAAA,SAAA,EAAA,+DAIH,GAAA,MAAA,SAGF,MAGQ,oBAAkB,SAAA,EAAA,MAC1B,YAEO,QAAP,GACK,GAAA,OAAA,YAAA,KAAA,EAAA,GACE,QAAA,SAAkB,IAAO,EAAS,MAAM,sEAG1C,GAAA,MAAA,SAAA,EAAA,KAAA,YAAA,KAAA,EAAA,2IAuBP,EAAI,SAAO,EAAO,WAAK,GAAW,EAAA,WAAA,EAAA,GAC9B","file":"date-parser.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.dateParser', [])\n\n.provider('$dateParser', function($localeProvider) {\n\n // define a custom ParseDate object to use instead of native Date\n // to avoid date values wrapping when setting date component values\n function ParseDate() {\n this.year = 1970;\n this.month = 0;\n this.day = 1;\n this.hours = 0;\n this.minutes = 0;\n this.seconds = 0;\n this.milliseconds = 0;\n }\n\n ParseDate.prototype.setMilliseconds = function(value) { this.milliseconds = value; };\n ParseDate.prototype.setSeconds = function(value) { this.seconds = value; };\n ParseDate.prototype.setMinutes = function(value) { this.minutes = value; };\n ParseDate.prototype.setHours = function(value) { this.hours = value; };\n ParseDate.prototype.getHours = function() { return this.hours; };\n ParseDate.prototype.setDate = function(value) { this.day = value; };\n ParseDate.prototype.setMonth = function(value) { this.month = value; };\n ParseDate.prototype.setFullYear = function(value) { this.year = value; };\n ParseDate.prototype.fromDate = function(value) {\n this.year = value.getFullYear();\n this.month = value.getMonth();\n this.day = value.getDate();\n this.hours = value.getHours();\n this.minutes = value.getMinutes();\n this.seconds = value.getSeconds();\n this.milliseconds = value.getMilliseconds();\n return this;\n };\n\n ParseDate.prototype.toDate = function() {\n return new Date(this.year, this.month, this.day, this.hours, this.minutes, this.seconds, this.milliseconds);\n };\n\n var proto = ParseDate.prototype;\n\n function noop() {\n }\n\n function isNumeric(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function indexOfCaseInsensitive(array, value) {\n var len = array.length, str=value.toString().toLowerCase();\n for (var i=0; i 12 when midnight changeover, but then cannot generate\n * midnight datetime, so jump to 1AM, otherwise reset.\n * @param date (Date) the date to check\n * @return (Date) the corrected date\n *\n * __ copied from jquery ui datepicker __\n */\n $dateParser.daylightSavingAdjust = function(date) {\n if (!date) {\n return null;\n }\n date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\n return date;\n };\n\n // Private functions\n\n function setMapForFormat(format) {\n var keys = Object.keys(setFnMap), i;\n var map = [], sortedMap = [];\n // Map to setFn\n var clonedFormat = format;\n for(i = 0; i < keys.length; i++) {\n if(format.split(keys[i]).length > 1) {\n var index = clonedFormat.search(keys[i]);\n format = format.split(keys[i]).join('');\n if(setFnMap[keys[i]]) {\n map[index] = setFnMap[keys[i]];\n }\n }\n }\n // Sort result map\n angular.forEach(map, function(v) {\n // conditional required since angular.forEach broke around v1.2.21\n // related pr: https://github.com/angular/angular.js/pull/8525\n if(v) sortedMap.push(v);\n });\n return sortedMap;\n }\n\n function escapeReservedSymbols(text) {\n return text.replace(/\\//g, '[\\\\/]').replace('/-/g', '[-]').replace(/\\./g, '[.]').replace(/\\\\s/g, '[\\\\s]');\n }\n\n function regExpForFormat(format) {\n var keys = Object.keys(regExpMap), i;\n\n var re = format;\n // Abstract replaces to avoid collisions\n for(i = 0; i < keys.length; i++) {\n re = re.split(keys[i]).join('${' + i + '}');\n }\n // Replace abstracted values\n for(i = 0; i < keys.length; i++) {\n re = re.split('${' + i + '}').join('(' + regExpMap[keys[i]] + ')');\n }\n format = escapeReservedSymbols(format);\n\n return new RegExp('^' + re + '$', ['i']);\n }\n\n $dateParser.init();\n return $dateParser;\n\n };\n\n return DateParserFactory;\n\n };\n\n});\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["helpers/date-parser.js"],"names":[],"mappings":"qBASI,OAAK,iDAEA,eAAM,kBAAA,mBAIN,iCAGP,KAAA,IAAU,EACV,KAAA,MAAU,EACV,KAAA,QAAU,EACV,KAAA,QAAU,EACV,KAAA,aAAoB,EA4BpB,QAAS,cAGD,GAAS,4DAMf,IAAA,GADE,GAAA,EAAW,OAAK,EAAA,EAAW,WAAA,cACrB,EAAA,EAAA,EAAA,EAAA,IACR,GAAA,EAAQ,GAAA,gBAAA,EAAA,MAAA,YAnCV,EAAU,UAAU,gBAAc,SAAS,GAAS,KAAK,aAAO,GAChE,EAAU,UAAU,WAAW,SAAS,GAAO,KAAA,QAAA,KACxC,UAAa,WAAA,SAAA,GAAA,KAAA,QAAA,KACb,UAAQ,SAAM,SAAA,GAAA,KAAA,MAAA,KACd,UAAY,SAAA,WAAA,MAAA,MAAA,SACZ,UAAQ,QAAM,SAAA,GAAA,KAAA,IAAA,KACd,UAAU,SAAM,SAAA,GAAA,KAAA,MAAA,KAChB,UAAU,YAAM,SAAA,GAAA,KAAA,KAAA,KAChB,UAAA,SAAqB,SAAA,GAQ5B,MAPE,MAAA,KAAO,EAAA,2DAGT,KAAA,MAAU,EAAU,WAClB,KAAA,QAAW,EAAU,+EAGnB,6JAwBF,EAAI,KAAA,qCAEE,sDAKF,GAAU,SAAA,WAmJN,GAAY,MACe,GAA3B,EAAA,OAAS,KAAO,GAChB,KAAG,+EAMP,GAAQ,EAAQ,MAAK,EAAS,IAAG,KAAA,4BAYnC,oD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,KAAc,MAGd,MAAS,SAAO,EAAA,EAAA,GAEpB,IAAW,EAAA,EAAa,iBAAe,IAAiB,GACxD,QAAQ,OAAO,KAAI,EAAQ,EAAiB,EAAA,GAAA,EAAA,aAC1C,GAAa,EAAM,EAAqB,GAAM,wBAGhD,KAAI,EAAA,OAAe,CAGnB,KAAI,sEAAA,EAAA,EAAS,EAAK,EAAK,OAAQ,EAAQ,IACrC,EAAO,IAAA,EAAA,GAAA,KAAA,EAAA,EAAA,EAAA,GAGT,IAAA,GAAO,EAAA,QAGT,OAAA,UAAY,EAAA,IAAA,MAAA,EAAsB,WAC5B,EAGE,KAGG,oBAAsB,SAAS,EAAA,YAG7B,YAAQ,CACjB,GAAA,GAAO,GAAQ,QACV,GAAA,MAAA,EAAA,cAAA,EAAA,WAAA,EAAA,WAAA,YAAA,EAAA,EAAA,GAAA,EAAA,EAAA,EAAA,YAAA,EAAA,EAAA,WACE,QAAS,SAAA,IAAA,EAAA,MAAA,gDAGX,GAAA,MAAA,SAAA,EAAA,+DAIH,GAAA,MAAA,SAGF,MAGQ,oBAAkB,SAAA,EAAA,MAC1B,YAEO,QAAP,GACK,GAAA,OAAA,YAAA,KAAA,EAAA,GACE,QAAA,SAAkB,IAAO,EAAS,MAAM,sEAG1C,GAAA,MAAA,SAAA,EAAA,KAAA,YAAA,KAAA,EAAA,2IAuBP,EAAI,SAAO,EAAO,WAAK,GAAW,EAAA,WAAA,EAAA,GAC9B","file":"date-parser.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.dateParser', [])\r\n\r\n.provider('$dateParser', function($localeProvider) {\r\n\r\n // define a custom ParseDate object to use instead of native Date\r\n // to avoid date values wrapping when setting date component values\r\n function ParseDate() {\r\n this.year = 1970;\r\n this.month = 0;\r\n this.day = 1;\r\n this.hours = 0;\r\n this.minutes = 0;\r\n this.seconds = 0;\r\n this.milliseconds = 0;\r\n }\r\n\r\n ParseDate.prototype.setMilliseconds = function(value) { this.milliseconds = value; };\r\n ParseDate.prototype.setSeconds = function(value) { this.seconds = value; };\r\n ParseDate.prototype.setMinutes = function(value) { this.minutes = value; };\r\n ParseDate.prototype.setHours = function(value) { this.hours = value; };\r\n ParseDate.prototype.getHours = function() { return this.hours; };\r\n ParseDate.prototype.setDate = function(value) { this.day = value; };\r\n ParseDate.prototype.setMonth = function(value) { this.month = value; };\r\n ParseDate.prototype.setFullYear = function(value) { this.year = value; };\r\n ParseDate.prototype.fromDate = function(value) {\r\n this.year = value.getFullYear();\r\n this.month = value.getMonth();\r\n this.day = value.getDate();\r\n this.hours = value.getHours();\r\n this.minutes = value.getMinutes();\r\n this.seconds = value.getSeconds();\r\n this.milliseconds = value.getMilliseconds();\r\n return this;\r\n };\r\n\r\n ParseDate.prototype.toDate = function() {\r\n return new Date(this.year, this.month, this.day, this.hours, this.minutes, this.seconds, this.milliseconds);\r\n };\r\n\r\n var proto = ParseDate.prototype;\r\n\r\n function noop() {\r\n }\r\n\r\n function isNumeric(n) {\r\n return !isNaN(parseFloat(n)) && isFinite(n);\r\n }\r\n\r\n function indexOfCaseInsensitive(array, value) {\r\n var len = array.length, str=value.toString().toLowerCase();\r\n for (var i=0; i 12 when midnight changeover, but then cannot generate\r\n * midnight datetime, so jump to 1AM, otherwise reset.\r\n * @param date (Date) the date to check\r\n * @return (Date) the corrected date\r\n *\r\n * __ copied from jquery ui datepicker __\r\n */\r\n $dateParser.daylightSavingAdjust = function(date) {\r\n if (!date) {\r\n return null;\r\n }\r\n date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\r\n return date;\r\n };\r\n\r\n // Private functions\r\n\r\n function setMapForFormat(format) {\r\n var keys = Object.keys(setFnMap), i;\r\n var map = [], sortedMap = [];\r\n // Map to setFn\r\n var clonedFormat = format;\r\n for(i = 0; i < keys.length; i++) {\r\n if(format.split(keys[i]).length > 1) {\r\n var index = clonedFormat.search(keys[i]);\r\n format = format.split(keys[i]).join('');\r\n if(setFnMap[keys[i]]) {\r\n map[index] = setFnMap[keys[i]];\r\n }\r\n }\r\n }\r\n // Sort result map\r\n angular.forEach(map, function(v) {\r\n // conditional required since angular.forEach broke around v1.2.21\r\n // related pr: https://github.com/angular/angular.js/pull/8525\r\n if(v) sortedMap.push(v);\r\n });\r\n return sortedMap;\r\n }\r\n\r\n function escapeReservedSymbols(text) {\r\n return text.replace(/\\//g, '[\\\\/]').replace('/-/g', '[-]').replace(/\\./g, '[.]').replace(/\\\\s/g, '[\\\\s]');\r\n }\r\n\r\n function regExpForFormat(format) {\r\n var keys = Object.keys(regExpMap), i;\r\n\r\n var re = format;\r\n // Abstract replaces to avoid collisions\r\n for(i = 0; i < keys.length; i++) {\r\n re = re.split(keys[i]).join('${' + i + '}');\r\n }\r\n // Replace abstracted values\r\n for(i = 0; i < keys.length; i++) {\r\n re = re.split('${' + i + '}').join('(' + regExpMap[keys[i]] + ')');\r\n }\r\n format = escapeReservedSymbols(format);\r\n\r\n return new RegExp('^' + re + '$', ['i']);\r\n }\r\n\r\n $dateParser.init();\r\n return $dateParser;\r\n\r\n };\r\n\r\n return DateParserFactory;\r\n\r\n };\r\n\r\n});\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/datepicker.js b/dist/modules/datepicker.js
index 8e7df83e5..2679425e2 100644
--- a/dist/modules/datepicker.js
+++ b/dist/modules/datepicker.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/datepicker.min.js b/dist/modules/datepicker.min.js
index 88d467544..df29ac861 100644
--- a/dist/modules/datepicker.min.js
+++ b/dist/modules/datepicker.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/datepicker.min.js.map b/dist/modules/datepicker.min.js.map
index 138500e0f..1b03e3ff8 100644
--- a/dist/modules/datepicker.min.js.map
+++ b/dist/modules/datepicker.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["datepicker/datepicker.js"],"names":[],"mappings":"qBASQ,OAAA,4IAKF,cAAS,cAET,GAAU,KAAA,UACV,UAAM,UACN,YAAO,qCAEP,SAAA,iCACA,QAAA,QACA,WAAA,EACA,UAAA,EACA,MAAA,EACA,MAAA,EAEA,WAAA,EACA,SAAA,OACA,WAAA,YACA,gBAAW,KACX,UAAU,KACV,YAAU,MACV,WAAW,OACX,iBAAS,YACT,gBAAW,OACX,cAAA,EACA,WAAU,EACV,SAAA,6BAGF,QAAK,cAEH,mBAAa,GACb,SAAI,mCACJ,UAAI,0CAGJ,MAAS,UAAA,YAAkB,aAAqB,OAAQ,iBAAA,kBAAA,WAAA,WAAA,SAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,oEAsJtD,QAAA,KACE,EAAG,GAAA,0CA7ID,EAAc,EAAA,MAClB,EAAY,EAAS,SACjB,EAAA,EAAW,MACf,GAAM,YAAgB,EAAA,WAAA,EAAA,qDAOtB,GAAM,MAAA,EAAU,YACd,UAAY,EAAO,iCAErB,IAAA,GAAM,EAAc,OAAS,EAAO,SAIlC,QAAY,SAAS,qFAOrB,EAAW,SAAO,EAAS,MAAO,GAAK,EAAY,OAAA,WAKnD,OAAmB,SAAA,4CAGrB,EAAY,MAAA,EACV,EAAQ,OAAA,KAAA,EAAqB,kBAM/B,EAAY,oBAAkB,SAAY,yBAExC,KAAI,GAAA,GAAQ,EAAA,EAAO,EAAA,KAAW,OAAA,EAAA,EAAa,IAC3C,QAAU,QAAA,EAAS,KAAM,GAAA,EAAA,mBAIrB,OAAS,SAAa,EAAA,WAEnB,OAAA,EAAA,cAAA,EAAA,WAAA,GAAA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ourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.datepicker', [\n 'mgcrea.ngStrap.helpers.dateParser',\n 'mgcrea.ngStrap.helpers.dateFormatter',\n 'mgcrea.ngStrap.tooltip'])\n\n .provider('$datepicker', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'datepicker',\n placement: 'bottom-left',\n template: 'datepicker/datepicker.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n // lang: $locale.id,\n useNative: false,\n dateType: 'date',\n dateFormat: 'shortDate',\n modelDateFormat: null,\n dayFormat: 'dd',\n monthFormat: 'MMM',\n yearFormat: 'yyyy',\n monthTitleFormat: 'MMMM yyyy',\n yearTitleFormat: 'yyyy',\n strictFormat: false,\n autoclose: false,\n minDate: -Infinity,\n maxDate: +Infinity,\n startView: 0,\n minView: 0,\n startWeek: 0,\n daysOfWeekDisabled: '',\n iconLeft: 'glyphicon glyphicon-chevron-left',\n iconRight: 'glyphicon glyphicon-chevron-right'\n };\n\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, datepickerViews, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var isTouch = ('createTouch' in $window.document) && isNative;\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\n\n function DatepickerFactory(element, controller, config) {\n\n var $datepicker = $tooltip(element, angular.extend({}, defaults, config));\n var parentScope = config.scope;\n var options = $datepicker.$options;\n var scope = $datepicker.$scope;\n if(options.startView) options.startView -= options.minView;\n\n // View vars\n\n var pickerViews = datepickerViews($datepicker);\n $datepicker.$views = pickerViews.views;\n var viewDate = pickerViews.viewDate;\n scope.$mode = options.startView;\n scope.$iconLeft = options.iconLeft;\n scope.$iconRight = options.iconRight;\n var $picker = $datepicker.$views[scope.$mode];\n\n // Scope methods\n\n scope.$select = function(date) {\n $datepicker.select(date);\n };\n scope.$selectPane = function(value) {\n $datepicker.$selectPane(value);\n };\n scope.$toggleMode = function() {\n $datepicker.setMode((scope.$mode + 1) % $datepicker.$views.length);\n };\n\n // Public methods\n\n $datepicker.update = function(date) {\n // console.warn('$datepicker.update() newValue=%o', date);\n if(angular.isDate(date) && !isNaN(date.getTime())) {\n $datepicker.$date = date;\n $picker.update.call($picker, date);\n }\n // Build only if pristine\n $datepicker.$build(true);\n };\n\n $datepicker.updateDisabledDates = function(dateRanges) {\n options.disabledDateRanges = dateRanges;\n for(var i = 0, l = scope.rows.length; i < l; i++) {\n angular.forEach(scope.rows[i], $datepicker.$setDisabledEl);\n }\n };\n\n $datepicker.select = function(date, keep) {\n // console.warn('$datepicker.select', date, scope.$mode);\n if(!angular.isDate(controller.$dateValue)) controller.$dateValue = new Date(date);\n if(!scope.$mode || keep) {\n controller.$setViewValue(angular.copy(date));\n controller.$render();\n if(options.autoclose && !keep) {\n $timeout(function() { $datepicker.hide(true); });\n }\n } else {\n angular.extend(viewDate, {year: date.getFullYear(), month: date.getMonth(), date: date.getDate()});\n $datepicker.setMode(scope.$mode - 1);\n $datepicker.$build();\n }\n };\n\n $datepicker.setMode = function(mode) {\n // console.warn('$datepicker.setMode', mode);\n scope.$mode = mode;\n $picker = $datepicker.$views[scope.$mode];\n $datepicker.$build();\n };\n\n // Protected methods\n\n $datepicker.$build = function(pristine) {\n // console.warn('$datepicker.$build() viewDate=%o', viewDate);\n if(pristine === true && $picker.built) return;\n if(pristine === false && !$picker.built) return;\n $picker.build.call($picker);\n };\n\n $datepicker.$updateSelected = function() {\n for(var i = 0, l = scope.rows.length; i < l; i++) {\n angular.forEach(scope.rows[i], updateSelected);\n }\n };\n\n $datepicker.$isSelected = function(date) {\n return $picker.isSelected(date);\n };\n\n $datepicker.$setDisabledEl = function(el) {\n el.disabled = $picker.isDisabled(el.date);\n };\n\n $datepicker.$selectPane = function(value) {\n var steps = $picker.steps;\n // set targetDate to first day of month to avoid problems with\n // date values rollover. This assumes the viewDate does not\n // depend on the day of the month \n var targetDate = new Date(Date.UTC(viewDate.year + ((steps.year || 0) * value), viewDate.month + ((steps.month || 0) * value), 1));\n angular.extend(viewDate, {year: targetDate.getUTCFullYear(), month: targetDate.getUTCMonth(), date: targetDate.getUTCDate()});\n $datepicker.$build();\n };\n\n $datepicker.$onMouseDown = function(evt) {\n // Prevent blur on mousedown on .dropdown-menu\n evt.preventDefault();\n evt.stopPropagation();\n // Emulate click for mobile devices\n if(isTouch) {\n var targetEl = angular.element(evt.target);\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\n targetEl = targetEl.parent();\n }\n targetEl.triggerHandler('click');\n }\n };\n\n $datepicker.$onKeyDown = function(evt) {\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n if(evt.keyCode === 13) {\n if(!scope.$mode) {\n return $datepicker.hide(true);\n } else {\n return scope.$apply(function() { $datepicker.setMode(scope.$mode - 1); });\n }\n }\n\n // Navigate with keyboard\n $picker.onKeyDown(evt);\n parentScope.$digest();\n };\n\n // Private\n\n function updateSelected(el) {\n el.selected = $datepicker.$isSelected(el.date);\n }\n\n function focusElement() {\n element[0].focus();\n }\n\n // Overrides\n\n var _init = $datepicker.init;\n $datepicker.init = function() {\n if(isNative && options.useNative) {\n element.prop('type', 'date');\n element.css('-webkit-appearance', 'textfield');\n return;\n } else if(isTouch) {\n element.prop('type', 'text');\n element.attr('readonly', 'true');\n element.on('click', focusElement);\n }\n _init();\n };\n\n var _destroy = $datepicker.destroy;\n $datepicker.destroy = function() {\n if(isNative && options.useNative) {\n element.off('click', focusElement);\n }\n _destroy();\n };\n\n var _show = $datepicker.show;\n $datepicker.show = function() {\n _show();\n // use timeout to hookup the events to prevent \n // event bubbling from being processed imediately. \n $timeout(function() {\n $datepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $datepicker.$onKeyDown);\n }\n }, 0, false);\n };\n\n var _hide = $datepicker.hide;\n $datepicker.hide = function(blur) {\n if(!$datepicker.$isShown) return;\n $datepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $datepicker.$onKeyDown);\n }\n _hide(blur);\n };\n\n return $datepicker;\n\n }\n\n DatepickerFactory.defaults = defaults;\n return DatepickerFactory;\n\n };\n\n })\n\n .directive('bsDatepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $datepicker) {\n\n var defaults = $datepicker.defaults;\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope, controller: controller};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'dateType', 'dateFormat', 'modelDateFormat', 'dayFormat', 'strictFormat', 'startWeek', 'startDate', 'useNative', 'lang', 'startView', 'minView', 'iconLeft', 'iconRight', 'daysOfWeekDisabled'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!datepicker || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(datepicker),?/i);\n newValue === true ? datepicker.show() : datepicker.hide();\n });\n\n // Initialize datepicker\n var datepicker = $datepicker(element, controller, options);\n options = datepicker.$options;\n // Set expected iOS format\n if(isNative && options.useNative) options.dateFormat = 'yyyy-MM-dd';\n\n var lang = options.lang;\n\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n \n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\n\n // Observe attributes for changes\n angular.forEach(['minDate', 'maxDate'], function(key) {\n // console.warn('attr.$observe(%s)', key, attr[key]);\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\n // console.warn('attr.$observe(%s)=%o', key, newValue);\n datepicker.$options[key] = dateParser.getDateForAttribute(key, newValue);\n // Build only if dirty\n !isNaN(datepicker.$options[key]) && datepicker.$build(false);\n validateAgainstMinMaxDate(controller.$dateValue);\n });\n });\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n datepicker.update(controller.$dateValue);\n }, true);\n\n // Normalize undefined/null/empty array,\n // so that we don't treat changing from undefined->null as a change.\n function normalizeDateRanges(ranges) {\n if (!ranges || !ranges.length) return null;\n return ranges;\n }\n\n if (angular.isDefined(attr.disabledDates)) {\n scope.$watch(attr.disabledDates, function(disabledRanges, previousValue) {\n disabledRanges = normalizeDateRanges(disabledRanges);\n previousValue = normalizeDateRanges(previousValue);\n\n if (disabledRanges) {\n datepicker.updateDisabledDates(disabledRanges);\n }\n });\n }\n\n function validateAgainstMinMaxDate(parsedDate) {\n if (!angular.isDate(parsedDate)) return;\n var isMinValid = isNaN(datepicker.$options.minDate) || parsedDate.getTime() >= datepicker.$options.minDate;\n var isMaxValid = isNaN(datepicker.$options.maxDate) || parsedDate.getTime() <= datepicker.$options.maxDate;\n var isValid = isMinValid && isMaxValid;\n controller.$setValidity('date', isValid);\n controller.$setValidity('min', isMinValid);\n controller.$setValidity('max', isMaxValid);\n // Only update the model when we have a valid date\n if(isValid) controller.$dateValue = parsedDate;\n }\n\n // viewValue -> $parsers -> modelValue\n controller.$parsers.unshift(function(viewValue) {\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\n // Null values should correctly reset the model value & validity\n if(!viewValue) {\n controller.$setValidity('date', true);\n // BREAKING CHANGE:\n // return null (not undefined) when input value is empty, so angularjs 1.3 \n // ngModelController can go ahead and run validators, like ngRequired\n return null;\n }\n var parsedDate = dateParser.parse(viewValue, controller.$dateValue);\n if(!parsedDate || isNaN(parsedDate.getTime())) {\n controller.$setValidity('date', false);\n // return undefined, causes ngModelController to \n // invalidate model value \n return;\n } else {\n validateAgainstMinMaxDate(parsedDate);\n }\n if(options.dateType === 'string') {\n return formatDate(parsedDate, options.modelDateFormat || options.dateFormat);\n } else if(options.dateType === 'number') {\n return controller.$dateValue.getTime();\n } else if(options.dateType === 'unix') {\n return controller.$dateValue.getTime() / 1000;\n } else if(options.dateType === 'iso') {\n return controller.$dateValue.toISOString();\n } else {\n return new Date(controller.$dateValue);\n }\n });\n\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n var date;\n if(angular.isUndefined(modelValue) || modelValue === null) {\n date = NaN;\n } else if(angular.isDate(modelValue)) {\n date = modelValue;\n } else if(options.dateType === 'string') {\n date = dateParser.parse(modelValue, null, options.modelDateFormat);\n } else if(options.dateType === 'unix') {\n date = new Date(modelValue * 1000);\n } else {\n date = new Date(modelValue);\n }\n // Setup default value?\n // if(isNaN(date.getTime())) {\n // var today = new Date();\n // date = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);\n // }\n controller.$dateValue = date;\n return getDateFormattedString();\n });\n\n // viewValue -> element\n controller.$render = function() {\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\n element.val(getDateFormattedString());\n };\n\n function getDateFormattedString() {\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.dateFormat);\n }\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if(datepicker) datepicker.destroy();\n options = null;\n datepicker = null;\n });\n\n }\n };\n\n })\n\n .provider('datepickerViews', function() {\n\n var defaults = this.defaults = {\n dayFormat: 'dd',\n daySplit: 7\n };\n\n // Split array into smaller arrays\n function split(arr, size) {\n var arrays = [];\n while(arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n }\n\n // Modulus operator\n function mod(n, m) {\n return ((n % m) + m) % m;\n }\n\n this.$get = function($dateFormatter, $dateParser, $sce) {\n\n return function(picker) {\n\n var scope = picker.$scope;\n var options = picker.$options;\n\n var lang = options.lang;\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\n\n var weekDaysMin = $dateFormatter.weekdaysShort(lang);\n var weekDaysLabels = weekDaysMin.slice(options.startWeek).concat(weekDaysMin.slice(0, options.startWeek));\n var weekDaysLabelsHtml = $sce.trustAsHtml('' + weekDaysLabels.join(' ') + ' ');\n\n var startDate = picker.$date || (options.startDate ? dateParser.getDateForAttribute('startDate', options.startDate) : new Date());\n var viewDate = {year: startDate.getFullYear(), month: startDate.getMonth(), date: startDate.getDate()};\n var timezoneOffset = startDate.getTimezoneOffset() * 6e4;\n\n var views = [{\n format: options.dayFormat,\n split: 7,\n steps: { month: 1 },\n update: function(date, force) {\n if(!this.built || force || date.getFullYear() !== viewDate.year || date.getMonth() !== viewDate.month) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$build();\n } else if(date.getDate() !== viewDate.date) {\n viewDate.date = picker.$date.getDate();\n picker.$updateSelected();\n }\n },\n build: function() {\n var firstDayOfMonth = new Date(viewDate.year, viewDate.month, 1), firstDayOfMonthOffset = firstDayOfMonth.getTimezoneOffset();\n var firstDate = new Date(+firstDayOfMonth - mod(firstDayOfMonth.getDay() - options.startWeek, 7) * 864e5), firstDateOffset = firstDate.getTimezoneOffset();\n var today = new Date().toDateString();\n // Handle daylight time switch\n if(firstDateOffset !== firstDayOfMonthOffset) firstDate = new Date(+firstDate + (firstDateOffset - firstDayOfMonthOffset) * 60e3);\n var days = [], day;\n for(var i = 0; i < 42; i++) { // < 7 * 6\n day = dateParser.daylightSavingAdjust(new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate() + i));\n days.push({date: day, isToday: day.toDateString() === today, label: formatDate(day, this.format), selected: picker.$date && this.isSelected(day), muted: day.getMonth() !== viewDate.month, disabled: this.isDisabled(day)});\n }\n scope.title = formatDate(firstDayOfMonth, options.monthTitleFormat);\n scope.showLabels = true;\n scope.labels = weekDaysLabelsHtml;\n scope.rows = split(days, this.split);\n this.built = true;\n },\n isSelected: function(date) {\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth() && date.getDate() === picker.$date.getDate();\n },\n isDisabled: function(date) {\n var time = date.getTime();\n\n // Disabled because of min/max date.\n if (time < options.minDate || time > options.maxDate) return true;\n\n // Disabled due to being a disabled day of the week\n if (options.daysOfWeekDisabled.indexOf(date.getDay()) !== -1) return true;\n\n // Disabled because of disabled date range.\n if (options.disabledDateRanges) {\n for (var i = 0; i < options.disabledDateRanges.length; i++) {\n if (time >= options.disabledDateRanges[i].start && time <= options.disabledDateRanges[i].end) {\n return true;\n }\n }\n }\n\n return false;\n },\n onKeyDown: function(evt) {\n if (!picker.$date) {\n return;\n }\n var actualTime = picker.$date.getTime();\n var newDate;\n\n if(evt.keyCode === 37) newDate = new Date(actualTime - 1 * 864e5);\n else if(evt.keyCode === 38) newDate = new Date(actualTime - 7 * 864e5);\n else if(evt.keyCode === 39) newDate = new Date(actualTime + 1 * 864e5);\n else if(evt.keyCode === 40) newDate = new Date(actualTime + 7 * 864e5);\n\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\n }\n }, {\n name: 'month',\n format: options.monthFormat,\n split: 4,\n steps: { year: 1 },\n update: function(date, force) {\n if(!this.built || date.getFullYear() !== viewDate.year) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$build();\n } else if(date.getMonth() !== viewDate.month) {\n angular.extend(viewDate, {month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$updateSelected();\n }\n },\n build: function() {\n var firstMonth = new Date(viewDate.year, 0, 1);\n var months = [], month;\n for (var i = 0; i < 12; i++) {\n month = new Date(viewDate.year, i, 1);\n months.push({date: month, label: formatDate(month, this.format), selected: picker.$isSelected(month), disabled: this.isDisabled(month)});\n }\n scope.title = formatDate(month, options.yearTitleFormat);\n scope.showLabels = false;\n scope.rows = split(months, this.split);\n this.built = true;\n },\n isSelected: function(date) {\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth();\n },\n isDisabled: function(date) {\n var lastDate = +new Date(date.getFullYear(), date.getMonth() + 1, 0);\n return lastDate < options.minDate || date.getTime() > options.maxDate;\n },\n onKeyDown: function(evt) {\n if (!picker.$date) {\n return;\n }\n var actualMonth = picker.$date.getMonth();\n var newDate = new Date(picker.$date);\n\n if(evt.keyCode === 37) newDate.setMonth(actualMonth - 1);\n else if(evt.keyCode === 38) newDate.setMonth(actualMonth - 4);\n else if(evt.keyCode === 39) newDate.setMonth(actualMonth + 1);\n else if(evt.keyCode === 40) newDate.setMonth(actualMonth + 4);\n\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\n }\n }, {\n name: 'year',\n format: options.yearFormat,\n split: 4,\n steps: { year: 12 },\n update: function(date, force) {\n if(!this.built || force || parseInt(date.getFullYear()/20, 10) !== parseInt(viewDate.year/20, 10)) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$build();\n } else if(date.getFullYear() !== viewDate.year) {\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\n picker.$updateSelected();\n }\n },\n build: function() {\n var firstYear = viewDate.year - viewDate.year % (this.split * 3);\n var years = [], year;\n for (var i = 0; i < 12; i++) {\n year = new Date(firstYear + i, 0, 1);\n years.push({date: year, label: formatDate(year, this.format), selected: picker.$isSelected(year), disabled: this.isDisabled(year)});\n }\n scope.title = years[0].label + '-' + years[years.length - 1].label;\n scope.showLabels = false;\n scope.rows = split(years, this.split);\n this.built = true;\n },\n isSelected: function(date) {\n return picker.$date && date.getFullYear() === picker.$date.getFullYear();\n },\n isDisabled: function(date) {\n var lastDate = +new Date(date.getFullYear() + 1, 0, 0);\n return lastDate < options.minDate || date.getTime() > options.maxDate;\n },\n onKeyDown: function(evt) {\n if (!picker.$date) {\n return;\n }\n var actualYear = picker.$date.getFullYear(),\n newDate = new Date(picker.$date);\n\n if(evt.keyCode === 37) newDate.setYear(actualYear - 1);\n else if(evt.keyCode === 38) newDate.setYear(actualYear - 4);\n else if(evt.keyCode === 39) newDate.setYear(actualYear + 1);\n else if(evt.keyCode === 40) newDate.setYear(actualYear + 4);\n\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\n }\n }];\n\n return {\n views: options.minView ? Array.prototype.slice.call(views, options.minView) : views,\n viewDate: viewDate\n };\n\n };\n\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["datepicker/datepicker.js"],"names":[],"mappings":"qBASQ,OAAA,4IAKF,cAAS,cAET,GAAU,KAAA,UACV,UAAM,UACN,YAAO,qCAEP,SAAA,iCACA,QAAA,QACA,WAAA,EACA,UAAA,EACA,MAAA,EACA,MAAA,EAEA,WAAA,EACA,SAAA,OACA,WAAA,YACA,gBAAW,KACX,UAAU,KACV,YAAU,MACV,WAAW,OACX,iBAAS,YACT,gBAAW,OACX,cAAA,EACA,WAAU,EACV,SAAA,6BAGF,QAAK,cAEH,mBAAa,GACb,SAAI,mCACJ,UAAI,0CAGJ,MAAS,UAAA,YAAkB,aAAqB,OAAQ,iBAAA,kBAAA,WAAA,WAAA,SAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,oEAsJtD,QAAA,KACE,EAAG,GAAA,0CA7ID,EAAc,EAAA,MAClB,EAAY,EAAS,SACjB,EAAA,EAAW,MACf,GAAM,YAAgB,EAAA,WAAA,EAAA,qDAOtB,GAAM,MAAA,EAAU,YACd,UAAY,EAAO,iCAErB,IAAA,GAAM,EAAc,OAAS,EAAO,SAIlC,QAAY,SAAS,qFAOrB,EAAW,SAAO,EAAS,MAAO,GAAK,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AA,EAAA,MAAA,sCAGnB,GAAI,IAAA,GAAa,MAAO,EAAM,cAAA,EAAA,EAAA,SAC1B,GAAc,EAAK,SAAO,EAAA,UAAA,EAAA,mBAEvB,SAAA,MACF,EAAO,mCAIR,EAAM,GAAA,MAAW,EAAA,mEAIpB,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,GACoB,KAAlB,EAAQ,SAAgB,EAAA,QAAgB,EAAY,4GAQhE,SAAA","file":"datepicker.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.datepicker', [\r\n 'mgcrea.ngStrap.helpers.dateParser',\r\n 'mgcrea.ngStrap.helpers.dateFormatter',\r\n 'mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$datepicker', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'datepicker',\r\n placement: 'bottom-left',\r\n template: 'datepicker/datepicker.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n // lang: $locale.id,\r\n useNative: false,\r\n dateType: 'date',\r\n dateFormat: 'shortDate',\r\n modelDateFormat: null,\r\n dayFormat: 'dd',\r\n monthFormat: 'MMM',\r\n yearFormat: 'yyyy',\r\n monthTitleFormat: 'MMMM yyyy',\r\n yearTitleFormat: 'yyyy',\r\n strictFormat: false,\r\n autoclose: false,\r\n minDate: -Infinity,\r\n maxDate: +Infinity,\r\n startView: 0,\r\n minView: 0,\r\n startWeek: 0,\r\n daysOfWeekDisabled: '',\r\n iconLeft: 'glyphicon glyphicon-chevron-left',\r\n iconRight: 'glyphicon glyphicon-chevron-right'\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, datepickerViews, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var isTouch = ('createTouch' in $window.document) && isNative;\r\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\r\n\r\n function DatepickerFactory(element, controller, config) {\r\n\r\n var $datepicker = $tooltip(element, angular.extend({}, defaults, config));\r\n var parentScope = config.scope;\r\n var options = $datepicker.$options;\r\n var scope = $datepicker.$scope;\r\n if(options.startView) options.startView -= options.minView;\r\n\r\n // View vars\r\n\r\n var pickerViews = datepickerViews($datepicker);\r\n $datepicker.$views = pickerViews.views;\r\n var viewDate = pickerViews.viewDate;\r\n scope.$mode = options.startView;\r\n scope.$iconLeft = options.iconLeft;\r\n scope.$iconRight = options.iconRight;\r\n var $picker = $datepicker.$views[scope.$mode];\r\n\r\n // Scope methods\r\n\r\n scope.$select = function(date) {\r\n $datepicker.select(date);\r\n };\r\n scope.$selectPane = function(value) {\r\n $datepicker.$selectPane(value);\r\n };\r\n scope.$toggleMode = function() {\r\n $datepicker.setMode((scope.$mode + 1) % $datepicker.$views.length);\r\n };\r\n\r\n // Public methods\r\n\r\n $datepicker.update = function(date) {\r\n // console.warn('$datepicker.update() newValue=%o', date);\r\n if(angular.isDate(date) && !isNaN(date.getTime())) {\r\n $datepicker.$date = date;\r\n $picker.update.call($picker, date);\r\n }\r\n // Build only if pristine\r\n $datepicker.$build(true);\r\n };\r\n\r\n $datepicker.updateDisabledDates = function(dateRanges) {\r\n options.disabledDateRanges = dateRanges;\r\n for(var i = 0, l = scope.rows.length; i < l; i++) {\r\n angular.forEach(scope.rows[i], $datepicker.$setDisabledEl);\r\n }\r\n };\r\n\r\n $datepicker.select = function(date, keep) {\r\n // console.warn('$datepicker.select', date, scope.$mode);\r\n if(!angular.isDate(controller.$dateValue)) controller.$dateValue = new Date(date);\r\n if(!scope.$mode || keep) {\r\n controller.$setViewValue(angular.copy(date));\r\n controller.$render();\r\n if(options.autoclose && !keep) {\r\n $timeout(function() { $datepicker.hide(true); });\r\n }\r\n } else {\r\n angular.extend(viewDate, {year: date.getFullYear(), month: date.getMonth(), date: date.getDate()});\r\n $datepicker.setMode(scope.$mode - 1);\r\n $datepicker.$build();\r\n }\r\n };\r\n\r\n $datepicker.setMode = function(mode) {\r\n // console.warn('$datepicker.setMode', mode);\r\n scope.$mode = mode;\r\n $picker = $datepicker.$views[scope.$mode];\r\n $datepicker.$build();\r\n };\r\n\r\n // Protected methods\r\n\r\n $datepicker.$build = function(pristine) {\r\n // console.warn('$datepicker.$build() viewDate=%o', viewDate);\r\n if(pristine === true && $picker.built) return;\r\n if(pristine === false && !$picker.built) return;\r\n $picker.build.call($picker);\r\n };\r\n\r\n $datepicker.$updateSelected = function() {\r\n for(var i = 0, l = scope.rows.length; i < l; i++) {\r\n angular.forEach(scope.rows[i], updateSelected);\r\n }\r\n };\r\n\r\n $datepicker.$isSelected = function(date) {\r\n return $picker.isSelected(date);\r\n };\r\n\r\n $datepicker.$setDisabledEl = function(el) {\r\n el.disabled = $picker.isDisabled(el.date);\r\n };\r\n\r\n $datepicker.$selectPane = function(value) {\r\n var steps = $picker.steps;\r\n // set targetDate to first day of month to avoid problems with\r\n // date values rollover. This assumes the viewDate does not\r\n // depend on the day of the month \r\n var targetDate = new Date(Date.UTC(viewDate.year + ((steps.year || 0) * value), viewDate.month + ((steps.month || 0) * value), 1));\r\n angular.extend(viewDate, {year: targetDate.getUTCFullYear(), month: targetDate.getUTCMonth(), date: targetDate.getUTCDate()});\r\n $datepicker.$build();\r\n };\r\n\r\n $datepicker.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown on .dropdown-menu\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n // Emulate click for mobile devices\r\n if(isTouch) {\r\n var targetEl = angular.element(evt.target);\r\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\r\n targetEl = targetEl.parent();\r\n }\r\n targetEl.triggerHandler('click');\r\n }\r\n };\r\n\r\n $datepicker.$onKeyDown = function(evt) {\r\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n if(evt.keyCode === 13) {\r\n if(!scope.$mode) {\r\n return $datepicker.hide(true);\r\n } else {\r\n return scope.$apply(function() { $datepicker.setMode(scope.$mode - 1); });\r\n }\r\n }\r\n\r\n // Navigate with keyboard\r\n $picker.onKeyDown(evt);\r\n parentScope.$digest();\r\n };\r\n\r\n // Private\r\n\r\n function updateSelected(el) {\r\n el.selected = $datepicker.$isSelected(el.date);\r\n }\r\n\r\n function focusElement() {\r\n element[0].focus();\r\n }\r\n\r\n // Overrides\r\n\r\n var _init = $datepicker.init;\r\n $datepicker.init = function() {\r\n if(isNative && options.useNative) {\r\n element.prop('type', 'date');\r\n element.css('-webkit-appearance', 'textfield');\r\n return;\r\n } else if(isTouch) {\r\n element.prop('type', 'text');\r\n element.attr('readonly', 'true');\r\n element.on('click', focusElement);\r\n }\r\n _init();\r\n };\r\n\r\n var _destroy = $datepicker.destroy;\r\n $datepicker.destroy = function() {\r\n if(isNative && options.useNative) {\r\n element.off('click', focusElement);\r\n }\r\n _destroy();\r\n };\r\n\r\n var _show = $datepicker.show;\r\n $datepicker.show = function() {\r\n _show();\r\n // use timeout to hookup the events to prevent \r\n // event bubbling from being processed imediately. \r\n $timeout(function() {\r\n $datepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $datepicker.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var _hide = $datepicker.hide;\r\n $datepicker.hide = function(blur) {\r\n if(!$datepicker.$isShown) return;\r\n $datepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $datepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $datepicker.$onKeyDown);\r\n }\r\n _hide(blur);\r\n };\r\n\r\n return $datepicker;\r\n\r\n }\r\n\r\n DatepickerFactory.defaults = defaults;\r\n return DatepickerFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsDatepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $datepicker) {\r\n\r\n var defaults = $datepicker.defaults;\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope, controller: controller};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'dateType', 'dateFormat', 'modelDateFormat', 'dayFormat', 'strictFormat', 'startWeek', 'startDate', 'useNative', 'lang', 'startView', 'minView', 'iconLeft', 'iconRight', 'daysOfWeekDisabled'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!datepicker || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(datepicker),?/i);\r\n newValue === true ? datepicker.show() : datepicker.hide();\r\n });\r\n\r\n // Initialize datepicker\r\n var datepicker = $datepicker(element, controller, options);\r\n options = datepicker.$options;\r\n // Set expected iOS format\r\n if(isNative && options.useNative) options.dateFormat = 'yyyy-MM-dd';\r\n\r\n var lang = options.lang;\r\n\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n \r\n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\r\n\r\n // Observe attributes for changes\r\n angular.forEach(['minDate', 'maxDate'], function(key) {\r\n // console.warn('attr.$observe(%s)', key, attr[key]);\r\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\r\n // console.warn('attr.$observe(%s)=%o', key, newValue);\r\n datepicker.$options[key] = dateParser.getDateForAttribute(key, newValue);\r\n // Build only if dirty\r\n !isNaN(datepicker.$options[key]) && datepicker.$build(false);\r\n validateAgainstMinMaxDate(controller.$dateValue);\r\n });\r\n });\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n datepicker.update(controller.$dateValue);\r\n }, true);\r\n\r\n // Normalize undefined/null/empty array,\r\n // so that we don't treat changing from undefined->null as a change.\r\n function normalizeDateRanges(ranges) {\r\n if (!ranges || !ranges.length) return null;\r\n return ranges;\r\n }\r\n\r\n if (angular.isDefined(attr.disabledDates)) {\r\n scope.$watch(attr.disabledDates, function(disabledRanges, previousValue) {\r\n disabledRanges = normalizeDateRanges(disabledRanges);\r\n previousValue = normalizeDateRanges(previousValue);\r\n\r\n if (disabledRanges) {\r\n datepicker.updateDisabledDates(disabledRanges);\r\n }\r\n });\r\n }\r\n\r\n function validateAgainstMinMaxDate(parsedDate) {\r\n if (!angular.isDate(parsedDate)) return;\r\n var isMinValid = isNaN(datepicker.$options.minDate) || parsedDate.getTime() >= datepicker.$options.minDate;\r\n var isMaxValid = isNaN(datepicker.$options.maxDate) || parsedDate.getTime() <= datepicker.$options.maxDate;\r\n var isValid = isMinValid && isMaxValid;\r\n controller.$setValidity('date', isValid);\r\n controller.$setValidity('min', isMinValid);\r\n controller.$setValidity('max', isMaxValid);\r\n // Only update the model when we have a valid date\r\n if(isValid) controller.$dateValue = parsedDate;\r\n }\r\n\r\n // viewValue -> $parsers -> modelValue\r\n controller.$parsers.unshift(function(viewValue) {\r\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\r\n // Null values should correctly reset the model value & validity\r\n if(!viewValue) {\r\n controller.$setValidity('date', true);\r\n // BREAKING CHANGE:\r\n // return null (not undefined) when input value is empty, so angularjs 1.3 \r\n // ngModelController can go ahead and run validators, like ngRequired\r\n return null;\r\n }\r\n var parsedDate = dateParser.parse(viewValue, controller.$dateValue);\r\n if(!parsedDate || isNaN(parsedDate.getTime())) {\r\n controller.$setValidity('date', false);\r\n // return undefined, causes ngModelController to \r\n // invalidate model value \r\n return;\r\n } else {\r\n validateAgainstMinMaxDate(parsedDate);\r\n }\r\n if(options.dateType === 'string') {\r\n return formatDate(parsedDate, options.modelDateFormat || options.dateFormat);\r\n } else if(options.dateType === 'number') {\r\n return controller.$dateValue.getTime();\r\n } else if(options.dateType === 'unix') {\r\n return controller.$dateValue.getTime() / 1000;\r\n } else if(options.dateType === 'iso') {\r\n return controller.$dateValue.toISOString();\r\n } else {\r\n return new Date(controller.$dateValue);\r\n }\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n var date;\r\n if(angular.isUndefined(modelValue) || modelValue === null) {\r\n date = NaN;\r\n } else if(angular.isDate(modelValue)) {\r\n date = modelValue;\r\n } else if(options.dateType === 'string') {\r\n date = dateParser.parse(modelValue, null, options.modelDateFormat);\r\n } else if(options.dateType === 'unix') {\r\n date = new Date(modelValue * 1000);\r\n } else {\r\n date = new Date(modelValue);\r\n }\r\n // Setup default value?\r\n // if(isNaN(date.getTime())) {\r\n // var today = new Date();\r\n // date = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);\r\n // }\r\n controller.$dateValue = date;\r\n return getDateFormattedString();\r\n });\r\n\r\n // viewValue -> element\r\n controller.$render = function() {\r\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\r\n element.val(getDateFormattedString());\r\n };\r\n\r\n function getDateFormattedString() {\r\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.dateFormat);\r\n }\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if(datepicker) datepicker.destroy();\r\n options = null;\r\n datepicker = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n .provider('datepickerViews', function() {\r\n\r\n var defaults = this.defaults = {\r\n dayFormat: 'dd',\r\n daySplit: 7\r\n };\r\n\r\n // Split array into smaller arrays\r\n function split(arr, size) {\r\n var arrays = [];\r\n while(arr.length > 0) {\r\n arrays.push(arr.splice(0, size));\r\n }\r\n return arrays;\r\n }\r\n\r\n // Modulus operator\r\n function mod(n, m) {\r\n return ((n % m) + m) % m;\r\n }\r\n\r\n this.$get = function($dateFormatter, $dateParser, $sce) {\r\n\r\n return function(picker) {\r\n\r\n var scope = picker.$scope;\r\n var options = picker.$options;\r\n\r\n var lang = options.lang;\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n var dateParser = $dateParser({format: options.dateFormat, lang: lang, strict: options.strictFormat});\r\n\r\n var weekDaysMin = $dateFormatter.weekdaysShort(lang);\r\n var weekDaysLabels = weekDaysMin.slice(options.startWeek).concat(weekDaysMin.slice(0, options.startWeek));\r\n var weekDaysLabelsHtml = $sce.trustAsHtml('' + weekDaysLabels.join(' ') + ' ');\r\n\r\n var startDate = picker.$date || (options.startDate ? dateParser.getDateForAttribute('startDate', options.startDate) : new Date());\r\n var viewDate = {year: startDate.getFullYear(), month: startDate.getMonth(), date: startDate.getDate()};\r\n var timezoneOffset = startDate.getTimezoneOffset() * 6e4;\r\n\r\n var views = [{\r\n format: options.dayFormat,\r\n split: 7,\r\n steps: { month: 1 },\r\n update: function(date, force) {\r\n if(!this.built || force || date.getFullYear() !== viewDate.year || date.getMonth() !== viewDate.month) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$build();\r\n } else if(date.getDate() !== viewDate.date) {\r\n viewDate.date = picker.$date.getDate();\r\n picker.$updateSelected();\r\n }\r\n },\r\n build: function() {\r\n var firstDayOfMonth = new Date(viewDate.year, viewDate.month, 1), firstDayOfMonthOffset = firstDayOfMonth.getTimezoneOffset();\r\n var firstDate = new Date(+firstDayOfMonth - mod(firstDayOfMonth.getDay() - options.startWeek, 7) * 864e5), firstDateOffset = firstDate.getTimezoneOffset();\r\n var today = new Date().toDateString();\r\n // Handle daylight time switch\r\n if(firstDateOffset !== firstDayOfMonthOffset) firstDate = new Date(+firstDate + (firstDateOffset - firstDayOfMonthOffset) * 60e3);\r\n var days = [], day;\r\n for(var i = 0; i < 42; i++) { // < 7 * 6\r\n day = dateParser.daylightSavingAdjust(new Date(firstDate.getFullYear(), firstDate.getMonth(), firstDate.getDate() + i));\r\n days.push({date: day, isToday: day.toDateString() === today, label: formatDate(day, this.format), selected: picker.$date && this.isSelected(day), muted: day.getMonth() !== viewDate.month, disabled: this.isDisabled(day)});\r\n }\r\n scope.title = formatDate(firstDayOfMonth, options.monthTitleFormat);\r\n scope.showLabels = true;\r\n scope.labels = weekDaysLabelsHtml;\r\n scope.rows = split(days, this.split);\r\n this.built = true;\r\n },\r\n isSelected: function(date) {\r\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth() && date.getDate() === picker.$date.getDate();\r\n },\r\n isDisabled: function(date) {\r\n var time = date.getTime();\r\n\r\n // Disabled because of min/max date.\r\n if (time < options.minDate || time > options.maxDate) return true;\r\n\r\n // Disabled due to being a disabled day of the week\r\n if (options.daysOfWeekDisabled.indexOf(date.getDay()) !== -1) return true;\r\n\r\n // Disabled because of disabled date range.\r\n if (options.disabledDateRanges) {\r\n for (var i = 0; i < options.disabledDateRanges.length; i++) {\r\n if (time >= options.disabledDateRanges[i].start && time <= options.disabledDateRanges[i].end) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n },\r\n onKeyDown: function(evt) {\r\n if (!picker.$date) {\r\n return;\r\n }\r\n var actualTime = picker.$date.getTime();\r\n var newDate;\r\n\r\n if(evt.keyCode === 37) newDate = new Date(actualTime - 1 * 864e5);\r\n else if(evt.keyCode === 38) newDate = new Date(actualTime - 7 * 864e5);\r\n else if(evt.keyCode === 39) newDate = new Date(actualTime + 1 * 864e5);\r\n else if(evt.keyCode === 40) newDate = new Date(actualTime + 7 * 864e5);\r\n\r\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\r\n }\r\n }, {\r\n name: 'month',\r\n format: options.monthFormat,\r\n split: 4,\r\n steps: { year: 1 },\r\n update: function(date, force) {\r\n if(!this.built || date.getFullYear() !== viewDate.year) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$build();\r\n } else if(date.getMonth() !== viewDate.month) {\r\n angular.extend(viewDate, {month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$updateSelected();\r\n }\r\n },\r\n build: function() {\r\n var firstMonth = new Date(viewDate.year, 0, 1);\r\n var months = [], month;\r\n for (var i = 0; i < 12; i++) {\r\n month = new Date(viewDate.year, i, 1);\r\n months.push({date: month, label: formatDate(month, this.format), selected: picker.$isSelected(month), disabled: this.isDisabled(month)});\r\n }\r\n scope.title = formatDate(month, options.yearTitleFormat);\r\n scope.showLabels = false;\r\n scope.rows = split(months, this.split);\r\n this.built = true;\r\n },\r\n isSelected: function(date) {\r\n return picker.$date && date.getFullYear() === picker.$date.getFullYear() && date.getMonth() === picker.$date.getMonth();\r\n },\r\n isDisabled: function(date) {\r\n var lastDate = +new Date(date.getFullYear(), date.getMonth() + 1, 0);\r\n return lastDate < options.minDate || date.getTime() > options.maxDate;\r\n },\r\n onKeyDown: function(evt) {\r\n if (!picker.$date) {\r\n return;\r\n }\r\n var actualMonth = picker.$date.getMonth();\r\n var newDate = new Date(picker.$date);\r\n\r\n if(evt.keyCode === 37) newDate.setMonth(actualMonth - 1);\r\n else if(evt.keyCode === 38) newDate.setMonth(actualMonth - 4);\r\n else if(evt.keyCode === 39) newDate.setMonth(actualMonth + 1);\r\n else if(evt.keyCode === 40) newDate.setMonth(actualMonth + 4);\r\n\r\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\r\n }\r\n }, {\r\n name: 'year',\r\n format: options.yearFormat,\r\n split: 4,\r\n steps: { year: 12 },\r\n update: function(date, force) {\r\n if(!this.built || force || parseInt(date.getFullYear()/20, 10) !== parseInt(viewDate.year/20, 10)) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$build();\r\n } else if(date.getFullYear() !== viewDate.year) {\r\n angular.extend(viewDate, {year: picker.$date.getFullYear(), month: picker.$date.getMonth(), date: picker.$date.getDate()});\r\n picker.$updateSelected();\r\n }\r\n },\r\n build: function() {\r\n var firstYear = viewDate.year - viewDate.year % (this.split * 3);\r\n var years = [], year;\r\n for (var i = 0; i < 12; i++) {\r\n year = new Date(firstYear + i, 0, 1);\r\n years.push({date: year, label: formatDate(year, this.format), selected: picker.$isSelected(year), disabled: this.isDisabled(year)});\r\n }\r\n scope.title = years[0].label + '-' + years[years.length - 1].label;\r\n scope.showLabels = false;\r\n scope.rows = split(years, this.split);\r\n this.built = true;\r\n },\r\n isSelected: function(date) {\r\n return picker.$date && date.getFullYear() === picker.$date.getFullYear();\r\n },\r\n isDisabled: function(date) {\r\n var lastDate = +new Date(date.getFullYear() + 1, 0, 0);\r\n return lastDate < options.minDate || date.getTime() > options.maxDate;\r\n },\r\n onKeyDown: function(evt) {\r\n if (!picker.$date) {\r\n return;\r\n }\r\n var actualYear = picker.$date.getFullYear(),\r\n newDate = new Date(picker.$date);\r\n\r\n if(evt.keyCode === 37) newDate.setYear(actualYear - 1);\r\n else if(evt.keyCode === 38) newDate.setYear(actualYear - 4);\r\n else if(evt.keyCode === 39) newDate.setYear(actualYear + 1);\r\n else if(evt.keyCode === 40) newDate.setYear(actualYear + 4);\r\n\r\n if (!this.isDisabled(newDate)) picker.select(newDate, true);\r\n }\r\n }];\r\n\r\n return {\r\n views: options.minView ? Array.prototype.slice.call(views, options.minView) : views,\r\n viewDate: viewDate\r\n };\r\n\r\n };\r\n\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/datepicker.tpl.js b/dist/modules/datepicker.tpl.js
index 31a79962c..ebc4e7dc5 100644
--- a/dist/modules/datepicker.tpl.js
+++ b/dist/modules/datepicker.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/datepicker.tpl.min.js b/dist/modules/datepicker.tpl.min.js
index 30f05058f..b2ac89b6e 100644
--- a/dist/modules/datepicker.tpl.min.js
+++ b/dist/modules/datepicker.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/debounce.js b/dist/modules/debounce.js
index 9eabead3c..0e61ee2dd 100644
--- a/dist/modules/debounce.js
+++ b/dist/modules/debounce.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/debounce.min.js b/dist/modules/debounce.min.js
index 956ecf8ae..c39e2f294 100644
--- a/dist/modules/debounce.min.js
+++ b/dist/modules/debounce.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/debounce.min.js.map b/dist/modules/debounce.min.js.map
index 46ba3cc8f..06a6a426c 100644
--- a/dist/modules/debounce.min.js.map
+++ b/dist/modules/debounce.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["helpers/debounce.js"],"names":[],"mappings":"qBASI,OAAO,8CAIF,YAAS,WAAA,SAAA,SACV,UAAS,EAAO,EAAA,oBAElB,eACE,GAAU,KACV,EAAI,YACG,IAAe,cAEf,OAAA,KAEF,EAAM,kBAEb,sDAeG,YAAU,WAAA,SAAA,SACX,UAAG,EAAQ,EAAA,SACJ,sBAEP,cACE,GAAU,OACP,gCAGF,MAAM,EAAA,yBAId,EAAA,YAAA","file":"debounce.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.debounce', [])\n\n// @source jashkenas/underscore\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L693\n.factory('debounce', function($timeout) {\n return function(func, wait, immediate) {\n var timeout = null;\n return function() {\n var context = this,\n args = arguments,\n callNow = immediate && !timeout;\n if(timeout) {\n $timeout.cancel(timeout);\n }\n timeout = $timeout(function later() {\n timeout = null;\n if(!immediate) {\n func.apply(context, args);\n }\n }, wait, false);\n if(callNow) {\n func.apply(context, args);\n }\n return timeout;\n };\n };\n})\n\n\n// @source jashkenas/underscore\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L661\n.factory('throttle', function($timeout) {\n return function(func, wait, options) {\n var timeout = null;\n options || (options = {});\n return function() {\n var context = this,\n args = arguments;\n if(!timeout) {\n if(options.leading !== false) {\n func.apply(context, args);\n }\n timeout = $timeout(function later() {\n timeout = null;\n if(options.trailing !== false) {\n func.apply(context, args);\n }\n }, wait, false);\n }\n };\n };\n});\n\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["helpers/debounce.js"],"names":[],"mappings":"qBASI,OAAO,8CAIF,YAAS,WAAA,SAAA,SACV,UAAS,EAAO,EAAA,oBAElB,eACE,GAAU,KACV,EAAI,YACG,IAAe,cAEf,OAAA,KAEF,EAAM,kBAEb,sDAeG,YAAU,WAAA,SAAA,SACX,UAAG,EAAQ,EAAA,SACJ,sBAEP,cACE,GAAU,OACP,gCAGF,MAAM,EAAA,yBAId,EAAA,YAAA","file":"debounce.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.debounce', [])\r\n\r\n// @source jashkenas/underscore\r\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L693\r\n.factory('debounce', function($timeout) {\r\n return function(func, wait, immediate) {\r\n var timeout = null;\r\n return function() {\r\n var context = this,\r\n args = arguments,\r\n callNow = immediate && !timeout;\r\n if(timeout) {\r\n $timeout.cancel(timeout);\r\n }\r\n timeout = $timeout(function later() {\r\n timeout = null;\r\n if(!immediate) {\r\n func.apply(context, args);\r\n }\r\n }, wait, false);\r\n if(callNow) {\r\n func.apply(context, args);\r\n }\r\n return timeout;\r\n };\r\n };\r\n})\r\n\r\n\r\n// @source jashkenas/underscore\r\n// @url https://github.com/jashkenas/underscore/blob/1.5.2/underscore.js#L661\r\n.factory('throttle', function($timeout) {\r\n return function(func, wait, options) {\r\n var timeout = null;\r\n options || (options = {});\r\n return function() {\r\n var context = this,\r\n args = arguments;\r\n if(!timeout) {\r\n if(options.leading !== false) {\r\n func.apply(context, args);\r\n }\r\n timeout = $timeout(function later() {\r\n timeout = null;\r\n if(options.trailing !== false) {\r\n func.apply(context, args);\r\n }\r\n }, wait, false);\r\n }\r\n };\r\n };\r\n});\r\n\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/dimensions.js b/dist/modules/dimensions.js
index d07bdc140..9aa00d84e 100644
--- a/dist/modules/dimensions.js
+++ b/dist/modules/dimensions.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/dimensions.min.js b/dist/modules/dimensions.min.js
index d9a630c17..0538d7d3a 100644
--- a/dist/modules/dimensions.min.js
+++ b/dist/modules/dimensions.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/dimensions.min.js.map b/dist/modules/dimensions.min.js.map
index ce1c318ae..836440ff9 100644
--- a/dist/modules/dimensions.min.js.map
+++ b/dist/modules/dimensions.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["helpers/dimensions.js"],"names":[],"mappings":"8HAcQ,wHAiBA,SAAQ,EAAc,EAAA,kBAExB,EAAO,oIAgBC,SAAQ,2TAiBhB,SAAW,SAAS,MAGlB,8FAeA,EAAA,EAAA,OAAiB,gCAMjB,EAAgB,KAAA,EAAA,IAAA,EAAA,kBAAA,GAChB,EAAY,MAAM,EAAA,IAAA,EAA8B,mBAAsB,wIAkBxE,GAAO,SAA2B,uMAiBlC,OAAO,SAAA,EAAA,iNAiBP,MAAO,SAAA,EAAA,gCAGT,GAAO,EAAA,IAAA,EAAA,cAAA,GAAA,EAAA,IAAA,EAAA,eAAA,GAEN,GAAA,EAAA,IAAA,EAAA,eAAA,GAAA,EAAA,IAAA,EAAA,gBAAA,GAAA,EAAA,IAAA,EAAA,mBAAA,GAAA,EAAA,IAAA,EAAA,oBAAA","file":"dimensions.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.dimensions', [])\n\n .factory('dimensions', function($document, $window) {\n\n var jqLite = angular.element;\n var fn = {};\n\n /**\n * Test the element nodeName\n * @param element\n * @param name\n */\n var nodeName = fn.nodeName = function(element, name) {\n return element.nodeName && element.nodeName.toLowerCase() === name.toLowerCase();\n };\n\n /**\n * Returns the element computed style\n * @param element\n * @param prop\n * @param extra\n */\n fn.css = function(element, prop, extra) {\n var value;\n if (element.currentStyle) { //IE\n value = element.currentStyle[prop];\n } else if (window.getComputedStyle) {\n value = window.getComputedStyle(element)[prop];\n } else {\n value = element.style[prop];\n }\n return extra === true ? parseFloat(value) || 0 : value;\n };\n\n /**\n * Provides read-only equivalent of jQuery's offset function:\n * @required-by bootstrap-tooltip, bootstrap-affix\n * @url http://api.jquery.com/offset/\n * @param element\n */\n fn.offset = function(element) {\n var boxRect = element.getBoundingClientRect();\n var docElement = element.ownerDocument;\n return {\n width: boxRect.width || element.offsetWidth,\n height: boxRect.height || element.offsetHeight,\n top: boxRect.top + (window.pageYOffset || docElement.documentElement.scrollTop) - (docElement.documentElement.clientTop || 0),\n left: boxRect.left + (window.pageXOffset || docElement.documentElement.scrollLeft) - (docElement.documentElement.clientLeft || 0)\n };\n };\n\n /**\n * Provides read-only equivalent of jQuery's position function\n * @required-by bootstrap-tooltip, bootstrap-affix\n * @url http://api.jquery.com/offset/\n * @param element\n */\n fn.position = function(element) {\n\n var offsetParentRect = {top: 0, left: 0},\n offsetParentElement,\n offset;\n\n // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\n if (fn.css(element, 'position') === 'fixed') {\n\n // We assume that getBoundingClientRect is available when computed position is fixed\n offset = element.getBoundingClientRect();\n\n } else {\n\n // Get *real* offsetParentElement\n offsetParentElement = offsetParent(element);\n\n // Get correct offsets\n offset = fn.offset(element);\n if (!nodeName(offsetParentElement, 'html')) {\n offsetParentRect = fn.offset(offsetParentElement);\n }\n\n // Add offsetParent borders\n offsetParentRect.top += fn.css(offsetParentElement, 'borderTopWidth', true);\n offsetParentRect.left += fn.css(offsetParentElement, 'borderLeftWidth', true);\n }\n\n // Subtract parent offsets and element margins\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n top: offset.top - offsetParentRect.top - fn.css(element, 'marginTop', true),\n left: offset.left - offsetParentRect.left - fn.css(element, 'marginLeft', true)\n };\n\n };\n\n /**\n * Returns the closest, non-statically positioned offsetParent of a given element\n * @required-by fn.position\n * @param element\n */\n var offsetParent = function offsetParentElement(element) {\n var docElement = element.ownerDocument;\n var offsetParent = element.offsetParent || docElement;\n if(nodeName(offsetParent, '#document')) return docElement.documentElement;\n while(offsetParent && !nodeName(offsetParent, 'html') && fn.css(offsetParent, 'position') === 'static') {\n offsetParent = offsetParent.offsetParent;\n }\n return offsetParent || docElement.documentElement;\n };\n\n /**\n * Provides equivalent of jQuery's height function\n * @required-by bootstrap-affix\n * @url http://api.jquery.com/height/\n * @param element\n * @param outer\n */\n fn.height = function(element, outer) {\n var value = element.offsetHeight;\n if(outer) {\n value += fn.css(element, 'marginTop', true) + fn.css(element, 'marginBottom', true);\n } else {\n value -= fn.css(element, 'paddingTop', true) + fn.css(element, 'paddingBottom', true) + fn.css(element, 'borderTopWidth', true) + fn.css(element, 'borderBottomWidth', true);\n }\n return value;\n };\n\n /**\n * Provides equivalent of jQuery's width function\n * @required-by bootstrap-affix\n * @url http://api.jquery.com/width/\n * @param element\n * @param outer\n */\n fn.width = function(element, outer) {\n var value = element.offsetWidth;\n if(outer) {\n value += fn.css(element, 'marginLeft', true) + fn.css(element, 'marginRight', true);\n } else {\n value -= fn.css(element, 'paddingLeft', true) + fn.css(element, 'paddingRight', true) + fn.css(element, 'borderLeftWidth', true) + fn.css(element, 'borderRightWidth', true);\n }\n return value;\n };\n\n return fn;\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["helpers/dimensions.js"],"names":[],"mappings":"8HAcQ,wHAiBA,SAAQ,EAAc,EAAA,kBAExB,EAAO,oIAgBC,SAAQ,2TAiBhB,SAAW,SAAS,MAGlB,8FAeA,EAAA,EAAA,OAAiB,gCAMjB,EAAgB,KAAA,EAAA,IAAA,EAAA,kBAAA,GAChB,EAAY,MAAM,EAAA,IAAA,EAA8B,mBAAsB,wIAkBxE,GAAO,SAA2B,uMAiBlC,OAAO,SAAA,EAAA,iNAiBP,MAAO,SAAA,EAAA,gCAGT,GAAO,EAAA,IAAA,EAAA,cAAA,GAAA,EAAA,IAAA,EAAA,eAAA,GAEN,GAAA,EAAA,IAAA,EAAA,eAAA,GAAA,EAAA,IAAA,EAAA,gBAAA,GAAA,EAAA,IAAA,EAAA,mBAAA,GAAA,EAAA,IAAA,EAAA,oBAAA","file":"dimensions.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.dimensions', [])\r\n\r\n .factory('dimensions', function($document, $window) {\r\n\r\n var jqLite = angular.element;\r\n var fn = {};\r\n\r\n /**\r\n * Test the element nodeName\r\n * @param element\r\n * @param name\r\n */\r\n var nodeName = fn.nodeName = function(element, name) {\r\n return element.nodeName && element.nodeName.toLowerCase() === name.toLowerCase();\r\n };\r\n\r\n /**\r\n * Returns the element computed style\r\n * @param element\r\n * @param prop\r\n * @param extra\r\n */\r\n fn.css = function(element, prop, extra) {\r\n var value;\r\n if (element.currentStyle) { //IE\r\n value = element.currentStyle[prop];\r\n } else if (window.getComputedStyle) {\r\n value = window.getComputedStyle(element)[prop];\r\n } else {\r\n value = element.style[prop];\r\n }\r\n return extra === true ? parseFloat(value) || 0 : value;\r\n };\r\n\r\n /**\r\n * Provides read-only equivalent of jQuery's offset function:\r\n * @required-by bootstrap-tooltip, bootstrap-affix\r\n * @url http://api.jquery.com/offset/\r\n * @param element\r\n */\r\n fn.offset = function(element) {\r\n var boxRect = element.getBoundingClientRect();\r\n var docElement = element.ownerDocument;\r\n return {\r\n width: boxRect.width || element.offsetWidth,\r\n height: boxRect.height || element.offsetHeight,\r\n top: boxRect.top + (window.pageYOffset || docElement.documentElement.scrollTop) - (docElement.documentElement.clientTop || 0),\r\n left: boxRect.left + (window.pageXOffset || docElement.documentElement.scrollLeft) - (docElement.documentElement.clientLeft || 0)\r\n };\r\n };\r\n\r\n /**\r\n * Provides read-only equivalent of jQuery's position function\r\n * @required-by bootstrap-tooltip, bootstrap-affix\r\n * @url http://api.jquery.com/offset/\r\n * @param element\r\n */\r\n fn.position = function(element) {\r\n\r\n var offsetParentRect = {top: 0, left: 0},\r\n offsetParentElement,\r\n offset;\r\n\r\n // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent\r\n if (fn.css(element, 'position') === 'fixed') {\r\n\r\n // We assume that getBoundingClientRect is available when computed position is fixed\r\n offset = element.getBoundingClientRect();\r\n\r\n } else {\r\n\r\n // Get *real* offsetParentElement\r\n offsetParentElement = offsetParent(element);\r\n\r\n // Get correct offsets\r\n offset = fn.offset(element);\r\n if (!nodeName(offsetParentElement, 'html')) {\r\n offsetParentRect = fn.offset(offsetParentElement);\r\n }\r\n\r\n // Add offsetParent borders\r\n offsetParentRect.top += fn.css(offsetParentElement, 'borderTopWidth', true);\r\n offsetParentRect.left += fn.css(offsetParentElement, 'borderLeftWidth', true);\r\n }\r\n\r\n // Subtract parent offsets and element margins\r\n return {\r\n width: element.offsetWidth,\r\n height: element.offsetHeight,\r\n top: offset.top - offsetParentRect.top - fn.css(element, 'marginTop', true),\r\n left: offset.left - offsetParentRect.left - fn.css(element, 'marginLeft', true)\r\n };\r\n\r\n };\r\n\r\n /**\r\n * Returns the closest, non-statically positioned offsetParent of a given element\r\n * @required-by fn.position\r\n * @param element\r\n */\r\n var offsetParent = function offsetParentElement(element) {\r\n var docElement = element.ownerDocument;\r\n var offsetParent = element.offsetParent || docElement;\r\n if(nodeName(offsetParent, '#document')) return docElement.documentElement;\r\n while(offsetParent && !nodeName(offsetParent, 'html') && fn.css(offsetParent, 'position') === 'static') {\r\n offsetParent = offsetParent.offsetParent;\r\n }\r\n return offsetParent || docElement.documentElement;\r\n };\r\n\r\n /**\r\n * Provides equivalent of jQuery's height function\r\n * @required-by bootstrap-affix\r\n * @url http://api.jquery.com/height/\r\n * @param element\r\n * @param outer\r\n */\r\n fn.height = function(element, outer) {\r\n var value = element.offsetHeight;\r\n if(outer) {\r\n value += fn.css(element, 'marginTop', true) + fn.css(element, 'marginBottom', true);\r\n } else {\r\n value -= fn.css(element, 'paddingTop', true) + fn.css(element, 'paddingBottom', true) + fn.css(element, 'borderTopWidth', true) + fn.css(element, 'borderBottomWidth', true);\r\n }\r\n return value;\r\n };\r\n\r\n /**\r\n * Provides equivalent of jQuery's width function\r\n * @required-by bootstrap-affix\r\n * @url http://api.jquery.com/width/\r\n * @param element\r\n * @param outer\r\n */\r\n fn.width = function(element, outer) {\r\n var value = element.offsetWidth;\r\n if(outer) {\r\n value += fn.css(element, 'marginLeft', true) + fn.css(element, 'marginRight', true);\r\n } else {\r\n value -= fn.css(element, 'paddingLeft', true) + fn.css(element, 'paddingRight', true) + fn.css(element, 'borderLeftWidth', true) + fn.css(element, 'borderRightWidth', true);\r\n }\r\n return value;\r\n };\r\n\r\n return fn;\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/dropdown.js b/dist/modules/dropdown.js
index 8b9bd8736..29b34df30 100644
--- a/dist/modules/dropdown.js
+++ b/dist/modules/dropdown.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/dropdown.min.js b/dist/modules/dropdown.min.js
index 43c9d043d..565b4e1c4 100644
--- a/dist/modules/dropdown.min.js
+++ b/dist/modules/dropdown.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/dropdown.min.js.map b/dist/modules/dropdown.min.js.map
index 83f28ccc6..897864966 100644
--- a/dist/modules/dropdown.min.js.map
+++ b/dist/modules/dropdown.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["dropdown/dropdown.js"],"names":[],"mappings":"qBASM,OAAA,2BAAW,oCAEX,YAAS,cAET,GAAU,KAAA,UACV,UAAM,UACN,YAAO,yEAGT,QAAK,qBAEH,UAAI,EACJ,MAAI,gBAIF,MAAI,UAAY,aAAA,WAAA,WAAA,SAAA,EAAA,EAAA,EAAA,wDAwEX,EAAA,SAAA,EAAA,IAAA,EAAA,cAjEL,CAAA,GAAI,8BAIM,GAAA,OAAa,EAAc,OAAA,EAAA,MAAA,QAAA,EAAA,SAE/B,EAAA,EAAA,MACJ,GAAI,EAAA,WAIA,WAAc,SAAA,GAClB,GAAI,UAAA,KAAA,EAAA,SAAJ,CACA,EAAA,mBACE,6FAIF,IAAG,EAAI,OAAP,eAEQ,QAAQ,EAAA,SAAY,EAAQ,GACpC,GAAmB,EAAA,KAAA,EAAA,YAAA,EAAA,8DAMjB,QAAO,YAAU,KAAA,EAAA,GACrB,EAAA,GAAU,GAAO,GAAA,cAMb,GAAO,EAAG,OACN,KAAA,WACN,IAGF,EAAW,WACX,EAAU,UAAO,EAAW,SAAA,GAAA,UAAA,EAAA,YAC1B,EAAI,GAAA,QAAU,IACd,GAAA,GACA,EAAO,SAAI,aAAS,EAAA,SAAA,wCAKlB,EAAU,WACd,EAAU,UAAU,EAAW,SAAA,IAAA,UAAA,EAAA,YAC7B,EAAO,IAAI,QAAS,GACpB,EAAA,SAAA,aAAA,EAAA,YAAA,oCAKF,GAAS,QAAA,WACP,EAAO,IAAA,QAAW,GAClB,8CA9DF,EAAc,QAAQ,UAAW,iBAAU,QAAA,UAAA,uBAAA,QAAA,UAAA,oBAAA,QAAA,UAAA,mBAAA,QAAA,UAAA,mHAqFtC,uCAKH,IAAM,MAAU,WACf,SAAA,YAAA,YAAA,QAAA,UAAA,WAAA,OAAA,YAAA,YAAA,SAAA,4CAKE,YAAQ,EAAS,OAAA,EAAW,WAAa,SAAS,GACrD,EAAA,QAAa,OAIf,EAAI,QAAW,EAAA,OAAU,EAAA,OAAS,SAAA,wFAGlC,KAAU,EAAY,EAAA,OAAW,EAAA,kEASpC,EAAA","file":"dropdown.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.dropdown', ['mgcrea.ngStrap.tooltip'])\n\n .provider('$dropdown', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'dropdown',\n placement: 'bottom-left',\n template: 'dropdown/dropdown.tpl.html',\n trigger: 'click',\n container: false,\n keyboard: true,\n html: false,\n delay: 0\n };\n\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;\n\n function DropdownFactory(element, config) {\n\n var $dropdown = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n var scope = $dropdown.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n\n $dropdown = $tooltip(element, options);\n var parentEl = element.parent();\n\n // Protected methods\n\n $dropdown.$onKeyDown = function(evt) {\n if (!/(38|40)/.test(evt.keyCode)) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n // Retrieve focused index\n var items = angular.element($dropdown.$element[0].querySelectorAll('li:not(.divider) a'));\n if(!items.length) return;\n var index;\n angular.forEach(items, function(el, i) {\n if(matchesSelector && matchesSelector.call(el, ':focus')) index = i;\n });\n\n // Navigate with keyboard\n if(evt.keyCode === 38 && index > 0) index--;\n else if(evt.keyCode === 40 && index < items.length - 1) index++;\n else if(angular.isUndefined(index)) index = 0;\n items.eq(index)[0].focus();\n\n };\n\n // Overrides\n\n var show = $dropdown.show;\n $dropdown.show = function() {\n show();\n // use timeout to hookup the events to prevent \n // event bubbling from being processed imediately. \n $timeout(function() {\n options.keyboard && $dropdown.$element.on('keydown', $dropdown.$onKeyDown);\n bodyEl.on('click', onBodyClick);\n }, 0, false);\n parentEl.hasClass('dropdown') && parentEl.addClass('open');\n };\n\n var hide = $dropdown.hide;\n $dropdown.hide = function() {\n if(!$dropdown.$isShown) return;\n options.keyboard && $dropdown.$element.off('keydown', $dropdown.$onKeyDown);\n bodyEl.off('click', onBodyClick);\n parentEl.hasClass('dropdown') && parentEl.removeClass('open');\n hide();\n };\n\n var destroy = $dropdown.destroy;\n $dropdown.destroy = function() {\n bodyEl.off('click', onBodyClick);\n destroy();\n };\n\n // Private functions\n\n function onBodyClick(evt) {\n if(evt.target === element[0]) return;\n return evt.target !== element[0] && $dropdown.hide();\n }\n\n return $dropdown;\n\n }\n\n return DropdownFactory;\n\n };\n\n })\n\n .directive('bsDropdown', function($window, $sce, $dropdown) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as an object\n attr.bsDropdown && scope.$watch(attr.bsDropdown, function(newValue, oldValue) {\n scope.content = newValue;\n }, true);\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!dropdown || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(dropdown),?/i);\n newValue === true ? dropdown.show() : dropdown.hide();\n });\n\n // Initialize dropdown\n var dropdown = $dropdown(element, options);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (dropdown) dropdown.destroy();\n options = null;\n dropdown = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["dropdown/dropdown.js"],"names":[],"mappings":"qBASM,OAAA,2BAAW,oCAEX,YAAS,cAET,GAAU,KAAA,UACV,UAAM,UACN,YAAO,yEAGT,QAAK,qBAEH,UAAI,EACJ,MAAI,gBAIF,MAAI,UAAY,aAAA,WAAA,WAAA,SAAA,EAAA,EAAA,EAAA,wDAwEX,EAAA,SAAA,EAAA,IAAA,EAAA,cAjEL,CAAA,GAAI,8BAIM,GAAA,OAAa,EAAc,OAAA,EAAA,MAAA,QAAA,EAAA,SAE/B,EAAA,EAAA,MACJ,GAAI,EAAA,WAIA,WAAc,SAAA,GAClB,GAAI,UAAA,KAAA,EAAA,SAAJ,CACA,EAAA,mBACE,6FAIF,IAAG,EAAI,OAAP,eAEQ,QAAQ,EAAA,SAAY,EAAQ,GACpC,GAAmB,EAAA,KAAA,EAAA,YAAA,EAAA,8DAMjB,QAAO,YAAU,KAAA,EAAA,GACrB,EAAA,GAAU,GAAO,GAAA,cAMb,GAAO,EAAG,OACN,KAAA,WACN,IAGF,EAAW,WACX,EAAU,UAAO,EAAW,SAAA,GAAA,UAAA,EAAA,YAC1B,EAAI,GAAA,QAAU,IACd,GAAA,GACA,EAAO,SAAI,aAAS,EAAA,SAAA,wCAKlB,EAAU,WACd,EAAU,UAAU,EAAW,SAAA,IAAA,UAAA,EAAA,YAC7B,EAAO,IAAI,QAAS,GACpB,EAAA,SAAA,aAAA,EAAA,YAAA,oCAKF,GAAS,QAAA,WACP,EAAO,IAAA,QAAW,GAClB,8CA9DF,EAAc,QAAQ,UAAW,iBAAU,QAAA,UAAA,uBAAA,QAAA,UAAA,oBAAA,QAAA,UAAA,mBAAA,QAAA,UAAA,mHAqFtC,uCAKH,IAAM,MAAU,WACf,SAAA,YAAA,YAAA,QAAA,UAAA,WAAA,OAAA,YAAA,YAAA,SAAA,4CAKE,YAAQ,EAAS,OAAA,EAAW,WAAa,SAAS,GACrD,EAAA,QAAa,OAIf,EAAI,QAAW,EAAA,OAAU,EAAA,OAAS,SAAA,wFAGlC,KAAU,EAAY,EAAA,OAAW,EAAA,kEASpC,EAAA","file":"dropdown.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.dropdown', ['mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$dropdown', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'dropdown',\r\n placement: 'bottom-left',\r\n template: 'dropdown/dropdown.tpl.html',\r\n trigger: 'click',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0\r\n };\r\n\r\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var matchesSelector = Element.prototype.matchesSelector || Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector;\r\n\r\n function DropdownFactory(element, config) {\r\n\r\n var $dropdown = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n var scope = $dropdown.$scope = options.scope && options.scope.$new() || $rootScope.$new();\r\n\r\n $dropdown = $tooltip(element, options);\r\n var parentEl = element.parent();\r\n\r\n // Protected methods\r\n\r\n $dropdown.$onKeyDown = function(evt) {\r\n if (!/(38|40)/.test(evt.keyCode)) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n // Retrieve focused index\r\n var items = angular.element($dropdown.$element[0].querySelectorAll('li:not(.divider) a'));\r\n if(!items.length) return;\r\n var index;\r\n angular.forEach(items, function(el, i) {\r\n if(matchesSelector && matchesSelector.call(el, ':focus')) index = i;\r\n });\r\n\r\n // Navigate with keyboard\r\n if(evt.keyCode === 38 && index > 0) index--;\r\n else if(evt.keyCode === 40 && index < items.length - 1) index++;\r\n else if(angular.isUndefined(index)) index = 0;\r\n items.eq(index)[0].focus();\r\n\r\n };\r\n\r\n // Overrides\r\n\r\n var show = $dropdown.show;\r\n $dropdown.show = function() {\r\n show();\r\n // use timeout to hookup the events to prevent \r\n // event bubbling from being processed imediately. \r\n $timeout(function() {\r\n options.keyboard && $dropdown.$element.on('keydown', $dropdown.$onKeyDown);\r\n bodyEl.on('click', onBodyClick);\r\n }, 0, false);\r\n parentEl.hasClass('dropdown') && parentEl.addClass('open');\r\n };\r\n\r\n var hide = $dropdown.hide;\r\n $dropdown.hide = function() {\r\n if(!$dropdown.$isShown) return;\r\n options.keyboard && $dropdown.$element.off('keydown', $dropdown.$onKeyDown);\r\n bodyEl.off('click', onBodyClick);\r\n parentEl.hasClass('dropdown') && parentEl.removeClass('open');\r\n hide();\r\n };\r\n\r\n var destroy = $dropdown.destroy;\r\n $dropdown.destroy = function() {\r\n bodyEl.off('click', onBodyClick);\r\n destroy();\r\n };\r\n\r\n // Private functions\r\n\r\n function onBodyClick(evt) {\r\n if(evt.target === element[0]) return;\r\n return evt.target !== element[0] && $dropdown.hide();\r\n }\r\n\r\n return $dropdown;\r\n\r\n }\r\n\r\n return DropdownFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsDropdown', function($window, $sce, $dropdown) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsDropdown && scope.$watch(attr.bsDropdown, function(newValue, oldValue) {\r\n scope.content = newValue;\r\n }, true);\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!dropdown || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(dropdown),?/i);\r\n newValue === true ? dropdown.show() : dropdown.hide();\r\n });\r\n\r\n // Initialize dropdown\r\n var dropdown = $dropdown(element, options);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (dropdown) dropdown.destroy();\r\n options = null;\r\n dropdown = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/dropdown.tpl.js b/dist/modules/dropdown.tpl.js
index ac9385a6e..a114c89f4 100644
--- a/dist/modules/dropdown.tpl.js
+++ b/dist/modules/dropdown.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/dropdown.tpl.min.js b/dist/modules/dropdown.tpl.min.js
index 76f037207..0ad7ff835 100644
--- a/dist/modules/dropdown.tpl.min.js
+++ b/dist/modules/dropdown.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/modal.js b/dist/modules/modal.js
index a5187d58b..1f5bfec63 100644
--- a/dist/modules/modal.js
+++ b/dist/modules/modal.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/modal.min.js b/dist/modules/modal.min.js
index 1506c012b..abd9f7395 100644
--- a/dist/modules/modal.min.js
+++ b/dist/modules/modal.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/modal.min.js.map b/dist/modules/modal.min.js.map
index 23f5ea7b8..c86ff5bbe 100644
--- a/dist/modules/modal.min.js.map
+++ b/dist/modules/modal.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["modal/modal.js"],"names":[],"mappings":"qBASM,OAAA,wBAAa,+CAEb,SAAW,cAEX,GAAA,KAAiB,UACjB,UAAW,UACX,kBAAS,UACT,YAAU,QACV,YAAU,QACV,UAAM,MACN,SAAM,uDAGR,QAAK,iBAEH,UAAI,EACJ,MAAI,EACJ,MAAI,4JAWE,GAAe,WA4Jd,OACD,MAAA,EAAA,YAAA,QAAA,gB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,SAAgB,EAAA,OAAA,EAAA,MAAA,SAAA,EAAA,kBAGlB,GAAQ,EAAc,SAChB,SAAS,SAAK,GAAA,UAAA,iBAAA,wBAKlB,GAAO,GAAA,EAAA,gFAIX,EAAO,IAAA,EAAA,EAAA,wCA7PL,EAAI,OAAS,UAAA,gFAGb,EAAqB,+GA0QhB,uCAKH,IAAa,MAAK,EAAS,QAAK,EAAS,MAAU,WACjD,SAAa,WAAK,kBAAY,YAAA,WAAA,WAAA,OAAA,YAAA,aAAA,SAAA,0CAKlC,QAAK,SAAW,QAAM,WAAY,SAAS,GACzC,EAAG,IAAQ,EAAA,SAAS,EAAW,SAAA,GAC7B,EAAA,GAAQ,EAAO,YAAO,qEAOtB,QAAQ,OAAO,EAAA,uBAOjB,GAAI,EAAa,gFAQtB,EAAA","file":"modal.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$modal', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n backdropAnimation: 'am-fade',\n prefixClass: 'modal',\n prefixEvent: 'modal',\n placement: 'top',\n template: 'modal/modal.tpl.html',\n contentTemplate: false,\n container: false,\n element: null,\n backdrop: true,\n keyboard: true,\n html: false,\n show: true\n };\n\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {\n\n var forEach = angular.forEach;\n var trim = String.prototype.trim;\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n var bodyElement = angular.element($window.document.body);\n var htmlReplaceRegExp = /ng-bind=\"/ig;\n\n function ModalFactory(config) {\n\n var $modal = {};\n\n // Common vars\n var options = $modal.$options = angular.extend({}, defaults, config);\n $modal.$promise = fetchTemplate(options.template);\n var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n if(!options.element && !options.container) {\n options.container = 'body';\n }\n\n // Support scope as string options\n forEach(['title', 'content'], function(key) {\n if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);\n });\n\n // Provide scope helpers\n scope.$hide = function() {\n scope.$$postDigest(function() {\n $modal.hide();\n });\n };\n scope.$show = function() {\n scope.$$postDigest(function() {\n $modal.show();\n });\n };\n scope.$toggle = function() {\n scope.$$postDigest(function() {\n $modal.toggle();\n });\n };\n // Publish isShown as a protected var on scope\n $modal.$isShown = scope.$isShown = false;\n\n // Support contentTemplate option\n if(options.contentTemplate) {\n $modal.$promise = $modal.$promise.then(function(template) {\n var templateEl = angular.element(template);\n return fetchTemplate(options.contentTemplate)\n .then(function(contentTemplate) {\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]).removeAttr('ng-bind').html(contentTemplate);\n // Drop the default footer as you probably don't want it if you use a custom contentTemplate\n if(!config.template) contentEl.next().remove();\n return templateEl[0].outerHTML;\n });\n });\n }\n\n // Fetch, compile then initialize modal\n var modalLinker, modalElement;\n var backdropElement = angular.element('
');\n $modal.$promise.then(function(template) {\n if(angular.isObject(template)) template = template.data;\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\n template = trim.apply(template);\n modalLinker = $compile(template);\n $modal.init();\n });\n\n $modal.init = function() {\n\n // Options: show\n if(options.show) {\n scope.$$postDigest(function() {\n $modal.show();\n });\n }\n\n };\n\n $modal.destroy = function() {\n\n // Remove element\n if(modalElement) {\n modalElement.remove();\n modalElement = null;\n }\n if(backdropElement) {\n backdropElement.remove();\n backdropElement = null;\n }\n\n // Destroy scope\n scope.$destroy();\n\n };\n\n $modal.show = function() {\n if($modal.$isShown) return;\n\n if(scope.$emit(options.prefixEvent + '.show.before', $modal).defaultPrevented) {\n return;\n }\n var parent, after;\n if(angular.isElement(options.container)) {\n parent = options.container;\n after = options.container[0].lastChild ? angular.element(options.container[0].lastChild) : null;\n } else {\n if (options.container) {\n parent = findElement(options.container);\n after = parent[0].lastChild ? angular.element(parent[0].lastChild) : null;\n } else {\n parent = null;\n after = options.element;\n }\n }\n\n // Fetch a cloned element linked from template\n modalElement = $modal.$element = modalLinker(scope, function(clonedElement, scope) {});\n\n // Set the initial positioning.\n modalElement.css({display: 'block'}).addClass(options.placement);\n\n // Options: animation\n if(options.animation) {\n if(options.backdrop) {\n backdropElement.addClass(options.backdropAnimation);\n }\n modalElement.addClass(options.animation);\n }\n\n if(options.backdrop) {\n $animate.enter(backdropElement, bodyElement, null);\n }\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.enter(modalElement, parent, after, enterAnimateCallback);\n if(promise && promise.then) promise.then(enterAnimateCallback);\n\n $modal.$isShown = scope.$isShown = true;\n safeDigest(scope);\n // Focus once the enter-animation has started\n // Weird PhantomJS bug hack\n var el = modalElement[0];\n requestAnimationFrame(function() {\n el.focus();\n });\n\n bodyElement.addClass(options.prefixClass + '-open');\n if(options.animation) {\n bodyElement.addClass(options.prefixClass + '-with-' + options.animation);\n }\n\n // Bind events\n if(options.backdrop) {\n modalElement.on('click', hideOnBackdropClick);\n backdropElement.on('click', hideOnBackdropClick);\n backdropElement.on('wheel', preventEventDefault);\n }\n if(options.keyboard) {\n modalElement.on('keyup', $modal.$onKeyUp);\n }\n };\n\n function enterAnimateCallback() {\n scope.$emit(options.prefixEvent + '.show', $modal);\n }\n\n $modal.hide = function() {\n if(!$modal.$isShown) return;\n\n if(scope.$emit(options.prefixEvent + '.hide.before', $modal).defaultPrevented) {\n return;\n }\n var promise = $animate.leave(modalElement, leaveAnimateCallback);\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n if(promise && promise.then) promise.then(leaveAnimateCallback);\n\n if(options.backdrop) {\n $animate.leave(backdropElement);\n }\n $modal.$isShown = scope.$isShown = false;\n safeDigest(scope);\n\n // Unbind events\n if(options.backdrop) {\n modalElement.off('click', hideOnBackdropClick);\n backdropElement.off('click', hideOnBackdropClick);\n backdropElement.off('wheel', preventEventDefault);\n }\n if(options.keyboard) {\n modalElement.off('keyup', $modal.$onKeyUp);\n }\n };\n\n function leaveAnimateCallback() {\n scope.$emit(options.prefixEvent + '.hide', $modal);\n bodyElement.removeClass(options.prefixClass + '-open');\n if(options.animation) {\n bodyElement.removeClass(options.prefixClass + '-with-' + options.animation);\n }\n }\n\n $modal.toggle = function() {\n\n $modal.$isShown ? $modal.hide() : $modal.show();\n\n };\n\n $modal.focus = function() {\n modalElement[0].focus();\n };\n\n // Protected methods\n\n $modal.$onKeyUp = function(evt) {\n\n if (evt.which === 27 && $modal.$isShown) {\n $modal.hide();\n evt.stopPropagation();\n }\n\n };\n\n // Private methods\n\n function hideOnBackdropClick(evt) {\n if(evt.target !== evt.currentTarget) return;\n options.backdrop === 'static' ? $modal.focus() : $modal.hide();\n }\n\n function preventEventDefault(evt) {\n evt.preventDefault();\n }\n\n return $modal;\n\n }\n\n // Helper functions\n\n function safeDigest(scope) {\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\n }\n\n function findElement(query, element) {\n return angular.element((element || document).querySelectorAll(query));\n }\n\n var fetchPromises = {};\n function fetchTemplate(template) {\n if(fetchPromises[template]) return fetchPromises[template];\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\n .then(function(res) {\n if(angular.isObject(res)) {\n $templateCache.put(template, res.data);\n return res.data;\n }\n return res;\n }));\n }\n\n return ModalFactory;\n\n };\n\n })\n\n .directive('bsModal', function($window, $sce, $modal) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsModal && scope.$watch(attr.bsModal, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize modal\n var modal = $modal(options);\n\n // Trigger\n element.on(attr.trigger || 'click', modal.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (modal) modal.destroy();\n options = null;\n modal = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["modal/modal.js"],"names":[],"mappings":"qBASM,OAAA,wBAAa,+CAEb,SAAW,cAEX,GAAA,KAAiB,UACjB,UAAW,UACX,kBAAS,UACT,YAAU,QACV,YAAU,QACV,UAAM,MACN,SAAM,uDAGR,QAAK,iBAEH,UAAI,EACJ,MAAI,EACJ,MAAI,4JAWE,GAAe,WA4Jd,OACD,MAAA,EAAA,YAAA,QAAA,gBAgCJ,EAAO,MAAA,EAAS,YAAW,QAAA,wCAEzB,EAAO,wGA8BF,WAAP,EAAO,SAAA,EAAA,QAAA,EAAA,4CA3NL,yCAIF,GAAA,SAAkB,EAAY,EAAS,aACrC,GAAG,EAAc,OAAM,EAAO,OAAK,EAAY,MAAQ,QAAA,EAAA,uDAMrD,QAAO,WAAA,SAAA,wCAKP,MAAO,mDAKP,MAAO,gGAOR,EAAQ,cAIN,SAAK,EAAS,UAAA,IAGT,oBACJ,SAAO,EAAc,SAAA,KAAA,SAAA,0IAOvB,OADA,GAAa,UAAA,EAAA,OAAA,SACb,EAAkB,GAAA,kBAMpB,GAAO,gEAiLT,oCA9KA,QAAO,SAAO,KAAW,EAAA,EAAA,6DAGvB,EAAW,EAAM,KACf,mCAOJ,EAAO,aAAU,yBAOZ,QAAA,yDAaH,EAAG,cAIA,KAAQ,eACT,EAAA,aAEK,MAAA,EAAA,YAAA,eAAA,GAAA,qBAGH,GAAQ,UACH,UAAA,EAAA,cACL,EAAS,YACT,EAAQ,UAAQ,GAAA,UAAA,QAAA,QAAA,EAAA,UAAA,GAAA,WAAA,kHAYP,EAAA,SAAU,EAAA,EAAA,gBAGrB,KAAa,QAAS,UAAQ,SAAA,EAAA,WAG7B,EAAQ,YACT,EAAS,+EAOX,EAAO,MAAA,EAAiB,EAAW,KAInC,IAAI,GAAK,EAAa,MAAA,EAAA,EAAA,EAAA,EACtB,IAAA,EAAsB,MAAA,EAAW,KAAA,oCAM/B,GAAA,EAAY,8BAKZ,SAAgB,EAAS,YAAA,SACzB,EAAA,WACA,EAAA,SAAmB,EAAS,YAAA,SAAA,EAAA,wDAOhC,EAAS,GAAA,QAAuB,+KAsB3B,EAAQ,UACT,EAAA,MAAa,KAEb,SAAgB,EAAI,UAAS,sDAOjC,EAAS,IAAA,QAAuB,IAE9B,EAAA,UACA,EAAW,IAAA,QAAW,EAAA,cAYtB,OAAa,4DAOb,EAAQ,GAAA,oEASV,EAAA,oBAgBM,gBAOR,EAAI,SAAgB,EAAA,OAAA,EAAA,MAAA,SAAA,EAAA,kBAGlB,GAAQ,EAAc,SAChB,SAAS,SAAK,GAAA,UAAA,iBAAA,wBAKlB,GAAO,GAAA,EAAA,gFAIX,EAAO,IAAA,EAAA,EAAA,wCA7PL,EAAI,OAAS,UAAA,gFAGb,EAAqB,+GA0QhB,uCAKH,IAAa,MAAK,EAAS,QAAK,EAAS,MAAU,WACjD,SAAa,WAAK,kBAAY,YAAA,WAAA,WAAA,OAAA,YAAA,aAAA,SAAA,0CAKlC,QAAK,SAAW,QAAM,WAAY,SAAS,GACzC,EAAG,IAAQ,EAAA,SAAS,EAAW,SAAA,GAC7B,EAAA,GAAQ,EAAO,YAAO,qEAOtB,QAAQ,OAAO,EAAA,uBAOjB,GAAI,EAAa,gFAQtB,EAAA","file":"modal.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])\r\n\r\n .provider('$modal', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n backdropAnimation: 'am-fade',\r\n prefixClass: 'modal',\r\n prefixEvent: 'modal',\r\n placement: 'top',\r\n template: 'modal/modal.tpl.html',\r\n contentTemplate: false,\r\n container: false,\r\n element: null,\r\n backdrop: true,\r\n keyboard: true,\r\n html: false,\r\n show: true\r\n };\r\n\r\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {\r\n\r\n var forEach = angular.forEach;\r\n var trim = String.prototype.trim;\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n var bodyElement = angular.element($window.document.body);\r\n var htmlReplaceRegExp = /ng-bind=\"/ig;\r\n\r\n function ModalFactory(config) {\r\n\r\n var $modal = {};\r\n\r\n // Common vars\r\n var options = $modal.$options = angular.extend({}, defaults, config);\r\n $modal.$promise = fetchTemplate(options.template);\r\n var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();\r\n if(!options.element && !options.container) {\r\n options.container = 'body';\r\n }\r\n\r\n // Support scope as string options\r\n forEach(['title', 'content'], function(key) {\r\n if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);\r\n });\r\n\r\n // Provide scope helpers\r\n scope.$hide = function() {\r\n scope.$$postDigest(function() {\r\n $modal.hide();\r\n });\r\n };\r\n scope.$show = function() {\r\n scope.$$postDigest(function() {\r\n $modal.show();\r\n });\r\n };\r\n scope.$toggle = function() {\r\n scope.$$postDigest(function() {\r\n $modal.toggle();\r\n });\r\n };\r\n // Publish isShown as a protected var on scope\r\n $modal.$isShown = scope.$isShown = false;\r\n\r\n // Support contentTemplate option\r\n if(options.contentTemplate) {\r\n $modal.$promise = $modal.$promise.then(function(template) {\r\n var templateEl = angular.element(template);\r\n return fetchTemplate(options.contentTemplate)\r\n .then(function(contentTemplate) {\r\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]).removeAttr('ng-bind').html(contentTemplate);\r\n // Drop the default footer as you probably don't want it if you use a custom contentTemplate\r\n if(!config.template) contentEl.next().remove();\r\n return templateEl[0].outerHTML;\r\n });\r\n });\r\n }\r\n\r\n // Fetch, compile then initialize modal\r\n var modalLinker, modalElement;\r\n var backdropElement = angular.element('
');\r\n $modal.$promise.then(function(template) {\r\n if(angular.isObject(template)) template = template.data;\r\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\r\n template = trim.apply(template);\r\n modalLinker = $compile(template);\r\n $modal.init();\r\n });\r\n\r\n $modal.init = function() {\r\n\r\n // Options: show\r\n if(options.show) {\r\n scope.$$postDigest(function() {\r\n $modal.show();\r\n });\r\n }\r\n\r\n };\r\n\r\n $modal.destroy = function() {\r\n\r\n // Remove element\r\n if(modalElement) {\r\n modalElement.remove();\r\n modalElement = null;\r\n }\r\n if(backdropElement) {\r\n backdropElement.remove();\r\n backdropElement = null;\r\n }\r\n\r\n // Destroy scope\r\n scope.$destroy();\r\n\r\n };\r\n\r\n $modal.show = function() {\r\n if($modal.$isShown) return;\r\n\r\n if(scope.$emit(options.prefixEvent + '.show.before', $modal).defaultPrevented) {\r\n return;\r\n }\r\n var parent, after;\r\n if(angular.isElement(options.container)) {\r\n parent = options.container;\r\n after = options.container[0].lastChild ? angular.element(options.container[0].lastChild) : null;\r\n } else {\r\n if (options.container) {\r\n parent = findElement(options.container);\r\n after = parent[0].lastChild ? angular.element(parent[0].lastChild) : null;\r\n } else {\r\n parent = null;\r\n after = options.element;\r\n }\r\n }\r\n\r\n // Fetch a cloned element linked from template\r\n modalElement = $modal.$element = modalLinker(scope, function(clonedElement, scope) {});\r\n\r\n // Set the initial positioning.\r\n modalElement.css({display: 'block'}).addClass(options.placement);\r\n\r\n // Options: animation\r\n if(options.animation) {\r\n if(options.backdrop) {\r\n backdropElement.addClass(options.backdropAnimation);\r\n }\r\n modalElement.addClass(options.animation);\r\n }\r\n\r\n if(options.backdrop) {\r\n $animate.enter(backdropElement, bodyElement, null);\r\n }\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n var promise = $animate.enter(modalElement, parent, after, enterAnimateCallback);\r\n if(promise && promise.then) promise.then(enterAnimateCallback);\r\n\r\n $modal.$isShown = scope.$isShown = true;\r\n safeDigest(scope);\r\n // Focus once the enter-animation has started\r\n // Weird PhantomJS bug hack\r\n var el = modalElement[0];\r\n requestAnimationFrame(function() {\r\n el.focus();\r\n });\r\n\r\n bodyElement.addClass(options.prefixClass + '-open');\r\n if(options.animation) {\r\n bodyElement.addClass(options.prefixClass + '-with-' + options.animation);\r\n }\r\n\r\n // Bind events\r\n if(options.backdrop) {\r\n modalElement.on('click', hideOnBackdropClick);\r\n backdropElement.on('click', hideOnBackdropClick);\r\n backdropElement.on('wheel', preventEventDefault);\r\n }\r\n if(options.keyboard) {\r\n modalElement.on('keyup', $modal.$onKeyUp);\r\n }\r\n };\r\n\r\n function enterAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.show', $modal);\r\n }\r\n\r\n $modal.hide = function() {\r\n if(!$modal.$isShown) return;\r\n\r\n if(scope.$emit(options.prefixEvent + '.hide.before', $modal).defaultPrevented) {\r\n return;\r\n }\r\n var promise = $animate.leave(modalElement, leaveAnimateCallback);\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n if(promise && promise.then) promise.then(leaveAnimateCallback);\r\n\r\n if(options.backdrop) {\r\n $animate.leave(backdropElement);\r\n }\r\n $modal.$isShown = scope.$isShown = false;\r\n safeDigest(scope);\r\n\r\n // Unbind events\r\n if(options.backdrop) {\r\n modalElement.off('click', hideOnBackdropClick);\r\n backdropElement.off('click', hideOnBackdropClick);\r\n backdropElement.off('wheel', preventEventDefault);\r\n }\r\n if(options.keyboard) {\r\n modalElement.off('keyup', $modal.$onKeyUp);\r\n }\r\n };\r\n\r\n function leaveAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.hide', $modal);\r\n bodyElement.removeClass(options.prefixClass + '-open');\r\n if(options.animation) {\r\n bodyElement.removeClass(options.prefixClass + '-with-' + options.animation);\r\n }\r\n }\r\n\r\n $modal.toggle = function() {\r\n\r\n $modal.$isShown ? $modal.hide() : $modal.show();\r\n\r\n };\r\n\r\n $modal.focus = function() {\r\n modalElement[0].focus();\r\n };\r\n\r\n // Protected methods\r\n\r\n $modal.$onKeyUp = function(evt) {\r\n\r\n if (evt.which === 27 && $modal.$isShown) {\r\n $modal.hide();\r\n evt.stopPropagation();\r\n }\r\n\r\n };\r\n\r\n // Private methods\r\n\r\n function hideOnBackdropClick(evt) {\r\n if(evt.target !== evt.currentTarget) return;\r\n options.backdrop === 'static' ? $modal.focus() : $modal.hide();\r\n }\r\n\r\n function preventEventDefault(evt) {\r\n evt.preventDefault();\r\n }\r\n\r\n return $modal;\r\n\r\n }\r\n\r\n // Helper functions\r\n\r\n function safeDigest(scope) {\r\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\r\n }\r\n\r\n function findElement(query, element) {\r\n return angular.element((element || document).querySelectorAll(query));\r\n }\r\n\r\n var fetchPromises = {};\r\n function fetchTemplate(template) {\r\n if(fetchPromises[template]) return fetchPromises[template];\r\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\r\n .then(function(res) {\r\n if(angular.isObject(res)) {\r\n $templateCache.put(template, res.data);\r\n return res.data;\r\n }\r\n return res;\r\n }));\r\n }\r\n\r\n return ModalFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsModal', function($window, $sce, $modal) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope, element: element, show: false};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsModal && scope.$watch(attr.bsModal, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n }, true);\r\n\r\n // Initialize modal\r\n var modal = $modal(options);\r\n\r\n // Trigger\r\n element.on(attr.trigger || 'click', modal.toggle);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (modal) modal.destroy();\r\n options = null;\r\n modal = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/modal.tpl.js b/dist/modules/modal.tpl.js
index 5c2911684..3cbe11fd8 100644
--- a/dist/modules/modal.tpl.js
+++ b/dist/modules/modal.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/modal.tpl.min.js b/dist/modules/modal.tpl.min.js
index e814ada12..aa5787791 100644
--- a/dist/modules/modal.tpl.min.js
+++ b/dist/modules/modal.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/navbar.js b/dist/modules/navbar.js
index 8c1713ebd..ffa9824d7 100644
--- a/dist/modules/navbar.js
+++ b/dist/modules/navbar.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/navbar.min.js b/dist/modules/navbar.min.js
index 97a0af366..bc01cbe60 100644
--- a/dist/modules/navbar.min.js
+++ b/dist/modules/navbar.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/navbar.min.js.map b/dist/modules/navbar.min.js.map
index e0d48d6e4..784af1dd5 100644
--- a/dist/modules/navbar.min.js.map
+++ b/dist/modules/navbar.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["navbar/navbar.js"],"names":[],"mappings":"qBASM,OAAQ,6DAIR,GAAQ,KAAU,4FAOpB,OAAI,SAAW,+EAOX,GAAI,EAAU,gFAQZ,QAAO,OAAU,KAAA,GAAA,SAAA,wFASX,MAEF,GAAU,EAAM,GAAA,iBAAU,MAAA,EAAA,UAAA,aAExB,QAAS,EAAW,SAAU,GAElC,GAAG,GAAY,QAAA,QAAW,GACxB,EAAU,EAAS,KAAQ,EAAA,WAAA,QAAA,IAAA,SACtB,SACL,EAAU,IAAA,EAAY","file":"navbar.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.navbar', [])\n\n .provider('$navbar', function() {\n\n var defaults = this.defaults = {\n activeClass: 'active',\n routeAttr: 'data-match-route',\n strict: false\n };\n\n this.$get = function() {\n return {defaults: defaults};\n };\n\n })\n\n .directive('bsNavbar', function($window, $location, $navbar) {\n\n var defaults = $navbar.defaults;\n\n return {\n restrict: 'A',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = angular.copy(defaults);\n angular.forEach(Object.keys(defaults), function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Watch for the $location\n scope.$watch(function() {\n\n return $location.path();\n\n }, function(newValue, oldValue) {\n\n var liElements = element[0].querySelectorAll('li[' + options.routeAttr + ']');\n\n angular.forEach(liElements, function(li) {\n\n var liElement = angular.element(li);\n var pattern = liElement.attr(options.routeAttr).replace('/', '\\\\/');\n if(options.strict) {\n pattern = '^' + pattern + '$';\n }\n var regexp = new RegExp(pattern, ['i']);\n\n if(regexp.test(newValue)) {\n liElement.addClass(options.activeClass);\n } else {\n liElement.removeClass(options.activeClass);\n }\n\n });\n\n });\n\n }\n\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["navbar/navbar.js"],"names":[],"mappings":"qBASM,OAAQ,6DAIR,GAAQ,KAAU,4FAOpB,OAAI,SAAW,+EAOX,GAAI,EAAU,gFAQZ,QAAO,OAAU,KAAA,GAAA,SAAA,wFASX,MAEF,GAAU,EAAM,GAAA,iBAAU,MAAA,EAAA,UAAA,aAExB,QAAS,EAAW,SAAU,GAElC,GAAG,GAAY,QAAA,QAAW,GACxB,EAAU,EAAS,KAAQ,EAAA,WAAA,QAAA,IAAA,SACtB,SACL,EAAU,IAAA,EAAY","file":"navbar.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.navbar', [])\r\n\r\n .provider('$navbar', function() {\r\n\r\n var defaults = this.defaults = {\r\n activeClass: 'active',\r\n routeAttr: 'data-match-route',\r\n strict: false\r\n };\r\n\r\n this.$get = function() {\r\n return {defaults: defaults};\r\n };\r\n\r\n })\r\n\r\n .directive('bsNavbar', function($window, $location, $navbar) {\r\n\r\n var defaults = $navbar.defaults;\r\n\r\n return {\r\n restrict: 'A',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = angular.copy(defaults);\r\n angular.forEach(Object.keys(defaults), function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Watch for the $location\r\n scope.$watch(function() {\r\n\r\n return $location.path();\r\n\r\n }, function(newValue, oldValue) {\r\n\r\n var liElements = element[0].querySelectorAll('li[' + options.routeAttr + ']');\r\n\r\n angular.forEach(liElements, function(li) {\r\n\r\n var liElement = angular.element(li);\r\n var pattern = liElement.attr(options.routeAttr).replace('/', '\\\\/');\r\n if(options.strict) {\r\n pattern = '^' + pattern + '$';\r\n }\r\n var regexp = new RegExp(pattern, ['i']);\r\n\r\n if(regexp.test(newValue)) {\r\n liElement.addClass(options.activeClass);\r\n } else {\r\n liElement.removeClass(options.activeClass);\r\n }\r\n\r\n });\r\n\r\n });\r\n\r\n }\r\n\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/parse-options.js b/dist/modules/parse-options.js
index 4199bd5a0..ce1f463a9 100644
--- a/dist/modules/parse-options.js
+++ b/dist/modules/parse-options.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/parse-options.min.js b/dist/modules/parse-options.min.js
index 8bffcce39..a25cce835 100644
--- a/dist/modules/parse-options.min.js
+++ b/dist/modules/parse-options.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/parse-options.min.js.map b/dist/modules/parse-options.min.js.map
index 9f8b5f706..f6b14ab02 100644
--- a/dist/modules/parse-options.min.js.map
+++ b/dist/modules/parse-options.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["helpers/parse-options.js"],"names":[],"mappings":"sIAcY,qLAGJ,MAAI,SAAU,KAAQ,SAAW,EAAA,iFA0CjC,GAAA,GAAc,EACd,EAAO,EAAA,EAAA,wCAvCP,GAAI,MAGF,EAAA,QAAc,UAAiB,EAAK,KACxB,cAGZ,GAAA,EAAmB,EAAY,EAAA,EAAA,EAAA,WAEpB,KAAO,wDAGpB,EAAc,EAAA,IAAW,EAAA,GACvB,EAAU,EAAK,KACT,EAAS,EAAQ,IAAA,MACrB,EAAc,EAAA,GAAU,EAAA,GAAS,KAC1B,EAAA,EAAc,8BAIzB,MAAA,GAAA,KAAc,EAAA,EAAe,IAC3B,KAAI,SAAQ,GAEZ,MADA,GAAM,QAAa,EAAA,EAAA,EAAA,MACZ,EAAU,sCAKnB,GAAA,YACE,GAAA,GAAkB,EACZ,EAAS","file":"parse-options.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.helpers.parseOptions', [])\n\n .provider('$parseOptions', function() {\n\n var defaults = this.defaults = {\n regexp: /^\\s*(.*?)(?:\\s+as\\s+(.*?))?(?:\\s+group\\s+by\\s+(.*))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+(.*?)(?:\\s+track\\s+by\\s+(.*?))?$/\n };\n\n this.$get = function($parse, $q) {\n\n function ParseOptionsFactory(attr, config) {\n\n var $parseOptions = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n $parseOptions.$values = [];\n\n // Private vars\n var match, displayFn, valueName, keyName, groupByFn, valueFn, valuesFn;\n\n $parseOptions.init = function() {\n $parseOptions.$match = match = attr.match(options.regexp);\n displayFn = $parse(match[2] || match[1]),\n valueName = match[4] || match[6],\n keyName = match[5],\n groupByFn = $parse(match[3] || ''),\n valueFn = $parse(match[2] ? match[1] : valueName),\n valuesFn = $parse(match[7]);\n };\n\n $parseOptions.valuesFn = function(scope, controller) {\n return $q.when(valuesFn(scope, controller))\n .then(function(values) {\n $parseOptions.$values = values ? parseValues(values, scope) : {};\n return $parseOptions.$values;\n });\n };\n\n $parseOptions.displayValue = function(modelValue) {\n var scope = {};\n scope[valueName] = modelValue;\n return displayFn(scope);\n };\n\n // Private functions\n\n function parseValues(values, scope) {\n return values.map(function(match, index) {\n var locals = {}, label, value;\n locals[valueName] = match;\n label = displayFn(scope, locals);\n value = valueFn(scope, locals);\n return {label: label, value: value, index: index};\n });\n }\n\n $parseOptions.init();\n return $parseOptions;\n\n }\n\n return ParseOptionsFactory;\n\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["helpers/parse-options.js"],"names":[],"mappings":"sIAcY,qLAGJ,MAAI,SAAU,KAAQ,SAAW,EAAA,iFA0CjC,GAAA,GAAc,EACd,EAAO,EAAA,EAAA,wCAvCP,GAAI,MAGF,EAAA,QAAc,UAAiB,EAAK,KACxB,cAGZ,GAAA,EAAmB,EAAY,EAAA,EAAA,EAAA,WAEpB,KAAO,wDAGpB,EAAc,EAAA,IAAW,EAAA,GACvB,EAAU,EAAK,KACT,EAAS,EAAQ,IAAA,MACrB,EAAc,EAAA,GAAU,EAAA,GAAS,KAC1B,EAAA,EAAc,8BAIzB,MAAA,GAAA,KAAc,EAAA,EAAe,IAC3B,KAAI,SAAQ,GAEZ,MADA,GAAM,QAAa,EAAA,EAAA,EAAA,MACZ,EAAU,sCAKnB,GAAA,YACE,GAAA,GAAkB,EACZ,EAAS","file":"parse-options.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.helpers.parseOptions', [])\r\n\r\n .provider('$parseOptions', function() {\r\n\r\n var defaults = this.defaults = {\r\n regexp: /^\\s*(.*?)(?:\\s+as\\s+(.*?))?(?:\\s+group\\s+by\\s+(.*))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+(.*?)(?:\\s+track\\s+by\\s+(.*?))?$/\r\n };\r\n\r\n this.$get = function($parse, $q) {\r\n\r\n function ParseOptionsFactory(attr, config) {\r\n\r\n var $parseOptions = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n $parseOptions.$values = [];\r\n\r\n // Private vars\r\n var match, displayFn, valueName, keyName, groupByFn, valueFn, valuesFn;\r\n\r\n $parseOptions.init = function() {\r\n $parseOptions.$match = match = attr.match(options.regexp);\r\n displayFn = $parse(match[2] || match[1]),\r\n valueName = match[4] || match[6],\r\n keyName = match[5],\r\n groupByFn = $parse(match[3] || ''),\r\n valueFn = $parse(match[2] ? match[1] : valueName),\r\n valuesFn = $parse(match[7]);\r\n };\r\n\r\n $parseOptions.valuesFn = function(scope, controller) {\r\n return $q.when(valuesFn(scope, controller))\r\n .then(function(values) {\r\n $parseOptions.$values = values ? parseValues(values, scope) : {};\r\n return $parseOptions.$values;\r\n });\r\n };\r\n\r\n $parseOptions.displayValue = function(modelValue) {\r\n var scope = {};\r\n scope[valueName] = modelValue;\r\n return displayFn(scope);\r\n };\r\n\r\n // Private functions\r\n\r\n function parseValues(values, scope) {\r\n return values.map(function(match, index) {\r\n var locals = {}, label, value;\r\n locals[valueName] = match;\r\n label = displayFn(scope, locals);\r\n value = valueFn(scope, locals);\r\n return {label: label, value: value, index: index};\r\n });\r\n }\r\n\r\n $parseOptions.init();\r\n return $parseOptions;\r\n\r\n }\r\n\r\n return ParseOptionsFactory;\r\n\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/popover.js b/dist/modules/popover.js
index b085bcef1..dc07244de 100644
--- a/dist/modules/popover.js
+++ b/dist/modules/popover.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/popover.min.js b/dist/modules/popover.min.js
index e3f53379a..7133b586f 100644
--- a/dist/modules/popover.min.js
+++ b/dist/modules/popover.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/popover.min.js.map b/dist/modules/popover.min.js.map
index 319e11de8..a7bb43253 100644
--- a/dist/modules/popover.min.js.map
+++ b/dist/modules/popover.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["popover/popover.js"],"names":[],"mappings":"qBASM,OAAA,0BAAW,oCAEX,WAAW,cAEX,GAAA,KAAiB,UACjB,UAAS,UACT,YAAU,GACV,WAAM,EACN,QAAO,EACP,UAAS,QACT,SAAO,2BACP,iBAAW,8BAGb,MAAK,WAEH,QAAS,8BAKP,MAAI,WAAW,SAAS,gDAOxB,EAAO,EAAA,EAAA,sBAIT,EAAO,OAAA,QAAA,EAAA,kCAaD,aAAS,UAAgB,OAAS,WAAM,SAAA,EAAA,EAAA,+DAKvC,uCAKH,IAAa,MAAK,WAChB,SAAa,WAAK,kBAAY,YAAA,YAAA,SAAA,QAAA,UAAA,WAAA,OAAA,YAAA,cAAA,aAAA,SAAA,GAC9B,QAAQ,UAAU,EAAA,MAAa,EAAA,GAAA,EAAA,6GAOnC,QAAK,UAAa,IAAa,EAAyB,WACnD,GAAQ,EAAS,0BAMlB,WAAW,EAAQ,OAAA,EAAA,UAAA,SAAA,EAAA,uBAEpB,QAAA,OAAA,EAAA,eAID,QAAI,UAAY,IAAQ,EAAqB,WAC7C,GAAW,EAAS,yBAKtB,EAAI,QAAU,EAAA,OAAS,EAAS,OAAA,SAAA,uFAGhC,KAAU,EAAY,EAAA,OAAW,EAAA,kEASpC,EAAA","file":"popover.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.popover', ['mgcrea.ngStrap.tooltip'])\n\n .provider('$popover', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n customClass: '',\n container: false,\n target: false,\n placement: 'right',\n template: 'popover/popover.tpl.html',\n contentTemplate: false,\n trigger: 'click',\n keyboard: true,\n html: false,\n title: '',\n content: '',\n delay: 0,\n autoClose: false\n };\n\n this.$get = function($tooltip) {\n\n function PopoverFactory(element, config) {\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n var $popover = $tooltip(element, options);\n\n // Support scope as string options [/*title, */content]\n if(options.content) {\n $popover.$scope.content = options.content;\n }\n\n return $popover;\n\n }\n\n return PopoverFactory;\n\n };\n\n })\n\n .directive('bsPopover', function($window, $sce, $popover) {\n\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'customClass', 'autoClose'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\n popover && popover.$applyPlacement();\n });\n });\n });\n\n // Support scope as an object\n attr.bsPopover && scope.$watch(attr.bsPopover, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\n popover && popover.$applyPlacement();\n });\n }, true);\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!popover || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(popover),?/i);\n newValue === true ? popover.show() : popover.hide();\n });\n\n // Initialize popover\n var popover = $popover(element, options);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (popover) popover.destroy();\n options = null;\n popover = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["popover/popover.js"],"names":[],"mappings":"qBASM,OAAA,0BAAW,oCAEX,WAAW,cAEX,GAAA,KAAiB,UACjB,UAAS,UACT,YAAU,GACV,WAAM,EACN,QAAO,EACP,UAAS,QACT,SAAO,2BACP,iBAAW,8BAGb,MAAK,WAEH,QAAS,8BAKP,MAAI,WAAW,SAAS,gDAOxB,EAAO,EAAA,EAAA,sBAIT,EAAO,OAAA,QAAA,EAAA,kCAaD,aAAS,UAAgB,OAAS,WAAM,SAAA,EAAA,EAAA,+DAKvC,uCAKH,IAAa,MAAK,WAChB,SAAa,WAAK,kBAAY,YAAA,YAAA,SAAA,QAAA,UAAA,WAAA,OAAA,YAAA,cAAA,aAAA,SAAA,GAC9B,QAAQ,UAAU,EAAA,MAAa,EAAA,GAAA,EAAA,6GAOnC,QAAK,UAAa,IAAa,EAAyB,WACnD,GAAQ,EAAS,0BAMlB,WAAW,EAAQ,OAAA,EAAA,UAAA,SAAA,EAAA,uBAEpB,QAAA,OAAA,EAAA,eAID,QAAI,UAAY,IAAQ,EAAqB,WAC7C,GAAW,EAAS,yBAKtB,EAAI,QAAU,EAAA,OAAS,EAAS,OAAA,SAAA,uFAGhC,KAAU,EAAY,EAAA,OAAW,EAAA,kEASpC,EAAA","file":"popover.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.popover', ['mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$popover', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n customClass: '',\r\n container: false,\r\n target: false,\r\n placement: 'right',\r\n template: 'popover/popover.tpl.html',\r\n contentTemplate: false,\r\n trigger: 'click',\r\n keyboard: true,\r\n html: false,\r\n title: '',\r\n content: '',\r\n delay: 0,\r\n autoClose: false\r\n };\r\n\r\n this.$get = function($tooltip) {\r\n\r\n function PopoverFactory(element, config) {\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n var $popover = $tooltip(element, options);\r\n\r\n // Support scope as string options [/*title, */content]\r\n if(options.content) {\r\n $popover.$scope.content = options.content;\r\n }\r\n\r\n return $popover;\r\n\r\n }\r\n\r\n return PopoverFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsPopover', function($window, $sce, $popover) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'customClass', 'autoClose'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Support scope as data-attrs\r\n angular.forEach(['title', 'content'], function(key) {\r\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\r\n scope[key] = $sce.trustAsHtml(newValue);\r\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\r\n popover && popover.$applyPlacement();\r\n });\r\n });\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsPopover && scope.$watch(attr.bsPopover, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.content = newValue;\r\n }\r\n angular.isDefined(oldValue) && requestAnimationFrame(function() {\r\n popover && popover.$applyPlacement();\r\n });\r\n }, true);\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!popover || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(popover),?/i);\r\n newValue === true ? popover.show() : popover.hide();\r\n });\r\n\r\n // Initialize popover\r\n var popover = $popover(element, options);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (popover) popover.destroy();\r\n options = null;\r\n popover = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/popover.tpl.js b/dist/modules/popover.tpl.js
index fe1b02e58..80528fa12 100644
--- a/dist/modules/popover.tpl.js
+++ b/dist/modules/popover.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/popover.tpl.min.js b/dist/modules/popover.tpl.min.js
index e0c39e6cb..49a7b0cd2 100644
--- a/dist/modules/popover.tpl.min.js
+++ b/dist/modules/popover.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/raf.js b/dist/modules/raf.js
index 270e3c5b7..140740b36 100644
--- a/dist/modules/raf.js
+++ b/dist/modules/raf.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/raf.min.js b/dist/modules/raf.min.js
index 9b8f87e94..b46c114f4 100644
--- a/dist/modules/raf.min.js
+++ b/dist/modules/raf.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/raf.min.js.map b/dist/modules/raf.min.js.map
index 66b662392..f94fcff84 100644
--- a/dist/modules/raf.min.js.map
+++ b/dist/modules/raf.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["helpers/raf.js"],"names":[],"mappings":"8GAW6B,WAAQ,SAAA,EAAA,SAER,EAAQ,sDAEd,EAAA,yBAEnB,EAAa,EAAA,sBACF,EAAsB,4BACb,EAAA,yBACK,EAAA,wCAGzB,EAAA,WACM,GACJ,GAAA,GAAO,EAAW,SAChB,mBAIN,SAAI,sBAEJ,OAAO","file":"raf.min.js","sourcesContent":["'use strict';\n\n(angular.version.minor < 3 && angular.version.dot < 14) && angular.module('ng')\n\n.factory('$$rAF', function($window, $timeout) {\n\n var requestAnimationFrame = $window.requestAnimationFrame ||\n $window.webkitRequestAnimationFrame ||\n $window.mozRequestAnimationFrame;\n\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\n $window.webkitCancelAnimationFrame ||\n $window.mozCancelAnimationFrame ||\n $window.webkitCancelRequestAnimationFrame;\n\n var rafSupported = !!requestAnimationFrame;\n var raf = rafSupported ?\n function(fn) {\n var id = requestAnimationFrame(fn);\n return function() {\n cancelAnimationFrame(id);\n };\n } :\n function(fn) {\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n return function() {\n $timeout.cancel(timer);\n };\n };\n\n raf.supported = rafSupported;\n\n return raf;\n\n});\n\n// .factory('$$animateReflow', function($$rAF, $document) {\n\n// var bodyEl = $document[0].body;\n\n// return function(fn) {\n// //the returned function acts as the cancellation function\n// return $$rAF(function() {\n// //the line below will force the browser to perform a repaint\n// //so that all the animated elements within the animation frame\n// //will be properly updated and drawn on screen. This is\n// //required to perform multi-class CSS based animations with\n// //Firefox. DO NOT REMOVE THIS LINE.\n// var a = bodyEl.offsetWidth + 1;\n// fn();\n// });\n// };\n\n// });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["helpers/raf.js"],"names":[],"mappings":"8GAW6B,WAAQ,SAAA,EAAA,SAER,EAAQ,sDAEd,EAAA,yBAEnB,EAAa,EAAA,sBACF,EAAsB,4BACb,EAAA,yBACK,EAAA,wCAGzB,EAAA,WACM,GACJ,GAAA,GAAO,EAAW,SAChB,mBAIN,SAAI,sBAEJ,OAAO","file":"raf.min.js","sourcesContent":["'use strict';\r\n\r\n(angular.version.minor < 3 && angular.version.dot < 14) && angular.module('ng')\r\n\r\n.factory('$$rAF', function($window, $timeout) {\r\n\r\n var requestAnimationFrame = $window.requestAnimationFrame ||\r\n $window.webkitRequestAnimationFrame ||\r\n $window.mozRequestAnimationFrame;\r\n\r\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\r\n $window.webkitCancelAnimationFrame ||\r\n $window.mozCancelAnimationFrame ||\r\n $window.webkitCancelRequestAnimationFrame;\r\n\r\n var rafSupported = !!requestAnimationFrame;\r\n var raf = rafSupported ?\r\n function(fn) {\r\n var id = requestAnimationFrame(fn);\r\n return function() {\r\n cancelAnimationFrame(id);\r\n };\r\n } :\r\n function(fn) {\r\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\r\n return function() {\r\n $timeout.cancel(timer);\r\n };\r\n };\r\n\r\n raf.supported = rafSupported;\r\n\r\n return raf;\r\n\r\n});\r\n\r\n// .factory('$$animateReflow', function($$rAF, $document) {\r\n\r\n// var bodyEl = $document[0].body;\r\n\r\n// return function(fn) {\r\n// //the returned function acts as the cancellation function\r\n// return $$rAF(function() {\r\n// //the line below will force the browser to perform a repaint\r\n// //so that all the animated elements within the animation frame\r\n// //will be properly updated and drawn on screen. This is\r\n// //required to perform multi-class CSS based animations with\r\n// //Firefox. DO NOT REMOVE THIS LINE.\r\n// var a = bodyEl.offsetWidth + 1;\r\n// fn();\r\n// });\r\n// };\r\n\r\n// });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/scrollspy.js b/dist/modules/scrollspy.js
index 9424de7a3..35dc60b6e 100644
--- a/dist/modules/scrollspy.js
+++ b/dist/modules/scrollspy.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/scrollspy.min.js b/dist/modules/scrollspy.min.js
index 4308ecd99..14aeb5b50 100644
--- a/dist/modules/scrollspy.min.js
+++ b/dist/modules/scrollspy.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/scrollspy.min.js.map b/dist/modules/scrollspy.min.js.map
index 2b00e77e3..c302eb38d 100644
--- a/dist/modules/scrollspy.min.js.map
+++ b/dist/modules/scrollspy.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["scrollspy/scrollspy.js"],"names":[],"mappings":"qBASQ,OAAA,4BAA2B,kCAAA,+CAE7B,aAAU,kDAMV,SAAI,IACJ,SAAI,IACJ,OAAI,oHAWE,GAAU,EAAQ,GACtB,MAAI,GAAQ,GAAA,UAAiB,EAAA,GAAU,SAAA,gBAAA,EAAA,sBAGnC,GAAW,GAGf,GAAG,GAAM,QAAW,UAAA,EAAA,EAClB,GAAM,UAAU,EAAA,QAAA,MAChB,GAAa,EAAA,EAAA,QAAA,kDAOf,MADA,GAAI,GAAA,UACA,EAAA,EAGJ,IAGI,GAAA,EAGJ,MAGE,MATE,KAIA,EAAA,EAAA,kCASF,KAAA,WAGA,KAAA,QAAY,EAGZ,EAAA,EAA0B,KAAW,cAAI,EAAA,UACzC,EAAA,EAA6B,KAAA,cAAe,EAAA,UAC5C,EAAA,GAAA,QAAA,KAAA,gEAIoB,EAAA,KAAA,aAAA,EAAA,mHAepB,KAAA,UACA,KAAA,QAAa,uFAQf,iBAGM,GAAA,mDAUK,EAAW,EAAA,YAAiB,EAAe,KAAA,eAAA,mDAMlD,EAAG,EAAiB,GAAA,WAAkB,IAAQ,EAAA,GAAA,OAC9C,MAAG,GAAY,iBAAkB,EAAW,+GAOhD,EAAW,EAAA,GAAA,4HAUH,EAAgB,cAAW,sEAQjC,KACA,EAAe,OAAS,YAAA,UACrB,EAAS,EAAgB,OAAS,OAAS,EAAQ,EAAgB,OAAA,SAAU,SAAO,OACrF,EAAe,OAAS,SAAS,SAAS,YAAA,WAI9C,EAAW,EAAA,OACT,EAAO,OAAA,SAAgB,UACrB,EAAO,EAAI,OAAW,OAAA,EAAA,EAAA,OAAA,SAAA,SAAA,SACrB,OAAA,SAAA,SAAA,SAAA,4CAKL,MAAA,GAAW,OAAe,SAAW,yBAEnC,sCAOQ,QAAA,EAAa,SAAA,GACnB,GAAA,GAAU,SAAc,cAAA,EAAA,2CAEzB,EAAK,QAAe,OAAA,EAAA,YAAA,EAAA,WAAA,EAAA,EAAA,cAIrB,OAAA,SAAA,kDAIF,MAAW,GAAA,UAAA,EAAe,mBAOnB,aAAmB,SAAA,EAAW,KACpB,MAAA,OAAA,EAAA,OAAA,2CAIf,wDAGF,EAAW,CACT,wBAMF,EAAO,SAAA,SAAA,0CAhLP,GAAO,QAAW,QAAA,0GAiMlB,eAAiB,aAAU,WAAoB,aAAK,aAAA,SAAA,EAAA,EAAA,EAAA,8BAIhD,SAAY,EAAW,EAAA,kBAG3B,SAAM,SAAI,SAAY,UAAW,SAAA,GAC/B,QAAI,UAAW,EAAA,MAAA,EAAA,GAAA,EAAA,mBAIf,aAAU,EAAA,OAAA,4GAiBV,mBAAsB,aAAQ,WAAA,aAAA,aAAA,6HAOnC,GAAA,GAAA,QAAA,QAAA","file":"scrollspy.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.scrollspy', ['mgcrea.ngStrap.helpers.debounce', 'mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$scrollspy', function() {\n\n // Pool of registered spies\n var spies = this.$$spies = {};\n\n var defaults = this.defaults = {\n debounce: 150,\n throttle: 100,\n offset: 100\n };\n\n this.$get = function($window, $document, $rootScope, dimensions, debounce, throttle) {\n\n var windowEl = angular.element($window);\n var docEl = angular.element($document.prop('documentElement'));\n var bodyEl = angular.element($window.document.body);\n\n // Helper functions\n\n function nodeName(element, name) {\n return element[0].nodeName && element[0].nodeName.toLowerCase() === name.toLowerCase();\n }\n\n function ScrollSpyFactory(config) {\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n if(!options.element) options.element = bodyEl;\n var isWindowSpy = nodeName(options.element, 'body');\n var scrollEl = isWindowSpy ? windowEl : options.element;\n var scrollId = isWindowSpy ? 'window' : options.id;\n\n // Use existing spy\n if(spies[scrollId]) {\n spies[scrollId].$$count++;\n return spies[scrollId];\n }\n\n var $scrollspy = {};\n\n // Private vars\n var unbindViewContentLoaded, unbindIncludeContentLoaded;\n var trackedElements = $scrollspy.$trackedElements = [];\n var sortedElements = [];\n var activeTarget;\n var debouncedCheckPosition;\n var throttledCheckPosition;\n var debouncedCheckOffsets;\n var viewportHeight;\n var scrollTop;\n\n $scrollspy.init = function() {\n\n // Setup internal ref counter\n this.$$count = 1;\n\n // Bind events\n debouncedCheckPosition = debounce(this.checkPosition, options.debounce);\n throttledCheckPosition = throttle(this.checkPosition, options.throttle);\n scrollEl.on('click', this.checkPositionWithEventLoop);\n windowEl.on('resize', debouncedCheckPosition);\n scrollEl.on('scroll', throttledCheckPosition);\n\n debouncedCheckOffsets = debounce(this.checkOffsets, options.debounce);\n unbindViewContentLoaded = $rootScope.$on('$viewContentLoaded', debouncedCheckOffsets);\n unbindIncludeContentLoaded = $rootScope.$on('$includeContentLoaded', debouncedCheckOffsets);\n debouncedCheckOffsets();\n\n // Register spy for reuse\n if(scrollId) {\n spies[scrollId] = $scrollspy;\n }\n\n };\n\n $scrollspy.destroy = function() {\n\n // Check internal ref counter\n this.$$count--;\n if(this.$$count > 0) {\n return;\n }\n\n // Unbind events\n scrollEl.off('click', this.checkPositionWithEventLoop);\n windowEl.off('resize', debouncedCheckPosition);\n scrollEl.off('scroll', throttledCheckPosition);\n unbindViewContentLoaded();\n unbindIncludeContentLoaded();\n if (scrollId) {\n delete spies[scrollId];\n }\n };\n\n $scrollspy.checkPosition = function() {\n\n // Not ready yet\n if(!sortedElements.length) return;\n\n // Calculate the scroll position\n scrollTop = (isWindowSpy ? $window.pageYOffset : scrollEl.prop('scrollTop')) || 0;\n\n // Calculate the viewport height for use by the components\n viewportHeight = Math.max($window.innerHeight, docEl.prop('clientHeight'));\n\n // Activate first element if scroll is smaller\n if(scrollTop < sortedElements[0].offsetTop && activeTarget !== sortedElements[0].target) {\n return $scrollspy.$activateElement(sortedElements[0]);\n }\n\n // Activate proper element\n for (var i = sortedElements.length; i--;) {\n if(angular.isUndefined(sortedElements[i].offsetTop) || sortedElements[i].offsetTop === null) continue;\n if(activeTarget === sortedElements[i].target) continue;\n if(scrollTop < sortedElements[i].offsetTop) continue;\n if(sortedElements[i + 1] && scrollTop > sortedElements[i + 1].offsetTop) continue;\n return $scrollspy.$activateElement(sortedElements[i]);\n }\n\n };\n\n $scrollspy.checkPositionWithEventLoop = function() {\n // IE 9 throws an error if we use 'this' instead of '$scrollspy'\n // in this setTimeout call\n setTimeout($scrollspy.checkPosition, 1);\n };\n\n // Protected methods\n\n $scrollspy.$activateElement = function(element) {\n if(activeTarget) {\n var activeElement = $scrollspy.$getTrackedElement(activeTarget);\n if(activeElement) {\n activeElement.source.removeClass('active');\n if(nodeName(activeElement.source, 'li') && nodeName(activeElement.source.parent().parent(), 'li')) {\n activeElement.source.parent().parent().removeClass('active');\n }\n }\n }\n activeTarget = element.target;\n element.source.addClass('active');\n if(nodeName(element.source, 'li') && nodeName(element.source.parent().parent(), 'li')) {\n element.source.parent().parent().addClass('active');\n }\n };\n\n $scrollspy.$getTrackedElement = function(target) {\n return trackedElements.filter(function(obj) {\n return obj.target === target;\n })[0];\n };\n\n // Track offsets behavior\n\n $scrollspy.checkOffsets = function() {\n\n angular.forEach(trackedElements, function(trackedElement) {\n var targetElement = document.querySelector(trackedElement.target);\n trackedElement.offsetTop = targetElement ? dimensions.offset(targetElement).top : null;\n if(options.offset && trackedElement.offsetTop !== null) trackedElement.offsetTop -= options.offset * 1;\n });\n\n sortedElements = trackedElements\n .filter(function(el) {\n return el.offsetTop !== null;\n })\n .sort(function(a, b) {\n return a.offsetTop - b.offsetTop;\n });\n\n debouncedCheckPosition();\n\n };\n\n $scrollspy.trackElement = function(target, source) {\n trackedElements.push({target: target, source: source});\n };\n\n $scrollspy.untrackElement = function(target, source) {\n var toDelete;\n for (var i = trackedElements.length; i--;) {\n if(trackedElements[i].target === target && trackedElements[i].source === source) {\n toDelete = i;\n break;\n }\n }\n trackedElements = trackedElements.splice(toDelete, 1);\n };\n\n $scrollspy.activate = function(i) {\n trackedElements[i].addClass('active');\n };\n\n // Initialize plugin\n\n $scrollspy.init();\n return $scrollspy;\n\n }\n\n return ScrollSpyFactory;\n\n };\n\n })\n\n .directive('bsScrollspy', function($rootScope, debounce, dimensions, $scrollspy) {\n\n return {\n restrict: 'EAC',\n link: function postLink(scope, element, attr) {\n\n var options = {scope: scope};\n angular.forEach(['offset', 'target'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n var scrollspy = $scrollspy(options);\n scrollspy.trackElement(options.target, element);\n\n scope.$on('$destroy', function() {\n if (scrollspy) {\n scrollspy.untrackElement(options.target, element);\n scrollspy.destroy();\n }\n options = null;\n scrollspy = null;\n });\n\n }\n };\n\n })\n\n\n .directive('bsScrollspyList', function($rootScope, debounce, dimensions, $scrollspy) {\n\n return {\n restrict: 'A',\n compile: function postLink(element, attr) {\n var children = element[0].querySelectorAll('li > a[href]');\n angular.forEach(children, function(child) {\n var childEl = angular.element(child);\n childEl.parent().attr('bs-scrollspy', '').attr('data-target', childEl.attr('href'));\n });\n }\n\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["scrollspy/scrollspy.js"],"names":[],"mappings":"qBASQ,OAA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e,mBAOnB,aAAmB,SAAA,EAAW,KACpB,MAAA,OAAA,EAAA,OAAA,2CAIf,wDAGF,EAAW,CACT,wBAMF,EAAO,SAAA,SAAA,0CAhLP,GAAO,QAAW,QAAA,0GAiMlB,eAAiB,aAAU,WAAoB,aAAK,aAAA,SAAA,EAAA,EAAA,EAAA,8BAIhD,SAAY,EAAW,EAAA,kBAG3B,SAAM,SAAI,SAAY,UAAW,SAAA,GAC/B,QAAI,UAAW,EAAA,MAAA,EAAA,GAAA,EAAA,mBAIf,aAAU,EAAA,OAAA,4GAiBV,mBAAsB,aAAQ,WAAA,aAAA,aAAA,6HAOnC,GAAA,GAAA,QAAA,QAAA","file":"scrollspy.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.scrollspy', ['mgcrea.ngStrap.helpers.debounce', 'mgcrea.ngStrap.helpers.dimensions'])\r\n\r\n .provider('$scrollspy', function() {\r\n\r\n // Pool of registered spies\r\n var spies = this.$$spies = {};\r\n\r\n var defaults = this.defaults = {\r\n debounce: 150,\r\n throttle: 100,\r\n offset: 100\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, dimensions, debounce, throttle) {\r\n\r\n var windowEl = angular.element($window);\r\n var docEl = angular.element($document.prop('documentElement'));\r\n var bodyEl = angular.element($window.document.body);\r\n\r\n // Helper functions\r\n\r\n function nodeName(element, name) {\r\n return element[0].nodeName && element[0].nodeName.toLowerCase() === name.toLowerCase();\r\n }\r\n\r\n function ScrollSpyFactory(config) {\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n if(!options.element) options.element = bodyEl;\r\n var isWindowSpy = nodeName(options.element, 'body');\r\n var scrollEl = isWindowSpy ? windowEl : options.element;\r\n var scrollId = isWindowSpy ? 'window' : options.id;\r\n\r\n // Use existing spy\r\n if(spies[scrollId]) {\r\n spies[scrollId].$$count++;\r\n return spies[scrollId];\r\n }\r\n\r\n var $scrollspy = {};\r\n\r\n // Private vars\r\n var unbindViewContentLoaded, unbindIncludeContentLoaded;\r\n var trackedElements = $scrollspy.$trackedElements = [];\r\n var sortedElements = [];\r\n var activeTarget;\r\n var debouncedCheckPosition;\r\n var throttledCheckPosition;\r\n var debouncedCheckOffsets;\r\n var viewportHeight;\r\n var scrollTop;\r\n\r\n $scrollspy.init = function() {\r\n\r\n // Setup internal ref counter\r\n this.$$count = 1;\r\n\r\n // Bind events\r\n debouncedCheckPosition = debounce(this.checkPosition, options.debounce);\r\n throttledCheckPosition = throttle(this.checkPosition, options.throttle);\r\n scrollEl.on('click', this.checkPositionWithEventLoop);\r\n windowEl.on('resize', debouncedCheckPosition);\r\n scrollEl.on('scroll', throttledCheckPosition);\r\n\r\n debouncedCheckOffsets = debounce(this.checkOffsets, options.debounce);\r\n unbindViewContentLoaded = $rootScope.$on('$viewContentLoaded', debouncedCheckOffsets);\r\n unbindIncludeContentLoaded = $rootScope.$on('$includeContentLoaded', debouncedCheckOffsets);\r\n debouncedCheckOffsets();\r\n\r\n // Register spy for reuse\r\n if(scrollId) {\r\n spies[scrollId] = $scrollspy;\r\n }\r\n\r\n };\r\n\r\n $scrollspy.destroy = function() {\r\n\r\n // Check internal ref counter\r\n this.$$count--;\r\n if(this.$$count > 0) {\r\n return;\r\n }\r\n\r\n // Unbind events\r\n scrollEl.off('click', this.checkPositionWithEventLoop);\r\n windowEl.off('resize', debouncedCheckPosition);\r\n scrollEl.off('scroll', throttledCheckPosition);\r\n unbindViewContentLoaded();\r\n unbindIncludeContentLoaded();\r\n if (scrollId) {\r\n delete spies[scrollId];\r\n }\r\n };\r\n\r\n $scrollspy.checkPosition = function() {\r\n\r\n // Not ready yet\r\n if(!sortedElements.length) return;\r\n\r\n // Calculate the scroll position\r\n scrollTop = (isWindowSpy ? $window.pageYOffset : scrollEl.prop('scrollTop')) || 0;\r\n\r\n // Calculate the viewport height for use by the components\r\n viewportHeight = Math.max($window.innerHeight, docEl.prop('clientHeight'));\r\n\r\n // Activate first element if scroll is smaller\r\n if(scrollTop < sortedElements[0].offsetTop && activeTarget !== sortedElements[0].target) {\r\n return $scrollspy.$activateElement(sortedElements[0]);\r\n }\r\n\r\n // Activate proper element\r\n for (var i = sortedElements.length; i--;) {\r\n if(angular.isUndefined(sortedElements[i].offsetTop) || sortedElements[i].offsetTop === null) continue;\r\n if(activeTarget === sortedElements[i].target) continue;\r\n if(scrollTop < sortedElements[i].offsetTop) continue;\r\n if(sortedElements[i + 1] && scrollTop > sortedElements[i + 1].offsetTop) continue;\r\n return $scrollspy.$activateElement(sortedElements[i]);\r\n }\r\n\r\n };\r\n\r\n $scrollspy.checkPositionWithEventLoop = function() {\r\n // IE 9 throws an error if we use 'this' instead of '$scrollspy'\r\n // in this setTimeout call\r\n setTimeout($scrollspy.checkPosition, 1);\r\n };\r\n\r\n // Protected methods\r\n\r\n $scrollspy.$activateElement = function(element) {\r\n if(activeTarget) {\r\n var activeElement = $scrollspy.$getTrackedElement(activeTarget);\r\n if(activeElement) {\r\n activeElement.source.removeClass('active');\r\n if(nodeName(activeElement.source, 'li') && nodeName(activeElement.source.parent().parent(), 'li')) {\r\n activeElement.source.parent().parent().removeClass('active');\r\n }\r\n }\r\n }\r\n activeTarget = element.target;\r\n element.source.addClass('active');\r\n if(nodeName(element.source, 'li') && nodeName(element.source.parent().parent(), 'li')) {\r\n element.source.parent().parent().addClass('active');\r\n }\r\n };\r\n\r\n $scrollspy.$getTrackedElement = function(target) {\r\n return trackedElements.filter(function(obj) {\r\n return obj.target === target;\r\n })[0];\r\n };\r\n\r\n // Track offsets behavior\r\n\r\n $scrollspy.checkOffsets = function() {\r\n\r\n angular.forEach(trackedElements, function(trackedElement) {\r\n var targetElement = document.querySelector(trackedElement.target);\r\n trackedElement.offsetTop = targetElement ? dimensions.offset(targetElement).top : null;\r\n if(options.offset && trackedElement.offsetTop !== null) trackedElement.offsetTop -= options.offset * 1;\r\n });\r\n\r\n sortedElements = trackedElements\r\n .filter(function(el) {\r\n return el.offsetTop !== null;\r\n })\r\n .sort(function(a, b) {\r\n return a.offsetTop - b.offsetTop;\r\n });\r\n\r\n debouncedCheckPosition();\r\n\r\n };\r\n\r\n $scrollspy.trackElement = function(target, source) {\r\n trackedElements.push({target: target, source: source});\r\n };\r\n\r\n $scrollspy.untrackElement = function(target, source) {\r\n var toDelete;\r\n for (var i = trackedElements.length; i--;) {\r\n if(trackedElements[i].target === target && trackedElements[i].source === source) {\r\n toDelete = i;\r\n break;\r\n }\r\n }\r\n trackedElements = trackedElements.splice(toDelete, 1);\r\n };\r\n\r\n $scrollspy.activate = function(i) {\r\n trackedElements[i].addClass('active');\r\n };\r\n\r\n // Initialize plugin\r\n\r\n $scrollspy.init();\r\n return $scrollspy;\r\n\r\n }\r\n\r\n return ScrollSpyFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsScrollspy', function($rootScope, debounce, dimensions, $scrollspy) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n link: function postLink(scope, element, attr) {\r\n\r\n var options = {scope: scope};\r\n angular.forEach(['offset', 'target'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n var scrollspy = $scrollspy(options);\r\n scrollspy.trackElement(options.target, element);\r\n\r\n scope.$on('$destroy', function() {\r\n if (scrollspy) {\r\n scrollspy.untrackElement(options.target, element);\r\n scrollspy.destroy();\r\n }\r\n options = null;\r\n scrollspy = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n })\r\n\r\n\r\n .directive('bsScrollspyList', function($rootScope, debounce, dimensions, $scrollspy) {\r\n\r\n return {\r\n restrict: 'A',\r\n compile: function postLink(element, attr) {\r\n var children = element[0].querySelectorAll('li > a[href]');\r\n angular.forEach(children, function(child) {\r\n var childEl = angular.element(child);\r\n childEl.parent().attr('bs-scrollspy', '').attr('data-target', childEl.attr('href'));\r\n });\r\n }\r\n\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/select.js b/dist/modules/select.js
index 40e0a6a66..4c87370f5 100644
--- a/dist/modules/select.js
+++ b/dist/modules/select.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/select.min.js b/dist/modules/select.min.js
index 7fa179348..aa888a6b1 100644
--- a/dist/modules/select.min.js
+++ b/dist/modules/select.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/select.min.js.map b/dist/modules/select.min.js.map
index 94539275f..3ef915acd 100644
--- a/dist/modules/select.min.js.map
+++ b/dist/modules/select.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["select/select.js"],"names":[],"mappings":"qBASM,OAAA,yBAAa,yBAAA,iDAEb,UAAU,cAEV,GAAW,KAAA,UACX,UAAU,UACV,YAAM,SACN,YAAO,UACP,UAAU,cACV,SAAA,yBACA,QAAM,QACN,WAAW,EACX,UAAA,EACA,MAAA,EACA,MAAA,EACA,UAAA,EACA,gBAAe,EACf,MAAA,4FAGF,QAAK,sBAEH,UAAI,EACJ,cAAe,WACf,cAAe,0HASb,GAAmB,EAAS,EAAA,YAK5B,EAAM,QAAc,UAAQ,EAAA,EAE5B,GAAM,EAAA,EAAiB,EACvB,IAAA,GAAM,EAAW,qBAGjB,EAAM,aAAY,IAChB,YAAM,EAAa,WACjB,oBAAiB,EAAA,gBAAA,EAAA,wFAKnB,UAAM,SAAa,KACjB,aAAe,8BAKjB,QAAO,SAAQ,oEAOjB,MAAM,GAAA,gBAGA,UAAM,SAAQ,kDAKpB,IAAM,GAAA,GAAA,EAAA,EAAc,EAAA,SAAY,OAAA,IACzB,EAAQ,UAAO,IA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,SAAS,KAAM,UAAY,gBAAA,SAAA,EAAA,EAAA,EAAA,EAAA,oCAKnD,kDAKH,IAAI,MAAU,EAAA,YAAA,EAAA,wBACd,SAAY,YAAW,YAAA,QAAA,UAAA,WAAA,OAAA,YAAA,WAAA,cAAA,WAAA,iBAAA,YAAA,gBAAA,UAAA,YAAA,SAAA,GACvB,QAAU,UAAQ,EAAQ,MAAA,EAAA,GAAA,EAAA,8CAK5B,GAAI,GAAA,uGAGJ,EAAI,MAAS,GAIb,GAAA,GAAa,EAAgB,EAAS,WAGnC,EAAK,EAAS,EAAQ,EAAA,6CAItB,OAAA,EAAA,2BAGH,KAAM,SAAO,eAEX,EAAO,cAEN,GAGH,EAAA,OAAW,EAAA,QAAU,WAEnB,EAAI,qBACJ,EAAW,iBAIN,QAAO,cAER,GAAA,IACK,UAAA,QAAA,QAAA,EAAA,gBACL,EAAoB,YAAK,IAAA,SAAA,2BAEtB,QAAA,UAAA,GAAA,EAAA,OAAA,SAAA,GAAA,OAAA,IACL,OAAQ,QAAO,aACf,EAAW,QAAQ,EAAU,WAAS,EAAc,0EAMtD,EAAA,EAAW,UAAW,EAAe,aACnC,EAAQ,QAAS,UAAM,GAAW,EAAA,OAAA,SAAA,GAAA,OAAA,4CAKtC,EAAU,WACR,EAAI,SAAe,SAAA,GACnB,OAAU,GAAA,IAAA,EAAA,oDAOf,EAAA","file":"select.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.select', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\n\n .provider('$select', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'select',\n prefixEvent: '$select',\n placement: 'bottom-left',\n template: 'select/select.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n multiple: false,\n allNoneButtons: false,\n sort: true,\n caretHtml: ' ',\n placeholder: 'Choose among the following...',\n allText: 'All',\n noneText: 'None',\n maxLength: 3,\n maxLengthHtml: 'selected',\n iconCheckmark: 'glyphicon glyphicon-ok'\n };\n\n this.$get = function($window, $document, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var isTouch = ('createTouch' in $window.document) && isNative;\n\n function SelectFactory(element, controller, config) {\n\n var $select = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $select = $tooltip(element, options);\n var scope = $select.$scope;\n\n scope.$matches = [];\n scope.$activeIndex = 0;\n scope.$isMultiple = options.multiple;\n scope.$showAllNoneButtons = options.allNoneButtons && options.multiple;\n scope.$iconCheckmark = options.iconCheckmark;\n scope.$allText = options.allText;\n scope.$noneText = options.noneText;\n\n scope.$activate = function(index) {\n scope.$$postDigest(function() {\n $select.activate(index);\n });\n };\n\n scope.$select = function(index, evt) {\n scope.$$postDigest(function() {\n $select.select(index);\n });\n };\n\n scope.$isVisible = function() {\n return $select.$isVisible();\n };\n\n scope.$isActive = function(index) {\n return $select.$isActive(index);\n };\n\n scope.$selectAll = function () {\n for (var i = 0; i < scope.$matches.length; i++) {\n if (!scope.$isActive(i)) {\n scope.$select(i);\n }\n }\n };\n\n scope.$selectNone = function () {\n for (var i = 0; i < scope.$matches.length; i++) {\n if (scope.$isActive(i)) {\n scope.$select(i);\n }\n }\n };\n\n // Public methods\n\n $select.update = function(matches) {\n scope.$matches = matches;\n $select.$updateActiveIndex();\n };\n\n $select.activate = function(index) {\n if(options.multiple) {\n scope.$activeIndex.sort();\n $select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index);\n if(options.sort) scope.$activeIndex.sort();\n } else {\n scope.$activeIndex = index;\n }\n return scope.$activeIndex;\n };\n\n $select.select = function(index) {\n var value = scope.$matches[index].value;\n scope.$apply(function() {\n $select.activate(index);\n if(options.multiple) {\n controller.$setViewValue(scope.$activeIndex.map(function(index) {\n return scope.$matches[index].value;\n }));\n } else {\n controller.$setViewValue(value);\n // Hide if single select\n $select.hide();\n }\n });\n // Emit event\n scope.$emit(options.prefixEvent + '.select', value, index);\n };\n\n // Protected methods\n\n $select.$updateActiveIndex = function() {\n if(controller.$modelValue && scope.$matches.length) {\n if(options.multiple && angular.isArray(controller.$modelValue)) {\n scope.$activeIndex = controller.$modelValue.map(function(value) {\n return $select.$getIndex(value);\n });\n } else {\n scope.$activeIndex = $select.$getIndex(controller.$modelValue);\n }\n } else if(scope.$activeIndex >= scope.$matches.length) {\n scope.$activeIndex = options.multiple ? [] : 0;\n }\n };\n\n $select.$isVisible = function() {\n if(!options.minLength || !controller) {\n return scope.$matches.length;\n }\n // minLength support\n return scope.$matches.length && controller.$viewValue.length >= options.minLength;\n };\n\n $select.$isActive = function(index) {\n if(options.multiple) {\n return scope.$activeIndex.indexOf(index) !== -1;\n } else {\n return scope.$activeIndex === index;\n }\n };\n\n $select.$getIndex = function(value) {\n var l = scope.$matches.length, i = l;\n if(!l) return;\n for(i = l; i--;) {\n if(scope.$matches[i].value === value) break;\n }\n if(i < 0) return;\n return i;\n };\n\n $select.$onMouseDown = function(evt) {\n // Prevent blur on mousedown on .dropdown-menu\n evt.preventDefault();\n evt.stopPropagation();\n // Emulate click for mobile devices\n if(isTouch) {\n var targetEl = angular.element(evt.target);\n targetEl.triggerHandler('click');\n }\n };\n\n $select.$onKeyDown = function(evt) {\n if (!/(9|13|38|40)/.test(evt.keyCode)) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n // Select with enter\n if(!options.multiple && (evt.keyCode === 13 || evt.keyCode === 9)) {\n return $select.select(scope.$activeIndex);\n }\n\n // Navigate with keyboard\n if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\n scope.$digest();\n };\n\n // Overrides\n\n var _show = $select.show;\n $select.show = function() {\n _show();\n if(options.multiple) {\n $select.$element.addClass('select-multiple');\n }\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n $select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $select.$onKeyDown);\n }\n }, 0, false);\n };\n\n var _hide = $select.hide;\n $select.hide = function() {\n $select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $select.$onKeyDown);\n }\n _hide(true);\n };\n\n return $select;\n\n }\n\n SelectFactory.defaults = defaults;\n return SelectFactory;\n\n };\n\n })\n\n .directive('bsSelect', function($window, $parse, $q, $select, $parseOptions) {\n\n var defaults = $select.defaults;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope, placeholder: defaults.placeholder};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Add support for select markup\n if(element[0].nodeName.toLowerCase() === 'select') {\n var inputEl = element;\n inputEl.css('display', 'none');\n element = angular.element(' ');\n inputEl.after(element);\n }\n\n // Build proper ngOptions\n var parsedOptions = $parseOptions(attr.ngOptions);\n\n // Initialize select\n var select = $select(element, controller, options);\n\n // Watch ngOptions values before filtering for changes\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').trim();\n scope.$watch(watchedOptions, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\n parsedOptions.valuesFn(scope, controller)\n .then(function(values) {\n select.update(values);\n controller.$render();\n });\n }, true);\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue);\n select.$updateActiveIndex();\n controller.$render();\n }, true);\n\n // Model rendering in view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n var selected, index;\n if(options.multiple && angular.isArray(controller.$modelValue)) {\n selected = controller.$modelValue.map(function(value) {\n index = select.$getIndex(value);\n return angular.isDefined(index) ? select.$scope.$matches[index].label : false;\n }).filter(angular.isDefined);\n if(selected.length > (options.maxLength || defaults.maxLength)) {\n selected = selected.length + ' ' + (options.maxLengthHtml || defaults.maxLengthHtml);\n } else {\n selected = selected.join(', ');\n }\n } else {\n index = select.$getIndex(controller.$modelValue);\n selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false;\n }\n element.html((selected ? selected : options.placeholder) + defaults.caretHtml);\n };\n\n if(options.multiple){\n controller.$isEmpty = function(value){\n return !value || value.length === 0;\n };\n }\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (select) select.destroy();\n options = null;\n select = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["select/select.js"],"names":[],"mappings":"qBASM,OAAA,yBAAa,yBAAA,iDAEb,UAAU,cAEV,GAAW,KAAA,UACX,UAAU,UACV,YAAM,SACN,YAAO,UACP,UAAU,cACV,SAAA,yBACA,QAAM,QACN,WAAW,EACX,UAAA,EACA,MAAA,EACA,MAAA,EACA,UAAA,EACA,gBAAe,EACf,MAAA,4FAGF,QAAK,sBAEH,UAAI,EACJ,cAAe,WACf,cAAe,0HASb,GAAmB,EAAS,EAAA,YAK5B,EAAM,QAAc,UAAQ,EAAA,EAE5B,GAAM,EAAA,EAAiB,EACvB,IAAA,GAAM,EAAW,qBAGjB,EAAM,aAAY,IAChB,YAAM,EAAa,WACjB,oBAAiB,EAAA,gBAAA,EAAA,wFAKnB,UAAM,SAAa,KACjB,aAAe,8BAKjB,QAAO,SAAQ,oEAOjB,MAAM,GAAA,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YAAA,EAAA,wDAIT,GAAA,yGA1LE,EAAI,eAAyB,GAAI,UAAU,QAiMhD,GAAU,SAAA,kBAOD,YAAS,UAAgB,SAAS,KAAM,UAAY,gBAAA,SAAA,EAAA,EAAA,EAAA,EAAA,oCAKnD,kDAKH,IAAI,MAAU,EAAA,YAAA,EAAA,wBACd,SAAY,YAAW,YAAA,QAAA,UAAA,WAAA,OAAA,YAAA,WAAA,cAAA,WAAA,iBAAA,YAAA,gBAAA,UAAA,YAAA,SAAA,GACvB,QAAU,UAAQ,EAAQ,MAAA,EAAA,GAAA,EAAA,8CAK5B,GAAI,GAAA,uGAGJ,EAAI,MAAS,GAIb,GAAA,GAAa,EAAgB,EAAS,WAGnC,EAAK,EAAS,EAAQ,EAAA,6CAItB,OAAA,EAAA,2BAGH,KAAM,SAAO,eAEX,EAAO,cAEN,GAGH,EAAA,OAAW,EAAA,QAAU,WAEnB,EAAI,qBACJ,EAAW,iBAIN,QAAO,cAER,GAAA,IACK,UAAA,QAAA,QAAA,EAAA,gBACL,EAAoB,YAAK,IAAA,SAAA,2BAEtB,QAAA,UAAA,GAAA,EAAA,OAAA,SAAA,GAAA,OAAA,IACL,OAAQ,QAAO,aACf,EAAW,QAAQ,EAAU,WAAS,EAAc,0EAMtD,EAAA,EAAW,UAAW,EAAe,aACnC,EAAQ,QAAS,UAAM,GAAW,EAAA,OAAA,SAAA,GAAA,OAAA,4CAKtC,EAAU,WACR,EAAI,SAAe,SAAA,GACnB,OAAU,GAAA,IAAA,EAAA,oDAOf,EAAA","file":"select.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.select', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\r\n\r\n .provider('$select', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'select',\r\n prefixEvent: '$select',\r\n placement: 'bottom-left',\r\n template: 'select/select.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n multiple: false,\r\n allNoneButtons: false,\r\n sort: true,\r\n caretHtml: ' ',\r\n placeholder: 'Choose among the following...',\r\n allText: 'All',\r\n noneText: 'None',\r\n maxLength: 3,\r\n maxLengthHtml: 'selected',\r\n iconCheckmark: 'glyphicon glyphicon-ok'\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var isTouch = ('createTouch' in $window.document) && isNative;\r\n\r\n function SelectFactory(element, controller, config) {\r\n\r\n var $select = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $select = $tooltip(element, options);\r\n var scope = $select.$scope;\r\n\r\n scope.$matches = [];\r\n scope.$activeIndex = 0;\r\n scope.$isMultiple = options.multiple;\r\n scope.$showAllNoneButtons = options.allNoneButtons && options.multiple;\r\n scope.$iconCheckmark = options.iconCheckmark;\r\n scope.$allText = options.allText;\r\n scope.$noneText = options.noneText;\r\n\r\n scope.$activate = function(index) {\r\n scope.$$postDigest(function() {\r\n $select.activate(index);\r\n });\r\n };\r\n\r\n scope.$select = function(index, evt) {\r\n scope.$$postDigest(function() {\r\n $select.select(index);\r\n });\r\n };\r\n\r\n scope.$isVisible = function() {\r\n return $select.$isVisible();\r\n };\r\n\r\n scope.$isActive = function(index) {\r\n return $select.$isActive(index);\r\n };\r\n\r\n scope.$selectAll = function () {\r\n for (var i = 0; i < scope.$matches.length; i++) {\r\n if (!scope.$isActive(i)) {\r\n scope.$select(i);\r\n }\r\n }\r\n };\r\n\r\n scope.$selectNone = function () {\r\n for (var i = 0; i < scope.$matches.length; i++) {\r\n if (scope.$isActive(i)) {\r\n scope.$select(i);\r\n }\r\n }\r\n };\r\n\r\n // Public methods\r\n\r\n $select.update = function(matches) {\r\n scope.$matches = matches;\r\n $select.$updateActiveIndex();\r\n };\r\n\r\n $select.activate = function(index) {\r\n if(options.multiple) {\r\n scope.$activeIndex.sort();\r\n $select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index);\r\n if(options.sort) scope.$activeIndex.sort();\r\n } else {\r\n scope.$activeIndex = index;\r\n }\r\n return scope.$activeIndex;\r\n };\r\n\r\n $select.select = function(index) {\r\n var value = scope.$matches[index].value;\r\n scope.$apply(function() {\r\n $select.activate(index);\r\n if(options.multiple) {\r\n controller.$setViewValue(scope.$activeIndex.map(function(index) {\r\n return scope.$matches[index].value;\r\n }));\r\n } else {\r\n controller.$setViewValue(value);\r\n // Hide if single select\r\n $select.hide();\r\n }\r\n });\r\n // Emit event\r\n scope.$emit(options.prefixEvent + '.select', value, index);\r\n };\r\n\r\n // Protected methods\r\n\r\n $select.$updateActiveIndex = function() {\r\n if(controller.$modelValue && scope.$matches.length) {\r\n if(options.multiple && angular.isArray(controller.$modelValue)) {\r\n scope.$activeIndex = controller.$modelValue.map(function(value) {\r\n return $select.$getIndex(value);\r\n });\r\n } else {\r\n scope.$activeIndex = $select.$getIndex(controller.$modelValue);\r\n }\r\n } else if(scope.$activeIndex >= scope.$matches.length) {\r\n scope.$activeIndex = options.multiple ? [] : 0;\r\n }\r\n };\r\n\r\n $select.$isVisible = function() {\r\n if(!options.minLength || !controller) {\r\n return scope.$matches.length;\r\n }\r\n // minLength support\r\n return scope.$matches.length && controller.$viewValue.length >= options.minLength;\r\n };\r\n\r\n $select.$isActive = function(index) {\r\n if(options.multiple) {\r\n return scope.$activeIndex.indexOf(index) !== -1;\r\n } else {\r\n return scope.$activeIndex === index;\r\n }\r\n };\r\n\r\n $select.$getIndex = function(value) {\r\n var l = scope.$matches.length, i = l;\r\n if(!l) return;\r\n for(i = l; i--;) {\r\n if(scope.$matches[i].value === value) break;\r\n }\r\n if(i < 0) return;\r\n return i;\r\n };\r\n\r\n $select.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown on .dropdown-menu\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n // Emulate click for mobile devices\r\n if(isTouch) {\r\n var targetEl = angular.element(evt.target);\r\n targetEl.triggerHandler('click');\r\n }\r\n };\r\n\r\n $select.$onKeyDown = function(evt) {\r\n if (!/(9|13|38|40)/.test(evt.keyCode)) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n // Select with enter\r\n if(!options.multiple && (evt.keyCode === 13 || evt.keyCode === 9)) {\r\n return $select.select(scope.$activeIndex);\r\n }\r\n\r\n // Navigate with keyboard\r\n if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\r\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\r\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\r\n scope.$digest();\r\n };\r\n\r\n // Overrides\r\n\r\n var _show = $select.show;\r\n $select.show = function() {\r\n _show();\r\n if(options.multiple) {\r\n $select.$element.addClass('select-multiple');\r\n }\r\n // use timeout to hookup the events to prevent\r\n // event bubbling from being processed imediately.\r\n $timeout(function() {\r\n $select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $select.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var _hide = $select.hide;\r\n $select.hide = function() {\r\n $select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $select.$onKeyDown);\r\n }\r\n _hide(true);\r\n };\r\n\r\n return $select;\r\n\r\n }\r\n\r\n SelectFactory.defaults = defaults;\r\n return SelectFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsSelect', function($window, $parse, $q, $select, $parseOptions) {\r\n\r\n var defaults = $select.defaults;\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope, placeholder: defaults.placeholder};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Add support for select markup\r\n if(element[0].nodeName.toLowerCase() === 'select') {\r\n var inputEl = element;\r\n inputEl.css('display', 'none');\r\n element = angular.element(' ');\r\n inputEl.after(element);\r\n }\r\n\r\n // Build proper ngOptions\r\n var parsedOptions = $parseOptions(attr.ngOptions);\r\n\r\n // Initialize select\r\n var select = $select(element, controller, options);\r\n\r\n // Watch ngOptions values before filtering for changes\r\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').trim();\r\n scope.$watch(watchedOptions, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\r\n parsedOptions.valuesFn(scope, controller)\r\n .then(function(values) {\r\n select.update(values);\r\n controller.$render();\r\n });\r\n }, true);\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue);\r\n select.$updateActiveIndex();\r\n controller.$render();\r\n }, true);\r\n\r\n // Model rendering in view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n var selected, index;\r\n if(options.multiple && angular.isArray(controller.$modelValue)) {\r\n selected = controller.$modelValue.map(function(value) {\r\n index = select.$getIndex(value);\r\n return angular.isDefined(index) ? select.$scope.$matches[index].label : false;\r\n }).filter(angular.isDefined);\r\n if(selected.length > (options.maxLength || defaults.maxLength)) {\r\n selected = selected.length + ' ' + (options.maxLengthHtml || defaults.maxLengthHtml);\r\n } else {\r\n selected = selected.join(', ');\r\n }\r\n } else {\r\n index = select.$getIndex(controller.$modelValue);\r\n selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false;\r\n }\r\n element.html((selected ? selected : options.placeholder) + defaults.caretHtml);\r\n };\r\n\r\n if(options.multiple){\r\n controller.$isEmpty = function(value){\r\n return !value || value.length === 0;\r\n };\r\n }\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (select) select.destroy();\r\n options = null;\r\n select = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/select.tpl.js b/dist/modules/select.tpl.js
index b3fc3bf83..c26f2dfff 100644
--- a/dist/modules/select.tpl.js
+++ b/dist/modules/select.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/select.tpl.min.js b/dist/modules/select.tpl.min.js
index 5273d986e..c9c73e01e 100644
--- a/dist/modules/select.tpl.min.js
+++ b/dist/modules/select.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tab.js b/dist/modules/tab.js
index b33c58d4f..e3180a171 100644
--- a/dist/modules/tab.js
+++ b/dist/modules/tab.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tab.min.js b/dist/modules/tab.min.js
index 32a74f204..23ef39508 100644
--- a/dist/modules/tab.min.js
+++ b/dist/modules/tab.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tab.min.js.map b/dist/modules/tab.min.js.map
index a1ef9943d..1fe264ecb 100644
--- a/dist/modules/tab.min.js.map
+++ b/dist/modules/tab.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["tab/tab.js"],"names":[],"mappings":"qBASM,OAAA,oDAIF,GAAI,GAAA,KAAa,UACf,UAAW,0DAGX,YAAK,sDAOL,GAAA,SAAO,QAAe,KAAK,sEAEtB,QAAA,UAAgB,EAAS,MAAA,EAAA,SAAA,GAAA,EAAA,sCAK9B,EAAK,aAAA,EAAA,SAA6B,YAElC,EAAK,OAAQ,EAAA,YAKX,2BAAgC,EAAA,gEAMhC,QAAY,SAAA,kDAKP,OAAI,OAAU,EAAA,OAKnB,gCAKA,MAEE,WAAA,gFAMN,EAAK,2BAAkB,QAAA,SAAA,GACjB,qCAUN,OAFD,GAAA,SAAU,iBAEL,eAKK,UAAA,UAAA,WAAA,OAAA,SAAA,SAAA,EAAA,EAAA,EAAA,MAEP,GAAa,EAAA,gBAGb,SAAM,WAAS,+BAET,cACA,SAAa,WAAY,SAAA,EAAA,+FAM3B,GAAa,EAAA,oGAUX,2BAAmC,KAAA,WACnC,EAAO,cAAA,EAAA,OAAA,wEAYP,EAAA,aAAmB,2BAMlB,2BAAA,KAAA,kGAOA,mBAOD,UAAA,UAAc,WAAY,OAAA,SAAA,EAAA,EAAA,iDAI9B,iCA2BE,+BAEF,EAAA,EAAA,OAAA,oEA1BA,GACE,IADa,EAAS,GACR,EAAK,2GAYrB,EAAU,SAAA,EAAY,SAAW,WAIjC,EAAS,MAAA,KAGP,IAAA,WAAmB,uEAWxB","file":"tab.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.tab', [])\n\n .provider('$tab', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n template: 'tab/tab.tpl.html',\n navClass: 'nav-tabs',\n activeClass: 'active'\n };\n\n var controller = this.controller = function($scope, $element, $attrs) {\n var self = this;\n\n // Attributes options\n self.$options = angular.copy(defaults);\n angular.forEach(['animation', 'navClass', 'activeClass'], function(key) {\n if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];\n });\n\n // Publish options on scope\n $scope.$navClass = self.$options.navClass;\n $scope.$activeClass = self.$options.activeClass;\n\n self.$panes = $scope.$panes = [];\n\n // DEPRECATED: $viewChangeListeners, please use $activePaneChangeListeners\n // Because we deprecated ngModel usage, we rename viewChangeListeners to \n // activePaneChangeListeners to make more sense.\n self.$activePaneChangeListeners = self.$viewChangeListeners = [];\n\n self.$push = function(pane) {\n self.$panes.push(pane);\n };\n\n self.$remove = function(pane) {\n var index = self.$panes.indexOf(pane);\n var activeIndex = self.$panes.$active;\n\n // remove pane from $panes array\n self.$panes.splice(index, 1);\n\n if (index < activeIndex) {\n // we removed a pane before the active pane, so we need to \n // decrement the active pane index\n activeIndex--;\n }\n else if (index === activeIndex && activeIndex === self.$panes.length) {\n // we remove the active pane and it was the one at the end,\n // so select the previous one\n activeIndex--;\n }\n self.$setActive(activeIndex);\n };\n\n self.$panes.$active = 0;\n self.$setActive = $scope.$setActive = function(value) {\n self.$panes.$active = value;\n self.$activePaneChangeListeners.forEach(function(fn) {\n fn();\n });\n };\n\n };\n\n this.$get = function() {\n var $tab = {};\n $tab.defaults = defaults;\n $tab.controller = controller;\n return $tab;\n };\n\n })\n\n .directive('bsTabs', function($window, $animate, $tab, $parse) {\n\n var defaults = $tab.defaults;\n\n return {\n require: ['?ngModel', 'bsTabs'],\n transclude: true,\n scope: true,\n controller: ['$scope', '$element', '$attrs', $tab.controller],\n templateUrl: function(element, attr) {\n return attr.template || defaults.template;\n },\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsTabsCtrl = controllers[1];\n\n // DEPRECATED: ngModel, please use bsActivePane\n // 'ngModel' is deprecated bacause if interferes with form validation\n // and status, so avoid using it here.\n if(ngModelCtrl) {\n console.warn('Usage of ngModel is deprecated, please use bsActivePane instead!');\n\n // Update the modelValue following\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\n ngModelCtrl.$setViewValue(bsTabsCtrl.$panes.$active);\n });\n\n // modelValue -> $formatters -> viewValue\n ngModelCtrl.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n bsTabsCtrl.$setActive(modelValue * 1);\n return modelValue;\n });\n\n }\n\n if (attrs.bsActivePane) {\n // adapted from angularjs ngModelController bindings\n // https://github.com/angular/angular.js/blob/v1.3.1/src%2Fng%2Fdirective%2Finput.js#L1730\n var parsedBsActivePane = $parse(attrs.bsActivePane);\n\n // Update bsActivePane value with change\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\n parsedBsActivePane.assign(scope, bsTabsCtrl.$panes.$active);\n });\n\n // watch bsActivePane for value changes\n scope.$watch(attrs.bsActivePane, function(newValue, oldValue) {\n bsTabsCtrl.$setActive(newValue * 1);\n }, true);\n }\n }\n };\n\n })\n\n .directive('bsPane', function($window, $animate, $sce) {\n\n return {\n require: ['^?ngModel', '^bsTabs'],\n scope: true,\n link: function postLink(scope, element, attrs, controllers) {\n\n var ngModelCtrl = controllers[0];\n var bsTabsCtrl = controllers[1];\n\n // Add base class\n element.addClass('tab-pane');\n\n // Observe title attribute for change\n attrs.$observe('title', function(newValue, oldValue) {\n scope.title = $sce.trustAsHtml(newValue);\n });\n\n // Add animation class\n if(bsTabsCtrl.$options.animation) {\n element.addClass(bsTabsCtrl.$options.animation);\n }\n\n // Push pane to parent bsTabs controller\n bsTabsCtrl.$push(scope);\n\n // remove pane from tab controller when pane is destroyed\n scope.$on('$destroy', function() {\n bsTabsCtrl.$remove(scope);\n });\n\n function render() {\n var index = bsTabsCtrl.$panes.indexOf(scope);\n var active = bsTabsCtrl.$panes.$active;\n $animate[index === active ? 'addClass' : 'removeClass'](element, bsTabsCtrl.$options.activeClass);\n }\n\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\n render();\n });\n render();\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["tab/tab.js"],"names":[],"mappings":"qBASM,OAAA,oDAIF,GAAI,GAAA,KAAa,UACf,UAAW,0DAGX,YAAK,sDAOL,GAAA,SAAO,QAAe,KAAK,sEAEtB,QAAA,UAAgB,EAAS,MAAA,EAAA,SAAA,GAAA,EAAA,sCAK9B,EAAK,aAAA,EAAA,SAA6B,YAElC,EAAK,OAAQ,EAAA,YAKX,2BAAgC,EAAA,gEAMhC,QAAY,SAAA,kDAKP,OAAI,OAAU,EAAA,OAKnB,gCAKA,MAEE,WAAA,gFAMN,EAAK,2BAAkB,QAAA,SAAA,GACjB,qCAUN,OAFD,GAAA,SAAU,iBAEL,eAKK,UAAA,UAAA,WAAA,OAAA,SAAA,SAAA,EAAA,EAAA,EAAA,MAEP,GAAa,EAAA,gBAGb,SAAM,WAAS,+BAET,cACA,SAAa,WAAY,SAAA,EAAA,+FAM3B,GAAa,EAAA,oGAUX,2BAAmC,KAAA,WACnC,EAAO,cAAA,EAAA,OAAA,wEAYP,EAAA,aAAmB,2BAMlB,2BAAA,KAAA,kGAOA,mBAOD,UAAA,UAAc,WAAY,OAAA,SAAA,EAAA,EAAA,iDAI9B,iCA2BE,+BAEF,EAAA,EAAA,OAAA,oEA1BA,GACE,IADa,EAAS,GACR,EAAK,2GAYrB,EAAU,SAAA,EAAY,SAAW,WAIjC,EAAS,MAAA,KAGP,IAAA,WAAmB,uEAWxB","file":"tab.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.tab', [])\r\n\r\n .provider('$tab', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n template: 'tab/tab.tpl.html',\r\n navClass: 'nav-tabs',\r\n activeClass: 'active'\r\n };\r\n\r\n var controller = this.controller = function($scope, $element, $attrs) {\r\n var self = this;\r\n\r\n // Attributes options\r\n self.$options = angular.copy(defaults);\r\n angular.forEach(['animation', 'navClass', 'activeClass'], function(key) {\r\n if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];\r\n });\r\n\r\n // Publish options on scope\r\n $scope.$navClass = self.$options.navClass;\r\n $scope.$activeClass = self.$options.activeClass;\r\n\r\n self.$panes = $scope.$panes = [];\r\n\r\n // DEPRECATED: $viewChangeListeners, please use $activePaneChangeListeners\r\n // Because we deprecated ngModel usage, we rename viewChangeListeners to \r\n // activePaneChangeListeners to make more sense.\r\n self.$activePaneChangeListeners = self.$viewChangeListeners = [];\r\n\r\n self.$push = function(pane) {\r\n self.$panes.push(pane);\r\n };\r\n\r\n self.$remove = function(pane) {\r\n var index = self.$panes.indexOf(pane);\r\n var activeIndex = self.$panes.$active;\r\n\r\n // remove pane from $panes array\r\n self.$panes.splice(index, 1);\r\n\r\n if (index < activeIndex) {\r\n // we removed a pane before the active pane, so we need to \r\n // decrement the active pane index\r\n activeIndex--;\r\n }\r\n else if (index === activeIndex && activeIndex === self.$panes.length) {\r\n // we remove the active pane and it was the one at the end,\r\n // so select the previous one\r\n activeIndex--;\r\n }\r\n self.$setActive(activeIndex);\r\n };\r\n\r\n self.$panes.$active = 0;\r\n self.$setActive = $scope.$setActive = function(value) {\r\n self.$panes.$active = value;\r\n self.$activePaneChangeListeners.forEach(function(fn) {\r\n fn();\r\n });\r\n };\r\n\r\n };\r\n\r\n this.$get = function() {\r\n var $tab = {};\r\n $tab.defaults = defaults;\r\n $tab.controller = controller;\r\n return $tab;\r\n };\r\n\r\n })\r\n\r\n .directive('bsTabs', function($window, $animate, $tab, $parse) {\r\n\r\n var defaults = $tab.defaults;\r\n\r\n return {\r\n require: ['?ngModel', 'bsTabs'],\r\n transclude: true,\r\n scope: true,\r\n controller: ['$scope', '$element', '$attrs', $tab.controller],\r\n templateUrl: function(element, attr) {\r\n return attr.template || defaults.template;\r\n },\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsTabsCtrl = controllers[1];\r\n\r\n // DEPRECATED: ngModel, please use bsActivePane\r\n // 'ngModel' is deprecated bacause if interferes with form validation\r\n // and status, so avoid using it here.\r\n if(ngModelCtrl) {\r\n console.warn('Usage of ngModel is deprecated, please use bsActivePane instead!');\r\n\r\n // Update the modelValue following\r\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\r\n ngModelCtrl.$setViewValue(bsTabsCtrl.$panes.$active);\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n ngModelCtrl.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n bsTabsCtrl.$setActive(modelValue * 1);\r\n return modelValue;\r\n });\r\n\r\n }\r\n\r\n if (attrs.bsActivePane) {\r\n // adapted from angularjs ngModelController bindings\r\n // https://github.com/angular/angular.js/blob/v1.3.1/src%2Fng%2Fdirective%2Finput.js#L1730\r\n var parsedBsActivePane = $parse(attrs.bsActivePane);\r\n\r\n // Update bsActivePane value with change\r\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\r\n parsedBsActivePane.assign(scope, bsTabsCtrl.$panes.$active);\r\n });\r\n\r\n // watch bsActivePane for value changes\r\n scope.$watch(attrs.bsActivePane, function(newValue, oldValue) {\r\n bsTabsCtrl.$setActive(newValue * 1);\r\n }, true);\r\n }\r\n }\r\n };\r\n\r\n })\r\n\r\n .directive('bsPane', function($window, $animate, $sce) {\r\n\r\n return {\r\n require: ['^?ngModel', '^bsTabs'],\r\n scope: true,\r\n link: function postLink(scope, element, attrs, controllers) {\r\n\r\n var ngModelCtrl = controllers[0];\r\n var bsTabsCtrl = controllers[1];\r\n\r\n // Add base class\r\n element.addClass('tab-pane');\r\n\r\n // Observe title attribute for change\r\n attrs.$observe('title', function(newValue, oldValue) {\r\n scope.title = $sce.trustAsHtml(newValue);\r\n });\r\n\r\n // Add animation class\r\n if(bsTabsCtrl.$options.animation) {\r\n element.addClass(bsTabsCtrl.$options.animation);\r\n }\r\n\r\n // Push pane to parent bsTabs controller\r\n bsTabsCtrl.$push(scope);\r\n\r\n // remove pane from tab controller when pane is destroyed\r\n scope.$on('$destroy', function() {\r\n bsTabsCtrl.$remove(scope);\r\n });\r\n\r\n function render() {\r\n var index = bsTabsCtrl.$panes.indexOf(scope);\r\n var active = bsTabsCtrl.$panes.$active;\r\n $animate[index === active ? 'addClass' : 'removeClass'](element, bsTabsCtrl.$options.activeClass);\r\n }\r\n\r\n bsTabsCtrl.$activePaneChangeListeners.push(function() {\r\n render();\r\n });\r\n render();\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/tab.tpl.js b/dist/modules/tab.tpl.js
index 4882306aa..112377bc9 100644
--- a/dist/modules/tab.tpl.js
+++ b/dist/modules/tab.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tab.tpl.min.js b/dist/modules/tab.tpl.min.js
index 292323ce6..ec5af653b 100644
--- a/dist/modules/tab.tpl.min.js
+++ b/dist/modules/tab.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/timepicker.js b/dist/modules/timepicker.js
index 4072c1222..6b2f50f7d 100644
--- a/dist/modules/timepicker.js
+++ b/dist/modules/timepicker.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/timepicker.min.js b/dist/modules/timepicker.min.js
index 6e3f41f6e..b4d5003d2 100644
--- a/dist/modules/timepicker.min.js
+++ b/dist/modules/timepicker.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/timepicker.min.js.map b/dist/modules/timepicker.min.js.map
index bc5bf8de3..87c4f74bb 100644
--- a/dist/modules/timepicker.min.js.map
+++ b/dist/modules/timepicker.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["timepicker/timepicker.js"],"names":[],"mappings":"qBASQ,OAAA,4IAKF,cAAS,cAET,GAAU,KAAA,UACV,UAAM,UACN,YAAO,qCAEP,SAAA,iCACA,QAAA,QACA,WAAA,EACA,UAAA,EACA,MAAA,EACA,MAAA,EAEA,WAAQ,EACR,SAAU,OACV,WAAY,YACZ,gBAAQ,KACR,WAAU,EACV,SAAA,0BAGF,SAAK,eAEH,OAAI,iCACJ,SAAI,mCACJ,cAAe,cAGf,MAAS,UAAA,YAAkB,aAAqB,OAAQ,iBAAA,WAAA,WAAA,SAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,WAOlD,GAAe,EAAA,EAAA,WAuNV,GAAc,EAAA,MACnB,EAAQ,GAAG,gBAAkB,OACrB,EAAQ,GAAA,iBAChB,GAAQ,UAAG,GACX,EAAQ,UAAG,YAAe,mEAI9B,EAAS,GAAA,kBAAe,EAAA,GACd,QAAG,YAAA,EAAA,GAAA,6DAMb,QAAA,KACE,EA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AA,EAAA,eArHb,IAAI,MAAe,EAAQ,WAAU,WAClC,SAAQ,YAAS,YAAW,QAAa,UAAe,WAAA,OAAA,YAAA,WAAA,YAAA,WAAA,aAAA,kBAAA,YAAA,WAAA,aAAA,SAAA,gBAAA,SAAA,YAAA,SAAA,GAC3D,QAAA,UAAoB,EAAA,MAAW,EAAS,GAAA,EAAW,MAIrD,EAAG,QAAA,EAAa,OAAQ,EAAA,OAAa,SAAS,GAC1C,GAAa,QAAY,UAAS,KACtC,QAAU,SAAW,KAAA,IAAA,EAAA,MAAA,sKAWrB,MAAQ,GAAS,WAAW,EAAY,EAAS,IAI7C,EAAO,GAAW,OAAS,EAAS,WAAW,KAAA,wGAMnD,EAAa,SAAK,GAAS,EAAS,oBAAoB,EAAA,qCAEtD,EAAkB,EAAW,kBAKzB,OAAA,EAAA,QAAmB,WAEvB,EAAI,OAAU,EAAc,cAC5B,KAkBE,SAAW,QAAa,SAAQ,GAGlC,IAAI,EAKF,iCAAA,QAEA,GAAA,QAAA,OAA0B,GAAA,EAAA,EAAA,MAAA,EAAA,EAAA,6CAE5B,GAAW,aAAa,QAAU,IAKhC,EAAkB,GAEA,WAAlB,EAAO,SACF,EAAA,EAAA,EAAA,iBAAA,EAAA,YACsB,WAApB,EAAS,kGAKT,EAAA,WAAiB,cAEtB,GAAA,MAAA,EAAA,iBAKG,YAAW,KAAA,SAAa,kBAG7B,QAAO,YAAS,IAAa,OAAA,EACxB,IACE,QAAS,OAAA,6DAKX,GAAA,MADiB,SAAxB,EAAW,SACJ,IAAA,KAMP,EAAQ,WAAI,oFAiBjB,EAAA","file":"timepicker.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.timepicker', [\n 'mgcrea.ngStrap.helpers.dateParser',\n 'mgcrea.ngStrap.helpers.dateFormatter',\n 'mgcrea.ngStrap.tooltip'])\n\n .provider('$timepicker', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'timepicker',\n placement: 'bottom-left',\n template: 'timepicker/timepicker.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n // lang: $locale.id,\n useNative: true,\n timeType: 'date',\n timeFormat: 'shortTime',\n modelTimeFormat: null,\n autoclose: false,\n minTime: -Infinity,\n maxTime: +Infinity,\n length: 5,\n hourStep: 1,\n minuteStep: 5,\n iconUp: 'glyphicon glyphicon-chevron-up',\n iconDown: 'glyphicon glyphicon-chevron-down',\n arrowBehavior: 'pager'\n };\n\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var isTouch = ('createTouch' in $window.document) && isNative;\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\n\n function timepickerFactory(element, controller, config) {\n\n var $timepicker = $tooltip(element, angular.extend({}, defaults, config));\n var parentScope = config.scope;\n var options = $timepicker.$options;\n var scope = $timepicker.$scope;\n\n var lang = options.lang;\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n\n // View vars\n\n var selectedIndex = 0;\n var startDate = controller.$dateValue || new Date();\n var viewDate = {hour: startDate.getHours(), meridian: startDate.getHours() < 12, minute: startDate.getMinutes(), second: startDate.getSeconds(), millisecond: startDate.getMilliseconds()};\n\n var format = $dateFormatter.getDatetimeFormat(options.timeFormat, lang);\n\n var hoursFormat = $dateFormatter.hoursFormat(format),\n timeSeparator = $dateFormatter.timeSeparator(format),\n minutesFormat = $dateFormatter.minutesFormat(format),\n showAM = $dateFormatter.showAM(format);\n\n scope.$iconUp = options.iconUp;\n scope.$iconDown = options.iconDown;\n\n // Scope methods\n\n scope.$select = function(date, index) {\n $timepicker.select(date, index);\n };\n scope.$moveIndex = function(value, index) {\n $timepicker.$moveIndex(value, index);\n };\n scope.$switchMeridian = function(date) {\n $timepicker.switchMeridian(date);\n };\n\n // Public methods\n\n $timepicker.update = function(date) {\n // console.warn('$timepicker.update() newValue=%o', date);\n if(angular.isDate(date) && !isNaN(date.getTime())) {\n $timepicker.$date = date;\n angular.extend(viewDate, {hour: date.getHours(), minute: date.getMinutes(), second: date.getSeconds(), millisecond: date.getMilliseconds()});\n $timepicker.$build();\n } else if(!$timepicker.$isBuilt) {\n $timepicker.$build();\n }\n };\n\n $timepicker.select = function(date, index, keep) {\n // console.warn('$timepicker.select', date, scope.$mode);\n if(!controller.$dateValue || isNaN(controller.$dateValue.getTime())) controller.$dateValue = new Date(1970, 0, 1);\n if(!angular.isDate(date)) date = new Date(date);\n if(index === 0) controller.$dateValue.setHours(date.getHours());\n else if(index === 1) controller.$dateValue.setMinutes(date.getMinutes());\n controller.$setViewValue(angular.copy(controller.$dateValue));\n controller.$render();\n if(options.autoclose && !keep) {\n $timeout(function() { $timepicker.hide(true); });\n }\n };\n\n $timepicker.switchMeridian = function(date) {\n if (!controller.$dateValue || isNaN(controller.$dateValue.getTime())) {\n return;\n }\n var hours = (date || controller.$dateValue).getHours();\n controller.$dateValue.setHours(hours < 12 ? hours + 12 : hours - 12);\n controller.$setViewValue(angular.copy(controller.$dateValue));\n controller.$render();\n };\n\n // Protected methods\n\n $timepicker.$build = function() {\n // console.warn('$timepicker.$build() viewDate=%o', viewDate);\n var i, midIndex = scope.midIndex = parseInt(options.length / 2, 10);\n var hours = [], hour;\n for(i = 0; i < options.length; i++) {\n hour = new Date(1970, 0, 1, viewDate.hour - (midIndex - i) * options.hourStep);\n hours.push({date: hour, label: formatDate(hour, hoursFormat), selected: $timepicker.$date && $timepicker.$isSelected(hour, 0), disabled: $timepicker.$isDisabled(hour, 0)});\n }\n var minutes = [], minute;\n for(i = 0; i < options.length; i++) {\n minute = new Date(1970, 0, 1, 0, viewDate.minute - (midIndex - i) * options.minuteStep);\n minutes.push({date: minute, label: formatDate(minute, minutesFormat), selected: $timepicker.$date && $timepicker.$isSelected(minute, 1), disabled: $timepicker.$isDisabled(minute, 1)});\n }\n\n var rows = [];\n for(i = 0; i < options.length; i++) {\n rows.push([hours[i], minutes[i]]);\n }\n scope.rows = rows;\n scope.showAM = showAM;\n scope.isAM = ($timepicker.$date || hours[midIndex].date).getHours() < 12;\n scope.timeSeparator = timeSeparator;\n $timepicker.$isBuilt = true;\n };\n\n $timepicker.$isSelected = function(date, index) {\n if(!$timepicker.$date) return false;\n else if(index === 0) {\n return date.getHours() === $timepicker.$date.getHours();\n } else if(index === 1) {\n return date.getMinutes() === $timepicker.$date.getMinutes();\n }\n };\n\n $timepicker.$isDisabled = function(date, index) {\n var selectedTime;\n if(index === 0) {\n selectedTime = date.getTime() + viewDate.minute * 6e4;\n } else if(index === 1) {\n selectedTime = date.getTime() + viewDate.hour * 36e5;\n }\n return selectedTime < options.minTime * 1 || selectedTime > options.maxTime * 1;\n };\n\n scope.$arrowAction = function (value, index) {\n if (options.arrowBehavior === 'picker') {\n $timepicker.$setTimeByStep(value,index);\n } else {\n $timepicker.$moveIndex(value,index);\n }\n };\n\n $timepicker.$setTimeByStep = function(value, index) {\n var newDate = new Date($timepicker.$date);\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\n if (index === 0) {\n newDate.setHours(hours - (parseInt(options.hourStep, 10) * value));\n }\n else {\n newDate.setMinutes(minutes - (parseInt(options.minuteStep, 10) * value));\n }\n $timepicker.select(newDate, index, true);\n };\n\n $timepicker.$moveIndex = function(value, index) {\n var targetDate;\n if(index === 0) {\n targetDate = new Date(1970, 0, 1, viewDate.hour + (value * options.length), viewDate.minute);\n angular.extend(viewDate, {hour: targetDate.getHours()});\n } else if(index === 1) {\n targetDate = new Date(1970, 0, 1, viewDate.hour, viewDate.minute + (value * options.length * options.minuteStep));\n angular.extend(viewDate, {minute: targetDate.getMinutes()});\n }\n $timepicker.$build();\n };\n\n $timepicker.$onMouseDown = function(evt) {\n // Prevent blur on mousedown on .dropdown-menu\n if(evt.target.nodeName.toLowerCase() !== 'input') evt.preventDefault();\n evt.stopPropagation();\n // Emulate click for mobile devices\n if(isTouch) {\n var targetEl = angular.element(evt.target);\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\n targetEl = targetEl.parent();\n }\n targetEl.triggerHandler('click');\n }\n };\n\n $timepicker.$onKeyDown = function(evt) {\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n // Close on enter\n if(evt.keyCode === 13) return $timepicker.hide(true);\n\n // Navigate with keyboard\n var newDate = new Date($timepicker.$date);\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\n var lateralMove = /(37|39)/.test(evt.keyCode);\n var count = 2 + showAM * 1;\n\n // Navigate indexes (left, right)\n if (lateralMove) {\n if(evt.keyCode === 37) selectedIndex = selectedIndex < 1 ? count - 1 : selectedIndex - 1;\n else if(evt.keyCode === 39) selectedIndex = selectedIndex < count - 1 ? selectedIndex + 1 : 0;\n }\n\n // Update values (up, down)\n var selectRange = [0, hoursLength];\n if(selectedIndex === 0) {\n if(evt.keyCode === 38) newDate.setHours(hours - parseInt(options.hourStep, 10));\n else if(evt.keyCode === 40) newDate.setHours(hours + parseInt(options.hourStep, 10));\n // re-calculate hours length because we have changed hours value\n hoursLength = formatDate(newDate, hoursFormat).length;\n selectRange = [0, hoursLength];\n } else if(selectedIndex === 1) {\n if(evt.keyCode === 38) newDate.setMinutes(minutes - parseInt(options.minuteStep, 10));\n else if(evt.keyCode === 40) newDate.setMinutes(minutes + parseInt(options.minuteStep, 10));\n // re-calculate minutes length because we have changes minutes value\n minutesLength = formatDate(newDate, minutesFormat).length;\n selectRange = [hoursLength + 1, hoursLength + 1 + minutesLength];\n } else if(selectedIndex === 2) {\n if(!lateralMove) $timepicker.switchMeridian();\n selectRange = [hoursLength + 1 + minutesLength + 1, hoursLength + 1 + minutesLength + 3];\n }\n $timepicker.select(newDate, selectedIndex, true);\n createSelection(selectRange[0], selectRange[1]);\n parentScope.$digest();\n };\n\n // Private\n\n function createSelection(start, end) {\n if(element[0].createTextRange) {\n var selRange = element[0].createTextRange();\n selRange.collapse(true);\n selRange.moveStart('character', start);\n selRange.moveEnd('character', end);\n selRange.select();\n } else if(element[0].setSelectionRange) {\n element[0].setSelectionRange(start, end);\n } else if(angular.isUndefined(element[0].selectionStart)) {\n element[0].selectionStart = start;\n element[0].selectionEnd = end;\n }\n }\n\n function focusElement() {\n element[0].focus();\n }\n\n // Overrides\n\n var _init = $timepicker.init;\n $timepicker.init = function() {\n if(isNative && options.useNative) {\n element.prop('type', 'time');\n element.css('-webkit-appearance', 'textfield');\n return;\n } else if(isTouch) {\n element.prop('type', 'text');\n element.attr('readonly', 'true');\n element.on('click', focusElement);\n }\n _init();\n };\n\n var _destroy = $timepicker.destroy;\n $timepicker.destroy = function() {\n if(isNative && options.useNative) {\n element.off('click', focusElement);\n }\n _destroy();\n };\n\n var _show = $timepicker.show;\n $timepicker.show = function() {\n _show();\n // use timeout to hookup the events to prevent \n // event bubbling from being processed imediately. \n $timeout(function() {\n $timepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $timepicker.$onKeyDown);\n }\n }, 0, false);\n };\n\n var _hide = $timepicker.hide;\n $timepicker.hide = function(blur) {\n if(!$timepicker.$isShown) return;\n $timepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $timepicker.$onKeyDown);\n }\n _hide(blur);\n };\n\n return $timepicker;\n\n }\n\n timepickerFactory.defaults = defaults;\n return timepickerFactory;\n\n };\n\n })\n\n\n .directive('bsTimepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $timepicker) {\n\n var defaults = $timepicker.defaults;\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope, controller: controller};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'timeType', 'timeFormat', 'modelTimeFormat', 'useNative', 'hourStep', 'minuteStep', 'length', 'arrowBehavior', 'iconUp', 'iconDown'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!timepicker || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(timepicker),?/i);\n newValue === true ? timepicker.show() : timepicker.hide();\n });\n\n // Initialize timepicker\n if(isNative && (options.useNative || defaults.useNative)) options.timeFormat = 'HH:mm';\n var timepicker = $timepicker(element, controller, options);\n options = timepicker.$options;\n\n var lang = options.lang;\n var formatDate = function(date, format) {\n return $dateFormatter.formatDate(date, format, lang);\n };\n\n // Initialize parser\n var dateParser = $dateParser({format: options.timeFormat, lang: lang});\n\n // Observe attributes for changes\n angular.forEach(['minTime', 'maxTime'], function(key) {\n // console.warn('attr.$observe(%s)', key, attr[key]);\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\n timepicker.$options[key] = dateParser.getTimeForAttribute(key, newValue);\n !isNaN(timepicker.$options[key]) && timepicker.$build();\n validateAgainstMinMaxTime(controller.$dateValue);\n });\n });\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue, controller.$dateValue);\n timepicker.update(controller.$dateValue);\n }, true);\n\n function validateAgainstMinMaxTime(parsedTime) {\n if (!angular.isDate(parsedTime)) return;\n var isMinValid = isNaN(options.minTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) >= options.minTime;\n var isMaxValid = isNaN(options.maxTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) <= options.maxTime;\n var isValid = isMinValid && isMaxValid;\n controller.$setValidity('date', isValid);\n controller.$setValidity('min', isMinValid);\n controller.$setValidity('max', isMaxValid);\n // Only update the model when we have a valid date\n if(!isValid) {\n return;\n }\n controller.$dateValue = parsedTime;\n }\n\n // viewValue -> $parsers -> modelValue\n controller.$parsers.unshift(function(viewValue) {\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\n // Null values should correctly reset the model value & validity\n if(!viewValue) {\n // BREAKING CHANGE:\n // return null (not undefined) when input value is empty, so angularjs 1.3 \n // ngModelController can go ahead and run validators, like ngRequired\n controller.$setValidity('date', true);\n return null;\n }\n var parsedTime = angular.isDate(viewValue) ? viewValue : dateParser.parse(viewValue, controller.$dateValue);\n if(!parsedTime || isNaN(parsedTime.getTime())) {\n controller.$setValidity('date', false);\n // return undefined, causes ngModelController to \n // invalidate model value \n return;\n } else {\n validateAgainstMinMaxTime(parsedTime);\n }\n if(options.timeType === 'string') {\n return formatDate(parsedTime, options.modelTimeFormat || options.timeFormat);\n } else if(options.timeType === 'number') {\n return controller.$dateValue.getTime();\n } else if(options.timeType === 'unix') {\n return controller.$dateValue.getTime() / 1000;\n } else if(options.timeType === 'iso') {\n return controller.$dateValue.toISOString();\n } else {\n return new Date(controller.$dateValue);\n }\n });\n\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n var date;\n if(angular.isUndefined(modelValue) || modelValue === null) {\n date = NaN;\n } else if(angular.isDate(modelValue)) {\n date = modelValue;\n } else if(options.timeType === 'string') {\n date = dateParser.parse(modelValue, null, options.modelTimeFormat);\n } else if(options.timeType === 'unix') {\n date = new Date(modelValue * 1000);\n } else {\n date = new Date(modelValue);\n }\n // Setup default value?\n // if(isNaN(date.getTime())) date = new Date(new Date().setMinutes(0) + 36e5);\n controller.$dateValue = date;\n return getTimeFormattedString();\n });\n\n // viewValue -> element\n controller.$render = function() {\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\n element.val(getTimeFormattedString());\n };\n\n function getTimeFormattedString() {\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.timeFormat);\n }\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (timepicker) timepicker.destroy();\n options = null;\n timepicker = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["timepicker/timepicker.js"],"names":[],"mappings":"qBASQ,OAAA,4IAKF,cAAS,cAET,GAAU,KAAA,UACV,UAAM,UACN,YAAO,qCAEP,SAAA,iCACA,QAAA,QACA,WAAA,EACA,UAAA,EACA,MAAA,EACA,MAAA,EAEA,WAAQ,EACR,SAAU,OACV,WAAY,YACZ,gBAAQ,KACR,WAAU,EACV,SAAA,0BAGF,SAAK,eAEH,OAAI,iCACJ,SAAI,mCACJ,cAAe,cAGf,MAAS,UAAA,YAAkB,aAAqB,OAAQ,iBAAA,WAAA,WAAA,SAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,WAOlD,GAAe,EAAA,EAAA,WAuNV,GAAc,EAAA,MACnB,EAAQ,GAAG,gBAAkB,OACrB,EAAQ,GAAA,iBAChB,GAAQ,UAAG,GACX,EAAQ,UAAG,YAAe,mEAI9B,EAAS,GAAA,kBAAe,EAAA,GACd,QAAG,YAAA,EAAA,GAAA,6DAMb,QAAA,KACE,EAAG,GAAA,WArOH,GAAO,EAAe,EAAW,QAAM,UAAQ,EAAA,sCAK7C,EAAA,EAAA,KACA,EAAY,SAAA,EAAW,GAC3B,MAAI,GAAkB,WAAU,EAAA,EAAY,IAK1C,EAAgB,EAChB,EAAA,EAAgB,YAAe,GAAA,MAC/B,GAAS,KAAA,EAAe,WAAO,SAAA,EAAA,WAAA,GAAA,OAAA,EA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A,EAAa,OAAQ,EAAA,OAAa,SAAS,GAC1C,GAAa,QAAY,UAAS,KACtC,QAAU,SAAW,KAAA,IAAA,EAAA,MAAA,sKAWrB,MAAQ,GAAS,WAAW,EAAY,EAAS,IAI7C,EAAO,GAAW,OAAS,EAAS,WAAW,KAAA,wGAMnD,EAAa,SAAK,GAAS,EAAS,oBAAoB,EAAA,qCAEtD,EAAkB,EAAW,kBAKzB,OAAA,EAAA,QAAmB,WAEvB,EAAI,OAAU,EAAc,cAC5B,KAkBE,SAAW,QAAa,SAAQ,GAGlC,IAAI,EAKF,iCAAA,QAEA,GAAA,QAAA,OAA0B,GAAA,EAAA,EAAA,MAAA,EAAA,EAAA,6CAE5B,GAAW,aAAa,QAAU,IAKhC,EAAkB,GAEA,WAAlB,EAAO,SACF,EAAA,EAAA,EAAA,iBAAA,EAAA,YACsB,WAApB,EAAS,kGAKT,EAAA,WAAiB,cAEtB,GAAA,MAAA,EAAA,iBAKG,YAAW,KAAA,SAAa,kBAG7B,QAAO,YAAS,IAAa,OAAA,EACxB,IACE,QAAS,OAAA,6DAKX,GAAA,MADiB,SAAxB,EAAW,SACJ,IAAA,KAMP,EAAQ,WAAI,oFAiBjB,EAAA","file":"timepicker.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.timepicker', [\r\n 'mgcrea.ngStrap.helpers.dateParser',\r\n 'mgcrea.ngStrap.helpers.dateFormatter',\r\n 'mgcrea.ngStrap.tooltip'])\r\n\r\n .provider('$timepicker', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'timepicker',\r\n placement: 'bottom-left',\r\n template: 'timepicker/timepicker.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n // lang: $locale.id,\r\n useNative: true,\r\n timeType: 'date',\r\n timeFormat: 'shortTime',\r\n modelTimeFormat: null,\r\n autoclose: false,\r\n minTime: -Infinity,\r\n maxTime: +Infinity,\r\n length: 5,\r\n hourStep: 1,\r\n minuteStep: 5,\r\n iconUp: 'glyphicon glyphicon-chevron-up',\r\n iconDown: 'glyphicon glyphicon-chevron-down',\r\n arrowBehavior: 'pager'\r\n };\r\n\r\n this.$get = function($window, $document, $rootScope, $sce, $dateFormatter, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var isTouch = ('createTouch' in $window.document) && isNative;\r\n if(!defaults.lang) defaults.lang = $dateFormatter.getDefaultLocale();\r\n\r\n function timepickerFactory(element, controller, config) {\r\n\r\n var $timepicker = $tooltip(element, angular.extend({}, defaults, config));\r\n var parentScope = config.scope;\r\n var options = $timepicker.$options;\r\n var scope = $timepicker.$scope;\r\n\r\n var lang = options.lang;\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n\r\n // View vars\r\n\r\n var selectedIndex = 0;\r\n var startDate = controller.$dateValue || new Date();\r\n var viewDate = {hour: startDate.getHours(), meridian: startDate.getHours() < 12, minute: startDate.getMinutes(), second: startDate.getSeconds(), millisecond: startDate.getMilliseconds()};\r\n\r\n var format = $dateFormatter.getDatetimeFormat(options.timeFormat, lang);\r\n\r\n var hoursFormat = $dateFormatter.hoursFormat(format),\r\n timeSeparator = $dateFormatter.timeSeparator(format),\r\n minutesFormat = $dateFormatter.minutesFormat(format),\r\n showAM = $dateFormatter.showAM(format);\r\n\r\n scope.$iconUp = options.iconUp;\r\n scope.$iconDown = options.iconDown;\r\n\r\n // Scope methods\r\n\r\n scope.$select = function(date, index) {\r\n $timepicker.select(date, index);\r\n };\r\n scope.$moveIndex = function(value, index) {\r\n $timepicker.$moveIndex(value, index);\r\n };\r\n scope.$switchMeridian = function(date) {\r\n $timepicker.switchMeridian(date);\r\n };\r\n\r\n // Public methods\r\n\r\n $timepicker.update = function(date) {\r\n // console.warn('$timepicker.update() newValue=%o', date);\r\n if(angular.isDate(date) && !isNaN(date.getTime())) {\r\n $timepicker.$date = date;\r\n angular.extend(viewDate, {hour: date.getHours(), minute: date.getMinutes(), second: date.getSeconds(), millisecond: date.getMilliseconds()});\r\n $timepicker.$build();\r\n } else if(!$timepicker.$isBuilt) {\r\n $timepicker.$build();\r\n }\r\n };\r\n\r\n $timepicker.select = function(date, index, keep) {\r\n // console.warn('$timepicker.select', date, scope.$mode);\r\n if(!controller.$dateValue || isNaN(controller.$dateValue.getTime())) controller.$dateValue = new Date(1970, 0, 1);\r\n if(!angular.isDate(date)) date = new Date(date);\r\n if(index === 0) controller.$dateValue.setHours(date.getHours());\r\n else if(index === 1) controller.$dateValue.setMinutes(date.getMinutes());\r\n controller.$setViewValue(angular.copy(controller.$dateValue));\r\n controller.$render();\r\n if(options.autoclose && !keep) {\r\n $timeout(function() { $timepicker.hide(true); });\r\n }\r\n };\r\n\r\n $timepicker.switchMeridian = function(date) {\r\n if (!controller.$dateValue || isNaN(controller.$dateValue.getTime())) {\r\n return;\r\n }\r\n var hours = (date || controller.$dateValue).getHours();\r\n controller.$dateValue.setHours(hours < 12 ? hours + 12 : hours - 12);\r\n controller.$setViewValue(angular.copy(controller.$dateValue));\r\n controller.$render();\r\n };\r\n\r\n // Protected methods\r\n\r\n $timepicker.$build = function() {\r\n // console.warn('$timepicker.$build() viewDate=%o', viewDate);\r\n var i, midIndex = scope.midIndex = parseInt(options.length / 2, 10);\r\n var hours = [], hour;\r\n for(i = 0; i < options.length; i++) {\r\n hour = new Date(1970, 0, 1, viewDate.hour - (midIndex - i) * options.hourStep);\r\n hours.push({date: hour, label: formatDate(hour, hoursFormat), selected: $timepicker.$date && $timepicker.$isSelected(hour, 0), disabled: $timepicker.$isDisabled(hour, 0)});\r\n }\r\n var minutes = [], minute;\r\n for(i = 0; i < options.length; i++) {\r\n minute = new Date(1970, 0, 1, 0, viewDate.minute - (midIndex - i) * options.minuteStep);\r\n minutes.push({date: minute, label: formatDate(minute, minutesFormat), selected: $timepicker.$date && $timepicker.$isSelected(minute, 1), disabled: $timepicker.$isDisabled(minute, 1)});\r\n }\r\n\r\n var rows = [];\r\n for(i = 0; i < options.length; i++) {\r\n rows.push([hours[i], minutes[i]]);\r\n }\r\n scope.rows = rows;\r\n scope.showAM = showAM;\r\n scope.isAM = ($timepicker.$date || hours[midIndex].date).getHours() < 12;\r\n scope.timeSeparator = timeSeparator;\r\n $timepicker.$isBuilt = true;\r\n };\r\n\r\n $timepicker.$isSelected = function(date, index) {\r\n if(!$timepicker.$date) return false;\r\n else if(index === 0) {\r\n return date.getHours() === $timepicker.$date.getHours();\r\n } else if(index === 1) {\r\n return date.getMinutes() === $timepicker.$date.getMinutes();\r\n }\r\n };\r\n\r\n $timepicker.$isDisabled = function(date, index) {\r\n var selectedTime;\r\n if(index === 0) {\r\n selectedTime = date.getTime() + viewDate.minute * 6e4;\r\n } else if(index === 1) {\r\n selectedTime = date.getTime() + viewDate.hour * 36e5;\r\n }\r\n return selectedTime < options.minTime * 1 || selectedTime > options.maxTime * 1;\r\n };\r\n\r\n scope.$arrowAction = function (value, index) {\r\n if (options.arrowBehavior === 'picker') {\r\n $timepicker.$setTimeByStep(value,index);\r\n } else {\r\n $timepicker.$moveIndex(value,index);\r\n }\r\n };\r\n\r\n $timepicker.$setTimeByStep = function(value, index) {\r\n var newDate = new Date($timepicker.$date);\r\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\r\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\r\n if (index === 0) {\r\n newDate.setHours(hours - (parseInt(options.hourStep, 10) * value));\r\n }\r\n else {\r\n newDate.setMinutes(minutes - (parseInt(options.minuteStep, 10) * value));\r\n }\r\n $timepicker.select(newDate, index, true);\r\n };\r\n\r\n $timepicker.$moveIndex = function(value, index) {\r\n var targetDate;\r\n if(index === 0) {\r\n targetDate = new Date(1970, 0, 1, viewDate.hour + (value * options.length), viewDate.minute);\r\n angular.extend(viewDate, {hour: targetDate.getHours()});\r\n } else if(index === 1) {\r\n targetDate = new Date(1970, 0, 1, viewDate.hour, viewDate.minute + (value * options.length * options.minuteStep));\r\n angular.extend(viewDate, {minute: targetDate.getMinutes()});\r\n }\r\n $timepicker.$build();\r\n };\r\n\r\n $timepicker.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown on .dropdown-menu\r\n if(evt.target.nodeName.toLowerCase() !== 'input') evt.preventDefault();\r\n evt.stopPropagation();\r\n // Emulate click for mobile devices\r\n if(isTouch) {\r\n var targetEl = angular.element(evt.target);\r\n if(targetEl[0].nodeName.toLowerCase() !== 'button') {\r\n targetEl = targetEl.parent();\r\n }\r\n targetEl.triggerHandler('click');\r\n }\r\n };\r\n\r\n $timepicker.$onKeyDown = function(evt) {\r\n if (!/(38|37|39|40|13)/.test(evt.keyCode) || evt.shiftKey || evt.altKey) return;\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n // Close on enter\r\n if(evt.keyCode === 13) return $timepicker.hide(true);\r\n\r\n // Navigate with keyboard\r\n var newDate = new Date($timepicker.$date);\r\n var hours = newDate.getHours(), hoursLength = formatDate(newDate, hoursFormat).length;\r\n var minutes = newDate.getMinutes(), minutesLength = formatDate(newDate, minutesFormat).length;\r\n var lateralMove = /(37|39)/.test(evt.keyCode);\r\n var count = 2 + showAM * 1;\r\n\r\n // Navigate indexes (left, right)\r\n if (lateralMove) {\r\n if(evt.keyCode === 37) selectedIndex = selectedIndex < 1 ? count - 1 : selectedIndex - 1;\r\n else if(evt.keyCode === 39) selectedIndex = selectedIndex < count - 1 ? selectedIndex + 1 : 0;\r\n }\r\n\r\n // Update values (up, down)\r\n var selectRange = [0, hoursLength];\r\n if(selectedIndex === 0) {\r\n if(evt.keyCode === 38) newDate.setHours(hours - parseInt(options.hourStep, 10));\r\n else if(evt.keyCode === 40) newDate.setHours(hours + parseInt(options.hourStep, 10));\r\n // re-calculate hours length because we have changed hours value\r\n hoursLength = formatDate(newDate, hoursFormat).length;\r\n selectRange = [0, hoursLength];\r\n } else if(selectedIndex === 1) {\r\n if(evt.keyCode === 38) newDate.setMinutes(minutes - parseInt(options.minuteStep, 10));\r\n else if(evt.keyCode === 40) newDate.setMinutes(minutes + parseInt(options.minuteStep, 10));\r\n // re-calculate minutes length because we have changes minutes value\r\n minutesLength = formatDate(newDate, minutesFormat).length;\r\n selectRange = [hoursLength + 1, hoursLength + 1 + minutesLength];\r\n } else if(selectedIndex === 2) {\r\n if(!lateralMove) $timepicker.switchMeridian();\r\n selectRange = [hoursLength + 1 + minutesLength + 1, hoursLength + 1 + minutesLength + 3];\r\n }\r\n $timepicker.select(newDate, selectedIndex, true);\r\n createSelection(selectRange[0], selectRange[1]);\r\n parentScope.$digest();\r\n };\r\n\r\n // Private\r\n\r\n function createSelection(start, end) {\r\n if(element[0].createTextRange) {\r\n var selRange = element[0].createTextRange();\r\n selRange.collapse(true);\r\n selRange.moveStart('character', start);\r\n selRange.moveEnd('character', end);\r\n selRange.select();\r\n } else if(element[0].setSelectionRange) {\r\n element[0].setSelectionRange(start, end);\r\n } else if(angular.isUndefined(element[0].selectionStart)) {\r\n element[0].selectionStart = start;\r\n element[0].selectionEnd = end;\r\n }\r\n }\r\n\r\n function focusElement() {\r\n element[0].focus();\r\n }\r\n\r\n // Overrides\r\n\r\n var _init = $timepicker.init;\r\n $timepicker.init = function() {\r\n if(isNative && options.useNative) {\r\n element.prop('type', 'time');\r\n element.css('-webkit-appearance', 'textfield');\r\n return;\r\n } else if(isTouch) {\r\n element.prop('type', 'text');\r\n element.attr('readonly', 'true');\r\n element.on('click', focusElement);\r\n }\r\n _init();\r\n };\r\n\r\n var _destroy = $timepicker.destroy;\r\n $timepicker.destroy = function() {\r\n if(isNative && options.useNative) {\r\n element.off('click', focusElement);\r\n }\r\n _destroy();\r\n };\r\n\r\n var _show = $timepicker.show;\r\n $timepicker.show = function() {\r\n _show();\r\n // use timeout to hookup the events to prevent \r\n // event bubbling from being processed imediately. \r\n $timeout(function() {\r\n $timepicker.$element.on(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $timepicker.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var _hide = $timepicker.hide;\r\n $timepicker.hide = function(blur) {\r\n if(!$timepicker.$isShown) return;\r\n $timepicker.$element.off(isTouch ? 'touchstart' : 'mousedown', $timepicker.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $timepicker.$onKeyDown);\r\n }\r\n _hide(blur);\r\n };\r\n\r\n return $timepicker;\r\n\r\n }\r\n\r\n timepickerFactory.defaults = defaults;\r\n return timepickerFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n\r\n .directive('bsTimepicker', function($window, $parse, $q, $dateFormatter, $dateParser, $timepicker) {\r\n\r\n var defaults = $timepicker.defaults;\r\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\r\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope, controller: controller};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'autoclose', 'timeType', 'timeFormat', 'modelTimeFormat', 'useNative', 'hourStep', 'minuteStep', 'length', 'arrowBehavior', 'iconUp', 'iconDown'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!timepicker || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(timepicker),?/i);\r\n newValue === true ? timepicker.show() : timepicker.hide();\r\n });\r\n\r\n // Initialize timepicker\r\n if(isNative && (options.useNative || defaults.useNative)) options.timeFormat = 'HH:mm';\r\n var timepicker = $timepicker(element, controller, options);\r\n options = timepicker.$options;\r\n\r\n var lang = options.lang;\r\n var formatDate = function(date, format) {\r\n return $dateFormatter.formatDate(date, format, lang);\r\n };\r\n\r\n // Initialize parser\r\n var dateParser = $dateParser({format: options.timeFormat, lang: lang});\r\n\r\n // Observe attributes for changes\r\n angular.forEach(['minTime', 'maxTime'], function(key) {\r\n // console.warn('attr.$observe(%s)', key, attr[key]);\r\n angular.isDefined(attr[key]) && attr.$observe(key, function(newValue) {\r\n timepicker.$options[key] = dateParser.getTimeForAttribute(key, newValue);\r\n !isNaN(timepicker.$options[key]) && timepicker.$build();\r\n validateAgainstMinMaxTime(controller.$dateValue);\r\n });\r\n });\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue, controller.$dateValue);\r\n timepicker.update(controller.$dateValue);\r\n }, true);\r\n\r\n function validateAgainstMinMaxTime(parsedTime) {\r\n if (!angular.isDate(parsedTime)) return;\r\n var isMinValid = isNaN(options.minTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) >= options.minTime;\r\n var isMaxValid = isNaN(options.maxTime) || new Date(parsedTime.getTime()).setFullYear(1970, 0, 1) <= options.maxTime;\r\n var isValid = isMinValid && isMaxValid;\r\n controller.$setValidity('date', isValid);\r\n controller.$setValidity('min', isMinValid);\r\n controller.$setValidity('max', isMaxValid);\r\n // Only update the model when we have a valid date\r\n if(!isValid) {\r\n return;\r\n }\r\n controller.$dateValue = parsedTime;\r\n }\r\n\r\n // viewValue -> $parsers -> modelValue\r\n controller.$parsers.unshift(function(viewValue) {\r\n // console.warn('$parser(\"%s\"): viewValue=%o', element.attr('ng-model'), viewValue);\r\n // Null values should correctly reset the model value & validity\r\n if(!viewValue) {\r\n // BREAKING CHANGE:\r\n // return null (not undefined) when input value is empty, so angularjs 1.3 \r\n // ngModelController can go ahead and run validators, like ngRequired\r\n controller.$setValidity('date', true);\r\n return null;\r\n }\r\n var parsedTime = angular.isDate(viewValue) ? viewValue : dateParser.parse(viewValue, controller.$dateValue);\r\n if(!parsedTime || isNaN(parsedTime.getTime())) {\r\n controller.$setValidity('date', false);\r\n // return undefined, causes ngModelController to \r\n // invalidate model value \r\n return;\r\n } else {\r\n validateAgainstMinMaxTime(parsedTime);\r\n }\r\n if(options.timeType === 'string') {\r\n return formatDate(parsedTime, options.modelTimeFormat || options.timeFormat);\r\n } else if(options.timeType === 'number') {\r\n return controller.$dateValue.getTime();\r\n } else if(options.timeType === 'unix') {\r\n return controller.$dateValue.getTime() / 1000;\r\n } else if(options.timeType === 'iso') {\r\n return controller.$dateValue.toISOString();\r\n } else {\r\n return new Date(controller.$dateValue);\r\n }\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n var date;\r\n if(angular.isUndefined(modelValue) || modelValue === null) {\r\n date = NaN;\r\n } else if(angular.isDate(modelValue)) {\r\n date = modelValue;\r\n } else if(options.timeType === 'string') {\r\n date = dateParser.parse(modelValue, null, options.modelTimeFormat);\r\n } else if(options.timeType === 'unix') {\r\n date = new Date(modelValue * 1000);\r\n } else {\r\n date = new Date(modelValue);\r\n }\r\n // Setup default value?\r\n // if(isNaN(date.getTime())) date = new Date(new Date().setMinutes(0) + 36e5);\r\n controller.$dateValue = date;\r\n return getTimeFormattedString();\r\n });\r\n\r\n // viewValue -> element\r\n controller.$render = function() {\r\n // console.warn('$render(\"%s\"): viewValue=%o', element.attr('ng-model'), controller.$viewValue);\r\n element.val(getTimeFormattedString());\r\n };\r\n\r\n function getTimeFormattedString() {\r\n return !controller.$dateValue || isNaN(controller.$dateValue.getTime()) ? '' : formatDate(controller.$dateValue, options.timeFormat);\r\n }\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (timepicker) timepicker.destroy();\r\n options = null;\r\n timepicker = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/timepicker.tpl.js b/dist/modules/timepicker.tpl.js
index 92ca20e63..958687402 100644
--- a/dist/modules/timepicker.tpl.js
+++ b/dist/modules/timepicker.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/timepicker.tpl.min.js b/dist/modules/timepicker.tpl.min.js
index 5592318e2..b8f1496e4 100644
--- a/dist/modules/timepicker.tpl.min.js
+++ b/dist/modules/timepicker.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tooltip.js b/dist/modules/tooltip.js
index d1ac220a4..9c85e4f7e 100644
--- a/dist/modules/tooltip.js
+++ b/dist/modules/tooltip.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tooltip.min.js b/dist/modules/tooltip.min.js
index 50742d87d..8c6c73e3a 100644
--- a/dist/modules/tooltip.min.js
+++ b/dist/modules/tooltip.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tooltip.min.js.map b/dist/modules/toolt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EAAkC,SAAlC,EAAkC,QAAW,EAAiB,QAAA,QAAU,yCAO1E,GAAI,EAAA,EAAA,EAAA,EAAA,qBAIR,EAAS,SAAA,SAAgB,GACL,KAAd,EAAI,OAAc,EAAA,WACpB,EAAQ,OACR,EAAI,oBAIR,EAAS,cAAA,SAAA,GACH,KAAA,EAAA,QACJ,EAAI,GAAA,oEAMN,EAAA,iBACE,EAAI,oBAEC,SAAY,EAAS,GAAA,OAAA,EAAA,GAAA,iBAuL5B,OAAM,iBAOR,EAAI,SAAgB,EAAA,OAAA,EAAA,MAAA,SAAA,EAAA,kBAGlB,GAAQ,EAAc,SAChB,SAAS,SAAK,GAAA,UAAA,iBAAA,wBAKlB,GAAO,GAAA,EAAA,gFAIX,EAAO,IAAA,EAAA,EAAA,qBA3iBL,GAAI,OAAW,UAAA,kDAGf,EAAI,QAAW,QAAW,EAAA,uIAwjBrB,oCAKL,GAAI,IAAO,MAAA,WACH,SAAQ,WAAA,kBAAA,YAAA,YAAA,SAAA,QAAA,UAAA,WAAA,OAAA,YAAA,oBAAA,OAAA,eAAA,SAAA,0CAMZ,EAAI,eAAiB,aACrB,MAAM,+HAQV,QAAK,UAAa,IAAa,EAAK,WAC/B,GAAQ,EAAS,yBAMlB,WAAW,EAAQ,OAAA,EAAA,UAAA,SAAA,EAAA,uBAEpB,QAAA,OAAA,EAAA,aAID,QAAI,UAAY,IAAQ,EAAU,WAClC,GAAW,EAAS,yBAKtB,EAAK,QAAA,EAAa,OAAM,EAAO,OAAK,SAAW,6BAE1C,QAAC,SAAY,KAAQ,IAAU,EAAW,MAAA,wBAC7C,KAAW,EAAS,EAAA,OAAW,EAAa,8IAQxB,EAAA,WAAtB,KAAU,GAAuB,GAAA,8DASpC,EAAA","file":"tooltip.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$tooltip', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n customClass: '',\n prefixClass: 'tooltip',\n prefixEvent: 'tooltip',\n container: false,\n target: false,\n placement: 'top',\n template: 'tooltip/tooltip.tpl.html',\n contentTemplate: false,\n trigger: 'hover focus',\n keyboard: false,\n html: false,\n show: false,\n title: '',\n type: '',\n delay: 0,\n autoClose: false,\n bsEnabled: true\n };\n\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {\n\n var trim = String.prototype.trim;\n var isTouch = 'createTouch' in $window.document;\n var htmlReplaceRegExp = /ng-bind=\"/ig;\n var $body = angular.element($window.document);\n\n function TooltipFactory(element, config) {\n\n var $tooltip = {};\n\n // Common vars\n var nodeName = element[0].nodeName.toLowerCase();\n var options = $tooltip.$options = angular.extend({}, defaults, config);\n $tooltip.$promise = fetchTemplate(options.template);\n var scope = $tooltip.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n if(options.delay && angular.isString(options.delay)) {\n var split = options.delay.split(',').map(parseFloat);\n options.delay = split.length > 1 ? {show: split[0], hide: split[1]} : split[0];\n }\n\n // Support scope as string options\n if(options.title) {\n scope.title = $sce.trustAsHtml(options.title);\n }\n\n // Provide scope helpers\n scope.$setEnabled = function(isEnabled) {\n scope.$$postDigest(function() {\n $tooltip.setEnabled(isEnabled);\n });\n };\n scope.$hide = function() {\n scope.$$postDigest(function() {\n $tooltip.hide();\n });\n };\n scope.$show = function() {\n scope.$$postDigest(function() {\n $tooltip.show();\n });\n };\n scope.$toggle = function() {\n scope.$$postDigest(function() {\n $tooltip.toggle();\n });\n };\n // Publish isShown as a protected var on scope\n $tooltip.$isShown = scope.$isShown = false;\n\n // Private vars\n var timeout, hoverState;\n\n // Support contentTemplate option\n if(options.contentTemplate) {\n $tooltip.$promise = $tooltip.$promise.then(function(template) {\n var templateEl = angular.element(template);\n return fetchTemplate(options.contentTemplate)\n .then(function(contentTemplate) {\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]);\n if(!contentEl.length) contentEl = findElement('[ng-bind=\"title\"]', templateEl[0]);\n contentEl.removeAttr('ng-bind').html(contentTemplate);\n return templateEl[0].outerHTML;\n });\n });\n }\n\n // Fetch, compile then initialize tooltip\n var tipLinker, tipElement, tipTemplate, tipContainer, tipScope;\n $tooltip.$promise.then(function(template) {\n if(angular.isObject(template)) template = template.data;\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\n template = trim.apply(template);\n tipTemplate = template;\n tipLinker = $compile(template);\n $tooltip.init();\n });\n\n $tooltip.init = function() {\n\n // Options: delay\n if (options.delay && angular.isNumber(options.delay)) {\n options.delay = {\n show: options.delay,\n hide: options.delay\n };\n }\n\n // Replace trigger on touch devices ?\n // if(isTouch && options.trigger === defaults.trigger) {\n // options.trigger.replace(/hover/g, 'click');\n // }\n\n // Options : container\n if(options.container === 'self') {\n tipContainer = element;\n } else if(angular.isElement(options.container)) {\n tipContainer = options.container;\n } else if(options.container) {\n tipContainer = findElement(options.container);\n }\n\n // Options: trigger\n bindTriggerEvents();\n\n // Options: target\n if(options.target) {\n options.target = angular.isElement(options.target) ? options.target : findElement(options.target);\n }\n\n // Options: show\n if(options.show) {\n scope.$$postDigest(function() {\n options.trigger === 'focus' ? element[0].focus() : $tooltip.show();\n });\n }\n\n };\n\n $tooltip.destroy = function() {\n\n // Unbind events\n unbindTriggerEvents();\n\n // Remove element\n destroyTipElement();\n\n // Destroy scope\n scope.$destroy();\n\n };\n\n $tooltip.enter = function() {\n\n clearTimeout(timeout);\n hoverState = 'in';\n if (!options.delay || !options.delay.show) {\n return $tooltip.show();\n }\n\n timeout = setTimeout(function() {\n if (hoverState ==='in') $tooltip.show();\n }, options.delay.show);\n\n };\n\n $tooltip.show = function() {\n if (!options.bsEnabled || $tooltip.$isShown) return;\n\n scope.$emit(options.prefixEvent + '.show.before', $tooltip);\n var parent, after;\n if (options.container) {\n parent = tipContainer;\n if (tipContainer[0].lastChild) {\n after = angular.element(tipContainer[0].lastChild);\n } else {\n after = null;\n }\n } else {\n parent = null;\n after = element;\n }\n\n\n // Hide any existing tipElement\n if(tipElement) destroyTipElement();\n // Fetch a cloned element linked from template\n tipScope = $tooltip.$scope.$new();\n tipElement = $tooltip.$element = tipLinker(tipScope, function(clonedElement, scope) {});\n\n // Set the initial positioning. Make the tooltip invisible\n // so IE doesn't try to focus on it off screen.\n tipElement.css({top: '-9999px', left: '-9999px', display: 'block', visibility: 'hidden'});\n\n // Options: animation\n if(options.animation) tipElement.addClass(options.animation);\n // Options: type\n if(options.type) tipElement.addClass(options.prefixClass + '-' + options.type);\n // Options: custom classes\n if(options.customClass) tipElement.addClass(options.customClass);\n\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.enter(tipElement, parent, after, enterAnimateCallback);\n if(promise && promise.then) promise.then(enterAnimateCallback);\n\n $tooltip.$isShown = scope.$isShown = true;\n safeDigest(scope);\n $$rAF(function () {\n $tooltip.$applyPlacement();\n\n // Once placed, make the tooltip visible\n if(tipElement) tipElement.css({visibility: 'visible'});\n }); // var a = bodyEl.offsetWidth + 1; ?\n\n // Bind events\n if(options.keyboard) {\n if(options.trigger !== 'focus') {\n $tooltip.focus();\n }\n bindKeyboardEvents();\n }\n\n if(options.autoClose) {\n bindAutoCloseEvents();\n }\n\n };\n\n function enterAnimateCallback() {\n scope.$emit(options.prefixEvent + '.show', $tooltip);\n }\n\n $tooltip.leave = function() {\n\n clearTimeout(timeout);\n hoverState = 'out';\n if (!options.delay || !options.delay.hide) {\n return $tooltip.hide();\n }\n timeout = setTimeout(function () {\n if (hoverState === 'out') {\n $tooltip.hide();\n }\n }, options.delay.hide);\n\n };\n\n var _blur;\n $tooltip.hide = function(blur) {\n\n if(!$tooltip.$isShown) return;\n scope.$emit(options.prefixEvent + '.hide.before', $tooltip);\n\n // store blur value for leaveAnimateCallback to use\n _blur = blur;\n\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.leave(tipElement, leaveAnimateCallback);\n if(promise && promise.then) promise.then(leaveAnimateCallback);\n\n $tooltip.$isShown = scope.$isShown = false;\n safeDigest(scope);\n\n // Unbind events\n if(options.keyboard && tipElement !== null) {\n unbindKeyboardEvents();\n }\n\n if(options.autoClose && tipElement !== null) {\n unbindAutoCloseEvents();\n }\n };\n\n function leaveAnimateCallback() {\n scope.$emit(options.prefixEvent + '.hide', $tooltip);\n // Allow to blur the input when hidden, like when pressing enter key\n if(_blur && options.trigger === 'focus') {\n return element[0].blur();\n }\n\n // clean up child scopes\n destroyTipElement();\n }\n\n $tooltip.toggle = function() {\n $tooltip.$isShown ? $tooltip.leave() : $tooltip.enter();\n };\n\n $tooltip.focus = function() {\n tipElement[0].focus();\n };\n\n $tooltip.setEnabled = function(isEnabled) {\n options.bsEnabled = isEnabled;\n };\n\n // Protected methods\n\n $tooltip.$applyPlacement = function() {\n if(!tipElement) return;\n\n // Determine if we're doing an auto or normal placement\n var placement = options.placement,\n autoToken = /\\s?auto?\\s?/i,\n autoPlace = autoToken.test(placement);\n\n if (autoPlace) {\n placement = placement.replace(autoToken, '') || defaults.placement;\n }\n\n // Need to add the position class before we get\n // the offsets\n tipElement.addClass(options.placement);\n\n // Get the position of the target element\n // and the height and width of the tooltip so we can center it.\n var elementPosition = getPosition(),\n tipWidth = tipElement.prop('offsetWidth'),\n tipHeight = tipElement.prop('offsetHeight');\n\n // If we're auto placing, we need to check the positioning\n if (autoPlace) {\n var originalPlacement = placement;\n var container = options.container ? angular.element(document.querySelector(options.container)) : element.parent();\n var containerPosition = getPosition(container);\n\n // Determine if the vertical placement\n if (originalPlacement.indexOf('bottom') >= 0 && elementPosition.bottom + tipHeight > containerPosition.bottom) {\n placement = originalPlacement.replace('bottom', 'top');\n } else if (originalPlacement.indexOf('top') >= 0 && elementPosition.top - tipHeight < containerPosition.top) {\n placement = originalPlacement.replace('top', 'bottom');\n }\n\n // Determine the horizontal placement\n // The exotic placements of left and right are opposite of the standard placements. Their arrows are put on the left/right\n // and flow in the opposite direction of their placement.\n if ((originalPlacement === 'right' || originalPlacement === 'bottom-left' || originalPlacement === 'top-left') &&\n elementPosition.right + tipWidth > containerPosition.width) {\n\n placement = originalPlacement === 'right' ? 'left' : placement.replace('left', 'right');\n } else if ((originalPlacement === 'left' || originalPlacement === 'bottom-right' || originalPlacement === 'top-right') &&\n elementPosition.left - tipWidth < containerPosition.left) {\n\n placement = originalPlacement === 'left' ? 'right' : placement.replace('right', 'left');\n }\n\n tipElement.removeClass(originalPlacement).addClass(placement);\n }\n\n // Get the tooltip's top and left coordinates to center it with this directive.\n var tipPosition = getCalculatedOffset(placement, elementPosition, tipWidth, tipHeight);\n applyPlacementCss(tipPosition.top, tipPosition.left);\n };\n\n $tooltip.$onKeyUp = function(evt) {\n if (evt.which === 27 && $tooltip.$isShown) {\n $tooltip.hide();\n evt.stopPropagation();\n }\n };\n\n $tooltip.$onFocusKeyUp = function(evt) {\n if (evt.which === 27) {\n element[0].blur();\n evt.stopPropagation();\n }\n };\n\n $tooltip.$onFocusElementMouseDown = function(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n // Some browsers do not auto-focus buttons (eg. Safari)\n $tooltip.$isShown ? element[0].blur() : element[0].focus();\n };\n\n // bind/unbind events\n function bindTriggerEvents() {\n var triggers = options.trigger.split(' ');\n angular.forEach(triggers, function(trigger) {\n if(trigger === 'click') {\n element.on('click', $tooltip.toggle);\n } else if(trigger !== 'manual') {\n element.on(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\n element.on(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\n nodeName === 'button' && trigger !== 'hover' && element.on(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\n }\n });\n }\n\n function unbindTriggerEvents() {\n var triggers = options.trigger.split(' ');\n for (var i = triggers.length; i--;) {\n var trigger = triggers[i];\n if(trigger === 'click') {\n element.off('click', $tooltip.toggle);\n } else if(trigger !== 'manual') {\n element.off(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\n element.off(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\n nodeName === 'button' && trigger !== 'hover' && element.off(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\n }\n }\n }\n\n function bindKeyboardEvents() {\n if(options.trigger !== 'focus') {\n tipElement.on('keyup', $tooltip.$onKeyUp);\n } else {\n element.on('keyup', $tooltip.$onFocusKeyUp);\n }\n }\n\n function unbindKeyboardEvents() {\n if(options.trigger !== 'focus') {\n tipElement.off('keyup', $tooltip.$onKeyUp);\n } else {\n element.off('keyup', $tooltip.$onFocusKeyUp);\n }\n }\n\n var _autoCloseEventsBinded = false;\n function bindAutoCloseEvents() {\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n // Stop propagation when clicking inside tooltip\n tipElement.on('click', stopEventPropagation);\n\n // Hide when clicking outside tooltip\n $body.on('click', $tooltip.hide);\n\n _autoCloseEventsBinded = true;\n }, 0, false);\n }\n\n function unbindAutoCloseEvents() {\n if (_autoCloseEventsBinded) {\n tipElement.off('click', stopEventPropagation);\n $body.off('click', $tooltip.hide);\n _autoCloseEventsBinded = false;\n }\n }\n\n function stopEventPropagation(event) {\n event.stopPropagation();\n }\n\n // Private methods\n\n function getPosition($element) {\n $element = $element || (options.target || element);\n\n var el = $element[0];\n\n var elRect = el.getBoundingClientRect();\n if (elRect.width === null) {\n // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093\n elRect = angular.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top });\n }\n\n var elPos;\n if (options.container === 'body') {\n elPos = dimensions.offset(el);\n } else {\n elPos = dimensions.position(el);\n }\n\n return angular.extend({}, elRect, elPos);\n }\n\n function getCalculatedOffset(placement, position, actualWidth, actualHeight) {\n var offset;\n var split = placement.split('-');\n\n switch (split[0]) {\n case 'right':\n offset = {\n top: position.top + position.height / 2 - actualHeight / 2,\n left: position.left + position.width\n };\n break;\n case 'bottom':\n offset = {\n top: position.top + position.height,\n left: position.left + position.width / 2 - actualWidth / 2\n };\n break;\n case 'left':\n offset = {\n top: position.top + position.height / 2 - actualHeight / 2,\n left: position.left - actualWidth\n };\n break;\n default:\n offset = {\n top: position.top - actualHeight,\n left: position.left + position.width / 2 - actualWidth / 2\n };\n break;\n }\n\n if(!split[1]) {\n return offset;\n }\n\n // Add support for corners @todo css\n if(split[0] === 'top' || split[0] === 'bottom') {\n switch (split[1]) {\n case 'left':\n offset.left = position.left;\n break;\n case 'right':\n offset.left = position.left + position.width - actualWidth;\n }\n } else if(split[0] === 'left' || split[0] === 'right') {\n switch (split[1]) {\n case 'top':\n offset.top = position.top - actualHeight;\n break;\n case 'bottom':\n offset.top = position.top + position.height;\n }\n }\n\n return offset;\n }\n\n function applyPlacementCss(top, left) {\n tipElement.css({ top: top + 'px', left: left + 'px' });\n }\n\n function destroyTipElement() {\n // Cancel pending callbacks\n clearTimeout(timeout);\n\n if($tooltip.$isShown && tipElement !== null) {\n if(options.autoClose) {\n unbindAutoCloseEvents();\n }\n\n if(options.keyboard) {\n unbindKeyboardEvents();\n }\n }\n\n if(tipScope) {\n tipScope.$destroy();\n tipScope = null;\n }\n\n if(tipElement) {\n tipElement.remove();\n tipElement = $tooltip.$element = null;\n }\n }\n\n return $tooltip;\n\n }\n\n // Helper functions\n\n function safeDigest(scope) {\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\n }\n\n function findElement(query, element) {\n return angular.element((element || document).querySelectorAll(query));\n }\n\n var fetchPromises = {};\n function fetchTemplate(template) {\n if(fetchPromises[template]) return fetchPromises[template];\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\n .then(function(res) {\n if(angular.isObject(res)) {\n $templateCache.put(template, res.data);\n return res.data;\n }\n return res;\n }));\n }\n\n return TooltipFactory;\n\n };\n\n })\n\n .directive('bsTooltip', function($window, $location, $sce, $tooltip, $$rAF) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'backdropAnimation', 'type', 'customClass'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // overwrite inherited title value when no value specified\n // fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11\n if (!scope.hasOwnProperty('title')){\n scope.title = '';\n }\n\n // Observe scope attributes for change\n attr.$observe('title', function(newValue) {\n if (angular.isDefined(newValue) || !scope.hasOwnProperty('title')) {\n var oldValue = scope.title;\n scope.title = $sce.trustAsHtml(newValue);\n angular.isDefined(oldValue) && $$rAF(function() {\n tooltip && tooltip.$applyPlacement();\n });\n }\n });\n\n // Support scope as an object\n attr.bsTooltip && scope.$watch(attr.bsTooltip, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.title = newValue;\n }\n angular.isDefined(oldValue) && $$rAF(function() {\n tooltip && tooltip.$applyPlacement();\n });\n }, true);\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!tooltip || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(tooltip),?/i);\n newValue === true ? tooltip.show() : tooltip.hide();\n });\n\n // Enabled binding support\n attr.bsEnabled && scope.$watch(attr.bsEnabled, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.bsEnabled, newValue, oldValue);\n if(!tooltip || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|1|,?(tooltip),?/i);\n newValue === false ? tooltip.setEnabled(false) : tooltip.setEnabled(true);\n });\n\n // Initialize popover\n var tooltip = $tooltip(element, options);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if(tooltip) tooltip.destroy();\n options = null;\n tooltip = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["tooltip/tooltip.js"],"names":[],"mappings":"qBASM,OAAA,0BAAa,+CAEb,WAAW,cAEX,GAAW,KAAA,UACX,UAAU,UACV,YAAA,GACA,YAAS,UACT,YAAU,UACV,WAAM,EACN,QAAM,EACN,UAAO,MACP,SAAM,2BACN,iBAAO,EACP,QAAA,cACA,UAAA,kBAGF,MAAK,WAEH,MAAI,EACJ,WAAI,EACJ,WAAI,QAGJ,MAAS,UAAA,aAAwB,WAAQ,KAAA,iBAAA,QAAA,WAAA,OAAA,aAAA,QAAA,WAAA,SAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,WAOvC,GAAoB,EAAA,WA0MlB,KACA,EAAK,MAAA,EAAQ,YAAkB,QAAY,sBA8C3C,GAAA,MAAA,EAAA,YAAA,QAAA,0BAGO,EAAS,GAAA,WAIlB,aA+FM,QACA,GAAA,EAAa,QAAY,MAAA,qFAK/B,EAAS,GAAA,UAAA,EAAsB,aAAA,QAAA,EAAA,OACzB,EAAA,GAAmB,UAAR,EAAsB,aAAA,OAAA,EAAA,OACxB,WAAb,GAAoC,UAAd,GAAc,EAAA,GAAA,EAAA,aAAA,YAAA,EAAA,qCAKhC,SAEA,GADA,GAAQ,EAAI,QAAY,MAAA,KACxB,EAAA,EAAa,OAAY,KAAA,+DAK/B,EAAS,IAAqB,UAArB,EAAqB,aAAA,QAAA,EAAA,OACzB,EAAQ,IAAY,UAAZ,EAAqB,aAAA,OAAA,EAAA,OAChB,WAAd,GAAgC,UAAT,GAAS,EAAA,IAAA,EAAA,aAAA,YAAA,EAAA,yCAM3B,UAAT,EAAS,QACP,EAAW,GAAA,QAAY,EAAS,YAEzB,GAAA,QAAA,EAAA,4BAKL,UAAA,EAAA,QACJ,EAAS,IAAA,QAAA,EAAsB,wDAU3B,2BAKF,E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AlC,EAAkC,QAAW,EAAiB,QAAA,QAAU,yCAO1E,GAAI,EAAA,EAAA,EAAA,EAAA,qBAIR,EAAS,SAAA,SAAgB,GACL,KAAd,EAAI,OAAc,EAAA,WACpB,EAAQ,OACR,EAAI,oBAIR,EAAS,cAAA,SAAA,GACH,KAAA,EAAA,QACJ,EAAI,GAAA,oEAMN,EAAA,iBACE,EAAI,oBAEC,SAAY,EAAS,GAAA,OAAA,EAAA,GAAA,iBAuL5B,OAAM,iBAOR,EAAI,SAAgB,EAAA,OAAA,EAAA,MAAA,SAAA,EAAA,kBAGlB,GAAQ,EAAc,SAChB,SAAS,SAAK,GAAA,UAAA,iBAAA,wBAKlB,GAAO,GAAA,EAAA,gFAIX,EAAO,IAAA,EAAA,EAAA,qBA3iBL,GAAI,OAAW,UAAA,kDAGf,EAAI,QAAW,QAAW,EAAA,uIAwjBrB,oCAKL,GAAI,IAAO,MAAA,WACH,SAAQ,WAAA,kBAAA,YAAA,YAAA,SAAA,QAAA,UAAA,WAAA,OAAA,YAAA,oBAAA,OAAA,eAAA,SAAA,0CAMZ,EAAI,eAAiB,aACrB,MAAM,+HAQV,QAAK,UAAa,IAAa,EAAK,WAC/B,GAAQ,EAAS,yBAMlB,WAAW,EAAQ,OAAA,EAAA,UAAA,SAAA,EAAA,uBAEpB,QAAA,OAAA,EAAA,aAID,QAAI,UAAY,IAAQ,EAAU,WAClC,GAAW,EAAS,yBAKtB,EAAK,QAAA,EAAa,OAAM,EAAO,OAAK,SAAW,6BAE1C,QAAC,SAAY,KAAQ,IAAU,EAAW,MAAA,wBAC7C,KAAW,EAAS,EAAA,OAAW,EAAa,8IAQxB,EAAA,WAAtB,KAAU,GAAuB,GAAA,8DASpC,EAAA","file":"tooltip.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])\r\n\r\n .provider('$tooltip', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n customClass: '',\r\n prefixClass: 'tooltip',\r\n prefixEvent: 'tooltip',\r\n container: false,\r\n target: false,\r\n placement: 'top',\r\n template: 'tooltip/tooltip.tpl.html',\r\n contentTemplate: false,\r\n trigger: 'hover focus',\r\n keyboard: false,\r\n html: false,\r\n show: false,\r\n title: '',\r\n type: '',\r\n delay: 0,\r\n autoClose: false,\r\n bsEnabled: true\r\n };\r\n\r\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {\r\n\r\n var trim = String.prototype.trim;\r\n var isTouch = 'createTouch' in $window.document;\r\n var htmlReplaceRegExp = /ng-bind=\"/ig;\r\n var $body = angular.element($window.document);\r\n\r\n function TooltipFactory(element, config) {\r\n\r\n var $tooltip = {};\r\n\r\n // Common vars\r\n var nodeName = element[0].nodeName.toLowerCase();\r\n var options = $tooltip.$options = angular.extend({}, defaults, config);\r\n $tooltip.$promise = fetchTemplate(options.template);\r\n var scope = $tooltip.$scope = options.scope && options.scope.$new() || $rootScope.$new();\r\n if(options.delay && angular.isString(options.delay)) {\r\n var split = options.delay.split(',').map(parseFloat);\r\n options.delay = split.length > 1 ? {show: split[0], hide: split[1]} : split[0];\r\n }\r\n\r\n // Support scope as string options\r\n if(options.title) {\r\n scope.title = $sce.trustAsHtml(options.title);\r\n }\r\n\r\n // Provide scope helpers\r\n scope.$setEnabled = function(isEnabled) {\r\n scope.$$postDigest(function() {\r\n $tooltip.setEnabled(isEnabled);\r\n });\r\n };\r\n scope.$hide = function() {\r\n scope.$$postDigest(function() {\r\n $tooltip.hide();\r\n });\r\n };\r\n scope.$show = function() {\r\n scope.$$postDigest(function() {\r\n $tooltip.show();\r\n });\r\n };\r\n scope.$toggle = function() {\r\n scope.$$postDigest(function() {\r\n $tooltip.toggle();\r\n });\r\n };\r\n // Publish isShown as a protected var on scope\r\n $tooltip.$isShown = scope.$isShown = false;\r\n\r\n // Private vars\r\n var timeout, hoverState;\r\n\r\n // Support contentTemplate option\r\n if(options.contentTemplate) {\r\n $tooltip.$promise = $tooltip.$promise.then(function(template) {\r\n var templateEl = angular.element(template);\r\n return fetchTemplate(options.contentTemplate)\r\n .then(function(contentTemplate) {\r\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]);\r\n if(!contentEl.length) contentEl = findElement('[ng-bind=\"title\"]', templateEl[0]);\r\n contentEl.removeAttr('ng-bind').html(contentTemplate);\r\n return templateEl[0].outerHTML;\r\n });\r\n });\r\n }\r\n\r\n // Fetch, compile then initialize tooltip\r\n var tipLinker, tipElement, tipTemplate, tipContainer, tipScope;\r\n $tooltip.$promise.then(function(template) {\r\n if(angular.isObject(template)) template = template.data;\r\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\r\n template = trim.apply(template);\r\n tipTemplate = template;\r\n tipLinker = $compile(template);\r\n $tooltip.init();\r\n });\r\n\r\n $tooltip.init = function() {\r\n\r\n // Options: delay\r\n if (options.delay && angular.isNumber(options.delay)) {\r\n options.delay = {\r\n show: options.delay,\r\n hide: options.delay\r\n };\r\n }\r\n\r\n // Replace trigger on touch devices ?\r\n // if(isTouch && options.trigger === defaults.trigger) {\r\n // options.trigger.replace(/hover/g, 'click');\r\n // }\r\n\r\n // Options : container\r\n if(options.container === 'self') {\r\n tipContainer = element;\r\n } else if(angular.isElement(options.container)) {\r\n tipContainer = options.container;\r\n } else if(options.container) {\r\n tipContainer = findElement(options.container);\r\n }\r\n\r\n // Options: trigger\r\n bindTriggerEvents();\r\n\r\n // Options: target\r\n if(options.target) {\r\n options.target = angular.isElement(options.target) ? options.target : findElement(options.target);\r\n }\r\n\r\n // Options: show\r\n if(options.show) {\r\n scope.$$postDigest(function() {\r\n options.trigger === 'focus' ? element[0].focus() : $tooltip.show();\r\n });\r\n }\r\n\r\n };\r\n\r\n $tooltip.destroy = function() {\r\n\r\n // Unbind events\r\n unbindTriggerEvents();\r\n\r\n // Remove element\r\n destroyTipElement();\r\n\r\n // Destroy scope\r\n scope.$destroy();\r\n\r\n };\r\n\r\n $tooltip.enter = function() {\r\n\r\n clearTimeout(timeout);\r\n hoverState = 'in';\r\n if (!options.delay || !options.delay.show) {\r\n return $tooltip.show();\r\n }\r\n\r\n timeout = setTimeout(function() {\r\n if (hoverState ==='in') $tooltip.show();\r\n }, options.delay.show);\r\n\r\n };\r\n\r\n $tooltip.show = function() {\r\n if (!options.bsEnabled || $tooltip.$isShown) return;\r\n\r\n scope.$emit(options.prefixEvent + '.show.before', $tooltip);\r\n var parent, after;\r\n if (options.container) {\r\n parent = tipContainer;\r\n if (tipContainer[0].lastChild) {\r\n after = angular.element(tipContainer[0].lastChild);\r\n } else {\r\n after = null;\r\n }\r\n } else {\r\n parent = null;\r\n after = element;\r\n }\r\n\r\n\r\n // Hide any existing tipElement\r\n if(tipElement) destroyTipElement();\r\n // Fetch a cloned element linked from template\r\n tipScope = $tooltip.$scope.$new();\r\n tipElement = $tooltip.$element = tipLinker(tipScope, function(clonedElement, scope) {});\r\n\r\n // Set the initial positioning. Make the tooltip invisible\r\n // so IE doesn't try to focus on it off screen.\r\n tipElement.css({top: '-9999px', left: '-9999px', display: 'block', visibility: 'hidden'});\r\n\r\n // Options: animation\r\n if(options.animation) tipElement.addClass(options.animation);\r\n // Options: type\r\n if(options.type) tipElement.addClass(options.prefixClass + '-' + options.type);\r\n // Options: custom classes\r\n if(options.customClass) tipElement.addClass(options.customClass);\r\n\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n var promise = $animate.enter(tipElement, parent, after, enterAnimateCallback);\r\n if(promise && promise.then) promise.then(enterAnimateCallback);\r\n\r\n $tooltip.$isShown = scope.$isShown = true;\r\n safeDigest(scope);\r\n $$rAF(function () {\r\n $tooltip.$applyPlacement();\r\n\r\n // Once placed, make the tooltip visible\r\n if(tipElement) tipElement.css({visibility: 'visible'});\r\n }); // var a = bodyEl.offsetWidth + 1; ?\r\n\r\n // Bind events\r\n if(options.keyboard) {\r\n if(options.trigger !== 'focus') {\r\n $tooltip.focus();\r\n }\r\n bindKeyboardEvents();\r\n }\r\n\r\n if(options.autoClose) {\r\n bindAutoCloseEvents();\r\n }\r\n\r\n };\r\n\r\n function enterAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.show', $tooltip);\r\n }\r\n\r\n $tooltip.leave = function() {\r\n\r\n clearTimeout(timeout);\r\n hoverState = 'out';\r\n if (!options.delay || !options.delay.hide) {\r\n return $tooltip.hide();\r\n }\r\n timeout = setTimeout(function () {\r\n if (hoverState === 'out') {\r\n $tooltip.hide();\r\n }\r\n }, options.delay.hide);\r\n\r\n };\r\n\r\n var _blur;\r\n $tooltip.hide = function(blur) {\r\n\r\n if(!$tooltip.$isShown) return;\r\n scope.$emit(options.prefixEvent + '.hide.before', $tooltip);\r\n\r\n // store blur value for leaveAnimateCallback to use\r\n _blur = blur;\r\n\r\n // Support v1.3+ $animate\r\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\r\n var promise = $animate.leave(tipElement, leaveAnimateCallback);\r\n if(promise && promise.then) promise.then(leaveAnimateCallback);\r\n\r\n $tooltip.$isShown = scope.$isShown = false;\r\n safeDigest(scope);\r\n\r\n // Unbind events\r\n if(options.keyboard && tipElement !== null) {\r\n unbindKeyboardEvents();\r\n }\r\n\r\n if(options.autoClose && tipElement !== null) {\r\n unbindAutoCloseEvents();\r\n }\r\n };\r\n\r\n function leaveAnimateCallback() {\r\n scope.$emit(options.prefixEvent + '.hide', $tooltip);\r\n // Allow to blur the input when hidden, like when pressing enter key\r\n if(_blur && options.trigger === 'focus') {\r\n return element[0].blur();\r\n }\r\n\r\n // clean up child scopes\r\n destroyTipElement();\r\n }\r\n\r\n $tooltip.toggle = function() {\r\n $tooltip.$isShown ? $tooltip.leave() : $tooltip.enter();\r\n };\r\n\r\n $tooltip.focus = function() {\r\n tipElement[0].focus();\r\n };\r\n\r\n $tooltip.setEnabled = function(isEnabled) {\r\n options.bsEnabled = isEnabled;\r\n };\r\n\r\n // Protected methods\r\n\r\n $tooltip.$applyPlacement = function() {\r\n if(!tipElement) return;\r\n\r\n // Determine if we're doing an auto or normal placement\r\n var placement = options.placement,\r\n autoToken = /\\s?auto?\\s?/i,\r\n autoPlace = autoToken.test(placement);\r\n\r\n if (autoPlace) {\r\n placement = placement.replace(autoToken, '') || defaults.placement;\r\n }\r\n\r\n // Need to add the position class before we get\r\n // the offsets\r\n tipElement.addClass(options.placement);\r\n\r\n // Get the position of the target element\r\n // and the height and width of the tooltip so we can center it.\r\n var elementPosition = getPosition(),\r\n tipWidth = tipElement.prop('offsetWidth'),\r\n tipHeight = tipElement.prop('offsetHeight');\r\n\r\n // If we're auto placing, we need to check the positioning\r\n if (autoPlace) {\r\n var originalPlacement = placement;\r\n var container = options.container ? angular.element(document.querySelector(options.container)) : element.parent();\r\n var containerPosition = getPosition(container);\r\n\r\n // Determine if the vertical placement\r\n if (originalPlacement.indexOf('bottom') >= 0 && elementPosition.bottom + tipHeight > containerPosition.bottom) {\r\n placement = originalPlacement.replace('bottom', 'top');\r\n } else if (originalPlacement.indexOf('top') >= 0 && elementPosition.top - tipHeight < containerPosition.top) {\r\n placement = originalPlacement.replace('top', 'bottom');\r\n }\r\n\r\n // Determine the horizontal placement\r\n // The exotic placements of left and right are opposite of the standard placements. Their arrows are put on the left/right\r\n // and flow in the opposite direction of their placement.\r\n if ((originalPlacement === 'right' || originalPlacement === 'bottom-left' || originalPlacement === 'top-left') &&\r\n elementPosition.right + tipWidth > containerPosition.width) {\r\n\r\n placement = originalPlacement === 'right' ? 'left' : placement.replace('left', 'right');\r\n } else if ((originalPlacement === 'left' || originalPlacement === 'bottom-right' || originalPlacement === 'top-right') &&\r\n elementPosition.left - tipWidth < containerPosition.left) {\r\n\r\n placement = originalPlacement === 'left' ? 'right' : placement.replace('right', 'left');\r\n }\r\n\r\n tipElement.removeClass(originalPlacement).addClass(placement);\r\n }\r\n\r\n // Get the tooltip's top and left coordinates to center it with this directive.\r\n var tipPosition = getCalculatedOffset(placement, elementPosition, tipWidth, tipHeight);\r\n applyPlacementCss(tipPosition.top, tipPosition.left);\r\n };\r\n\r\n $tooltip.$onKeyUp = function(evt) {\r\n if (evt.which === 27 && $tooltip.$isShown) {\r\n $tooltip.hide();\r\n evt.stopPropagation();\r\n }\r\n };\r\n\r\n $tooltip.$onFocusKeyUp = function(evt) {\r\n if (evt.which === 27) {\r\n element[0].blur();\r\n evt.stopPropagation();\r\n }\r\n };\r\n\r\n $tooltip.$onFocusElementMouseDown = function(evt) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n // Some browsers do not auto-focus buttons (eg. Safari)\r\n $tooltip.$isShown ? element[0].blur() : element[0].focus();\r\n };\r\n\r\n // bind/unbind events\r\n function bindTriggerEvents() {\r\n var triggers = options.trigger.split(' ');\r\n angular.forEach(triggers, function(trigger) {\r\n if(trigger === 'click') {\r\n element.on('click', $tooltip.toggle);\r\n } else if(trigger !== 'manual') {\r\n element.on(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\r\n element.on(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\r\n nodeName === 'button' && trigger !== 'hover' && element.on(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\r\n }\r\n });\r\n }\r\n\r\n function unbindTriggerEvents() {\r\n var triggers = options.trigger.split(' ');\r\n for (var i = triggers.length; i--;) {\r\n var trigger = triggers[i];\r\n if(trigger === 'click') {\r\n element.off('click', $tooltip.toggle);\r\n } else if(trigger !== 'manual') {\r\n element.off(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\r\n element.off(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\r\n nodeName === 'button' && trigger !== 'hover' && element.off(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\r\n }\r\n }\r\n }\r\n\r\n function bindKeyboardEvents() {\r\n if(options.trigger !== 'focus') {\r\n tipElement.on('keyup', $tooltip.$onKeyUp);\r\n } else {\r\n element.on('keyup', $tooltip.$onFocusKeyUp);\r\n }\r\n }\r\n\r\n function unbindKeyboardEvents() {\r\n if(options.trigger !== 'focus') {\r\n tipElement.off('keyup', $tooltip.$onKeyUp);\r\n } else {\r\n element.off('keyup', $tooltip.$onFocusKeyUp);\r\n }\r\n }\r\n\r\n var _autoCloseEventsBinded = false;\r\n function bindAutoCloseEvents() {\r\n // use timeout to hookup the events to prevent\r\n // event bubbling from being processed imediately.\r\n $timeout(function() {\r\n // Stop propagation when clicking inside tooltip\r\n tipElement.on('click', stopEventPropagation);\r\n\r\n // Hide when clicking outside tooltip\r\n $body.on('click', $tooltip.hide);\r\n\r\n _autoCloseEventsBinded = true;\r\n }, 0, false);\r\n }\r\n\r\n function unbindAutoCloseEvents() {\r\n if (_autoCloseEventsBinded) {\r\n tipElement.off('click', stopEventPropagation);\r\n $body.off('click', $tooltip.hide);\r\n _autoCloseEventsBinded = false;\r\n }\r\n }\r\n\r\n function stopEventPropagation(event) {\r\n event.stopPropagation();\r\n }\r\n\r\n // Private methods\r\n\r\n function getPosition($element) {\r\n $element = $element || (options.target || element);\r\n\r\n var el = $element[0];\r\n\r\n var elRect = el.getBoundingClientRect();\r\n if (elRect.width === null) {\r\n // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093\r\n elRect = angular.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top });\r\n }\r\n\r\n var elPos;\r\n if (options.container === 'body') {\r\n elPos = dimensions.offset(el);\r\n } else {\r\n elPos = dimensions.position(el);\r\n }\r\n\r\n return angular.extend({}, elRect, elPos);\r\n }\r\n\r\n function getCalculatedOffset(placement, position, actualWidth, actualHeight) {\r\n var offset;\r\n var split = placement.split('-');\r\n\r\n switch (split[0]) {\r\n case 'right':\r\n offset = {\r\n top: position.top + position.height / 2 - actualHeight / 2,\r\n left: position.left + position.width\r\n };\r\n break;\r\n case 'bottom':\r\n offset = {\r\n top: position.top + position.height,\r\n left: position.left + position.width / 2 - actualWidth / 2\r\n };\r\n break;\r\n case 'left':\r\n offset = {\r\n top: position.top + position.height / 2 - actualHeight / 2,\r\n left: position.left - actualWidth\r\n };\r\n break;\r\n default:\r\n offset = {\r\n top: position.top - actualHeight,\r\n left: position.left + position.width / 2 - actualWidth / 2\r\n };\r\n break;\r\n }\r\n\r\n if(!split[1]) {\r\n return offset;\r\n }\r\n\r\n // Add support for corners @todo css\r\n if(split[0] === 'top' || split[0] === 'bottom') {\r\n switch (split[1]) {\r\n case 'left':\r\n offset.left = position.left;\r\n break;\r\n case 'right':\r\n offset.left = position.left + position.width - actualWidth;\r\n }\r\n } else if(split[0] === 'left' || split[0] === 'right') {\r\n switch (split[1]) {\r\n case 'top':\r\n offset.top = position.top - actualHeight;\r\n break;\r\n case 'bottom':\r\n offset.top = position.top + position.height;\r\n }\r\n }\r\n\r\n return offset;\r\n }\r\n\r\n function applyPlacementCss(top, left) {\r\n tipElement.css({ top: top + 'px', left: left + 'px' });\r\n }\r\n\r\n function destroyTipElement() {\r\n // Cancel pending callbacks\r\n clearTimeout(timeout);\r\n\r\n if($tooltip.$isShown && tipElement !== null) {\r\n if(options.autoClose) {\r\n unbindAutoCloseEvents();\r\n }\r\n\r\n if(options.keyboard) {\r\n unbindKeyboardEvents();\r\n }\r\n }\r\n\r\n if(tipScope) {\r\n tipScope.$destroy();\r\n tipScope = null;\r\n }\r\n\r\n if(tipElement) {\r\n tipElement.remove();\r\n tipElement = $tooltip.$element = null;\r\n }\r\n }\r\n\r\n return $tooltip;\r\n\r\n }\r\n\r\n // Helper functions\r\n\r\n function safeDigest(scope) {\r\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\r\n }\r\n\r\n function findElement(query, element) {\r\n return angular.element((element || document).querySelectorAll(query));\r\n }\r\n\r\n var fetchPromises = {};\r\n function fetchTemplate(template) {\r\n if(fetchPromises[template]) return fetchPromises[template];\r\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\r\n .then(function(res) {\r\n if(angular.isObject(res)) {\r\n $templateCache.put(template, res.data);\r\n return res.data;\r\n }\r\n return res;\r\n }));\r\n }\r\n\r\n return TooltipFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsTooltip', function($window, $location, $sce, $tooltip, $$rAF) {\r\n\r\n return {\r\n restrict: 'EAC',\r\n scope: true,\r\n link: function postLink(scope, element, attr, transclusion) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'backdropAnimation', 'type', 'customClass'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // overwrite inherited title value when no value specified\r\n // fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11\r\n if (!scope.hasOwnProperty('title')){\r\n scope.title = '';\r\n }\r\n\r\n // Observe scope attributes for change\r\n attr.$observe('title', function(newValue) {\r\n if (angular.isDefined(newValue) || !scope.hasOwnProperty('title')) {\r\n var oldValue = scope.title;\r\n scope.title = $sce.trustAsHtml(newValue);\r\n angular.isDefined(oldValue) && $$rAF(function() {\r\n tooltip && tooltip.$applyPlacement();\r\n });\r\n }\r\n });\r\n\r\n // Support scope as an object\r\n attr.bsTooltip && scope.$watch(attr.bsTooltip, function(newValue, oldValue) {\r\n if(angular.isObject(newValue)) {\r\n angular.extend(scope, newValue);\r\n } else {\r\n scope.title = newValue;\r\n }\r\n angular.isDefined(oldValue) && $$rAF(function() {\r\n tooltip && tooltip.$applyPlacement();\r\n });\r\n }, true);\r\n\r\n // Visibility binding support\r\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\r\n if(!tooltip || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(tooltip),?/i);\r\n newValue === true ? tooltip.show() : tooltip.hide();\r\n });\r\n\r\n // Enabled binding support\r\n attr.bsEnabled && scope.$watch(attr.bsEnabled, function(newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', attr.bsEnabled, newValue, oldValue);\r\n if(!tooltip || !angular.isDefined(newValue)) return;\r\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|1|,?(tooltip),?/i);\r\n newValue === false ? tooltip.setEnabled(false) : tooltip.setEnabled(true);\r\n });\r\n\r\n // Initialize popover\r\n var tooltip = $tooltip(element, options);\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if(tooltip) tooltip.destroy();\r\n options = null;\r\n tooltip = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/tooltip.tpl.js b/dist/modules/tooltip.tpl.js
index 5df7c7009..965dcba58 100644
--- a/dist/modules/tooltip.tpl.js
+++ b/dist/modules/tooltip.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/tooltip.tpl.min.js b/dist/modules/tooltip.tpl.min.js
index f11bdd674..e7356c9bc 100644
--- a/dist/modules/tooltip.tpl.min.js
+++ b/dist/modules/tooltip.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/typeahead.js b/dist/modules/typeahead.js
index 5b702a9aa..8417dcd5b 100644
--- a/dist/modules/typeahead.js
+++ b/dist/modules/typeahead.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/typeahead.min.js b/dist/modules/typeahead.min.js
index b93863687..0640140eb 100644
--- a/dist/modules/typeahead.min.js
+++ b/dist/modules/typeahead.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/typeahead.min.js.map b/dist/modules/typeahead.min.js.map
index 95e2fc864..cdc5534e1 100644
--- a/dist/modules/typeahead.min.js.map
+++ b/dist/modules/typeahead.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["typeahead/typeahead.js"],"names":[],"mappings":"qBASM,OAAA,4BAAa,yBAAA,iDAEb,aAAU,cAEV,GAAW,KAAA,UACX,UAAU,UACV,YAAM,YACN,YAAO,aACP,UAAW,cACX,SAAQ,+BACR,QAAO,QACP,WAAA,sBAGF,MAAK,cAEH,OAAI,iBAEJ,WAAS,sFAOP,GAAsB,EAAS,EAAA,GAE/B,GAAI,MAGF,EAAM,QAAW,UAAA,EAAA,WAGnB,IAAA,GAAM,EAAA,mBAGJ,cAAmB,aACjB,kDAKF,UAAM,SAAa,KACjB,aAAW,8BAKb,QAAO,SAAW,8CAMlB,WAAiB,WACjB,MAAG,GAAM,cAKX,EAAW,OAAA,SAAW,GACpB,EAAM,SAAA,kDAMN,SAAW,SAAc,GACzB,EAAA,aAAW,wBAIX,GAAA,GAAY,EAAA,SAAQ,GAAc,uDAKpC,GAAW,EAAa,YAEpB,MAAS,EAAM,YAAS,UAAA,EAAA,4BAM5B,MAAA,GAAW,WAAY,EAIhB,EAAM,SAAS,QAAG,QAAiB,SAAA,EAAA,aAAA,EAAA,WAAA,QAAA,EAAA,YAHhC,EAAM,SAAS,UAMh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EAClC,OAAsB,UAAlB,EAA4B,GAAA,qEAOlC,IAAM,GAAI,EAAY,UAAW,EAAA,aAC3B,EAAW,QAAA,UAAU,GAAA,EAAA,OAAA,SAAA,GAAA,MAAA,EAAA,UACzB,GAAU,QAAA,SAAA,GAAA,EAAA,aAAA,GAAA,EACV,EAAA,IAAY,EAAA,EAAA,WAAA,QAAA,iBAAA,IAAA,OAAA,gDAMjB,EAAA","file":"typeahead.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\n\n .provider('$typeahead', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'typeahead',\n prefixEvent: '$typeahead',\n placement: 'bottom-left',\n template: 'typeahead/typeahead.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n minLength: 1,\n filter: 'filter',\n limit: 6,\n comparator: ''\n };\n\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n\n function TypeaheadFactory(element, controller, config) {\n\n var $typeahead = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $typeahead = $tooltip(element, options);\n var parentScope = config.scope;\n var scope = $typeahead.$scope;\n\n scope.$resetMatches = function(){\n scope.$matches = [];\n scope.$activeIndex = 0;\n };\n scope.$resetMatches();\n\n scope.$activate = function(index) {\n scope.$$postDigest(function() {\n $typeahead.activate(index);\n });\n };\n\n scope.$select = function(index, evt) {\n scope.$$postDigest(function() {\n $typeahead.select(index);\n });\n };\n\n scope.$isVisible = function() {\n return $typeahead.$isVisible();\n };\n\n // Public methods\n\n $typeahead.update = function(matches) {\n scope.$matches = matches;\n if(scope.$activeIndex >= matches.length) {\n scope.$activeIndex = 0;\n }\n };\n\n $typeahead.activate = function(index) {\n scope.$activeIndex = index;\n };\n\n $typeahead.select = function(index) {\n var value = scope.$matches[index].value;\n // console.log('$setViewValue', value);\n controller.$setViewValue(value);\n controller.$render();\n scope.$resetMatches();\n if(parentScope) parentScope.$digest();\n // Emit event\n scope.$emit(options.prefixEvent + '.select', value, index);\n };\n\n // Protected methods\n\n $typeahead.$isVisible = function() {\n if(!options.minLength || !controller) {\n return !!scope.$matches.length;\n }\n // minLength support\n return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;\n };\n\n $typeahead.$getIndex = function(value) {\n var l = scope.$matches.length, i = l;\n if(!l) return;\n for(i = l; i--;) {\n if(scope.$matches[i].value === value) break;\n }\n if(i < 0) return;\n return i;\n };\n\n $typeahead.$onMouseDown = function(evt) {\n // Prevent blur on mousedown\n evt.preventDefault();\n evt.stopPropagation();\n };\n\n $typeahead.$onKeyDown = function(evt) {\n if(!/(38|40|13)/.test(evt.keyCode)) return;\n\n // Let ngSubmit pass if the typeahead tip is hidden\n if($typeahead.$isVisible()) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n // Select with enter\n if(evt.keyCode === 13 && scope.$matches.length) {\n $typeahead.select(scope.$activeIndex);\n }\n\n // Navigate with keyboard\n else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\n scope.$digest();\n };\n\n // Overrides\n\n var show = $typeahead.show;\n $typeahead.show = function() {\n show();\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n $typeahead.$element.on('mousedown', $typeahead.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $typeahead.$onKeyDown);\n }\n }, 0, false);\n };\n\n var hide = $typeahead.hide;\n $typeahead.hide = function() {\n $typeahead.$element.off('mousedown', $typeahead.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $typeahead.$onKeyDown);\n }\n hide();\n };\n\n return $typeahead;\n\n }\n\n TypeaheadFactory.defaults = defaults;\n return TypeaheadFactory;\n\n };\n\n })\n\n .directive('bsTypeahead', function($window, $parse, $q, $typeahead, $parseOptions) {\n\n var defaults = $typeahead.defaults;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Build proper ngOptions\n var filter = options.filter || defaults.filter;\n var limit = options.limit || defaults.limit;\n var comparator = options.comparator || defaults.comparator;\n\n var ngOptions = attr.ngOptions;\n if(filter) ngOptions += ' | ' + filter + ':$viewValue';\n if (comparator) ngOptions += ':' + comparator;\n if(limit) ngOptions += ' | limitTo:' + limit;\n var parsedOptions = $parseOptions(ngOptions);\n\n // Initialize typeahead\n var typeahead = $typeahead(element, controller, options);\n\n // Watch options on demand\n if(options.watchOptions) {\n // Watch ngOptions values before filtering for changes, drop function calls\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').replace(/\\(.*\\)/g, '').trim();\n scope.$watch(watchedOptions, function (newValue, oldValue) {\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\n parsedOptions.valuesFn(scope, controller).then(function (values) {\n typeahead.update(values);\n controller.$render();\n });\n }, true);\n }\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('$watch', element.attr('ng-model'), newValue);\n scope.$modelValue = newValue; // Publish modelValue on scope for custom templates\n parsedOptions.valuesFn(scope, controller)\n .then(function(values) {\n // Prevent input with no future prospect if selectMode is truthy\n // @TODO test selectMode\n if(options.selectMode && !values.length && newValue.length > 0) {\n controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));\n return;\n }\n if(values.length > limit) values = values.slice(0, limit);\n var isVisible = typeahead.$isVisible();\n isVisible && typeahead.update(values);\n // Do not re-queue an update if a correct value has been selected\n if(values.length === 1 && values[0].value === newValue) return;\n !isVisible && typeahead.update(values);\n // Queue a new rendering that will leverage collection loading\n controller.$render();\n });\n });\n\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n var displayValue = parsedOptions.displayValue(modelValue);\n return displayValue === undefined ? '' : displayValue;\n });\n\n // Model rendering in view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n if(controller.$isEmpty(controller.$viewValue)) return element.val('');\n var index = typeahead.$getIndex(controller.$modelValue);\n var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;\n selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;\n element.val(selected ? selected.toString().replace(/<(?:.|\\n)*?>/gm, '').trim() : '');\n };\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (typeahead) typeahead.destroy();\n options = null;\n typeahead = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
\ No newline at end of file
+{"version":3,"sources":["typeahead/typeahead.js"],"names":[],"mappings":"qBASM,OAAA,4BAAa,yBAAA,iDAEb,aAAU,cAEV,GAAW,KAAA,UACX,UAAU,UACV,YAAM,YACN,YAAO,aACP,UAAW,cACX,SAAQ,+BACR,QAAO,QACP,WAAA,sBAGF,MAAK,cAEH,OAAI,iBAEJ,WAAS,sFAOP,GAAsB,EAAS,EAAA,GAE/B,GAAI,MAGF,EAAM,QAAW,UAAA,EAAA,WAGnB,IAAA,GAAM,EAAA,mBAGJ,cAAmB,aACjB,kDAKF,UAAM,SAAa,KACjB,aAAW,8BAKb,QAAO,SAAW,8CAMlB,WAAiB,WACjB,MAAG,GAAM,cAKX,EAAW,OAAA,SAAW,GACpB,EAAM,SAAA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AQ,QAAA,SAAe,KAExB,YAAA,uBAEC,SAAO,0CAKT,WADD,GAAU,cAAgB,EAAU,WAAU,UAAU,EAAA,EAAA,WAAA,OAAA,GAGxD,GAAA,OAAW,IAAA,EAAA,EAAA,MAAA,EAAA,0EAKf,GAAW,EAAiB,OAAA,GAE1B,EAAI,eAKN,EAAW,YAAU,KAAA,SAAY,GAE/B,GAAG,GAAW,EAAS,aAAW,EAClC,OAAsB,UAAlB,EAA4B,GAAA,qEAOlC,IAAM,GAAI,EAAY,UAAW,EAAA,aAC3B,EAAW,QAAA,UAAU,GAAA,EAAA,OAAA,SAAA,GAAA,MAAA,EAAA,UACzB,GAAU,QAAA,SAAA,GAAA,EAAA,aAAA,GAAA,EACV,EAAA,IAAY,EAAA,EAAA,WAAA,QAAA,iBAAA,IAAA,OAAA,gDAMjB,EAAA","file":"typeahead.min.js","sourcesContent":["'use strict';\r\n\r\nangular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\r\n\r\n .provider('$typeahead', function() {\r\n\r\n var defaults = this.defaults = {\r\n animation: 'am-fade',\r\n prefixClass: 'typeahead',\r\n prefixEvent: '$typeahead',\r\n placement: 'bottom-left',\r\n template: 'typeahead/typeahead.tpl.html',\r\n trigger: 'focus',\r\n container: false,\r\n keyboard: true,\r\n html: false,\r\n delay: 0,\r\n minLength: 1,\r\n filter: 'filter',\r\n limit: 6,\r\n comparator: ''\r\n };\r\n\r\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\r\n\r\n var bodyEl = angular.element($window.document.body);\r\n\r\n function TypeaheadFactory(element, controller, config) {\r\n\r\n var $typeahead = {};\r\n\r\n // Common vars\r\n var options = angular.extend({}, defaults, config);\r\n\r\n $typeahead = $tooltip(element, options);\r\n var parentScope = config.scope;\r\n var scope = $typeahead.$scope;\r\n\r\n scope.$resetMatches = function(){\r\n scope.$matches = [];\r\n scope.$activeIndex = 0;\r\n };\r\n scope.$resetMatches();\r\n\r\n scope.$activate = function(index) {\r\n scope.$$postDigest(function() {\r\n $typeahead.activate(index);\r\n });\r\n };\r\n\r\n scope.$select = function(index, evt) {\r\n scope.$$postDigest(function() {\r\n $typeahead.select(index);\r\n });\r\n };\r\n\r\n scope.$isVisible = function() {\r\n return $typeahead.$isVisible();\r\n };\r\n\r\n // Public methods\r\n\r\n $typeahead.update = function(matches) {\r\n scope.$matches = matches;\r\n if(scope.$activeIndex >= matches.length) {\r\n scope.$activeIndex = 0;\r\n }\r\n };\r\n\r\n $typeahead.activate = function(index) {\r\n scope.$activeIndex = index;\r\n };\r\n\r\n $typeahead.select = function(index) {\r\n var value = scope.$matches[index].value;\r\n // console.log('$setViewValue', value);\r\n controller.$setViewValue(value);\r\n controller.$render();\r\n scope.$resetMatches();\r\n if(parentScope) parentScope.$digest();\r\n // Emit event\r\n scope.$emit(options.prefixEvent + '.select', value, index);\r\n };\r\n\r\n // Protected methods\r\n\r\n $typeahead.$isVisible = function() {\r\n if(!options.minLength || !controller) {\r\n return !!scope.$matches.length;\r\n }\r\n // minLength support\r\n return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;\r\n };\r\n\r\n $typeahead.$getIndex = function(value) {\r\n var l = scope.$matches.length, i = l;\r\n if(!l) return;\r\n for(i = l; i--;) {\r\n if(scope.$matches[i].value === value) break;\r\n }\r\n if(i < 0) return;\r\n return i;\r\n };\r\n\r\n $typeahead.$onMouseDown = function(evt) {\r\n // Prevent blur on mousedown\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n };\r\n\r\n $typeahead.$onKeyDown = function(evt) {\r\n if(!/(38|40|13)/.test(evt.keyCode)) return;\r\n\r\n // Let ngSubmit pass if the typeahead tip is hidden\r\n if($typeahead.$isVisible()) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n }\r\n\r\n // Select with enter\r\n if(evt.keyCode === 13 && scope.$matches.length) {\r\n $typeahead.select(scope.$activeIndex);\r\n }\r\n\r\n // Navigate with keyboard\r\n else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\r\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\r\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\r\n scope.$digest();\r\n };\r\n\r\n // Overrides\r\n\r\n var show = $typeahead.show;\r\n $typeahead.show = function() {\r\n show();\r\n // use timeout to hookup the events to prevent\r\n // event bubbling from being processed imediately.\r\n $timeout(function() {\r\n $typeahead.$element.on('mousedown', $typeahead.$onMouseDown);\r\n if(options.keyboard) {\r\n element.on('keydown', $typeahead.$onKeyDown);\r\n }\r\n }, 0, false);\r\n };\r\n\r\n var hide = $typeahead.hide;\r\n $typeahead.hide = function() {\r\n $typeahead.$element.off('mousedown', $typeahead.$onMouseDown);\r\n if(options.keyboard) {\r\n element.off('keydown', $typeahead.$onKeyDown);\r\n }\r\n hide();\r\n };\r\n\r\n return $typeahead;\r\n\r\n }\r\n\r\n TypeaheadFactory.defaults = defaults;\r\n return TypeaheadFactory;\r\n\r\n };\r\n\r\n })\r\n\r\n .directive('bsTypeahead', function($window, $parse, $q, $typeahead, $parseOptions) {\r\n\r\n var defaults = $typeahead.defaults;\r\n\r\n return {\r\n restrict: 'EAC',\r\n require: 'ngModel',\r\n link: function postLink(scope, element, attr, controller) {\r\n\r\n // Directive options\r\n var options = {scope: scope};\r\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator'], function(key) {\r\n if(angular.isDefined(attr[key])) options[key] = attr[key];\r\n });\r\n\r\n // Build proper ngOptions\r\n var filter = options.filter || defaults.filter;\r\n var limit = options.limit || defaults.limit;\r\n var comparator = options.comparator || defaults.comparator;\r\n\r\n var ngOptions = attr.ngOptions;\r\n if(filter) ngOptions += ' | ' + filter + ':$viewValue';\r\n if (comparator) ngOptions += ':' + comparator;\r\n if(limit) ngOptions += ' | limitTo:' + limit;\r\n var parsedOptions = $parseOptions(ngOptions);\r\n\r\n // Initialize typeahead\r\n var typeahead = $typeahead(element, controller, options);\r\n\r\n // Watch options on demand\r\n if(options.watchOptions) {\r\n // Watch ngOptions values before filtering for changes, drop function calls\r\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').replace(/\\(.*\\)/g, '').trim();\r\n scope.$watch(watchedOptions, function (newValue, oldValue) {\r\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\r\n parsedOptions.valuesFn(scope, controller).then(function (values) {\r\n typeahead.update(values);\r\n controller.$render();\r\n });\r\n }, true);\r\n }\r\n\r\n // Watch model for changes\r\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\r\n // console.warn('$watch', element.attr('ng-model'), newValue);\r\n scope.$modelValue = newValue; // Publish modelValue on scope for custom templates\r\n parsedOptions.valuesFn(scope, controller)\r\n .then(function(values) {\r\n // Prevent input with no future prospect if selectMode is truthy\r\n // @TODO test selectMode\r\n if(options.selectMode && !values.length && newValue.length > 0) {\r\n controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));\r\n return;\r\n }\r\n if(values.length > limit) values = values.slice(0, limit);\r\n var isVisible = typeahead.$isVisible();\r\n isVisible && typeahead.update(values);\r\n // Do not re-queue an update if a correct value has been selected\r\n if(values.length === 1 && values[0].value === newValue) return;\r\n !isVisible && typeahead.update(values);\r\n // Queue a new rendering that will leverage collection loading\r\n controller.$render();\r\n });\r\n });\r\n\r\n // modelValue -> $formatters -> viewValue\r\n controller.$formatters.push(function(modelValue) {\r\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\r\n var displayValue = parsedOptions.displayValue(modelValue);\r\n return displayValue === undefined ? '' : displayValue;\r\n });\r\n\r\n // Model rendering in view\r\n controller.$render = function () {\r\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\r\n if(controller.$isEmpty(controller.$viewValue)) return element.val('');\r\n var index = typeahead.$getIndex(controller.$modelValue);\r\n var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;\r\n selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;\r\n element.val(selected ? selected.toString().replace(/<(?:.|\\n)*?>/gm, '').trim() : '');\r\n };\r\n\r\n // Garbage collection\r\n scope.$on('$destroy', function() {\r\n if (typeahead) typeahead.destroy();\r\n options = null;\r\n typeahead = null;\r\n });\r\n\r\n }\r\n };\r\n\r\n });\r\n"],"sourceRoot":"/source/"}
\ No newline at end of file
diff --git a/dist/modules/typeahead.tpl.js b/dist/modules/typeahead.tpl.js
index dda2e1f27..97f6aaa38 100644
--- a/dist/modules/typeahead.tpl.js
+++ b/dist/modules/typeahead.tpl.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/dist/modules/typeahead.tpl.min.js b/dist/modules/typeahead.tpl.min.js
index a724bddac..fc3566922 100644
--- a/dist/modules/typeahead.tpl.min.js
+++ b/dist/modules/typeahead.tpl.min.js
@@ -1,6 +1,6 @@
/**
* angular-strap
- * @version v2.1.5 - 2014-12-23
+ * @version v2.1.5 - 2014-12-30
* @link http://mgcrea.github.io/angular-strap
* @author Olivier Louvignes (olivier@mg-crea.com)
* @license MIT License, http://www.opensource.org/licenses/MIT
diff --git a/docs/index.html b/docs/index.html
index db3099de1..0f91f3028 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -80,6 +80,7 @@
+
@@ -124,6 +125,7 @@
+
@@ -158,6 +160,7 @@
+