rails-angular-strap 2.1.6 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -10
- data/lib/rails-angular-strap/version.rb +1 -1
- data/vendor/assets/javascripts/angular-strap.js +1 -1
- data/vendor/assets/javascripts/angular-strap.min.js +1 -1
- data/vendor/assets/javascripts/angular-strap/angular-strap.js +1405 -1104
- data/vendor/assets/javascripts/angular-strap/angular-strap.min.js +4 -5
- data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.js +15 -15
- data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.min.js +2 -2
- metadata +2 -192
- data/vendor/assets/javascripts/angular-strap-unstable.js +0 -2
- data/vendor/assets/javascripts/angular-strap-unstable.min.js +0 -2
- data/vendor/assets/javascripts/angular-strap/angular-strap.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/affix.js +0 -249
- data/vendor/assets/javascripts/angular-strap/modules/affix.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/affix.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/alert.js +0 -120
- data/vendor/assets/javascripts/angular-strap/modules/alert.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/alert.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/aside.js +0 -96
- data/vendor/assets/javascripts/angular-strap/modules/aside.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/aside.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/button.js +0 -177
- data/vendor/assets/javascripts/angular-strap/modules/button.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/button.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/collapse.js +0 -273
- data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.js +0 -61
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.js +0 -273
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.js +0 -640
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/debounce.js +0 -62
- data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.js +0 -156
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.js +0 -149
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/modal.js +0 -349
- data/vendor/assets/javascripts/angular-strap/modules/modal.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/modal.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/navbar.js +0 -72
- data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.js +0 -76
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/popover.js +0 -112
- data/vendor/assets/javascripts/angular-strap/modules/popover.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/popover.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/raf.js +0 -61
- data/vendor/assets/javascripts/angular-strap/modules/raf.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/raf.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.js +0 -261
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/select.js +0 -325
- data/vendor/assets/javascripts/angular-strap/modules/select.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/select.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/select.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/select.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/tab.js +0 -186
- data/vendor/assets/javascripts/angular-strap/modules/tab.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/tab.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.js +0 -485
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.js +0 -690
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.js +0 -266
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.js +0 -5040
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.min.js +0 -11
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.tpl.js +0 -89
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.js +0 -249
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.js +0 -120
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.js +0 -96
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.js +0 -177
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.js +0 -273
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.js +0 -61
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.js +0 -273
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.js +0 -640
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.js +0 -62
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.js +0 -156
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.js +0 -149
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.js +0 -357
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.js +0 -72
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.js +0 -76
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.js +0 -112
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.js +0 -61
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.js +0 -261
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.js +0 -328
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.js +0 -186
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.js +0 -485
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.js +0 -705
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.js +0 -266
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.tpl.min.js +0 -8
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
"use strict";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 a=e[0].querySelectorAll('input[type="checkbox"]');angular.forEach(a,function(e){var a=angular.element(e);a.attr("bs-checkbox",""),a.attr("ng-model",t.ngModel+"."+a.attr("value"))})}}}).directive("bsCheckbox",["$button","$$rAF",function(e,t){var a=e.defaults,n=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,r,u,l){var o=a,i="INPUT"===r[0].nodeName,c=i?r.parent():r,s=angular.isDefined(u.trueValue)?u.trueValue:!0;n.test(u.trueValue)&&(s=e.$eval(u.trueValue));var d=angular.isDefined(u.falseValue)?u.falseValue:!1;n.test(u.falseValue)&&(d=e.$eval(u.falseValue));var f="boolean"!=typeof s||"boolean"!=typeof d;f&&(l.$parsers.push(function(e){return e?s:d}),l.$formatters.push(function(e){return angular.equals(e,s)}),e.$watch(u.ngModel,function(){l.$render()})),l.$render=function(){var e=angular.equals(l.$modelValue,s);t(function(){i&&(r[0].checked=e),c.toggleClass(o.activeClass,e)})},r.bind(o.toggleEvent,function(){e.$apply(function(){i||l.$setViewValue(!c.hasClass("active")),f||l.$render()})})}}}]).directive("bsRadioGroup",function(){return{restrict:"A",require:"ngModel",compile:function(e,t){e.attr("data-toggle","buttons"),e.removeAttr("ng-model");var a=e[0].querySelectorAll('input[type="radio"]');angular.forEach(a,function(e){angular.element(e).attr("bs-radio",""),angular.element(e).attr("ng-model",t.ngModel)})}}}).directive("bsRadio",["$button","$$rAF",function(e,t){var a=e.defaults,n=/^(true|false|\d+)$/;return{restrict:"A",require:"ngModel",link:function(e,r,u,l){var o=a,i="INPUT"===r[0].nodeName,c=i?r.parent():r,s=n.test(u.value)?e.$eval(u.value):u.value;l.$render=function(){var e=angular.equals(l.$modelValue,s);t(function(){i&&(r[0].checked=e),c.toggleClass(o.activeClass,e)})},r.bind(o.toggleEvent,function(){e.$apply(function(){l.$setViewValue(s),l.$render()})})}}}]);
|
9
|
-
//# sourceMappingURL=button.min.js.map
|
@@ -1 +0,0 @@
|
|
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/"}
|
@@ -1,273 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
angular.module('mgcrea.ngStrap.collapse', [])
|
11
|
-
|
12
|
-
.provider('$collapse', function() {
|
13
|
-
|
14
|
-
var defaults = this.defaults = {
|
15
|
-
animation: 'am-collapse',
|
16
|
-
disallowToggle: false,
|
17
|
-
activeClass: 'in',
|
18
|
-
startCollapsed: false,
|
19
|
-
allowMultiple: false
|
20
|
-
};
|
21
|
-
|
22
|
-
var controller = this.controller = function($scope, $element, $attrs) {
|
23
|
-
var self = this;
|
24
|
-
|
25
|
-
// Attributes options
|
26
|
-
self.$options = angular.copy(defaults);
|
27
|
-
angular.forEach(['animation', 'disallowToggle', 'activeClass', 'startCollapsed', 'allowMultiple'], function (key) {
|
28
|
-
if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];
|
29
|
-
});
|
30
|
-
|
31
|
-
self.$toggles = [];
|
32
|
-
self.$targets = [];
|
33
|
-
|
34
|
-
self.$viewChangeListeners = [];
|
35
|
-
|
36
|
-
self.$registerToggle = function(element) {
|
37
|
-
self.$toggles.push(element);
|
38
|
-
};
|
39
|
-
self.$registerTarget = function(element) {
|
40
|
-
self.$targets.push(element);
|
41
|
-
};
|
42
|
-
|
43
|
-
self.$unregisterToggle = function(element) {
|
44
|
-
var index = self.$toggles.indexOf(element);
|
45
|
-
// remove toggle from $toggles array
|
46
|
-
self.$toggles.splice(index, 1);
|
47
|
-
};
|
48
|
-
self.$unregisterTarget = function(element) {
|
49
|
-
var index = self.$targets.indexOf(element);
|
50
|
-
|
51
|
-
// remove element from $targets array
|
52
|
-
self.$targets.splice(index, 1);
|
53
|
-
|
54
|
-
if (self.$options.allowMultiple) {
|
55
|
-
// remove target index from $active array values
|
56
|
-
deactivateItem(element);
|
57
|
-
}
|
58
|
-
|
59
|
-
// fix active item indexes
|
60
|
-
fixActiveItemIndexes(index);
|
61
|
-
|
62
|
-
self.$viewChangeListeners.forEach(function(fn) {
|
63
|
-
fn();
|
64
|
-
});
|
65
|
-
};
|
66
|
-
|
67
|
-
// use array to store all the currently open panels
|
68
|
-
self.$targets.$active = !self.$options.startCollapsed ? [0] : [];
|
69
|
-
self.$setActive = $scope.$setActive = function(value) {
|
70
|
-
if(angular.isArray(value)) {
|
71
|
-
self.$targets.$active = angular.copy(value);
|
72
|
-
}
|
73
|
-
else if(!self.$options.disallowToggle) {
|
74
|
-
// toogle element active status
|
75
|
-
isActive(value) ? deactivateItem(value) : activateItem(value);
|
76
|
-
} else {
|
77
|
-
activateItem(value);
|
78
|
-
}
|
79
|
-
|
80
|
-
self.$viewChangeListeners.forEach(function(fn) {
|
81
|
-
fn();
|
82
|
-
});
|
83
|
-
};
|
84
|
-
|
85
|
-
self.$activeIndexes = function() {
|
86
|
-
return self.$options.allowMultiple ? self.$targets.$active :
|
87
|
-
self.$targets.$active.length === 1 ? self.$targets.$active[0] : -1;
|
88
|
-
};
|
89
|
-
|
90
|
-
function fixActiveItemIndexes(index) {
|
91
|
-
// item with index was removed, so we
|
92
|
-
// need to adjust other items index values
|
93
|
-
var activeIndexes = self.$targets.$active;
|
94
|
-
for(var i = 0; i < activeIndexes.length; i++) {
|
95
|
-
if (index < activeIndexes[i]) {
|
96
|
-
activeIndexes[i] = activeIndexes[i] - 1;
|
97
|
-
}
|
98
|
-
|
99
|
-
// the last item is active, so we need to
|
100
|
-
// adjust its index
|
101
|
-
if (activeIndexes[i] === self.$targets.length) {
|
102
|
-
activeIndexes[i] = self.$targets.length - 1;
|
103
|
-
}
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
function isActive(value) {
|
108
|
-
var activeItems = self.$targets.$active;
|
109
|
-
return activeItems.indexOf(value) === -1 ? false : true;
|
110
|
-
}
|
111
|
-
|
112
|
-
function deactivateItem(value) {
|
113
|
-
var index = self.$targets.$active.indexOf(value);
|
114
|
-
if (index !== -1) {
|
115
|
-
self.$targets.$active.splice(index, 1);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
function activateItem(value) {
|
120
|
-
if (!self.$options.allowMultiple) {
|
121
|
-
// remove current selected item
|
122
|
-
self.$targets.$active.splice(0, 1);
|
123
|
-
}
|
124
|
-
|
125
|
-
if (self.$targets.$active.indexOf(value) === -1) {
|
126
|
-
self.$targets.$active.push(value);
|
127
|
-
}
|
128
|
-
}
|
129
|
-
|
130
|
-
};
|
131
|
-
|
132
|
-
this.$get = function() {
|
133
|
-
var $collapse = {};
|
134
|
-
$collapse.defaults = defaults;
|
135
|
-
$collapse.controller = controller;
|
136
|
-
return $collapse;
|
137
|
-
};
|
138
|
-
|
139
|
-
})
|
140
|
-
|
141
|
-
.directive('bsCollapse', ["$window", "$animate", "$collapse", function($window, $animate, $collapse) {
|
142
|
-
|
143
|
-
var defaults = $collapse.defaults;
|
144
|
-
|
145
|
-
return {
|
146
|
-
require: ['?ngModel', 'bsCollapse'],
|
147
|
-
controller: ['$scope', '$element', '$attrs', $collapse.controller],
|
148
|
-
link: function postLink(scope, element, attrs, controllers) {
|
149
|
-
|
150
|
-
var ngModelCtrl = controllers[0];
|
151
|
-
var bsCollapseCtrl = controllers[1];
|
152
|
-
|
153
|
-
if(ngModelCtrl) {
|
154
|
-
|
155
|
-
// Update the modelValue following
|
156
|
-
bsCollapseCtrl.$viewChangeListeners.push(function() {
|
157
|
-
ngModelCtrl.$setViewValue(bsCollapseCtrl.$activeIndexes());
|
158
|
-
});
|
159
|
-
|
160
|
-
// modelValue -> $formatters -> viewValue
|
161
|
-
ngModelCtrl.$formatters.push(function(modelValue) {
|
162
|
-
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
|
163
|
-
if (angular.isArray(modelValue)) {
|
164
|
-
// model value is an array, so just replace
|
165
|
-
// the active items directly
|
166
|
-
bsCollapseCtrl.$setActive(modelValue);
|
167
|
-
}
|
168
|
-
else {
|
169
|
-
var activeIndexes = bsCollapseCtrl.$activeIndexes();
|
170
|
-
|
171
|
-
if (angular.isArray(activeIndexes)) {
|
172
|
-
// we have an array of selected indexes
|
173
|
-
if (activeIndexes.indexOf(modelValue * 1) === -1) {
|
174
|
-
// item with modelValue index is not active
|
175
|
-
bsCollapseCtrl.$setActive(modelValue * 1);
|
176
|
-
}
|
177
|
-
}
|
178
|
-
else if (activeIndexes !== modelValue * 1) {
|
179
|
-
bsCollapseCtrl.$setActive(modelValue * 1);
|
180
|
-
}
|
181
|
-
}
|
182
|
-
return modelValue;
|
183
|
-
});
|
184
|
-
|
185
|
-
}
|
186
|
-
|
187
|
-
}
|
188
|
-
};
|
189
|
-
|
190
|
-
}])
|
191
|
-
|
192
|
-
.directive('bsCollapseToggle', function() {
|
193
|
-
|
194
|
-
return {
|
195
|
-
require: ['^?ngModel', '^bsCollapse'],
|
196
|
-
link: function postLink(scope, element, attrs, controllers) {
|
197
|
-
|
198
|
-
var ngModelCtrl = controllers[0];
|
199
|
-
var bsCollapseCtrl = controllers[1];
|
200
|
-
|
201
|
-
// Add base attr
|
202
|
-
element.attr('data-toggle', 'collapse');
|
203
|
-
|
204
|
-
// Push pane to parent bsCollapse controller
|
205
|
-
bsCollapseCtrl.$registerToggle(element);
|
206
|
-
|
207
|
-
// remove toggle from collapse controller when toggle is destroyed
|
208
|
-
scope.$on('$destroy', function() {
|
209
|
-
bsCollapseCtrl.$unregisterToggle(element);
|
210
|
-
});
|
211
|
-
|
212
|
-
element.on('click', function() {
|
213
|
-
var index = attrs.bsCollapseToggle || bsCollapseCtrl.$toggles.indexOf(element);
|
214
|
-
bsCollapseCtrl.$setActive(index * 1);
|
215
|
-
scope.$apply();
|
216
|
-
});
|
217
|
-
|
218
|
-
}
|
219
|
-
};
|
220
|
-
|
221
|
-
})
|
222
|
-
|
223
|
-
.directive('bsCollapseTarget', ["$animate", function($animate) {
|
224
|
-
|
225
|
-
return {
|
226
|
-
require: ['^?ngModel', '^bsCollapse'],
|
227
|
-
// scope: true,
|
228
|
-
link: function postLink(scope, element, attrs, controllers) {
|
229
|
-
|
230
|
-
var ngModelCtrl = controllers[0];
|
231
|
-
var bsCollapseCtrl = controllers[1];
|
232
|
-
|
233
|
-
// Add base class
|
234
|
-
element.addClass('collapse');
|
235
|
-
|
236
|
-
// Add animation class
|
237
|
-
if(bsCollapseCtrl.$options.animation) {
|
238
|
-
element.addClass(bsCollapseCtrl.$options.animation);
|
239
|
-
}
|
240
|
-
|
241
|
-
// Push pane to parent bsCollapse controller
|
242
|
-
bsCollapseCtrl.$registerTarget(element);
|
243
|
-
|
244
|
-
// remove pane target from collapse controller when target is destroyed
|
245
|
-
scope.$on('$destroy', function() {
|
246
|
-
bsCollapseCtrl.$unregisterTarget(element);
|
247
|
-
});
|
248
|
-
|
249
|
-
function render() {
|
250
|
-
var index = bsCollapseCtrl.$targets.indexOf(element);
|
251
|
-
var active = bsCollapseCtrl.$activeIndexes();
|
252
|
-
var action = 'removeClass';
|
253
|
-
if (angular.isArray(active)) {
|
254
|
-
if (active.indexOf(index) !== -1) {
|
255
|
-
action = 'addClass';
|
256
|
-
}
|
257
|
-
}
|
258
|
-
else if (index === active) {
|
259
|
-
action = 'addClass';
|
260
|
-
}
|
261
|
-
|
262
|
-
$animate[action](element, bsCollapseCtrl.$options.activeClass);
|
263
|
-
}
|
264
|
-
|
265
|
-
bsCollapseCtrl.$viewChangeListeners.push(function() {
|
266
|
-
render();
|
267
|
-
});
|
268
|
-
render();
|
269
|
-
|
270
|
-
}
|
271
|
-
};
|
272
|
-
|
273
|
-
}]);
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
"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<t.length;a++)e<t[a]&&(t[a]=t[a]-1),t[a]===o.$targets.length&&(t[a]=o.$targets.length-1)}function s(e){var t=o.$targets.$active;return-1===t.indexOf(e)?!1:!0}function r(e){var t=o.$targets.$active.indexOf(e);-1!==t&&o.$targets.$active.splice(t,1)}function l(e){o.$options.allowMultiple||o.$targets.$active.splice(0,1),-1===o.$targets.$active.indexOf(e)&&o.$targets.$active.push(e)}var o=this;o.$options=angular.copy(e),angular.forEach(["animation","disallowToggle","activeClass","startCollapsed","allowMultiple"],function(e){angular.isDefined(n[e])&&(o.$options[e]=n[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);o.$targets.splice(t,1),o.$options.allowMultiple&&r(e),i(t),o.$viewChangeListeners.forEach(function(e){e()})},o.$targets.$active=o.$options.startCollapsed?[]:[0],o.$setActive=t.$setActive=function(e){angular.isArray(e)?o.$targets.$active=angular.copy(e):o.$options.disallowToggle?l(e):s(e)?r(e):l(e),o.$viewChangeListeners.forEach(function(e){e()})},o.$activeIndexes=function(){return o.$options.allowMultiple?o.$targets.$active:1===o.$targets.$active.length?o.$targets.$active[0]:-1}};this.$get=function(){var a={};return a.defaults=e,a.controller=t,a}}).directive("bsCollapse",["$window","$animate","$collapse",function(e,t,a){a.defaults;return{require:["?ngModel","bsCollapse"],controller:["$scope","$element","$attrs",a.controller],link:function(e,t,a,n){var i=n[0],s=n[1];i&&(s.$viewChangeListeners.push(function(){i.$setViewValue(s.$activeIndexes())}),i.$formatters.push(function(e){if(angular.isArray(e))s.$setActive(e);else{var t=s.$activeIndexes();angular.isArray(t)?-1===t.indexOf(1*e)&&s.$setActive(1*e):t!==1*e&&s.$setActive(1*e)}return e}))}}}]).directive("bsCollapseToggle",function(){return{require:["^?ngModel","^bsCollapse"],link:function(e,t,a,n){var i=(n[0],n[1]);t.attr("data-toggle","collapse"),i.$registerToggle(t),e.$on("$destroy",function(){i.$unregisterToggle(t)}),t.on("click",function(){var n=a.bsCollapseToggle||i.$toggles.indexOf(t);i.$setActive(1*n),e.$apply()})}}}).directive("bsCollapseTarget",["$animate",function(e){return{require:["^?ngModel","^bsCollapse"],link:function(t,a,n,i){function s(){var t=r.$targets.indexOf(a),n=r.$activeIndexes(),i="removeClass";angular.isArray(n)?-1!==n.indexOf(t)&&(i="addClass"):t===n&&(i="addClass"),e[i](a,r.$options.activeClass)}var r=(i[0],i[1]);a.addClass("collapse"),r.$options.animation&&a.addClass(r.$options.animation),r.$registerTarget(a),t.$on("$destroy",function(){r.$unregisterTarget(a)}),r.$viewChangeListeners.push(function(){s()}),s()}}}]);
|
9
|
-
//# sourceMappingURL=collapse.min.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"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';\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 allowMultiple: 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', 'allowMultiple'], 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\n // remove element from $targets array\n self.$targets.splice(index, 1);\n\n if (self.$options.allowMultiple) {\n // remove target index from $active array values\n deactivateItem(element);\n }\n\n // fix active item indexes\n fixActiveItemIndexes(index);\n\n self.$viewChangeListeners.forEach(function(fn) {\n fn();\n });\n };\n\n // use array to store all the currently open panels\n self.$targets.$active = !self.$options.startCollapsed ? [0] : [];\n self.$setActive = $scope.$setActive = function(value) {\n if(angular.isArray(value)) {\n self.$targets.$active = angular.copy(value);\n }\n else if(!self.$options.disallowToggle) {\n // toogle element active status\n isActive(value) ? deactivateItem(value) : activateItem(value);\n } else {\n activateItem(value);\n }\n\n self.$viewChangeListeners.forEach(function(fn) {\n fn();\n });\n };\n\n self.$activeIndexes = function() {\n return self.$options.allowMultiple ? self.$targets.$active :\n self.$targets.$active.length === 1 ? self.$targets.$active[0] : -1;\n };\n\n function fixActiveItemIndexes(index) {\n // item with index was removed, so we\n // need to adjust other items index values\n var activeIndexes = self.$targets.$active;\n for(var i = 0; i < activeIndexes.length; i++) {\n if (index < activeIndexes[i]) {\n activeIndexes[i] = activeIndexes[i] - 1;\n }\n\n // the last item is active, so we need to\n // adjust its index\n if (activeIndexes[i] === self.$targets.length) {\n activeIndexes[i] = self.$targets.length - 1;\n }\n }\n }\n\n function isActive(value) {\n var activeItems = self.$targets.$active;\n return activeItems.indexOf(value) === -1 ? false : true;\n }\n\n function deactivateItem(value) {\n var index = self.$targets.$active.indexOf(value);\n if (index !== -1) {\n self.$targets.$active.splice(index, 1);\n }\n }\n\n function activateItem(value) {\n if (!self.$options.allowMultiple) {\n // remove current selected item\n self.$targets.$active.splice(0, 1);\n }\n\n if (self.$targets.$active.indexOf(value) === -1) {\n self.$targets.$active.push(value);\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.$activeIndexes());\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 (angular.isArray(modelValue)) {\n // model value is an array, so just replace\n // the active items directly\n bsCollapseCtrl.$setActive(modelValue);\n }\n else {\n var activeIndexes = bsCollapseCtrl.$activeIndexes();\n\n if (angular.isArray(activeIndexes)) {\n // we have an array of selected indexes\n if (activeIndexes.indexOf(modelValue * 1) === -1) {\n // item with modelValue index is not active\n bsCollapseCtrl.$setActive(modelValue * 1);\n }\n }\n else if (activeIndexes !== modelValue * 1) {\n bsCollapseCtrl.$setActive(modelValue * 1);\n }\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.$activeIndexes();\n var action = 'removeClass';\n if (angular.isArray(active)) {\n if (active.indexOf(index) !== -1) {\n action = 'addClass';\n }\n }\n else if (index === active) {\n action = 'addClass';\n }\n\n $animate[action](element, bsCollapseCtrl.$options.activeClass);\n }\n\n bsCollapseCtrl.$viewChangeListeners.push(function() {\n render();\n });\n render();\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
angular.module('mgcrea.ngStrap.helpers.dateFormatter', [])
|
11
|
-
|
12
|
-
.service('$dateFormatter', ["$locale", "dateFilter", function($locale, dateFilter) {
|
13
|
-
|
14
|
-
// The unused `lang` arguments are on purpose. The default implementation does not
|
15
|
-
// use them and it always uses the locale loaded into the `$locale` service.
|
16
|
-
// Custom implementations might use it, thus allowing different directives to
|
17
|
-
// have different languages.
|
18
|
-
|
19
|
-
this.getDefaultLocale = function() {
|
20
|
-
return $locale.id;
|
21
|
-
};
|
22
|
-
|
23
|
-
// Format is either a data format name, e.g. "shortTime" or "fullDate", or a date format
|
24
|
-
// Return either the corresponding date format or the given date format.
|
25
|
-
this.getDatetimeFormat = function(format, lang) {
|
26
|
-
return $locale.DATETIME_FORMATS[format] || format;
|
27
|
-
};
|
28
|
-
|
29
|
-
this.weekdaysShort = function(lang) {
|
30
|
-
return $locale.DATETIME_FORMATS.SHORTDAY;
|
31
|
-
};
|
32
|
-
|
33
|
-
function splitTimeFormat(format) {
|
34
|
-
return /(h+)([:\.])?(m+)[ ]?(a?)/i.exec(format).slice(1);
|
35
|
-
}
|
36
|
-
|
37
|
-
// h:mm a => h
|
38
|
-
this.hoursFormat = function(timeFormat) {
|
39
|
-
return splitTimeFormat(timeFormat)[0];
|
40
|
-
};
|
41
|
-
|
42
|
-
// h:mm a => mm
|
43
|
-
this.minutesFormat = function(timeFormat) {
|
44
|
-
return splitTimeFormat(timeFormat)[2];
|
45
|
-
};
|
46
|
-
|
47
|
-
// h:mm a => :
|
48
|
-
this.timeSeparator = function(timeFormat) {
|
49
|
-
return splitTimeFormat(timeFormat)[1];
|
50
|
-
};
|
51
|
-
|
52
|
-
// h:mm a => true, H.mm => false
|
53
|
-
this.showAM = function(timeFormat) {
|
54
|
-
return !!splitTimeFormat(timeFormat)[3];
|
55
|
-
};
|
56
|
-
|
57
|
-
this.formatDate = function(date, format, lang){
|
58
|
-
return dateFilter(date, format);
|
59
|
-
};
|
60
|
-
|
61
|
-
}]);
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
"use strict";angular.module("mgcrea.ngStrap.helpers.dateFormatter",[]).service("$dateFormatter",["$locale","dateFilter",function(t,e){function r(t){return/(h+)([:\.])?(m+)[ ]?(a?)/i.exec(t).slice(1)}this.getDefaultLocale=function(){return t.id},this.getDatetimeFormat=function(e){return t.DATETIME_FORMATS[e]||e},this.weekdaysShort=function(){return t.DATETIME_FORMATS.SHORTDAY},this.hoursFormat=function(t){return r(t)[0]},this.minutesFormat=function(t){return r(t)[2]},this.timeSeparator=function(t){return r(t)[1]},this.showAM=function(t){return!!r(t)[3]},this.formatDate=function(t,r){return e(t,r)}}]);
|
9
|
-
//# sourceMappingURL=date-formatter.min.js.map
|
@@ -1 +0,0 @@
|
|
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/"}
|
@@ -1,273 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
angular.module('mgcrea.ngStrap.helpers.dateParser', [])
|
11
|
-
|
12
|
-
.provider('$dateParser', ["$localeProvider", function($localeProvider) {
|
13
|
-
|
14
|
-
// define a custom ParseDate object to use instead of native Date
|
15
|
-
// to avoid date values wrapping when setting date component values
|
16
|
-
function ParseDate() {
|
17
|
-
this.year = 1970;
|
18
|
-
this.month = 0;
|
19
|
-
this.day = 1;
|
20
|
-
this.hours = 0;
|
21
|
-
this.minutes = 0;
|
22
|
-
this.seconds = 0;
|
23
|
-
this.milliseconds = 0;
|
24
|
-
}
|
25
|
-
|
26
|
-
ParseDate.prototype.setMilliseconds = function(value) { this.milliseconds = value; };
|
27
|
-
ParseDate.prototype.setSeconds = function(value) { this.seconds = value; };
|
28
|
-
ParseDate.prototype.setMinutes = function(value) { this.minutes = value; };
|
29
|
-
ParseDate.prototype.setHours = function(value) { this.hours = value; };
|
30
|
-
ParseDate.prototype.getHours = function() { return this.hours; };
|
31
|
-
ParseDate.prototype.setDate = function(value) { this.day = value; };
|
32
|
-
ParseDate.prototype.setMonth = function(value) { this.month = value; };
|
33
|
-
ParseDate.prototype.setFullYear = function(value) { this.year = value; };
|
34
|
-
ParseDate.prototype.fromDate = function(value) {
|
35
|
-
this.year = value.getFullYear();
|
36
|
-
this.month = value.getMonth();
|
37
|
-
this.day = value.getDate();
|
38
|
-
this.hours = value.getHours();
|
39
|
-
this.minutes = value.getMinutes();
|
40
|
-
this.seconds = value.getSeconds();
|
41
|
-
this.milliseconds = value.getMilliseconds();
|
42
|
-
return this;
|
43
|
-
};
|
44
|
-
|
45
|
-
ParseDate.prototype.toDate = function() {
|
46
|
-
return new Date(this.year, this.month, this.day, this.hours, this.minutes, this.seconds, this.milliseconds);
|
47
|
-
};
|
48
|
-
|
49
|
-
var proto = ParseDate.prototype;
|
50
|
-
|
51
|
-
function noop() {
|
52
|
-
}
|
53
|
-
|
54
|
-
function isNumeric(n) {
|
55
|
-
return !isNaN(parseFloat(n)) && isFinite(n);
|
56
|
-
}
|
57
|
-
|
58
|
-
function indexOfCaseInsensitive(array, value) {
|
59
|
-
var len = array.length, str=value.toString().toLowerCase();
|
60
|
-
for (var i=0; i<len; i++) {
|
61
|
-
if (array[i].toLowerCase() === str) { return i; }
|
62
|
-
}
|
63
|
-
return -1; // Return -1 per the "Array.indexOf()" method.
|
64
|
-
}
|
65
|
-
|
66
|
-
var defaults = this.defaults = {
|
67
|
-
format: 'shortDate',
|
68
|
-
strict: false
|
69
|
-
};
|
70
|
-
|
71
|
-
this.$get = ["$locale", "dateFilter", function($locale, dateFilter) {
|
72
|
-
|
73
|
-
var DateParserFactory = function(config) {
|
74
|
-
|
75
|
-
var options = angular.extend({}, defaults, config);
|
76
|
-
|
77
|
-
var $dateParser = {};
|
78
|
-
|
79
|
-
var regExpMap = {
|
80
|
-
'sss' : '[0-9]{3}',
|
81
|
-
'ss' : '[0-5][0-9]',
|
82
|
-
's' : options.strict ? '[1-5]?[0-9]' : '[0-9]|[0-5][0-9]',
|
83
|
-
'mm' : '[0-5][0-9]',
|
84
|
-
'm' : options.strict ? '[1-5]?[0-9]' : '[0-9]|[0-5][0-9]',
|
85
|
-
'HH' : '[01][0-9]|2[0-3]',
|
86
|
-
'H' : options.strict ? '1?[0-9]|2[0-3]' : '[01]?[0-9]|2[0-3]',
|
87
|
-
'hh' : '[0][1-9]|[1][012]',
|
88
|
-
'h' : options.strict ? '[1-9]|1[012]' : '0?[1-9]|1[012]',
|
89
|
-
'a' : 'AM|PM',
|
90
|
-
'EEEE' : $locale.DATETIME_FORMATS.DAY.join('|'),
|
91
|
-
'EEE' : $locale.DATETIME_FORMATS.SHORTDAY.join('|'),
|
92
|
-
'dd' : '0[1-9]|[12][0-9]|3[01]',
|
93
|
-
'd' : options.strict ? '[1-9]|[1-2][0-9]|3[01]' : '0?[1-9]|[1-2][0-9]|3[01]',
|
94
|
-
'MMMM' : $locale.DATETIME_FORMATS.MONTH.join('|'),
|
95
|
-
'MMM' : $locale.DATETIME_FORMATS.SHORTMONTH.join('|'),
|
96
|
-
'MM' : '0[1-9]|1[012]',
|
97
|
-
'M' : options.strict ? '[1-9]|1[012]' : '0?[1-9]|1[012]',
|
98
|
-
'yyyy' : '[1]{1}[0-9]{3}|[2]{1}[0-9]{3}',
|
99
|
-
'yy' : '[0-9]{2}',
|
100
|
-
'y' : options.strict ? '-?(0|[1-9][0-9]{0,3})' : '-?0*[0-9]{1,4}',
|
101
|
-
};
|
102
|
-
|
103
|
-
var setFnMap = {
|
104
|
-
'sss' : proto.setMilliseconds,
|
105
|
-
'ss' : proto.setSeconds,
|
106
|
-
's' : proto.setSeconds,
|
107
|
-
'mm' : proto.setMinutes,
|
108
|
-
'm' : proto.setMinutes,
|
109
|
-
'HH' : proto.setHours,
|
110
|
-
'H' : proto.setHours,
|
111
|
-
'hh' : proto.setHours,
|
112
|
-
'h' : proto.setHours,
|
113
|
-
'EEEE' : noop,
|
114
|
-
'EEE' : noop,
|
115
|
-
'dd' : proto.setDate,
|
116
|
-
'd' : proto.setDate,
|
117
|
-
'a' : function(value) { var hours = this.getHours() % 12; return this.setHours(value.match(/pm/i) ? hours + 12 : hours); },
|
118
|
-
'MMMM' : function(value) { return this.setMonth(indexOfCaseInsensitive($locale.DATETIME_FORMATS.MONTH, value)); },
|
119
|
-
'MMM' : function(value) { return this.setMonth(indexOfCaseInsensitive($locale.DATETIME_FORMATS.SHORTMONTH, value)); },
|
120
|
-
'MM' : function(value) { return this.setMonth(1 * value - 1); },
|
121
|
-
'M' : function(value) { return this.setMonth(1 * value - 1); },
|
122
|
-
'yyyy' : proto.setFullYear,
|
123
|
-
'yy' : function(value) { return this.setFullYear(2000 + 1 * value); },
|
124
|
-
'y' : proto.setFullYear
|
125
|
-
};
|
126
|
-
|
127
|
-
var regex, setMap;
|
128
|
-
|
129
|
-
$dateParser.init = function() {
|
130
|
-
$dateParser.$format = $locale.DATETIME_FORMATS[options.format] || options.format;
|
131
|
-
regex = regExpForFormat($dateParser.$format);
|
132
|
-
setMap = setMapForFormat($dateParser.$format);
|
133
|
-
};
|
134
|
-
|
135
|
-
$dateParser.isValid = function(date) {
|
136
|
-
if(angular.isDate(date)) return !isNaN(date.getTime());
|
137
|
-
return regex.test(date);
|
138
|
-
};
|
139
|
-
|
140
|
-
$dateParser.parse = function(value, baseDate, format) {
|
141
|
-
// check for date format special names
|
142
|
-
if(format) format = $locale.DATETIME_FORMATS[format] || format;
|
143
|
-
if(angular.isDate(value)) value = dateFilter(value, format || $dateParser.$format);
|
144
|
-
var formatRegex = format ? regExpForFormat(format) : regex;
|
145
|
-
var formatSetMap = format ? setMapForFormat(format) : setMap;
|
146
|
-
var matches = formatRegex.exec(value);
|
147
|
-
if(!matches) return false;
|
148
|
-
// use custom ParseDate object to set parsed values
|
149
|
-
var date = baseDate && !isNaN(baseDate.getTime()) ? new ParseDate().fromDate(baseDate) : new ParseDate().fromDate(new Date(1970, 0, 1, 0));
|
150
|
-
for(var i = 0; i < matches.length - 1; i++) {
|
151
|
-
formatSetMap[i] && formatSetMap[i].call(date, matches[i+1]);
|
152
|
-
}
|
153
|
-
// convert back to native Date object
|
154
|
-
var newDate = date.toDate();
|
155
|
-
|
156
|
-
// check new native Date object for day values overflow
|
157
|
-
if (parseInt(date.day, 10) !== newDate.getDate()) {
|
158
|
-
return false;
|
159
|
-
}
|
160
|
-
|
161
|
-
return newDate;
|
162
|
-
};
|
163
|
-
|
164
|
-
$dateParser.getDateForAttribute = function(key, value) {
|
165
|
-
var date;
|
166
|
-
|
167
|
-
if(value === 'today') {
|
168
|
-
var today = new Date();
|
169
|
-
date = new Date(today.getFullYear(), today.getMonth(), today.getDate() + (key === 'maxDate' ? 1 : 0), 0, 0, 0, (key === 'minDate' ? 0 : -1));
|
170
|
-
} else if(angular.isString(value) && value.match(/^".+"$/)) { // Support {{ dateObj }}
|
171
|
-
date = new Date(value.substr(1, value.length - 2));
|
172
|
-
} else if(isNumeric(value)) {
|
173
|
-
date = new Date(parseInt(value, 10));
|
174
|
-
} else if (angular.isString(value) && 0 === value.length) { // Reset date
|
175
|
-
date = key === 'minDate' ? -Infinity : +Infinity;
|
176
|
-
} else {
|
177
|
-
date = new Date(value);
|
178
|
-
}
|
179
|
-
|
180
|
-
return date;
|
181
|
-
};
|
182
|
-
|
183
|
-
$dateParser.getTimeForAttribute = function(key, value) {
|
184
|
-
var time;
|
185
|
-
|
186
|
-
if(value === 'now') {
|
187
|
-
time = new Date().setFullYear(1970, 0, 1);
|
188
|
-
} else if(angular.isString(value) && value.match(/^".+"$/)) {
|
189
|
-
time = new Date(value.substr(1, value.length - 2)).setFullYear(1970, 0, 1);
|
190
|
-
} else if(isNumeric(value)) {
|
191
|
-
time = new Date(parseInt(value, 10)).setFullYear(1970, 0, 1);
|
192
|
-
} else if (angular.isString(value) && 0 === value.length) { // Reset time
|
193
|
-
time = key === 'minTime' ? -Infinity : +Infinity;
|
194
|
-
} else {
|
195
|
-
time = $dateParser.parse(value, new Date(1970, 0, 1, 0));
|
196
|
-
}
|
197
|
-
|
198
|
-
return time;
|
199
|
-
};
|
200
|
-
|
201
|
-
/* Handle switch to/from daylight saving.
|
202
|
-
* Hours may be non-zero on daylight saving cut-over:
|
203
|
-
* > 12 when midnight changeover, but then cannot generate
|
204
|
-
* midnight datetime, so jump to 1AM, otherwise reset.
|
205
|
-
* @param date (Date) the date to check
|
206
|
-
* @return (Date) the corrected date
|
207
|
-
*
|
208
|
-
* __ copied from jquery ui datepicker __
|
209
|
-
*/
|
210
|
-
$dateParser.daylightSavingAdjust = function(date) {
|
211
|
-
if (!date) {
|
212
|
-
return null;
|
213
|
-
}
|
214
|
-
date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
|
215
|
-
return date;
|
216
|
-
};
|
217
|
-
|
218
|
-
// Private functions
|
219
|
-
|
220
|
-
function setMapForFormat(format) {
|
221
|
-
var keys = Object.keys(setFnMap), i;
|
222
|
-
var map = [], sortedMap = [];
|
223
|
-
// Map to setFn
|
224
|
-
var clonedFormat = format;
|
225
|
-
for(i = 0; i < keys.length; i++) {
|
226
|
-
if(format.split(keys[i]).length > 1) {
|
227
|
-
var index = clonedFormat.search(keys[i]);
|
228
|
-
format = format.split(keys[i]).join('');
|
229
|
-
if(setFnMap[keys[i]]) {
|
230
|
-
map[index] = setFnMap[keys[i]];
|
231
|
-
}
|
232
|
-
}
|
233
|
-
}
|
234
|
-
// Sort result map
|
235
|
-
angular.forEach(map, function(v) {
|
236
|
-
// conditional required since angular.forEach broke around v1.2.21
|
237
|
-
// related pr: https://github.com/angular/angular.js/pull/8525
|
238
|
-
if(v) sortedMap.push(v);
|
239
|
-
});
|
240
|
-
return sortedMap;
|
241
|
-
}
|
242
|
-
|
243
|
-
function escapeReservedSymbols(text) {
|
244
|
-
return text.replace(/\//g, '[\\/]').replace('/-/g', '[-]').replace(/\./g, '[.]').replace(/\\s/g, '[\\s]');
|
245
|
-
}
|
246
|
-
|
247
|
-
function regExpForFormat(format) {
|
248
|
-
var keys = Object.keys(regExpMap), i;
|
249
|
-
|
250
|
-
var re = format;
|
251
|
-
// Abstract replaces to avoid collisions
|
252
|
-
for(i = 0; i < keys.length; i++) {
|
253
|
-
re = re.split(keys[i]).join('${' + i + '}');
|
254
|
-
}
|
255
|
-
// Replace abstracted values
|
256
|
-
for(i = 0; i < keys.length; i++) {
|
257
|
-
re = re.split('${' + i + '}').join('(' + regExpMap[keys[i]] + ')');
|
258
|
-
}
|
259
|
-
format = escapeReservedSymbols(format);
|
260
|
-
|
261
|
-
return new RegExp('^' + re + '$', ['i']);
|
262
|
-
}
|
263
|
-
|
264
|
-
$dateParser.init();
|
265
|
-
return $dateParser;
|
266
|
-
|
267
|
-
};
|
268
|
-
|
269
|
-
return DateParserFactory;
|
270
|
-
|
271
|
-
}];
|
272
|
-
|
273
|
-
}]);
|