rails-angular-strap 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +21 -0
  4. data/lib/rails-angular-strap.rb +11 -0
  5. data/lib/rails-angular-strap/engine.rb +4 -0
  6. data/lib/rails-angular-strap/version.rb +4 -0
  7. data/vendor/assets/javascripts/angular-strap.js +2 -0
  8. data/vendor/assets/javascripts/angular-strap.min.js +2 -0
  9. data/vendor/assets/javascripts/angular-strap/angular-strap.js +5014 -0
  10. data/vendor/assets/javascripts/angular-strap/angular-strap.min.js +11 -0
  11. data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.js +89 -0
  12. data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.min.js +8 -0
  13. data/vendor/assets/javascripts/angular-strap/modules/affix.js +249 -0
  14. data/vendor/assets/javascripts/angular-strap/modules/affix.min.js +9 -0
  15. data/vendor/assets/javascripts/angular-strap/modules/affix.min.js.map +1 -0
  16. data/vendor/assets/javascripts/angular-strap/modules/alert.js +120 -0
  17. data/vendor/assets/javascripts/angular-strap/modules/alert.min.js +9 -0
  18. data/vendor/assets/javascripts/angular-strap/modules/alert.min.js.map +1 -0
  19. data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.js +14 -0
  20. data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.min.js +8 -0
  21. data/vendor/assets/javascripts/angular-strap/modules/aside.js +96 -0
  22. data/vendor/assets/javascripts/angular-strap/modules/aside.min.js +9 -0
  23. data/vendor/assets/javascripts/angular-strap/modules/aside.min.js.map +1 -0
  24. data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.js +14 -0
  25. data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.min.js +8 -0
  26. data/vendor/assets/javascripts/angular-strap/modules/button.js +177 -0
  27. data/vendor/assets/javascripts/angular-strap/modules/button.min.js +9 -0
  28. data/vendor/assets/javascripts/angular-strap/modules/button.min.js.map +1 -0
  29. data/vendor/assets/javascripts/angular-strap/modules/collapse.js +273 -0
  30. data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js +9 -0
  31. data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js.map +1 -0
  32. data/vendor/assets/javascripts/angular-strap/modules/date-formatter.js +61 -0
  33. data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js +9 -0
  34. data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js.map +1 -0
  35. data/vendor/assets/javascripts/angular-strap/modules/date-parser.js +273 -0
  36. data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js +9 -0
  37. data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js.map +1 -0
  38. data/vendor/assets/javascripts/angular-strap/modules/datepicker.js +640 -0
  39. data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js +9 -0
  40. data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js.map +1 -0
  41. data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.js +14 -0
  42. data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.min.js +8 -0
  43. data/vendor/assets/javascripts/angular-strap/modules/debounce.js +62 -0
  44. data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js +9 -0
  45. data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js.map +1 -0
  46. data/vendor/assets/javascripts/angular-strap/modules/dimensions.js +156 -0
  47. data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js +9 -0
  48. data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js.map +1 -0
  49. data/vendor/assets/javascripts/angular-strap/modules/dropdown.js +149 -0
  50. data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js +9 -0
  51. data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js.map +1 -0
  52. data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.js +14 -0
  53. data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.min.js +8 -0
  54. data/vendor/assets/javascripts/angular-strap/modules/modal.js +349 -0
  55. data/vendor/assets/javascripts/angular-strap/modules/modal.min.js +9 -0
  56. data/vendor/assets/javascripts/angular-strap/modules/modal.min.js.map +1 -0
  57. data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.js +14 -0
  58. data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.min.js +8 -0
  59. data/vendor/assets/javascripts/angular-strap/modules/navbar.js +72 -0
  60. data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js +9 -0
  61. data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js.map +1 -0
  62. data/vendor/assets/javascripts/angular-strap/modules/parse-options.js +76 -0
  63. data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js +9 -0
  64. data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js.map +1 -0
  65. data/vendor/assets/javascripts/angular-strap/modules/popover.js +112 -0
  66. data/vendor/assets/javascripts/angular-strap/modules/popover.min.js +9 -0
  67. data/vendor/assets/javascripts/angular-strap/modules/popover.min.js.map +1 -0
  68. data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.js +14 -0
  69. data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.min.js +8 -0
  70. data/vendor/assets/javascripts/angular-strap/modules/raf.js +61 -0
  71. data/vendor/assets/javascripts/angular-strap/modules/raf.min.js +9 -0
  72. data/vendor/assets/javascripts/angular-strap/modules/raf.min.js.map +1 -0
  73. data/vendor/assets/javascripts/angular-strap/modules/scrollspy.js +261 -0
  74. data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js +9 -0
  75. data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js.map +1 -0
  76. data/vendor/assets/javascripts/angular-strap/modules/select.js +325 -0
  77. data/vendor/assets/javascripts/angular-strap/modules/select.min.js +9 -0
  78. data/vendor/assets/javascripts/angular-strap/modules/select.min.js.map +1 -0
  79. data/vendor/assets/javascripts/angular-strap/modules/select.tpl.js +14 -0
  80. data/vendor/assets/javascripts/angular-strap/modules/select.tpl.min.js +8 -0
  81. data/vendor/assets/javascripts/angular-strap/modules/tab.js +186 -0
  82. data/vendor/assets/javascripts/angular-strap/modules/tab.min.js +9 -0
  83. data/vendor/assets/javascripts/angular-strap/modules/tab.min.js.map +1 -0
  84. data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.js +14 -0
  85. data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.min.js +8 -0
  86. data/vendor/assets/javascripts/angular-strap/modules/timepicker.js +485 -0
  87. data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js +9 -0
  88. data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js.map +1 -0
  89. data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.js +14 -0
  90. data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.min.js +8 -0
  91. data/vendor/assets/javascripts/angular-strap/modules/tooltip.js +690 -0
  92. data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js +9 -0
  93. data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js.map +1 -0
  94. data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.js +14 -0
  95. data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.min.js +8 -0
  96. data/vendor/assets/javascripts/angular-strap/modules/typeahead.js +266 -0
  97. data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js +9 -0
  98. data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js.map +1 -0
  99. data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.js +14 -0
  100. data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.min.js +8 -0
  101. metadata +143 -0
