rails-angular-strap 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +21 -0
- data/lib/rails-angular-strap.rb +11 -0
- data/lib/rails-angular-strap/engine.rb +4 -0
- data/lib/rails-angular-strap/version.rb +4 -0
- data/vendor/assets/javascripts/angular-strap.js +2 -0
- data/vendor/assets/javascripts/angular-strap.min.js +2 -0
- data/vendor/assets/javascripts/angular-strap/angular-strap.js +5014 -0
- data/vendor/assets/javascripts/angular-strap/angular-strap.min.js +11 -0
- data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.js +89 -0
- data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/affix.js +249 -0
- data/vendor/assets/javascripts/angular-strap/modules/affix.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/affix.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/alert.js +120 -0
- data/vendor/assets/javascripts/angular-strap/modules/alert.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/alert.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/aside.js +96 -0
- data/vendor/assets/javascripts/angular-strap/modules/aside.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/aside.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/button.js +177 -0
- data/vendor/assets/javascripts/angular-strap/modules/button.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/button.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/collapse.js +273 -0
- data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.js +61 -0
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.js +273 -0
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.js +640 -0
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/debounce.js +62 -0
- data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.js +156 -0
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.js +149 -0
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/modal.js +349 -0
- data/vendor/assets/javascripts/angular-strap/modules/modal.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/modal.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/navbar.js +72 -0
- data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.js +76 -0
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/popover.js +112 -0
- data/vendor/assets/javascripts/angular-strap/modules/popover.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/popover.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/raf.js +61 -0
- data/vendor/assets/javascripts/angular-strap/modules/raf.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/raf.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.js +261 -0
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/select.js +325 -0
- data/vendor/assets/javascripts/angular-strap/modules/select.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/select.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/select.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/select.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/tab.js +186 -0
- data/vendor/assets/javascripts/angular-strap/modules/tab.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/tab.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.js +485 -0
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.js +690 -0
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.js +266 -0
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.min.js +8 -0
- metadata +143 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-01-11
|
4
|
+
* @link http://mgcrea.github.io/angular-strap
|
5
|
+
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
+
*/
|
8
|
+
"use strict";angular.module("mgcrea.ngStrap.tooltip",["mgcrea.ngStrap.helpers.dimensions"]).provider("$tooltip",function(){var t=this.defaults={animation:"am-fade",customClass:"",prefixClass:"tooltip",prefixEvent:"tooltip",container:!1,target:!1,placement:"top",template:"tooltip/tooltip.tpl.html",contentTemplate:!1,trigger:"hover focus",keyboard:!1,html:!1,show:!1,title:"",type:"",delay:0,autoClose:!1,bsEnabled:!0};this.$get=["$window","$rootScope","$compile","$q","$templateCache","$http","$animate","$sce","dimensions","$$rAF","$timeout",function(e,n,o,i,a,l,r,s,u,c,f){function p(e,i){function a(){K.$emit(O.prefixEvent+".show",F)}function l(){if(K.$emit(O.prefixEvent+".hide",F),q===W){if(R&&"focus"===O.trigger)return e[0].blur();P()}}function p(){var t=O.trigger.split(" ");angular.forEach(t,function(t){"click"===t?e.on("click",F.toggle):"manual"!==t&&(e.on("hover"===t?"mouseenter":"focus",F.enter),e.on("hover"===t?"mouseleave":"blur",F.leave),"button"===A&&"hover"!==t&&e.on($?"touchstart":"mousedown",F.$onFocusElementMouseDown))})}function v(){for(var t=O.trigger.split(" "),n=t.length;n--;){var o=t[n];"click"===o?e.off("click",F.toggle):"manual"!==o&&(e.off("hover"===o?"mouseenter":"focus",F.enter),e.off("hover"===o?"mouseleave":"blur",F.leave),"button"===A&&"hover"!==o&&e.off($?"touchstart":"mousedown",F.$onFocusElementMouseDown))}}function y(){"focus"!==O.trigger?q.on("keyup",F.$onKeyUp):e.on("keyup",F.$onFocusKeyUp)}function k(){"focus"!==O.trigger?q.off("keyup",F.$onKeyUp):e.off("keyup",F.$onFocusKeyUp)}function S(){f(function(){q.on("click",E),w.on("click",F.hide),z=!0},0,!1)}function C(){z&&(q.off("click",E),w.off("click",F.hide),z=!1)}function E(t){t.stopPropagation()}function x(t){t=t||O.target||e;var n=t[0],o=n.getBoundingClientRect();null===o.width&&(o=angular.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var i;return i="body"===O.container?u.offset(n):u.position(n),angular.extend({},o,i)}function D(t,e,n,o){var i,a=t.split("-");switch(a[0]){case"right":i={top:e.top+e.height/2-o/2,left:e.left+e.width};break;case"bottom":i={top:e.top+e.height,left:e.left+e.width/2-n/2};break;case"left":i={top:e.top+e.height/2-o/2,left:e.left-n};break;default:i={top:e.top-o,left:e.left+e.width/2-n/2}}if(!a[1])return i;if("top"===a[0]||"bottom"===a[0])switch(a[1]){case"left":i.left=e.left;break;case"right":i.left=e.left+e.width-n}else if("left"===a[0]||"right"===a[0])switch(a[1]){case"top":i.top=e.top-o;break;case"bottom":i.top=e.top+e.height}return i}function T(t,e){q.css({top:t+"px",left:e+"px"})}function P(){clearTimeout(H),F.$isShown&&null!==q&&(O.autoClose&&C(),O.keyboard&&k()),B&&(B.$destroy(),B=null),q&&(q.remove(),q=F.$element=null)}var F={},A=e[0].nodeName.toLowerCase(),O=F.$options=angular.extend({},t,i);F.$promise=g(O.template);var K=F.$scope=O.scope&&O.scope.$new()||n.$new();if(O.delay&&angular.isString(O.delay)){var U=O.delay.split(",").map(parseFloat);O.delay=U.length>1?{show:U[0],hide:U[1]}:U[0]}F.$id=O.id||e.attr("id")||"",O.title&&(K.title=s.trustAsHtml(O.title)),K.$setEnabled=function(t){K.$$postDigest(function(){F.setEnabled(t)})},K.$hide=function(){K.$$postDigest(function(){F.hide()})},K.$show=function(){K.$$postDigest(function(){F.show()})},K.$toggle=function(){K.$$postDigest(function(){F.toggle()})},F.$isShown=K.$isShown=!1;var H,M;O.contentTemplate&&(F.$promise=F.$promise.then(function(t){var e=angular.element(t);return g(O.contentTemplate).then(function(t){var n=d('[ng-bind="content"]',e[0]);return n.length||(n=d('[ng-bind="title"]',e[0])),n.removeAttr("ng-bind").html(t),e[0].outerHTML})}));var j,q,L,N,B;F.$promise.then(function(t){angular.isObject(t)&&(t=t.data),O.html&&(t=t.replace(b,'ng-bind-html="')),t=m.apply(t),L=t,j=o(t),F.init()}),F.init=function(){O.delay&&angular.isNumber(O.delay)&&(O.delay={show:O.delay,hide:O.delay}),"self"===O.container?N=e:angular.isElement(O.container)?N=O.container:O.container&&(N=d(O.container)),p(),O.target&&(O.target=angular.isElement(O.target)?O.target:d(O.target)),O.show&&K.$$postDigest(function(){"focus"===O.trigger?e[0].focus():F.show()})},F.destroy=function(){v(),P(),K.$destroy()},F.enter=function(){return clearTimeout(H),M="in",O.delay&&O.delay.show?void(H=setTimeout(function(){"in"===M&&F.show()},O.delay.show)):F.show()},F.show=function(){if(O.bsEnabled&&!F.$isShown){K.$emit(O.prefixEvent+".show.before",F);var t,n;O.container?(t=N,n=N[0].lastChild?angular.element(N[0].lastChild):null):(t=null,n=e),q&&P(),B=F.$scope.$new(),q=F.$element=j(B,function(){}),q.css({top:"-9999px",left:"-9999px",display:"block",visibility:"hidden"}),O.animation&&q.addClass(O.animation),O.type&&q.addClass(O.prefixClass+"-"+O.type),O.customClass&&q.addClass(O.customClass);var o=r.enter(q,t,n,a);o&&o.then&&o.then(a),F.$isShown=K.$isShown=!0,h(K),c(function(){F.$applyPlacement(),q&&q.css({visibility:"visible"})}),O.keyboard&&("focus"!==O.trigger&&F.focus(),y()),O.autoClose&&S()}},F.leave=function(){return clearTimeout(H),M="out",O.delay&&O.delay.hide?void(H=setTimeout(function(){"out"===M&&F.hide()},O.delay.hide)):F.hide()};var R,W;F.hide=function(t){if(F.$isShown){K.$emit(O.prefixEvent+".hide.before",F),R=t,W=q;var e=r.leave(q,l);e&&e.then&&e.then(l),F.$isShown=K.$isShown=!1,h(K),O.keyboard&&null!==q&&k(),O.autoClose&&null!==q&&C()}},F.toggle=function(){F.$isShown?F.leave():F.enter()},F.focus=function(){q[0].focus()},F.setEnabled=function(t){O.bsEnabled=t},F.$applyPlacement=function(){if(q){var n=O.placement,o=/\s?auto?\s?/i,i=o.test(n);i&&(n=n.replace(o,"")||t.placement),q.addClass(O.placement);var a=x(),l=q.prop("offsetWidth"),r=q.prop("offsetHeight");if(i){var s=n,u=O.container?angular.element(document.querySelector(O.container)):e.parent(),c=x(u);s.indexOf("bottom")>=0&&a.bottom+r>c.bottom?n=s.replace("bottom","top"):s.indexOf("top")>=0&&a.top-r<c.top&&(n=s.replace("top","bottom")),("right"===s||"bottom-left"===s||"top-left"===s)&&a.right+l>c.width?n="right"===s?"left":n.replace("left","right"):("left"===s||"bottom-right"===s||"top-right"===s)&&a.left-l<c.left&&(n="left"===s?"right":n.replace("right","left")),q.removeClass(s).addClass(n)}var f=D(n,a,l,r);T(f.top,f.left)}},F.$onKeyUp=function(t){27===t.which&&F.$isShown&&(F.hide(),t.stopPropagation())},F.$onFocusKeyUp=function(t){27===t.which&&(e[0].blur(),t.stopPropagation())},F.$onFocusElementMouseDown=function(t){t.preventDefault(),t.stopPropagation(),F.$isShown?e[0].blur():e[0].focus()};var z=!1;return F}function h(t){t.$$phase||t.$root&&t.$root.$$phase||t.$digest()}function d(t,e){return angular.element((e||document).querySelectorAll(t))}function g(t){return v[t]?v[t]:v[t]=i.when(a.get(t)||l.get(t)).then(function(e){return angular.isObject(e)?(a.put(t,e.data),e.data):e})}var m=String.prototype.trim,$="createTouch"in e.document,b=/ng-bind="/gi,w=angular.element(e.document),v={};return p}]}).directive("bsTooltip",["$window","$location","$sce","$tooltip","$$rAF",function(t,e,n,o,i){return{restrict:"EAC",scope:!0,link:function(t,e,a){var l={scope:t};angular.forEach(["template","contentTemplate","placement","container","target","delay","trigger","keyboard","html","animation","backdropAnimation","type","customClass","id"],function(t){angular.isDefined(a[t])&&(l[t]=a[t])}),t.hasOwnProperty("title")||(t.title=""),a.$observe("title",function(e){if(angular.isDefined(e)||!t.hasOwnProperty("title")){var o=t.title;t.title=n.trustAsHtml(e),angular.isDefined(o)&&i(function(){r&&r.$applyPlacement()})}}),a.bsTooltip&&t.$watch(a.bsTooltip,function(e,n){angular.isObject(e)?angular.extend(t,e):t.title=e,angular.isDefined(n)&&i(function(){r&&r.$applyPlacement()})},!0),a.bsShow&&t.$watch(a.bsShow,function(t){r&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|,?(tooltip),?/i)),t===!0?r.show():r.hide())}),a.bsEnabled&&t.$watch(a.bsEnabled,function(t){r&&angular.isDefined(t)&&(angular.isString(t)&&(t=!!t.match(/true|1|,?(tooltip),?/i)),r.setEnabled(t===!1?!1:!0))});var r=o(e,l);t.$on("$destroy",function(){r&&r.destroy(),l=null,r=null})}}}]);
|
9
|
+
//# sourceMappingURL=tooltip.min.js.map
|
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R,EAAS,cAAA,SAAA,GACH,KAAA,EAAA,QACJ,EAAI,GAAA,oEAMN,EAAA,iBACE,EAAI,oBAEC,SAAY,EAAS,GAAA,OAAA,EAAA,GAAA,iBAuL5B,OAAM,iBAOR,EAAI,SAAgB,EAAA,OAAA,EAAA,MAAA,SAAA,EAAA,kBAGlB,GAAQ,EAAc,SAChB,SAAS,SAAK,GAAA,UAAA,iBAAA,wBAKlB,GAAO,GAAA,EAAA,gFAIX,EAAO,IAAA,EAAA,EAAA,qBA1jBL,GAAI,OAAW,UAAA,kDAGf,EAAI,QAAW,QAAW,EAAA,uIAukBrB,oCAKL,GAAI,IAAO,MAAA,WACH,SAAQ,WAAA,kBAAA,YAAA,YAAA,SAAA,QAAA,UAAA,WAAA,OAAA,YAAA,oBAAA,OAAA,cAAA,MAAA,SAAA,0CAMZ,EAAI,eAAiB,aACrB,MAAM,+HAQV,QAAK,UAAa,IAAa,EAAK,WAC/B,GAAQ,EAAS,yBAMlB,WAAW,EAAQ,OAAA,EAAA,UAAA,SAAA,EAAA,uBAEpB,QAAA,OAAA,EAAA,aAID,QAAI,UAAY,IAAQ,EAAU,WAClC,GAAW,EAAS,yBAKtB,EAAK,QAAA,EAAa,OAAM,EAAO,OAAK,SAAW,6BAE1C,QAAC,SAAY,KAAQ,IAAU,EAAW,MAAA,wBAC7C,KAAW,EAAS,EAAA,OAAW,EAAa,8IAQxB,EAAA,WAAtB,KAAU,GAAuB,GAAA,8DASpC,EAAA","file":"tooltip.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.tooltip', ['mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$tooltip', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n customClass: '',\n prefixClass: 'tooltip',\n prefixEvent: 'tooltip',\n container: false,\n target: false,\n placement: 'top',\n template: 'tooltip/tooltip.tpl.html',\n contentTemplate: false,\n trigger: 'hover focus',\n keyboard: false,\n html: false,\n show: false,\n title: '',\n type: '',\n delay: 0,\n autoClose: false,\n bsEnabled: true\n };\n\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $sce, dimensions, $$rAF, $timeout) {\n\n var trim = String.prototype.trim;\n var isTouch = 'createTouch' in $window.document;\n var htmlReplaceRegExp = /ng-bind=\"/ig;\n var $body = angular.element($window.document);\n\n function TooltipFactory(element, config) {\n\n var $tooltip = {};\n\n // Common vars\n var nodeName = element[0].nodeName.toLowerCase();\n var options = $tooltip.$options = angular.extend({}, defaults, config);\n $tooltip.$promise = fetchTemplate(options.template);\n var scope = $tooltip.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n if(options.delay && angular.isString(options.delay)) {\n var split = options.delay.split(',').map(parseFloat);\n options.delay = split.length > 1 ? {show: split[0], hide: split[1]} : split[0];\n }\n\n // store $id to identify the triggering element in events\n // give priority to options.id, otherwise, try to use\n // element id if defined\n $tooltip.$id = options.id || element.attr('id') || '';\n\n // Support scope as string options\n if(options.title) {\n scope.title = $sce.trustAsHtml(options.title);\n }\n\n // Provide scope helpers\n scope.$setEnabled = function(isEnabled) {\n scope.$$postDigest(function() {\n $tooltip.setEnabled(isEnabled);\n });\n };\n scope.$hide = function() {\n scope.$$postDigest(function() {\n $tooltip.hide();\n });\n };\n scope.$show = function() {\n scope.$$postDigest(function() {\n $tooltip.show();\n });\n };\n scope.$toggle = function() {\n scope.$$postDigest(function() {\n $tooltip.toggle();\n });\n };\n // Publish isShown as a protected var on scope\n $tooltip.$isShown = scope.$isShown = false;\n\n // Private vars\n var timeout, hoverState;\n\n // Support contentTemplate option\n if(options.contentTemplate) {\n $tooltip.$promise = $tooltip.$promise.then(function(template) {\n var templateEl = angular.element(template);\n return fetchTemplate(options.contentTemplate)\n .then(function(contentTemplate) {\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]);\n if(!contentEl.length) contentEl = findElement('[ng-bind=\"title\"]', templateEl[0]);\n contentEl.removeAttr('ng-bind').html(contentTemplate);\n return templateEl[0].outerHTML;\n });\n });\n }\n\n // Fetch, compile then initialize tooltip\n var tipLinker, tipElement, tipTemplate, tipContainer, tipScope;\n $tooltip.$promise.then(function(template) {\n if(angular.isObject(template)) template = template.data;\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\n template = trim.apply(template);\n tipTemplate = template;\n tipLinker = $compile(template);\n $tooltip.init();\n });\n\n $tooltip.init = function() {\n\n // Options: delay\n if (options.delay && angular.isNumber(options.delay)) {\n options.delay = {\n show: options.delay,\n hide: options.delay\n };\n }\n\n // Replace trigger on touch devices ?\n // if(isTouch && options.trigger === defaults.trigger) {\n // options.trigger.replace(/hover/g, 'click');\n // }\n\n // Options : container\n if(options.container === 'self') {\n tipContainer = element;\n } else if(angular.isElement(options.container)) {\n tipContainer = options.container;\n } else if(options.container) {\n tipContainer = findElement(options.container);\n }\n\n // Options: trigger\n bindTriggerEvents();\n\n // Options: target\n if(options.target) {\n options.target = angular.isElement(options.target) ? options.target : findElement(options.target);\n }\n\n // Options: show\n if(options.show) {\n scope.$$postDigest(function() {\n options.trigger === 'focus' ? element[0].focus() : $tooltip.show();\n });\n }\n\n };\n\n $tooltip.destroy = function() {\n\n // Unbind events\n unbindTriggerEvents();\n\n // Remove element\n destroyTipElement();\n\n // Destroy scope\n scope.$destroy();\n\n };\n\n $tooltip.enter = function() {\n\n clearTimeout(timeout);\n hoverState = 'in';\n if (!options.delay || !options.delay.show) {\n return $tooltip.show();\n }\n\n timeout = setTimeout(function() {\n if (hoverState ==='in') $tooltip.show();\n }, options.delay.show);\n\n };\n\n $tooltip.show = function() {\n if (!options.bsEnabled || $tooltip.$isShown) return;\n\n scope.$emit(options.prefixEvent + '.show.before', $tooltip);\n var parent, after;\n if (options.container) {\n parent = tipContainer;\n if (tipContainer[0].lastChild) {\n after = angular.element(tipContainer[0].lastChild);\n } else {\n after = null;\n }\n } else {\n parent = null;\n after = element;\n }\n\n\n // Hide any existing tipElement\n if(tipElement) destroyTipElement();\n // Fetch a cloned element linked from template\n tipScope = $tooltip.$scope.$new();\n tipElement = $tooltip.$element = tipLinker(tipScope, function(clonedElement, scope) {});\n\n // Set the initial positioning. Make the tooltip invisible\n // so IE doesn't try to focus on it off screen.\n tipElement.css({top: '-9999px', left: '-9999px', display: 'block', visibility: 'hidden'});\n\n // Options: animation\n if(options.animation) tipElement.addClass(options.animation);\n // Options: type\n if(options.type) tipElement.addClass(options.prefixClass + '-' + options.type);\n // Options: custom classes\n if(options.customClass) tipElement.addClass(options.customClass);\n\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.enter(tipElement, parent, after, enterAnimateCallback);\n if(promise && promise.then) promise.then(enterAnimateCallback);\n\n $tooltip.$isShown = scope.$isShown = true;\n safeDigest(scope);\n $$rAF(function () {\n $tooltip.$applyPlacement();\n\n // Once placed, make the tooltip visible\n if(tipElement) tipElement.css({visibility: 'visible'});\n }); // var a = bodyEl.offsetWidth + 1; ?\n\n // Bind events\n if(options.keyboard) {\n if(options.trigger !== 'focus') {\n $tooltip.focus();\n }\n bindKeyboardEvents();\n }\n\n if(options.autoClose) {\n bindAutoCloseEvents();\n }\n\n };\n\n function enterAnimateCallback() {\n scope.$emit(options.prefixEvent + '.show', $tooltip);\n }\n\n $tooltip.leave = function() {\n\n clearTimeout(timeout);\n hoverState = 'out';\n if (!options.delay || !options.delay.hide) {\n return $tooltip.hide();\n }\n timeout = setTimeout(function () {\n if (hoverState === 'out') {\n $tooltip.hide();\n }\n }, options.delay.hide);\n\n };\n\n var _blur;\n var _tipToHide;\n $tooltip.hide = function(blur) {\n\n if(!$tooltip.$isShown) return;\n scope.$emit(options.prefixEvent + '.hide.before', $tooltip);\n\n // store blur value for leaveAnimateCallback to use\n _blur = blur;\n\n // store current tipElement reference to use\n // in leaveAnimateCallback\n _tipToHide = tipElement;\n\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.leave(tipElement, leaveAnimateCallback);\n if(promise && promise.then) promise.then(leaveAnimateCallback);\n\n $tooltip.$isShown = scope.$isShown = false;\n safeDigest(scope);\n\n // Unbind events\n if(options.keyboard && tipElement !== null) {\n unbindKeyboardEvents();\n }\n\n if(options.autoClose && tipElement !== null) {\n unbindAutoCloseEvents();\n }\n };\n\n function leaveAnimateCallback() {\n scope.$emit(options.prefixEvent + '.hide', $tooltip);\n\n // check if current tipElement still references\n // the same element when hide was called\n if (tipElement === _tipToHide) {\n // Allow to blur the input when hidden, like when pressing enter key\n if(_blur && options.trigger === 'focus') {\n return element[0].blur();\n }\n\n // clean up child scopes\n destroyTipElement();\n }\n }\n\n $tooltip.toggle = function() {\n $tooltip.$isShown ? $tooltip.leave() : $tooltip.enter();\n };\n\n $tooltip.focus = function() {\n tipElement[0].focus();\n };\n\n $tooltip.setEnabled = function(isEnabled) {\n options.bsEnabled = isEnabled;\n };\n\n // Protected methods\n\n $tooltip.$applyPlacement = function() {\n if(!tipElement) return;\n\n // Determine if we're doing an auto or normal placement\n var placement = options.placement,\n autoToken = /\\s?auto?\\s?/i,\n autoPlace = autoToken.test(placement);\n\n if (autoPlace) {\n placement = placement.replace(autoToken, '') || defaults.placement;\n }\n\n // Need to add the position class before we get\n // the offsets\n tipElement.addClass(options.placement);\n\n // Get the position of the target element\n // and the height and width of the tooltip so we can center it.\n var elementPosition = getPosition(),\n tipWidth = tipElement.prop('offsetWidth'),\n tipHeight = tipElement.prop('offsetHeight');\n\n // If we're auto placing, we need to check the positioning\n if (autoPlace) {\n var originalPlacement = placement;\n var container = options.container ? angular.element(document.querySelector(options.container)) : element.parent();\n var containerPosition = getPosition(container);\n\n // Determine if the vertical placement\n if (originalPlacement.indexOf('bottom') >= 0 && elementPosition.bottom + tipHeight > containerPosition.bottom) {\n placement = originalPlacement.replace('bottom', 'top');\n } else if (originalPlacement.indexOf('top') >= 0 && elementPosition.top - tipHeight < containerPosition.top) {\n placement = originalPlacement.replace('top', 'bottom');\n }\n\n // Determine the horizontal placement\n // The exotic placements of left and right are opposite of the standard placements. Their arrows are put on the left/right\n // and flow in the opposite direction of their placement.\n if ((originalPlacement === 'right' || originalPlacement === 'bottom-left' || originalPlacement === 'top-left') &&\n elementPosition.right + tipWidth > containerPosition.width) {\n\n placement = originalPlacement === 'right' ? 'left' : placement.replace('left', 'right');\n } else if ((originalPlacement === 'left' || originalPlacement === 'bottom-right' || originalPlacement === 'top-right') &&\n elementPosition.left - tipWidth < containerPosition.left) {\n\n placement = originalPlacement === 'left' ? 'right' : placement.replace('right', 'left');\n }\n\n tipElement.removeClass(originalPlacement).addClass(placement);\n }\n\n // Get the tooltip's top and left coordinates to center it with this directive.\n var tipPosition = getCalculatedOffset(placement, elementPosition, tipWidth, tipHeight);\n applyPlacementCss(tipPosition.top, tipPosition.left);\n };\n\n $tooltip.$onKeyUp = function(evt) {\n if (evt.which === 27 && $tooltip.$isShown) {\n $tooltip.hide();\n evt.stopPropagation();\n }\n };\n\n $tooltip.$onFocusKeyUp = function(evt) {\n if (evt.which === 27) {\n element[0].blur();\n evt.stopPropagation();\n }\n };\n\n $tooltip.$onFocusElementMouseDown = function(evt) {\n evt.preventDefault();\n evt.stopPropagation();\n // Some browsers do not auto-focus buttons (eg. Safari)\n $tooltip.$isShown ? element[0].blur() : element[0].focus();\n };\n\n // bind/unbind events\n function bindTriggerEvents() {\n var triggers = options.trigger.split(' ');\n angular.forEach(triggers, function(trigger) {\n if(trigger === 'click') {\n element.on('click', $tooltip.toggle);\n } else if(trigger !== 'manual') {\n element.on(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\n element.on(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\n nodeName === 'button' && trigger !== 'hover' && element.on(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\n }\n });\n }\n\n function unbindTriggerEvents() {\n var triggers = options.trigger.split(' ');\n for (var i = triggers.length; i--;) {\n var trigger = triggers[i];\n if(trigger === 'click') {\n element.off('click', $tooltip.toggle);\n } else if(trigger !== 'manual') {\n element.off(trigger === 'hover' ? 'mouseenter' : 'focus', $tooltip.enter);\n element.off(trigger === 'hover' ? 'mouseleave' : 'blur', $tooltip.leave);\n nodeName === 'button' && trigger !== 'hover' && element.off(isTouch ? 'touchstart' : 'mousedown', $tooltip.$onFocusElementMouseDown);\n }\n }\n }\n\n function bindKeyboardEvents() {\n if(options.trigger !== 'focus') {\n tipElement.on('keyup', $tooltip.$onKeyUp);\n } else {\n element.on('keyup', $tooltip.$onFocusKeyUp);\n }\n }\n\n function unbindKeyboardEvents() {\n if(options.trigger !== 'focus') {\n tipElement.off('keyup', $tooltip.$onKeyUp);\n } else {\n element.off('keyup', $tooltip.$onFocusKeyUp);\n }\n }\n\n var _autoCloseEventsBinded = false;\n function bindAutoCloseEvents() {\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n // Stop propagation when clicking inside tooltip\n tipElement.on('click', stopEventPropagation);\n\n // Hide when clicking outside tooltip\n $body.on('click', $tooltip.hide);\n\n _autoCloseEventsBinded = true;\n }, 0, false);\n }\n\n function unbindAutoCloseEvents() {\n if (_autoCloseEventsBinded) {\n tipElement.off('click', stopEventPropagation);\n $body.off('click', $tooltip.hide);\n _autoCloseEventsBinded = false;\n }\n }\n\n function stopEventPropagation(event) {\n event.stopPropagation();\n }\n\n // Private methods\n\n function getPosition($element) {\n $element = $element || (options.target || element);\n\n var el = $element[0];\n\n var elRect = el.getBoundingClientRect();\n if (elRect.width === null) {\n // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093\n elRect = angular.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top });\n }\n\n var elPos;\n if (options.container === 'body') {\n elPos = dimensions.offset(el);\n } else {\n elPos = dimensions.position(el);\n }\n\n return angular.extend({}, elRect, elPos);\n }\n\n function getCalculatedOffset(placement, position, actualWidth, actualHeight) {\n var offset;\n var split = placement.split('-');\n\n switch (split[0]) {\n case 'right':\n offset = {\n top: position.top + position.height / 2 - actualHeight / 2,\n left: position.left + position.width\n };\n break;\n case 'bottom':\n offset = {\n top: position.top + position.height,\n left: position.left + position.width / 2 - actualWidth / 2\n };\n break;\n case 'left':\n offset = {\n top: position.top + position.height / 2 - actualHeight / 2,\n left: position.left - actualWidth\n };\n break;\n default:\n offset = {\n top: position.top - actualHeight,\n left: position.left + position.width / 2 - actualWidth / 2\n };\n break;\n }\n\n if(!split[1]) {\n return offset;\n }\n\n // Add support for corners @todo css\n if(split[0] === 'top' || split[0] === 'bottom') {\n switch (split[1]) {\n case 'left':\n offset.left = position.left;\n break;\n case 'right':\n offset.left = position.left + position.width - actualWidth;\n }\n } else if(split[0] === 'left' || split[0] === 'right') {\n switch (split[1]) {\n case 'top':\n offset.top = position.top - actualHeight;\n break;\n case 'bottom':\n offset.top = position.top + position.height;\n }\n }\n\n return offset;\n }\n\n function applyPlacementCss(top, left) {\n tipElement.css({ top: top + 'px', left: left + 'px' });\n }\n\n function destroyTipElement() {\n // Cancel pending callbacks\n clearTimeout(timeout);\n\n if($tooltip.$isShown && tipElement !== null) {\n if(options.autoClose) {\n unbindAutoCloseEvents();\n }\n\n if(options.keyboard) {\n unbindKeyboardEvents();\n }\n }\n\n if(tipScope) {\n tipScope.$destroy();\n tipScope = null;\n }\n\n if(tipElement) {\n tipElement.remove();\n tipElement = $tooltip.$element = null;\n }\n }\n\n return $tooltip;\n\n }\n\n // Helper functions\n\n function safeDigest(scope) {\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\n }\n\n function findElement(query, element) {\n return angular.element((element || document).querySelectorAll(query));\n }\n\n var fetchPromises = {};\n function fetchTemplate(template) {\n if(fetchPromises[template]) return fetchPromises[template];\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\n .then(function(res) {\n if(angular.isObject(res)) {\n $templateCache.put(template, res.data);\n return res.data;\n }\n return res;\n }));\n }\n\n return TooltipFactory;\n\n };\n\n })\n\n .directive('bsTooltip', function($window, $location, $sce, $tooltip, $$rAF) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['template', 'contentTemplate', 'placement', 'container', 'target', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'backdropAnimation', 'type', 'customClass', 'id'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // overwrite inherited title value when no value specified\n // fix for angular 1.3.1 531a8de72c439d8ddd064874bf364c00cedabb11\n if (!scope.hasOwnProperty('title')){\n scope.title = '';\n }\n\n // Observe scope attributes for change\n attr.$observe('title', function(newValue) {\n if (angular.isDefined(newValue) || !scope.hasOwnProperty('title')) {\n var oldValue = scope.title;\n scope.title = $sce.trustAsHtml(newValue);\n angular.isDefined(oldValue) && $$rAF(function() {\n tooltip && tooltip.$applyPlacement();\n });\n }\n });\n\n // Support scope as an object\n attr.bsTooltip && scope.$watch(attr.bsTooltip, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.title = newValue;\n }\n angular.isDefined(oldValue) && $$rAF(function() {\n tooltip && tooltip.$applyPlacement();\n });\n }, true);\n\n // Visibility binding support\n attr.bsShow && scope.$watch(attr.bsShow, function(newValue, oldValue) {\n if(!tooltip || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|,?(tooltip),?/i);\n newValue === true ? tooltip.show() : tooltip.hide();\n });\n\n // Enabled binding support\n attr.bsEnabled && scope.$watch(attr.bsEnabled, function(newValue, oldValue) {\n // console.warn('scope.$watch(%s)', attr.bsEnabled, newValue, oldValue);\n if(!tooltip || !angular.isDefined(newValue)) return;\n if(angular.isString(newValue)) newValue = !!newValue.match(/true|1|,?(tooltip),?/i);\n newValue === false ? tooltip.setEnabled(false) : tooltip.setEnabled(true);\n });\n\n // Initialize popover\n var tooltip = $tooltip(element, options);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if(tooltip) tooltip.destroy();\n options = null;\n tooltip = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-01-11
|
4
|
+
* @link http://mgcrea.github.io/angular-strap
|
5
|
+
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
+
*/
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
angular.module('mgcrea.ngStrap.tooltip').run(['$templateCache', function($templateCache) {
|
11
|
+
|
12
|
+
$templateCache.put('tooltip/tooltip.tpl.html', '<div class="tooltip in" ng-show="title"><div class="tooltip-arrow"></div><div class="tooltip-inner" ng-bind="title"></div></div>');
|
13
|
+
|
14
|
+
}]);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-01-11
|
4
|
+
* @link http://mgcrea.github.io/angular-strap
|
5
|
+
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
+
*/
|
8
|
+
"use strict";angular.module("mgcrea.ngStrap.tooltip").run(["$templateCache",function(t){t.put("tooltip/tooltip.tpl.html",'<div class="tooltip in" ng-show="title"><div class="tooltip-arrow"></div><div class="tooltip-inner" ng-bind="title"></div></div>')}]);
|
@@ -0,0 +1,266 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-01-11
|
4
|
+
* @link http://mgcrea.github.io/angular-strap
|
5
|
+
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
+
*/
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
angular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])
|
11
|
+
|
12
|
+
.provider('$typeahead', function() {
|
13
|
+
|
14
|
+
var defaults = this.defaults = {
|
15
|
+
animation: 'am-fade',
|
16
|
+
prefixClass: 'typeahead',
|
17
|
+
prefixEvent: '$typeahead',
|
18
|
+
placement: 'bottom-left',
|
19
|
+
template: 'typeahead/typeahead.tpl.html',
|
20
|
+
trigger: 'focus',
|
21
|
+
container: false,
|
22
|
+
keyboard: true,
|
23
|
+
html: false,
|
24
|
+
delay: 0,
|
25
|
+
minLength: 1,
|
26
|
+
filter: 'filter',
|
27
|
+
limit: 6,
|
28
|
+
comparator: ''
|
29
|
+
};
|
30
|
+
|
31
|
+
this.$get = ["$window", "$rootScope", "$tooltip", "$timeout", function($window, $rootScope, $tooltip, $timeout) {
|
32
|
+
|
33
|
+
var bodyEl = angular.element($window.document.body);
|
34
|
+
|
35
|
+
function TypeaheadFactory(element, controller, config) {
|
36
|
+
|
37
|
+
var $typeahead = {};
|
38
|
+
|
39
|
+
// Common vars
|
40
|
+
var options = angular.extend({}, defaults, config);
|
41
|
+
|
42
|
+
$typeahead = $tooltip(element, options);
|
43
|
+
var parentScope = config.scope;
|
44
|
+
var scope = $typeahead.$scope;
|
45
|
+
|
46
|
+
scope.$resetMatches = function(){
|
47
|
+
scope.$matches = [];
|
48
|
+
scope.$activeIndex = 0;
|
49
|
+
};
|
50
|
+
scope.$resetMatches();
|
51
|
+
|
52
|
+
scope.$activate = function(index) {
|
53
|
+
scope.$$postDigest(function() {
|
54
|
+
$typeahead.activate(index);
|
55
|
+
});
|
56
|
+
};
|
57
|
+
|
58
|
+
scope.$select = function(index, evt) {
|
59
|
+
scope.$$postDigest(function() {
|
60
|
+
$typeahead.select(index);
|
61
|
+
});
|
62
|
+
};
|
63
|
+
|
64
|
+
scope.$isVisible = function() {
|
65
|
+
return $typeahead.$isVisible();
|
66
|
+
};
|
67
|
+
|
68
|
+
// Public methods
|
69
|
+
|
70
|
+
$typeahead.update = function(matches) {
|
71
|
+
scope.$matches = matches;
|
72
|
+
if(scope.$activeIndex >= matches.length) {
|
73
|
+
scope.$activeIndex = 0;
|
74
|
+
}
|
75
|
+
};
|
76
|
+
|
77
|
+
$typeahead.activate = function(index) {
|
78
|
+
scope.$activeIndex = index;
|
79
|
+
};
|
80
|
+
|
81
|
+
$typeahead.select = function(index) {
|
82
|
+
var value = scope.$matches[index].value;
|
83
|
+
// console.log('$setViewValue', value);
|
84
|
+
controller.$setViewValue(value);
|
85
|
+
controller.$render();
|
86
|
+
scope.$resetMatches();
|
87
|
+
if(parentScope) parentScope.$digest();
|
88
|
+
// Emit event
|
89
|
+
scope.$emit(options.prefixEvent + '.select', value, index, $typeahead);
|
90
|
+
};
|
91
|
+
|
92
|
+
// Protected methods
|
93
|
+
|
94
|
+
$typeahead.$isVisible = function() {
|
95
|
+
if(!options.minLength || !controller) {
|
96
|
+
return !!scope.$matches.length;
|
97
|
+
}
|
98
|
+
// minLength support
|
99
|
+
return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;
|
100
|
+
};
|
101
|
+
|
102
|
+
$typeahead.$getIndex = function(value) {
|
103
|
+
var l = scope.$matches.length, i = l;
|
104
|
+
if(!l) return;
|
105
|
+
for(i = l; i--;) {
|
106
|
+
if(scope.$matches[i].value === value) break;
|
107
|
+
}
|
108
|
+
if(i < 0) return;
|
109
|
+
return i;
|
110
|
+
};
|
111
|
+
|
112
|
+
$typeahead.$onMouseDown = function(evt) {
|
113
|
+
// Prevent blur on mousedown
|
114
|
+
evt.preventDefault();
|
115
|
+
evt.stopPropagation();
|
116
|
+
};
|
117
|
+
|
118
|
+
$typeahead.$onKeyDown = function(evt) {
|
119
|
+
if(!/(38|40|13)/.test(evt.keyCode)) return;
|
120
|
+
|
121
|
+
// Let ngSubmit pass if the typeahead tip is hidden
|
122
|
+
if($typeahead.$isVisible()) {
|
123
|
+
evt.preventDefault();
|
124
|
+
evt.stopPropagation();
|
125
|
+
}
|
126
|
+
|
127
|
+
// Select with enter
|
128
|
+
if(evt.keyCode === 13 && scope.$matches.length) {
|
129
|
+
$typeahead.select(scope.$activeIndex);
|
130
|
+
}
|
131
|
+
|
132
|
+
// Navigate with keyboard
|
133
|
+
else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;
|
134
|
+
else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;
|
135
|
+
else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;
|
136
|
+
scope.$digest();
|
137
|
+
};
|
138
|
+
|
139
|
+
// Overrides
|
140
|
+
|
141
|
+
var show = $typeahead.show;
|
142
|
+
$typeahead.show = function() {
|
143
|
+
show();
|
144
|
+
// use timeout to hookup the events to prevent
|
145
|
+
// event bubbling from being processed imediately.
|
146
|
+
$timeout(function() {
|
147
|
+
$typeahead.$element.on('mousedown', $typeahead.$onMouseDown);
|
148
|
+
if(options.keyboard) {
|
149
|
+
element.on('keydown', $typeahead.$onKeyDown);
|
150
|
+
}
|
151
|
+
}, 0, false);
|
152
|
+
};
|
153
|
+
|
154
|
+
var hide = $typeahead.hide;
|
155
|
+
$typeahead.hide = function() {
|
156
|
+
$typeahead.$element.off('mousedown', $typeahead.$onMouseDown);
|
157
|
+
if(options.keyboard) {
|
158
|
+
element.off('keydown', $typeahead.$onKeyDown);
|
159
|
+
}
|
160
|
+
hide();
|
161
|
+
};
|
162
|
+
|
163
|
+
return $typeahead;
|
164
|
+
|
165
|
+
}
|
166
|
+
|
167
|
+
TypeaheadFactory.defaults = defaults;
|
168
|
+
return TypeaheadFactory;
|
169
|
+
|
170
|
+
}];
|
171
|
+
|
172
|
+
})
|
173
|
+
|
174
|
+
.directive('bsTypeahead', ["$window", "$parse", "$q", "$typeahead", "$parseOptions", function($window, $parse, $q, $typeahead, $parseOptions) {
|
175
|
+
|
176
|
+
var defaults = $typeahead.defaults;
|
177
|
+
|
178
|
+
return {
|
179
|
+
restrict: 'EAC',
|
180
|
+
require: 'ngModel',
|
181
|
+
link: function postLink(scope, element, attr, controller) {
|
182
|
+
|
183
|
+
// Directive options
|
184
|
+
var options = {scope: scope};
|
185
|
+
angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator', 'id'], function(key) {
|
186
|
+
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
187
|
+
});
|
188
|
+
|
189
|
+
// Build proper ngOptions
|
190
|
+
var filter = options.filter || defaults.filter;
|
191
|
+
var limit = options.limit || defaults.limit;
|
192
|
+
var comparator = options.comparator || defaults.comparator;
|
193
|
+
|
194
|
+
var ngOptions = attr.ngOptions;
|
195
|
+
if(filter) ngOptions += ' | ' + filter + ':$viewValue';
|
196
|
+
if (comparator) ngOptions += ':' + comparator;
|
197
|
+
if(limit) ngOptions += ' | limitTo:' + limit;
|
198
|
+
var parsedOptions = $parseOptions(ngOptions);
|
199
|
+
|
200
|
+
// Initialize typeahead
|
201
|
+
var typeahead = $typeahead(element, controller, options);
|
202
|
+
|
203
|
+
// Watch options on demand
|
204
|
+
if(options.watchOptions) {
|
205
|
+
// Watch ngOptions values before filtering for changes, drop function calls
|
206
|
+
var watchedOptions = parsedOptions.$match[7].replace(/\|.+/, '').replace(/\(.*\)/g, '').trim();
|
207
|
+
scope.$watch(watchedOptions, function (newValue, oldValue) {
|
208
|
+
// console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);
|
209
|
+
parsedOptions.valuesFn(scope, controller).then(function (values) {
|
210
|
+
typeahead.update(values);
|
211
|
+
controller.$render();
|
212
|
+
});
|
213
|
+
}, true);
|
214
|
+
}
|
215
|
+
|
216
|
+
// Watch model for changes
|
217
|
+
scope.$watch(attr.ngModel, function(newValue, oldValue) {
|
218
|
+
// console.warn('$watch', element.attr('ng-model'), newValue);
|
219
|
+
scope.$modelValue = newValue; // Publish modelValue on scope for custom templates
|
220
|
+
parsedOptions.valuesFn(scope, controller)
|
221
|
+
.then(function(values) {
|
222
|
+
// Prevent input with no future prospect if selectMode is truthy
|
223
|
+
// @TODO test selectMode
|
224
|
+
if(options.selectMode && !values.length && newValue.length > 0) {
|
225
|
+
controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));
|
226
|
+
return;
|
227
|
+
}
|
228
|
+
if(values.length > limit) values = values.slice(0, limit);
|
229
|
+
var isVisible = typeahead.$isVisible();
|
230
|
+
isVisible && typeahead.update(values);
|
231
|
+
// Do not re-queue an update if a correct value has been selected
|
232
|
+
if(values.length === 1 && values[0].value === newValue) return;
|
233
|
+
!isVisible && typeahead.update(values);
|
234
|
+
// Queue a new rendering that will leverage collection loading
|
235
|
+
controller.$render();
|
236
|
+
});
|
237
|
+
});
|
238
|
+
|
239
|
+
// modelValue -> $formatters -> viewValue
|
240
|
+
controller.$formatters.push(function(modelValue) {
|
241
|
+
// console.warn('$formatter("%s"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);
|
242
|
+
var displayValue = parsedOptions.displayValue(modelValue);
|
243
|
+
return displayValue === undefined ? '' : displayValue;
|
244
|
+
});
|
245
|
+
|
246
|
+
// Model rendering in view
|
247
|
+
controller.$render = function () {
|
248
|
+
// console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);
|
249
|
+
if(controller.$isEmpty(controller.$viewValue)) return element.val('');
|
250
|
+
var index = typeahead.$getIndex(controller.$modelValue);
|
251
|
+
var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;
|
252
|
+
selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;
|
253
|
+
element.val(selected ? selected.toString().replace(/<(?:.|\n)*?>/gm, '').trim() : '');
|
254
|
+
};
|
255
|
+
|
256
|
+
// Garbage collection
|
257
|
+
scope.$on('$destroy', function() {
|
258
|
+
if (typeahead) typeahead.destroy();
|
259
|
+
options = null;
|
260
|
+
typeahead = null;
|
261
|
+
});
|
262
|
+
|
263
|
+
}
|
264
|
+
};
|
265
|
+
|
266
|
+
}]);
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-01-11
|
4
|
+
* @link http://mgcrea.github.io/angular-strap
|
5
|
+
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
+
*/
|
8
|
+
"use strict";angular.module("mgcrea.ngStrap.typeahead",["mgcrea.ngStrap.tooltip","mgcrea.ngStrap.helpers.parseOptions"]).provider("$typeahead",function(){var e=this.defaults={animation:"am-fade",prefixClass:"typeahead",prefixEvent:"$typeahead",placement:"bottom-left",template:"typeahead/typeahead.tpl.html",trigger:"focus",container:!1,keyboard:!0,html:!1,delay:0,minLength:1,filter:"filter",limit:6,comparator:""};this.$get=["$window","$rootScope","$tooltip","$timeout",function(t,n,a,i){function o(t,n,o){var r={},l=angular.extend({},e,o);r=a(t,l);var c=o.scope,s=r.$scope;s.$resetMatches=function(){s.$matches=[],s.$activeIndex=0},s.$resetMatches(),s.$activate=function(e){s.$$postDigest(function(){r.activate(e)})},s.$select=function(e){s.$$postDigest(function(){r.select(e)})},s.$isVisible=function(){return r.$isVisible()},r.update=function(e){s.$matches=e,s.$activeIndex>=e.length&&(s.$activeIndex=0)},r.activate=function(e){s.$activeIndex=e},r.select=function(e){var t=s.$matches[e].value;n.$setViewValue(t),n.$render(),s.$resetMatches(),c&&c.$digest(),s.$emit(l.prefixEvent+".select",t,e,r)},r.$isVisible=function(){return l.minLength&&n?s.$matches.length&&angular.isString(n.$viewValue)&&n.$viewValue.length>=l.minLength:!!s.$matches.length},r.$getIndex=function(e){var t=s.$matches.length,n=t;if(t){for(n=t;n--&&s.$matches[n].value!==e;);if(!(0>n))return n}},r.$onMouseDown=function(e){e.preventDefault(),e.stopPropagation()},r.$onKeyDown=function(e){/(38|40|13)/.test(e.keyCode)&&(r.$isVisible()&&(e.preventDefault(),e.stopPropagation()),13===e.keyCode&&s.$matches.length?r.select(s.$activeIndex):38===e.keyCode&&s.$activeIndex>0?s.$activeIndex--:40===e.keyCode&&s.$activeIndex<s.$matches.length-1?s.$activeIndex++:angular.isUndefined(s.$activeIndex)&&(s.$activeIndex=0),s.$digest())};var u=r.show;r.show=function(){u(),i(function(){r.$element.on("mousedown",r.$onMouseDown),l.keyboard&&t.on("keydown",r.$onKeyDown)},0,!1)};var $=r.hide;return r.hide=function(){r.$element.off("mousedown",r.$onMouseDown),l.keyboard&&t.off("keydown",r.$onKeyDown),$()},r}angular.element(t.document.body);return o.defaults=e,o}]}).directive("bsTypeahead",["$window","$parse","$q","$typeahead","$parseOptions",function(e,t,n,a,i){var o=a.defaults;return{restrict:"EAC",require:"ngModel",link:function(e,t,n,r){var l={scope:e};angular.forEach(["placement","container","delay","trigger","keyboard","html","animation","template","filter","limit","minLength","watchOptions","selectMode","comparator","id"],function(e){angular.isDefined(n[e])&&(l[e]=n[e])});var c=l.filter||o.filter,s=l.limit||o.limit,u=l.comparator||o.comparator,$=n.ngOptions;c&&($+=" | "+c+":$viewValue"),u&&($+=":"+u),s&&($+=" | limitTo:"+s);var d=i($),f=a(t,r,l);if(l.watchOptions){var p=d.$match[7].replace(/\|.+/,"").replace(/\(.*\)/g,"").trim();e.$watch(p,function(){d.valuesFn(e,r).then(function(e){f.update(e),r.$render()})},!0)}e.$watch(n.ngModel,function(t){e.$modelValue=t,d.valuesFn(e,r).then(function(e){if(l.selectMode&&!e.length&&t.length>0)return void r.$setViewValue(r.$viewValue.substring(0,r.$viewValue.length-1));e.length>s&&(e=e.slice(0,s));var n=f.$isVisible();n&&f.update(e),(1!==e.length||e[0].value!==t)&&(!n&&f.update(e),r.$render())})}),r.$formatters.push(function(e){var t=d.displayValue(e);return void 0===t?"":t}),r.$render=function(){if(r.$isEmpty(r.$viewValue))return t.val("");var e=f.$getIndex(r.$modelValue),n=angular.isDefined(e)?f.$scope.$matches[e].label:r.$viewValue;n=angular.isObject(n)?d.displayValue(n):n,t.val(n?n.toString().replace(/<(?:.|\n)*?>/gm,"").trim():"")},e.$on("$destroy",function(){f&&f.destroy(),l=null,f=null})}}}]);
|
9
|
+
//# sourceMappingURL=typeahead.min.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["typeahead/typeahead.js"],"names":[],"mappings":"qBASM,OAAA,4BAAa,yBAAA,iDAEb,aAAU,cAEV,GAAW,KAAA,UACX,UAAU,UACV,YAAM,YACN,YAAO,aACP,UAAW,cACX,SAAQ,+BACR,QAAO,QACP,WAAA,sBAGF,MAAK,cAEH,OAAI,iBAEJ,WAAS,sFAOP,GAAsB,EAAS,EAAA,GAE/B,GAAI,MAGF,EAAM,QAAW,UAAA,EAAA,WAGnB,IAAA,GAAM,EAAA,mBAGJ,cAAmB,aACjB,kDAKF,UAAM,SAAa,KACjB,aAAW,8BAKb,QAAO,SAAW,8CAMlB,WAAiB,WACjB,MAAG,GAAM,cAKX,EAAW,OAAA,SAAW,GACpB,EAAM,SAAA,kDAMN,SAAW,SAAc,GACzB,EAAA,aAAW,wBAIX,GAAA,GAAY,EAAA,SAAQ,GAAc,uDAKpC,GAAW,EAAa,YAEpB,MAAS,EAAM,YAAS,UAAA,EAAA,EAAA,4BAM5B,MAAA,GAAW,WAAY,EAIhB,EAAM,SAAS,QAAG,QAAiB,SAAA,EAAA,aAAA,EAAA,WAAA,QAAA,EAAA,YAHhC,EAAM,SAAS,UAMhB,UAAA,SAAA,qCAGT,IAAA,EAAA,EAAW,+BAGT,KAAI,EAAJ,gBAII,aAAkB,SAAI,sBAG1B,EAAG,2EAOD,EAAW,uDAMG,OAAX,SAAW,EAAY,SAAM,OAClC,EAAM,OAAA,EAAA,gEAKc,KAAlB,EAAO,SAAW,EAAA,aAAA,EAAA,SAAA,OAAA,EAAA,EAAA,eACtB,QAAkB,YAAW,EAAA,gBAAA,EAAA,aAAA,GAC3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js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.typeahead', ['mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.helpers.parseOptions'])\n\n .provider('$typeahead', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n prefixClass: 'typeahead',\n prefixEvent: '$typeahead',\n placement: 'bottom-left',\n template: 'typeahead/typeahead.tpl.html',\n trigger: 'focus',\n container: false,\n keyboard: true,\n html: false,\n delay: 0,\n minLength: 1,\n filter: 'filter',\n limit: 6,\n comparator: ''\n };\n\n this.$get = function($window, $rootScope, $tooltip, $timeout) {\n\n var bodyEl = angular.element($window.document.body);\n\n function TypeaheadFactory(element, controller, config) {\n\n var $typeahead = {};\n\n // Common vars\n var options = angular.extend({}, defaults, config);\n\n $typeahead = $tooltip(element, options);\n var parentScope = config.scope;\n var scope = $typeahead.$scope;\n\n scope.$resetMatches = function(){\n scope.$matches = [];\n scope.$activeIndex = 0;\n };\n scope.$resetMatches();\n\n scope.$activate = function(index) {\n scope.$$postDigest(function() {\n $typeahead.activate(index);\n });\n };\n\n scope.$select = function(index, evt) {\n scope.$$postDigest(function() {\n $typeahead.select(index);\n });\n };\n\n scope.$isVisible = function() {\n return $typeahead.$isVisible();\n };\n\n // Public methods\n\n $typeahead.update = function(matches) {\n scope.$matches = matches;\n if(scope.$activeIndex >= matches.length) {\n scope.$activeIndex = 0;\n }\n };\n\n $typeahead.activate = function(index) {\n scope.$activeIndex = index;\n };\n\n $typeahead.select = function(index) {\n var value = scope.$matches[index].value;\n // console.log('$setViewValue', value);\n controller.$setViewValue(value);\n controller.$render();\n scope.$resetMatches();\n if(parentScope) parentScope.$digest();\n // Emit event\n scope.$emit(options.prefixEvent + '.select', value, index, $typeahead);\n };\n\n // Protected methods\n\n $typeahead.$isVisible = function() {\n if(!options.minLength || !controller) {\n return !!scope.$matches.length;\n }\n // minLength support\n return scope.$matches.length && angular.isString(controller.$viewValue) && controller.$viewValue.length >= options.minLength;\n };\n\n $typeahead.$getIndex = function(value) {\n var l = scope.$matches.length, i = l;\n if(!l) return;\n for(i = l; i--;) {\n if(scope.$matches[i].value === value) break;\n }\n if(i < 0) return;\n return i;\n };\n\n $typeahead.$onMouseDown = function(evt) {\n // Prevent blur on mousedown\n evt.preventDefault();\n evt.stopPropagation();\n };\n\n $typeahead.$onKeyDown = function(evt) {\n if(!/(38|40|13)/.test(evt.keyCode)) return;\n\n // Let ngSubmit pass if the typeahead tip is hidden\n if($typeahead.$isVisible()) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n // Select with enter\n if(evt.keyCode === 13 && scope.$matches.length) {\n $typeahead.select(scope.$activeIndex);\n }\n\n // Navigate with keyboard\n else if(evt.keyCode === 38 && scope.$activeIndex > 0) scope.$activeIndex--;\n else if(evt.keyCode === 40 && scope.$activeIndex < scope.$matches.length - 1) scope.$activeIndex++;\n else if(angular.isUndefined(scope.$activeIndex)) scope.$activeIndex = 0;\n scope.$digest();\n };\n\n // Overrides\n\n var show = $typeahead.show;\n $typeahead.show = function() {\n show();\n // use timeout to hookup the events to prevent\n // event bubbling from being processed imediately.\n $timeout(function() {\n $typeahead.$element.on('mousedown', $typeahead.$onMouseDown);\n if(options.keyboard) {\n element.on('keydown', $typeahead.$onKeyDown);\n }\n }, 0, false);\n };\n\n var hide = $typeahead.hide;\n $typeahead.hide = function() {\n $typeahead.$element.off('mousedown', $typeahead.$onMouseDown);\n if(options.keyboard) {\n element.off('keydown', $typeahead.$onKeyDown);\n }\n hide();\n };\n\n return $typeahead;\n\n }\n\n TypeaheadFactory.defaults = defaults;\n return TypeaheadFactory;\n\n };\n\n })\n\n .directive('bsTypeahead', function($window, $parse, $q, $typeahead, $parseOptions) {\n\n var defaults = $typeahead.defaults;\n\n return {\n restrict: 'EAC',\n require: 'ngModel',\n link: function postLink(scope, element, attr, controller) {\n\n // Directive options\n var options = {scope: scope};\n angular.forEach(['placement', 'container', 'delay', 'trigger', 'keyboard', 'html', 'animation', 'template', 'filter', 'limit', 'minLength', 'watchOptions', 'selectMode', 'comparator', 'id'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Build proper ngOptions\n var filter = options.filter || defaults.filter;\n var limit = options.limit || defaults.limit;\n var comparator = options.comparator || defaults.comparator;\n\n var ngOptions = attr.ngOptions;\n if(filter) ngOptions += ' | ' + filter + ':$viewValue';\n if (comparator) ngOptions += ':' + comparator;\n if(limit) ngOptions += ' | limitTo:' + limit;\n var parsedOptions = $parseOptions(ngOptions);\n\n // Initialize typeahead\n var typeahead = $typeahead(element, controller, options);\n\n // Watch options on demand\n if(options.watchOptions) {\n // Watch ngOptions values before filtering for changes, drop function calls\n var watchedOptions = parsedOptions.$match[7].replace(/\\|.+/, '').replace(/\\(.*\\)/g, '').trim();\n scope.$watch(watchedOptions, function (newValue, oldValue) {\n // console.warn('scope.$watch(%s)', watchedOptions, newValue, oldValue);\n parsedOptions.valuesFn(scope, controller).then(function (values) {\n typeahead.update(values);\n controller.$render();\n });\n }, true);\n }\n\n // Watch model for changes\n scope.$watch(attr.ngModel, function(newValue, oldValue) {\n // console.warn('$watch', element.attr('ng-model'), newValue);\n scope.$modelValue = newValue; // Publish modelValue on scope for custom templates\n parsedOptions.valuesFn(scope, controller)\n .then(function(values) {\n // Prevent input with no future prospect if selectMode is truthy\n // @TODO test selectMode\n if(options.selectMode && !values.length && newValue.length > 0) {\n controller.$setViewValue(controller.$viewValue.substring(0, controller.$viewValue.length - 1));\n return;\n }\n if(values.length > limit) values = values.slice(0, limit);\n var isVisible = typeahead.$isVisible();\n isVisible && typeahead.update(values);\n // Do not re-queue an update if a correct value has been selected\n if(values.length === 1 && values[0].value === newValue) return;\n !isVisible && typeahead.update(values);\n // Queue a new rendering that will leverage collection loading\n controller.$render();\n });\n });\n\n // modelValue -> $formatters -> viewValue\n controller.$formatters.push(function(modelValue) {\n // console.warn('$formatter(\"%s\"): modelValue=%o (%o)', element.attr('ng-model'), modelValue, typeof modelValue);\n var displayValue = parsedOptions.displayValue(modelValue);\n return displayValue === undefined ? '' : displayValue;\n });\n\n // Model rendering in view\n controller.$render = function () {\n // console.warn('$render', element.attr('ng-model'), 'controller.$modelValue', typeof controller.$modelValue, controller.$modelValue, 'controller.$viewValue', typeof controller.$viewValue, controller.$viewValue);\n if(controller.$isEmpty(controller.$viewValue)) return element.val('');\n var index = typeahead.$getIndex(controller.$modelValue);\n var selected = angular.isDefined(index) ? typeahead.$scope.$matches[index].label : controller.$viewValue;\n selected = angular.isObject(selected) ? parsedOptions.displayValue(selected) : selected;\n element.val(selected ? selected.toString().replace(/<(?:.|\\n)*?>/gm, '').trim() : '');\n };\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (typeahead) typeahead.destroy();\n options = null;\n typeahead = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-01-11
|
4
|
+
* @link http://mgcrea.github.io/angular-strap
|
5
|
+
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
+
*/
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
angular.module('mgcrea.ngStrap.typeahead').run(['$templateCache', function($templateCache) {
|
11
|
+
|
12
|
+
$templateCache.put('typeahead/typeahead.tpl.html', '<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select"><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}"><a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a></li></ul>');
|
13
|
+
|
14
|
+
}]);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-01-11
|
4
|
+
* @link http://mgcrea.github.io/angular-strap
|
5
|
+
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
+
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
+
*/
|
8
|
+
"use strict";angular.module("mgcrea.ngStrap.typeahead").run(["$templateCache",function(e){e.put("typeahead/typeahead.tpl.html",'<ul tabindex="-1" class="typeahead dropdown-menu" ng-show="$isVisible()" role="select"><li role="presentation" ng-repeat="match in $matches" ng-class="{active: $index == $activeIndex}"><a role="menuitem" tabindex="-1" ng-click="$select($index, $event)" ng-bind="match.label"></a></li></ul>')}]);
|
metadata
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails-angular-strap
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alexander Bobrov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Injects AngularStrap into your asset pipeline.
|
14
|
+
email: alexander@devvela.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- MIT-LICENSE
|
20
|
+
- README.md
|
21
|
+
- lib/rails-angular-strap.rb
|
22
|
+
- lib/rails-angular-strap/engine.rb
|
23
|
+
- lib/rails-angular-strap/version.rb
|
24
|
+
- vendor/assets/javascripts/angular-strap.js
|
25
|
+
- vendor/assets/javascripts/angular-strap.min.js
|
26
|
+
- vendor/assets/javascripts/angular-strap/angular-strap.js
|
27
|
+
- vendor/assets/javascripts/angular-strap/angular-strap.min.js
|
28
|
+
- vendor/assets/javascripts/angular-strap/angular-strap.tpl.js
|
29
|
+
- vendor/assets/javascripts/angular-strap/angular-strap.tpl.min.js
|
30
|
+
- vendor/assets/javascripts/angular-strap/modules/affix.js
|
31
|
+
- vendor/assets/javascripts/angular-strap/modules/affix.min.js
|
32
|
+
- vendor/assets/javascripts/angular-strap/modules/affix.min.js.map
|
33
|
+
- vendor/assets/javascripts/angular-strap/modules/alert.js
|
34
|
+
- vendor/assets/javascripts/angular-strap/modules/alert.min.js
|
35
|
+
- vendor/assets/javascripts/angular-strap/modules/alert.min.js.map
|
36
|
+
- vendor/assets/javascripts/angular-strap/modules/alert.tpl.js
|
37
|
+
- vendor/assets/javascripts/angular-strap/modules/alert.tpl.min.js
|
38
|
+
- vendor/assets/javascripts/angular-strap/modules/aside.js
|
39
|
+
- vendor/assets/javascripts/angular-strap/modules/aside.min.js
|
40
|
+
- vendor/assets/javascripts/angular-strap/modules/aside.min.js.map
|
41
|
+
- vendor/assets/javascripts/angular-strap/modules/aside.tpl.js
|
42
|
+
- vendor/assets/javascripts/angular-strap/modules/aside.tpl.min.js
|
43
|
+
- vendor/assets/javascripts/angular-strap/modules/button.js
|
44
|
+
- vendor/assets/javascripts/angular-strap/modules/button.min.js
|
45
|
+
- vendor/assets/javascripts/angular-strap/modules/button.min.js.map
|
46
|
+
- vendor/assets/javascripts/angular-strap/modules/collapse.js
|
47
|
+
- vendor/assets/javascripts/angular-strap/modules/collapse.min.js
|
48
|
+
- vendor/assets/javascripts/angular-strap/modules/collapse.min.js.map
|
49
|
+
- vendor/assets/javascripts/angular-strap/modules/date-formatter.js
|
50
|
+
- vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js
|
51
|
+
- vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js.map
|
52
|
+
- vendor/assets/javascripts/angular-strap/modules/date-parser.js
|
53
|
+
- vendor/assets/javascripts/angular-strap/modules/date-parser.min.js
|
54
|
+
- vendor/assets/javascripts/angular-strap/modules/date-parser.min.js.map
|
55
|
+
- vendor/assets/javascripts/angular-strap/modules/datepicker.js
|
56
|
+
- vendor/assets/javascripts/angular-strap/modules/datepicker.min.js
|
57
|
+
- vendor/assets/javascripts/angular-strap/modules/datepicker.min.js.map
|
58
|
+
- vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.js
|
59
|
+
- vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.min.js
|
60
|
+
- vendor/assets/javascripts/angular-strap/modules/debounce.js
|
61
|
+
- vendor/assets/javascripts/angular-strap/modules/debounce.min.js
|
62
|
+
- vendor/assets/javascripts/angular-strap/modules/debounce.min.js.map
|
63
|
+
- vendor/assets/javascripts/angular-strap/modules/dimensions.js
|
64
|
+
- vendor/assets/javascripts/angular-strap/modules/dimensions.min.js
|
65
|
+
- vendor/assets/javascripts/angular-strap/modules/dimensions.min.js.map
|
66
|
+
- vendor/assets/javascripts/angular-strap/modules/dropdown.js
|
67
|
+
- vendor/assets/javascripts/angular-strap/modules/dropdown.min.js
|
68
|
+
- vendor/assets/javascripts/angular-strap/modules/dropdown.min.js.map
|
69
|
+
- vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.js
|
70
|
+
- vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.min.js
|
71
|
+
- vendor/assets/javascripts/angular-strap/modules/modal.js
|
72
|
+
- vendor/assets/javascripts/angular-strap/modules/modal.min.js
|
73
|
+
- vendor/assets/javascripts/angular-strap/modules/modal.min.js.map
|
74
|
+
- vendor/assets/javascripts/angular-strap/modules/modal.tpl.js
|
75
|
+
- vendor/assets/javascripts/angular-strap/modules/modal.tpl.min.js
|
76
|
+
- vendor/assets/javascripts/angular-strap/modules/navbar.js
|
77
|
+
- vendor/assets/javascripts/angular-strap/modules/navbar.min.js
|
78
|
+
- vendor/assets/javascripts/angular-strap/modules/navbar.min.js.map
|
79
|
+
- vendor/assets/javascripts/angular-strap/modules/parse-options.js
|
80
|
+
- vendor/assets/javascripts/angular-strap/modules/parse-options.min.js
|
81
|
+
- vendor/assets/javascripts/angular-strap/modules/parse-options.min.js.map
|
82
|
+
- vendor/assets/javascripts/angular-strap/modules/popover.js
|
83
|
+
- vendor/assets/javascripts/angular-strap/modules/popover.min.js
|
84
|
+
- vendor/assets/javascripts/angular-strap/modules/popover.min.js.map
|
85
|
+
- vendor/assets/javascripts/angular-strap/modules/popover.tpl.js
|
86
|
+
- vendor/assets/javascripts/angular-strap/modules/popover.tpl.min.js
|
87
|
+
- vendor/assets/javascripts/angular-strap/modules/raf.js
|
88
|
+
- vendor/assets/javascripts/angular-strap/modules/raf.min.js
|
89
|
+
- vendor/assets/javascripts/angular-strap/modules/raf.min.js.map
|
90
|
+
- vendor/assets/javascripts/angular-strap/modules/scrollspy.js
|
91
|
+
- vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js
|
92
|
+
- vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js.map
|
93
|
+
- vendor/assets/javascripts/angular-strap/modules/select.js
|
94
|
+
- vendor/assets/javascripts/angular-strap/modules/select.min.js
|
95
|
+
- vendor/assets/javascripts/angular-strap/modules/select.min.js.map
|
96
|
+
- vendor/assets/javascripts/angular-strap/modules/select.tpl.js
|
97
|
+
- vendor/assets/javascripts/angular-strap/modules/select.tpl.min.js
|
98
|
+
- vendor/assets/javascripts/angular-strap/modules/tab.js
|
99
|
+
- vendor/assets/javascripts/angular-strap/modules/tab.min.js
|
100
|
+
- vendor/assets/javascripts/angular-strap/modules/tab.min.js.map
|
101
|
+
- vendor/assets/javascripts/angular-strap/modules/tab.tpl.js
|
102
|
+
- vendor/assets/javascripts/angular-strap/modules/tab.tpl.min.js
|
103
|
+
- vendor/assets/javascripts/angular-strap/modules/timepicker.js
|
104
|
+
- vendor/assets/javascripts/angular-strap/modules/timepicker.min.js
|
105
|
+
- vendor/assets/javascripts/angular-strap/modules/timepicker.min.js.map
|
106
|
+
- vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.js
|
107
|
+
- vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.min.js
|
108
|
+
- vendor/assets/javascripts/angular-strap/modules/tooltip.js
|
109
|
+
- vendor/assets/javascripts/angular-strap/modules/tooltip.min.js
|
110
|
+
- vendor/assets/javascripts/angular-strap/modules/tooltip.min.js.map
|
111
|
+
- vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.js
|
112
|
+
- vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.min.js
|
113
|
+
- vendor/assets/javascripts/angular-strap/modules/typeahead.js
|
114
|
+
- vendor/assets/javascripts/angular-strap/modules/typeahead.min.js
|
115
|
+
- vendor/assets/javascripts/angular-strap/modules/typeahead.min.js.map
|
116
|
+
- vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.js
|
117
|
+
- vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.min.js
|
118
|
+
homepage: https://github.com/alexkpek/angular-strap-rails
|
119
|
+
licenses:
|
120
|
+
- MIT
|
121
|
+
metadata: {}
|
122
|
+
post_install_message:
|
123
|
+
rdoc_options: []
|
124
|
+
require_paths:
|
125
|
+
- lib
|
126
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
requirements: []
|
137
|
+
rubyforge_project:
|
138
|
+
rubygems_version: 2.4.5
|
139
|
+
signing_key:
|
140
|
+
specification_version: 4
|
141
|
+
summary: AngularStrap on Rails
|
142
|
+
test_files: []
|
143
|
+
has_rdoc:
|