Start working on commit message tooltips
[gitphp.git] / js / ext / jquery.qtip.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* qTip - The jQuery tooltip plugin
* http://craigsworks.com/projects/qtip/
*
* Version: 2.0.0pre
* Copyright 2009 Craig Michael Thompson - http://craigsworks.com
*
* Dual licensed under MIT or GPL Version 2 licenses
*   http://en.wikipedia.org/wiki/MIT_License
*   http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Sun Aug 29 01:09:38 2010 +0100
*/
 
"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
/*jslint browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true */
/*global window: false, jQuery: false */
 
var TRUE=true,FALSE=false,NULL=null;
(function(a,B,D){function K(b){if(!b)return FALSE;try{if("metadata"in b&&"object"!==typeof b.metadata)b.metadata={type:b.metadata};if("content"in b){if("object"!==typeof b.content||b.content.jquery)b.content={text:b.content};var c=a.isFunction(b.content.text)?b.content.text():b.content.text||FALSE;if(!c&&!c.attr||c.length<1||"object"===typeof c&&!c.jquery)b.content.text=FALSE;if("title"in b.content&&"object"!==typeof b.content.title)b.content.title={text:b.content.title}}if("position"in b){if("object"!==
typeof b.position)b.position={my:b.position,at:b.position};if("object"!==typeof b.position.adjust)b.position.adjust={};if("undefined"!==typeof b.position.adjust.screen)b.position.adjust.screen=!!b.position.adjust.screen}if("show"in b){if("object"!==typeof b.show)b.show={event:b.show};if("object"!==typeof b.show)b.show=b.show.jquery?{target:b.show}:{event:b.show}}if("hide"in b)if("object"!==typeof b.hide)b.hide=b.hide.jquery?{target:b.hide}:{event:b.hide};if("style"in b&&"object"!==typeof b.style)b.style=
{classes:b.style}}catch(k){}a.each(a.fn.qtip.plugins,function(){this.sanitize&&this.sanitize(b)})}function M(b,c,k){function h(d){var i,n;d=d.split(".");i=c[d[0]];for(n=1;n<d.length;n+=1)if(typeof i[d[n]]==="object"&&!i[d[n]].jquery)i=i[d[n]];else break;return[i,d[n]]}function q(d){var i=e.elements.tooltip,n=!i.is(":visible")?TRUE:FALSE,j=FALSE;if(!e.rendered)return FALSE;n&&i.addClass("ui-tooltip-accessible");switch(d){case "dimensions":j={height:i.outerHeight(),width:i.outerWidth()};break;case "position":j=
i.offset();break}n&&i.removeClass("ui-tooltip-accessible");return j}function o(){var d=e.elements;if(d.title){d.titlebar.remove();d.titlebar=d.title=d.button=NULL;d.tooltip.removeAttr("aria-labelledby")}}function u(){var d=e.elements,i=c.content.title.button;d.titlebar&&o();d.titlebar=a("<div />",{"class":"ui-tooltip-titlebar "+(c.style.widget?"ui-widget-header":"")}).append(d.title=a("<div />",{id:"ui-tooltip-"+k+"-title","class":"ui-tooltip-title",html:c.content.title.text})).prependTo(d.wrapper);
if(i){d.button=i.jquery?i:"string"===typeof i?a("<a />",{html:i}):a("<a />",{"class":"ui-state-default"}).append(a("<span />",{"class":"ui-icon ui-icon-close"}));d.button.prependTo(d.titlebar).attr("role","button").addClass("ui-tooltip-"+(i===TRUE?"close":"button")).hover(function(n){a(this).toggleClass("ui-state-hover",n.type==="mouseenter")}).click(function(){d.tooltip.hasClass("ui-state-disabled")||e.hide();return FALSE}).bind("mousedown keydown mouseup keyup mouseout",function(n){a(this).toggleClass("ui-state-active ui-state-focus",
/down$/i.test(n.type))})}}function p(d){if(!e.rendered||!d)return FALSE;if(a.isFunction(d))d=d();d.jquery&&d.length>0?e.elements.content.append(d.css({display:"block"})):e.elements.content.html(d);d=void 0;var i=e.elements.tooltip,n,j;if(e.rendered&&a.browser.msie){i.css({width:"auto",maxWidth:"none"});d=q("dimensions").width;i.css({maxWidth:""});n=parseInt(i.css("max-width"),10)||0;j=parseInt(i.css("min-width"),10)||0;d=Math.min(Math.max(d,j),n);i.width(d)}e.reposition(e.cache.event);if(e.rendered<
0){if(c.show.ready||e.rendered===-2)e.show(e.cache.event);e.rendered=TRUE}return e}function w(d,i,n,j){function f(y){if(r.tooltip.hasClass("ui-state-disabled"))return FALSE;r.show.trigger("qtip-"+k+"-inactive");clearTimeout(e.timers.show);clearTimeout(e.timers.hide);e.timers.show=setTimeout(function(){e.show(y)},c.show.delay)}function g(y){if(r.tooltip.hasClass("ui-state-disabled"))return FALSE;var z=a(y.relatedTarget).parents(".qtip.ui-tooltip")[0]==r.tooltip[0];clearTimeout(e.timers.show);clearTimeout(e.timers.hide);
if(c.position.target==="mouse"&&z||c.hide.fixed&&/mouse(out|leave|move)/.test(y.type)&&z){y.stopPropagation();y.preventDefault();return FALSE}r.tooltip.stop(TRUE,TRUE);e.timers.hide=setTimeout(function(){e.hide(y)},c.hide.delay)}function l(y){if(r.tooltip.hasClass("ui-state-disabled"))return FALSE;clearTimeout(e.timers.inactive);e.timers.inactive=setTimeout(function(){e.hide(y)},c.hide.inactive)}function m(y){e.elements.tooltip.is(":visible")&&e.reposition(y)}var t=".qtip-"+k,r={show:c.show.target,
hide:c.hide.target,tooltip:e.elements.tooltip},x={show:String(c.show.event).split(" "),hide:String(c.hide.event).split(" ")},s=a.browser.msie&&/^6\.[0-9]/.test(a.browser.version);if(n&&c.hide.fixed){r.hide=r.hide.add(r.tooltip);r.tooltip.bind("mouseover"+t,function(){r.tooltip.hasClass("ui-state-disabled")||clearTimeout(e.timers.hide)})}if(i){if("number"===typeof c.hide.inactive){r.show.bind("qtip-"+k+"-inactive",l);a.each(a.fn.qtip.inactiveEvents,function(y,z){r.hide.add(e.elements.tooltip).bind(z+
t+"-inactive",l)})}a.each(x.hide,function(y,z){var A=a.inArray(z,x.show);if(A>-1&&a(r.hide).add(r.show).length===a(r.hide).length||z==="unfocus"){r.show.bind(z+t,function(C){r.tooltip.is(":visible")?g(C):f(C)});delete x.show[A]}else r.hide.bind(z+t,g)})}if(d){a.each(x.show,function(y,z){r.show.bind(z+t,f)});r.tooltip.bind("mouseover"+t,function(){e.focus()})}if(j){if(c.position.adjust.resize||c.position.adjust.screen)a(B).bind("resize"+t,m);if(c.position.adjust.screen||s&&r.tooltip.css("position")===
"fixed")a(document).bind("scroll"+t,m);/unfocus/i.test(c.hide.event)&&a(document).bind("mousedown"+t,function(y){var z=e.elements.tooltip;a(y.target).parents(".qtip.ui-tooltip").length===0&&a(y.target).add(b).length>1&&z.is(":visible")&&!z.hasClass("ui-state-disabled")&&e.hide()});c.position.target==="mouse"&&a(document).bind("mousemove"+t,function(y){c.position.adjust.mouse&&!r.tooltip.hasClass("ui-state-disabled")&&r.tooltip.is(":visible")&&e.reposition(y)})}}function v(d,i,n,j){j=parseInt(j,10)!==
0;var f=".qtip-"+k,g={show:d?c.show.target:a("<div/>"),hide:i?c.hide.target:a("<div/>"),tooltip:n?e.elements.tooltip:a("<div/>")};i={show:String(c.show.event).split(" "),hide:String(c.hide.event).split(" ")};if(e.rendered){a.each(i.show,function(l,m){g.show.unbind(m+f)});g.show.unbind("mousemove"+f).unbind("mouseout"+f).unbind("qtip-"+k+"-inactive");a.each(i.hide,function(l,m){g.hide.add(g.tooltip).unbind(m+f)});a.each(a.fn.qtip.inactiveEvents,function(l,m){g.hide.add(n?e.elements.content:NULL).unbind(m+
f+"-inactive")});g.hide.unbind("mouseout"+f);g.tooltip.unbind("mouseover"+f);if(j){a(B).unbind("resize"+f);a(document).unbind("mousedown"+f+" mousemove"+f)}}else d&&g.show.unbind(i.show+f+"-create")}var e=this;e.id=k;e.rendered=FALSE;e.elements={target:b};e.cache={event:{},target:NULL,disabled:FALSE};e.timers={};e.options=c;e.plugins={};a.extend(e,{render:function(d){var i=e.elements;if(e.rendered)return FALSE;e.rendered=d?-2:-1;i.tooltip=a("<div/>").attr({id:"ui-tooltip-"+k,role:"tooltip"}).addClass("qtip ui-tooltip ui-helper-reset "+
c.style.classes).toggleClass("ui-widget",c.style.widget).toggleClass("ui-state-disabled",e.cache.disabled).css("z-index",a.fn.qtip.zindex+a("div.qtip.ui-tooltip").length).data("qtip",e).appendTo(c.position.container);i.wrapper=a("<div />").addClass("ui-tooltip-wrapper").appendTo(i.tooltip);i.content=a("<div />").addClass("ui-tooltip-content").attr("id","ui-tooltip-"+k+"-content").addClass("ui-tooltip-content").toggleClass("ui-widget-content",c.style.widget).appendTo(i.wrapper);c.content.title.text&&
u();a.each(a.fn.qtip.plugins,function(){this.initialize==="render"&&this(e)});w(1,1,1,1);a.each(c.events,function(n,j){i.tooltip.bind("tooltip"+n,j)});b.bind("remove.qtip",function(){e.destroy()});p(c.content.text);i.tooltip.trigger("tooltiprender",[e.hash()]);return e},get:function(d){switch(d.toLowerCase()){case "offset":d=q("position");break;case "dimensions":d=q("dimensions");break;default:d=h(d.toLowerCase());d=d[0].precedance?d[0].string():d[0].jquery?d[0]:d[0][d[1]];break}return d},set:function(d,
i){var n=h(d.toLowerCase()),j,f,g,l={builtin:{"^content.text":function(){p(i)},"^content.title.text":function(){if(e.rendered)if(!e.elements.title&&i){u();e.reposition()}else i?e.elements.title.html(i):o()},"^position.container$":function(){if(e.rendered===TRUE){e.elements.tooltip.appendTo(i);e.reposition()}},"^position.(my|at)$":function(){var m=/my$/i.test(d)?"my":"at";if("string"===typeof i)c.position[m]=new a.fn.qtip.plugins.Corner(i)},"^position.(my|at|adjust|target)":function(){e.rendered&&
e.reposition()},"^(show|hide).(event|target|fixed)":function(m,t,r,x){var s=d.search(/fixed/i)>-1?[0,[0,1,1,1]]:d.search(/hide/i)<0?["show",[1,0,0,0]]:["hide",[0,1,0,0]];if(s[0])m[t]=x;v.apply(e,s[1]);if(s[0])m[t]=r;w.apply(e,s[1])}}};a.each(e.plugins,function(m){if("object"===typeof this.checks)l[m]=this.checks});j=n[0][n[1]];n[0][n[1]]=i;K(c);for(f in l)for(g in l[f])RegExp(g,"i").test(d)&&l[f][g].call(e,n[0],n[1],i,j);return e},toggle:function(d,i){function n(){var t=d?"attr":"removeAttr",r=/^1|0$/.test(a(this).css("opacity"));
e.elements.title&&b[t]("aria-labelledby","ui-tooltip-"+k+"-title");b[t]("aria-describedby","ui-tooltip-"+k+"-content");if(d){if(a.browser.msie&&a(this).get(0).style&&r){m=a(this).get(0).style;m.removeAttribute("filter");m.removeAttribute("opacity")}}else r&&a(this).hide()}if(!e.rendered)return FALSE;var j=d?"show":"hide",f=e.elements.tooltip,g=c[j],l=f.is(":visible"),m;if((typeof d).search("boolean|number"))d=!f.is(":visible");if(!l&&!d||f.is(":animated"))return e;if(i){if(e.cache.event&&/over|enter/.test(i.type)&&
/out|leave/.test(e.cache.event.type)&&a(i.target).add(c.show.target).length<2&&a(i.relatedTarget).parents(".qtip.ui-tooltip").length>0)return e;e.cache.event=a.extend({},i)}l=a.Event("tooltip"+j);l.originalEvent=a.extend({},i);f.trigger(l,[e.hash(),90]);if(l.isDefaultPrevented())return e;if(d){if(e.rendered===TRUE){e.focus();e.reposition(i)}g.solo&&a(":not(.qtip.ui-tooltip)").qtip("hide")}else clearTimeout(e.timers.show);f.attr("aria-hidden",Boolean(!d));f.stop(TRUE,FALSE);if(a.isFunction(g.effect)){g.effect.call(f);
f.queue(function(){n.call(this);a(this).dequeue()})}else if(g.effect===FALSE){f[j]();n.call(f)}else f.fadeTo(90,d?1:0,n);d&&g.target.trigger("qtip-"+k+"-inactive");return e},show:function(d){e.toggle(TRUE,d)},hide:function(d){e.toggle(FALSE,d)},focus:function(d){if(!e.rendered)return FALSE;var i=e.elements.tooltip,n=parseInt(i.css("z-index"),10),j=a.fn.qtip.zindex+a(".qtip.ui-tooltip").length,f=a.extend({},d);if(!i.hasClass("ui-tooltip-focus")&&n!==j){a(".qtip.ui-tooltip").each(function(){var g=a(this).qtip(),
l=a.Event("tooltipblur"),m,t;if(!g||!g.rendered)return TRUE;m=g.elements.tooltip;t=parseInt(m.css("z-index"),10);isNaN(t)||m.css({zIndex:t-1});m.removeClass("ui-tooltip-focus");l.originalEvent=f;m.trigger(l,[g,j])});d=a.Event("tooltipfocus");d.originalEvent=f;i.trigger(d,[e.hash(),j]);d.isDefaultPrevented()||i.css({zIndex:j}).addClass("ui-tooltip-focus")}return e},reposition:function(d){if(e.rendered===FALSE)return FALSE;var i=c.position.target,n=e.elements.tooltip,j=c.position,f=j.my,g=j.at,l=e.elements.tooltip.width(),
m=e.elements.tooltip.height(),t=a(j.container)[0],r=0,x=0,s={left:0,top:0},y=a.Event("tooltipmove"),z={left:function(A){var C=i==="mouse"?d.pageX:i.offset().left,F=a(B).scrollLeft(),E=a(B).width(),H=g.x==="left"?r:g.x==="right"?-r:r/2,G=f.x!==g.x&&g.x!=="center"?r:0,L=H+(f.x==="left"?-l:f.x==="right"?l:l/2)+-2*j.adjust.x;E=A+l-E-F;if(F-A>0&&!(A>=C&&A<C+r))s.left+=L-H+G;else if(E>0&&A+l>C)s.left+=(f.x==="center"?-1:1)*(L-H-G);return s.left-A},top:function(A){var C=a(B).scrollTop(),F=a(B).height(),
E=g.y==="top"?x:g.y==="bottom"?-x:0,H=f.y!==g.y&&g.y!=="center"?x:0,G=E+(f.y==="top"?-m:f.y==="bottom"?m:-m/2)+-2*j.adjust.y;F=A+m-F-C;if(C-A>0)s.top+=f.y==="center"?-G+E:G;else if(F>0)s.top+=G-E-H;return s.top-A}};if(i==="mouse"){g={x:"left",y:"top"};if(!d)d=e.cache.event;s={top:d.pageY,left:d.pageX}}else{if(i==="event")i=d&&d.target&&d.type!=="scroll"&&d.type!=="resize"?e.cache.target=a(d.target):e.cache.target;if(i[0]===document||i[0]===B){r=i.width();x=i.height();s={top:n.css("position")==="fixed"?
0:i.scrollTop(),left:i.scrollLeft()}}else if(i.is("area")&&a.fn.qtip.plugins.imagemap){s=a.fn.qtip.plugins.imagemap(i,g);r=s.width;x=s.height;s=s.offset}else{r=i.outerWidth();x=i.outerHeight();s=i.offset();if(j.adjust.offset){do{s.left-=t.offsetLeft-t.scrollLeft;s.top-=t.offsetTop-t.scrollTop}while(t=t.offsetParent)}}s.left+=g.x==="right"?r:g.x==="center"?r/2:0;s.top+=g.y==="bottom"?x:g.y==="center"?x/2:0}s.left+=j.adjust.x+(f.x==="right"?-l:f.x==="center"?-l/2:0);s.top+=j.adjust.y+(f.y==="bottom"?
-m:f.y==="center"?-m/2:0);s.adjusted=j.adjust.screen&&i[0]!==B&&i[0]!==document.body?{left:z.left(s.left),top:z.top(s.top)}:{left:0,top:0};if(j.container[0]==document.body){if(s.top<1)s.top=0;if(s.left<1)s.left=0}n.attr("class",function(){return a(this).attr("class").replace(/ui-tooltip-pos-\w+/i,"")}).addClass("ui-tooltip-pos-"+f.abbreviation());y.originalEvent=a.extend({},d);n.trigger(y,[e.hash(),s]);if(y.isDefaultPrevented())return e;delete s.adjust;if(n.is(":visible")&&a.isFunction(j.adjust.effect)){j.adjust.effect.call(n,
s);n.queue(function(){a(this).css({opacity:"",height:""});a.browser.msie&&a(this).get(0).style&&a(this).get(0).style.removeAttribute("filter");a(this).dequeue()})}else n.css(s);return e},disable:function(d){var i=e.elements.tooltip;if(e.rendered)i.toggleClass("ui-state-disabled",d);else e.cache.disabled=!!d;return e},destroy:function(){var d=e.elements,i=d.target.data("oldtitle");e.rendered&&a.each(e.plugins,function(){this.initialize==="render"&&this.destroy()});v(1,1,1,1);b.removeData("qtip");e.rendered&&
d.tooltip.remove();i&&b.attr("title",i);return b},hash:function(){var d=a.extend({},e);delete d.cache;delete d.timers;delete d.options;delete d.plugins;delete d.render;delete d.hash;return d}})}function N(b,c){var k;k=a(this).metadata?a(this).metadata(c.metadata):{};k=a.extend(TRUE,{},c,k);var h=k.position,q=a(this)[0]===document?a(document.body):a(this);if("boolean"===typeof k.content.text)if(k.content.attr!==FALSE&&a(this).attr(k.content.attr))k.content.text=a(this).attr(k.content.attr);else return FALSE;
if(h.container===FALSE)h.container=a(document.body);if(h.target===FALSE)h.target=q;if(k.show.target===FALSE)k.show.target=q;if(k.hide.target===FALSE)k.hide.target=q;h.at=new a.fn.qtip.plugins.Corner(h.at);h.my=new a.fn.qtip.plugins.Corner(h.my);if(a(this).data("qtip"))if(k.overwrite)a(this).qtip("destroy");else if(k.overwrite===FALSE)return FALSE;k=new M(a(this),k,b);a(this).data("qtip",k);return k}function O(b){var c=this;c.checks={"^content.ajax":function(){this.plugins.ajax.load(this.options.content.ajax)}};
a.extend(c,{init:function(){var k=b.options.content.ajax;c.load(k);b.elements.tooltip.bind("tooltipshow.ajax",function(){k.once===FALSE&&b.rendered===TRUE&&c.load(k)})},load:function(k){a.ajax(a.extend(TRUE,{},k,{success:function(h,q){if(a.isFunction(k.success))if(k.success.call(b.hash(),h,q)===FALSE)return;b.set("content.text",h);I.remove()},error:function(h,q,o){var u=q||o;if(a.isFunction(k.error)){h=k.error.call(b.hash(),h,q,o);if(h===FALSE)return}b.set("content.text",u)}}));return c},destroy:function(){b.elements.tooltip.unbind("tooltipshow.ajax")}});
c.init()}function J(b,c,k){var h=Math.floor(c/2),q=Math.floor(k/2);c={bottomright:[[0,0],[c,k],[c,0]],bottomleft:[[0,0],[c,0],[0,k]],topright:[[0,k],[c,0],[c,k]],topleft:[[0,0],[0,k],[c,k]],topcenter:[[0,k],[h,0],[c,k]],bottomcenter:[[0,0],[c,0],[h,k]],rightcenter:[[0,0],[c,q],[0,k]],leftcenter:[[c,0],[c,k],[0,q]]};c.lefttop=c.bottomright;c.righttop=c.bottomleft;c.leftbottom=c.topright;c.rightbottom=c.topleft;return c[b]}function P(b){function c(j){var f=o.tip,g=["left","right"],l={left:0,right:0,
top:0,bottom:0},m=0;if(q.corner===FALSE||!f)return FALSE;j=j||h.corner;f.css({top:"",bottom:"",left:"",right:"",margin:""});g[j.precedance==="y"?"push":"unshift"]("top","bottom");if(a.browser.msie)l={top:j.precedance==="y"?0:0,left:0,bottom:j.precedance==="y"?0:0,right:0};switch(j[j.precedance==="y"?"x":"y"]){case "center":f.css(g[0],"50%").css("margin-"+g[0],-(v[j.precedance==="y"?"width":"height"]/2));break;case g[0]:f.css(g[0],l[g[0]]+i);break;case g[1]:f.css(g[1],l[g[1]]+i);break}m=v[j.precedance===
"x"?"width":"height"];if(d)m-=parseInt(p.css("border-"+j[j.precedance]+"-width"),10);j[j.precedance]===g[2]?f.css(g[2],-l[g[2]]-m):f.css(g[3],l[g[3]]-m)}function k(j,f,g){if(o.tip){j=a.extend({},h.corner);f=h.mimic.adjust?a.extend({},h.mimic):null;var l=j.precedance==="y"?["y","top","left","height"]:["x","left","top","width"],m=g.adjusted,t=parseInt(p.css("border-"+j[l[0]]+"-width"),10);a.each([j,f],function(){if(m.left)this.x=this.x==="center"?m.left>0?"left":"right":this.x==="left"?"right":"left";
if(m.top)this.y=this.y==="center"?m.top>0?"top":"bottom":this.y==="top"?"bottom":"top"});g[l[1]]+=(j[l[0]]===l[1]?1:-1)*(v[l[3]]-t);g[l[2]]-=i;if(j.string()!==w.corner.string()&&(w.top!==m.top||w.left!==m.left))h.update(j,f);w.left=m.left;w.top=m.top;w.corner=j}}var h=this,q=b.options.style.tip,o=b.elements,u=o.tooltip,p=o.wrapper,w={top:0,left:0,corner:{string:function(){}}},v={width:q.width,height:q.height},e={},d=q.border||0,i=q.adjust||0,n=q.method||FALSE;h.corner=NULL;h.mimic=NULL;h.checks={"^position.my|style.tip.(corner|mimic|method|border)":function(){d=
q.border;if(h.detectCorner()){h.create();h.detectColours();h.update()}else h.tip.remove();this.get("position.target")!=="mouse"&&this.reposition()},"^style.tip.(height|width)":function(){v={width:q.width,height:q.height};h.create();h.update();b.reposition()}};a.extend(h,{init:function(){if(n===TRUE)n=a("<canvas />")[0].getContext?"canvas":a.browser.msie&&(h.mimic&&/center/i.test(h.mimic.string())||v.height!==v.width)?"vml":"polygon";else if(n==="canvas")n=a.browser.msie?"vml":!a("<canvas />")[0].getContext?
"polygon":"canvas";else if(n==="polygon")n=a.browser.msie&&/center/i.test(h.mimic.string())?"vml":n;if(h.detectCorner()){h.create();h.detectColours();h.update();u.bind("tooltipmove.tip",k)}return h},detectCorner:function(){var j=q.corner,f=q.mimic||j,g=b.options.position.at,l=b.options.position.my;if(l.string)l=l.string();if(j===FALSE||l===FALSE&&g===FALSE)return FALSE;else{if(j===TRUE)h.corner=new a.fn.qtip.plugins.Corner(l);else if(!j.string)h.corner=new a.fn.qtip.plugins.Corner(j);if(f===TRUE)h.mimic=
new a.fn.qtip.plugins.Corner(l);else if(!f.string){h.mimic=new a.fn.qtip.plugins.Corner(f);h.mimic.precedance=h.corner.precedance}}return h.corner.string()!=="centercenter"},detectColours:function(){var j=o.tip,f=h.mimic[h.mimic.precedance],g="border-"+f+"-color";e.fill=j.css("background-color","").css("border","").css("background-color")||"transparent";e.border=j.get(0).style?j.get(0).style["border"+f.charAt(0)+f.substr(1)+"Color"]:j.css(g)||"transparent";if(/rgba?\(0, 0, 0(, 0)?\)|transparent/i.test(e.fill))e.fill=
p.css(d?"background-color":g);if(!e.border||/rgba?\(0, 0, 0(, 0)?\)|transparent/i.test(e.border))e.border=p.css(g)||e.fill;a("*",j).add(j).css("background-color","transparent").css("border",0)},create:function(){var j=v.width,f=v.height;o.tip&&o.tip.remove();o.tip=a('<div class="ui-tooltip-tip ui-widget-content"></div>').css(v).prependTo(u);switch(n){case "canvas":o.tip.append('<canvas height="'+f+'" width="'+j+'" />');break;case "vml":o.tip.html('<vml:shape coordorigin="0 0" coordsize="'+j+" "+f+
'" stroked="'+!!d+'"  style="behavior:url(#default#VML); display:inline-block; antialias:TRUE; position: absolute;  top:0; left:0; width:'+j+"px; height:"+f+"px; vertical-align:"+h.corner.y+';"><vml:stroke weight="'+(d-2)+'px" joinstyle="miter" miterlimit="10"  style="behavior:url(#default#VML); display:inline-block;" /></vml:shape>');break;case "polygon":o.tip.append('<div class="ui-tooltip-tip-inner" />').append(d?'<div class="ui-tooltip-tip-border" />':"");break}return h},update:function(j,f){var g=
o.tip,l=v.width,m=v.height,t=d>0?0:1,r=Math.ceil(d/2+0.5),x;f||(f=j?j:h.mimic);if(!j)j=h.corner;if(f.x==="false")f.x=j.x;if(f.y==="false")f.y=j.y;g=g.children();switch(n){case "canvas":g=g.get(0).getContext("2d");g.clearRect(0,0,3E3,3E3);g.restore();if(d){x=J(f.string(),l*2,m*2);g.strokeStyle=e.border;g.lineWidth=d+1;g.lineJoin="miter";g.miterLimit=100;g.save();g.translate(f.x==="left"?0:f.x==="right"?-l:-l/2,f.y==="top"?0:f.y==="bottom"?-m:-m/2)}else x=J(f.string(),l,m);g.fillStyle=e.fill;for(g.miterLimit=
0;t<2;t++){g.globalCompositeOperation=t&&d?"destination-in":"source-over";g.beginPath();g.moveTo(x[0][0],x[0][1]);g.lineTo(x[1][0],x[1][1]);g.lineTo(x[2][0],x[2][1]);g.closePath();g.fill();t||g.stroke()}break;case "vml":x=J(f.string(),l,m);t="m"+x[0][0]+","+x[0][1]+" l"+x[1][0]+","+x[1][1]+" "+x[2][0]+","+x[2][1]+" xe";g.attr({path:t,fillcolor:e.fill});if(d){g.children().attr("color",e.border);if(f.precedance==="y"){g.css("top",(f.y==="top"?1:-1)*(d-2));g.css("left",f.x==="left"?1:-2)}else{g.css("left",
(f.x==="left"?1:-1)*(d-2));g.css("top",f.y==="top"?1:-2)}}break;case "polygon":if(f.precedance==="y"){t=l>m?1.5:l<m?5:2.2;r=[f.x==="left"?r:f.x==="right"?-r:0,Math.floor(t*r*(f.y==="bottom"?-1:1)*(f.x==="center"?0.8:1))]}else{t=l<m?1.5:l>m?5:2.2;r=[Math.floor(t*r*(f.x==="right"?-1:1)*(f.y==="center"?0.9:1)),f.y==="top"?r:f.y==="bottom"?-r:0]}g.removeAttr("style").each(function(s){var y={x:f.precedance==="x"?f.x==="left"?"right":"left":f.x,y:f.precedance==="y"?f.y==="top"?"bottom":"top":f.y},z=f.x===
"center"?["left","right",y.y,m,l]:["top","bottom",y.x,l,m],A=e[!s&&d?"border":"fill"];s&&a(this).css({position:"absolute","z-index":1,left:r[0],top:r[1]});f.x==="center"||f.y==="center"?a(this).css("border-"+z[2],z[3]+"px solid "+A).css("border-"+z[0],Math.floor(z[4]/2)+"px dashed transparent").css("border-"+z[1],Math.floor(z[4]/2)+"px dashed transparent"):a(this).css("border-width",Math.floor(m/2)+"px "+Math.floor(l/2)+"px").css("border-"+y.x,Math.floor(l/2)+"px solid "+A).css("border-"+y.y,Math.floor(m/
2)+"px solid "+A)});break}c(j);return h},destroy:function(){o.tip&&o.tip.remove();u.unbind("tooltipmove.tip")}})}function Q(b,c){var k=this,h=b.elements,q=h.tooltip;h.overlay=a("#qtip-overlay");a.extend(k,{init:function(){c=a.extend(TRUE,a.fn.qtip.plugins.modal.defaults,c);q.bind("tooltipshow.qtipmodal tooltiphide.qtipmodal",function(o,u,p){o=o.type.replace("tooltip","");a.isFunction(c[o])?c[o].call(h.overlay,p,u):k[o](p)});h.overlay.length||k.create();c.blur===TRUE&&h.overlay.bind("click.qtipmodal"+
b.id,function(){b.hide.call(b)})},create:function(){h.overlay=a("<div />",{id:"qtip-overlay",css:{position:"absolute",top:0,left:0,display:"none"}}).appendTo(document.body);a(B).bind("resize.qtipmodal",function(){h.overlay.css({height:Math.max(a(B).height(),a(document).height()),width:Math.max(a(B).width(),a(document).width())})}).trigger("resize")},toggle:function(o){var u=h.overlay,p=b.options.show.modal.effect,w=o?"show":"hide";u.stop(TRUE,FALSE);if(a.isFunction(p))p.call(u,o);else p===FALSE?u[w]():
u.fadeTo(90,o?0.7:0,function(){o||a(this).hide()})},show:function(){k.toggle(TRUE)},hide:function(){k.toggle(FALSE)},destroy:function(){var o=TRUE;a("*").each(function(){var u=a(this).data("qtip");if(u&&u.id!==b.id&&u.options.show.modal)return o=FALSE});if(o){h.overlay.remove();a(B).unbind("scroll.qtipmodal resize.qtipmodal")}else h.overlay.unbind("click.qtipmodal"+b.id);q.unbind("tooltipshow.qtipmodal tooltiphide.qtipmodal")}});k.init()}function R(b){var c=this,k=b.elements,h=k.tooltip,q=".bgiframe-"+
b.id,o="tooltipmove"+q+" tooltipshow"+q;a.extend(c,{init:function(){k.bgiframe=a('<iframe class="ui-tooltip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';"  style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0);"></iframe>');k.bgiframe.appendTo(h);h.bind(o,c.adjust)},adjust:function(){var u=b.calculate("dimensions"),p=b.plugins.tip,w=b.elements.tip,v;v=parseInt(h.css("border-left-width"),10);v={left:-v,top:-v};if(p&&w){p=p.corner.precedance==="x"?["width","left"]:
["height","top"];v[p[1]]-=w[p[0]]()}k.bgiframe.css(v).css(u)},destroy:function(){c.iframe.remove();h.unbind(o)}});c.init()}a.fn.qtip=function(b,c,k){var h=String(b).toLowerCase(),q=FALSE,o=h==="disable"?[TRUE]:a.makeArray(arguments).splice(1),u=o[o.length-1],p;if(!b&&a(this).data("qtip")||h==="api")return(p=a(this).eq(0).data("qtip"))?p.hash():D;else if("string"===typeof b){a(this).each(function(){var w=a(this).data("qtip");if(!w)return TRUE;if(/option|set/.test(h)&&c)if(k!==D)w.set(c,k);else q=w.get(c);
else{if(!w.rendered&&(h==="show"||h==="toggle")){if(u.timeStamp)w.cache.event=u;w.render()}else if(h==="enable"){h="disable";o=[FALSE]}w[h]&&w[h].apply(w[h],o)}});return q!==FALSE?q:a(this)}else if("object"===typeof b){K(b);p=a.extend(TRUE,{},a.fn.qtip.defaults,b);return a.fn.qtip.bind.call(this,p)}};a.fn.qtip.bind=function(b){return a(this).each(function(){function c(w){function v(){h.render(typeof w==="object"||q.show.ready);o.show.unbind(u.show);o.hide.unbind(u.hide)}if(h.cache.disabled)return FALSE;
h.cache.event=a.extend({},w);if(q.show.delay>0){h.timers.show=setTimeout(v,q.show.delay);u.show!==u.hide&&o.hide.bind(u.hide,function(){clearTimeout(h.timers.show)})}else v()}var k,h,q,o,u,p;k=b.id===FALSE||b.id.length<1||a("#ui-tooltip-"+b.id).length?a.fn.qtip.nextid++:b.id;p=".qtip-"+k+"-create";h=N.call(a(this),k,b);if(h===FALSE)return TRUE;q=h.options;a(this).attr("title")&&a(this).data("oldtitle",a(this).attr("title")).removeAttr("title");a.each(a.fn.qtip.plugins,function(){this.initialize===
"initialize"&&this(h)});o={show:q.show.target,hide:q.hide.target};u={show:String(q.show.event).replace(" ",p+" ")+p,hide:String(q.hide.event).replace(" ",p+" ")+p};q.show.ready||q.prerender||q.show.event===FALSE?c():o.show.bind(u.show,c)})};a.each({attr:function(b){var c=a(this).data("qtip");return arguments.length===1&&b==="title"&&c&&c.rendered===TRUE?a(this).data("oldtitle"):NULL},remove:a.ui?NULL:function(b,c){this.each(function(){if(!c)if(!b||a.filter(b,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})}},
function(b,c){if(!c)return TRUE;var k=a.fn[b];a.fn[b]=function(){return c.apply(this,arguments)||k.apply(this,arguments)}});a.fn.qtip.nextid=0;a.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");a.fn.qtip.zindex=15E3;a.fn.qtip.plugins={Corner:function(b){this.x=(String(b).replace(/middle/i,"center").match(/left|right|center/i)||["false"])[0].toLowerCase();this.y=(String(b).replace(/middle/i,"center").match(/top|bottom|center/i)||["false"])[0].toLowerCase();
this.precedance=b.charAt(0).search(/^(t|b)/)>-1?"y":"x";this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y};this.abbreviation=function(){var c=this.x.substr(0,1),k=this.y.substr(0,1);return c===k?c:c==="c"||c!=="c"&&k!=="c"?k+c:c+k}}};a.fn.qtip.defaults={prerender:FALSE,id:FALSE,overwrite:TRUE,metadata:{type:"class"},content:{text:TRUE,attr:"title",title:{text:FALSE,button:FALSE}},position:{my:"top left",at:"bottom right",target:FALSE,container:FALSE,adjust:{x:0,y:0,mouse:TRUE,
screen:FALSE,resize:TRUE,effect:TRUE,offset:FALSE}},show:{target:FALSE,event:"mouseenter",effect:TRUE,delay:90,solo:FALSE,ready:FALSE},hide:{target:FALSE,event:"mouseleave",effect:TRUE,delay:0,fixed:FALSE,inactive:FALSE},style:{classes:"",widget:FALSE},events:{render:a.noop,move:a.noop,show:a.noop,hide:a.noop,focus:a.noop,blur:a.noop}};var I=a();a.fn.qtip.plugins.ajax=function(b){var c=b.plugins.ajax,k=b.options.content;if(k.ajax&&k.ajax.url)if(c)return c;else{b.plugins.ajax=new O(b);return b.plugins.ajax}};
a.fn.qtip.plugins.ajax.initialize="render";a.fn.qtip.plugins.ajax.sanitize=function(b){if(b.content!==D)if(b.content.ajax!==D){if(typeof b.content.ajax!=="object")b.content.ajax={url:b.content.ajax};if(b.content.text===FALSE)b.content.text="Loading...";b.content.ajax.once=Boolean(b.content.ajax.once);b.content.ajax.preload=Boolean(b.content.ajax.preload);if(b.content.ajax.preload){b=b.content.ajax.url;a("#qtip-preload").length||a('<div id="qtip-preload" class="ui-tooltip-accessible" />').appendTo(document.body);
I.length||(I=a("<div />").appendTo("#qtip-preload").load(b+" img"))}}};a.fn.qtip.plugins.tip=function(b){var c=b.plugins.tip,k=b.options.style.tip;if(k&&k.corner)if(c)return c;else{b.plugins.tip=new P(b);b.plugins.tip.init();return b.plugins.tip}};a.fn.qtip.plugins.tip.initialize="render";a.fn.qtip.plugins.tip.sanitize=function(b){if(b.style===D)b.style={};if(b.style.tip===D)b.style.tip={corner:TRUE};if(typeof b.style.tip!=="object")b.style.tip={corner:b.style.tip||TRUE};if(typeof b.style.tip.method!==
"string")b.style.tip.method=TRUE;if(!/canvas|polygon/i.test(b.style.tip.method))b.style.tip.method=TRUE;if(typeof b.style.tip.width!=="number")b.style.tip.width=12;if(typeof b.style.tip.height!=="number")b.style.tip.height=12;if(typeof b.style.tip.border!=="number")b.style.tip.border=0};a.fn.qtip.plugins.imagemap=function(b,c){function k(e,d){for(var i=0,n=1,j=1,f=0,g=0,l=e.width,m=e.height;l>0&&m>0&&n>0&&j>0;){l=Math.floor(l/2);m=Math.floor(m/2);if(c.x==="left")n=l;else if(c.x==="right")n=e.width-
l;else n+=Math.floor(l/2);if(c.y==="top")j=m;else if(c.y==="bottom")j=e.height-m;else j+=Math.floor(m/2);for(i=d.length;i--;){if(d.length<2)break;f=d[i][0]-e.offset.left;g=d[i][1]-e.offset.top;if(c.x==="left"&&f>=n||c.x==="right"&&f<=n||c.x==="center"&&(f<n||f>e.width-n)||c.y==="top"&&g>=j||c.y==="bottom"&&g<=j||c.y==="center"&&(g<j||g>e.height-j))d.splice(i,1)}}return{left:d[0][0],top:d[0][1]}}var h=b.attr("shape").toLowerCase(),q=b.attr("coords").split(","),o=[],u=a('img[usemap="#'+b.parent("map").attr("name")+
'"]').offset(),p={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},w=0,v=0;if(h==="poly")for(w=q.length;w--;){v=[parseInt(q[--w],10),parseInt(q[w+1],10)];if(v[0]>p.offset.right)p.offset.right=v[0];if(v[0]<p.offset.left)p.offset.left=v[0];if(v[1]>p.offset.bottom)p.offset.bottom=v[1];if(v[1]<p.offset.top)p.offset.top=v[1];o.push(v)}else o=a.map(q,function(e){return parseInt(e,10)});switch(h){case "rect":p={width:Math.abs(o[2]-o[0]),height:Math.abs(o[3]-o[1]),offset:{left:o[0],top:o[1]}};
break;case "circle":p={width:o[2]+2,height:o[2]+2,offset:{left:o[0],top:o[1]}};break;case "poly":a.extend(p,{width:Math.abs(p.offset.right-p.offset.left),height:Math.abs(p.offset.bottom-p.offset.top)});p.offset=c.string()==="centercenter"?{left:p.offset.left+p.width/2,top:p.offset.top+p.height/2}:k(p,o.slice());p.width=p.height=0;break}p.offset.left+=u.left;p.offset.top+=u.top;return p};a.fn.qtip.plugins.modal=function(b){var c=b.plugins.modal,k=b.options.show.modal;if(c)return c;else if(typeof k===
"object"){b.plugins.modal=new Q(b,k);return b.plugins.modal}};a.fn.qtip.plugins.modal.initialize="render";a.fn.qtip.plugins.modal.sanitize=function(b){if(b.show&&b.show.modal!==D)if(typeof b.show.modal!=="object")b.show.modal={}};a.fn.qtip.plugins.modal.defaults={effect:TRUE,blur:TRUE};a.fn.qtip.plugins.bgiframe=function(b){if(!(a.browser.msie&&/^6\.[0-9]/.test(a.browser.version)&&a("select, object").length))return FALSE;var c=b.plugins.bgiframe;if(c)return c;else{b.plugins.bgiframe=new R(b);return b.plugins.bgiframe}};
a.fn.qtip.plugins.bgiframe.initialize="render"})(jQuery,window);
 
comments