@@ -0,0 +1,9 @@
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.scrollspy",["mgcrea.ngStrap.helpers.debounce","mgcrea.ngStrap.helpers.dimensions"]).provider("$scrollspy",function(){var e=this.$$spies={},t=this.defaults={debounce:150,throttle:100,offset:100};this.$get=["$window","$document","$rootScope","dimensions","debounce","throttle",function(n,o,r,c,i,s){function a(e,t){return e[0].nodeName&&e[0].nodeName.toLowerCase()===t.toLowerCase()}function l(o){var l=angular.extend({},t,o);l.element||(l.element=p);var d=a(l.element,"body"),h=d?u:l.element,m=d?"window":l.id;if(e[m])return e[m].$$count++,e[m];var g,v,$,k,E,T,y,b,C={},S=C.$trackedElements=[],L=[];return C.init=function(){this.$$count=1,k=i(this.checkPosition,l.debounce),E=s(this.checkPosition,l.throttle),h.on("click",this.checkPositionWithEventLoop),u.on("resize",k),h.on("scroll",E),T=i(this.checkOffsets,l.debounce),g=r.$on("$viewContentLoaded",T),v=r.$on("$includeContentLoaded",T),T(),m&&(e[m]=C)},C.destroy=function(){this.$$count--,this.$$count>0||(h.off("click",this.checkPositionWithEventLoop),u.off("resize",k),h.off("scroll",E),g(),v(),m&&delete e[m])},C.checkPosition=function(){if(L.length){if(b=(d?n.pageYOffset:h.prop("scrollTop"))||0,y=Math.max(n.innerHeight,f.prop("clientHeight")),b<L[0].offsetTop&&$!==L[0].target)return C.$activateElement(L[0]);for(var e=L.length;e--;)if(!angular.isUndefined(L[e].offsetTop)&&null!==L[e].offsetTop&&$!==L[e].target&&!(b<L[e].offsetTop||L[e+1]&&b>L[e+1].offsetTop))return C.$activateElement(L[e])}},C.checkPositionWithEventLoop=function(){setTimeout(C.checkPosition,1)},C.$activateElement=function(e){if($){var t=C.$getTrackedElement($);t&&(t.source.removeClass("active"),a(t.source,"li")&&a(t.source.parent().parent(),"li")&&t.source.parent().parent().removeClass("active"))}$=e.target,e.source.addClass("active"),a(e.source,"li")&&a(e.source.parent().parent(),"li")&&e.source.parent().parent().addClass("active")},C.$getTrackedElement=function(e){return S.filter(function(t){return t.target===e})[0]},C.checkOffsets=function(){angular.forEach(S,function(e){var t=document.querySelector(e.target);e.offsetTop=t?c.offset(t).top:null,l.offset&&null!==e.offsetTop&&(e.offsetTop-=1*l.offset)}),L=S.filter(function(e){return null!==e.offsetTop}).sort(function(e,t){return e.offsetTop-t.offsetTop}),k()},C.trackElement=function(e,t){S.push({target:e,source:t})},C.untrackElement=function(e,t){for(var n,o=S.length;o--;)if(S[o].target===e&&S[o].source===t){n=o;break}S=S.splice(n,1)},C.activate=function(e){S[e].addClass("active")},C.init(),C}var u=angular.element(n),f=angular.element(o.prop("documentElement")),p=angular.element(n.document.body);return l}]}).directive("bsScrollspy",["$rootScope","debounce","dimensions","$scrollspy",function(e,t,n,o){return{restrict:"EAC",link:function(e,t,n){var r={scope:e};angular.forEach(["offset","target"],function(e){angular.isDefined(n[e])&&(r[e]=n[e])});var c=o(r);c.trackElement(r.target,t),e.$on("$destroy",function(){c&&(c.untrackElement(r.target,t),c.destroy()),r=null,c=null})}}}]).directive("bsScrollspyList",["$rootScope","debounce","dimensions","$scrollspy",function(){return{restrict:"A",compile:function(e){var t=e[0].querySelectorAll("li > a[href]");angular.forEach(t,function(e){var t=angular.element(e);t.parent().attr("bs-scrollspy","").attr("data-target",t.attr("href"))})}}}]);
9
+ //# sourceMappingURL=scrollspy.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["scrollspy/scrollspy.js"],"names":[],"mappings":"qBASQ,OAAA,4BAA2B,kCAAA,+CAE7B,aAAU,kDAMV,SAAI,IACJ,SAAI,IACJ,OAAI,oHAWE,GAAU,EAAQ,GACtB,MAAI,GAAQ,GAAA,UAAiB,EAAA,GAAU,SAAA,gBAAA,EAAA,sBAGnC,GAAW,GAGf,GAAG,GAAM,QAAW,UAAA,EAAA,EAClB,GAAM,UAAU,EAAA,QAAA,MAChB,GAAa,EAAA,EAAA,QAAA,kDAOf,MADA,GAAI,GAAA,UACA,EAAA,EAGJ,IAGI,GAAA,EAGJ,MAGE,MATE,KAIA,EAAA,EAAA,kCASF,KAAA,WAGA,KAAA,QAAY,EAG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OnC,GAAA,GAAA,QAAA,QAAA","file":"scrollspy.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.scrollspy', ['mgcrea.ngStrap.helpers.debounce', 'mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$scrollspy', function() {\n\n // Pool of registered spies\n var spies = this.$$spies = {};\n\n var defaults = this.defaults = {\n debounce: 150,\n throttle: 100,\n offset: 100\n };\n\n this.$get = function($window, $document, $rootScope, dimensions, debounce, throttle) {\n\n var windowEl = angular.element($window);\n var docEl = angular.element($document.prop('documentElement'));\n var bodyEl = angular.element($window.document.body);\n\n // Helper functions\n\n function nodeName(element, name) {\n return element[0].nodeName && element[0].nodeName.toLowerCase() === name.toLowerCase();\n }\n\n function ScrollSpyFactory(config) {\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n if(!options.element) options.element = bodyEl;\n var isWindowSpy = nodeName(options.element, 'body');\n var scrollEl = isWindowSpy ? windowEl : options.element;\n var scrollId = isWindowSpy ? 'window' : options.id;\n\n // Use existing spy\n if(spies[scrollId]) {\n spies[scrollId].$$count++;\n return spies[scrollId];\n }\n\n var $scrollspy = {};\n\n // Private vars\n var unbindViewContentLoaded, unbindIncludeContentLoaded;\n var trackedElements = $scrollspy.$trackedElements = [];\n var sortedElements = [];\n var activeTarget;\n var debouncedCheckPosition;\n var throttledCheckPosition;\n var debouncedCheckOffsets;\n var viewportHeight;\n var scrollTop;\n\n $scrollspy.init = function() {\n\n // Setup internal ref counter\n this.$$count = 1;\n\n // Bind events\n debouncedCheckPosition = debounce(this.checkPosition, options.debounce);\n throttledCheckPosition = throttle(this.checkPosition, options.throttle);\n scrollEl.on('click', this.checkPositionWithEventLoop);\n windowEl.on('resize', debouncedCheckPosition);\n scrollEl.on('scroll', throttledCheckPosition);\n\n debouncedCheckOffsets = debounce(this.checkOffsets, options.debounce);\n unbindViewContentLoaded = $rootScope.$on('$viewContentLoaded', debouncedCheckOffsets);\n unbindIncludeContentLoaded = $rootScope.$on('$includeContentLoaded', debouncedCheckOffsets);\n debouncedCheckOffsets();\n\n // Register spy for reuse\n if(scrollId) {\n spies[scrollId] = $scrollspy;\n }\n\n };\n\n $scrollspy.destroy = function() {\n\n // Check internal ref counter\n this.$$count--;\n if(this.$$count > 0) {\n return;\n }\n\n // Unbind events\n scrollEl.off('click', this.checkPositionWithEventLoop);\n windowEl.off('resize', debouncedCheckPosition);\n scrollEl.off('scroll', throttledCheckPosition);\n unbindViewContentLoaded();\n unbindIncludeContentLoaded();\n if (scrollId) {\n delete spies[scrollId];\n }\n };\n\n $scrollspy.checkPosition = function() {\n\n // Not ready yet\n if(!sortedElements.length) return;\n\n // Calculate the scroll position\n scrollTop = (isWindowSpy ? $window.pageYOffset : scrollEl.prop('scrollTop')) || 0;\n\n // Calculate the viewport height for use by the components\n viewportHeight = Math.max($window.innerHeight, docEl.prop('clientHeight'));\n\n // Activate first element if scroll is smaller\n if(scrollTop < sortedElements[0].offsetTop && activeTarget !== sortedElements[0].target) {\n return $scrollspy.$activateElement(sortedElements[0]);\n }\n\n // Activate proper element\n for (var i = sortedElements.length; i--;) {\n if(angular.isUndefined(sortedElements[i].offsetTop) || sortedElements[i].offsetTop === null) continue;\n if(activeTarget === sortedElements[i].target) continue;\n if(scrollTop < sortedElements[i].offsetTop) continue;\n if(sortedElements[i + 1] && scrollTop > sortedElements[i + 1].offsetTop) continue;\n return $scrollspy.$activateElement(sortedElements[i]);\n }\n\n };\n\n $scrollspy.checkPositionWithEventLoop = function() {\n // IE 9 throws an error if we use 'this' instead of '$scrollspy'\n // in this setTimeout call\n setTimeout($scrollspy.checkPosition, 1);\n };\n\n // Protected methods\n\n $scrollspy.$activateElement = function(element) {\n if(activeTarget) {\n var activeElement = $scrollspy.$getTrackedElement(activeTarget);\n if(activeElement) {\n activeElement.source.removeClass('active');\n if(nodeName(activeElement.source, 'li') && nodeName(activeElement.source.parent().parent(), 'li')) {\n activeElement.source.parent().parent().removeClass('active');\n }\n }\n }\n activeTarget = element.target;\n element.source.addClass('active');\n if(nodeName(element.source, 'li') && nodeName(element.source.parent().parent(), 'li')) {\n element.source.parent().parent().addClass('active');\n }\n };\n\n $scrollspy.$getTrackedElement = function(target) {\n return trackedElements.filter(function(obj) {\n return obj.target === target;\n })[0];\n };\n\n // Track offsets behavior\n\n $scrollspy.checkOffsets = function() {\n\n angular.forEach(trackedElements, function(trackedElement) {\n var targetElement = document.querySelector(trackedElement.target);\n trackedElement.offsetTop = targetElement ? dimensions.offset(targetElement).top : null;\n if(options.offset && trackedElement.offsetTop !== null) trackedElement.offsetTop -= options.offset * 1;\n });\n\n sortedElements = trackedElements\n .filter(function(el) {\n return el.offsetTop !== null;\n })\n .sort(function(a, b) {\n return a.offsetTop - b.offsetTop;\n });\n\n debouncedCheckPosition();\n\n };\n\n $scrollspy.trackElement = function(target, source) {\n trackedElements.push({target: target, source: source});\n };\n\n $scrollspy.untrackElement = function(target, source) {\n var toDelete;\n for (var i = trackedElements.length; i--;) {\n if(trackedElements[i].target === target && trackedElements[i].source === source) {\n toDelete = i;\n break;\n }\n }\n trackedElements = trackedElements.splice(toDelete, 1);\n };\n\n $scrollspy.activate = function(i) {\n trackedElements[i].addClass('active');\n };\n\n // Initialize plugin\n\n $scrollspy.init();\n return $scrollspy;\n\n }\n\n return ScrollSpyFactory;\n\n };\n\n })\n\n .directive('bsScrollspy', function($rootScope, debounce, dimensions, $scrollspy) {\n\n return {\n restrict: 'EAC',\n link: function postLink(scope, element, attr) {\n\n var options = {scope: scope};\n angular.forEach(['offset', 'target'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n var scrollspy = $scrollspy(options);\n scrollspy.trackElement(options.target, element);\n\n scope.$on('$destroy', function() {\n if (scrollspy) {\n scrollspy.untrackElement(options.target, element);\n scrollspy.destroy();\n }\n options = null;\n scrollspy = null;\n });\n\n }\n };\n\n })\n\n\n .directive('bsScrollspyList', function($rootScope, debounce, dimensions, $scrollspy) {\n\n return {\n restrict: 'A',\n compile: function postLink(element, attr) {\n var children = element[0].querySelectorAll('li > a[href]');\n angular.forEach(children, function(child) {\n var childEl = angular.element(child);\n childEl.parent().attr('bs-scrollspy', '').attr('data-target', childEl.attr('href'));\n });\n }\n\n };\n\n });\n"],"sourceRoot":"/source/"}
@@ -0,0 +1,325 @@
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.select', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])
11
+
12
+ .provider('$select', function() {
13
+
14
+ var defaults = this.defaults = {
15
+ animation: 'am-fade',
16
+ prefixClass: 'select',
17
+ prefixEvent: '$select',
18
+ placement: 'bottom-left',
19
+ template: 'select/select.tpl.html',
20
+ trigger: 'focus',
21
+ container: false,
22
+ keyboard: true,
23
+ html: false,
24
+ delay: 0,
25
+ multiple: false,
26
+ allNoneButtons: false,
27
+ sort: true,
28
+ caretHtml: '&nbsp;<span class="caret"></span>',
29
+ placeholder: 'Choose among the following...',
30
+ allText: 'All',
31
+ noneText: 'None',
32
+ maxLength: 3,
33
+ maxLengthHtml: 'selected',
34
+ iconCheckmark: 'glyphicon glyphicon-ok'
35
+ };
36
+
37
+ this.$get = ["$window", "$document", "$rootScope", "$tooltip", "$timeout", function($window, $document, $rootScope, $tooltip, $timeout) {
38
+
39
+ var bodyEl = angular.element($window.document.body);
40
+ var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);
41
+ var isTouch = ('createTouch' in $window.document) && isNative;
42
+
43
+ function SelectFactory(element, controller, config) {
44
+
45
+ var $select = {};
46
+
47
+ // Common vars
48
+ var options = angular.extend({}, defaults, config);
49
+
50
+ $select = $tooltip(element, options);
51
+ var scope = $select.$scope;
52
+
53
+ scope.$matches = [];
54
+ scope.$activeIndex = 0;
55
+ scope.$isMultiple = options.multiple;
56
+ scope.$showAllNoneButtons = options.allNoneButtons && options.multiple;
57
+ scope.$iconCheckmark = options.iconCheckmark;
58
+ scope.$allText = options.allText;
59
+ scope.$noneText = options.noneText;
60
+
61
+ scope.$activate = function(index) {
62
+ scope.$$postDigest(function() {
63
+ $select.activate(index);
64
+ });
65
+ };
66
+
67
+ scope.$select = function(index, evt) {
68
+ scope.$$postDigest(function() {
69
+ $select.select(index);
70
+ });
71
+ };
72
+
73
+ scope.$isVisible = function() {
74
+ return $select.$isVisible();
75
+ };
76
+
77
+ scope.$isActive = function(index) {
78
+ return $select.$isActive(index);
79
+ };
80
+
81
+ scope.$selectAll = function () {
82
+ for (var i = 0; i < scope.$matches.length; i++) {
83
+ if (!scope.$isActive(i)) {
84
+ scope.$select(i);
85
+ }
86
+ }
87
+ };
88
+
89
+ scope.$selectNone = function () {
90
+ for (var i = 0; i < scope.$matches.length; i++) {
91
+ if (scope.$isActive(i)) {
92
+ scope.$select(i);
93
+ }
94
+ }
95
+ };
96
+
97
+ // Public methods
98
+
99
+ $select.update = function(matches) {
100
+ scope.$matches = matches;
101
+ $select.$updateActiveIndex();
102
+ };
103
+
104
+ $select.activate = function(index) {
105
+ if(options.multiple) {
106
+ scope.$activeIndex.sort();
107
+ $select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index);
108
+ if(options.sort) scope.$activeIndex.sort();
109
+ } else {
110
+ scope.$activeIndex = index;
111
+ }
112
+ return scope.$activeIndex;
113
+ };
114
+
115
+ $select.select = function(index) {
116
+ var value = scope.$matches[index].value;
117
+ scope.$apply(function() {
118
+ $select.activate(index);
119
+ if(options.multiple) {
120
+ controller.$setViewValue(scope.$activeIndex.map(function(index) {
121
+ return scope.$matches[index].value;
122
+ }));
123
+ } else {
124
+ controller.$setViewValue(value);
125
+ // Hide if single select
126
+ $select.hide();
127
+ }
128
+ });
129
+ // Emit event
130
+ scope.$emit(options.prefixEvent + '.select', value, index, $select);
131
+ };
132
+
133
+ // Protected methods
134
+
135
+ $select.$updateActiveIndex = function() {
136
+ if(controller.$modelValue && scope.$matches.length) {
137
+ if(options.multiple && angular.isArray(controller.$modelValue)) {
138
+ scope.$activeIndex = controller.$modelValue.map(function(value) {
139
+ return $select.$getIndex(value);
140
+ });
141
+ } else {
142
+ scope.$activeIndex = $select.$getIndex(controller.$modelValue);
143
+ }
144
+ } else if(scope.$activeIndex >= scope.$matches.length) {
145
+ scope.$activeIndex = options.multiple ? [] : 0;
146
+ }
147
+ };
148
+
149
+ $select.$isVisible = function() {
150
+ if(!options.minLength || !controller) {
151
+ return scope.$matches.length;
152
+ }
153
+ // minLength support
154
+ return scope.$matches.length && controller.$viewValue.length >= options.minLength;
155
+ };
156
+
157
+ $select.$isActive = function(index) {
158
+ if(options.multiple) {
159
+ return scope.$activeIndex.indexOf(index) !== -1;
160
+ } else {
161
+ return scope.$activeIndex === index;
162
+ }
163
+ };
164
+
165
+ $select.$getIndex = function(value) {
166
+ var l = scope.$matches.length, i = l;
167
+ if(!l) return;
168
+ for(i = l; i--;) {
169
+ if(scope.$matches[i].value === value) break;
170
+ }
171
+ if(i < 0) return;
172
+ return i;
173
+ };
174
+
175
+ $select.$onMouseDown = function(evt) {
176
+ // Prevent blur on mousedown on .dropdown-menu
177
+ evt.preventDefault();
178
+ evt.stopPropagation();
179
+ // Emulate click for mobile devices
180
+ if(isTouch) {
181
+ var targetEl = angular.element(evt.target);
182
+ targetEl.triggerHandler('click');
183
+ }
184
+ };
185
+
186
+ $select.$onKeyDown = function(evt) {
187
+ if (!/(9|13|38|40)/.test(evt.keyCode)) return;
188
+ evt.preventDefault();
189
+ evt.stopPropagation();
190
+
191
+ // Select with enter
192
+ if(!options.multiple && (evt.keyCode === 13 || evt.keyCode === 9)) {
193
+ return $select.select(scope.$activeIndex);
194
+ }
195
+
196
+ // Navigate with keyboard
197
+ if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;
198
+ else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;
199
+ else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;
200
+ scope.$digest();
201
+ };
202
+
203
+ // Overrides
204
+
205
+ var _show = $select.show;
206
+ $select.show = function() {
207
+ _show();
208
+ if(options.multiple) {
209
+ $select.$element.addClass('select-multiple');
210
+ }
211
+ // use timeout to hookup the events to prevent
212
+ // event bubbling from being processed imediately.
213
+ $timeout(function() {
214
+ $select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);
215
+ if(options.keyboard) {
216
+ element.on('keydown', $select.$onKeyDown);
217
+ }
218
+ }, 0, false);
219
+ };
220
+
221
+ var _hide = $select.hide;
222
+ $select.hide = function() {
223
+ $select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);
224
+ if(options.keyboard) {
225
+ element.off('keydown', $select.$onKeyDown);
226
+ }
227
+ _hide(true);
228
+ };
229
+
230
+ return $select;
231
+
232
+ }
233
+
234
+ SelectFactory.defaults = defaults;
235
+ return SelectFactory;
236
+
237
+ }];
238
+
239
+ })
240
+
241
+ .directive('bsSelect', ["$window", "$parse", "$q", "$select", "$parseOptions", function($window, $parse, $q, $select, $parseOptions) {
242
+
243
+ var defaults = $select.defaults;
244
+
245
+ return {
246
+ restrict: 'EAC',
247
+ require: 'ngModel',
248
+ link: function postLink(scope, element, attr, controller) {
249
+
250
+ // Directive options
251
+ var options = {scope: scope, placeholder: defaults.placeholder};
252
+ angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText', 'iconCheckmark', 'autoClose', 'id'], function(key) {
253
+ if(angular.isDefined(attr[key])) options[key] = attr[key];
254
+ });
255
+
256
+ // Add support for select markup
257
+ if(element[0].nodeName.toLowerCase() === 'select') {
258
+ var inputEl = element;
259
+ inputEl.css('display', 'none');
260
+ element = angular.element('<button type="button" class="btn btn-default"></button>');
261
+ inputEl.after(element);
262
+ }
263
+
264
+ // Build proper ngOptions
265
+ var parsedOptions = $parseOptions(attr.ngOptions);
266
+
267
+ // Initialize select
268
+ var select = $select(element, controller, options);
269
+
270
+ // Watch ngOptions values before filtering for changes
271
+ var watchedOptions = parsedOptions.$match[7].replace(/\|.+/, '').trim();
272
+ scope.$watch(watchedOptions, function(newValue, oldValue) {
273
+ // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);
274
+ parsedOptions.valuesFn(scope, controller)
275
+ .then(function(values) {
276
+ select.update(values);
277
+ controller.$render();
278
+ });
279
+ }, true);
280
+
281
+ // Watch model for changes
282
+ scope.$watch(attr.ngModel, function(newValue, oldValue) {
283
+ // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue);
284
+ select.$updateActiveIndex();
285
+ controller.$render();
286
+ }, true);
287
+
288
+ // Model rendering in view
289
+ controller.$render = function () {
290
+ // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);
291
+ var selected, index;
292
+ if(options.multiple && angular.isArray(controller.$modelValue)) {
293
+ selected = controller.$modelValue.map(function(value) {
294
+ index = select.$getIndex(value);
295
+ return angular.isDefined(index) ? select.$scope.$matches[index].label : false;
296
+ }).filter(angular.isDefined);
297
+ if(selected.length > (options.maxLength || defaults.maxLength)) {
298
+ selected = selected.length + ' ' + (options.maxLengthHtml || defaults.maxLengthHtml);
299
+ } else {
300
+ selected = selected.join(', ');
301
+ }
302
+ } else {
303
+ index = select.$getIndex(controller.$modelValue);
304
+ selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false;
305
+ }
306
+ element.html((selected ? selected : options.placeholder) + defaults.caretHtml);
307
+ };
308
+
309
+ if(options.multiple){
310
+ controller.$isEmpty = function(value){
311
+ return !value || value.length === 0;
312
+ };
313
+ }
314
+
315
+ // Garbage collection
316
+ scope.$on('$destroy', function() {
317
+ if (select) select.destroy();
318
+ options = null;
319
+ select = null;
320
+ });
321
+
322
+ }
323
+ };
324
+
325
+ }]);
@@ -0,0 +1,9 @@
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.select",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$select",function(){var e=this.defaults={animation:"am-fade",prefixClass:"select",prefixEvent:"$select",placement:"bottom-left",template:"select/select.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,multiple:!1,allNoneButtons:!1,sort:!0,caretHtml:'&nbsp;<span class="caret"></span>',placeholder:"Choose among the following...",allText:"All",noneText:"None",maxLength:3,maxLengthHtml:"selected",iconCheckmark:"glyphicon glyphicon-ok"};this.$get=["$window","$document","$rootScope","$tooltip","$timeout",function(t,n,a,l,i){function o(t,n,a){var o={},c=angular.extend({},e,a);o=l(t,c);var u=o.$scope;u.$matches=[],u.$activeIndex=0,u.$isMultiple=c.multiple,u.$showAllNoneButtons=c.allNoneButtons&&c.multiple,u.$iconCheckmark=c.iconCheckmark,u.$allText=c.allText,u.$noneText=c.noneText,u.$activate=function(e){u.$$postDigest(function(){o.activate(e)})},u.$select=function(e){u.$$postDigest(function(){o.select(e)})},u.$isVisible=function(){return o.$isVisible()},u.$isActive=function(e){return o.$isActive(e)},u.$selectAll=function(){for(var e=0;e<u.$matches.length;e++)u.$isActive(e)||u.$select(e)},u.$selectNone=function(){for(var e=0;e<u.$matches.length;e++)u.$isActive(e)&&u.$select(e)},o.update=function(e){u.$matches=e,o.$updateActiveIndex()},o.activate=function(e){return c.multiple?(u.$activeIndex.sort(),o.$isActive(e)?u.$activeIndex.splice(u.$activeIndex.indexOf(e),1):u.$activeIndex.push(e),c.sort&&u.$activeIndex.sort()):u.$activeIndex=e,u.$activeIndex},o.select=function(e){var t=u.$matches[e].value;u.$apply(function(){o.activate(e),c.multiple?n.$setViewValue(u.$activeIndex.map(function(e){return u.$matches[e].value})):(n.$setViewValue(t),o.hide())}),u.$emit(c.prefixEvent+".select",t,e,o)},o.$updateActiveIndex=function(){n.$modelValue&&u.$matches.length?u.$activeIndex=c.multiple&&angular.isArray(n.$modelValue)?n.$modelValue.map(function(e){return o.$getIndex(e)}):o.$getIndex(n.$modelValue):u.$activeIndex>=u.$matches.length&&(u.$activeIndex=c.multiple?[]:0)},o.$isVisible=function(){return c.minLength&&n?u.$matches.length&&n.$viewValue.length>=c.minLength:u.$matches.length},o.$isActive=function(e){return c.multiple?-1!==u.$activeIndex.indexOf(e):u.$activeIndex===e},o.$getIndex=function(e){var t=u.$matches.length,n=t;if(t){for(n=t;n--&&u.$matches[n].value!==e;);if(!(0>n))return n}},o.$onMouseDown=function(e){if(e.preventDefault(),e.stopPropagation(),r){var t=angular.element(e.target);t.triggerHandler("click")}},o.$onKeyDown=function(e){if(/(9|13|38|40)/.test(e.keyCode)){if(e.preventDefault(),e.stopPropagation(),!c.multiple&&(13===e.keyCode||9===e.keyCode))return o.select(u.$activeIndex);38===e.keyCode&&u.$activeIndex>0?u.$activeIndex--:40===e.keyCode&&u.$activeIndex<u.$matches.length-1?u.$activeIndex++:angular.isUndefined(u.$activeIndex)&&(u.$activeIndex=0),u.$digest()}};var s=o.show;o.show=function(){s(),c.multiple&&o.$element.addClass("select-multiple"),i(function(){o.$element.on(r?"touchstart":"mousedown",o.$onMouseDown),c.keyboard&&t.on("keydown",o.$onKeyDown)},0,!1)};var $=o.hide;return o.hide=function(){o.$element.off(r?"touchstart":"mousedown",o.$onMouseDown),c.keyboard&&t.off("keydown",o.$onKeyDown),$(!0)},o}var c=(angular.element(t.document.body),/(ip(a|o)d|iphone|android)/gi.test(t.navigator.userAgent)),r="createTouch"in t.document&&c;return o.defaults=e,o}]}).directive("bsSelect",["$window","$parse","$q","$select","$parseOptions",function(e,t,n,a,l){var i=a.defaults;return{restrict:"EAC",require:"ngModel",link:function(e,t,n,o){var c={scope:e,placeholder:i.placeholder};if(angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","placeholder","multiple","allNoneButtons","maxLength","maxLengthHtml","allText","noneText","iconCheckmark","autoClose","id"],function(e){angular.isDefined(n[e])&&(c[e]=n[e])}),"select"===t[0].nodeName.toLowerCase()){var r=t;r.css("display","none"),t=angular.element('<button type="button" class="btn btn-default"></button>'),r.after(t)}var u=l(n.ngOptions),s=a(t,o,c),$=u.$match[7].replace(/\|.+/,"").trim();e.$watch($,function(){u.valuesFn(e,o).then(function(e){s.update(e),o.$render()})},!0),e.$watch(n.ngModel,function(){s.$updateActiveIndex(),o.$render()},!0),o.$render=function(){var e,n;c.multiple&&angular.isArray(o.$modelValue)?(e=o.$modelValue.map(function(e){return n=s.$getIndex(e),angular.isDefined(n)?s.$scope.$matches[n].label:!1}).filter(angular.isDefined),e=e.length>(c.maxLength||i.maxLength)?e.length+" "+(c.maxLengthHtml||i.maxLengthHtml):e.join(", ")):(n=s.$getIndex(o.$modelValue),e=angular.isDefined(n)?s.$scope.$matches[n].label:!1),t.html((e?e:c.placeholder)+i.caretHtml)},c.multiple&&(o.$isEmpty=function(e){return!e||0===e.length}),e.$on("$destroy",function(){s&&s.destroy(),c=null,s=null})}}}]);
9
+ //# sourceMappingURL=select.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["select/select.js"],"names":[],"mappings":"qBASM,OAAA,yBAAa,yBAAA,iDAEb,UAAU,cAEV,GAAW,KAAA,UACX,UAAU,UACV,YAAM,SACN,YAAO,UACP,UAAU,cACV,SAAA,yBACA,QAAM,QACN,WAAW,EACX,UAAA,EACA,MAAA,EACA,MAAA,EACA,UAAA,EACA,gBAAe,EACf,MAAA,4FAGF,QAAK,sBAEH,UAAI,EACJ,cAAe,WACf,cAAe,0H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.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.select', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\n\n .provider('$select', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'select',\n prefixEvent: '$select',\n placement: 'bottom-left',\n template: 'select/select.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n multiple: false,\n allNoneButtons: false,\n sort: true,\n caretHtml: '&nbsp;<span class=\"caret\"></span>',\n placeholder: 'Choose among the following...',\n allText: 'All',\n noneText: 'None',\n maxLength: 3,\n maxLengthHtml: 'selected',\n iconCheckmark: 'glyphicon glyphicon-ok'\n };\n\n this.$get = function($window, $document, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n var isNative = /(ip(a|o)d|iphone|android)/ig.test($window.navigator.userAgent);\n var isTouch = ('createTouch' in $window.document) && isNative;\n\n function SelectFactory(element, controller, config) {\n\n var $select = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $select = $tooltip(element, options);\n var scope = $select.$scope;\n\n scope.$matches = [];\n scope.$activeIndex = 0;\n scope.$isMultiple = options.multiple;\n scope.$showAllNoneButtons = options.allNoneButtons && options.multiple;\n scope.$iconCheckmark = options.iconCheckmark;\n scope.$allText = options.allText;\n scope.$noneText = options.noneText;\n\n scope.$activate = function(index) {\n scope.$$postDigest(function() {\n $select.activate(index);\n });\n };\n\n scope.$select = function(index, evt) {\n scope.$$postDigest(function() {\n $select.select(index);\n });\n };\n\n scope.$isVisible = function() {\n return $select.$isVisible();\n };\n\n scope.$isActive = function(index) {\n return $select.$isActive(index);\n };\n\n scope.$selectAll = function () {\n for (var i = 0; i < scope.$matches.length; i++) {\n if (!scope.$isActive(i)) {\n scope.$select(i);\n }\n }\n };\n\n scope.$selectNone = function () {\n for (var i = 0; i < scope.$matches.length; i++) {\n if (scope.$isActive(i)) {\n scope.$select(i);\n }\n }\n };\n\n // Public methods\n\n $select.update = function(matches) {\n scope.$matches = matches;\n $select.$updateActiveIndex();\n };\n\n $select.activate = function(index) {\n if(options.multiple) {\n scope.$activeIndex.sort();\n $select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index);\n if(options.sort) scope.$activeIndex.sort();\n } else {\n scope.$activeIndex = index;\n }\n return scope.$activeIndex;\n };\n\n $select.select = function(index) {\n var value = scope.$matches[index].value;\n scope.$apply(function() {\n $select.activate(index);\n if(options.multiple) {\n controller.$setViewValue(scope.$activeIndex.map(function(index) {\n return scope.$matches[index].value;\n }));\n } else {\n controller.$setViewValue(value);\n // Hide if single select\n $select.hide();\n }\n });\n // Emit event\n scope.$emit(options.prefixEvent + '.select', value, index, $select);\n };\n\n // Protected methods\n\n $select.$updateActiveIndex = function() {\n if(controller.$modelValue && scope.$matches.length) {\n if(options.multiple && angular.isArray(controller.$modelValue)) {\n scope.$activeIndex = controller.$modelValue.map(function(value) {\n return $select.$getIndex(value);\n });\n } else {\n scope.$activeIndex = $select.$getIndex(controller.$modelValue);\n }\n } else if(scope.$activeIndex >= scope.$matches.length) {\n scope.$activeIndex = options.multiple ? [] : 0;\n }\n };\n\n $select.$isVisible = function() {\n if(!options.minLength || !controller) {\n return scope.$matches.length;\n }\n // minLength support\n return scope.$matches.length && controller.$viewValue.length >= options.minLength;\n };\n\n $select.$isActive = function(index) {\n if(options.multiple) {\n return scope.$activeIndex.indexOf(index) !== -1;\n } else {\n return scope.$activeIndex === index;\n }\n };\n\n $select.$getIndex = function(value) {\n var l = scope.$matches.length, i = l;\n if(!l) return;\n for(i = l; i--;) {\n if(scope.$matches[i].value === value) break;\n }\n if(i < 0) return;\n return i;\n };\n\n $select.$onMouseDown = function(evt) {\n // Prevent blur on mousedown on .dropdown-menu\n evt.preventDefault();\n evt.stopPropagation();\n // Emulate click for mobile devices\n if(isTouch) {\n var targetEl = angular.element(evt.target);\n targetEl.triggerHandler('click');\n }\n };\n\n $select.$onKeyDown = function(evt) {\n if (!/(9|13|38|40)/.test(evt.keyCode)) return;\n evt.preventDefault();\n evt.stopPropagation();\n\n // Select with enter\n if(!options.multiple && (evt.keyCode === 13 || evt.keyCode === 9)) {\n return $select.select(scope.$activeIndex);\n }\n\n // Navigate with keyboard\n if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\n scope.$digest();\n };\n\n // Overrides\n\n var _show = $select.show;\n $select.show = function() {\n _show();\n if(options.multiple) {\n $select.$element.addClass('select-multiple');\n }\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n $select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $select.$onKeyDown);\n }\n }, 0, false);\n };\n\n var _hide = $select.hide;\n $select.hide = function() {\n $select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $select.$onKeyDown);\n }\n _hide(true);\n };\n\n return $select;\n\n }\n\n SelectFactory.defaults = defaults;\n return SelectFactory;\n\n };\n\n })\n\n .directive('bsSelect', function($window, $parse, $q, $select, $parseOptions) {\n\n var defaults = $select.defaults;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope, placeholder: defaults.placeholder};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText', 'iconCheckmark', 'autoClose', 'id'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Add support for select markup\n if(element[0].nodeName.toLowerCase() === 'select') {\n var inputEl = element;\n inputEl.css('display', 'none');\n element = angular.element('<button type=\"button\" class=\"btn btn-default\"></button>');\n inputEl.after(element);\n }\n\n // Build proper ngOptions\n var parsedOptions = $parseOptions(attr.ngOptions);\n\n // Initialize select\n var select = $select(element, controller, options);\n\n // Watch ngOptions values before filtering for changes\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').trim();\n scope.$watch(watchedOptions, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\n parsedOptions.valuesFn(scope, controller)\n .then(function(values) {\n select.update(values);\n controller.$render();\n });\n }, true);\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue);\n select.$updateActiveIndex();\n controller.$render();\n }, true);\n\n // Model rendering in view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n var selected, index;\n if(options.multiple && angular.isArray(controller.$modelValue)) {\n selected = controller.$modelValue.map(function(value) {\n index = select.$getIndex(value);\n return angular.isDefined(index) ? select.$scope.$matches[index].label : false;\n }).filter(angular.isDefined);\n if(selected.length > (options.maxLength || defaults.maxLength)) {\n selected = selected.length + ' ' + (options.maxLengthHtml || defaults.maxLengthHtml);\n } else {\n selected = selected.join(', ');\n }\n } else {\n index = select.$getIndex(controller.$modelValue);\n selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false;\n }\n element.html((selected ? selected : options.placeholder) + defaults.caretHtml);\n };\n\n if(options.multiple){\n controller.$isEmpty = function(value){\n return !value || value.length === 0;\n };\n }\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (select) select.destroy();\n options = null;\n select = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
@@ -0,0 +1,14 @@
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.select').run(['$templateCache', function($templateCache) {
11
+
12
+ $templateCache.put('select/select.tpl.html', '<ul tabindex="-1" class="select dropdown-menu" ng-show="$isVisible()" role="select"><li ng-if="$showAllNoneButtons"><div class="btn-group" style="margin-bottom: 5px; margin-left: 5px"><button type="button" class="btn btn-default btn-xs" ng-click="$selectAll()">{{$allText}}</button> <button type="button" class="btn btn-default btn-xs" ng-click="$selectNone()">{{$noneText}}</button></div></li><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $isActive($index)}"><a style="cursor: default" role="menuitem" tabindex="-1" ng-click="$select($index, $event)"><i class="{{$iconCheckmark}} pull-right" ng-if="$isMultiple && $isActive($index)"></i> <span ng-bind="match.label"></span></a></li></ul>');
13
+
14
+ }]);
@@ -0,0 +1,8 @@
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.select").run(["$templateCache",function(t){t.put("select/select.tpl.html",'<ul tabindex="-1" class="select dropdown-menu" ng-show="$isVisible()" role="select"><li ng-if="$showAllNoneButtons"><div class="btn-group" style="margin-bottom: 5px; margin-left: 5px"><button type="button" class="btn btn-default btn-xs" ng-click="$selectAll()">{{$allText}}</button> <button type="button" class="btn btn-default btn-xs" ng-click="$selectNone()">{{$noneText}}</button></div></li><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $isActive($index)}"><a style="cursor: default" role="menuitem" tabindex="-1" ng-click="$select($index, $event)"><i class="{{$iconCheckmark}} pull-right" ng-if="$isMultiple && $isActive($index)"></i> <span ng-bind="match.label"></span></a></li></ul>')}]);
@@ -0,0 +1,186 @@
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.tab', [])
11
+
12
+ .provider('$tab', function() {
13
+
14
+ var defaults = this.defaults = {
15
+ animation: 'am-fade',
16
+ template: 'tab/tab.tpl.html',
17
+ navClass: 'nav-tabs',
18
+ activeClass: 'active'
19
+ };
20
+
21
+ var controller = this.controller = function($scope, $element, $attrs) {
22
+ var self = this;
23
+
24
+ // Attributes options
25
+ self.$options = angular.copy(defaults);
26
+ angular.forEach(['animation', 'navClass', 'activeClass'], function(key) {
27
+ if(angular.isDefined($attrs[key])) self.$options[key] = $attrs[key];
28
+ });
29
+
30
+ // Publish options on scope
31
+ $scope.$navClass = self.$options.navClass;
32
+ $scope.$activeClass = self.$options.activeClass;
33
+
34
+ self.$panes = $scope.$panes = [];
35
+
36
+ // DEPRECATED: $viewChangeListeners, please use $activePaneChangeListeners
37
+ // Because we deprecated ngModel usage, we rename viewChangeListeners to
38
+ // activePaneChangeListeners to make more sense.
39
+ self.$activePaneChangeListeners = self.$viewChangeListeners = [];
40
+
41
+ self.$push = function(pane) {
42
+ self.$panes.push(pane);
43
+ };
44
+
45
+ self.$remove = function(pane) {
46
+ var index = self.$panes.indexOf(pane);
47
+ var activeIndex = self.$panes.$active;
48
+
49
+ // remove pane from $panes array
50
+ self.$panes.splice(index, 1);
51
+
52
+ if (index < activeIndex) {
53
+ // we removed a pane before the active pane, so we need to
54
+ // decrement the active pane index
55
+ activeIndex--;
56
+ }
57
+ else if (index === activeIndex && activeIndex === self.$panes.length) {
58
+ // we remove the active pane and it was the one at the end,
59
+ // so select the previous one
60
+ activeIndex--;
61
+ }
62
+ self.$setActive(activeIndex);
63
+ };
64
+
65
+ self.$panes.$active = 0;
66
+ self.$setActive = $scope.$setActive = function(value) {
67
+ self.$panes.$active = value;
68
+ self.$activePaneChangeListeners.forEach(function(fn) {
69
+ fn();
70
+ });
71
+ };
72
+
73
+ };
74
+
75
+ this.$get = function() {
76
+ var $tab = {};
77
+ $tab.defaults = defaults;
78
+ $tab.controller = controller;
79
+ return $tab;
80
+ };
81
+
82
+ })
83
+
84
+ .directive('bsTabs', ["$window", "$animate", "$tab", "$parse", function($window, $animate, $tab, $parse) {
85
+
86
+ var defaults = $tab.defaults;
87
+
88
+ return {
89
+ require: ['?ngModel', 'bsTabs'],
90
+ transclude: true,
91
+ scope: true,
92
+ controller: ['$scope', '$element', '$attrs', $tab.controller],
93
+ templateUrl: function(element, attr) {
94
+ return attr.template || defaults.template;
95
+ },
96
+ link: function postLink(scope, element, attrs, controllers) {
97
+
98
+ var ngModelCtrl = controllers[0];
99
+ var bsTabsCtrl = controllers[1];
100
+
101
+ // DEPRECATED: ngModel, please use bsActivePane
102
+ // 'ngModel' is deprecated bacause if interferes with form validation
103
+ // and status, so avoid using it here.
104
+ if(ngModelCtrl) {
105
+ console.warn('Usage of ngModel is deprecated, please use bsActivePane instead!');
106
+
107
+ // Update the modelValue following
108
+ bsTabsCtrl.$activePaneChangeListeners.push(function() {
109
+ ngModelCtrl.$setViewValue(bsTabsCtrl.$panes.$active);
110
+ });
111
+
112
+ // modelValue -> $formatters -> viewValue
113
+ ngModelCtrl.$formatters.push(function(modelValue) {
114
+ // console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
115
+ bsTabsCtrl.$setActive(modelValue * 1);
116
+ return modelValue;
117
+ });
118
+
119
+ }
120
+
121
+ if (attrs.bsActivePane) {
122
+ // adapted from angularjs ngModelController bindings
123
+ // https://github.com/angular/angular.js/blob/v1.3.1/src%2Fng%2Fdirective%2Finput.js#L1730
124
+ var parsedBsActivePane = $parse(attrs.bsActivePane);
125
+
126
+ // Update bsActivePane value with change
127
+ bsTabsCtrl.$activePaneChangeListeners.push(function() {
128
+ parsedBsActivePane.assign(scope, bsTabsCtrl.$panes.$active);
129
+ });
130
+
131
+ // watch bsActivePane for value changes
132
+ scope.$watch(attrs.bsActivePane, function(newValue, oldValue) {
133
+ bsTabsCtrl.$setActive(newValue * 1);
134
+ }, true);
135
+ }
136
+ }
137
+ };
138
+
139
+ }])
140
+
141
+ .directive('bsPane', ["$window", "$animate", "$sce", function($window, $animate, $sce) {
142
+
143
+ return {
144
+ require: ['^?ngModel', '^bsTabs'],
145
+ scope: true,
146
+ link: function postLink(scope, element, attrs, controllers) {
147
+
148
+ var ngModelCtrl = controllers[0];
149
+ var bsTabsCtrl = controllers[1];
150
+
151
+ // Add base class
152
+ element.addClass('tab-pane');
153
+
154
+ // Observe title attribute for change
155
+ attrs.$observe('title', function(newValue, oldValue) {
156
+ scope.title = $sce.trustAsHtml(newValue);
157
+ });
158
+
159
+ // Add animation class
160
+ if(bsTabsCtrl.$options.animation) {
161
+ element.addClass(bsTabsCtrl.$options.animation);
162
+ }
163
+
164
+ // Push pane to parent bsTabs controller
165
+ bsTabsCtrl.$push(scope);
166
+
167
+ // remove pane from tab controller when pane is destroyed
168
+ scope.$on('$destroy', function() {
169
+ bsTabsCtrl.$remove(scope);
170
+ });
171
+
172
+ function render() {
173
+ var index = bsTabsCtrl.$panes.indexOf(scope);
174
+ var active = bsTabsCtrl.$panes.$active;
175
+ $animate[index === active ? 'addClass' : 'removeClass'](element, bsTabsCtrl.$options.activeClass);
176
+ }
177
+
178
+ bsTabsCtrl.$activePaneChangeListeners.push(function() {
179
+ render();
180
+ });
181
+ render();
182
+
183
+ }
184
+ };
185
+
186
+ }]);