Simple Calendar – Google Calendar Plugin - Version 2.1.5

Version Description

  • Updated jQuery tooltip library to qTip2. Previously using unmaintained original qTip library.
Download this release

Release Info

Developer pderksen
Plugin Icon 128x128 Simple Calendar – Google Calendar Plugin
Version 2.1.5
Comparing to
See all releases

Code changes from version 2.1.4 to 2.1.5

README.txt CHANGED
@@ -43,7 +43,7 @@ This plugin was originally created by [Ross Hanney](http://www.rhanney.co.uk), a
43
  * Polish - Provided by Michał Pasternak of [iplweb.pl](http://iplweb.pl/).
44
  * Lithuanian - Provided by Andrius Mazeika of [mazeika.info](http://mazeika.info/).
45
  * Dutch - Provided by Henri van Werkhoven.
46
- * Catalan
47
 
48
  == Installation ==
49
 
@@ -89,14 +89,18 @@ There are three ways to install this plugin.
89
 
90
  == Changelog ==
91
 
 
 
 
 
92
  = 2.1.4 =
93
 
94
  * Reverted CSS enqueue change.
95
- * Added Catalan translation.
96
  * Updated AJAX security code.
97
  * Fixed bug with calendar ID field not trimming extra spaces.
98
  * Updated French translation - Pull Request by @Jojaba
99
- * Tested with WordPress 4.1.
100
 
101
  = 2.1.3 =
102
 
43
  * Polish - Provided by Michał Pasternak of [iplweb.pl](http://iplweb.pl/).
44
  * Lithuanian - Provided by Andrius Mazeika of [mazeika.info](http://mazeika.info/).
45
  * Dutch - Provided by Henri van Werkhoven.
46
+ * Catalan - Provided by Toni Ginard & Monica Grau of [agora.xtec.cat](http://agora.xtec.cat/).
47
 
48
  == Installation ==
49
 
89
 
90
  == Changelog ==
91
 
92
+ = 2.1.5 =
93
+
94
+ * Updated jQuery tooltip library to [qTip2](http://qtip2.com/). Previously using unmaintained original qTip library.
95
+
96
  = 2.1.4 =
97
 
98
  * Reverted CSS enqueue change.
99
+ * Added Catalan translation - Provided by Toni Ginard & Monica Grau of [agora.xtec.cat](http://agora.xtec.cat/).
100
  * Updated AJAX security code.
101
  * Fixed bug with calendar ID field not trimming extra spaces.
102
  * Updated French translation - Pull Request by @Jojaba
103
+ * Tested up to WordPress 4.1.
104
 
105
  = 2.1.3 =
106
 
class-google-calendar-events.php CHANGED
@@ -18,7 +18,7 @@ class Google_Calendar_Events {
18
  *
19
  * @var string
20
  */
21
- protected $version = '2.1.4';
22
 
23
  /**
24
  * Unique identifier for the plugin.
@@ -131,11 +131,10 @@ class Google_Calendar_Events {
131
  * @since 2.0.0
132
  */
133
  public function enqueue_public_scripts() {
134
-
135
- wp_register_script( $this->plugin_slug . '-qtip', plugins_url( 'js/jquery-qtip.js', __FILE__ ), array( 'jquery' ), $this->version, true );
 
136
  wp_register_script( $this->plugin_slug . '-public', plugins_url( 'js/gce-script.js', __FILE__ ), array( 'jquery', $this->plugin_slug . '-qtip' ), $this->version, true );
137
-
138
-
139
  }
140
 
141
  /*
@@ -144,7 +143,10 @@ class Google_Calendar_Events {
144
  * @since 2.0.0
145
  */
146
  public function enqueue_public_styles() {
147
- wp_enqueue_style( $this->plugin_slug . '-public', plugins_url( 'css/gce-style.css', __FILE__ ), array(), $this->version );
 
 
 
148
  }
149
 
150
  /**
18
  *
19
  * @var string
20
  */
21
+ protected $version = '2.1.5';
22
 
23
  /**
24
  * Unique identifier for the plugin.
131
  * @since 2.0.0
132
  */
133
  public function enqueue_public_scripts() {
134
+ wp_register_script( $this->plugin_slug . '-qtip', plugins_url( 'js/jquery.qtip.min.js', __FILE__ ), array( 'jquery' ), $this->version, true );
135
+ // CDN version if needed.
136
+ //wp_register_script( $this->plugin_slug . '-qtip', '//cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.1/basic/jquery.qtip.min.js', array( 'jquery' ), $this->version, true );
137
  wp_register_script( $this->plugin_slug . '-public', plugins_url( 'js/gce-script.js', __FILE__ ), array( 'jquery', $this->plugin_slug . '-qtip' ), $this->version, true );
 
 
138
  }
139
 
140
  /*
143
  * @since 2.0.0
144
  */
145
  public function enqueue_public_styles() {
146
+ wp_enqueue_style( $this->plugin_slug . '-qtip', plugins_url( 'css/jquery.qtip.min.css', __FILE__ ), array(), $this->version );
147
+ // CDN version if needed.
148
+ //wp_enqueue_style( $this->plugin_slug . '-qtip', '//cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.1/basic/jquery.qtip.min.css', array(), $this->version );
149
+ wp_enqueue_style( $this->plugin_slug . '-public', plugins_url( 'css/gce-style.css', __FILE__ ), array( $this->plugin_slug . '-qtip' ), $this->version );
150
  }
151
 
152
  /**
css/jquery.qtip.css ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * qTip2 - Pretty powerful tooltips - v2.2.1
3
+ * http://qtip2.com
4
+ *
5
+ * Copyright (c) 2014
6
+ * Released under the MIT licenses
7
+ * http://jquery.org/license
8
+ *
9
+ * Date: Sat Sep 6 2014 11:12 GMT+0100+0100
10
+ * Plugins: None
11
+ * Styles: core
12
+ */
13
+ .qtip{
14
+ position: absolute;
15
+ left: -28000px;
16
+ top: -28000px;
17
+ display: none;
18
+
19
+ max-width: 280px;
20
+ min-width: 50px;
21
+
22
+ font-size: 10.5px;
23
+ line-height: 12px;
24
+
25
+ direction: ltr;
26
+
27
+ box-shadow: none;
28
+ padding: 0;
29
+ }
30
+
31
+ .qtip-content{
32
+ position: relative;
33
+ padding: 5px 9px;
34
+ overflow: hidden;
35
+
36
+ text-align: left;
37
+ word-wrap: break-word;
38
+ }
39
+
40
+ .qtip-titlebar{
41
+ position: relative;
42
+ padding: 5px 35px 5px 10px;
43
+ overflow: hidden;
44
+
45
+ border-width: 0 0 1px;
46
+ font-weight: bold;
47
+ }
48
+
49
+ .qtip-titlebar + .qtip-content{ border-top-width: 0 !important; }
50
+
51
+ /* Default close button class */
52
+ .qtip-close{
53
+ position: absolute;
54
+ right: -9px; top: -9px;
55
+ z-index: 11; /* Overlap .qtip-tip */
56
+
57
+ cursor: pointer;
58
+ outline: medium none;
59
+
60
+ border: 1px solid transparent;
61
+ }
62
+
63
+ .qtip-titlebar .qtip-close{
64
+ right: 4px; top: 50%;
65
+ margin-top: -9px;
66
+ }
67
+
68
+ * html .qtip-titlebar .qtip-close{ top: 16px; } /* IE fix */
69
+
70
+ .qtip-titlebar .ui-icon,
71
+ .qtip-icon .ui-icon{
72
+ display: block;
73
+ text-indent: -1000em;
74
+ direction: ltr;
75
+ }
76
+
77
+ .qtip-icon, .qtip-icon .ui-icon{
78
+ -moz-border-radius: 3px;
79
+ -webkit-border-radius: 3px;
80
+ border-radius: 3px;
81
+ text-decoration: none;
82
+ }
83
+
84
+ .qtip-icon .ui-icon{
85
+ width: 18px;
86
+ height: 14px;
87
+
88
+ line-height: 14px;
89
+ text-align: center;
90
+ text-indent: 0;
91
+ font: normal bold 10px/13px Tahoma,sans-serif;
92
+
93
+ color: inherit;
94
+ background: transparent none no-repeat -100em -100em;
95
+ }
96
+
97
+ /* Applied to 'focused' tooltips e.g. most recently displayed/interacted with */
98
+ .qtip-focus{}
99
+
100
+ /* Applied on hover of tooltips i.e. added/removed on mouseenter/mouseleave respectively */
101
+ .qtip-hover{}
102
+
103
+ /* Default tooltip style */
104
+ .qtip-default{
105
+ border: 1px solid #F1D031;
106
+
107
+ background-color: #FFFFA3;
108
+ color: #555;
109
+ }
110
+
111
+ .qtip-default .qtip-titlebar{
112
+ background-color: #FFEF93;
113
+ }
114
+
115
+ .qtip-default .qtip-icon{
116
+ border-color: #CCC;
117
+ background: #F1F1F1;
118
+ color: #777;
119
+ }
120
+
121
+ .qtip-default .qtip-titlebar .qtip-close{
122
+ border-color: #AAA;
123
+ color: #111;
124
+ }
css/jquery.qtip.min.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /* qTip2 v2.2.1 | Plugins: None | Styles: core | qtip2.com | Licensed MIT | Sat Sep 06 2014 23:12:15 */
2
+
3
+ .qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;direction:ltr;box-shadow:none;padding:0}.qtip-content{position:relative;padding:5px 9px;overflow:hidden;text-align:left;word-wrap:break-word}.qtip-titlebar{position:relative;padding:5px 35px 5px 10px;overflow:hidden;border-width:0 0 1px;font-weight:700}.qtip-titlebar+.qtip-content{border-top-width:0!important}.qtip-close{position:absolute;right:-9px;top:-9px;z-index:11;cursor:pointer;outline:0;border:1px solid transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-icon .ui-icon,.qtip-titlebar .ui-icon{display:block;text-indent:-1000em;direction:ltr}.qtip-icon,.qtip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;text-decoration:none}.qtip-icon .ui-icon{width:18px;height:14px;line-height:14px;text-align:center;text-indent:0;font:400 bold 10px/13px Tahoma,sans-serif;color:inherit;background:-100em -100em no-repeat}.qtip-default{border:1px solid #F1D031;background-color:#FFFFA3;color:#555}.qtip-default .qtip-titlebar{background-color:#FFEF93}.qtip-default .qtip-icon{border-color:#CCC;background:#F1F1F1;color:#777}.qtip-default .qtip-titlebar .qtip-close{border-color:#AAA;color:#111}
google-calendar-events.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Google Calendar Events
13
  * Plugin URI: https://github.com/pderksen/WP-Google-Calendar-Events
14
  * Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
15
- * Version: 2.1.4
16
  * Author: Phil Derksen
17
  * Author URI: http://philderksen.com
18
  * License: GPL-2.0+
12
  * Plugin Name: Google Calendar Events
13
  * Plugin URI: https://github.com/pderksen/WP-Google-Calendar-Events
14
  * Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
15
+ * Version: 2.1.5
16
  * Author: Phil Derksen
17
  * Author URI: http://philderksen.com
18
  * License: GPL-2.0+
js/gce-script.js CHANGED
@@ -102,12 +102,25 @@
102
  //Add qtip to all target items
103
  $(this).qtip({
104
  content: $(this).children('.gce-event-info'),
105
- position: { corner: { target: 'center', tooltip: 'bottomLeft' }, adjust: { screen: true } },
106
- hide: { fixed: true, delay: 100, effect: { length: 0 } },
107
- show: { solo: true, delay: 0, effect: { length: 0 } },
108
- style: { padding: "0", classes: { tooltip: 'gce-qtip', tip: 'gce-qtip-tip', title: 'gce-qtip-title', content: 'gce-qtip-content', active: 'gce-qtip-active' }, border: { width: 0 } }
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  });
110
  });
111
  }
112
  });
113
- }(jQuery))
102
  //Add qtip to all target items
103
  $(this).qtip({
104
  content: $(this).children('.gce-event-info'),
105
+ position: {
106
+ my: 'left bottom',
107
+ at: 'center'
108
+ },
109
+ show: {
110
+ solo: true
111
+ },
112
+ hide: {
113
+ fixed: true
114
+ }
115
+
116
+ /* Old qTip 1 settings */
117
+
118
+ //position: { corner: { target: 'center', tooltip: 'bottomLeft' }, adjust: { screen: true } },
119
+ //show: { solo: true, delay: 0, effect: { length: 0 } },
120
+ //hide: { fixed: true, delay: 100, effect: { length: 0 } },
121
+ //style: { padding: "0", classes: { tooltip: 'gce-qtip', tip: 'gce-qtip-tip', title: 'gce-qtip-title', content: 'gce-qtip-content', active: 'gce-qtip-active' }, border: { width: 0 } }
122
  });
123
  });
124
  }
125
  });
