Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ver(release): bump to 0.7.1

  • Loading branch information...
commit dc160cc526e03bde9bece504fae7c3cd4e47d7c4 1 parent d8dcace
@mgcrea authored
View
2  component.json
@@ -2,7 +2,7 @@
"author": "Olivier Louvignes",
"name": "angular-strap",
"description": "AngularStrap - Twitter Bootstrap directives for AngularJS",
- "version": "0.7.0",
+ "version": "0.7.1",
"homepage": "http://mgcrea.github.com/angular-strap",
"repository": {
"type": "git",
View
395 dist/angular-strap.js
@@ -1,6 +1,6 @@
/**
* AngularStrap - Twitter Bootstrap directives for AngularJS
- * @version v0.7.0 - 2013-03-11
+ * @version v0.7.1 - 2013-03-21
* @link http://mgcrea.github.com/angular-strap
* @author Olivier Louvignes <olivier@mg-crea.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -345,41 +345,54 @@ angular.module('$strap.directives')
angular.module('$strap.directives')
-.directive('bsDatepicker', ['$timeout', function($timeout) {
+.directive('bsDatepicker', ['$timeout', '$strap.config', function($timeout, config) {
'use strict';
var isTouch = 'ontouchstart' in window && !window.navigator.userAgent.match(/PhantomJS/i);
- var DATE_REGEXP_MAP = {
- '/' : '[\\/]',
- '-' : '[-]',
- '.' : '[.]',
- 'dd' : '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
- 'd' : '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
- 'mm' : '(?:[0]?[1-9]|[1][012])',
- 'm' : '(?:[0]?[1-9]|[1][012])',
- 'yyyy' : '(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])',
- 'yy' : '(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])'
+ var regexpMap = function regexpMap(language) {
+ language = language || 'en';
+ return {
+ '/' : '[\\/]',
+ '-' : '[-]',
+ '.' : '[.]',
+ ' ' : '[\\s]',
+ 'dd' : '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
+ 'd' : '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
+ 'mm' : '(?:[0]?[1-9]|[1][012])',
+ 'm' : '(?:[0]?[1-9]|[1][012])',
+ 'DD' : '(?:' + $.fn.datepicker.dates[language].days.join('|') + ')',
+ 'D' : '(?:' + $.fn.datepicker.dates[language].daysShort.join('|') + ')',
+ 'MM' : '(?:' + $.fn.datepicker.dates[language].months.join('|') + ')',
+ 'M' : '(?:' + $.fn.datepicker.dates[language].monthsShort.join('|') + ')',
+ 'yyyy' : '(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])',
+ 'yy' : '(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])'
+ };
+ };
+
+ var regexpForDateFormat = function regexpForDateFormat(format, language) {
+ var re = format, map = regexpMap(language), i;
+ // Abstract replaces to avoid collisions
+ i = 0; angular.forEach(map, function(v, k) {
+ re = re.split(k).join('${' + i + '}'); i++;
+ });
+ // Replace abstracted values
+ i = 0; angular.forEach(map, function(v, k) {
+ re = re.split('${' + i + '}').join(v); i++;
+ });
+ return new RegExp('^' + re + '$', ['i']);
};
return {
restrict: 'A',
require: '?ngModel',
link: function postLink(scope, element, attrs, controller) {
- //console.log('postLink', this, arguments); window.element = element;
-
- var regexpForDateFormat = function(dateFormat, options) {
- options || (options = {});
- var re = dateFormat, regexpMap = DATE_REGEXP_MAP;
- /*if(options.mask) {
- regexpMap['/'] = '';
- regexpMap['-'] = '';
- }*/
- angular.forEach(regexpMap, function(v, k) { re = re.split(k).join(v); });
- return new RegExp('^' + re + '$', ['i']);
- };
- var dateFormatRegexp = isTouch ? 'yyyy/mm/dd' : regexpForDateFormat(attrs.dateFormat || 'mm/dd/yyyy'/*, {mask: !!attrs.uiMask}*/);
+ var options = config.datepicker || {},
+ language = attrs.language || options.language || 'en',
+ format = attrs.dateFormat || options.format || ($.fn.datepicker.dates[language] && $.fn.datepicker.dates[language].format) || 'mm/dd/yyyy';
+
+ var dateFormatRegexp = isTouch ? 'yyyy/mm/dd' : regexpForDateFormat(format, language);
// Handle date validity according to dateFormat
if(controller) {
@@ -395,12 +408,6 @@ angular.module('$strap.directives')
});
}
- // Support add-on
- var component = element.next('[data-toggle="datepicker"]');
- if(component.length) {
- component.on('click', function() { isTouch ? element.trigger('focus') : element.datepicker('show'); });
- }
-
// Use native interface for touch devices
if(isTouch && element.prop('type') === 'text') {
@@ -438,66 +445,178 @@ angular.module('$strap.directives')
element.attr('data-toggle', 'datepicker');
element.datepicker({
autoclose: true,
- forceParse: attrs.forceParse || false,
- language: attrs.language || 'en'
+ format: format,
+ language: language,
+ forceParse: attrs.forceParse || false
});
}
+ // Support add-on
+ var component = element.siblings('[data-toggle="datepicker"]');
+ if(component.length) {
+ component.on('click', function() { element.trigger('focus'); });
+ }
+
}
};
}]);
+// https://github.com/eternicode/bootstrap-datepicker
angular.module('$strap.directives')
-.directive('bsDropdown', ['$parse', '$compile', function($parse, $compile) {
+.directive('bsDaterangepicker', ['$timeout', function($timeout) {
'use strict';
- var slice = Array.prototype.slice;
-
- var template = '' +
- '<ul class="dropdown-menu" role="menu" aria-labelledby="drop1">' +
- '<li ng-repeat="item in items" ng-class="{divider: !!item.divider, \'dropdown-submenu\': !!item.submenu && item.submenu.length}">' +
- '<a ng-hide="!!item.divider" tabindex="-1" ng-href="{{item.href}}" ng-click="{{item.click}}" target="{{item.target}}" ng-bind-html-unsafe="item.text"></a>' +
- '</li>' +
- '</ul>';
-
- var linkSubmenu = function(items, parent, scope) {
- var subitems, submenu, subscope;
- for (var i = 0, l = items.length; i < l; i++) {
- if(subitems = items[i].submenu) {
- subscope = scope.$new();
- subscope.items = subitems;
- submenu = $compile(template)(subscope);
- submenu = submenu.appendTo(parent.children('li:nth-child(' + (i+1) + ')'));
- asyncLinkSubmenu(subitems, submenu, subscope);
- }
+ var isTouch = 'ontouchstart' in window && !window.navigator.userAgent.match(/PhantomJS/i);
+
+ // var DATE_REGEXP_MAP = {
+ // '/' : '[\\/]',
+ // '-' : '[-]',
+ // '.' : '[.]',
+ // 'dd' : '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
+ // 'd' : '(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))',
+ // 'mm' : '(?:[0]?[1-9]|[1][012])',
+ // 'm' : '(?:[0]?[1-9]|[1][012])',
+ // 'yyyy' : '(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])',
+ // 'yy' : '(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])'
+ // };
+
+ return {
+ restrict: 'A',
+ require: '?ngModel',
+ link: function postLink(scope, element, attrs, controller) {
+ console.log('postLink', this, arguments); window.element = element;
+
+ // var regexpForDateFormat = function(dateFormat, options) {
+ // options || (options = {});
+ // var re = dateFormat, regexpMap = DATE_REGEXP_MAP;
+ // /*if(options.mask) {
+ // regexpMap['/'] = '';
+ // regexpMap['-'] = '';
+ // }*/
+ // angular.forEach(regexpMap, function(v, k) { re = re.split(k).join(v); });
+ // return new RegExp('^' + re + '$', ['i']);
+ // };
+
+ // var dateFormatRegexp = isTouch ? 'yyyy/mm/dd' : regexpForDateFormat(attrs.dateFormat || 'mm/dd/yyyy'/*, {mask: !!attrs.uiMask}*/);
+
+ // // Handle date validity according to dateFormat
+ // if(controller) {
+ // controller.$parsers.unshift(function(viewValue) {
+ // //console.warn('viewValue', viewValue, dateFormatRegexp, dateFormatRegexp.test(viewValue));
+ // if (!viewValue || dateFormatRegexp.test(viewValue)) {
+ // controller.$setValidity('date', true);
+ // return viewValue;
+ // } else {
+ // controller.$setValidity('date', false);
+ // return undefined;
+ // }
+ // });
+ // }
+
+ // // Support add-on
+ // var component = element.next('[data-toggle="datepicker"]');
+ // if(component.length) {
+ // component.on('click', function() { isTouch ? element.trigger('focus') : element.datepicker('show'); });
+ // }
+
+ // // Use native interface for touch devices
+ // if(isTouch && element.prop('type') === 'text') {
+
+ // element.prop('type', 'date');
+ // element.on('change', function(ev) {
+ // scope.$apply(function () {
+ // controller.$setViewValue(element.val());
+ // });
+ // });
+
+ // } else {
+
+ // // If we have a controller (i.e. ngModelController) then wire it up
+ // if(controller) {
+ // element.on('changeDate', function(ev) {
+ // scope.$apply(function () {
+ // controller.$setViewValue(element.val());
+ // });
+ // });
+ // }
+
+ // // Popover GarbageCollection
+ // var $popover = element.closest('.popover');
+ // if($popover) {
+ // $popover.on('hide', function(e) {
+ // var datepicker = element.data('datepicker');
+ // if(datepicker) {
+ // datepicker.picker.remove();
+ // element.data('datepicker', null);
+ // }
+ // });
+ // }
+
+ // Create daterangepicker
+ element.attr('data-toggle', 'daterangepicker');
+ element.daterangepicker({
+ // autoclose: true,
+ // forceParse: attrs.forceParse || false,
+ // language: attrs.language || 'en'
+ });
+
+ // }
+
}
+
};
- var asyncLinkSubmenu = function() {
- var args = slice.call(arguments);
- setTimeout(function() {
- linkSubmenu.apply(null, args);
+}]);
+
+
+angular.module('$strap.directives')
+
+.directive('bsDropdown', ['$parse', '$compile', '$timeout', function($parse, $compile, $timeout) {
+ 'use strict';
+
+ var buildTemplate = function(items, ul) {
+ if(!ul) ul = ['<ul class="dropdown-menu" role="menu" aria-labelledby="drop1">', '</ul>'];
+ angular.forEach(items, function(item, index) {
+ if(item.divider) return ul.splice(index + 1, 0, '<li class="divider"></li>');
+ var li = '<li' + (item.submenu && item.submenu.length ? ' class="dropdown-submenu"' : '') + '>' +
+ '<a tabindex="-1" ng-href="' + (item.href || '') + '"' + (item.click ? '" ng-click="' + item.click + '"' : '') + (item.target ? '" target="' + item.target + '"' : '') + '>' +
+ (item.text || '') + '</a>';
+ if(item.submenu && item.submenu.length) li += buildTemplate(item.submenu).join("\n");
+ li += '</li>';
+ ul.splice(index + 1, 0, li);
});
+ return ul;
};
return {
restrict: 'EA',
scope: true,
- link: function postLink(scope, element, attr) {
+ link: function postLink(scope, iElement, iAttrs) {
+
+ var getter = $parse(iAttrs.bsDropdown),
+ items = getter(scope);
- var getter = $parse(attr.bsDropdown);
+ // Defer after any ngRepeat rendering
+ $timeout(function() {
- scope.items = getter(scope);
- var dropdown = $compile(template)(scope);
- asyncLinkSubmenu(scope.items, dropdown, scope);
- dropdown.insertAfter(element);
+ if(!angular.isArray(items)) {
+ // @todo?
+ }
- element
+ var dropdown = angular.element(buildTemplate(items).join(''));
+ dropdown.insertAfter(iElement);
+
+ // Compile dropdown-menu
+ $compile(iElement.next('ul.dropdown-menu'))(scope);
+
+ });
+
+ iElement
.addClass('dropdown-toggle')
.attr('data-toggle', "dropdown");
@@ -558,6 +677,22 @@ angular.module('$strap.directives')
};
scope.dismiss = scope.hide;
+ $modal.on("show", function(event) {
+ scope.$emit("modal-show", event);
+ });
+
+ $modal.on("shown", function(event) {
+ scope.$emit("modal-shown", event);
+ });
+
+ $modal.on("hide", function(event) {
+ scope.$emit("modal-hide", event);
+ });
+
+ $modal.on("hidden", function(event) {
+ scope.$emit("modal-hidden", event);
+ });
+
});
}
};
@@ -701,30 +836,91 @@ angular.module('$strap.directives')
angular.module('$strap.directives')
-.directive('bsTabs', ['$parse', '$compile', function($parse, $compile) {
+.directive('bsTabs', ['$parse', '$compile', '$timeout', function($parse, $compile, $timeout) {
'use strict';
return {
restrict: 'A',
+ require: '?ngModel',
+ scope: true,
link: function postLink(scope, iElement, iAttrs, controller) {
+ var getter = $parse(iAttrs.bsTabs),
+ setter = getter.assign,
+ value = getter(scope);
+
var tabs = ['<ul class="nav nav-tabs">', '</ul>'];
var panes = ['<div class="tab-content">', '</div>'];
- iElement.find('[data-tab]').each(function(index) {
- var $this = angular.element(this),
- id = 'tab-' + scope.$id + '-' + index,
- active = $this.hasClass('active'),
- fade = $this.hasClass('fade'),
- title = scope.$eval($this.data('tab'));
- tabs.splice(index + 1, 0, '<li' + (active ? ' class="active"' : '') + '><a href="#' + id + '" data-toggle="tab">' + title + '</a></li>');
- panes.splice(index + 1, 0, '<div class="tab-pane ' + $this.attr('class') + (fade && active ? ' in' : '') + '" id="' + id + '">' + this.innerHTML + '</div>');
+ iElement.hide();
+ var activeTab = 0;
+
+ // Defer after any ngRepeat rendering
+ $timeout(function() {
+
+ if(!angular.isArray(value)) {
+
+ value = [];
+ // Convert existing dom elements
+ iElement.children('[data-title], [data-tab]').each(function(index) {
+ var $this = angular.element(this);
+ value.push({
+ title: scope.$eval($this.data('title') || $this.data('tab')),
+ content: this.innerHTML,
+ active: $this.hasClass('active'),
+ fade: $this.hasClass('fade')
+ });
+ });
+
+ }
+
+ // Select correct starting activeTab
+ angular.forEach(value, function(tab, index) {
+ if(tab.active) {
+ activeTab = index;
+ }
+ });
+
+ // Build from object
+ angular.forEach(value, function(tab, index) {
+ var id = 'tab-' + scope.$id + '-' + index,
+ active = activeTab === index,
+ fade = iAttrs.fade || tab.fade;
+ tabs.splice(index + 1, 0, '<li' + (active ? ' class="active"' : '') + '><a href="#' + id + '" data-index="' + index + '" data-toggle="tab">' + tab.title + '</a></li>');
+ panes.splice(index + 1, 0, '<div class="tab-pane' + (active ? ' active' : '') + (fade ? ' fade' : '') + (fade && active ? ' in' : '') + '" id="' + id + '">' + tab.content + '</div>');
+ });
+
+ iElement.html(tabs.join('') + panes.join('')).show();
+
+ // Compile tab-content
+ $compile(iElement.children('div.tab-content'))(scope);
+
});
- iElement.html(tabs.join('') + panes.join(''));
+ // If we have a controller (i.e. ngModelController) then wire it up
+ if(controller) {
+
+ iElement.on('show', function(ev) {
+ var $target = $(ev.target);
+ scope.$apply(function() {
+ controller.$setViewValue($target.data('index'));
+ });
+ });
+
+ // Watch ngModel for changes
+ scope.$watch(iAttrs.ngModel, function(newValue, oldValue) {
+ if(angular.isUndefined(newValue)) { return; }
+ activeTab = newValue; // update starting activeTab before first build
+ setTimeout(function() {
+ var $next = iElement.children('ul.nav-tabs').find('li:eq(' + newValue*1 + ')');
+ if(!$next.hasClass('active')) {
+ $next.children('a').tab('show');
+ }
+ });
+ });
+
+ }
- // Compile tab-content
- $compile(iElement.children('div.tab-content'))(scope);
}
};
@@ -732,9 +928,6 @@ angular.module('$strap.directives')
}]);
-// https://github.com/jdewit/bootstrap-timepicker
-// https://github.com/kla/bootstrap-timepicker
-
angular.module('$strap.directives')
.directive('bsTimepicker', ['$timeout', function($timeout) {
@@ -749,8 +942,8 @@ angular.module('$strap.directives')
// If we have a controller (i.e. ngModelController) then wire it up
if(controller) {
- element.on('change', function(ev) {
- scope.$apply(function () {
+ element.on('changeTime.timepicker', function(ev) {
+ $timeout(function() {
controller.$setViewValue(element.val());
});
});
@@ -759,38 +952,19 @@ angular.module('$strap.directives')
// Handle input time validity
var timeRegExp = new RegExp('^' + TIME_REGEXP + '$', ['i']);
controller.$parsers.unshift(function(viewValue) {
- //console.warn('viewValue', viewValue, timeRegExp, timeRegExp.test(viewValue));
+ // console.warn('viewValue', viewValue, timeRegExp, timeRegExp.test(viewValue));
if (!viewValue || timeRegExp.test(viewValue)) {
controller.$setValidity('time', true);
return viewValue;
} else {
controller.$setValidity('time', false);
- return undefined;
+ return;
}
});
- // Support add-on
- // var component = element.siblings('[data-toggle="timepicker"]');
- // if(component.length) {
- // component.on('click', function() {
- // var $widget = element.data('timepicker').$widget;
- // });
- // }
-
- // Popover GarbageCollection
- var $popover = element.closest('.popover');
- if($popover) {
- $popover.on('hide', function(e) {
- var timepicker = element.data('timepicker');
- if(timepicker) {
- timepicker.$widget.remove();
- element.data('timepicker', null);
- }
- });
- }
-
// Create datepicker
element.attr('data-toggle', 'timepicker');
+ element.parent().addClass('bootstrap-timepicker');
//$timeout(function () {
element.timepicker();
//});
@@ -844,24 +1018,11 @@ angular.module('$strap.directives')
// Bootstrap override to provide events & tip() reference
var tooltip = element.data('tooltip');
tooltip.show = function() {
- var e = $.Event('show');
- this.$element.trigger(e);
- if (e.isDefaultPrevented()) {
- return;
- }
var r = $.fn.tooltip.Constructor.prototype.show.apply(this, arguments);
- // Bind popover to the tip()
+ // Bind tooltip to the tip()
this.tip().data('tooltip', this);
return r;
};
- tooltip.hide = function() {
- var e = $.Event('hide');
- this.$element.trigger(e);
- if (e.isDefaultPrevented()) {
- return;
- }
- return $.fn.tooltip.Constructor.prototype.hide.apply(this, arguments);
- };
//Provide scope display functions
scope._tooltip = function(event) {
View
4 dist/angular-strap.min.js
@@ -1,8 +1,8 @@
/**
* AngularStrap - Twitter Bootstrap directives for AngularJS
- * @version v0.7.0 - 2013-03-11
+ * @version v0.7.1 - 2013-03-21
* @link http://mgcrea.github.com/angular-strap
* @author Olivier Louvignes <olivier@mg-crea.com>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
-angular.module("$strap.config",[]).value("$strap.config",{}),angular.module("$strap.filters",["$strap.config"]),angular.module("$strap.directives",["$strap.config"]),angular.module("$strap",["$strap.filters","$strap.directives","$strap.config"]),angular.module("$strap.directives").directive("bsAlert",["$parse","$timeout","$compile",function(t,e,n){"use strict";return{restrict:"A",link:function(e,i,a){var o=t(a.bsAlert),r=(o.assign,o(e));a.bsAlert?e.$watch(a.bsAlert,function(t,o){r=t,i.html((t.title?"<strong>"+t.title+"</strong>&nbsp;":"")+t.content||""),t.closed&&i.hide(),n(i.contents())(e),(t.type||o.type)&&(o.type&&i.removeClass("alert-"+o.type),t.type&&i.addClass("alert-"+t.type)),(angular.isUndefined(a.closeButton)||"0"!==a.closeButton&&"false"!==a.closeButton)&&i.prepend('<button type="button" class="close" data-dismiss="alert">&times;</button>')},!0):(angular.isUndefined(a.closeButton)||"0"!==a.closeButton&&"false"!==a.closeButton)&&i.prepend('<button type="button" class="close" data-dismiss="alert">&times;</button>'),i.addClass("alert").alert(),i.hasClass("fade")&&(i.removeClass("in"),setTimeout(function(){i.addClass("in")}));var s=a.ngRepeat&&a.ngRepeat.split(" in ").pop();i.on("close",function(t){var n;s?(t.preventDefault(),i.removeClass("in"),n=function(){i.trigger("closed"),e.$parent&&e.$parent.$apply(function(){for(var t=s.split("."),n=e.$parent,i=0;t.length>i;++i)n&&(n=n[t[i]]);n&&n.splice(e.$index,1)})},$.support.transition&&i.hasClass("fade")?i.on($.support.transition.end,n):n()):r&&(t.preventDefault(),i.removeClass("in"),n=function(){i.trigger("closed"),e.$apply(function(){r.closed=!0})},$.support.transition&&i.hasClass("fade")?i.on($.support.transition.end,n):n())})}}}]),angular.module("$strap.directives").directive("bsButton",["$parse","$timeout",function(t){"use strict";return{restrict:"A",require:"?ngModel",link:function(e,n,i,a){if(a){n.parent('[data-toggle="buttons-checkbox"], [data-toggle="buttons-radio"]').length||n.attr("data-toggle","button");var o=!!e.$eval(i.ngModel);o&&n.addClass("active"),e.$watch(i.ngModel,function(t,e){var i=!!t,a=!!e;i!==a?$.fn.button.Constructor.prototype.toggle.call(r):i&&!o&&n.addClass("active")})}n.hasClass("btn")||n.on("click.button.data-api",function(){n.button("toggle")}),n.button();var r=n.data("button");r.toggle=function(){if(!a)return $.fn.button.Constructor.prototype.toggle.call(this);var i=n.parent('[data-toggle="buttons-radio"]');i.length?(n.siblings("[ng-model]").each(function(n,i){t($(i).attr("ng-model")).assign(e,!1)}),e.$digest(),a.$modelValue||(a.$setViewValue(!a.$modelValue),e.$digest())):e.$apply(function(){a.$setViewValue(!a.$modelValue)})}}}}]).directive("bsButtonsCheckbox",["$parse",function(){"use strict";return{restrict:"A",require:"?ngModel",compile:function(t){t.attr("data-toggle","buttons-checkbox").find("a, button").each(function(t,e){$(e).attr("bs-button","")})}}}]).directive("bsButtonsRadio",["$parse",function(){"use strict";return{restrict:"A",require:"?ngModel",compile:function(t,e){return t.attr("data-toggle","buttons-radio"),e.ngModel||t.find("a, button").each(function(t,e){$(e).attr("bs-button","")}),function(t,e,n,i){i&&(e.find("[value]").button().filter('[value="'+t.$eval(n.ngModel)+'"]').addClass("active"),e.on("click.button.data-api",function(e){t.$apply(function(){i.$setViewValue($(e.target).closest("button").attr("value"))})}),t.$watch(n.ngModel,function(i,a){if(i!==a){var o=e.find('[value="'+t.$eval(n.ngModel)+'"]');o.length&&$.fn.button.Constructor.prototype.toggle.call(o.data("button"))}}))}}}}]),angular.module("$strap.directives").directive("bsButtonSelect",["$parse","$timeout",function(t){"use strict";return{restrict:"A",require:"?ngModel",link:function(e,n,i,a){var o=t(i.bsButtonSelect);o.assign,a&&(n.text(e.$eval(i.ngModel)),e.$watch(i.ngModel,function(t){n.text(t)}));var r,s,l,u;n.bind("click",function(){r=o(e),s=a?e.$eval(i.ngModel):n.text(),l=r.indexOf(s),u=l>r.length-2?r[0]:r[l+1],console.warn(r,u),e.$apply(function(){n.text(u),a&&a.$setViewValue(u)})})}}}]),angular.module("$strap.directives").directive("bsDatepicker",["$timeout",function(){"use strict";var t="ontouchstart"in window&&!window.navigator.userAgent.match(/PhantomJS/i),e={"/":"[\\/]","-":"[-]",".":"[.]",dd:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",d:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",mm:"(?:[0]?[1-9]|[1][012])",m:"(?:[0]?[1-9]|[1][012])",yyyy:"(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])",yy:"(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])"};return{restrict:"A",require:"?ngModel",link:function(n,i,a,o){var r=function(t,n){n||(n={});var i=t,a=e;return angular.forEach(a,function(t,e){i=i.split(e).join(t)}),RegExp("^"+i+"$",["i"])},s=t?"yyyy/mm/dd":r(a.dateFormat||"mm/dd/yyyy");o&&o.$parsers.unshift(function(t){return!t||s.test(t)?(o.$setValidity("date",!0),t):(o.$setValidity("date",!1),void 0)});var l=i.next('[data-toggle="datepicker"]');if(l.length&&l.on("click",function(){t?i.trigger("focus"):i.datepicker("show")}),t&&"text"===i.prop("type"))i.prop("type","date"),i.on("change",function(){n.$apply(function(){o.$setViewValue(i.val())})});else{o&&i.on("changeDate",function(){n.$apply(function(){o.$setViewValue(i.val())})});var u=i.closest(".popover");u&&u.on("hide",function(){var t=i.data("datepicker");t&&(t.picker.remove(),i.data("datepicker",null))}),i.attr("data-toggle","datepicker"),i.datepicker({autoclose:!0,forceParse:a.forceParse||!1,language:a.language||"en"})}}}}]),angular.module("$strap.directives").directive("bsDropdown",["$parse","$compile",function(t,e){"use strict";var n=Array.prototype.slice,i='<ul class="dropdown-menu" role="menu" aria-labelledby="drop1"><li ng-repeat="item in items" ng-class="{divider: !!item.divider, \'dropdown-submenu\': !!item.submenu && item.submenu.length}"><a ng-hide="!!item.divider" tabindex="-1" ng-href="{{item.href}}" ng-click="{{item.click}}" target="{{item.target}}" ng-bind-html-unsafe="item.text"></a></li></ul>',a=function(t,n,a){for(var r,s,l,u=0,c=t.length;c>u;u++)(r=t[u].submenu)&&(l=a.$new(),l.items=r,s=e(i)(l),s=s.appendTo(n.children("li:nth-child("+(u+1)+")")),o(r,s,l))},o=function(){var t=n.call(arguments);setTimeout(function(){a.apply(null,t)})};return{restrict:"EA",scope:!0,link:function(n,a,r){var s=t(r.bsDropdown);n.items=s(n);var l=e(i)(n);o(n.items,l,n),l.insertAfter(a),a.addClass("dropdown-toggle").attr("data-toggle","dropdown")}}}]),angular.module("$strap.directives").directive("bsModal",["$parse","$compile","$http","$timeout","$q","$templateCache",function(t,e,n,i,a,o){"use strict";return{restrict:"A",scope:!0,link:function(r,s,l){var u=t(l.bsModal),c=(u.assign,u(r));a.when(o.get(c)||n.get(c,{cache:!0})).then(function(t){angular.isObject(t)&&(t=t.data);var n=u(r).replace(".html","").replace(/[\/|\.|:]/g,"-")+"-"+r.$id,a=$('<div class="modal hide" tabindex="-1"></div>').attr("id",n).attr("data-backdrop",l.backdrop||!0).attr("data-keyboard",l.keyboard||!0).addClass(l.modalClass?"fade "+l.modalClass:"fade").html(t);$("body").append(a),s.attr("href","#"+n).attr("data-toggle","modal"),i(function(){e(a)(r)}),r._modal=function(t){a.modal(t)},r.hide=function(){a.modal("hide")},r.show=function(){a.modal("show")},r.dismiss=r.hide})}}}]),angular.module("$strap.directives").directive("bsNavbar",["$location",function(t){"use strict";return{restrict:"A",link:function(e,n){e.$watch(function(){return t.path()},function(t){n.find("li[data-match-route]").each(function(e,n){var i=angular.element(n),a=i.attr("data-match-route"),o=RegExp("^"+a+"$",["i"]);o.test(t)?i.addClass("active"):i.removeClass("active")})})}}}]),angular.module("$strap.directives").directive("bsPopover",["$parse","$compile","$http","$timeout","$q","$templateCache",function(t,e,n,i,a,o){"use strict";return $("body").on("keyup",function(t){27===t.keyCode&&$(".popover.in").each(function(){$(this).popover("hide")})}),{restrict:"A",scope:!0,link:function(i,r,s){var l=t(s.bsPopover),u=(l.assign,l(i)),c={};angular.isObject(u)&&(c=u),a.when(c.content||o.get(u)||n.get(u,{cache:!0})).then(function(t){angular.isObject(t)&&(t=t.data),s.unique&&r.on("show",function(){$(".popover.in").each(function(){var t=$(this),e=t.data("popover");e&&!e.$element.is(r)&&t.popover("hide")})}),s.hide&&i.$watch(s.hide,function(t,e){t?n.hide():t!==e&&n.show()}),r.popover(angular.extend({},c,{content:t,html:!0}));var n=r.data("popover");n.hasContent=function(){return this.getTitle()||t},n.getPosition=function(){var t=$.fn.popover.Constructor.prototype.getPosition.apply(this,arguments);return e(this.$tip)(i),i.$digest(),this.$tip.data("popover",this),t},i._popover=function(t){r.popover(t)},i.hide=function(){r.popover("hide")},i.show=function(){r.popover("show")},i.dismiss=i.hide})}}}]),angular.module("$strap.directives").directive("bsTabs",["$parse","$compile",function(t,e){"use strict";return{restrict:"A",link:function(t,n){var i=['<ul class="nav nav-tabs">',"</ul>"],a=['<div class="tab-content">',"</div>"];n.find("[data-tab]").each(function(e){var n=angular.element(this),o="tab-"+t.$id+"-"+e,r=n.hasClass("active"),s=n.hasClass("fade"),l=t.$eval(n.data("tab"));i.splice(e+1,0,"<li"+(r?' class="active"':"")+'><a href="#'+o+'" data-toggle="tab">'+l+"</a></li>"),a.splice(e+1,0,'<div class="tab-pane '+n.attr("class")+(s&&r?" in":"")+'" id="'+o+'">'+this.innerHTML+"</div>")}),n.html(i.join("")+a.join("")),e(n.children("div.tab-content"))(t)}}}]),angular.module("$strap.directives").directive("bsTimepicker",["$timeout",function(){"use strict";var t="((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5][0-9])(?::[0-5][0-9])?(?:\\s?(?:am|AM|pm|PM))?)";return{restrict:"A",require:"?ngModel",link:function(e,n,i,a){a&&n.on("change",function(){e.$apply(function(){a.$setViewValue(n.val())})});var o=RegExp("^"+t+"$",["i"]);a.$parsers.unshift(function(t){return!t||o.test(t)?(a.$setValidity("time",!0),t):(a.$setValidity("time",!1),void 0)});var r=n.closest(".popover");r&&r.on("hide",function(){var t=n.data("timepicker");t&&(t.$widget.remove(),n.data("timepicker",null))}),n.attr("data-toggle","timepicker"),n.timepicker()}}}]),angular.module("$strap.directives").directive("bsTooltip",["$parse","$compile",function(t){"use strict";return{restrict:"A",scope:!0,link:function(e,n,i){var a=t(i.bsTooltip),o=(a.assign,a(e));e.$watch(i.bsTooltip,function(t,e){t!==e&&(o=t)}),i.unique&&n.on("show",function(){$(".tooltip.in").each(function(){var t=$(this),e=t.data("tooltip");e&&!e.$element.is(n)&&t.tooltip("hide")})}),n.tooltip({title:function(){return angular.isFunction(o)?o.apply(null,arguments):o},html:!0});var r=n.data("tooltip");r.show=function(){var t=$.Event("show");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=$.fn.tooltip.Constructor.prototype.show.apply(this,arguments);return this.tip().data("tooltip",this),e}},r.hide=function(){var t=$.Event("hide");return this.$element.trigger(t),t.isDefaultPrevented()?void 0:$.fn.tooltip.Constructor.prototype.hide.apply(this,arguments)},e._tooltip=function(t){n.tooltip(t)},e.hide=function(){n.tooltip("hide")},e.show=function(){n.tooltip("show")},e.dismiss=e.hide}}}]),angular.module("$strap.directives").directive("bsTypeahead",["$parse",function(t){"use strict";return{restrict:"A",require:"?ngModel",link:function(e,n,i,a){var o=t(i.bsTypeahead),r=(o.assign,o(e));e.$watch(i.bsTypeahead,function(t,e){t!==e&&(r=t)}),n.attr("data-provide","typeahead"),n.typeahead({source:function(){return angular.isFunction(r)?r.apply(null,arguments):r},minLength:i.minLength||1,items:i.items,updater:function(t){return a&&e.$apply(function(){a.$setViewValue(t)}),t}});var s=n.data("typeahead");s.lookup=function(){var t;return this.query=this.$element.val()||"",this.query.length<this.options.minLength?this.shown?this.hide():this:(t=$.isFunction(this.source)?this.source(this.query,$.proxy(this.process,this)):this.source,t?this.process(t):this)},"0"===i.minLength&&setTimeout(function(){n.on("focus",function(){0===n.val().length&&setTimeout(n.typeahead.bind(n,"lookup"),200)})})}}}]);
+angular.module("$strap.config",[]).value("$strap.config",{}),angular.module("$strap.filters",["$strap.config"]),angular.module("$strap.directives",["$strap.config"]),angular.module("$strap",["$strap.filters","$strap.directives","$strap.config"]),angular.module("$strap.directives").directive("bsAlert",["$parse","$timeout","$compile",function(t,e,n){"use strict";return{restrict:"A",link:function(e,a,i){var o=t(i.bsAlert),r=(o.assign,o(e));i.bsAlert?e.$watch(i.bsAlert,function(t,o){r=t,a.html((t.title?"<strong>"+t.title+"</strong>&nbsp;":"")+t.content||""),t.closed&&a.hide(),n(a.contents())(e),(t.type||o.type)&&(o.type&&a.removeClass("alert-"+o.type),t.type&&a.addClass("alert-"+t.type)),(angular.isUndefined(i.closeButton)||"0"!==i.closeButton&&"false"!==i.closeButton)&&a.prepend('<button type="button" class="close" data-dismiss="alert">&times;</button>')},!0):(angular.isUndefined(i.closeButton)||"0"!==i.closeButton&&"false"!==i.closeButton)&&a.prepend('<button type="button" class="close" data-dismiss="alert">&times;</button>'),a.addClass("alert").alert(),a.hasClass("fade")&&(a.removeClass("in"),setTimeout(function(){a.addClass("in")}));var s=i.ngRepeat&&i.ngRepeat.split(" in ").pop();a.on("close",function(t){var n;s?(t.preventDefault(),a.removeClass("in"),n=function(){a.trigger("closed"),e.$parent&&e.$parent.$apply(function(){for(var t=s.split("."),n=e.$parent,a=0;t.length>a;++a)n&&(n=n[t[a]]);n&&n.splice(e.$index,1)})},$.support.transition&&a.hasClass("fade")?a.on($.support.transition.end,n):n()):r&&(t.preventDefault(),a.removeClass("in"),n=function(){a.trigger("closed"),e.$apply(function(){r.closed=!0})},$.support.transition&&a.hasClass("fade")?a.on($.support.transition.end,n):n())})}}}]),angular.module("$strap.directives").directive("bsButton",["$parse","$timeout",function(t){"use strict";return{restrict:"A",require:"?ngModel",link:function(e,n,a,i){if(i){n.parent('[data-toggle="buttons-checkbox"], [data-toggle="buttons-radio"]').length||n.attr("data-toggle","button");var o=!!e.$eval(a.ngModel);o&&n.addClass("active"),e.$watch(a.ngModel,function(t,e){var a=!!t,i=!!e;a!==i?$.fn.button.Constructor.prototype.toggle.call(r):a&&!o&&n.addClass("active")})}n.hasClass("btn")||n.on("click.button.data-api",function(){n.button("toggle")}),n.button();var r=n.data("button");r.toggle=function(){if(!i)return $.fn.button.Constructor.prototype.toggle.call(this);var a=n.parent('[data-toggle="buttons-radio"]');a.length?(n.siblings("[ng-model]").each(function(n,a){t($(a).attr("ng-model")).assign(e,!1)}),e.$digest(),i.$modelValue||(i.$setViewValue(!i.$modelValue),e.$digest())):e.$apply(function(){i.$setViewValue(!i.$modelValue)})}}}}]).directive("bsButtonsCheckbox",["$parse",function(){"use strict";return{restrict:"A",require:"?ngModel",compile:function(t){t.attr("data-toggle","buttons-checkbox").find("a, button").each(function(t,e){$(e).attr("bs-button","")})}}}]).directive("bsButtonsRadio",["$parse",function(){"use strict";return{restrict:"A",require:"?ngModel",compile:function(t,e){return t.attr("data-toggle","buttons-radio"),e.ngModel||t.find("a, button").each(function(t,e){$(e).attr("bs-button","")}),function(t,e,n,a){a&&(e.find("[value]").button().filter('[value="'+t.$eval(n.ngModel)+'"]').addClass("active"),e.on("click.button.data-api",function(e){t.$apply(function(){a.$setViewValue($(e.target).closest("button").attr("value"))})}),t.$watch(n.ngModel,function(a,i){if(a!==i){var o=e.find('[value="'+t.$eval(n.ngModel)+'"]');o.length&&$.fn.button.Constructor.prototype.toggle.call(o.data("button"))}}))}}}}]),angular.module("$strap.directives").directive("bsButtonSelect",["$parse","$timeout",function(t){"use strict";return{restrict:"A",require:"?ngModel",link:function(e,n,a,i){var o=t(a.bsButtonSelect);o.assign,i&&(n.text(e.$eval(a.ngModel)),e.$watch(a.ngModel,function(t){n.text(t)}));var r,s,u,c;n.bind("click",function(){r=o(e),s=i?e.$eval(a.ngModel):n.text(),u=r.indexOf(s),c=u>r.length-2?r[0]:r[u+1],console.warn(r,c),e.$apply(function(){n.text(c),i&&i.$setViewValue(c)})})}}}]),angular.module("$strap.directives").directive("bsDatepicker",["$timeout","$strap.config",function(t,e){"use strict";var n="ontouchstart"in window&&!window.navigator.userAgent.match(/PhantomJS/i),a=function a(t){return t=t||"en",{"/":"[\\/]","-":"[-]",".":"[.]"," ":"[\\s]",dd:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",d:"(?:(?:[0-2]?[0-9]{1})|(?:[3][01]{1}))",mm:"(?:[0]?[1-9]|[1][012])",m:"(?:[0]?[1-9]|[1][012])",DD:"(?:"+$.fn.datepicker.dates[t].days.join("|")+")",D:"(?:"+$.fn.datepicker.dates[t].daysShort.join("|")+")",MM:"(?:"+$.fn.datepicker.dates[t].months.join("|")+")",M:"(?:"+$.fn.datepicker.dates[t].monthsShort.join("|")+")",yyyy:"(?:(?:[1]{1}[0-9]{1}[0-9]{1}[0-9]{1})|(?:[2]{1}[0-9]{3}))(?![[0-9]])",yy:"(?:(?:[0-9]{1}[0-9]{1}))(?![[0-9]])"}},i=function i(t,e){var n,i=t,o=a(e);return n=0,angular.forEach(o,function(t,e){i=i.split(e).join("${"+n+"}"),n++}),n=0,angular.forEach(o,function(t){i=i.split("${"+n+"}").join(t),n++}),RegExp("^"+i+"$",["i"])};return{restrict:"A",require:"?ngModel",link:function(t,a,o,r){var s=e.datepicker||{},u=o.language||s.language||"en",c=o.dateFormat||s.format||$.fn.datepicker.dates[u]&&$.fn.datepicker.dates[u].format||"mm/dd/yyyy",l=n?"yyyy/mm/dd":i(c,u);if(r&&r.$parsers.unshift(function(t){return!t||l.test(t)?(r.$setValidity("date",!0),t):(r.$setValidity("date",!1),void 0)}),n&&"text"===a.prop("type"))a.prop("type","date"),a.on("change",function(){t.$apply(function(){r.$setViewValue(a.val())})});else{r&&a.on("changeDate",function(){t.$apply(function(){r.$setViewValue(a.val())})});var d=a.closest(".popover");d&&d.on("hide",function(){var t=a.data("datepicker");t&&(t.picker.remove(),a.data("datepicker",null))}),a.attr("data-toggle","datepicker"),a.datepicker({autoclose:!0,format:c,language:u,forceParse:o.forceParse||!1})}var p=a.siblings('[data-toggle="datepicker"]');p.length&&p.on("click",function(){a.trigger("focus")})}}}]),angular.module("$strap.directives").directive("bsDaterangepicker",["$timeout",function(){"use strict";return"ontouchstart"in window&&!window.navigator.userAgent.match(/PhantomJS/i),{restrict:"A",require:"?ngModel",link:function(t,e){console.log("postLink",this,arguments),window.element=e,e.attr("data-toggle","daterangepicker"),e.daterangepicker({})}}}]),angular.module("$strap.directives").directive("bsDropdown",["$parse","$compile","$timeout",function(t,e,n){"use strict";var a=function(t,e){return e||(e=['<ul class="dropdown-menu" role="menu" aria-labelledby="drop1">',"</ul>"]),angular.forEach(t,function(t,n){if(t.divider)return e.splice(n+1,0,'<li class="divider"></li>');var i="<li"+(t.submenu&&t.submenu.length?' class="dropdown-submenu"':"")+">"+'<a tabindex="-1" ng-href="'+(t.href||"")+'"'+(t.click?'" ng-click="'+t.click+'"':"")+(t.target?'" target="'+t.target+'"':"")+">"+(t.text||"")+"</a>";t.submenu&&t.submenu.length&&(i+=a(t.submenu).join("\n")),i+="</li>",e.splice(n+1,0,i)}),e};return{restrict:"EA",scope:!0,link:function(i,o,r){var s=t(r.bsDropdown),u=s(i);n(function(){!angular.isArray(u);var t=angular.element(a(u).join(""));t.insertAfter(o),e(o.next("ul.dropdown-menu"))(i)}),o.addClass("dropdown-toggle").attr("data-toggle","dropdown")}}}]),angular.module("$strap.directives").directive("bsModal",["$parse","$compile","$http","$timeout","$q","$templateCache",function(t,e,n,a,i,o){"use strict";return{restrict:"A",scope:!0,link:function(r,s,u){var c=t(u.bsModal),l=(c.assign,c(r));i.when(o.get(l)||n.get(l,{cache:!0})).then(function(t){angular.isObject(t)&&(t=t.data);var n=c(r).replace(".html","").replace(/[\/|\.|:]/g,"-")+"-"+r.$id,i=$('<div class="modal hide" tabindex="-1"></div>').attr("id",n).attr("data-backdrop",u.backdrop||!0).attr("data-keyboard",u.keyboard||!0).addClass(u.modalClass?"fade "+u.modalClass:"fade").html(t);$("body").append(i),s.attr("href","#"+n).attr("data-toggle","modal"),a(function(){e(i)(r)}),r._modal=function(t){i.modal(t)},r.hide=function(){i.modal("hide")},r.show=function(){i.modal("show")},r.dismiss=r.hide,i.on("show",function(t){r.$emit("modal-show",t)}),i.on("shown",function(t){r.$emit("modal-shown",t)}),i.on("hide",function(t){r.$emit("modal-hide",t)}),i.on("hidden",function(t){r.$emit("modal-hidden",t)})})}}}]),angular.module("$strap.directives").directive("bsNavbar",["$location",function(t){"use strict";return{restrict:"A",link:function(e,n){e.$watch(function(){return t.path()},function(t){n.find("li[data-match-route]").each(function(e,n){var a=angular.element(n),i=a.attr("data-match-route"),o=RegExp("^"+i+"$",["i"]);o.test(t)?a.addClass("active"):a.removeClass("active")})})}}}]),angular.module("$strap.directives").directive("bsPopover",["$parse","$compile","$http","$timeout","$q","$templateCache",function(t,e,n,a,i,o){"use strict";return $("body").on("keyup",function(t){27===t.keyCode&&$(".popover.in").each(function(){$(this).popover("hide")})}),{restrict:"A",scope:!0,link:function(a,r,s){var u=t(s.bsPopover),c=(u.assign,u(a)),l={};angular.isObject(c)&&(l=c),i.when(l.content||o.get(c)||n.get(c,{cache:!0})).then(function(t){angular.isObject(t)&&(t=t.data),s.unique&&r.on("show",function(){$(".popover.in").each(function(){var t=$(this),e=t.data("popover");e&&!e.$element.is(r)&&t.popover("hide")})}),s.hide&&a.$watch(s.hide,function(t,e){t?n.hide():t!==e&&n.show()}),r.popover(angular.extend({},l,{content:t,html:!0}));var n=r.data("popover");n.hasContent=function(){return this.getTitle()||t},n.getPosition=function(){var t=$.fn.popover.Constructor.prototype.getPosition.apply(this,arguments);return e(this.$tip)(a),a.$digest(),this.$tip.data("popover",this),t},a._popover=function(t){r.popover(t)},a.hide=function(){r.popover("hide")},a.show=function(){r.popover("show")},a.dismiss=a.hide})}}}]),angular.module("$strap.directives").directive("bsTabs",["$parse","$compile","$timeout",function(t,e,n){"use strict";return{restrict:"A",require:"?ngModel",scope:!0,link:function(a,i,o,r){var s=t(o.bsTabs),u=(s.assign,s(a)),c=['<ul class="nav nav-tabs">',"</ul>"],l=['<div class="tab-content">',"</div>"];i.hide();var d=0;n(function(){angular.isArray(u)||(u=[],i.children("[data-title], [data-tab]").each(function(){var t=angular.element(this);u.push({title:a.$eval(t.data("title")||t.data("tab")),content:this.innerHTML,active:t.hasClass("active"),fade:t.hasClass("fade")})})),angular.forEach(u,function(t,e){t.active&&(d=e)}),angular.forEach(u,function(t,e){var n="tab-"+a.$id+"-"+e,i=d===e,r=o.fade||t.fade;c.splice(e+1,0,"<li"+(i?' class="active"':"")+'><a href="#'+n+'" data-index="'+e+'" data-toggle="tab">'+t.title+"</a></li>"),l.splice(e+1,0,'<div class="tab-pane'+(i?" active":"")+(r?" fade":"")+(r&&i?" in":"")+'" id="'+n+'">'+t.content+"</div>")}),i.html(c.join("")+l.join("")).show(),e(i.children("div.tab-content"))(a)}),r&&(i.on("show",function(t){var e=$(t.target);a.$apply(function(){r.$setViewValue(e.data("index"))})}),a.$watch(o.ngModel,function(t){angular.isUndefined(t)||(d=t,setTimeout(function(){var e=i.children("ul.nav-tabs").find("li:eq("+1*t+")");e.hasClass("active")||e.children("a").tab("show")}))}))}}}]),angular.module("$strap.directives").directive("bsTimepicker",["$timeout",function(t){"use strict";var e="((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5][0-9])(?::[0-5][0-9])?(?:\\s?(?:am|AM|pm|PM))?)";return{restrict:"A",require:"?ngModel",link:function(n,a,i,o){o&&a.on("changeTime.timepicker",function(){t(function(){o.$setViewValue(a.val())})});var r=RegExp("^"+e+"$",["i"]);o.$parsers.unshift(function(t){return!t||r.test(t)?(o.$setValidity("time",!0),t):(o.$setValidity("time",!1),void 0)}),a.attr("data-toggle","timepicker"),a.parent().addClass("bootstrap-timepicker"),a.timepicker()}}}]),angular.module("$strap.directives").directive("bsTooltip",["$parse","$compile",function(t){"use strict";return{restrict:"A",scope:!0,link:function(e,n,a){var i=t(a.bsTooltip),o=(i.assign,i(e));e.$watch(a.bsTooltip,function(t,e){t!==e&&(o=t)}),a.unique&&n.on("show",function(){$(".tooltip.in").each(function(){var t=$(this),e=t.data("tooltip");e&&!e.$element.is(n)&&t.tooltip("hide")})}),n.tooltip({title:function(){return angular.isFunction(o)?o.apply(null,arguments):o},html:!0});var r=n.data("tooltip");r.show=function(){var t=$.fn.tooltip.Constructor.prototype.show.apply(this,arguments);return this.tip().data("tooltip",this),t},e._tooltip=function(t){n.tooltip(t)},e.hide=function(){n.tooltip("hide")},e.show=function(){n.tooltip("show")},e.dismiss=e.hide}}}]),angular.module("$strap.directives").directive("bsTypeahead",["$parse",function(t){"use strict";return{restrict:"A",require:"?ngModel",link:function(e,n,a,i){var o=t(a.bsTypeahead),r=(o.assign,o(e));e.$watch(a.bsTypeahead,function(t,e){t!==e&&(r=t)}),n.attr("data-provide","typeahead"),n.typeahead({source:function(){return angular.isFunction(r)?r.apply(null,arguments):r},minLength:a.minLength||1,items:a.items,updater:function(t){return i&&e.$apply(function(){i.$setViewValue(t)}),t}});var s=n.data("typeahead");s.lookup=function(){var t;return this.query=this.$element.val()||"",this.query.length<this.options.minLength?this.shown?this.hide():this:(t=$.isFunction(this.source)?this.source(this.query,$.proxy(this.process,this)):this.source,t?this.process(t):this)},"0"===a.minLength&&setTimeout(function(){n.on("focus",function(){0===n.val().length&&setTimeout(n.typeahead.bind(n,"lookup"),200)})})}}}]);
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "angular-strap",
"description": "AngularStrap - Twitter Bootstrap directives for AngularJS",
- "version": "0.7.0",
+ "version": "0.7.1",
"homepage": "http://mgcrea.github.com/angular-strap",
"author": "Olivier Louvignes <olivier@mg-crea.com>",
"repository": {

0 comments on commit dc160cc

Please sign in to comment.
Something went wrong with that request. Please try again.