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.timepicker",["mgcrea.ngStrap.helpers.dateParser","mgcrea.ngStrap.helpers.dateFormatter","mgcrea.ngStrap.tooltip"]).provider("$timepicker",function(){var e=this.defaults={animation:"am-fade",prefixClass:"timepicker",placement:"bottom-left",template:"timepicker/timepicker.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,useNative:!0,timeType:"date",timeFormat:"shortTime",modelTimeFormat:null,autoclose:!1,minTime:-1/0,maxTime:+1/0,length:5,hourStep:1,minuteStep:5,iconUp:"glyphicon glyphicon-chevron-up",iconDown:"glyphicon glyphicon-chevron-down",arrowBehavior:"pager"};this.$get=["$window","$document","$rootScope","$sce","$dateFormatter","$tooltip","$timeout",function(t,a,n,i,o,r,u){function s(t,a,n){function i(e,a){if(t[0].createTextRange){var n=t[0].createTextRange();n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",a),n.select()}else t[0].setSelectionRange?t[0].setSelectionRange(e,a):angular.isUndefined(t[0].selectionStart)&&(t[0].selectionStart=e,t[0].selectionEnd=a)}function s(){t[0].focus()}var m=r(t,angular.extend({},e,n)),c=n.scope,g=m.$options,p=m.$scope,$=g.lang,f=function(e,t){return o.formatDate(e,t,$)},h=0,w=a.$dateValue||new Date,v={hour:w.getHours(),meridian:w.getHours()<12,minute:w.getMinutes(),second:w.getSeconds(),millisecond:w.getMilliseconds()},y=o.getDatetimeFormat(g.timeFormat,$),T=o.hoursFormat(y),D=o.timeSeparator(y),S=o.minutesFormat(y),V=o.showAM(y);p.$iconUp=g.iconUp,p.$iconDown=g.iconDown,p.$select=function(e,t){m.select(e,t)},p.$moveIndex=function(e,t){m.$moveIndex(e,t)},p.$switchMeridian=function(e){m.switchMeridian(e)},m.update=function(e){angular.isDate(e)&&!isNaN(e.getTime())?(m.$date=e,angular.extend(v,{hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),millisecond:e.getMilliseconds()}),m.$build()):m.$isBuilt||m.$build()},m.select=function(e,t,n){(!a.$dateValue||isNaN(a.$dateValue.getTime()))&&(a.$dateValue=new Date(1970,0,1)),angular.isDate(e)||(e=new Date(e)),0===t?a.$dateValue.setHours(e.getHours()):1===t&&a.$dateValue.setMinutes(e.getMinutes()),a.$setViewValue(angular.copy(a.$dateValue)),a.$render(),g.autoclose&&!n&&u(function(){m.hide(!0)})},m.switchMeridian=function(e){if(a.$dateValue&&!isNaN(a.$dateValue.getTime())){var t=(e||a.$dateValue).getHours();a.$dateValue.setHours(12>t?t+12:t-12),a.$setViewValue(angular.copy(a.$dateValue)),a.$render()}},m.$build=function(){var e,t,a=p.midIndex=parseInt(g.length/2,10),n=[];for(e=0;e<g.length;e++)t=new Date(1970,0,1,v.hour-(a-e)*g.hourStep),n.push({date:t,label:f(t,T),selected:m.$date&&m.$isSelected(t,0),disabled:m.$isDisabled(t,0)});var i,o=[];for(e=0;e<g.length;e++)i=new Date(1970,0,1,0,v.minute-(a-e)*g.minuteStep),o.push({date:i,label:f(i,S),selected:m.$date&&m.$isSelected(i,1),disabled:m.$isDisabled(i,1)});var r=[];for(e=0;e<g.length;e++)r.push([n[e],o[e]]);p.rows=r,p.showAM=V,p.isAM=(m.$date||n[a].date).getHours()<12,p.timeSeparator=D,m.$isBuilt=!0},m.$isSelected=function(e,t){return m.$date?0===t?e.getHours()===m.$date.getHours():1===t?e.getMinutes()===m.$date.getMinutes():void 0:!1},m.$isDisabled=function(e,t){var a;return 0===t?a=e.getTime()+6e4*v.minute:1===t&&(a=e.getTime()+36e5*v.hour),a<1*g.minTime||a>1*g.maxTime},p.$arrowAction=function(e,t){"picker"===g.arrowBehavior?m.$setTimeByStep(e,t):m.$moveIndex(e,t)},m.$setTimeByStep=function(e,t){{var a=new Date(m.$date),n=a.getHours(),i=(f(a,T).length,a.getMinutes());f(a,S).length}0===t?a.setHours(n-parseInt(g.hourStep,10)*e):a.setMinutes(i-parseInt(g.minuteStep,10)*e),m.select(a,t,!0)},m.$moveIndex=function(e,t){var a;0===t?(a=new Date(1970,0,1,v.hour+e*g.length,v.minute),angular.extend(v,{hour:a.getHours()})):1===t&&(a=new Date(1970,0,1,v.hour,v.minute+e*g.length*g.minuteStep),angular.extend(v,{minute:a.getMinutes()})),m.$build()},m.$onMouseDown=function(e){if("input"!==e.target.nodeName.toLowerCase()&&e.preventDefault(),e.stopPropagation(),d){var t=angular.element(e.target);"button"!==t[0].nodeName.toLowerCase()&&(t=t.parent()),t.triggerHandler("click")}},m.$onKeyDown=function(e){if(/(38|37|39|40|13)/.test(e.keyCode)&&!e.shiftKey&&!e.altKey){if(e.preventDefault(),e.stopPropagation(),13===e.keyCode)return m.hide(!0);var t=new Date(m.$date),a=t.getHours(),n=f(t,T).length,o=t.getMinutes(),r=f(t,S).length,u=/(37|39)/.test(e.keyCode),s=2+1*V;u&&(37===e.keyCode?h=1>h?s-1:h-1:39===e.keyCode&&(h=s-1>h?h+1:0));var l=[0,n];0===h?(38===e.keyCode?t.setHours(a-parseInt(g.hourStep,10)):40===e.keyCode&&t.setHours(a+parseInt(g.hourStep,10)),n=f(t,T).length,l=[0,n]):1===h?(38===e.keyCode?t.setMinutes(o-parseInt(g.minuteStep,10)):40===e.keyCode&&t.setMinutes(o+parseInt(g.minuteStep,10)),r=f(t,S).length,l=[n+1,n+1+r]):2===h&&(u||m.switchMeridian(),l=[n+1+r+1,n+1+r+3]),m.select(t,h,!0),i(l[0],l[1]),c.$digest()}};var k=m.init;m.init=function(){return l&&g.useNative?(t.prop("type","time"),void t.css("-webkit-appearance","textfield")):(d&&(t.prop("type","text"),t.attr("readonly","true"),t.on("click",s)),void k())};var b=m.destroy;m.destroy=function(){l&&g.useNative&&t.off("click",s),b()};var M=m.show;m.show=function(){M(),u(function(){m.$element.on(d?"touchstart":"mousedown",m.$onMouseDown),g.keyboard&&t.on("keydown",m.$onKeyDown)},0,!1)};var N=m.hide;return m.hide=function(e){m.$isShown&&(m.$element.off(d?"touchstart":"mousedown",m.$onMouseDown),g.keyboard&&t.off("keydown",m.$onKeyDown),N(e))},m}var l=(angular.element(t.document.body),/(ip(a|o)d|iphone|android)/gi.test(t.navigator.userAgent)),d="createTouch"in t.document&&l;return e.lang||(e.lang=o.getDefaultLocale()),s.defaults=e,s}]}).directive("bsTimepicker",["$window","$parse","$q","$dateFormatter","$dateParser","$timepicker",function(e,t,a,n,i,o){{var r=o.defaults,u=/(ip(a|o)d|iphone|android)/gi.test(e.navigator.userAgent);e.requestAnimationFrame||e.setTimeout}return{restrict:"EAC",require:"ngModel",link:function(e,t,a,s){function l(e){if(angular.isDate(e)){var t=isNaN(m.minTime)||new Date(e.getTime()).setFullYear(1970,0,1)>=m.minTime,a=isNaN(m.maxTime)||new Date(e.getTime()).setFullYear(1970,0,1)<=m.maxTime,n=t&&a;s.$setValidity("date",n),s.$setValidity("min",t),s.$setValidity("max",a),n&&(s.$dateValue=e)}}function d(){return!s.$dateValue||isNaN(s.$dateValue.getTime())?"":p(s.$dateValue,m.timeFormat)}var m={scope:e,controller:s};angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","autoclose","timeType","timeFormat","modelTimeFormat","useNative","hourStep","minuteStep","length","arrowBehavior","iconUp","iconDown","id"],function(e){angular.isDefined(a[e])&&(m[e]=a[e])}),a.bsShow&&e.$watch(a.bsShow,function(e){c&&angular.isDefined(e)&&(angular.isString(e)&&(e=!!e.match(/true|,?(timepicker),?/i)),e===!0?c.show():c.hide())}),u&&(m.useNative||r.useNative)&&(m.timeFormat="HH:mm");var c=o(t,s,m);m=c.$options;var g=m.lang,p=function(e,t){return n.formatDate(e,t,g)},$=i({format:m.timeFormat,lang:g});angular.forEach(["minTime","maxTime"],function(e){angular.isDefined(a[e])&&a.$observe(e,function(t){c.$options[e]=$.getTimeForAttribute(e,t),!isNaN(c.$options[e])&&c.$build(),l(s.$dateValue)})}),e.$watch(a.ngModel,function(){c.update(s.$dateValue)},!0),s.$parsers.unshift(function(e){if(!e)return s.$setValidity("date",!0),null;var t=angular.isDate(e)?e:$.parse(e,s.$dateValue);return!t||isNaN(t.getTime())?void s.$setValidity("date",!1):(l(t),"string"===m.timeType?p(t,m.modelTimeFormat||m.timeFormat):"number"===m.timeType?s.$dateValue.getTime():"unix"===m.timeType?s.$dateValue.getTime()/1e3:"iso"===m.timeType?s.$dateValue.toISOString():new Date(s.$dateValue))}),s.$formatters.push(function(e){var t;return t=angular.isUndefined(e)||null===e?0/0:angular.isDate(e)?e:"string"===m.timeType?$.parse(e,null,m.modelTimeFormat):new Date("unix"===m.timeType?1e3*e:e),s.$dateValue=t,d()}),s.$render=function(){t.val(d())},e.$on("$destroy",function(){c&&c.destroy(),m=null,c=null})}}}]);
|
9
|
-
//# sourceMappingURL=timepicker.min.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["timepicker.min.js"],"names":["angular","module","provider","defaults","this","animation","prefixClass","placement","template","trigger","container","keyboard","html","delay","useNative","timeType","timeFormat","modelTimeFormat","autoclose","minTime","Infinity","maxTime","length","hourStep","minuteStep","iconUp","iconDown","arrowBehavior","$get","$window","$document","$rootScope","$sce","$dateFormatter","$tooltip","$timeout","timepickerFactory","element","controller","config","createSelection","start","end","createTextRange","selRange","collapse","moveStart","moveEnd","select","setSelectionRange","isUndefined","selectionStart","selectionEnd","focusElement","focus","$timepicker","extend","parentScope","scope","options","$options","$scope","lang","formatDate","date","format","selectedIndex","startDate","$dateValue","Date","viewDate","hour","getHours","meridian","minute","getMinutes","second","getSeconds","millisecond","getMilliseconds","getDatetimeFormat","hoursFormat","timeSeparator","minutesFormat","showAM","$iconUp","$iconDown","$select","index","$moveIndex","value","$switchMeridian","switchMeridian","update","isDate","isNaN","getTime","$date","$build","$isBuilt","keep","setHours","setMinutes","$setViewValue","copy","$render","hide","hours","i","midIndex","parseInt","push","label","selected","$isSelected","disabled","$isDisabled","minutes","rows","isAM","selectedTime","$arrowAction","$setTimeByStep","newDate","targetDate","$onMouseDown","evt","target","nodeName","toLowerCase","preventDefault","stopPropagation","isTouch","targetEl","parent","triggerHandler","$onKeyDown","test","keyCode","shiftKey","altKey","hoursLength","minutesLength","lateralMove","count","selectRange","$digest","_init","init","isNative","prop","css","attr","on","_destroy","destroy","off","_show","show","$element","_hide","blur","$isShown","document","body","navigator","userAgent","getDefaultLocale","directive","$parse","$q","$dateParser","requestAnimationFrame","setTimeout","restrict","require","link","validateAgainstMinMaxTime","parsedTime","isMinValid","setFullYear","isMaxValid","isValid","$setValidity","getTimeFormattedString","forEach","key","isDefined","bsShow","$watch","newValue","timepicker","isString","match","dateParser","$observe","getTimeForAttribute","ngModel","$parsers","unshift","viewValue","parse","toISOString","$formatters","modelValue","NaN","val","$on"],"mappings":"AAOA,YAEAA,SAAQC,OAAO,6BACb,oCACA,uCACA,2BAECC,SAAS,cAAe,WAEvB,G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C,GAEJ,WAArBvH,EAAQ5C,SACFgD,EAAWmH,EAAYvH,EAAQ1C,iBAAmB0C,EAAQ3C,YACpC,WAArB2C,EAAQ5C,SACTuB,EAAW8B,WAAW4B,UACA,SAArBrC,EAAQ5C,SACTuB,EAAW8B,WAAW4B,UAAY,IACZ,QAArBrC,EAAQ5C,SACTuB,EAAW8B,WAAWsI,cAEtB,GAAIrI,MAAK/B,EAAW8B,eAK/B9B,EAAWqK,YAAY5F,KAAK,SAAS6F,GAEnC,GAAI5I,EAeJ,OAbEA,GADChE,QAAQkD,YAAY0J,IAA8B,OAAfA,EAC7BC,IACC7M,QAAQ8F,OAAO8G,GAChBA,EACsB,WAArBjJ,EAAQ5C,SACTmL,EAAWO,MAAMG,EAAY,KAAMjJ,EAAQ1C,iBAE3C,GAAIoD,MADkB,SAArBV,EAAQ5C,SACa,IAAb6L,EAEAA,GAIlBtK,EAAW8B,WAAaJ,EACjBwH,MAITlJ,EAAWmE,QAAU,WAEnBpE,EAAQyK,IAAItB,MAQd9H,EAAMqJ,IAAI,WAAY,WAChBhB,GAAYA,EAAWpC,UAC3BhG,EAAU,KACVoI,EAAa","file":"timepicker.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.timepicker').run(['$templateCache', function($templateCache) {
|
11
|
-
|
12
|
-
$templateCache.put('timepicker/timepicker.tpl.html', '<div class="dropdown-menu timepicker" style="min-width: 0px;width: auto"><table height="100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 0)"><i class="{{ $iconUp }}"></i></button></th><th> </th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 1)"><i class="{{ $iconUp }}"></i></button></th></tr></thead><tbody><tr ng-repeat="(i, row) in rows"><td class="text-center"><button tabindex="-1" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[0].selected}" ng-click="$select(row[0].date, 0)" ng-disabled="row[0].disabled"><span ng-class="{\'text-muted\': row[0].muted}" ng-bind="row[0].label"></span></button></td><td><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td class="text-center"><button tabindex="-1" ng-if="row[1].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[1].selected}" ng-click="$select(row[1].date, 1)" ng-disabled="row[1].disabled"><span ng-class="{\'text-muted\': row[1].muted}" ng-bind="row[1].label"></span></button></td><td ng-if="showAM"> </td><td ng-if="showAM"><button tabindex="-1" ng-show="i == midIndex - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !!isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">AM</button> <button tabindex="-1" ng-show="i == midIndex + 1 - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">PM</button></td></tr></tbody><tfoot><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 0)"><i class="{{ $iconDown }}"></i></button></th><th> </th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 1)"><i class="{{ $iconDown }}"></i></button></th></tr></tfoot></table></div>');
|
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.timepicker").run(["$templateCache",function(t){t.put("timepicker/timepicker.tpl.html",'<div class="dropdown-menu timepicker" style="min-width: 0px;width: auto"><table height="100%"><thead><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 0)"><i class="{{ $iconUp }}"></i></button></th><th> </th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(-1, 1)"><i class="{{ $iconUp }}"></i></button></th></tr></thead><tbody><tr ng-repeat="(i, row) in rows"><td class="text-center"><button tabindex="-1" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[0].selected}" ng-click="$select(row[0].date, 0)" ng-disabled="row[0].disabled"><span ng-class="{\'text-muted\': row[0].muted}" ng-bind="row[0].label"></span></button></td><td><span ng-bind="i == midIndex ? timeSeparator : \' \'"></span></td><td class="text-center"><button tabindex="-1" ng-if="row[1].date" style="width: 100%" type="button" class="btn btn-default" ng-class="{\'btn-primary\': row[1].selected}" ng-click="$select(row[1].date, 1)" ng-disabled="row[1].disabled"><span ng-class="{\'text-muted\': row[1].muted}" ng-bind="row[1].label"></span></button></td><td ng-if="showAM"> </td><td ng-if="showAM"><button tabindex="-1" ng-show="i == midIndex - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !!isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">AM</button> <button tabindex="-1" ng-show="i == midIndex + 1 - !isAM * 1" style="width: 100%" type="button" ng-class="{\'btn-primary\': !isAM}" class="btn btn-default" ng-click="$switchMeridian()" ng-disabled="el.disabled">PM</button></td></tr></tbody><tfoot><tr class="text-center"><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 0)"><i class="{{ $iconDown }}"></i></button></th><th> </th><th><button tabindex="-1" type="button" class="btn btn-default pull-left" ng-click="$arrowAction(1, 1)"><i class="{{ $iconDown }}"></i></button></th></tr></tfoot></table></div>')}]);
|
@@ -1,705 +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.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])
|
11
|
-
|
12
|
-
.provider('$tooltip', function() {
|
13
|
-
|
14
|
-
var defaults = this.defaults = {
|
15
|
-
animation: 'am-fade',
|
16
|
-
customClass: '',
|
17
|
-
prefixClass: 'tooltip',
|
18
|
-
prefixEvent: 'tooltip',
|
19
|
-
container: false,
|
20
|
-
target: false,
|
21
|
-
placement: 'top',
|
22
|
-
template: 'tooltip/tooltip.tpl.html',
|
23
|
-
contentTemplate: false,
|
24
|
-
trigger: 'hover focus',
|
25
|
-
keyboard: false,
|
26
|
-
html: false,
|
27
|
-
show: false,
|
28
|
-
title: '',
|
29
|
-
type: '',
|
30
|
-
delay: 0,
|
31
|
-
autoClose: false,
|
32
|
-
bsEnabled: true
|
33
|
-
};
|
34
|
-
|
35
|
-
this.$get = ["$window", "$rootScope", "$compile", "$q", "$templateCache", "$http", "$animate", "$sce", "dimensions", "$$rAF", "$timeout", function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {
|
36
|
-
|
37
|
-
var trim = String.prototype.trim;
|
38
|
-
var isTouch = 'createTouch' in $window.document;
|
39
|
-
var htmlReplaceRegExp = /ng-bind="/ig;
|
40
|
-
var $body = angular.element($window.document);
|
41
|
-
|
42
|
-
function TooltipFactory(element, config) {
|
43
|
-
|
44
|
-
var $tooltip = {};
|
45
|
-
|
46
|
-
// Common vars
|
47
|
-
var nodeName = element[0].nodeName.toLowerCase();
|
48
|
-
var options = $tooltip.$options = angular.extend({}, defaults, config);
|
49
|
-
$tooltip.$promise = fetchTemplate(options.template);
|
50
|
-
var scope = $tooltip.$scope = options.scope && options.scope.$new() || $rootScope.$new();
|
51
|
-
if(options.delay && angular.isString(options.delay)) {
|
52
|
-
var split = options.delay.split(',').map(parseFloat);
|
53
|
-
options.delay = split.length > 1 ? {show: split[0], hide: split[1]} : split[0];
|
54
|
-
}
|
55
|
-
|
56
|
-
// store $id to identify the triggering element in events
|
57
|
-
// give priority to options.id, otherwise, try to use
|
58
|
-
// element id if defined
|
59
|
-
$tooltip.$id = options.id || element.attr('id') || '';
|
60
|
-
|
61
|
-
// Support scope as string options
|
62
|
-
if(options.title) {
|
63
|
-
scope.title = $sce.trustAsHtml(options.title);
|
64
|
-
}
|
65
|
-
|
66
|
-
// Provide scope helpers
|
67
|
-
scope.$setEnabled = function(isEnabled) {
|
68
|
-
scope.$$postDigest(function() {
|
69
|
-
$tooltip.setEnabled(isEnabled);
|
70
|
-
});
|
71
|
-
};
|
72
|
-
scope.$hide = function() {
|
73
|
-
scope.$$postDigest(function() {
|
74
|
-
$tooltip.hide();
|
75
|
-
});
|
76
|
-
};
|
77
|
-
scope.$show = function() {
|
78
|
-
scope.$$postDigest(function() {
|
79
|
-
$tooltip.show();
|
80
|
-
});
|
81
|
-
};
|
82
|
-
scope.$toggle = function() {
|
83
|
-
scope.$$postDigest(function() {
|
84
|
-
$tooltip.toggle();
|
85
|
-
});
|
86
|
-
};
|
87
|
-
// Publish isShown as a protected var on scope
|
88
|
-
$tooltip.$isShown = scope.$isShown = false;
|
89
|
-
|
90
|
-
// Private vars
|
91
|
-
var timeout, hoverState;
|
92
|
-
|
93
|
-
// Support contentTemplate option
|
94
|
-
if(options.contentTemplate) {
|
95
|
-
$tooltip.$promise = $tooltip.$promise.then(function(template) {
|
96
|
-
var templateEl = angular.element(template);
|
97
|
-
return fetchTemplate(options.contentTemplate)
|
98
|
-
.then(function(contentTemplate) {
|
99
|
-
var contentEl = findElement('[ng-bind="content"]', templateEl[0]);
|
100
|
-
if(!contentEl.length) contentEl = findElement('[ng-bind="title"]', templateEl[0]);
|
101
|
-
contentEl.removeAttr('ng-bind').html(contentTemplate);
|
102
|
-
return templateEl[0].outerHTML;
|
103
|
-
});
|
104
|
-
});
|
105
|
-
}
|
106
|
-
|
107
|
-
// Fetch, compile then initialize tooltip
|
108
|
-
var tipLinker, tipElement, tipTemplate, tipContainer, tipScope;
|
109
|
-
$tooltip.$promise.then(function(template) {
|
110
|
-
if(angular.isObject(template)) template = template.data;
|
111
|
-
if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html="');
|
112
|
-
template = trim.apply(template);
|
113
|
-
tipTemplate = template;
|
114
|
-
tipLinker = $compile(template);
|
115
|
-
$tooltip.init();
|
116
|
-
});
|
117
|
-
|
118
|
-
$tooltip.init = function() {
|
119
|
-
|
120
|
-
// Options: delay
|
121
|
-
if (options.delay && angular.isNumber(options.delay)) {
|
122
|
-
options.delay = {
|
123
|
-
show: options.delay,
|
124
|
-
hide: options.delay
|
125
|
-
};
|
126
|
-
}
|
127
|
-
|
128
|
-
// Replace trigger on touch devices ?
|
129
|
-
// if(isTouch && options.trigger === defaults.trigger) {
|
130
|
-
// options.trigger.replace(/hover/g, 'click');
|
131
|
-
// }
|
132
|
-
|
133
|
-
// Options : container
|
134
|
-
if(options.container === 'self') {
|
135
|
-
tipContainer = element;
|
136
|
-
} else if(angular.isElement(options.container)) {
|
137
|
-
tipContainer = options.container;
|
138
|
-
} else if(options.container) {
|
139
|
-
tipContainer = findElement(options.container);
|
140
|
-
}
|
141
|
-
|
142
|
-
// Options: trigger
|
143
|
-
bindTriggerEvents();
|
144
|
-
|
145
|
-
// Options: target
|
146
|
-
if(options.target) {
|
147
|
-
options.target = angular.isElement(options.target) ? options.target : findElement(options.target);
|
148
|
-
}
|
149
|
-
|
150
|
-
// Options: show
|
151
|
-
if(options.show) {
|
152
|
-
scope.$$postDigest(function() {
|
153
|
-
options.trigger === 'focus' ? element[0].focus() : $tooltip.show();
|
154
|
-
});
|
155
|
-
}
|
156
|
-
|
157
|
-
};
|
158
|
-
|
159
|
-
$tooltip.destroy = function() {
|
160
|
-
|
161
|
-
// Unbind events
|
162
|
-
unbindTriggerEvents();
|
163
|
-
|
164
|
-
// Remove element
|
165
|
-
destroyTipElement();
|
166
|
-
|
167
|
-
// Destroy scope
|
168
|
-
scope.$destroy();
|
169
|
-
|
170
|
-
};
|
171
|
-
|
172
|
-
$tooltip.enter = function() {
|
173
|
-
|
174
|
-
clearTimeout(timeout);
|
175
|
-
hoverState = 'in';
|
176
|
-
if (!options.delay || !options.delay.show) {
|
177
|
-
return $tooltip.show();
|
178
|
-
}
|
179
|
-
|
180
|
-
timeout = setTimeout(function() {
|
181
|
-
if (hoverState ==='in') $tooltip.show();
|
182
|
-
}, options.delay.show);
|
183
|
-
|
184
|
-
};
|
185
|
-
|
186
|
-
$tooltip.show = function() {
|
187
|
-
if (!options.bsEnabled || $tooltip.$isShown) return;
|
188
|
-
|
189
|
-
scope.$emit(options.prefixEvent + '.show.before', $tooltip);
|
190
|
-
var parent, after;
|
191
|
-
if (options.container) {
|
192
|
-
parent = tipContainer;
|
193
|
-
if (tipContainer[0].lastChild) {
|
194
|
-
after = angular.element(tipContainer[0].lastChild);
|
195
|
-
} else {
|
196
|
-
after = null;
|
197
|
-
}
|
198
|
-
} else {
|
199
|
-
parent = null;
|
200
|
-
after = element;
|
201
|
-
}
|
202
|
-
|
203
|
-
|
204
|
-
// Hide any existing tipElement
|
205
|
-
if(tipElement) destroyTipElement();
|
206
|
-
// Fetch a cloned element linked from template
|
207
|
-
tipScope = $tooltip.$scope.$new();
|
208
|
-
tipElement = $tooltip.$element = tipLinker(tipScope, function(clonedElement, scope) {});
|
209
|
-
|
210
|
-
// Set the initial positioning. Make the tooltip invisible
|
211
|
-
// so IE doesn't try to focus on it off screen.
|
212
|
-
tipElement.css({top: '-9999px', left: '-9999px', display: 'block', visibility: 'hidden'});
|
213
|
-
|
214
|
-
// Options: animation
|
215
|
-
if(options.animation) tipElement.addClass(options.animation);
|
216
|
-
// Options: type
|
217
|
-
if(options.type) tipElement.addClass(options.prefixClass + '-' + options.type);
|
218
|
-
// Options: custom classes
|
219
|
-
if(options.customClass) tipElement.addClass(options.customClass);
|
220
|
-
|
221
|
-
// Support v1.3+ $animate
|
222
|
-
// https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9
|
223
|
-
var promise = $animate.enter(tipElement, parent, after, enterAnimateCallback);
|
224
|
-
if(promise && promise.then) promise.then(enterAnimateCallback);
|
225
|
-
|
226
|
-
$tooltip.$isShown = scope.$isShown = true;
|
227
|
-
safeDigest(scope);
|
228
|
-
$$rAF(function () {
|
229
|
-
$tooltip.$applyPlacement();
|
230
|
-
|
231
|
-
// Once placed, make the tooltip visible
|
232
|
-
if(tipElement) tipElement.css({visibility: 'visible'});
|
233
|
-
}); // var a = bodyEl.offsetWidth + 1; ?
|
234
|
-
|
235
|
-
// Bind events
|
236
|
-
if(options.keyboard) {
|
237
|
-
if(options.trigger !== 'focus') {
|
238
|
-
$tooltip.focus();
|
239
|
-
}
|
240
|
-
bindKeyboardEvents();
|
241
|
-
}
|
242
|
-
|
243
|
-
if(options.autoClose) {
|
244
|
-
bindAutoCloseEvents();
|
245
|
-
}
|
246
|
-
|
247
|
-
};
|
248
|
-
|
249
|
-
function enterAnimateCallback() {
|
250
|
-
scope.$emit(options.prefixEvent + '.show', $tooltip);
|
251
|
-
}
|
252
|
-
|
253
|
-
$tooltip.leave = function() {
|
254
|
-
|
255
|
-
clearTimeout(timeout);
|
256
|
-
hoverState = 'out';
|
257
|
-
if (!options.delay || !options.delay.hide) {
|
258
|
-
return $tooltip.hide();
|
259
|
-
}
|
260
|
-
timeout = setTimeout(function () {
|
261
|
-
if (hoverState === 'out') {
|
262
|
-
$tooltip.hide();
|
263
|
-
}
|
264
|
-
}, options.delay.hide);
|
265
|
-
|
266
|
-
};
|
267
|
-
|
268
|
-
var _blur;
|
269
|
-
var _tipToHide;
|
270
|
-
$tooltip.hide = function(blur) {
|
271
|
-
|
272
|
-
if(!$tooltip.$isShown) return;
|
273
|
-
scope.$emit(options.prefixEvent + '.hide.before', $tooltip);
|
274
|
-
|
275
|
-
// store blur value for leaveAnimateCallback to use
|
276
|
-
_blur = blur;
|
277
|
-
|
278
|
-
// store current tipElement reference to use
|
279
|
-
// in leaveAnimateCallback
|
280
|
-
_tipToHide = tipElement;
|
281
|
-
|
282
|
-
// Support v1.3+ $animate
|
283
|
-
// https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9
|
284
|
-
var promise = $animate.leave(tipElement, leaveAnimateCallback);
|
285
|
-
if(promise && promise.then) promise.then(leaveAnimateCallback);
|
286
|
-
|
287
|
-
$tooltip.$isShown = scope.$isShown = false;
|
288
|
-
safeDigest(scope);
|
289
|
-
|
290
|
-
// Unbind events
|
291
|
-
if(options.keyboard && tipElement !== null) {
|
292
|
-
unbindKeyboardEvents();
|
293
|
-
}
|
294
|
-
|
295
|
-
if(options.autoClose && tipElement !== null) {
|
296
|
-
unbindAutoCloseEvents();
|
297
|
-
}
|
298
|
-
};
|
299
|
-
|
300
|
-
function leaveAnimateCallback() {
|
301
|
-
scope.$emit(options.prefixEvent + '.hide', $tooltip);
|
302
|
-
|
303
|
-
// check if current tipElement still references
|
304
|
-
// the same element when hide was called
|
305
|
-
if (tipElement === _tipToHide) {
|
306
|
-
// Allow to blur the input when hidden, like when pressing enter key
|
307
|
-
if(_blur && options.trigger === 'focus') {
|
308
|
-
return element[0].blur();
|
309
|
-
}
|
310
|
-
|
311
|
-
// clean up child scopes
|
312
|
-
destroyTipElement();
|
313
|
-
}
|
314
|
-
}
|
315
|
-
|
316
|
-
$tooltip.toggle = function() {
|
317
|
-
$tooltip.$isShown ? $tooltip.leave() : $tooltip.enter();
|
318
|
-
};
|
319
|
-
|
320
|
-
$tooltip.focus = function() {
|
321
|
-
tipElement[0].focus();
|
322
|
-
};
|
323
|
-
|
324
|
-
$tooltip.setEnabled = function(isEnabled) {
|
325
|
-
options.bsEnabled = isEnabled;
|
326
|
-
};
|
327
|
-
|
328
|
-
// Protected methods
|
329
|
-
|
330
|
-
$tooltip.$applyPlacement = function() {
|
331
|
-
if(!tipElement) return;
|
332
|
-
|
333
|
-
// Determine if we're doing an auto or normal placement
|
334
|
-
var placement = options.placement,
|
335
|
-
autoToken = /\s?auto?\s?/i,
|
336
|
-
autoPlace = autoToken.test(placement);
|
337
|
-
|
338
|
-
if (autoPlace) {
|
339
|
-
placement = placement.replace(autoToken, '') || defaults.placement;
|
340
|
-
}
|
341
|
-
|
342
|
-
// Need to add the position class before we get
|
343
|
-
// the offsets
|
344
|
-
tipElement.addClass(options.placement);
|
345
|
-
|
346
|
-
// Get the position of the target element
|
347
|
-
// and the height and width of the tooltip so we can center it.
|
348
|
-
var elementPosition = getPosition(),
|
349
|
-
tipWidth = tipElement.prop('offsetWidth'),
|
350
|
-
tipHeight = tipElement.prop('offsetHeight');
|
351
|
-
|
352
|
-
// If we're auto placing, we need to check the positioning
|
353
|
-
if (autoPlace) {
|
354
|
-
var originalPlacement = placement;
|
355
|
-
var container = options.container ? angular.element(document.querySelector(options.container)) : element.parent();
|
356
|
-
var containerPosition = getPosition(container);
|
357
|
-
|
358
|
-
// Determine if the vertical placement
|
359
|
-
if (originalPlacement.indexOf('bottom') >= 0 && elementPosition.bottom + tipHeight > containerPosition.bottom) {
|
360
|
-
placement = originalPlacement.replace('bottom', 'top');
|
361
|
-
} else if (originalPlacement.indexOf('top') >= 0 && elementPosition.top - tipHeight < containerPosition.top) {
|
362
|
-
placement = originalPlacement.replace('top', 'bottom');
|
363
|
-
}
|
364
|
-
|
365
|
-
// Determine the horizontal placement
|
366
|
-
// The exotic placements of left and right are opposite of the standard placements. Their arrows are put on the left/right
|
367
|
-
// and flow in the opposite direction of their placement.
|
368
|
-
if ((originalPlacement === 'right' || originalPlacement === 'bottom-left' || originalPlacement === 'top-left') &&
|
369
|
-
elementPosition.right + tipWidth > containerPosition.width) {
|
370
|
-
|
371
|
-
placement = originalPlacement === 'right' ? 'left' : placement.replace('left', 'right');
|
372
|
-
} else if ((originalPlacement === 'left' || originalPlacement === 'bottom-right' || originalPlacement === 'top-right') &&
|
373
|
-
elementPosition.left - tipWidth < containerPosition.left) {
|
374
|
-
|
375
|
-
placement = originalPlacement === 'left' ? 'right' : placement.replace('right', 'left');
|
376
|
-
}
|
377
|
-
|
378
|
-
tipElement.removeClass(originalPlacement).addClass(placement);
|
379
|
-
}
|
380
|
-
|
381
|
-
// Get the tooltip's top and left coordinates to center it with this directive.
|
382
|
-
var tipPosition = getCalculatedOffset(placement, elementPosition, tipWidth, tipHeight);
|
383
|
-
applyPlacementCss(tipPosition.top, tipPosition.left);
|
384
|
-
};
|
385
|
-
|
386
|
-
$tooltip.$onKeyUp = function(evt) {
|
387
|
-
if (evt.which === 27 && $tooltip.$isShown) {
|
388
|
-
$tooltip.hide();
|
389
|
-
evt.stopPropagation();
|
390
|
-
}
|
391
|
-
};
|
392
|
-
|
393
|
-
$tooltip.$onFocusKeyUp = function(evt) {
|
394
|
-
if (evt.which === 27) {
|
395
|
-
element[0].blur();
|
396
|
-
evt.stopPropagation();
|
397
|
-
}
|
398
|
-
};
|
399
|
-
|
400
|
-
$tooltip.$onFocusElementMouseDown = function(evt) {
|
401
|
-
evt.preventDefault();
|
402
|
-
evt.stopPropagation();
|
403
|
-
// Some browsers do not auto-focus buttons (eg. Safari)
|
404
|
-
$tooltip.$isShown ? element[0].blur() : element[0].focus();
|
405
|
-
};
|
406
|
-
|
407
|
-
// bind/unbind events
|
408
|
-
function bindTriggerEvents() {
|
409
|
-
var triggers = options.trigger.split(' ');
|
410
|
-
angular.forEach(triggers, function(trigger) {
|
411
|
-
if(trigger === 'click') {
|
412
|
-
element.on('click', $tooltip.toggle);
|
413
|
-
} else if(trigger !== 'manual') {
|
414
|
-
element.on(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);
|
415
|
-
element.on(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);
|
416
|
-
nodeName === 'button' && trigger !== 'hover' && element.on(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);
|
417
|
-
}
|
418
|
-
});
|
419
|
-
}
|
420
|
-
|
421
|
-
function unbindTriggerEvents() {
|
422
|
-
var triggers = options.trigger.split(' ');
|
423
|
-
for (var i = triggers.length; i--;) {
|
424
|
-
var trigger = triggers[i];
|
425
|
-
if(trigger === 'click') {
|
426
|
-
element.off('click', $tooltip.toggle);
|
427
|
-
} else if(trigger !== 'manual') {
|
428
|
-
element.off(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);
|
429
|
-
element.off(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);
|
430
|
-
nodeName === 'button' && trigger !== 'hover' && element.off(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);
|
431
|
-
}
|
432
|
-
}
|
433
|
-
}
|
434
|
-
|
435
|
-
function bindKeyboardEvents() {
|
436
|
-
if(options.trigger !== 'focus') {
|
437
|
-
tipElement.on('keyup', $tooltip.$onKeyUp);
|
438
|
-
} else {
|
439
|
-
element.on('keyup', $tooltip.$onFocusKeyUp);
|
440
|
-
}
|
441
|
-
}
|
442
|
-
|
443
|
-
function unbindKeyboardEvents() {
|
444
|
-
if(options.trigger !== 'focus') {
|
445
|
-
tipElement.off('keyup', $tooltip.$onKeyUp);
|
446
|
-
} else {
|
447
|
-
element.off('keyup', $tooltip.$onFocusKeyUp);
|
448
|
-
}
|
449
|
-
}
|
450
|
-
|
451
|
-
var _autoCloseEventsBinded = false;
|
452
|
-
function bindAutoCloseEvents() {
|
453
|
-
// use timeout to hookup the events to prevent
|
454
|
-
// event bubbling from being processed imediately.
|
455
|
-
$timeout(function() {
|
456
|
-
// Stop propagation when clicking inside tooltip
|
457
|
-
tipElement.on('click', stopEventPropagation);
|
458
|
-
|
459
|
-
// Hide when clicking outside tooltip
|
460
|
-
$body.on('click', $tooltip.hide);
|
461
|
-
|
462
|
-
_autoCloseEventsBinded = true;
|
463
|
-
}, 0, false);
|
464
|
-
}
|
465
|
-
|
466
|
-
function unbindAutoCloseEvents() {
|
467
|
-
if (_autoCloseEventsBinded) {
|
468
|
-
tipElement.off('click', stopEventPropagation);
|
469
|
-
$body.off('click', $tooltip.hide);
|
470
|
-
_autoCloseEventsBinded = false;
|
471
|
-
}
|
472
|
-
}
|
473
|
-
|
474
|
-
function stopEventPropagation(event) {
|
475
|
-
event.stopPropagation();
|
476
|
-
}
|
477
|
-
|
478
|
-
// Private methods
|
479
|
-
|
480
|
-
function getPosition($element) {
|
481
|
-
$element = $element || (options.target || element);
|
482
|
-
|
483
|
-
var el = $element[0];
|
484
|
-
|
485
|
-
var elRect = el.getBoundingClientRect();
|
486
|
-
var rect = {};
|
487
|
-
|
488
|
-
// IE8 has issues with angular.extend and using elRect directly.
|
489
|
-
// By coping the values of elRect into a new object, we can continue to use extend
|
490
|
-
for (var p in elRect) {
|
491
|
-
if (elRect.hasOwnProperty(p)) {
|
492
|
-
rect[p] = elRect[p];
|
493
|
-
}
|
494
|
-
}
|
495
|
-
|
496
|
-
if (elRect.width === null) {
|
497
|
-
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
|
498
|
-
rect = angular.extend({}, rect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top });
|
499
|
-
}
|
500
|
-
|
501
|
-
var elPos;
|
502
|
-
if (options.container === 'body') {
|
503
|
-
elPos = dimensions.offset(el);
|
504
|
-
} else {
|
505
|
-
elPos = dimensions.position(el);
|
506
|
-
}
|
507
|
-
|
508
|
-
return angular.extend({}, rect, elPos);
|
509
|
-
}
|
510
|
-
|
511
|
-
function getCalculatedOffset(placement, position, actualWidth, actualHeight) {
|
512
|
-
var offset;
|
513
|
-
var split = placement.split('-');
|
514
|
-
|
515
|
-
switch (split[0]) {
|
516
|
-
case 'right':
|
517
|
-
offset = {
|
518
|
-
top: position.top + position.height / 2 - actualHeight / 2,
|
519
|
-
left: position.left + position.width
|
520
|
-
};
|
521
|
-
break;
|
522
|
-
case 'bottom':
|
523
|
-
offset = {
|
524
|
-
top: position.top + position.height,
|
525
|
-
left: position.left + position.width / 2 - actualWidth / 2
|
526
|
-
};
|
527
|
-
break;
|
528
|
-
case 'left':
|
529
|
-
offset = {
|
530
|
-
top: position.top + position.height / 2 - actualHeight / 2,
|
531
|
-
left: position.left - actualWidth
|
532
|
-
};
|
533
|
-
break;
|
534
|
-
default:
|
535
|
-
offset = {
|
536
|
-
top: position.top - actualHeight,
|
537
|
-
left: position.left + position.width / 2 - actualWidth / 2
|
538
|
-
};
|
539
|
-
break;
|
540
|
-
}
|
541
|
-
|
542
|
-
if(!split[1]) {
|
543
|
-
return offset;
|
544
|
-
}
|
545
|
-
|
546
|
-
// Add support for corners @todo css
|
547
|
-
if(split[0] === 'top' || split[0] === 'bottom') {
|
548
|
-
switch (split[1]) {
|
549
|
-
case 'left':
|
550
|
-
offset.left = position.left;
|
551
|
-
break;
|
552
|
-
case 'right':
|
553
|
-
offset.left = position.left + position.width - actualWidth;
|
554
|
-
}
|
555
|
-
} else if(split[0] === 'left' || split[0] === 'right') {
|
556
|
-
switch (split[1]) {
|
557
|
-
case 'top':
|
558
|
-
offset.top = position.top - actualHeight;
|
559
|
-
break;
|
560
|
-
case 'bottom':
|
561
|
-
offset.top = position.top + position.height;
|
562
|
-
}
|
563
|
-
}
|
564
|
-
|
565
|
-
return offset;
|
566
|
-
}
|
567
|
-
|
568
|
-
function applyPlacementCss(top, left) {
|
569
|
-
tipElement.css({ top: top + 'px', left: left + 'px' });
|
570
|
-
}
|
571
|
-
|
572
|
-
function destroyTipElement() {
|
573
|
-
// Cancel pending callbacks
|
574
|
-
clearTimeout(timeout);
|
575
|
-
|
576
|
-
if($tooltip.$isShown && tipElement !== null) {
|
577
|
-
if(options.autoClose) {
|
578
|
-
unbindAutoCloseEvents();
|
579
|
-
}
|
580
|
-
|
581
|
-
if(options.keyboard) {
|
582
|
-
unbindKeyboardEvents();
|
583
|
-
}
|
584
|
-
}
|
585
|
-
|
586
|
-
if(tipScope) {
|
587
|
-
tipScope.$destroy();
|
588
|
-
tipScope = null;
|
589
|
-
}
|
590
|
-
|
591
|
-
if(tipElement) {
|
592
|
-
tipElement.remove();
|
593
|
-
tipElement = $tooltip.$element = null;
|
594
|
-
}
|
595
|
-
}
|
596
|
-
|
597
|
-
return $tooltip;
|
598
|
-
|
599
|
-
}
|
600
|
-
|
601
|
-
// Helper functions
|
602
|
-
|
603
|
-
function safeDigest(scope) {
|
604
|
-
scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();
|
605
|
-
}
|
606
|
-
|
607
|
-
function findElement(query, element) {
|
608
|
-
return angular.element((element || document).querySelectorAll(query));
|
609
|
-
}
|
610
|
-
|
611
|
-
var fetchPromises = {};
|
612
|
-
function fetchTemplate(template) {
|
613
|
-
if(fetchPromises[template]) return fetchPromises[template];
|
614
|
-
return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))
|
615
|
-
.then(function(res) {
|
616
|
-
if(angular.isObject(res)) {
|
617
|
-
$templateCache.put(template, res.data);
|
618
|
-
return res.data;
|
619
|
-
}
|
620
|
-
return res;
|
621
|
-
}));
|
622
|
-
}
|
623
|
-
|
624
|
-
return TooltipFactory;
|
625
|
-
|
626
|
-
}];
|
627
|
-
|
628
|
-
})
|
629
|
-
|
630
|
-
.directive('bsTooltip', ["$window", "$location", "$sce", "$tooltip", "$$rAF", function($window, $location, $sce, $tooltip, $$rAF) {
|
631
|
-
|
632
|
-
return {
|
633
|
-
restrict: 'EAC',
|
634
|
-
scope: true,
|
635
|
-
link: function postLink(scope, element, attr, transclusion) {
|
636
|
-
|
637
|
-
// Directive options
|
638
|
-
var options = {scope: scope};
|
639
|
-
angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'backdropAnimation', 'type', 'customClass', 'id'], function(key) {
|
640
|
-
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
641
|
-
});
|
642
|
-
|
643
|
-
// should not parse target attribute, only data-target
|
644
|
-
if(element.attr('data-target')) {
|
645
|
-
options.target = element.attr('data-target');
|
646
|
-
}
|
647
|
-
|
648
|
-
// overwrite inherited title value when no value specified
|
649
|
-
// fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11
|
650
|
-
if (!scope.hasOwnProperty('title')){
|
651
|
-
scope.title = '';
|
652
|
-
}
|
653
|
-
|
654
|
-
// Observe scope attributes for change
|
655
|
-
attr.$observe('title', function(newValue) {
|
656
|
-
if (angular.isDefined(newValue) || !scope.hasOwnProperty('title')) {
|
657
|
-
var oldValue = scope.title;
|
658
|
-
scope.title = $sce.trustAsHtml(newValue);
|
659
|
-
angular.isDefined(oldValue) && $$rAF(function() {
|
660
|
-
tooltip && tooltip.$applyPlacement();
|
661
|
-
});
|
662
|
-
}
|
663
|
-
});
|
664
|
-
|
665
|
-
// Support scope as an object
|
666
|
-
attr.bsTooltip && scope.$watch(attr.bsTooltip, function(newValue, oldValue) {
|
667
|
-
if(angular.isObject(newValue)) {
|
668
|
-
angular.extend(scope, newValue);
|
669
|
-
} else {
|
670
|
-
scope.title = newValue;
|
671
|
-
}
|
672
|
-
angular.isDefined(oldValue) && $$rAF(function() {
|
673
|
-
tooltip && tooltip.$applyPlacement();
|
674
|
-
});
|
675
|
-
}, true);
|
676
|
-
|
677
|
-
// Visibility binding support
|
678
|
-
attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {
|
679
|
-
if(!tooltip || !angular.isDefined(newValue)) return;
|
680
|
-
if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(tooltip),?/i);
|
681
|
-
newValue === true ? tooltip.show() : tooltip.hide();
|
682
|
-
});
|
683
|
-
|
684
|
-
// Enabled binding support
|
685
|
-
attr.bsEnabled && scope.$watch(attr.bsEnabled, function(newValue, oldValue) {
|
686
|
-
// console.warn('scope.$watch(%s)', attr.bsEnabled, newValue, oldValue);
|
687
|
-
if(!tooltip || !angular.isDefined(newValue)) return;
|
688
|
-
if(angular.isString(newValue)) newValue = !!newValue.match(/true|1|,?(tooltip),?/i);
|
689
|
-
newValue === false ? tooltip.setEnabled(false) : tooltip.setEnabled(true);
|
690
|
-
});
|
691
|
-
|
692
|
-
// Initialize popover
|
693
|
-
var tooltip = $tooltip(element, options);
|
694
|
-
|
695
|
-
// Garbage collection
|
696
|
-
scope.$on('$destroy', function() {
|
697
|
-
if(tooltip) tooltip.destroy();
|
698
|
-
options = null;
|
699
|
-
tooltip = null;
|
700
|
-
});
|
701
|
-
|
702
|
-
}
|
703
|
-
};
|
704
|
-
|
705
|
-
}]);
|