126
+ }(jQuery));
js/jquery-qtip.js DELETED
@@ -1,15 +0,0 @@
1
- /*!
2
- * jquery.qtip. The jQuery tooltip plugin
3
- *
4
- * Copyright (c) 2009 Craig Thompson
5
- * http://craigsworks.com
6
- *
7
- * Licensed under MIT
8
- * http://www.opensource.org/licenses/mit-license.php
9
- *
10
- * Launch : February 2009
11
- * Version : 1.0.0-rc3
12
- * Released: Tuesday 12th May, 2009 - 00:00
13
- * Debug: jquery.qtip.debug.js
14
- */
15
- (function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")==="object"&&f(this).data("qtip")){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';"> <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;"> <div class="qtip-contentWrapper" style="overflow:hidden;"> <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){z.stopPropagation();z.preventDefault();clearTimeout(t.timers.hide);return false}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}})(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery.qtip.js ADDED
@@ -0,0 +1,2001 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * qTip2 - Pretty powerful tooltips - v2.2.1
3
+ * http://qtip2.com
4
+ *
5
+ * Copyright (c) 2014
6
+ * Released under the MIT licenses
7
+ * http://jquery.org/license
8
+ *
9
+ * Date: Sat Sep 6 2014 11:12 GMT+0100+0100
10
+ * Plugins: None
11
+ * Styles: core
12
+ */
13
+ /*global window: false, jQuery: false, console: false, define: false */
14
+
15
+ /* Cache window, document, undefined */
16
+ (function( window, document, undefined ) {
17
+
18
+ // Uses AMD or browser globals to create a jQuery plugin.
19
+ (function( factory ) {
20
+ "use strict";
21
+ if(typeof define === 'function' && define.amd) {
22
+ define(['jquery'], factory);
23
+ }
24
+ else if(jQuery && !jQuery.fn.qtip) {
25
+ factory(jQuery);
26
+ }
27
+ }
28
+ (function($) {
29
+ "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
30
+ ;// Munge the primitives - Paul Irish tip
31
+ var TRUE = true,
32
+ FALSE = false,
33
+ NULL = null,
34
+
35
+ // Common variables
36
+ X = 'x', Y = 'y',
37
+ WIDTH = 'width',
38
+ HEIGHT = 'height',
39
+
40
+ // Positioning sides
41
+ TOP = 'top',
42
+ LEFT = 'left',
43
+ BOTTOM = 'bottom',
44
+ RIGHT = 'right',
45
+ CENTER = 'center',
46
+
47
+ // Position adjustment types
48
+ FLIP = 'flip',
49
+ FLIPINVERT = 'flipinvert',
50
+ SHIFT = 'shift',
51
+
52
+ // Shortcut vars
53
+ QTIP, PROTOTYPE, CORNER, CHECKS,
54
+ PLUGINS = {},
55
+ NAMESPACE = 'qtip',
56
+ ATTR_HAS = 'data-hasqtip',
57
+ ATTR_ID = 'data-qtip-id',
58
+ WIDGET = ['ui-widget', 'ui-tooltip'],
59
+ SELECTOR = '.'+NAMESPACE,
60
+ INACTIVE_EVENTS = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '),
61
+
62
+ CLASS_FIXED = NAMESPACE+'-fixed',
63
+ CLASS_DEFAULT = NAMESPACE + '-default',
64
+ CLASS_FOCUS = NAMESPACE + '-focus',
65
+ CLASS_HOVER = NAMESPACE + '-hover',
66
+ CLASS_DISABLED = NAMESPACE+'-disabled',
67
+
68
+ replaceSuffix = '_replacedByqTip',
69
+ oldtitle = 'oldtitle',
70
+ trackingBound,
71
+
72
+ // Browser detection
73
+ BROWSER = {
74
+ /*
75
+ * IE version detection
76
+ *
77
+ * Adapted from: http://ajaxian.com/archives/attack-of-the-ie-conditional-comment
78
+ * Credit to James Padolsey for the original implemntation!
79
+ */
80
+ ie: (function(){
81
+ for (
82
+ var v = 4, i = document.createElement("div");
83
+ (i.innerHTML = "<!--[if gt IE " + v + "]><i></i><![endif]-->") && i.getElementsByTagName("i")[0];
84
+ v+=1
85
+ ) {}
86
+ return v > 4 ? v : NaN;
87
+ }()),
88
+
89
+ /*
90
+ * iOS version detection
91
+ */
92
+ iOS: parseFloat(
93
+ ('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
94
+ .replace('undefined', '3_2').replace('_', '.').replace('_', '')
95
+ ) || FALSE
96
+ };
97
+ ;function QTip(target, options, id, attr) {
98
+ // Elements and ID
99
+ this.id = id;
100
+ this.target = target;
101
+ this.tooltip = NULL;
102
+ this.elements = { target: target };
103
+
104
+ // Internal constructs
105
+ this._id = NAMESPACE + '-' + id;
106
+ this.timers = { img: {} };
107
+ this.options = options;
108
+ this.plugins = {};
109
+
110
+ // Cache object
111
+ this.cache = {
112
+ event: {},
113
+ target: $(),
114
+ disabled: FALSE,
115
+ attr: attr,
116
+ onTooltip: FALSE,
117
+ lastClass: ''
118
+ };
119
+
120
+ // Set the initial flags
121
+ this.rendered = this.destroyed = this.disabled = this.waiting =
122
+ this.hiddenDuringWait = this.positioning = this.triggering = FALSE;
123
+ }
124
+ PROTOTYPE = QTip.prototype;
125
+
126
+ PROTOTYPE._when = function(deferreds) {
127
+ return $.when.apply($, deferreds);
128
+ };
129
+
130
+ PROTOTYPE.render = function(show) {
131
+ if(this.rendered || this.destroyed) { return this; } // If tooltip has already been rendered, exit
132
+
133
+ var self = this,
134
+ options = this.options,
135
+ cache = this.cache,
136
+ elements = this.elements,
137
+ text = options.content.text,
138
+ title = options.content.title,
139
+ button = options.content.button,
140
+ posOptions = options.position,
141
+ namespace = '.'+this._id+' ',
142
+ deferreds = [],
143
+ tooltip;
144
+
145
+ // Add ARIA attributes to target
146
+ $.attr(this.target[0], 'aria-describedby', this._id);
147
+
148
+ // Create public position object that tracks current position corners
149
+ cache.posClass = this._createPosClass(
150
+ (this.position = { my: posOptions.my, at: posOptions.at }).my
151
+ );
152
+
153
+ // Create tooltip element
154
+ this.tooltip = elements.tooltip = tooltip = $('<div/>', {
155
+ 'id': this._id,
156
+ 'class': [ NAMESPACE, CLASS_DEFAULT, options.style.classes, cache.posClass ].join(' '),
157
+ 'width': options.style.width || '',
158
+ 'height': options.style.height || '',
159
+ 'tracking': posOptions.target === 'mouse' && posOptions.adjust.mouse,
160
+
161
+ /* ARIA specific attributes */
162
+ 'role': 'alert',
163
+ 'aria-live': 'polite',
164
+ 'aria-atomic': FALSE,
165
+ 'aria-describedby': this._id + '-content',
166
+ 'aria-hidden': TRUE
167
+ })
168
+ .toggleClass(CLASS_DISABLED, this.disabled)
169
+ .attr(ATTR_ID, this.id)
170
+ .data(NAMESPACE, this)
171
+ .appendTo(posOptions.container)
172
+ .append(
173
+ // Create content element
174
+ elements.content = $('<div />', {
175
+ 'class': NAMESPACE + '-content',
176
+ 'id': this._id + '-content',
177
+ 'aria-atomic': TRUE
178
+ })
179
+ );
180
+
181
+ // Set rendered flag and prevent redundant reposition calls for now
182
+ this.rendered = -1;
183
+ this.positioning = TRUE;
184
+
185
+ // Create title...
186
+ if(title) {
187
+ this._createTitle();
188
+
189
+ // Update title only if its not a callback (called in toggle if so)
190
+ if(!$.isFunction(title)) {
191
+ deferreds.push( this._updateTitle(title, FALSE) );
192
+ }
193
+ }
194
+
195
+ // Create button
196
+ if(button) { this._createButton(); }
197
+
198
+ // Set proper rendered flag and update content if not a callback function (called in toggle)
199
+ if(!$.isFunction(text)) {
200
+ deferreds.push( this._updateContent(text, FALSE) );
201
+ }
202
+ this.rendered = TRUE;
203
+
204
+ // Setup widget classes
205
+ this._setWidget();
206
+
207
+ // Initialize 'render' plugins
208
+ $.each(PLUGINS, function(name) {
209
+ var instance;
210
+ if(this.initialize === 'render' && (instance = this(self))) {
211
+ self.plugins[name] = instance;
212
+ }
213
+ });
214
+
215
+ // Unassign initial events and assign proper events
216
+ this._unassignEvents();
217
+ this._assignEvents();
218
+
219
+ // When deferreds have completed
220
+ this._when(deferreds).then(function() {
221
+ // tooltiprender event
222
+ self._trigger('render');
223
+
224
+ // Reset flags
225
+ self.positioning = FALSE;
226
+
227
+ // Show tooltip if not hidden during wait period
228
+ if(!self.hiddenDuringWait && (options.show.ready || show)) {
229
+ self.toggle(TRUE, cache.event, FALSE);
230
+ }
231
+ self.hiddenDuringWait = FALSE;
232
+ });
233
+
234
+ // Expose API
235
+ QTIP.api[this.id] = this;
236
+
237
+ return this;
238
+ };
239
+
240
+ PROTOTYPE.destroy = function(immediate) {
241
+ // Set flag the signify destroy is taking place to plugins
242
+ // and ensure it only gets destroyed once!
243
+ if(this.destroyed) { return this.target; }
244
+
245
+ function process() {
246
+ if(this.destroyed) { return; }
247
+ this.destroyed = TRUE;
248
+
249
+ var target = this.target,
250
+ title = target.attr(oldtitle),
251
+ timer;
252
+
253
+ // Destroy tooltip if rendered
254
+ if(this.rendered) {
255
+ this.tooltip.stop(1,0).find('*').remove().end().remove();
256
+ }
257
+
258
+ // Destroy all plugins
259
+ $.each(this.plugins, function(name) {
260
+ this.destroy && this.destroy();
261
+ });
262
+
263
+ // Clear timers
264
+ for(timer in this.timers) {
265
+ clearTimeout(this.timers[timer]);
266
+ }
267
+
268
+ // Remove api object and ARIA attributes
269
+ target.removeData(NAMESPACE)
270
+ .removeAttr(ATTR_ID)
271
+ .removeAttr(ATTR_HAS)
272
+ .removeAttr('aria-describedby');
273
+
274
+ // Reset old title attribute if removed
275
+ if(this.options.suppress && title) {
276
+ target.attr('title', title).removeAttr(oldtitle);
277
+ }
278
+
279
+ // Remove qTip events associated with this API
280
+ this._unassignEvents();
281
+
282
+ // Remove ID from used id objects, and delete object references
283
+ // for better garbage collection and leak protection
284
+ this.options = this.elements = this.cache = this.timers =
285
+ this.plugins = this.mouse = NULL;
286
+
287
+ // Delete epoxsed API object
288
+ delete QTIP.api[this.id];
289
+ }
290
+
291
+ // If an immediate destory is needed
292
+ if((immediate !== TRUE || this.triggering === 'hide') && this.rendered) {
293
+ this.tooltip.one('tooltiphidden', $.proxy(process, this));
294
+ !this.triggering && this.hide();
295
+ }
296
+
297
+ // If we're not in the process of hiding... process
298
+ else { process.call(this); }
299
+
300
+ return this.target;
301
+ };
302
+ ;function invalidOpt(a) {
303
+ return a === NULL || $.type(a) !== 'object';
304
+ }
305
+
306
+ function invalidContent(c) {
307
+ return !( $.isFunction(c) || (c && c.attr) || c.length || ($.type(c) === 'object' && (c.jquery || c.then) ));
308
+ }
309
+
310
+ // Option object sanitizer
311
+ function sanitizeOptions(opts) {
312
+ var content, text, ajax, once;
313
+
314
+ if(invalidOpt(opts)) { return FALSE; }
315
+
316
+ if(invalidOpt(opts.metadata)) {
317
+ opts.metadata = { type: opts.metadata };
318
+ }
319
+
320
+ if('content' in opts) {
321
+ content = opts.content;
322
+
323
+ if(invalidOpt(content) || content.jquery || content.done) {
324
+ content = opts.content = {
325
+ text: (text = invalidContent(content) ? FALSE : content)
326
+ };
327
+ }
328
+ else { text = content.text; }
329
+
330
+ // DEPRECATED - Old content.ajax plugin functionality
331
+ // Converts it into the proper Deferred syntax
332
+ if('ajax' in content) {
333
+ ajax = content.ajax;
334
+ once = ajax && ajax.once !== FALSE;
335
+ delete content.ajax;
336
+
337
+ content.text = function(event, api) {
338
+ var loading = text || $(this).attr(api.options.content.attr) || 'Loading...',
339
+
340
+ deferred = $.ajax(
341
+ $.extend({}, ajax, { context: api })
342
+ )
343
+ .then(ajax.success, NULL, ajax.error)
344
+ .then(function(content) {
345
+ if(content && once) { api.set('content.text', content); }
346
+ return content;
347
+ },
348
+ function(xhr, status, error) {
349
+ if(api.destroyed || xhr.status === 0) { return; }
350
+ api.set('content.text', status + ': ' + error);
351
+ });
352
+
353
+ return !once ? (api.set('content.text', loading), deferred) : loading;
354
+ };
355
+ }
356
+
357
+ if('title' in content) {
358
+ if($.isPlainObject(content.title)) {
359
+ content.button = content.title.button;
360
+ content.title = content.title.text;
361
+ }
362
+
363
+ if(invalidContent(content.title || FALSE)) {
364
+ content.title = FALSE;
365
+ }
366
+ }
367
+ }
368
+
369
+ if('position' in opts && invalidOpt(opts.position)) {
370
+ opts.position = { my: opts.position, at: opts.position };
371
+ }
372
+
373
+ if('show' in opts && invalidOpt(opts.show)) {
374
+ opts.show = opts.show.jquery ? { target: opts.show } :
375
+ opts.show === TRUE ? { ready: TRUE } : { event: opts.show };
376
+ }
377
+
378
+ if('hide' in opts && invalidOpt(opts.hide)) {
379
+ opts.hide = opts.hide.jquery ? { target: opts.hide } : { event: opts.hide };
380
+ }
381
+
382
+ if('style' in opts && invalidOpt(opts.style)) {
383
+ opts.style = { classes: opts.style };
384
+ }
385
+
386
+ // Sanitize plugin options
387
+ $.each(PLUGINS, function() {
388
+ this.sanitize && this.sanitize(opts);
389
+ });
390
+
391
+ return opts;
392
+ }
393
+
394
+ // Setup builtin .set() option checks
395
+ CHECKS = PROTOTYPE.checks = {
396
+ builtin: {
397
+ // Core checks
398
+ '^id$': function(obj, o, v, prev) {
399
+ var id = v === TRUE ? QTIP.nextid : v,
400
+ new_id = NAMESPACE + '-' + id;
401
+
402
+ if(id !== FALSE && id.length > 0 && !$('#'+new_id).length) {
403
+ this._id = new_id;
404
+
405
+ if(this.rendered) {
406
+ this.tooltip[0].id = this._id;
407
+ this.elements.content[0].id = this._id + '-content';
408
+ this.elements.title[0].id = this._id + '-title';
409
+ }
410
+ }
411
+ else { obj[o] = prev; }
412
+ },
413
+ '^prerender': function(obj, o, v) {
414
+ v && !this.rendered && this.render(this.options.show.ready);
415
+ },
416
+
417
+ // Content checks
418
+ '^content.text$': function(obj, o, v) {
419
+ this._updateContent(v);
420
+ },
421
+ '^content.attr$': function(obj, o, v, prev) {
422
+ if(this.options.content.text === this.target.attr(prev)) {
423
+ this._updateContent( this.target.attr(v) );
424
+ }
425
+ },
426
+ '^content.title$': function(obj, o, v) {
427
+ // Remove title if content is null
428
+ if(!v) { return this._removeTitle(); }
429
+
430
+ // If title isn't already created, create it now and update
431
+ v && !this.elements.title && this._createTitle();
432
+ this._updateTitle(v);
433
+ },
434
+ '^content.button$': function(obj, o, v) {
435
+ this._updateButton(v);
436
+ },
437
+ '^content.title.(text|button)$': function(obj, o, v) {
438
+ this.set('content.'+o, v); // Backwards title.text/button compat
439
+ },
440
+
441
+ // Position checks
442
+ '^position.(my|at)$': function(obj, o, v){
443
+ 'string' === typeof v && (this.position[o] = obj[o] = new CORNER(v, o === 'at'));
444
+ },
445
+ '^position.container$': function(obj, o, v){
446
+ this.rendered && this.tooltip.appendTo(v);
447
+ },
448
+
449
+ // Show checks
450
+ '^show.ready$': function(obj, o, v) {
451
+ v && (!this.rendered && this.render(TRUE) || this.toggle(TRUE));
452
+ },
453
+
454
+ // Style checks
455
+ '^style.classes$': function(obj, o, v, p) {
456
+ this.rendered && this.tooltip.removeClass(p).addClass(v);
457
+ },
458
+ '^style.(width|height)': function(obj, o, v) {
459
+ this.rendered && this.tooltip.css(o, v);
460
+ },
461
+ '^style.widget|content.title': function() {
462
+ this.rendered && this._setWidget();
463
+ },
464
+ '^style.def': function(obj, o, v) {
465
+ this.rendered && this.tooltip.toggleClass(CLASS_DEFAULT, !!v);
466
+ },
467
+
468
+ // Events check
469
+ '^events.(render|show|move|hide|focus|blur)$': function(obj, o, v) {
470
+ this.rendered && this.tooltip[($.isFunction(v) ? '' : 'un') + 'bind']('tooltip'+o, v);
471
+ },
472
+
473
+ // Properties which require event reassignment
474
+ '^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)': function() {
475
+ if(!this.rendered) { return; }
476
+
477
+ // Set tracking flag
478
+ var posOptions = this.options.position;
479
+ this.tooltip.attr('tracking', posOptions.target === 'mouse' && posOptions.adjust.mouse);
480
+
481
+ // Reassign events
482
+ this._unassignEvents();
483
+ this._assignEvents();
484
+ }
485
+ }
486
+ };
487
+
488
+ // Dot notation converter
489
+ function convertNotation(options, notation) {
490
+ var i = 0, obj, option = options,
491
+
492
+ // Split notation into array
493
+ levels = notation.split('.');
494
+
495
+ // Loop through
496
+ while( option = option[ levels[i++] ] ) {
497
+ if(i < levels.length) { obj = option; }
498
+ }
499
+
500
+ return [obj || options, levels.pop()];
501
+ }
502
+
503
+ PROTOTYPE.get = function(notation) {
504
+ if(this.destroyed) { return this; }
505
+
506
+ var o = convertNotation(this.options, notation.toLowerCase()),
507
+ result = o[0][ o[1] ];
508
+
509
+ return result.precedance ? result.string() : result;
510
+ };
511
+
512
+ function setCallback(notation, args) {
513
+ var category, rule, match;
514
+
515
+ for(category in this.checks) {
516
+ for(rule in this.checks[category]) {
517
+ if(match = (new RegExp(rule, 'i')).exec(notation)) {
518
+ args.push(match);
519
+
520
+ if(category === 'builtin' || this.plugins[category]) {
521
+ this.checks[category][rule].apply(
522
+ this.plugins[category] || this, args
523
+ );
524
+ }
525
+ }
526
+ }
527
+ }
528
+ }
529
+
530
+ var rmove = /^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,
531
+ rrender = /^prerender|show\.ready/i;
532
+
533
+ PROTOTYPE.set = function(option, value) {
534
+ if(this.destroyed) { return this; }
535
+
536
+ var rendered = this.rendered,
537
+ reposition = FALSE,
538
+ options = this.options,
539
+ checks = this.checks,
540
+ name;
541
+
542
+ // Convert singular option/value pair into object form
543
+ if('string' === typeof option) {
544
+ name = option; option = {}; option[name] = value;
545
+ }
546
+ else { option = $.extend({}, option); }
547
+
548
+ // Set all of the defined options to their new values
549
+ $.each(option, function(notation, value) {
550
+ if(rendered && rrender.test(notation)) {
551
+ delete option[notation]; return;
552
+ }
553
+
554
+ // Set new obj value
555
+ var obj = convertNotation(options, notation.toLowerCase()), previous;
556
+ previous = obj[0][ obj[1] ];
557
+ obj[0][ obj[1] ] = value && value.nodeType ? $(value) : value;
558
+
559
+ // Also check if we need to reposition
560
+ reposition = rmove.test(notation) || reposition;
561
+
562
+ // Set the new params for the callback
563
+ option[notation] = [obj[0], obj[1], value, previous];
564
+ });
565
+
566
+ // Re-sanitize options
567
+ sanitizeOptions(options);
568
+
569
+ /*
570
+ * Execute any valid callbacks for the set options
571
+ * Also set positioning flag so we don't get loads of redundant repositioning calls.
572
+ */
573
+ this.positioning = TRUE;
574
+ $.each(option, $.proxy(setCallback, this));
575
+ this.positioning = FALSE;
576
+
577
+ // Update position if needed
578
+ if(this.rendered && this.tooltip[0].offsetWidth > 0 && reposition) {
579
+ this.reposition( options.position.target === 'mouse' ? NULL : this.cache.event );
580
+ }
581
+
582
+ return this;
583
+ };
584
+ ;PROTOTYPE._update = function(content, element, reposition) {
585
+ var self = this,
586
+ cache = this.cache;
587
+
588
+ // Make sure tooltip is rendered and content is defined. If not return
589
+ if(!this.rendered || !content) { return FALSE; }
590
+
591
+ // Use function to parse content
592
+ if($.isFunction(content)) {
593
+ content = content.call(this.elements.target, cache.event, this) || '';
594
+ }
595
+
596
+ // Handle deferred content
597
+ if($.isFunction(content.then)) {
598
+ cache.waiting = TRUE;
599
+ return content.then(function(c) {
600
+ cache.waiting = FALSE;
601
+ return self._update(c, element);
602
+ }, NULL, function(e) {
603
+ return self._update(e, element);
604
+ });
605
+ }
606
+
607
+ // If content is null... return false
608
+ if(content === FALSE || (!content && content !== '')) { return FALSE; }
609
+
610
+ // Append new content if its a DOM array and show it if hidden
611
+ if(content.jquery && content.length > 0) {
612
+ element.empty().append(
613
+ content.css({ display: 'block', visibility: 'visible' })
614
+ );
615
+ }
616
+
617
+ // Content is a regular string, insert the new content
618
+ else { element.html(content); }
619
+
620
+ // Wait for content to be loaded, and reposition
621
+ return this._waitForContent(element).then(function(images) {
622
+ if(self.rendered && self.tooltip[0].offsetWidth > 0) {
623
+ self.reposition(cache.event, !images.length);
624
+ }
625
+ });
626
+ };
627
+
628
+ PROTOTYPE._waitForContent = function(element) {
629
+ var cache = this.cache;
630
+
631
+ // Set flag
632
+ cache.waiting = TRUE;
633
+
634
+ // If imagesLoaded is included, ensure images have loaded and return promise
635
+ return ( $.fn.imagesLoaded ? element.imagesLoaded() : $.Deferred().resolve([]) )
636
+ .done(function() { cache.waiting = FALSE; })
637
+ .promise();
638
+ };
639
+
640
+ PROTOTYPE._updateContent = function(content, reposition) {
641
+ this._update(content, this.elements.content, reposition);
642
+ };
643
+
644
+ PROTOTYPE._updateTitle = function(content, reposition) {
645
+ if(this._update(content, this.elements.title, reposition) === FALSE) {
646
+ this._removeTitle(FALSE);
647
+ }
648
+ };
649
+
650
+ PROTOTYPE._createTitle = function()
651
+ {
652
+ var elements = this.elements,
653
+ id = this._id+'-title';
654
+
655
+ // Destroy previous title element, if present
656
+ if(elements.titlebar) { this._removeTitle(); }
657
+
658
+ // Create title bar and title elements
659
+ elements.titlebar = $('<div />', {
660
+ 'class': NAMESPACE + '-titlebar ' + (this.options.style.widget ? createWidgetClass('header') : '')
661
+ })
662
+ .append(
663
+ elements.title = $('<div />', {
664
+ 'id': id,
665
+ 'class': NAMESPACE + '-title',
666
+ 'aria-atomic': TRUE
667
+ })
668
+ )
669
+ .insertBefore(elements.content)
670
+
671
+ // Button-specific events
672
+ .delegate('.qtip-close', 'mousedown keydown mouseup keyup mouseout', function(event) {
673
+ $(this).toggleClass('ui-state-active ui-state-focus', event.type.substr(-4) === 'down');
674
+ })
675
+ .delegate('.qtip-close', 'mouseover mouseout', function(event){
676
+ $(this).toggleClass('ui-state-hover', event.type === 'mouseover');
677
+ });
678
+
679
+ // Create button if enabled
680
+ if(this.options.content.button) { this._createButton(); }
681
+ };
682
+
683
+ PROTOTYPE._removeTitle = function(reposition)
684
+ {
685
+ var elements = this.elements;
686
+
687
+ if(elements.title) {
688
+ elements.titlebar.remove();
689
+ elements.titlebar = elements.title = elements.button = NULL;
690
+
691
+ // Reposition if enabled
692
+ if(reposition !== FALSE) { this.reposition(); }
693
+ }
694
+ };
695
+ ;PROTOTYPE._createPosClass = function(my) {
696
+ return NAMESPACE + '-pos-' + (my || this.options.position.my).abbrev();
697
+ };
698
+
699
+ PROTOTYPE.reposition = function(event, effect) {
700
+ if(!this.rendered || this.positioning || this.destroyed) { return this; }
701
+
702
+ // Set positioning flag
703
+ this.positioning = TRUE;
704
+
705
+ var cache = this.cache,
706
+ tooltip = this.tooltip,
707
+ posOptions = this.options.position,
708
+ target = posOptions.target,
709
+ my = posOptions.my,
710
+ at = posOptions.at,
711
+ viewport = posOptions.viewport,
712
+ container = posOptions.container,
713
+ adjust = posOptions.adjust,
714
+ method = adjust.method.split(' '),
715
+ tooltipWidth = tooltip.outerWidth(FALSE),
716
+ tooltipHeight = tooltip.outerHeight(FALSE),
717
+ targetWidth = 0,
718
+ targetHeight = 0,
719
+ type = tooltip.css('position'),
720
+ position = { left: 0, top: 0 },
721
+ visible = tooltip[0].offsetWidth > 0,
722
+ isScroll = event && event.type === 'scroll',
723
+ win = $(window),
724
+ doc = container[0].ownerDocument,
725
+ mouse = this.mouse,
726
+ pluginCalculations, offset, adjusted, newClass;
727
+
728
+ // Check if absolute position was passed
729
+ if($.isArray(target) && target.length === 2) {
730
+ // Force left top and set position
731
+ at = { x: LEFT, y: TOP };
732
+ position = { left: target[0], top: target[1] };
733
+ }
734
+
735
+ // Check if mouse was the target
736
+ else if(target === 'mouse') {
737
+ // Force left top to allow flipping
738
+ at = { x: LEFT, y: TOP };
739
+
740
+ // Use the mouse origin that caused the show event, if distance hiding is enabled
741
+ if((!adjust.mouse || this.options.hide.distance) && cache.origin && cache.origin.pageX) {
742
+ event = cache.origin;
743
+ }
744
+
745
+ // Use cached event for resize/scroll events
746
+ else if(!event || (event && (event.type === 'resize' || event.type === 'scroll'))) {
747
+ event = cache.event;
748
+ }
749
+
750
+ // Otherwise, use the cached mouse coordinates if available
751
+ else if(mouse && mouse.pageX) {
752
+ event = mouse;
753
+ }
754
+
755
+ // Calculate body and container offset and take them into account below
756
+ if(type !== 'static') { position = container.offset(); }
757
+ if(doc.body.offsetWidth !== (window.innerWidth || doc.documentElement.clientWidth)) {
758
+ offset = $(document.body).offset();
759
+ }
760
+
761
+ // Use event coordinates for position
762
+ position = {
763
+ left: event.pageX - position.left + (offset && offset.left || 0),
764
+ top: event.pageY - position.top + (offset && offset.top || 0)
765
+ };
766
+
767
+ // Scroll events are a pain, some browsers
768
+ if(adjust.mouse && isScroll && mouse) {
769
+ position.left -= (mouse.scrollX || 0) - win.scrollLeft();
770
+ position.top -= (mouse.scrollY || 0) - win.scrollTop();
771
+ }
772
+ }
773
+
774
+ // Target wasn't mouse or absolute...
775
+ else {
776
+ // Check if event targetting is being used
777
+ if(target === 'event') {
778
+ if(event && event.target && event.type !== 'scroll' && event.type !== 'resize') {
779
+ cache.target = $(event.target);
780
+ }
781
+ else if(!event.target) {
782
+ cache.target = this.elements.target;
783
+ }
784
+ }
785
+ else if(target !== 'event'){
786
+ cache.target = $(target.jquery ? target : this.elements.target);
787
+ }
788
+ target = cache.target;
789
+
790
+ // Parse the target into a jQuery object and make sure there's an element present
791
+ target = $(target).eq(0);
792
+ if(target.length === 0) { return this; }
793
+
794
+ // Check if window or document is the target
795
+ else if(target[0] === document || target[0] === window) {
796
+ targetWidth = BROWSER.iOS ? window.innerWidth : target.width();
797
+ targetHeight = BROWSER.iOS ? window.innerHeight : target.height();
798
+
799
+ if(target[0] === window) {
800
+ position = {
801
+ top: (viewport || target).scrollTop(),
802
+ left: (viewport || target).scrollLeft()
803
+ };
804
+ }
805
+ }
806
+
807
+ // Check if the target is an <AREA> element
808
+ else if(PLUGINS.imagemap && target.is('area')) {
809
+ pluginCalculations = PLUGINS.imagemap(this, target, at, PLUGINS.viewport ? method : FALSE);
810
+ }
811
+
812
+ // Check if the target is an SVG element
813
+ else if(PLUGINS.svg && target && target[0].ownerSVGElement) {
814
+ pluginCalculations = PLUGINS.svg(this, target, at, PLUGINS.viewport ? method : FALSE);
815
+ }
816
+
817
+ // Otherwise use regular jQuery methods
818
+ else {
819
+ targetWidth = target.outerWidth(FALSE);
820
+ targetHeight = target.outerHeight(FALSE);
821
+ position = target.offset();
822
+ }
823
+
824
+ // Parse returned plugin values into proper variables
825
+ if(pluginCalculations) {
826
+ targetWidth = pluginCalculations.width;
827
+ targetHeight = pluginCalculations.height;
828
+ offset = pluginCalculations.offset;
829
+ position = pluginCalculations.position;
830
+ }
831
+
832
+ // Adjust position to take into account offset parents
833
+ position = this.reposition.offset(target, position, container);
834
+
835
+ // Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2-4.0 & v4.3-4.3.2)
836
+ if((BROWSER.iOS > 3.1 && BROWSER.iOS < 4.1) ||
837
+ (BROWSER.iOS >= 4.3 && BROWSER.iOS < 4.33) ||
838
+ (!BROWSER.iOS && type === 'fixed')
839
+ ){
840
+ position.left -= win.scrollLeft();
841
+ position.top -= win.scrollTop();
842
+ }
843
+
844
+ // Adjust position relative to target
845
+ if(!pluginCalculations || (pluginCalculations && pluginCalculations.adjustable !== FALSE)) {
846
+ position.left += at.x === RIGHT ? targetWidth : at.x === CENTER ? targetWidth / 2 : 0;
847
+ position.top += at.y === BOTTOM ? targetHeight : at.y === CENTER ? targetHeight / 2 : 0;
848
+ }
849
+ }
850
+
851
+ // Adjust position relative to tooltip
852
+ position.left += adjust.x + (my.x === RIGHT ? -tooltipWidth : my.x === CENTER ? -tooltipWidth / 2 : 0);
853
+ position.top += adjust.y + (my.y === BOTTOM ? -tooltipHeight : my.y === CENTER ? -tooltipHeight / 2 : 0);
854
+
855
+ // Use viewport adjustment plugin if enabled
856
+ if(PLUGINS.viewport) {
857
+ adjusted = position.adjusted = PLUGINS.viewport(
858
+ this, position, posOptions, targetWidth, targetHeight, tooltipWidth, tooltipHeight
859
+ );
860
+
861
+ // Apply offsets supplied by positioning plugin (if used)
862
+ if(offset && adjusted.left) { position.left += offset.left; }
863
+ if(offset && adjusted.top) { position.top += offset.top; }
864
+
865
+ // Apply any new 'my' position
866
+ if(adjusted.my) { this.position.my = adjusted.my; }
867
+ }
868
+
869
+ // Viewport adjustment is disabled, set values to zero
870
+ else { position.adjusted = { left: 0, top: 0 }; }
871
+
872
+ // Set tooltip position class if it's changed
873
+ if(cache.posClass !== (newClass = this._createPosClass(this.position.my))) {
874
+ tooltip.removeClass(cache.posClass).addClass( (cache.posClass = newClass) );
875
+ }
876
+
877
+ // tooltipmove event
878
+ if(!this._trigger('move', [position, viewport.elem || viewport], event)) { return this; }
879
+ delete position.adjusted;
880
+
881
+ // If effect is disabled, target it mouse, no animation is defined or positioning gives NaN out, set CSS directly
882
+ if(effect === FALSE || !visible || isNaN(position.left) || isNaN(position.top) || target === 'mouse' || !$.isFunction(posOptions.effect)) {
883
+ tooltip.css(position);
884
+ }
885
+
886
+ // Use custom function if provided
887
+ else if($.isFunction(posOptions.effect)) {
888
+ posOptions.effect.call(tooltip, this, $.extend({}, position));
889
+ tooltip.queue(function(next) {
890
+ // Reset attributes to avoid cross-browser rendering bugs
891
+ $(this).css({ opacity: '', height: '' });
892
+ if(BROWSER.ie) { this.style.removeAttribute('filter'); }
893
+
894
+ next();
895
+ });
896
+ }
897
+
898
+ // Set positioning flag
899
+ this.positioning = FALSE;
900
+
901
+ return this;
902
+ };
903
+
904
+ // Custom (more correct for qTip!) offset calculator
905
+ PROTOTYPE.reposition.offset = function(elem, pos, container) {
906
+ if(!container[0]) { return pos; }
907
+
908
+ var ownerDocument = $(elem[0].ownerDocument),
909
+ quirks = !!BROWSER.ie && document.compatMode !== 'CSS1Compat',
910
+ parent = container[0],
911
+ scrolled, position, parentOffset, overflow;
912
+
913
+ function scroll(e, i) {
914
+ pos.left += i * e.scrollLeft();
915
+ pos.top += i * e.scrollTop();
916
+ }
917
+
918
+ // Compensate for non-static containers offset
919
+ do {
920
+ if((position = $.css(parent, 'position')) !== 'static') {
921
+ if(position === 'fixed') {
922
+ parentOffset = parent.getBoundingClientRect();
923
+ scroll(ownerDocument, -1);
924
+ }
925
+ else {
926
+ parentOffset = $(parent).position();
927
+ parentOffset.left += (parseFloat($.css(parent, 'borderLeftWidth')) || 0);
928
+ parentOffset.top += (parseFloat($.css(parent, 'borderTopWidth')) || 0);
929
+ }
930
+
931
+ pos.left -= parentOffset.left + (parseFloat($.css(parent, 'marginLeft')) || 0);
932
+ pos.top -= parentOffset.top + (parseFloat($.css(parent, 'marginTop')) || 0);
933
+
934
+ // If this is the first parent element with an overflow of "scroll" or "auto", store it
935
+ if(!scrolled && (overflow = $.css(parent, 'overflow')) !== 'hidden' && overflow !== 'visible') { scrolled = $(parent); }
936
+ }
937
+ }
938
+ while((parent = parent.offsetParent));
939
+
940
+ // Compensate for containers scroll if it also has an offsetParent (or in IE quirks mode)
941
+ if(scrolled && (scrolled[0] !== ownerDocument[0] || quirks)) {
942
+ scroll(scrolled, 1);
943
+ }
944
+
945
+ return pos;
946
+ };
947
+
948
+ // Corner class
949
+ var C = (CORNER = PROTOTYPE.reposition.Corner = function(corner, forceY) {
950
+ corner = ('' + corner).replace(/([A-Z])/, ' $1').replace(/middle/gi, CENTER).toLowerCase();
951
+ this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
952
+ this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();
953
+ this.forceY = !!forceY;
954
+
955
+ var f = corner.charAt(0);
956
+ this.precedance = (f === 't' || f === 'b' ? Y : X);
957
+ }).prototype;
958
+
959
+ C.invert = function(z, center) {
960
+ this[z] = this[z] === LEFT ? RIGHT : this[z] === RIGHT ? LEFT : center || this[z];
961
+ };
962
+
963
+ C.string = function(join) {
964
+ var x = this.x, y = this.y;
965
+
966
+ var result = x !== y ?
967
+ (x === 'center' || y !== 'center' && (this.precedance === Y || this.forceY) ?
968
+ [y,x] : [x,y]
969
+ ) :
970
+ [x];
971
+
972
+ return join !== false ? result.join(' ') : result;
973
+ };
974
+
975
+ C.abbrev = function() {
976
+ var result = this.string(false);
977
+ return result[0].charAt(0) + (result[1] && result[1].charAt(0) || '');
978
+ };
979
+
980
+ C.clone = function() {
981
+ return new CORNER( this.string(), this.forceY );
982
+ };
983
+
984
+ ;
985
+ PROTOTYPE.toggle = function(state, event) {
986
+ var cache = this.cache,
987
+ options = this.options,
988
+ tooltip = this.tooltip;
989
+
990
+ // Try to prevent flickering when tooltip overlaps show element
991
+ if(event) {
992
+ if((/over|enter/).test(event.type) && cache.event && (/out|leave/).test(cache.event.type) &&
993
+ options.show.target.add(event.target).length === options.show.target.length &&
994
+ tooltip.has(event.relatedTarget).length) {
995
+ return this;
996
+ }
997
+
998
+ // Cache event
999
+ cache.event = $.event.fix(event);
1000
+ }
1001
+
1002
+ // If we're currently waiting and we've just hidden... stop it
1003
+ this.waiting && !state && (this.hiddenDuringWait = TRUE);
1004
+
1005
+ // Render the tooltip if showing and it isn't already
1006
+ if(!this.rendered) { return state ? this.render(1) : this; }
1007
+ else if(this.destroyed || this.disabled) { return this; }
1008
+
1009
+ var type = state ? 'show' : 'hide',
1010
+ opts = this.options[type],
1011
+ otherOpts = this.options[ !state ? 'show' : 'hide' ],
1012
+ posOptions = this.options.position,
1013
+ contentOptions = this.options.content,
1014
+ width = this.tooltip.css('width'),
1015
+ visible = this.tooltip.is(':visible'),
1016
+ animate = state || opts.target.length === 1,
1017
+ sameTarget = !event || opts.target.length < 2 || cache.target[0] === event.target,
1018
+ identicalState, allow, showEvent, delay, after;
1019
+
1020
+ // Detect state if valid one isn't provided
1021
+ if((typeof state).search('boolean|number')) { state = !visible; }
1022
+
1023
+ // Check if the tooltip is in an identical state to the new would-be state
1024
+ identicalState = !tooltip.is(':animated') && visible === state && sameTarget;
1025
+
1026
+ // Fire tooltip(show/hide) event and check if destroyed
1027
+ allow = !identicalState ? !!this._trigger(type, [90]) : NULL;
1028
+
1029
+ // Check to make sure the tooltip wasn't destroyed in the callback
1030
+ if(this.destroyed) { return this; }
1031
+
1032
+ // If the user didn't stop the method prematurely and we're showing the tooltip, focus it
1033
+ if(allow !== FALSE && state) { this.focus(event); }
1034
+
1035
+ // If the state hasn't changed or the user stopped it, return early
1036
+ if(!allow || identicalState) { return this; }
1037
+
1038
+ // Set ARIA hidden attribute
1039
+ $.attr(tooltip[0], 'aria-hidden', !!!state);
1040
+
1041
+ // Execute state specific properties
1042
+ if(state) {
1043
+ // Store show origin coordinates
1044
+ this.mouse && (cache.origin = $.event.fix(this.mouse));
1045
+
1046
+ // Update tooltip content & title if it's a dynamic function
1047
+ if($.isFunction(contentOptions.text)) { this._updateContent(contentOptions.text, FALSE); }
1048
+ if($.isFunction(contentOptions.title)) { this._updateTitle(contentOptions.title, FALSE); }
1049
+
1050
+ // Cache mousemove events for positioning purposes (if not already tracking)
1051
+ if(!trackingBound && posOptions.target === 'mouse' && posOptions.adjust.mouse) {
1052
+ $(document).bind('mousemove.'+NAMESPACE, this._storeMouse);
1053
+ trackingBound = TRUE;
1054
+ }
1055
+
1056
+ // Update the tooltip position (set width first to prevent viewport/max-width issues)
1057
+ if(!width) { tooltip.css('width', tooltip.outerWidth(FALSE)); }
1058
+ this.reposition(event, arguments[2]);
1059
+ if(!width) { tooltip.css('width', ''); }
1060
+
1061
+ // Hide other tooltips if tooltip is solo
1062
+ if(!!opts.solo) {
1063
+ (typeof opts.solo === 'string' ? $(opts.solo) : $(SELECTOR, opts.solo))
1064
+ .not(tooltip).not(opts.target).qtip('hide', $.Event('tooltipsolo'));
1065
+ }
1066
+ }
1067
+ else {
1068
+ // Clear show timer if we're hiding
1069
+ clearTimeout(this.timers.show);
1070
+
1071
+ // Remove cached origin on hide
1072
+ delete cache.origin;
1073
+
1074
+ // Remove mouse tracking event if not needed (all tracking qTips are hidden)
1075
+ if(trackingBound && !$(SELECTOR+'[tracking="true"]:visible', opts.solo).not(tooltip).length) {
1076
+ $(document).unbind('mousemove.'+NAMESPACE);
1077
+ trackingBound = FALSE;
1078
+ }
1079
+
1080
+ // Blur the tooltip
1081
+ this.blur(event);
1082
+ }
1083
+
1084
+ // Define post-animation, state specific properties
1085
+ after = $.proxy(function() {
1086
+ if(state) {
1087
+ // Prevent antialias from disappearing in IE by removing filter
1088
+ if(BROWSER.ie) { tooltip[0].style.removeAttribute('filter'); }
1089
+
1090
+ // Remove overflow setting to prevent tip bugs
1091
+ tooltip.css('overflow', '');
1092
+
1093
+ // Autofocus elements if enabled
1094
+ if('string' === typeof opts.autofocus) {
1095
+ $(this.options.show.autofocus, tooltip).focus();
1096
+ }
1097
+
1098
+ // If set, hide tooltip when inactive for delay period
1099
+ this.options.show.target.trigger('qtip-'+this.id+'-inactive');
1100
+ }
1101
+ else {
1102
+ // Reset CSS states
1103
+ tooltip.css({
1104
+ display: '',
1105
+ visibility: '',
1106
+ opacity: '',
1107
+ left: '',
1108
+ top: ''
1109
+ });
1110
+ }
1111
+
1112
+ // tooltipvisible/tooltiphidden events
1113
+ this._trigger(state ? 'visible' : 'hidden');
1114
+ }, this);
1115
+
1116
+ // If no effect type is supplied, use a simple toggle
1117
+ if(opts.effect === FALSE || animate === FALSE) {
1118
+ tooltip[ type ]();
1119
+ after();
1120
+ }
1121
+
1122
+ // Use custom function if provided
1123
+ else if($.isFunction(opts.effect)) {
1124
+ tooltip.stop(1, 1);
1125
+ opts.effect.call(tooltip, this);
1126
+ tooltip.queue('fx', function(n) {
1127
+ after(); n();
1128
+ });
1129
+ }
1130
+
1131
+ // Use basic fade function by default
1132
+ else { tooltip.fadeTo(90, state ? 1 : 0, after); }
1133
+
1134
+ // If inactive hide method is set, active it
1135
+ if(state) { opts.target.trigger('qtip-'+this.id+'-inactive'); }
1136
+
1137
+ return this;
1138
+ };
1139
+
1140
+ PROTOTYPE.show = function(event) { return this.toggle(TRUE, event); };
1141
+
1142
+ PROTOTYPE.hide = function(event) { return this.toggle(FALSE, event); };
1143
+ ;PROTOTYPE.focus = function(event) {
1144
+ if(!this.rendered || this.destroyed) { return this; }
1145
+
1146
+ var qtips = $(SELECTOR),
1147
+ tooltip = this.tooltip,
1148
+ curIndex = parseInt(tooltip[0].style.zIndex, 10),
1149
+ newIndex = QTIP.zindex + qtips.length,
1150
+ focusedElem;
1151
+
1152
+ // Only update the z-index if it has changed and tooltip is not already focused
1153
+ if(!tooltip.hasClass(CLASS_FOCUS)) {
1154
+ // tooltipfocus event
1155
+ if(this._trigger('focus', [newIndex], event)) {
1156
+ // Only update z-index's if they've changed
1157
+ if(curIndex !== newIndex) {
1158
+ // Reduce our z-index's and keep them properly ordered
1159
+ qtips.each(function() {
1160
+ if(this.style.zIndex > curIndex) {
1161
+ this.style.zIndex = this.style.zIndex - 1;
1162
+ }
1163
+ });
1164
+
1165
+ // Fire blur event for focused tooltip
1166
+ qtips.filter('.' + CLASS_FOCUS).qtip('blur', event);
1167
+ }
1168
+
1169
+ // Set the new z-index
1170
+ tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex;
1171
+ }
1172
+ }
1173
+
1174
+ return this;
1175
+ };
1176
+
1177
+ PROTOTYPE.blur = function(event) {
1178
+ if(!this.rendered || this.destroyed) { return this; }
1179
+
1180
+ // Set focused status to FALSE
1181
+ this.tooltip.removeClass(CLASS_FOCUS);
1182
+
1183
+ // tooltipblur event
1184
+ this._trigger('blur', [ this.tooltip.css('zIndex') ], event);
1185
+
1186
+ return this;
1187
+ };
1188
+ ;PROTOTYPE.disable = function(state) {
1189
+ if(this.destroyed) { return this; }
1190
+
1191
+ // If 'toggle' is passed, toggle the current state
1192
+ if(state === 'toggle') {
1193
+ state = !(this.rendered ? this.tooltip.hasClass(CLASS_DISABLED) : this.disabled);
1194
+ }
1195
+
1196
+ // Disable if no state passed
1197
+ else if('boolean' !== typeof state) {
1198
+ state = TRUE;
1199
+ }
1200
+
1201
+ if(this.rendered) {
1202
+ this.tooltip.toggleClass(CLASS_DISABLED, state)
1203
+ .attr('aria-disabled', state);
1204
+ }
1205
+
1206
+ this.disabled = !!state;
1207
+
1208
+ return this;
1209
+ };
1210
+
1211
+ PROTOTYPE.enable = function() { return this.disable(FALSE); };
1212
+ ;PROTOTYPE._createButton = function()
1213
+ {
1214
+ var self = this,
1215
+ elements = this.elements,
1216
+ tooltip = elements.tooltip,
1217
+ button = this.options.content.button,
1218
+ isString = typeof button === 'string',
1219
+ close = isString ? button : 'Close tooltip';
1220
+
1221
+ if(elements.button) { elements.button.remove(); }
1222
+
1223
+ // Use custom button if one was supplied by user, else use default
1224
+ if(button.jquery) {
1225
+ elements.button = button;
1226
+ }
1227
+ else {
1228
+ elements.button = $('<a />', {
1229
+ 'class': 'qtip-close ' + (this.options.style.widget ? '' : NAMESPACE+'-icon'),
1230
+ 'title': close,
1231
+ 'aria-label': close
1232
+ })
1233
+ .prepend(
1234
+ $('<span />', {
1235
+ 'class': 'ui-icon ui-icon-close',
1236
+ 'html': '&times;'
1237
+ })
1238
+ );
1239
+ }
1240
+
1241
+ // Create button and setup attributes
1242
+ elements.button.appendTo(elements.titlebar || tooltip)
1243
+ .attr('role', 'button')
1244
+ .click(function(event) {
1245
+ if(!tooltip.hasClass(CLASS_DISABLED)) { self.hide(event); }
1246
+ return FALSE;
1247
+ });
1248
+ };
1249
+
1250
+ PROTOTYPE._updateButton = function(button)
1251
+ {
1252
+ // Make sure tooltip is rendered and if not, return
1253
+ if(!this.rendered) { return FALSE; }
1254
+
1255
+ var elem = this.elements.button;
1256
+ if(button) { this._createButton(); }
1257
+ else { elem.remove(); }
1258
+ };
1259
+ ;// Widget class creator
1260
+ function createWidgetClass(cls) {
1261
+ return WIDGET.concat('').join(cls ? '-'+cls+' ' : ' ');
1262
+ }
1263
+
1264
+ // Widget class setter method
1265
+ PROTOTYPE._setWidget = function()
1266
+ {
1267
+ var on = this.options.style.widget,
1268
+ elements = this.elements,
1269
+ tooltip = elements.tooltip,
1270
+ disabled = tooltip.hasClass(CLASS_DISABLED);
1271
+
1272
+ tooltip.removeClass(CLASS_DISABLED);
1273
+ CLASS_DISABLED = on ? 'ui-state-disabled' : 'qtip-disabled';
1274
+ tooltip.toggleClass(CLASS_DISABLED, disabled);
1275
+
1276
+ tooltip.toggleClass('ui-helper-reset '+createWidgetClass(), on).toggleClass(CLASS_DEFAULT, this.options.style.def && !on);
1277
+
1278
+ if(elements.content) {
1279
+ elements.content.toggleClass( createWidgetClass('content'), on);
1280
+ }
1281
+ if(elements.titlebar) {
1282
+ elements.titlebar.toggleClass( createWidgetClass('header'), on);
1283
+ }
1284
+ if(elements.button) {
1285
+ elements.button.toggleClass(NAMESPACE+'-icon', !on);
1286
+ }
1287
+ };
1288
+ ;function delay(callback, duration) {
1289
+ // If tooltip has displayed, start hide timer
1290
+ if(duration > 0) {
1291
+ return setTimeout(
1292
+ $.proxy(callback, this), duration
1293
+ );
1294
+ }
1295
+ else{ callback.call(this); }
1296
+ }
1297
+
1298
+ function showMethod(event) {
1299
+ if(this.tooltip.hasClass(CLASS_DISABLED)) { return; }
1300
+
1301
+ // Clear hide timers
1302
+ clearTimeout(this.timers.show);
1303
+ clearTimeout(this.timers.hide);
1304
+
1305
+ // Start show timer
1306
+ this.timers.show = delay.call(this,
1307
+ function() { this.toggle(TRUE, event); },
1308
+ this.options.show.delay
1309
+ );
1310
+ }
1311
+
1312
+ function hideMethod(event) {
1313
+ if(this.tooltip.hasClass(CLASS_DISABLED) || this.destroyed) { return; }
1314
+
1315
+ // Check if new target was actually the tooltip element
1316
+ var relatedTarget = $(event.relatedTarget),
1317
+ ontoTooltip = relatedTarget.closest(SELECTOR)[0] === this.tooltip[0],
1318
+ ontoTarget = relatedTarget[0] === this.options.show.target[0];
1319
+
1320
+ // Clear timers and stop animation queue
1321
+ clearTimeout(this.timers.show);
1322
+ clearTimeout(this.timers.hide);
1323
+
1324
+ // Prevent hiding if tooltip is fixed and event target is the tooltip.
1325
+ // Or if mouse positioning is enabled and cursor momentarily overlaps
1326
+ if(this !== relatedTarget[0] &&
1327
+ (this.options.position.target === 'mouse' && ontoTooltip) ||
1328
+ (this.options.hide.fixed && (
1329
+ (/mouse(out|leave|move)/).test(event.type) && (ontoTooltip || ontoTarget))
1330
+ ))
1331
+ {
1332
+ try {
1333
+ event.preventDefault();
1334
+ event.stopImmediatePropagation();
1335
+ } catch(e) {}
1336
+
1337
+ return;
1338
+ }
1339
+
1340
+ // If tooltip has displayed, start hide timer
1341
+ this.timers.hide = delay.call(this,
1342
+ function() { this.toggle(FALSE, event); },
1343
+ this.options.hide.delay,
1344
+ this
1345
+ );
1346
+ }
1347
+
1348
+ function inactiveMethod(event) {
1349
+ if(this.tooltip.hasClass(CLASS_DISABLED) || !this.options.hide.inactive) { return; }
1350
+
1351
+ // Clear timer
1352
+ clearTimeout(this.timers.inactive);
1353
+
1354
+ this.timers.inactive = delay.call(this,
1355
+ function(){ this.hide(event); },
1356
+ this.options.hide.inactive
1357
+ );
1358
+ }
1359
+
1360
+ function repositionMethod(event) {
1361
+ if(this.rendered && this.tooltip[0].offsetWidth > 0) { this.reposition(event); }
1362
+ }
1363
+
1364
+ // Store mouse coordinates
1365
+ PROTOTYPE._storeMouse = function(event) {
1366
+ (this.mouse = $.event.fix(event)).type = 'mousemove';
1367
+ return this;
1368
+ };
1369
+
1370
+ // Bind events
1371
+ PROTOTYPE._bind = function(targets, events, method, suffix, context) {
1372
+ if(!targets || !method || !events.length) { return; }
1373
+ var ns = '.' + this._id + (suffix ? '-'+suffix : '');
1374
+ $(targets).bind(
1375
+ (events.split ? events : events.join(ns + ' ')) + ns,
1376
+ $.proxy(method, context || this)
1377
+ );
1378
+ return this;
1379
+ };
1380
+ PROTOTYPE._unbind = function(targets, suffix) {
1381
+ targets && $(targets).unbind('.' + this._id + (suffix ? '-'+suffix : ''));
1382
+ return this;
1383
+ };
1384
+
1385
+ // Global delegation helper
1386
+ function delegate(selector, events, method) {
1387
+ $(document.body).delegate(selector,
1388
+ (events.split ? events : events.join('.'+NAMESPACE + ' ')) + '.'+NAMESPACE,
1389
+ function() {
1390
+ var api = QTIP.api[ $.attr(this, ATTR_ID) ];
1391
+ api && !api.disabled && method.apply(api, arguments);
1392
+ }
1393
+ );
1394
+ }
1395
+ // Event trigger
1396
+ PROTOTYPE._trigger = function(type, args, event) {
1397
+ var callback = $.Event('tooltip'+type);
1398
+ callback.originalEvent = (event && $.extend({}, event)) || this.cache.event || NULL;
1399
+
1400
+ this.triggering = type;
1401
+ this.tooltip.trigger(callback, [this].concat(args || []));
1402
+ this.triggering = FALSE;
1403
+
1404
+ return !callback.isDefaultPrevented();
1405
+ };
1406
+
1407
+ PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTargets, hideTargets, showMethod, hideMethod) {
1408
+ // Get tasrgets that lye within both
1409
+ var similarTargets = showTargets.filter( hideTargets ).add( hideTargets.filter(showTargets) ),
1410
+ toggleEvents = [];
1411
+
1412
+ // If hide and show targets are the same...
1413
+ if(similarTargets.length) {
1414
+
1415
+ // Filter identical show/hide events
1416
+ $.each(hideEvents, function(i, type) {
1417
+ var showIndex = $.inArray(type, showEvents);
1418
+
1419
+ // Both events are identical, remove from both hide and show events
1420
+ // and append to toggleEvents
1421
+ showIndex > -1 && toggleEvents.push( showEvents.splice( showIndex, 1 )[0] );
1422
+ });
1423
+
1424
+ // Toggle events are special case of identical show/hide events, which happen in sequence
1425
+ if(toggleEvents.length) {
1426
+ // Bind toggle events to the similar targets
1427
+ this._bind(similarTargets, toggleEvents, function(event) {
1428
+ var state = this.rendered ? this.tooltip[0].offsetWidth > 0 : false;
1429
+ (state ? hideMethod : showMethod).call(this, event);
1430
+ });
1431
+
1432
+ // Remove the similar targets from the regular show/hide bindings
1433
+ showTargets = showTargets.not(similarTargets);
1434
+ hideTargets = hideTargets.not(similarTargets);
1435
+ }
1436
+ }
1437
+
1438
+ // Apply show/hide/toggle events
1439
+ this._bind(showTargets, showEvents, showMethod);
1440
+ this._bind(hideTargets, hideEvents, hideMethod);
1441
+ };
1442
+
1443
+ PROTOTYPE._assignInitialEvents = function(event) {
1444
+ var options = this.options,
1445
+ showTarget = options.show.target,
1446
+ hideTarget = options.hide.target,
1447
+ showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [],
1448
+ hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : [];
1449
+
1450
+ // Catch remove/removeqtip events on target element to destroy redundant tooltips
1451
+ this._bind(this.elements.target, ['remove', 'removeqtip'], function(event) {
1452
+ this.destroy(true);
1453
+ }, 'destroy');
1454
+
1455
+ /*
1456
+ * Make sure hoverIntent functions properly by using mouseleave as a hide event if
1457
+ * mouseenter/mouseout is used for show.event, even if it isn't in the users options.
1458
+ */
1459
+ if(/mouse(over|enter)/i.test(options.show.event) && !/mouse(out|leave)/i.test(options.hide.event)) {
1460
+ hideEvents.push('mouseleave');
1461
+ }
1462
+
1463
+ /*
1464
+ * Also make sure initial mouse targetting works correctly by caching mousemove coords
1465
+ * on show targets before the tooltip has rendered. Also set onTarget when triggered to
1466
+ * keep mouse tracking working.
1467
+ */
1468
+ this._bind(showTarget, 'mousemove', function(event) {
1469
+ this._storeMouse(event);
1470
+ this.cache.onTarget = TRUE;
1471
+ });
1472
+
1473
+ // Define hoverIntent function
1474
+ function hoverIntent(event) {
1475
+ // Only continue if tooltip isn't disabled
1476
+ if(this.disabled || this.destroyed) { return FALSE; }
1477
+
1478
+ // Cache the event data
1479
+ this.cache.event = event && $.event.fix(event);
1480
+ this.cache.target = event && $(event.target);
1481
+
1482
+ // Start the event sequence
1483
+ clearTimeout(this.timers.show);
1484
+ this.timers.show = delay.call(this,
1485
+ function() { this.render(typeof event === 'object' || options.show.ready); },
1486
+ options.prerender ? 0 : options.show.delay
1487
+ );
1488
+ }
1489
+
1490
+ // Filter and bind events
1491
+ this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, hoverIntent, function() {
1492
+ if(!this.timers) { return FALSE; }
1493
+ clearTimeout(this.timers.show);
1494
+ });
1495
+
1496
+ // Prerendering is enabled, create tooltip now
1497
+ if(options.show.ready || options.prerender) { hoverIntent.call(this, event); }
1498
+ };
1499
+
1500
+ // Event assignment method
1501
+ PROTOTYPE._assignEvents = function() {
1502
+ var self = this,
1503
+ options = this.options,
1504
+ posOptions = options.position,
1505
+
1506
+ tooltip = this.tooltip,
1507
+ showTarget = options.show.target,
1508
+ hideTarget = options.hide.target,
1509
+ containerTarget = posOptions.container,
1510
+ viewportTarget = posOptions.viewport,
1511
+ documentTarget = $(document),
1512
+ bodyTarget = $(document.body),
1513
+ windowTarget = $(window),
1514
+
1515
+ showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [],
1516
+ hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : [];
1517
+
1518
+
1519
+ // Assign passed event callbacks
1520
+ $.each(options.events, function(name, callback) {
1521
+ self._bind(tooltip, name === 'toggle' ? ['tooltipshow','tooltiphide'] : ['tooltip'+name], callback, null, tooltip);
1522
+ });
1523
+
1524
+ // Hide tooltips when leaving current window/frame (but not select/option elements)
1525
+ if(/mouse(out|leave)/i.test(options.hide.event) && options.hide.leave === 'window') {
1526
+ this._bind(documentTarget, ['mouseout', 'blur'], function(event) {
1527
+ if(!/select|option/.test(event.target.nodeName) && !event.relatedTarget) {
1528
+ this.hide(event);
1529
+ }
1530
+ });
1531
+ }
1532
+
1533
+ // Enable hide.fixed by adding appropriate class
1534
+ if(options.hide.fixed) {
1535
+ hideTarget = hideTarget.add( tooltip.addClass(CLASS_FIXED) );
1536
+ }
1537
+
1538
+ /*
1539
+ * Make sure hoverIntent functions properly by using mouseleave to clear show timer if
1540
+ * mouseenter/mouseout is used for show.event, even if it isn't in the users options.
1541
+ */
1542
+ else if(/mouse(over|enter)/i.test(options.show.event)) {
1543
+ this._bind(hideTarget, 'mouseleave', function() {
1544
+ clearTimeout(this.timers.show);
1545
+ });
1546
+ }
1547
+
1548
+ // Hide tooltip on document mousedown if unfocus events are enabled
1549
+ if(('' + options.hide.event).indexOf('unfocus') > -1) {
1550
+ this._bind(containerTarget.closest('html'), ['mousedown', 'touchstart'], function(event) {
1551
+ var elem = $(event.target),
1552
+ enabled = this.rendered && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0,
1553
+ isAncestor = elem.parents(SELECTOR).filter(this.tooltip[0]).length > 0;
1554
+
1555
+ if(elem[0] !== this.target[0] && elem[0] !== this.tooltip[0] && !isAncestor &&
1556
+ !this.target.has(elem[0]).length && enabled
1557
+ ) {
1558
+ this.hide(event);
1559
+ }
1560
+ });
1561
+ }
1562
+
1563
+ // Check if the tooltip hides when inactive
1564
+ if('number' === typeof options.hide.inactive) {
1565
+ // Bind inactive method to show target(s) as a custom event
1566
+ this._bind(showTarget, 'qtip-'+this.id+'-inactive', inactiveMethod, 'inactive');
1567
+
1568
+ // Define events which reset the 'inactive' event handler
1569
+ this._bind(hideTarget.add(tooltip), QTIP.inactiveEvents, inactiveMethod);
1570
+ }
1571
+
1572
+ // Filter and bind events
1573
+ this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, showMethod, hideMethod);
1574
+
1575
+ // Mouse movement bindings
1576
+ this._bind(showTarget.add(tooltip), 'mousemove', function(event) {
1577
+ // Check if the tooltip hides when mouse is moved a certain distance
1578
+ if('number' === typeof options.hide.distance) {
1579
+ var origin = this.cache.origin || {},
1580
+ limit = this.options.hide.distance,
1581
+ abs = Math.abs;
1582
+
1583
+ // Check if the movement has gone beyond the limit, and hide it if so
1584
+ if(abs(event.pageX - origin.pageX) >= limit || abs(event.pageY - origin.pageY) >= limit) {
1585
+ this.hide(event);
1586
+ }
1587
+ }
1588
+
1589
+ // Cache mousemove coords on show targets
1590
+ this._storeMouse(event);
1591
+ });
1592
+
1593
+ // Mouse positioning events
1594
+ if(posOptions.target === 'mouse') {
1595
+ // If mouse adjustment is on...
1596
+ if(posOptions.adjust.mouse) {
1597
+ // Apply a mouseleave event so we don't get problems with overlapping
1598
+ if(options.hide.event) {
1599
+ // Track if we're on the target or not
1600
+ this._bind(showTarget, ['mouseenter', 'mouseleave'], function(event) {
1601
+ if(!this.cache) {return FALSE; }
1602
+ this.cache.onTarget = event.type === 'mouseenter';
1603
+ });
1604
+ }
1605
+
1606
+ // Update tooltip position on mousemove
1607
+ this._bind(documentTarget, 'mousemove', function(event) {
1608
+ // Update the tooltip position only if the tooltip is visible and adjustment is enabled
1609
+ if(this.rendered && this.cache.onTarget && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0) {
1610
+ this.reposition(event);
1611
+ }
1612
+ });
1613
+ }
1614
+ }
1615
+
1616
+ // Adjust positions of the tooltip on window resize if enabled
1617
+ if(posOptions.adjust.resize || viewportTarget.length) {
1618
+ this._bind( $.event.special.resize ? viewportTarget : windowTarget, 'resize', repositionMethod );
1619
+ }
1620
+
1621
+ // Adjust tooltip position on scroll of the window or viewport element if present
1622
+ if(posOptions.adjust.scroll) {
1623
+ this._bind( windowTarget.add(posOptions.container), 'scroll', repositionMethod );
1624
+ }
1625
+ };
1626
+
1627
+ // Un-assignment method
1628
+ PROTOTYPE._unassignEvents = function() {
1629
+ var options = this.options,
1630
+ showTargets = options.show.target,
1631
+ hideTargets = options.hide.target,
1632
+ targets = $.grep([
1633
+ this.elements.target[0],
1634
+ this.rendered && this.tooltip[0],
1635
+ options.position.container[0],
1636
+ options.position.viewport[0],
1637
+ options.position.container.closest('html')[0], // unfocus
1638
+ window,
1639
+ document
1640
+ ], function(i) {
1641
+ return typeof i === 'object';
1642
+ });
1643
+
1644
+ // Add show and hide targets if they're valid
1645
+ if(showTargets && showTargets.toArray) {
1646
+ targets = targets.concat(showTargets.toArray());
1647
+ }
1648
+ if(hideTargets && hideTargets.toArray) {
1649
+ targets = targets.concat(hideTargets.toArray());
1650
+ }
1651
+
1652
+ // Unbind the events
1653
+ this._unbind(targets)
1654
+ ._unbind(targets, 'destroy')
1655
+ ._unbind(targets, 'inactive');
1656
+ };
1657
+
1658
+ // Apply common event handlers using delegate (avoids excessive .bind calls!)
1659
+ $(function() {
1660
+ delegate(SELECTOR, ['mouseenter', 'mouseleave'], function(event) {
1661
+ var state = event.type === 'mouseenter',
1662
+ tooltip = $(event.currentTarget),
1663
+ target = $(event.relatedTarget || event.target),
1664
+ options = this.options;
1665
+
1666
+ // On mouseenter...
1667
+ if(state) {
1668
+ // Focus the tooltip on mouseenter (z-index stacking)
1669
+ this.focus(event);
1670
+
1671
+ // Clear hide timer on tooltip hover to prevent it from closing
1672
+ tooltip.hasClass(CLASS_FIXED) && !tooltip.hasClass(CLASS_DISABLED) && clearTimeout(this.timers.hide);
1673
+ }
1674
+
1675
+ // On mouseleave...
1676
+ else {
1677
+ // When mouse tracking is enabled, hide when we leave the tooltip and not onto the show target (if a hide event is set)
1678
+ if(options.position.target === 'mouse' && options.position.adjust.mouse &&
1679
+ options.hide.event && options.show.target && !target.closest(options.show.target[0]).length) {
1680
+ this.hide(event);
1681
+ }
1682
+ }
1683
+
1684
+ // Add hover class
1685
+ tooltip.toggleClass(CLASS_HOVER, state);
1686
+ });
1687
+
1688
+ // Define events which reset the 'inactive' event handler
1689
+ delegate('['+ATTR_ID+']', INACTIVE_EVENTS, inactiveMethod);
1690
+ });
1691
+ ;// Initialization method
1692
+ function init(elem, id, opts) {
1693
+ var obj, posOptions, attr, config, title,
1694
+
1695
+ // Setup element references
1696
+ docBody = $(document.body),
1697
+
1698
+ // Use document body instead of document element if needed
1699
+ newTarget = elem[0] === document ? docBody : elem,
1700
+
1701
+ // Grab metadata from element if plugin is present
1702
+ metadata = (elem.metadata) ? elem.metadata(opts.metadata) : NULL,
1703
+
1704
+ // If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise
1705
+ metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL,
1706
+
1707
+ // Grab data from metadata.name (or data-qtipopts as fallback) using .data() method,
1708
+ html5 = elem.data(opts.metadata.name || 'qtipopts');
1709
+
1710
+ // If we don't get an object returned attempt to parse it manualyl without parseJSON
1711
+ try { html5 = typeof html5 === 'string' ? $.parseJSON(html5) : html5; } catch(e) {}
1712
+
1713
+ // Merge in and sanitize metadata
1714
+ config = $.extend(TRUE, {}, QTIP.defaults, opts,
1715
+ typeof html5 === 'object' ? sanitizeOptions(html5) : NULL,
1716
+ sanitizeOptions(metadata5 || metadata));
1717
+
1718
+ // Re-grab our positioning options now we've merged our metadata and set id to passed value
1719
+ posOptions = config.position;
1720
+ config.id = id;
1721
+
1722
+ // Setup missing content if none is detected
1723
+ if('boolean' === typeof config.content.text) {
1724
+ attr = elem.attr(config.content.attr);
1725
+
1726
+ // Grab from supplied attribute if available
1727
+ if(config.content.attr !== FALSE && attr) { config.content.text = attr; }
1728
+
1729
+ // No valid content was found, abort render
1730
+ else { return FALSE; }
1731
+ }
1732
+
1733
+ // Setup target options
1734
+ if(!posOptions.container.length) { posOptions.container = docBody; }
1735
+ if(posOptions.target === FALSE) { posOptions.target = newTarget; }
1736
+ if(config.show.target === FALSE) { config.show.target = newTarget; }
1737
+ if(config.show.solo === TRUE) { config.show.solo = posOptions.container.closest('body'); }
1738
+ if(config.hide.target === FALSE) { config.hide.target = newTarget; }
1739
+ if(config.position.viewport === TRUE) { config.position.viewport = posOptions.container; }
1740
+
1741
+ // Ensure we only use a single container
1742
+ posOptions.container = posOptions.container.eq(0);
1743
+
1744
+ // Convert position corner values into x and y strings
1745
+ posOptions.at = new CORNER(posOptions.at, TRUE);
1746
+ posOptions.my = new CORNER(posOptions.my);
1747
+
1748
+ // Destroy previous tooltip if overwrite is enabled, or skip element if not
1749
+ if(elem.data(NAMESPACE)) {
1750
+ if(config.overwrite) {
1751
+ elem.qtip('destroy', true);
1752
+ }
1753
+ else if(config.overwrite === FALSE) {
1754
+ return FALSE;
1755
+ }
1756
+ }
1757
+
1758
+ // Add has-qtip attribute
1759
+ elem.attr(ATTR_HAS, id);
1760
+
1761
+ // Remove title attribute and store it if present
1762
+ if(config.suppress && (title = elem.attr('title'))) {
1763
+ // Final attr call fixes event delegatiom and IE default tooltip showing problem
1764
+ elem.removeAttr('title').attr(oldtitle, title).attr('title', '');
1765
+ }
1766
+
1767
+ // Initialize the tooltip and add API reference
1768
+ obj = new QTip(elem, config, id, !!attr);
1769
+ elem.data(NAMESPACE, obj);
1770
+
1771
+ return obj;
1772
+ }
1773
+
1774
+ // jQuery $.fn extension method
1775
+ QTIP = $.fn.qtip = function(options, notation, newValue)
1776
+ {
1777
+ var command = ('' + options).toLowerCase(), // Parse command
1778
+ returned = NULL,
1779
+ args = $.makeArray(arguments).slice(1),
1780
+ event = args[args.length - 1],
1781
+ opts = this[0] ? $.data(this[0], NAMESPACE) : NULL;
1782
+
1783
+ // Check for API request
1784
+ if((!arguments.length && opts) || command === 'api') {
1785
+ return opts;
1786
+ }
1787
+
1788
+ // Execute API command if present
1789
+ else if('string' === typeof options) {
1790
+ this.each(function() {
1791
+ var api = $.data(this, NAMESPACE);
1792
+ if(!api) { return TRUE; }
1793
+
1794
+ // Cache the event if possible
1795
+ if(event && event.timeStamp) { api.cache.event = event; }
1796
+
1797
+ // Check for specific API commands
1798
+ if(notation && (command === 'option' || command === 'options')) {
1799
+ if(newValue !== undefined || $.isPlainObject(notation)) {
1800
+ api.set(notation, newValue);
1801
+ }
1802
+ else {
1803
+ returned = api.get(notation);
1804
+ return FALSE;
1805
+ }
1806
+ }
1807
+
1808
+ // Execute API command
1809
+ else if(api[command]) {
1810
+ api[command].apply(api, args);
1811
+ }
1812
+ });
1813
+
1814
+ return returned !== NULL ? returned : this;
1815
+ }
1816
+
1817
+ // No API commands. validate provided options and setup qTips
1818
+ else if('object' === typeof options || !arguments.length) {
1819
+ // Sanitize options first
1820
+ opts = sanitizeOptions($.extend(TRUE, {}, options));
1821
+
1822
+ return this.each(function(i) {
1823
+ var api, id;
1824
+
1825
+ // Find next available ID, or use custom ID if provided
1826
+ id = $.isArray(opts.id) ? opts.id[i] : opts.id;
1827
+ id = !id || id === FALSE || id.length < 1 || QTIP.api[id] ? QTIP.nextid++ : id;
1828
+
1829
+ // Initialize the qTip and re-grab newly sanitized options
1830
+ api = init($(this), id, opts);
1831
+ if(api === FALSE) { return TRUE; }
1832
+ else { QTIP.api[id] = api; }
1833
+
1834
+ // Initialize plugins
1835
+ $.each(PLUGINS, function() {
1836
+ if(this.initialize === 'initialize') { this(api); }
1837
+ });
1838
+
1839
+ // Assign initial pre-render events
1840
+ api._assignInitialEvents(event);
1841
+ });
1842
+ }
1843
+ };
1844
+
1845
+ // Expose class
1846
+ $.qtip = QTip;
1847
+
1848
+ // Populated in render method
1849
+ QTIP.api = {};
1850
+ ;$.each({
1851
+ /* Allow other plugins to successfully retrieve the title of an element with a qTip applied */
1852
+ attr: function(attr, val) {
1853
+ if(this.length) {
1854
+ var self = this[0],
1855
+ title = 'title',
1856
+ api = $.data(self, 'qtip');
1857
+
1858
+ if(attr === title && api && 'object' === typeof api && api.options.suppress) {
1859
+ if(arguments.length < 2) {
1860
+ return $.attr(self, oldtitle);
1861
+ }
1862
+
1863
+ // If qTip is rendered and title was originally used as content, update it
1864
+ if(api && api.options.content.attr === title && api.cache.attr) {
1865
+ api.set('content.text', val);
1866
+ }
1867
+
1868
+ // Use the regular attr method to set, then cache the result
1869
+ return this.attr(oldtitle, val);
1870
+ }
1871
+ }
1872
+
1873
+ return $.fn['attr'+replaceSuffix].apply(this, arguments);
1874
+ },
1875
+
1876
+ /* Allow clone to correctly retrieve cached title attributes */
1877
+ clone: function(keepData) {
1878
+ var titles = $([]), title = 'title',
1879
+
1880
+ // Clone our element using the real clone method
1881
+ elems = $.fn['clone'+replaceSuffix].apply(this, arguments);
1882
+
1883
+ // Grab all elements with an oldtitle set, and change it to regular title attribute, if keepData is false
1884
+ if(!keepData) {
1885
+ elems.filter('['+oldtitle+']').attr('title', function() {
1886
+ return $.attr(this, oldtitle);
1887
+ })
1888
+ .removeAttr(oldtitle);
1889
+ }
1890
+
1891
+ return elems;
1892
+ }
1893
+ }, function(name, func) {
1894
+ if(!func || $.fn[name+replaceSuffix]) { return TRUE; }
1895
+
1896
+ var old = $.fn[name+replaceSuffix] = $.fn[name];
1897
+ $.fn[name] = function() {
1898
+ return func.apply(this, arguments) || old.apply(this, arguments);
1899
+ };
1900
+ });
1901
+
1902
+ /* Fire off 'removeqtip' handler in $.cleanData if jQuery UI not present (it already does similar).
1903
+ * This snippet is taken directly from jQuery UI source code found here:
1904
+ * http://code.jquery.com/ui/jquery-ui-git.js
1905
+ */
1906
+ if(!$.ui) {
1907
+ $['cleanData'+replaceSuffix] = $.cleanData;
1908
+ $.cleanData = function( elems ) {
1909
+ for(var i = 0, elem; (elem = $( elems[i] )).length; i++) {
1910
+ if(elem.attr(ATTR_HAS)) {
1911
+ try { elem.triggerHandler('removeqtip'); }
1912
+ catch( e ) {}
1913
+ }
1914
+ }
1915
+ $['cleanData'+replaceSuffix].apply(this, arguments);
1916
+ };
1917
+ }
1918
+ ;// qTip version
1919
+ QTIP.version = '2.2.1';
1920
+
1921
+ // Base ID for all qTips
1922
+ QTIP.nextid = 0;
1923
+
1924
+ // Inactive events array
1925
+ QTIP.inactiveEvents = INACTIVE_EVENTS;
1926
+
1927
+ // Base z-index for all qTips
1928
+ QTIP.zindex = 15000;
1929
+
1930
+ // Define configuration defaults
1931
+ QTIP.defaults = {
1932
+ prerender: FALSE,
1933
+ id: FALSE,
1934
+ overwrite: TRUE,
1935
+ suppress: TRUE,
1936
+ content: {
1937
+ text: TRUE,
1938
+ attr: 'title',
1939
+ title: FALSE,
1940
+ button: FALSE
1941
+ },
1942
+ position: {
1943
+ my: 'top left',
1944
+ at: 'bottom right',
1945
+ target: FALSE,
1946
+ container: FALSE,
1947
+ viewport: FALSE,
1948
+ adjust: {
1949
+ x: 0, y: 0,
1950
+ mouse: TRUE,
1951
+ scroll: TRUE,
1952
+ resize: TRUE,
1953
+ method: 'flipinvert flipinvert'
1954
+ },
1955
+ effect: function(api, pos, viewport) {
1956
+ $(this).animate(pos, {
1957
+ duration: 200,
1958
+ queue: FALSE
1959
+ });
1960
+ }
1961
+ },
1962
+ show: {
1963
+ target: FALSE,
1964
+ event: 'mouseenter',
1965
+ effect: TRUE,
1966
+ delay: 90,
1967
+ solo: FALSE,
1968
+ ready: FALSE,
1969
+ autofocus: FALSE
1970
+ },
1971
+ hide: {
1972
+ target: FALSE,
1973
+ event: 'mouseleave',
1974
+ effect: TRUE,
1975
+ delay: 0,
1976
+ fixed: FALSE,
1977
+ inactive: FALSE,
1978
+ leave: 'window',
1979
+ distance: FALSE
1980
+ },
1981
+ style: {
1982
+ classes: '',
1983
+ widget: FALSE,
1984
+ width: FALSE,
1985
+ height: FALSE,
1986
+ def: TRUE
1987
+ },
1988
+ events: {
1989
+ render: NULL,
1990
+ move: NULL,
1991
+ show: NULL,
1992
+ hide: NULL,
1993
+ toggle: NULL,
1994
+ visible: NULL,
1995
+ hidden: NULL,
1996
+ focus: NULL,
1997
+ blur: NULL
1998
+ }
1999
+ };
2000
+ ;}));
2001
+ }( window, document ));
js/jquery.qtip.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /* qTip2 v2.2.1 | Plugins: None | Styles: core | qtip2.com | Licensed MIT | Sat Sep 06 2014 23:12:15 */
2
+
3
+ !function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=z,this.elements={target:a},this._id=I+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:y,attr:e,onTooltip:y,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=y}function f(a){return a===z||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?y:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?y:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==y,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,z,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(d.isPlainObject(b.title)&&(b.button=b.title.button,b.title=b.title.text),g(b.title||y)&&(b.title=y))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===x?{ready:x}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(H,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return L.concat("").join(a?"-"+a+" ":" ")}function l(a,b){return b>0?setTimeout(d.proxy(a,this),b):void a.call(this)}function m(a){this.tooltip.hasClass(S)||(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=l.call(this,function(){this.toggle(x,a)},this.options.show.delay))}function n(a){if(!this.tooltip.hasClass(S)&&!this.destroyed){var b=d(a.relatedTarget),c=b.closest(M)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=l.call(this,function(){this.toggle(y,a)},this.options.hide.delay,this)}}function o(a){!this.tooltip.hasClass(S)&&this.options.hide.inactive&&(clearTimeout(this.timers.inactive),this.timers.inactive=l.call(this,function(){this.hide(a)},this.options.hide.inactive))}function p(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function q(a,c,e){d(b.body).delegate(a,(c.split?c:c.join("."+I+" "))+"."+I,function(){var a=s.api[d.attr(this,K)];a&&!a.disabled&&e.apply(a,arguments)})}function r(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):z,p="html5"===f.metadata.type&&o?o[f.metadata.name]:z,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(x,{},s.defaults,f,"object"==typeof q?h(q):z,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===y||!j)return y;k.content.text=j}if(i.container.length||(i.container=m),i.target===y&&(i.target=n),k.show.target===y&&(k.show.target=n),k.show.solo===x&&(k.show.solo=i.container.closest("body")),k.hide.target===y&&(k.hide.target=n),k.position.viewport===x&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new u(i.at,x),i.my=new u(i.my),a.data(I))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===y)return y;return a.attr(J,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(U,l).attr("title",""),g=new e(a,k,c,!!j),a.data(I,g),g}var s,t,u,v,w,x=!0,y=!1,z=null,A="x",B="y",C="top",D="left",E="bottom",F="right",G="center",H={},I="qtip",J="data-hasqtip",K="data-qtip-id",L=["ui-widget","ui-tooltip"],M="."+I,N="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),O=I+"-fixed",P=I+"-default",Q=I+"-focus",R=I+"-hover",S=I+"-disabled",T="_replacedByqTip",U="oldtitle",V={ie:function(){for(var a=4,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];a+=1);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||y};t=e.prototype,t._when=function(a){return d.when.apply(d,a)},t.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),f.posClass=this._createPosClass((this.position={my:k.my,at:k.at}).my),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[I,P,e.style.classes,f.posClass].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":y,"aria-describedby":this._id+"-content","aria-hidden":x}).toggleClass(S,this.disabled).attr(K,this.id).data(I,this).appendTo(k.container).append(g.content=d("<div />",{"class":I+"-content",id:this._id+"-content","aria-atomic":x})),this.rendered=-1,this.positioning=x,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,y))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,y)),this.rendered=x,this._setWidget(),d.each(H,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=y,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(x,f.event,y),c.hiddenDuringWait=y}),s.api[this.id]=this,this},t.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=x;var a,b=this.target,c=b.attr(U);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()});for(a in this.timers)clearTimeout(this.timers[a]);b.removeData(I).removeAttr(K).removeAttr(J).removeAttr("aria-describedby"),this.options.suppress&&c&&b.attr("title",c).removeAttr(U),this._unassignEvents(),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=z,delete s.api[this.id]}}return this.destroyed?this.target:(a===x&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},v=t.checks={builtin:{"^id$":function(a,b,c,e){var f=c===x?s.nextid:c,g=I+"-"+f;f!==y&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),void this._updateTitle(c)):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(this.position[b]=a[b]=new u(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(x)||this.toggle(x))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(P,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},t.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var W=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,X=/^prerender|show\.ready/i;t.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=y,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&X.test(b))return void delete a[b];var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=W.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=x,d.each(a,d.proxy(j,this)),this.positioning=y,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?z:this.cache.event),this},t._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=x,a.then(function(a){return e.waiting=y,c._update(a,b)},z,function(a){return c._update(a,b)})):a===y||!a&&""!==a?y:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):y},t._waitForContent=function(a){var b=this.cache;return b.waiting=x,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=y}).promise()},t._updateContent=function(a,b){this._update(a,this.elements.content,b)},t._updateTitle=function(a,b){this._update(a,this.elements.title,b)===y&&this._removeTitle(y)},t._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":I+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":I+"-title","aria-atomic":x})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},t._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=z,a!==y&&this.reposition())},t._createPosClass=function(a){return I+"-pos-"+(a||this.options.position.my).abbrev()},t.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=x;var f,g,h,i,j=this.cache,k=this.tooltip,l=this.options.position,m=l.target,n=l.my,o=l.at,p=l.viewport,q=l.container,r=l.adjust,s=r.method.split(" "),t=k.outerWidth(y),u=k.outerHeight(y),v=0,w=0,z=k.css("position"),A={left:0,top:0},B=k[0].offsetWidth>0,I=c&&"scroll"===c.type,J=d(a),K=q[0].ownerDocument,L=this.mouse;if(d.isArray(m)&&2===m.length)o={x:D,y:C},A={left:m[0],top:m[1]};else if("mouse"===m)o={x:D,y:C},(!r.mouse||this.options.hide.distance)&&j.origin&&j.origin.pageX?c=j.origin:!c||c&&("resize"===c.type||"scroll"===c.type)?c=j.event:L&&L.pageX&&(c=L),"static"!==z&&(A=q.offset()),K.body.offsetWidth!==(a.innerWidth||K.documentElement.clientWidth)&&(g=d(b.body).offset()),A={left:c.pageX-A.left+(g&&g.left||0),top:c.pageY-A.top+(g&&g.top||0)},r.mouse&&I&&L&&(A.left-=(L.scrollX||0)-J.scrollLeft(),A.top-=(L.scrollY||0)-J.scrollTop());else{if("event"===m?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?j.target=d(c.target):c.target||(j.target=this.elements.target):"event"!==m&&(j.target=d(m.jquery?m:this.elements.target)),m=j.target,m=d(m).eq(0),0===m.length)return this;m[0]===b||m[0]===a?(v=V.iOS?a.innerWidth:m.width(),w=V.iOS?a.innerHeight:m.height(),m[0]===a&&(A={top:(p||m).scrollTop(),left:(p||m).scrollLeft()})):H.imagemap&&m.is("area")?f=H.imagemap(this,m,o,H.viewport?s:y):H.svg&&m&&m[0].ownerSVGElement?f=H.svg(this,m,o,H.viewport?s:y):(v=m.outerWidth(y),w=m.outerHeight(y),A=m.offset()),f&&(v=f.width,w=f.height,g=f.offset,A=f.position),A=this.reposition.offset(m,A,q),(V.iOS>3.1&&V.iOS<4.1||V.iOS>=4.3&&V.iOS<4.33||!V.iOS&&"fixed"===z)&&(A.left-=J.scrollLeft(),A.top-=J.scrollTop()),(!f||f&&f.adjustable!==y)&&(A.left+=o.x===F?v:o.x===G?v/2:0,A.top+=o.y===E?w:o.y===G?w/2:0)}return A.left+=r.x+(n.x===F?-t:n.x===G?-t/2:0),A.top+=r.y+(n.y===E?-u:n.y===G?-u/2:0),H.viewport?(h=A.adjusted=H.viewport(this,A,l,v,w,t,u),g&&h.left&&(A.left+=g.left),g&&h.top&&(A.top+=g.top),h.my&&(this.position.my=h.my)):A.adjusted={left:0,top:0},j.posClass!==(i=this._createPosClass(this.position.my))&&k.removeClass(j.posClass).addClass(j.posClass=i),this._trigger("move",[A,p.elem||p],c)?(delete A.adjusted,e===y||!B||isNaN(A.left)||isNaN(A.top)||"mouse"===m||!d.isFunction(l.effect)?k.css(A):d.isFunction(l.effect)&&(l.effect.call(k,this,d.extend({},A)),k.queue(function(a){d(this).css({opacity:"",height:""}),V.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=y,this):this},t.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!V.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var Y=(u=t.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,G).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?B:A}).prototype;Y.invert=function(a,b){this[a]=this[a]===D?F:this[a]===F?D:b||this[a]},Y.string=function(a){var b=this.x,c=this.y,d=b!==c?"center"===b||"center"!==c&&(this.precedance===B||this.forceY)?[c,b]:[b,c]:[b];return a!==!1?d.join(" "):d},Y.abbrev=function(){var a=this.string(!1);return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},Y.clone=function(){return new u(this.string(),this.forceY)},t.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&e.event&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=d.event.fix(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=x),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",l=this.options[k],m=(this.options[a?"hide":"show"],this.options.position),n=this.options.content,o=this.tooltip.css("width"),p=this.tooltip.is(":visible"),q=a||1===l.target.length,r=!c||l.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!p),h=!g.is(":animated")&&p===a&&r,i=h?z:!!this._trigger(k,[90]),this.destroyed?this:(i!==y&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(this.mouse&&(e.origin=d.event.fix(this.mouse)),d.isFunction(n.text)&&this._updateContent(n.text,y),d.isFunction(n.title)&&this._updateTitle(n.title,y),!w&&"mouse"===m.target&&m.adjust.mouse&&(d(b).bind("mousemove."+I,this._storeMouse),w=x),o||g.css("width",g.outerWidth(y)),this.reposition(c,arguments[2]),o||g.css("width",""),l.solo&&("string"==typeof l.solo?d(l.solo):d(M,l.solo)).not(g).not(l.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,w&&!d(M+'[tracking="true"]:visible',l.solo).not(g).length&&(d(b).unbind("mousemove."+I),w=y),this.blur(c)),j=d.proxy(function(){a?(V.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof l.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),l.effect===y||q===y?(g[k](),j()):d.isFunction(l.effect)?(g.stop(1,1),l.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&l.target.trigger("qtip-"+this.id+"-inactive"),this))},t.show=function(a){return this.toggle(x,a)},t.hide=function(a){return this.toggle(y,a)},t.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(M),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=s.zindex+b.length;return c.hasClass(Q)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+Q).qtip("blur",a)),c.addClass(Q)[0].style.zIndex=f),this},t.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(Q),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},t.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(S):this.disabled):"boolean"!=typeof a&&(a=x),this.rendered&&this.tooltip.toggleClass(S,a).attr("aria-disabled",a),this.disabled=!!a,this)},t.enable=function(){return this.disable(y)},t._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":I+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(S)||a.hide(b),y})},t._updateButton=function(a){if(!this.rendered)return y;var b=this.elements.button;a?this._createButton():b.remove()},t._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(S);c.removeClass(S),S=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(S,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(P,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(I+"-icon",!a)},t._storeMouse=function(a){return(this.mouse=d.event.fix(a)).type="mousemove",this},t._bind=function(a,b,c,e,f){if(a&&c&&b.length){var g="."+this._id+(e?"-"+e:"");return d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this)),this}},t._unbind=function(a,b){return a&&d(a).unbind("."+this._id+(b?"-"+b:"")),this},t._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||z,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=y,!e.isDefaultPrevented()},t._bindEvents=function(a,b,c,e,f,g){var h=c.filter(e).add(e.filter(c)),i=[];h.length&&(d.each(b,function(b,c){var e=d.inArray(c,a);e>-1&&i.push(a.splice(e,1)[0])}),i.length&&(this._bind(h,i,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)}),c=c.not(h),e=e.not(h))),this._bind(c,a,f),this._bind(e,b,g)},t._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?y:(this.cache.event=a&&d.event.fix(a),this.cache.target=a&&d(a.target),clearTimeout(this.timers.show),void(this.timers.show=l.call(this,function(){this.render("object"==typeof a||c.show.ready)},c.prerender?0:c.show.delay)))}var c=this.options,e=c.show.target,f=c.hide.target,g=c.show.event?d.trim(""+c.show.event).split(" "):[],h=c.hide.event?d.trim(""+c.hide.event).split(" "):[];this._bind(this.elements.target,["remove","removeqtip"],function(){this.destroy(!0)},"destroy"),/mouse(over|enter)/i.test(c.show.event)&&!/mouse(out|leave)/i.test(c.hide.event)&&h.push("mouseleave"),this._bind(e,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=x}),this._bindEvents(g,h,e,f,b,function(){return this.timers?void clearTimeout(this.timers.show):y}),(c.show.ready||c.prerender)&&b.call(this,a)},t._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),q=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],t=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(O)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(S)&&this.tooltip[0].offsetWidth>0,e=b.parents(M).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",o,"inactive"),this._bind(i.add(g),s.inactiveEvents,o)),this._bindEvents(r,t,h,i,m,n),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){return this.cache?void(this.cache.onTarget="mouseenter"===a.type):y}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(S)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:q,"resize",p),f.adjust.scroll&&this._bind(q.add(f.container),"scroll",p)},t._unassignEvents=function(){var c=this.options,e=c.show.target,f=c.hide.target,g=d.grep([this.elements.target[0],this.rendered&&this.tooltip[0],c.position.container[0],c.position.viewport[0],c.position.container.closest("html")[0],a,b],function(a){return"object"==typeof a});e&&e.toArray&&(g=g.concat(e.toArray())),f&&f.toArray&&(g=g.concat(f.toArray())),this._unbind(g)._unbind(g,"destroy")._unbind(g,"inactive")},d(function(){q(M,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(O)&&!c.hasClass(S)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.position.adjust.mouse&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(R,b)}),q("["+K+"]",N,o)}),s=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=z,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],I):z;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,I);if(!a)return x;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),y;a.set(b,e)}}),g!==z?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(x,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===y||c.length<1||s.api[c]?s.nextid++:c,b=r(d(this),c,k),b===y?x:(s.api[c]=b,d.each(H,function(){"initialize"===this.initialize&&this(b)}),void b._assignInitialEvents(j))}))},d.qtip=e,s.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,U):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(U,b))}return d.fn["attr"+T].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+T].apply(this,arguments));return a||b.filter("["+U+"]").attr("title",function(){return d.attr(this,U)}).removeAttr(U),b}},function(a,b){if(!b||d.fn[a+T])return x;var c=d.fn[a+T]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+T]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(J))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+T].apply(this,arguments)}),s.version="2.2.1",s.nextid=0,s.inactiveEvents=N,s.zindex=15e3,s.defaults={prerender:y,id:y,overwrite:x,suppress:x,content:{text:x,attr:"title",title:y,button:y},position:{my:"top left",at:"bottom right",target:y,container:y,viewport:y,adjust:{x:0,y:0,mouse:x,scroll:x,resize:x,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:y})}},show:{target:y,event:"mouseenter",effect:x,delay:90,solo:y,ready:y,autofocus:y},hide:{target:y,event:"mouseleave",effect:x,delay:0,fixed:y,inactive:y,leave:"window",distance:y},style:{classes:"",widget:y,width:y,height:y,def:x},events:{render:z,move:z,show:z,hide:z,toggle:z,visible:z,hidden:z,focus:z,blur:z}}})}(window,document);
4
+ //# sourceMappingURL=jquery.qtip.min.js.map