Author: sevein
Date: Thu Jun 28 15:41:23 2012
New Revision: 11825

Log:
Add tooltip/popover from bootstrap.js

Added:
   trunk/vendor/bootstrap.js

Added: trunk/vendor/bootstrap.js
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/vendor/bootstrap.js   Thu Jun 28 15:41:23 2012        (r11825)
@@ -0,0 +1,3 @@
+// bootstrap-tooltip.js v2.0.4
+// bootstrap-popover.js v2.0.4
+!function(e){"use strict";var 
t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var
 
i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return
 t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof 
t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var
 
n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return
 
n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hove
 rState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var 
n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return
 
n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var
 
e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof
 
this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split("
 
")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"
 
right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},isHTML:function(e){return
 typeof 
e!="string"||e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3||/^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(e)},setContent:function(){var
 
e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.isHTML(t)?"html":"text"](t),e.removeClass("fade
 in top bottom left right")},hide:function(){function r(){var 
t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var
 
t=this,n=this.tip();n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove()},fixTitle:function(){var
 e=this.$element;(e.attr("title")||typeof 
e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return
 this.getTitle()},getPosition:function(t){return 
e.extend({},t?{top:0,left:0}:this.$element.offset(
 
),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var
 e,t=this.$element,n=this.options;return 
e=t.attr("data-original-title")||(typeof 
n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return 
this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},e.fn.tooltip=function(n){return
 this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof 
n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof 
n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div
 class="tooltip"><div class="tooltip-arrow"></div><div 
class="tooltip-inner"></div></div>',trigger:"hover",tit
 le:"",delay:0}}(window.jQuery),!function(e){"use strict";var 
t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var
 
e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.isHTML(t)?"html":"text"](t),e.find(".popover-content
 > *")[this.isHTML(n)?"html":"text"](n),e.removeClass("fade top bottom left 
right in")},hasContent:function(){return 
this.getTitle()||this.getContent()},getContent:function(){var 
e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof 
n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return 
this.$tip||(this.$tip=e(this.options.template)),this.$tip}}),e.fn.popover=function(n){return
 this.each(function(){var r=e(this),i=r.data("popover"),s=typeof 
n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof 
n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults
 ,{placement:"right",content:"",template:'<div class="popover"><div 
class="arrow"></div><div class="popover-inner"><h3 
class="popover-title"></h3><div 
class="popover-content"><p></p></div></div></div>'})}(window.jQuery);

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to