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-02-08
|
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
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["scrollspy.min.js"],"names":["angular","module","provider","spies","this","$$spies","defaults","debounce","throttle","offset","$get","$window","$document","$rootScope","dimensions","nodeName","element","name","toLowerCase","ScrollSpyFactory","config","options","extend","bodyEl","isWindowSpy","scrollEl","windowEl","scrollId","id","$$count","unbindViewContentLoaded","unbindIncludeContentLoaded","activeTarget","debouncedCheckPosition","throttledCheckPosition","debouncedCheckOffsets","viewportHeight","scrollTop","$scrollspy","trackedElements","$trackedElements","sortedElements","init","checkPosition","on","checkPositionWithEventLoop","checkOffsets","$on","destroy","off","length","pageYOffset","prop","Math","max","innerHeight","docEl","offsetTop","target","$activateElement","i","isUndefined","setTimeout","activeElement","$getTrackedElement","source","removeClass","parent","addClass","filter","obj","forEach","trackedElement","targetElement","document","querySelector","top","el","sort","a","b","trackElement","push","untrackElement","toDelete","splice","activate","body","directive","restrict","link","scope","attr","key","isDefined","scrollspy","compile","children","querySelectorAll","child","childEl"],"mappings":"AAOA,YAEAA,SAAQC,OAAO,4BAA6B,kCAAmC,sCAE5EC,SAAS,aAAc,WAGtB,GAAIC,GAAQC,KAAKC,WAEbC,EAAWF,KAAKE,UAClBC,SAAU,IACVC,SAAU,IACVC,OAAQ,IAGVL,MAAKM,MAAQ,UAAW,YAAa,aAAc,aAAc,WAAY,WAAY,SAASC,EAASC,EAAWC,EAAYC,EAAYP,EAAUC,G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AY,aAAc,aAAc,WAEnF,OACEC,SAAU,IACVO,QAAS,SAAkBhF,GACzB,GAAIiF,GAAWjF,EAAQ,GAAGkF,iBAAiB,eAC3ClG,SAAQuE,QAAQ0B,EAAU,SAASE,GACjC,GAAIC,GAAUpG,QAAQgB,QAAQmF,EAC9BC,GAAQjC,SAASyB,KAAK,eAAgB,IAAIA,KAAK,cAAeQ,EAAQR,KAAK","file":"scrollspy.min.js","sourcesContent":[null],"sourceRoot":"/source/"}
|
@@ -1,328 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-02-08
|
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: ' <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
|
-
// parse sort option value to support attribute as string
|
51
|
-
// when binded to interpolated value
|
52
|
-
options.sort = options.sort.toString().match(/true|1/i);
|
53
|
-
|
54
|
-
$select = $tooltip(element, options);
|
55
|
-
var scope = $select.$scope;
|
56
|
-
|
57
|
-
scope.$matches = [];
|
58
|
-
scope.$activeIndex = 0;
|
59
|
-
scope.$isMultiple = options.multiple;
|
60
|
-
scope.$showAllNoneButtons = options.allNoneButtons && options.multiple;
|
61
|
-
scope.$iconCheckmark = options.iconCheckmark;
|
62
|
-
scope.$allText = options.allText;
|
63
|
-
scope.$noneText = options.noneText;
|
64
|
-
|
65
|
-
scope.$activate = function(index) {
|
66
|
-
scope.$$postDigest(function() {
|
67
|
-
$select.activate(index);
|
68
|
-
});
|
69
|
-
};
|
70
|
-
|
71
|
-
scope.$select = function(index, evt) {
|
72
|
-
scope.$$postDigest(function() {
|
73
|
-
$select.select(index);
|
74
|
-
});
|
75
|
-
};
|
76
|
-
|
77
|
-
scope.$isVisible = function() {
|
78
|
-
return $select.$isVisible();
|
79
|
-
};
|
80
|
-
|
81
|
-
scope.$isActive = function(index) {
|
82
|
-
return $select.$isActive(index);
|
83
|
-
};
|
84
|
-
|
85
|
-
scope.$selectAll = function () {
|
86
|
-
for (var i = 0; i < scope.$matches.length; i++) {
|
87
|
-
if (!scope.$isActive(i)) {
|
88
|
-
scope.$select(i);
|
89
|
-
}
|
90
|
-
}
|
91
|
-
};
|
92
|
-
|
93
|
-
scope.$selectNone = function () {
|
94
|
-
for (var i = 0; i < scope.$matches.length; i++) {
|
95
|
-
if (scope.$isActive(i)) {
|
96
|
-
scope.$select(i);
|
97
|
-
}
|
98
|
-
}
|
99
|
-
};
|
100
|
-
|
101
|
-
// Public methods
|
102
|
-
|
103
|
-
$select.update = function(matches) {
|
104
|
-
scope.$matches = matches;
|
105
|
-
$select.$updateActiveIndex();
|
106
|
-
};
|
107
|
-
|
108
|
-
$select.activate = function(index) {
|
109
|
-
if(options.multiple) {
|
110
|
-
$select.$isActive(index) ? scope.$activeIndex.splice(scope.$activeIndex.indexOf(index), 1) : scope.$activeIndex.push(index);
|
111
|
-
if(options.sort) scope.$activeIndex.sort();
|
112
|
-
} else {
|
113
|
-
scope.$activeIndex = index;
|
114
|
-
}
|
115
|
-
return scope.$activeIndex;
|
116
|
-
};
|
117
|
-
|
118
|
-
$select.select = function(index) {
|
119
|
-
var value = scope.$matches[index].value;
|
120
|
-
scope.$apply(function() {
|
121
|
-
$select.activate(index);
|
122
|
-
if(options.multiple) {
|
123
|
-
controller.$setViewValue(scope.$activeIndex.map(function(index) {
|
124
|
-
return scope.$matches[index].value;
|
125
|
-
}));
|
126
|
-
} else {
|
127
|
-
controller.$setViewValue(value);
|
128
|
-
// Hide if single select
|
129
|
-
$select.hide();
|
130
|
-
}
|
131
|
-
});
|
132
|
-
// Emit event
|
133
|
-
scope.$emit(options.prefixEvent + '.select', value, index, $select);
|
134
|
-
};
|
135
|
-
|
136
|
-
// Protected methods
|
137
|
-
|
138
|
-
$select.$updateActiveIndex = function() {
|
139
|
-
if(controller.$modelValue && scope.$matches.length) {
|
140
|
-
if(options.multiple && angular.isArray(controller.$modelValue)) {
|
141
|
-
scope.$activeIndex = controller.$modelValue.map(function(value) {
|
142
|
-
return $select.$getIndex(value);
|
143
|
-
});
|
144
|
-
} else {
|
145
|
-
scope.$activeIndex = $select.$getIndex(controller.$modelValue);
|
146
|
-
}
|
147
|
-
} else if(scope.$activeIndex >= scope.$matches.length) {
|
148
|
-
scope.$activeIndex = options.multiple ? [] : 0;
|
149
|
-
}
|
150
|
-
};
|
151
|
-
|
152
|
-
$select.$isVisible = function() {
|
153
|
-
if(!options.minLength || !controller) {
|
154
|
-
return scope.$matches.length;
|
155
|
-
}
|
156
|
-
// minLength support
|
157
|
-
return scope.$matches.length && controller.$viewValue.length >= options.minLength;
|
158
|
-
};
|
159
|
-
|
160
|
-
$select.$isActive = function(index) {
|
161
|
-
if(options.multiple) {
|
162
|
-
return scope.$activeIndex.indexOf(index) !== -1;
|
163
|
-
} else {
|
164
|
-
return scope.$activeIndex === index;
|
165
|
-
}
|
166
|
-
};
|
167
|
-
|
168
|
-
$select.$getIndex = function(value) {
|
169
|
-
var l = scope.$matches.length, i = l;
|
170
|
-
if(!l) return;
|
171
|
-
for(i = l; i--;) {
|
172
|
-
if(scope.$matches[i].value === value) break;
|
173
|
-
}
|
174
|
-
if(i < 0) return;
|
175
|
-
return i;
|
176
|
-
};
|
177
|
-
|
178
|
-
$select.$onMouseDown = function(evt) {
|
179
|
-
// Prevent blur on mousedown on .dropdown-menu
|
180
|
-
evt.preventDefault();
|
181
|
-
evt.stopPropagation();
|
182
|
-
// Emulate click for mobile devices
|
183
|
-
if(isTouch) {
|
184
|
-
var targetEl = angular.element(evt.target);
|
185
|
-
targetEl.triggerHandler('click');
|
186
|
-
}
|
187
|
-
};
|
188
|
-
|
189
|
-
$select.$onKeyDown = function(evt) {
|
190
|
-
if (!/(9|13|38|40)/.test(evt.keyCode)) return;
|
191
|
-
evt.preventDefault();
|
192
|
-
evt.stopPropagation();
|
193
|
-
|
194
|
-
// Select with enter
|
195
|
-
if(!options.multiple && (evt.keyCode === 13 || evt.keyCode === 9)) {
|
196
|
-
return $select.select(scope.$activeIndex);
|
197
|
-
}
|
198
|
-
|
199
|
-
// Navigate with keyboard
|
200
|
-
if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;
|
201
|
-
else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;
|
202
|
-
else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;
|
203
|
-
scope.$digest();
|
204
|
-
};
|
205
|
-
|
206
|
-
// Overrides
|
207
|
-
|
208
|
-
var _show = $select.show;
|
209
|
-
$select.show = function() {
|
210
|
-
_show();
|
211
|
-
if(options.multiple) {
|
212
|
-
$select.$element.addClass('select-multiple');
|
213
|
-
}
|
214
|
-
// use timeout to hookup the events to prevent
|
215
|
-
// event bubbling from being processed imediately.
|
216
|
-
$timeout(function() {
|
217
|
-
$select.$element.on(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);
|
218
|
-
if(options.keyboard) {
|
219
|
-
element.on('keydown', $select.$onKeyDown);
|
220
|
-
}
|
221
|
-
}, 0, false);
|
222
|
-
};
|
223
|
-
|
224
|
-
var _hide = $select.hide;
|
225
|
-
$select.hide = function() {
|
226
|
-
$select.$element.off(isTouch ? 'touchstart' : 'mousedown', $select.$onMouseDown);
|
227
|
-
if(options.keyboard) {
|
228
|
-
element.off('keydown', $select.$onKeyDown);
|
229
|
-
}
|
230
|
-
_hide(true);
|
231
|
-
};
|
232
|
-
|
233
|
-
return $select;
|
234
|
-
|
235
|
-
}
|
236
|
-
|
237
|
-
SelectFactory.defaults = defaults;
|
238
|
-
return SelectFactory;
|
239
|
-
|
240
|
-
}];
|
241
|
-
|
242
|
-
})
|
243
|
-
|
244
|
-
.directive('bsSelect', ["$window", "$parse", "$q", "$select", "$parseOptions", function($window, $parse, $q, $select, $parseOptions) {
|
245
|
-
|
246
|
-
var defaults = $select.defaults;
|
247
|
-
|
248
|
-
return {
|
249
|
-
restrict: 'EAC',
|
250
|
-
require: 'ngModel',
|
251
|
-
link: function postLink(scope, element, attr, controller) {
|
252
|
-
|
253
|
-
// Directive options
|
254
|
-
var options = {scope: scope, placeholder: defaults.placeholder};
|
255
|
-
angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'placeholder', 'multiple', 'allNoneButtons', 'maxLength', 'maxLengthHtml', 'allText', 'noneText', 'iconCheckmark', 'autoClose', 'id', 'sort'], function(key) {
|
256
|
-
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
257
|
-
});
|
258
|
-
|
259
|
-
// Add support for select markup
|
260
|
-
if(element[0].nodeName.toLowerCase() === 'select') {
|
261
|
-
var inputEl = element;
|
262
|
-
inputEl.css('display', 'none');
|
263
|
-
element = angular.element('<button type="button" class="btn btn-default"></button>');
|
264
|
-
inputEl.after(element);
|
265
|
-
}
|
266
|
-
|
267
|
-
// Build proper ngOptions
|
268
|
-
var parsedOptions = $parseOptions(attr.ngOptions);
|
269
|
-
|
270
|
-
// Initialize select
|
271
|
-
var select = $select(element, controller, options);
|
272
|
-
|
273
|
-
// Watch ngOptions values before filtering for changes
|
274
|
-
var watchedOptions = parsedOptions.$match[7].replace(/\|.+/, '').trim();
|
275
|
-
scope.$watch(watchedOptions, function(newValue, oldValue) {
|
276
|
-
// console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);
|
277
|
-
parsedOptions.valuesFn(scope, controller)
|
278
|
-
.then(function(values) {
|
279
|
-
select.update(values);
|
280
|
-
controller.$render();
|
281
|
-
});
|
282
|
-
}, true);
|
283
|
-
|
284
|
-
// Watch model for changes
|
285
|
-
scope.$watch(attr.ngModel, function(newValue, oldValue) {
|
286
|
-
// console.warn('scope.$watch(%s)', attr.ngModel, newValue, oldValue);
|
287
|
-
select.$updateActiveIndex();
|
288
|
-
controller.$render();
|
289
|
-
}, true);
|
290
|
-
|
291
|
-
// Model rendering in view
|
292
|
-
controller.$render = function () {
|
293
|
-
// console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);
|
294
|
-
var selected, index;
|
295
|
-
if(options.multiple && angular.isArray(controller.$modelValue)) {
|
296
|
-
selected = controller.$modelValue.map(function(value) {
|
297
|
-
index = select.$getIndex(value);
|
298
|
-
return angular.isDefined(index) ? select.$scope.$matches[index].label : false;
|
299
|
-
}).filter(angular.isDefined);
|
300
|
-
if(selected.length > (options.maxLength || defaults.maxLength)) {
|
301
|
-
selected = selected.length + ' ' + (options.maxLengthHtml || defaults.maxLengthHtml);
|
302
|
-
} else {
|
303
|
-
selected = selected.join(', ');
|
304
|
-
}
|
305
|
-
} else {
|
306
|
-
index = select.$getIndex(controller.$modelValue);
|
307
|
-
selected = angular.isDefined(index) ? select.$scope.$matches[index].label : false;
|
308
|
-
}
|
309
|
-
element.html((selected ? selected : options.placeholder) + defaults.caretHtml);
|
310
|
-
};
|
311
|
-
|
312
|
-
if(options.multiple){
|
313
|
-
controller.$isEmpty = function(value){
|
314
|
-
return !value || value.length === 0;
|
315
|
-
};
|
316
|
-
}
|
317
|
-
|
318
|
-
// Garbage collection
|
319
|
-
scope.$on('$destroy', function() {
|
320
|
-
if (select) select.destroy();
|
321
|
-
options = null;
|
322
|
-
select = null;
|
323
|
-
});
|
324
|
-
|
325
|
-
}
|
326
|
-
};
|
327
|
-
|
328
|
-
}]);
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-02-08
|
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:' <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);c.sort=c.sort.toString().match(/true|1/i),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?(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","sort"],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
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["select.min.js"],"names":["angular","module","provider","defaults","this","animation","prefixClass","prefixEvent","placement","template","trigger","container","keyboard","html","delay","multiple","allNoneButtons","sort","caretHtml","placeholder","allText","noneText","maxLength","maxLengthHtml","iconCheckmark","$get","$window","$document","$rootScope","$tooltip","$timeout","SelectFactory","element","controller","config","$select","options","extend","toString","match","scope","$scope","$matches","$activeIndex","$isMultiple","$showAllNoneButtons","$iconCheckmark","$allText","$noneText","$activate","index","$$postDigest","activate","select","$isVisible","$isActive","$selectAll","i","length","$selectNone","update","matches","$updateActiveIndex","splice","indexOf","push","value","$apply","$setViewValue","map","hide","$emit","$modelValue","isArray","$getIndex","minLength","$viewValue","l","$onMouseDown","evt","preventDefault","stopPropagation","isTouch","targetEl","target","triggerHandler","$onKeyDown","test","keyCode","isUndefined","$digest","_show","show","$element","addClass","on","_hide","off","isNative","document","body","navigator","userAgent","directive","$parse","$q","$parseOptions","restrict","require","link","attr","forEach","key","isDefined","nodeName","toLowerCase","inputEl","css","after","parsedOptions","ngOptions","watchedOptions","$match","replace","trim","$watch","valuesFn","then","values","$render","ngModel","selected","label","filter","join","$isEmpty","$on","destroy"],"mappings":"AAOA,YAEAA,SAAQC,OAAO,yBAA0B,yBAA0B,wCAEhEC,SAAS,UAAW,WAEnB,GAAIC,GAAWC,KAAKD,UAClBE,UAAW,UACXC,YAAa,SACbC,YAAa,UACbC,UAAW,cACXC,SAAU,yBACVC,QAAS,QACTC,WAAW,EACX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,GAASG,EAAOZ,OAAOC,SAASQ,GAAOkF,OAAQ,IACvEC,OAAOrI,QAAQiH,WAEhBkB,EADCA,EAASzE,QAAUtB,EAAQd,WAAanB,EAASmB,WACvC6G,EAASzE,OAAS,KAAOtB,EAAQb,eAAiBpB,EAASoB,eAE3D4G,EAASG,KAAK,QAG3BpF,EAAQG,EAAOqB,UAAUzC,EAAWuC,aACpC2D,EAAWnI,QAAQiH,UAAU/D,GAASG,EAAOZ,OAAOC,SAASQ,GAAOkF,OAAQ,GAE9EpG,EAAQnB,MAAMsH,EAAWA,EAAW/F,EAAQjB,aAAehB,EAASe,YAGnEkB,EAAQrB,WACTkB,EAAWsG,SAAW,SAASrE,GAC7B,OAAQA,GAA0B,IAAjBA,EAAMR,SAK3BlB,EAAMgG,IAAI,WAAY,WAChBnF,GAAQA,EAAOoF,UACnBrG,EAAU,KACViB,EAAS","file":"select.min.js","sourcesContent":[null],"sourceRoot":"/source/"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-02-08
|
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
|
-
}]);
|
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-02-08
|
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>')}]);
|
@@ -1,186 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-02-08
|
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
|
-
}]);
|