rails_notebook 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +22 -0
- data/app/assets/javascripts/rails_notebook/application.js +13 -0
- data/app/assets/stylesheets/rails_notebook/application.css +15 -0
- data/app/controllers/rails_notebook/application_controller.rb +4 -0
- data/app/helpers/rails_notebook/application_helper.rb +4 -0
- data/app/views/layouts/rails_notebook/application.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/lib/rails_notebook.rb +14 -0
- data/lib/rails_notebook/assets/d3.js +9553 -0
- data/lib/rails_notebook/assets/dagre-d3.js +17572 -0
- data/lib/rails_notebook/assets/jquery.jsonview.css +52 -0
- data/lib/rails_notebook/assets/jquery.jsonview.js +284 -0
- data/lib/rails_notebook/assets/jquery.qtip.min.css +2 -0
- data/lib/rails_notebook/assets/jquery.qtip.min.js +3 -0
- data/lib/rails_notebook/assets/jquery.tipsy.js +288 -0
- data/lib/rails_notebook/assets/kernel.css +7 -0
- data/lib/rails_notebook/assets/kernel.js +18 -0
- data/lib/rails_notebook/assets/kernel.json +1 -0
- data/lib/rails_notebook/assets/logo-32x32.png +0 -0
- data/lib/rails_notebook/assets/logo-64x64.png +0 -0
- data/lib/rails_notebook/assets/nv.d3.css +641 -0
- data/lib/rails_notebook/assets/nv.d3.js +13298 -0
- data/lib/rails_notebook/assets/rails_notebook.css +136 -0
- data/lib/rails_notebook/assets/rails_notebook.js +548 -0
- data/lib/rails_notebook/assets/tipsy.css +25 -0
- data/lib/rails_notebook/command.rb +104 -0
- data/lib/rails_notebook/engine.rb +9 -0
- data/lib/rails_notebook/profiler.rb +111 -0
- data/lib/rails_notebook/renderers.rb +121 -0
- data/lib/rails_notebook/route.rb +121 -0
- data/lib/rails_notebook/schemaTable.rb +27 -0
- data/lib/rails_notebook/serializers.rb +92 -0
- data/lib/rails_notebook/table.rb +28 -0
- data/lib/rails_notebook/version.rb +3 -0
- data/lib/tasks/rails_notebook_tasks.rake +8 -0
- metadata +196 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
.jsonview {
|
3
|
+
font-family: monospace;
|
4
|
+
font-size: 1.1em;
|
5
|
+
white-space: pre-wrap; }
|
6
|
+
.jsonview .prop {
|
7
|
+
font-weight: bold; }
|
8
|
+
.jsonview .null {
|
9
|
+
color: red; }
|
10
|
+
.jsonview .bool {
|
11
|
+
color: blue; }
|
12
|
+
.jsonview .num {
|
13
|
+
color: blue; }
|
14
|
+
.jsonview .string {
|
15
|
+
color: green;
|
16
|
+
white-space: pre-wrap; }
|
17
|
+
.jsonview .string.multiline {
|
18
|
+
display: inline-block;
|
19
|
+
vertical-align: text-top; }
|
20
|
+
.jsonview .collapser {
|
21
|
+
position: absolute;
|
22
|
+
left: -1em;
|
23
|
+
cursor: pointer; }
|
24
|
+
.jsonview .collapsible {
|
25
|
+
transition: height 1.2s;
|
26
|
+
transition: width 1.2s; }
|
27
|
+
.jsonview .collapsible.collapsed {
|
28
|
+
height: .8em;
|
29
|
+
width: 1em;
|
30
|
+
display: inline-block;
|
31
|
+
overflow: hidden;
|
32
|
+
margin: 0; }
|
33
|
+
.jsonview .collapsible.collapsed:before {
|
34
|
+
content: "…";
|
35
|
+
width: 1em;
|
36
|
+
margin-left: .2em; }
|
37
|
+
.jsonview .collapser.collapsed {
|
38
|
+
transform: rotate(0deg); }
|
39
|
+
.jsonview .q {
|
40
|
+
display: inline-block;
|
41
|
+
width: 0px;
|
42
|
+
color: transparent; }
|
43
|
+
.jsonview li {
|
44
|
+
position: relative; }
|
45
|
+
.jsonview ul {
|
46
|
+
list-style: none;
|
47
|
+
margin: 0 0 0 2em;
|
48
|
+
padding: 0; }
|
49
|
+
.jsonview h1 {
|
50
|
+
font-size: 1.2em; }
|
51
|
+
|
52
|
+
/*# sourceMappingURL=jquery.jsonview.css.map */
|
@@ -0,0 +1,284 @@
|
|
1
|
+
|
2
|
+
/*!
|
3
|
+
jQuery JSONView.
|
4
|
+
Licensed under the MIT License.
|
5
|
+
*/
|
6
|
+
(function(jQuery) {
|
7
|
+
var $, Collapser, JSONFormatter, JSONView;
|
8
|
+
JSONFormatter = (function() {
|
9
|
+
function JSONFormatter(options) {
|
10
|
+
if (options == null) {
|
11
|
+
options = {};
|
12
|
+
}
|
13
|
+
this.options = options;
|
14
|
+
}
|
15
|
+
|
16
|
+
JSONFormatter.prototype.htmlEncode = function(html) {
|
17
|
+
if (html !== null) {
|
18
|
+
return html.toString().replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
19
|
+
} else {
|
20
|
+
return '';
|
21
|
+
}
|
22
|
+
};
|
23
|
+
|
24
|
+
JSONFormatter.prototype.jsString = function(s) {
|
25
|
+
s = JSON.stringify(s).slice(1, -1);
|
26
|
+
return this.htmlEncode(s);
|
27
|
+
};
|
28
|
+
|
29
|
+
JSONFormatter.prototype.decorateWithSpan = function(value, className) {
|
30
|
+
return "<span class=\"" + className + "\">" + (this.htmlEncode(value)) + "</span>";
|
31
|
+
};
|
32
|
+
|
33
|
+
JSONFormatter.prototype.valueToHTML = function(value, level) {
|
34
|
+
var valueType;
|
35
|
+
if (level == null) {
|
36
|
+
level = 0;
|
37
|
+
}
|
38
|
+
valueType = Object.prototype.toString.call(value).match(/\s(.+)]/)[1].toLowerCase();
|
39
|
+
return this["" + valueType + "ToHTML"].call(this, value, level);
|
40
|
+
};
|
41
|
+
|
42
|
+
JSONFormatter.prototype.nullToHTML = function(value) {
|
43
|
+
return this.decorateWithSpan('null', 'null');
|
44
|
+
};
|
45
|
+
|
46
|
+
JSONFormatter.prototype.numberToHTML = function(value) {
|
47
|
+
return this.decorateWithSpan(value, 'num');
|
48
|
+
};
|
49
|
+
|
50
|
+
JSONFormatter.prototype.stringToHTML = function(value) {
|
51
|
+
var multilineClass, newLinePattern;
|
52
|
+
if (/^(http|https|file):\/\/[^\s]+$/i.test(value)) {
|
53
|
+
return "<a href=\"" + (this.htmlEncode(value)) + "\"><span class=\"q\">\"</span>" + (this.jsString(value)) + "<span class=\"q\">\"</span></a>";
|
54
|
+
} else {
|
55
|
+
multilineClass = '';
|
56
|
+
value = this.jsString(value);
|
57
|
+
if (this.options.nl2br) {
|
58
|
+
newLinePattern = /([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g;
|
59
|
+
if (newLinePattern.test(value)) {
|
60
|
+
multilineClass = ' multiline';
|
61
|
+
value = (value + '').replace(newLinePattern, '$1' + '<br />');
|
62
|
+
}
|
63
|
+
}
|
64
|
+
return "<span class=\"string" + multilineClass + "\">\"" + value + "\"</span>";
|
65
|
+
}
|
66
|
+
};
|
67
|
+
|
68
|
+
JSONFormatter.prototype.booleanToHTML = function(value) {
|
69
|
+
return this.decorateWithSpan(value, 'bool');
|
70
|
+
};
|
71
|
+
|
72
|
+
JSONFormatter.prototype.arrayToHTML = function(array, level) {
|
73
|
+
var collapsible, hasContents, index, numProps, output, value, _i, _len;
|
74
|
+
if (level == null) {
|
75
|
+
level = 0;
|
76
|
+
}
|
77
|
+
hasContents = false;
|
78
|
+
output = '';
|
79
|
+
numProps = array.length;
|
80
|
+
for (index = _i = 0, _len = array.length; _i < _len; index = ++_i) {
|
81
|
+
value = array[index];
|
82
|
+
hasContents = true;
|
83
|
+
output += '<li>' + this.valueToHTML(value, level + 1);
|
84
|
+
if (numProps > 1) {
|
85
|
+
output += ',';
|
86
|
+
}
|
87
|
+
output += '</li>';
|
88
|
+
numProps--;
|
89
|
+
}
|
90
|
+
if (hasContents) {
|
91
|
+
collapsible = level === 0 ? '' : ' collapsible';
|
92
|
+
return "[<ul class=\"array level" + level + collapsible + "\">" + output + "</ul>]";
|
93
|
+
} else {
|
94
|
+
return '[ ]';
|
95
|
+
}
|
96
|
+
};
|
97
|
+
|
98
|
+
JSONFormatter.prototype.objectToHTML = function(object, level) {
|
99
|
+
var collapsible, hasContents, key, numProps, output, prop, value;
|
100
|
+
if (level == null) {
|
101
|
+
level = 0;
|
102
|
+
}
|
103
|
+
hasContents = false;
|
104
|
+
output = '';
|
105
|
+
numProps = 0;
|
106
|
+
for (prop in object) {
|
107
|
+
numProps++;
|
108
|
+
}
|
109
|
+
for (prop in object) {
|
110
|
+
value = object[prop];
|
111
|
+
hasContents = true;
|
112
|
+
key = this.options.escape ? this.jsString(prop) : prop;
|
113
|
+
output += "<li><span class=\"prop\"><span class=\"q\">\"</span>" + key + "<span class=\"q\">\"</span></span>: " + (this.valueToHTML(value, level + 1));
|
114
|
+
if (numProps > 1) {
|
115
|
+
output += ',';
|
116
|
+
}
|
117
|
+
output += '</li>';
|
118
|
+
numProps--;
|
119
|
+
}
|
120
|
+
if (hasContents) {
|
121
|
+
collapsible = level === 0 ? '' : ' collapsible';
|
122
|
+
return "{<ul class=\"obj level" + level + collapsible + "\">" + output + "</ul>}";
|
123
|
+
} else {
|
124
|
+
return '{ }';
|
125
|
+
}
|
126
|
+
};
|
127
|
+
|
128
|
+
JSONFormatter.prototype.jsonToHTML = function(json) {
|
129
|
+
return "<div class=\"jsonview\">" + (this.valueToHTML(json)) + "</div>";
|
130
|
+
};
|
131
|
+
|
132
|
+
return JSONFormatter;
|
133
|
+
|
134
|
+
})();
|
135
|
+
(typeof module !== "undefined" && module !== null) && (module.exports = JSONFormatter);
|
136
|
+
Collapser = (function() {
|
137
|
+
function Collapser() {}
|
138
|
+
|
139
|
+
Collapser.bindEvent = function(item, options) {
|
140
|
+
var collapser;
|
141
|
+
collapser = document.createElement('div');
|
142
|
+
collapser.className = 'collapser';
|
143
|
+
collapser.innerHTML = options.collapsed ? '+' : '-';
|
144
|
+
collapser.addEventListener('click', (function(_this) {
|
145
|
+
return function(event) {
|
146
|
+
return _this.toggle(event.target, options);
|
147
|
+
};
|
148
|
+
})(this));
|
149
|
+
item.insertBefore(collapser, item.firstChild);
|
150
|
+
if (options.collapsed) {
|
151
|
+
return this.collapse(collapser);
|
152
|
+
}
|
153
|
+
};
|
154
|
+
|
155
|
+
Collapser.expand = function(collapser) {
|
156
|
+
var ellipsis, target;
|
157
|
+
target = this.collapseTarget(collapser);
|
158
|
+
if (target.style.display === '') {
|
159
|
+
return;
|
160
|
+
}
|
161
|
+
ellipsis = target.parentNode.getElementsByClassName('ellipsis')[0];
|
162
|
+
target.parentNode.removeChild(ellipsis);
|
163
|
+
target.style.display = '';
|
164
|
+
return collapser.innerHTML = '-';
|
165
|
+
};
|
166
|
+
|
167
|
+
Collapser.collapse = function(collapser) {
|
168
|
+
var ellipsis, target;
|
169
|
+
target = this.collapseTarget(collapser);
|
170
|
+
if (target.style.display === 'none') {
|
171
|
+
return;
|
172
|
+
}
|
173
|
+
target.style.display = 'none';
|
174
|
+
ellipsis = document.createElement('span');
|
175
|
+
ellipsis.className = 'ellipsis';
|
176
|
+
ellipsis.innerHTML = ' … ';
|
177
|
+
target.parentNode.insertBefore(ellipsis, target);
|
178
|
+
return collapser.innerHTML = '+';
|
179
|
+
};
|
180
|
+
|
181
|
+
Collapser.toggle = function(collapser, options) {
|
182
|
+
var action, collapsers, target, _i, _len, _results;
|
183
|
+
if (options == null) {
|
184
|
+
options = {};
|
185
|
+
}
|
186
|
+
target = this.collapseTarget(collapser);
|
187
|
+
action = target.style.display === 'none' ? 'expand' : 'collapse';
|
188
|
+
if (options.recursive_collapser) {
|
189
|
+
collapsers = collapser.parentNode.getElementsByClassName('collapser');
|
190
|
+
_results = [];
|
191
|
+
for (_i = 0, _len = collapsers.length; _i < _len; _i++) {
|
192
|
+
collapser = collapsers[_i];
|
193
|
+
_results.push(this[action](collapser));
|
194
|
+
}
|
195
|
+
return _results;
|
196
|
+
} else {
|
197
|
+
return this[action](collapser);
|
198
|
+
}
|
199
|
+
};
|
200
|
+
|
201
|
+
Collapser.collapseTarget = function(collapser) {
|
202
|
+
var target, targets;
|
203
|
+
targets = collapser.parentNode.getElementsByClassName('collapsible');
|
204
|
+
if (!targets.length) {
|
205
|
+
return;
|
206
|
+
}
|
207
|
+
return target = targets[0];
|
208
|
+
};
|
209
|
+
|
210
|
+
return Collapser;
|
211
|
+
|
212
|
+
})();
|
213
|
+
$ = jQuery;
|
214
|
+
JSONView = {
|
215
|
+
collapse: function(el) {
|
216
|
+
if (el.innerHTML === '-') {
|
217
|
+
return Collapser.collapse(el);
|
218
|
+
}
|
219
|
+
},
|
220
|
+
expand: function(el) {
|
221
|
+
if (el.innerHTML === '+') {
|
222
|
+
return Collapser.expand(el);
|
223
|
+
}
|
224
|
+
},
|
225
|
+
toggle: function(el) {
|
226
|
+
return Collapser.toggle(el);
|
227
|
+
}
|
228
|
+
};
|
229
|
+
return $.fn.JSONView = function() {
|
230
|
+
var args, defaultOptions, formatter, json, method, options, outputDoc;
|
231
|
+
args = arguments;
|
232
|
+
if (JSONView[args[0]] != null) {
|
233
|
+
method = args[0];
|
234
|
+
return this.each(function() {
|
235
|
+
var $this, level;
|
236
|
+
$this = $(this);
|
237
|
+
if (args[1] != null) {
|
238
|
+
level = args[1];
|
239
|
+
return $this.find(".jsonview .collapsible.level" + level).siblings('.collapser').each(function() {
|
240
|
+
return JSONView[method](this);
|
241
|
+
});
|
242
|
+
} else {
|
243
|
+
return $this.find('.jsonview > ul > li .collapsible').siblings('.collapser').each(function() {
|
244
|
+
return JSONView[method](this);
|
245
|
+
});
|
246
|
+
}
|
247
|
+
});
|
248
|
+
} else {
|
249
|
+
json = args[0];
|
250
|
+
options = args[1] || {};
|
251
|
+
defaultOptions = {
|
252
|
+
collapsed: false,
|
253
|
+
nl2br: false,
|
254
|
+
recursive_collapser: false,
|
255
|
+
escape: true
|
256
|
+
};
|
257
|
+
options = $.extend(defaultOptions, options);
|
258
|
+
formatter = new JSONFormatter({
|
259
|
+
nl2br: options.nl2br,
|
260
|
+
escape: options.escape
|
261
|
+
});
|
262
|
+
if (Object.prototype.toString.call(json) === '[object String]') {
|
263
|
+
json = JSON.parse(json);
|
264
|
+
}
|
265
|
+
outputDoc = formatter.jsonToHTML(json);
|
266
|
+
return this.each(function() {
|
267
|
+
var $this, item, items, _i, _len, _results;
|
268
|
+
$this = $(this);
|
269
|
+
$this.html(outputDoc);
|
270
|
+
items = $this[0].getElementsByClassName('collapsible');
|
271
|
+
_results = [];
|
272
|
+
for (_i = 0, _len = items.length; _i < _len; _i++) {
|
273
|
+
item = items[_i];
|
274
|
+
if (item.parentNode.nodeName === 'LI') {
|
275
|
+
_results.push(Collapser.bindEvent(item.parentNode, options));
|
276
|
+
} else {
|
277
|
+
_results.push(void 0);
|
278
|
+
}
|
279
|
+
}
|
280
|
+
return _results;
|
281
|
+
});
|
282
|
+
}
|
283
|
+
};
|
284
|
+
})(jQuery);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/* qTip2 v2.2.0 None | qtip2.com | Licensed MIT, GPL | Thu Nov 21 2013 20:37:00 */
|
2
|
+
.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;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;border-color:transparent}.qtip-titlebar .qtip-close{right:4px;top:50%;margin-top:-9px}* html .qtip-titlebar .qtip-close{top:16px}.qtip-titlebar .ui-icon,.qtip-icon .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:transparent none no-repeat -100em -100em}.qtip-focus{}.qtip-hover{}.qtip-default{border-width:1px;border-style:solid;border-color:#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}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
/* qTip2 v2.2.0 None | qtip2.com | Licensed MIT, GPL | Thu Nov 21 2013 20:36:59 */
|
2
|
+
(function(t,e,i){(function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)})(function(s){"use strict";function n(t,e,i,n){this.id=i,this.target=t,this.tooltip=q,this.elements={target:t},this._id=O+"-"+i,this.timers={img:{}},this.options=e,this.plugins={},this.cache={event:{},target:s(),disabled:j,attr:n,onTooltip:j,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=j}function o(t){return t===q||"object"!==s.type(t)}function r(t){return!(s.isFunction(t)||t&&t.attr||t.length||"object"===s.type(t)&&(t.jquery||t.then))}function a(t){var e,i,n,a;return o(t)?j:(o(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,o(e)||e.jquery||e.done?e=t.content={text:i=r(e)?j:e}:i=e.text,"ajax"in e&&(n=e.ajax,a=n&&n.once!==j,delete e.ajax,e.text=function(t,e){var o=i||s(this).attr(e.options.content.attr)||"Loading...",r=s.ajax(s.extend({},n,{context:e})).then(n.success,q,n.error).then(function(t){return t&&a&&e.set("content.text",t),t},function(t,i,s){e.destroyed||0===t.status||e.set("content.text",i+": "+s)});return a?o:(e.set("content.text",o),r)}),"title"in e&&(o(e.title)||(e.button=e.title.button,e.title=e.title.text),r(e.title||j)&&(e.title=j))),"position"in t&&o(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&o(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===C?{ready:C}:{event:t.show}),"hide"in t&&o(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&o(t.style)&&(t.style={classes:t.style}),s.each(S,function(){this.sanitize&&this.sanitize(t)}),t)}function h(t,e){for(var i,s=0,n=t,o=e.split(".");n=n[o[s++]];)o.length>s&&(i=n);return[i||t,o.pop()]}function l(t,e){var i,s,n;for(i in this.checks)for(s in this.checks[i])(n=RegExp(s,"i").exec(t))&&(e.push(n),("builtin"===i||this.plugins[i])&&this.checks[i][s].apply(this.plugins[i]||this,e))}function d(t){return I.concat("").join(t?"-"+t+" ":" ")}function c(i){return i&&{type:i.type,pageX:i.pageX,pageY:i.pageY,target:i.target,relatedTarget:i.relatedTarget,scrollX:i.scrollX||t.pageXOffset||e.body.scrollLeft||e.documentElement.scrollLeft,scrollY:i.scrollY||t.pageYOffset||e.body.scrollTop||e.documentElement.scrollTop}||{}}function u(t,e){return e>0?setTimeout(s.proxy(t,this),e):(t.call(this),i)}function p(t){return this.tooltip.hasClass(H)?j:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=u.call(this,function(){this.toggle(C,t)},this.options.show.delay),i)}function f(t){if(this.tooltip.hasClass(H))return j;var e=s(t.relatedTarget),i=e.closest(Y)[0]===this.tooltip[0],n=e[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==e[0]&&"mouse"===this.options.position.target&&i||this.options.hide.fixed&&/mouse(out|leave|move)/.test(t.type)&&(i||n))try{t.preventDefault(),t.stopImmediatePropagation()}catch(o){}else this.timers.hide=u.call(this,function(){this.toggle(j,t)},this.options.hide.delay,this)}function g(t){return this.tooltip.hasClass(H)||!this.options.hide.inactive?j:(clearTimeout(this.timers.inactive),this.timers.inactive=u.call(this,function(){this.hide(t)},this.options.hide.inactive),i)}function m(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function v(t,i,n){s(e.body).delegate(t,(i.split?i:i.join(K+" "))+K,function(){var t=b.api[s.attr(this,X)];t&&!t.disabled&&n.apply(t,arguments)})}function y(t,i,o){var r,h,l,d,c,u=s(e.body),p=t[0]===e?u:t,f=t.metadata?t.metadata(o.metadata):q,g="html5"===o.metadata.type&&f?f[o.metadata.name]:q,m=t.data(o.metadata.name||"qtipopts");try{m="string"==typeof m?s.parseJSON(m):m}catch(v){}if(d=s.extend(C,{},b.defaults,o,"object"==typeof m?a(m):q,a(g||f)),h=d.position,d.id=i,"boolean"==typeof d.content.text){if(l=t.attr(d.content.attr),d.content.attr===j||!l)return j;d.content.text=l}if(h.container.length||(h.container=u),h.target===j&&(h.target=p),d.show.target===j&&(d.show.target=p),d.show.solo===C&&(d.show.solo=h.container.closest("body")),d.hide.target===j&&(d.hide.target=p),d.position.viewport===C&&(d.position.viewport=h.container),h.container=h.container.eq(0),h.at=new _(h.at,C),h.my=new _(h.my),t.data(O))if(d.overwrite)t.qtip("destroy",!0);else if(d.overwrite===j)return j;return t.attr(D,i),d.suppress&&(c=t.attr("title"))&&t.removeAttr("title").attr(R,c).attr("title",""),r=new n(t,d,i,!!l),t.data(O,r),t.one("remove.qtip-"+i+" removeqtip.qtip-"+i,function(){var t;(t=s(this).data(O))&&t.destroy(!0)}),r}var b,w,_,x,T,C=!0,j=!1,q=null,E="x",W="y",z="top",A="left",F="bottom",L="right",k="center",S={},O="qtip",D="data-hasqtip",X="data-qtip-id",I=["ui-widget","ui-tooltip"],Y="."+O,$="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),B=O+"-fixed",M=O+"-default",N=O+"-focus",P=O+"-hover",H=O+"-disabled",Q="_replacedByqTip",R="oldtitle",U={ie:function(){for(var t=3,i=e.createElement("div");(i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->")&&i.getElementsByTagName("i")[0];);return t>4?t: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("_",""))||j};w=n.prototype,w._when=function(t){return s.when.apply(s,t)},w.render=function(t){if(this.rendered||this.destroyed)return this;var e,i=this,n=this.options,o=this.cache,r=this.elements,a=n.content.text,h=n.content.title,l=n.content.button,d=n.position,c=("."+this._id+" ",[]);return s.attr(this.target[0],"aria-describedby",this._id),this.tooltip=r.tooltip=e=s("<div/>",{id:this._id,"class":[O,M,n.style.classes,O+"-pos-"+n.position.my.abbrev()].join(" "),width:n.style.width||"",height:n.style.height||"",tracking:"mouse"===d.target&&d.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":j,"aria-describedby":this._id+"-content","aria-hidden":C}).toggleClass(H,this.disabled).attr(X,this.id).data(O,this).appendTo(d.container).append(r.content=s("<div />",{"class":O+"-content",id:this._id+"-content","aria-atomic":C})),this.rendered=-1,this.positioning=C,h&&(this._createTitle(),s.isFunction(h)||c.push(this._updateTitle(h,j))),l&&this._createButton(),s.isFunction(a)||c.push(this._updateContent(a,j)),this.rendered=C,this._setWidget(),s.each(S,function(t){var e;"render"===this.initialize&&(e=this(i))&&(i.plugins[t]=e)}),this._unassignEvents(),this._assignEvents(),this._when(c).then(function(){i._trigger("render"),i.positioning=j,i.hiddenDuringWait||!n.show.ready&&!t||i.toggle(C,o.event,j),i.hiddenDuringWait=j}),b.api[this.id]=this,this},w.destroy=function(t){function e(){if(!this.destroyed){this.destroyed=C;var t=this.target,e=t.attr(R);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),s.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),t.removeData(O).removeAttr(X).removeAttr(D).removeAttr("aria-describedby"),this.options.suppress&&e&&t.attr("title",e).removeAttr(R),this._unbind(t),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=q,delete b.api[this.id]}}return this.destroyed?this.target:(t===C&&"hide"!==this.triggering||!this.rendered?e.call(this):(this.tooltip.one("tooltiphidden",s.proxy(e,this)),!this.triggering&&this.hide()),this.target)},x=w.checks={builtin:{"^id$":function(t,e,i,n){var o=i===C?b.nextid:i,r=O+"-"+o;o!==j&&o.length>0&&!s("#"+r).length?(this._id=r,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):t[e]=n},"^prerender":function(t,e,i){i&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(t,e,i){this._updateContent(i)},"^content.attr$":function(t,e,i,s){this.options.content.text===this.target.attr(s)&&this._updateContent(this.target.attr(i))},"^content.title$":function(t,e,s){return s?(s&&!this.elements.title&&this._createTitle(),this._updateTitle(s),i):this._removeTitle()},"^content.button$":function(t,e,i){this._updateButton(i)},"^content.title.(text|button)$":function(t,e,i){this.set("content."+e,i)},"^position.(my|at)$":function(t,e,i){"string"==typeof i&&(t[e]=new _(i,"at"===e))},"^position.container$":function(t,e,i){this.rendered&&this.tooltip.appendTo(i)},"^show.ready$":function(t,e,i){i&&(!this.rendered&&this.render(C)||this.toggle(C))},"^style.classes$":function(t,e,i,s){this.rendered&&this.tooltip.removeClass(s).addClass(i)},"^style.(width|height)":function(t,e,i){this.rendered&&this.tooltip.css(e,i)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(t,e,i){this.rendered&&this.tooltip.toggleClass(M,!!i)},"^events.(render|show|move|hide|focus|blur)$":function(t,e,i){this.rendered&&this.tooltip[(s.isFunction(i)?"":"un")+"bind"]("tooltip"+e,i)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var t=this.options.position;this.tooltip.attr("tracking","mouse"===t.target&&t.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},w.get=function(t){if(this.destroyed)return this;var e=h(this.options,t.toLowerCase()),i=e[0][e[1]];return i.precedance?i.string():i};var V=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,G=/^prerender|show\.ready/i;w.set=function(t,e){if(this.destroyed)return this;var n,o=this.rendered,r=j,d=this.options;return this.checks,"string"==typeof t?(n=t,t={},t[n]=e):t=s.extend({},t),s.each(t,function(e,n){if(o&&G.test(e))return delete t[e],i;var a,l=h(d,e.toLowerCase());a=l[0][l[1]],l[0][l[1]]=n&&n.nodeType?s(n):n,r=V.test(e)||r,t[e]=[l[0],l[1],n,a]}),a(d),this.positioning=C,s.each(t,s.proxy(l,this)),this.positioning=j,this.rendered&&this.tooltip[0].offsetWidth>0&&r&&this.reposition("mouse"===d.position.target?q:this.cache.event),this},w._update=function(t,e){var i=this,n=this.cache;return this.rendered&&t?(s.isFunction(t)&&(t=t.call(this.elements.target,n.event,this)||""),s.isFunction(t.then)?(n.waiting=C,t.then(function(t){return n.waiting=j,i._update(t,e)},q,function(t){return i._update(t,e)})):t===j||!t&&""!==t?j:(t.jquery&&t.length>0?e.empty().append(t.css({display:"block",visibility:"visible"})):e.html(t),this._waitForContent(e).then(function(t){t.images&&t.images.length&&i.rendered&&i.tooltip[0].offsetWidth>0&&i.reposition(n.event,!t.length)}))):j},w._waitForContent=function(t){var e=this.cache;return e.waiting=C,(s.fn.imagesLoaded?t.imagesLoaded():s.Deferred().resolve([])).done(function(){e.waiting=j}).promise()},w._updateContent=function(t,e){this._update(t,this.elements.content,e)},w._updateTitle=function(t,e){this._update(t,this.elements.title,e)===j&&this._removeTitle(j)},w._createTitle=function(){var t=this.elements,e=this._id+"-title";t.titlebar&&this._removeTitle(),t.titlebar=s("<div />",{"class":O+"-titlebar "+(this.options.style.widget?d("header"):"")}).append(t.title=s("<div />",{id:e,"class":O+"-title","aria-atomic":C})).insertBefore(t.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(t){s(this).toggleClass("ui-state-active ui-state-focus","down"===t.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(t){s(this).toggleClass("ui-state-hover","mouseover"===t.type)}),this.options.content.button&&this._createButton()},w._removeTitle=function(t){var e=this.elements;e.title&&(e.titlebar.remove(),e.titlebar=e.title=e.button=q,t!==j&&this.reposition())},w.reposition=function(i,n){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=C;var o,r,a=this.cache,h=this.tooltip,l=this.options.position,d=l.target,c=l.my,u=l.at,p=l.viewport,f=l.container,g=l.adjust,m=g.method.split(" "),v=h.outerWidth(j),y=h.outerHeight(j),b=0,w=0,_=h.css("position"),x={left:0,top:0},T=h[0].offsetWidth>0,q=i&&"scroll"===i.type,E=s(t),W=f[0].ownerDocument,O=this.mouse;if(s.isArray(d)&&2===d.length)u={x:A,y:z},x={left:d[0],top:d[1]};else if("mouse"===d)u={x:A,y:z},!O||!O.pageX||!g.mouse&&i&&i.pageX?i&&i.pageX||((!g.mouse||this.options.show.distance)&&a.origin&&a.origin.pageX?i=a.origin:(!i||i&&("resize"===i.type||"scroll"===i.type))&&(i=a.event)):i=O,"static"!==_&&(x=f.offset()),W.body.offsetWidth!==(t.innerWidth||W.documentElement.clientWidth)&&(r=s(e.body).offset()),x={left:i.pageX-x.left+(r&&r.left||0),top:i.pageY-x.top+(r&&r.top||0)},g.mouse&&q&&O&&(x.left-=(O.scrollX||0)-E.scrollLeft(),x.top-=(O.scrollY||0)-E.scrollTop());else{if("event"===d?i&&i.target&&"scroll"!==i.type&&"resize"!==i.type?a.target=s(i.target):i.target||(a.target=this.elements.target):"event"!==d&&(a.target=s(d.jquery?d:this.elements.target)),d=a.target,d=s(d).eq(0),0===d.length)return this;d[0]===e||d[0]===t?(b=U.iOS?t.innerWidth:d.width(),w=U.iOS?t.innerHeight:d.height(),d[0]===t&&(x={top:(p||d).scrollTop(),left:(p||d).scrollLeft()})):S.imagemap&&d.is("area")?o=S.imagemap(this,d,u,S.viewport?m:j):S.svg&&d&&d[0].ownerSVGElement?o=S.svg(this,d,u,S.viewport?m:j):(b=d.outerWidth(j),w=d.outerHeight(j),x=d.offset()),o&&(b=o.width,w=o.height,r=o.offset,x=o.position),x=this.reposition.offset(d,x,f),(U.iOS>3.1&&4.1>U.iOS||U.iOS>=4.3&&4.33>U.iOS||!U.iOS&&"fixed"===_)&&(x.left-=E.scrollLeft(),x.top-=E.scrollTop()),(!o||o&&o.adjustable!==j)&&(x.left+=u.x===L?b:u.x===k?b/2:0,x.top+=u.y===F?w:u.y===k?w/2:0)}return x.left+=g.x+(c.x===L?-v:c.x===k?-v/2:0),x.top+=g.y+(c.y===F?-y:c.y===k?-y/2:0),S.viewport?(x.adjusted=S.viewport(this,x,l,b,w,v,y),r&&x.adjusted.left&&(x.left+=r.left),r&&x.adjusted.top&&(x.top+=r.top)):x.adjusted={left:0,top:0},this._trigger("move",[x,p.elem||p],i)?(delete x.adjusted,n===j||!T||isNaN(x.left)||isNaN(x.top)||"mouse"===d||!s.isFunction(l.effect)?h.css(x):s.isFunction(l.effect)&&(l.effect.call(h,this,s.extend({},x)),h.queue(function(t){s(this).css({opacity:"",height:""}),U.ie&&this.style.removeAttribute("filter"),t()})),this.positioning=j,this):this},w.reposition.offset=function(t,i,n){function o(t,e){i.left+=e*t.scrollLeft(),i.top+=e*t.scrollTop()}if(!n[0])return i;var r,a,h,l,d=s(t[0].ownerDocument),c=!!U.ie&&"CSS1Compat"!==e.compatMode,u=n[0];do"static"!==(a=s.css(u,"position"))&&("fixed"===a?(h=u.getBoundingClientRect(),o(d,-1)):(h=s(u).position(),h.left+=parseFloat(s.css(u,"borderLeftWidth"))||0,h.top+=parseFloat(s.css(u,"borderTopWidth"))||0),i.left-=h.left+(parseFloat(s.css(u,"marginLeft"))||0),i.top-=h.top+(parseFloat(s.css(u,"marginTop"))||0),r||"hidden"===(l=s.css(u,"overflow"))||"visible"===l||(r=s(u)));while(u=u.offsetParent);return r&&(r[0]!==d[0]||c)&&o(r,1),i};var J=(_=w.reposition.Corner=function(t,e){t=(""+t).replace(/([A-Z])/," $1").replace(/middle/gi,k).toLowerCase(),this.x=(t.match(/left|right/i)||t.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(t.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!e;var i=t.charAt(0);this.precedance="t"===i||"b"===i?W:E}).prototype;J.invert=function(t,e){this[t]=this[t]===A?L:this[t]===L?A:e||this[t]},J.string=function(){var t=this.x,e=this.y;return t===e?t:this.precedance===W||this.forceY&&"center"!==e?e+" "+t:t+" "+e},J.abbrev=function(){var t=this.string().split(" ");return t[0].charAt(0)+(t[1]&&t[1].charAt(0)||"")},J.clone=function(){return new _(this.string(),this.forceY)},w.toggle=function(t,i){var n=this.cache,o=this.options,r=this.tooltip;if(i){if(/over|enter/.test(i.type)&&/out|leave/.test(n.event.type)&&o.show.target.add(i.target).length===o.show.target.length&&r.has(i.relatedTarget).length)return this;n.event=c(i)}if(this.waiting&&!t&&(this.hiddenDuringWait=C),!this.rendered)return t?this.render(1):this;if(this.destroyed||this.disabled)return this;var a,h,l,d=t?"show":"hide",u=this.options[d],p=(this.options[t?"hide":"show"],this.options.position),f=this.options.content,g=this.tooltip.css("width"),m=this.tooltip.is(":visible"),v=t||1===u.target.length,y=!i||2>u.target.length||n.target[0]===i.target;return(typeof t).search("boolean|number")&&(t=!m),a=!r.is(":animated")&&m===t&&y,h=a?q:!!this._trigger(d,[90]),this.destroyed?this:(h!==j&&t&&this.focus(i),!h||a?this:(s.attr(r[0],"aria-hidden",!t),t?(n.origin=c(this.mouse),s.isFunction(f.text)&&this._updateContent(f.text,j),s.isFunction(f.title)&&this._updateTitle(f.title,j),!T&&"mouse"===p.target&&p.adjust.mouse&&(s(e).bind("mousemove."+O,this._storeMouse),T=C),g||r.css("width",r.outerWidth(j)),this.reposition(i,arguments[2]),g||r.css("width",""),u.solo&&("string"==typeof u.solo?s(u.solo):s(Y,u.solo)).not(r).not(u.target).qtip("hide",s.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete n.origin,T&&!s(Y+'[tracking="true"]:visible',u.solo).not(r).length&&(s(e).unbind("mousemove."+O),T=j),this.blur(i)),l=s.proxy(function(){t?(U.ie&&r[0].style.removeAttribute("filter"),r.css("overflow",""),"string"==typeof u.autofocus&&s(this.options.show.autofocus,r).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):r.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(t?"visible":"hidden")},this),u.effect===j||v===j?(r[d](),l()):s.isFunction(u.effect)?(r.stop(1,1),u.effect.call(r,this),r.queue("fx",function(t){l(),t()})):r.fadeTo(90,t?1:0,l),t&&u.target.trigger("qtip-"+this.id+"-inactive"),this))},w.show=function(t){return this.toggle(C,t)},w.hide=function(t){return this.toggle(j,t)},w.focus=function(t){if(!this.rendered||this.destroyed)return this;var e=s(Y),i=this.tooltip,n=parseInt(i[0].style.zIndex,10),o=b.zindex+e.length;return i.hasClass(N)||this._trigger("focus",[o],t)&&(n!==o&&(e.each(function(){this.style.zIndex>n&&(this.style.zIndex=this.style.zIndex-1)}),e.filter("."+N).qtip("blur",t)),i.addClass(N)[0].style.zIndex=o),this},w.blur=function(t){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(N),this._trigger("blur",[this.tooltip.css("zIndex")],t),this)},w.disable=function(t){return this.destroyed?this:("toggle"===t?t=!(this.rendered?this.tooltip.hasClass(H):this.disabled):"boolean"!=typeof t&&(t=C),this.rendered&&this.tooltip.toggleClass(H,t).attr("aria-disabled",t),this.disabled=!!t,this)},w.enable=function(){return this.disable(j)},w._createButton=function(){var t=this,e=this.elements,i=e.tooltip,n=this.options.content.button,o="string"==typeof n,r=o?n:"Close tooltip";e.button&&e.button.remove(),e.button=n.jquery?n:s("<a />",{"class":"qtip-close "+(this.options.style.widget?"":O+"-icon"),title:r,"aria-label":r}).prepend(s("<span />",{"class":"ui-icon ui-icon-close",html:"×"})),e.button.appendTo(e.titlebar||i).attr("role","button").click(function(e){return i.hasClass(H)||t.hide(e),j})},w._updateButton=function(t){if(!this.rendered)return j;var e=this.elements.button;t?this._createButton():e.remove()},w._setWidget=function(){var t=this.options.style.widget,e=this.elements,i=e.tooltip,s=i.hasClass(H);i.removeClass(H),H=t?"ui-state-disabled":"qtip-disabled",i.toggleClass(H,s),i.toggleClass("ui-helper-reset "+d(),t).toggleClass(M,this.options.style.def&&!t),e.content&&e.content.toggleClass(d("content"),t),e.titlebar&&e.titlebar.toggleClass(d("header"),t),e.button&&e.button.toggleClass(O+"-icon",!t)},w._storeMouse=function(t){(this.mouse=c(t)).type="mousemove"},w._bind=function(t,e,i,n,o){var r="."+this._id+(n?"-"+n:"");e.length&&s(t).bind((e.split?e:e.join(r+" "))+r,s.proxy(i,o||this))},w._unbind=function(t,e){s(t).unbind("."+this._id+(e?"-"+e:""))};var K="."+O;s(function(){v(Y,["mouseenter","mouseleave"],function(t){var e="mouseenter"===t.type,i=s(t.currentTarget),n=s(t.relatedTarget||t.target),o=this.options;e?(this.focus(t),i.hasClass(B)&&!i.hasClass(H)&&clearTimeout(this.timers.hide)):"mouse"===o.position.target&&o.hide.event&&o.show.target&&!n.closest(o.show.target[0]).length&&this.hide(t),i.toggleClass(P,e)}),v("["+X+"]",$,g)}),w._trigger=function(t,e,i){var n=s.Event("tooltip"+t);return n.originalEvent=i&&s.extend({},i)||this.cache.event||q,this.triggering=t,this.tooltip.trigger(n,[this].concat(e||[])),this.triggering=j,!n.isDefaultPrevented()},w._bindEvents=function(t,e,n,o,r,a){if(o.add(n).length===o.length){var h=[];e=s.map(e,function(e){var n=s.inArray(e,t);return n>-1?(h.push(t.splice(n,1)[0]),i):e}),h.length&&this._bind(n,h,function(t){var e=this.rendered?this.tooltip[0].offsetWidth>0:!1;(e?a:r).call(this,t)})}this._bind(n,t,r),this._bind(o,e,a)},w._assignInitialEvents=function(t){function e(t){return this.disabled||this.destroyed?j:(this.cache.event=c(t),this.cache.target=t?s(t.target):[i],clearTimeout(this.timers.show),this.timers.show=u.call(this,function(){this.render("object"==typeof t||n.show.ready)},n.show.delay),i)}var n=this.options,o=n.show.target,r=n.hide.target,a=n.show.event?s.trim(""+n.show.event).split(" "):[],h=n.hide.event?s.trim(""+n.hide.event).split(" "):[];/mouse(over|enter)/i.test(n.show.event)&&!/mouse(out|leave)/i.test(n.hide.event)&&h.push("mouseleave"),this._bind(o,"mousemove",function(t){this._storeMouse(t),this.cache.onTarget=C}),this._bindEvents(a,h,o,r,e,function(){clearTimeout(this.timers.show)}),(n.show.ready||n.prerender)&&e.call(this,t)},w._assignEvents=function(){var i=this,n=this.options,o=n.position,r=this.tooltip,a=n.show.target,h=n.hide.target,l=o.container,d=o.viewport,c=s(e),u=(s(e.body),s(t)),v=n.show.event?s.trim(""+n.show.event).split(" "):[],y=n.hide.event?s.trim(""+n.hide.event).split(" "):[];s.each(n.events,function(t,e){i._bind(r,"toggle"===t?["tooltipshow","tooltiphide"]:["tooltip"+t],e,null,r)}),/mouse(out|leave)/i.test(n.hide.event)&&"window"===n.hide.leave&&this._bind(c,["mouseout","blur"],function(t){/select|option/.test(t.target.nodeName)||t.relatedTarget||this.hide(t)}),n.hide.fixed?h=h.add(r.addClass(B)):/mouse(over|enter)/i.test(n.show.event)&&this._bind(h,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+n.hide.event).indexOf("unfocus")>-1&&this._bind(l.closest("html"),["mousedown","touchstart"],function(t){var e=s(t.target),i=this.rendered&&!this.tooltip.hasClass(H)&&this.tooltip[0].offsetWidth>0,n=e.parents(Y).filter(this.tooltip[0]).length>0;e[0]===this.target[0]||e[0]===this.tooltip[0]||n||this.target.has(e[0]).length||!i||this.hide(t)}),"number"==typeof n.hide.inactive&&(this._bind(a,"qtip-"+this.id+"-inactive",g),this._bind(h.add(r),b.inactiveEvents,g,"-inactive")),this._bindEvents(v,y,a,h,p,f),this._bind(a.add(r),"mousemove",function(t){if("number"==typeof n.hide.distance){var e=this.cache.origin||{},i=this.options.hide.distance,s=Math.abs;(s(t.pageX-e.pageX)>=i||s(t.pageY-e.pageY)>=i)&&this.hide(t)}this._storeMouse(t)}),"mouse"===o.target&&o.adjust.mouse&&(n.hide.event&&this._bind(a,["mouseenter","mouseleave"],function(t){this.cache.onTarget="mouseenter"===t.type}),this._bind(c,"mousemove",function(t){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(H)&&this.tooltip[0].offsetWidth>0&&this.reposition(t)})),(o.adjust.resize||d.length)&&this._bind(s.event.special.resize?d:u,"resize",m),o.adjust.scroll&&this._bind(u.add(o.container),"scroll",m)},w._unassignEvents=function(){var i=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],t,e];this._unbind(s([]).pushStack(s.grep(i,function(t){return"object"==typeof t})))},b=s.fn.qtip=function(t,e,n){var o=(""+t).toLowerCase(),r=q,h=s.makeArray(arguments).slice(1),l=h[h.length-1],d=this[0]?s.data(this[0],O):q;return!arguments.length&&d||"api"===o?d:"string"==typeof t?(this.each(function(){var t=s.data(this,O);if(!t)return C;if(l&&l.timeStamp&&(t.cache.event=l),!e||"option"!==o&&"options"!==o)t[o]&&t[o].apply(t,h);else{if(n===i&&!s.isPlainObject(e))return r=t.get(e),j;t.set(e,n)}}),r!==q?r:this):"object"!=typeof t&&arguments.length?i:(d=a(s.extend(C,{},t)),this.each(function(t){var e,n;return n=s.isArray(d.id)?d.id[t]:d.id,n=!n||n===j||1>n.length||b.api[n]?b.nextid++:n,e=y(s(this),n,d),e===j?C:(b.api[n]=e,s.each(S,function(){"initialize"===this.initialize&&this(e)}),e._assignInitialEvents(l),i)}))},s.qtip=n,b.api={},s.each({attr:function(t,e){if(this.length){var i=this[0],n="title",o=s.data(i,"qtip");if(t===n&&o&&"object"==typeof o&&o.options.suppress)return 2>arguments.length?s.attr(i,R):(o&&o.options.content.attr===n&&o.cache.attr&&o.set("content.text",e),this.attr(R,e))}return s.fn["attr"+Q].apply(this,arguments)},clone:function(t){var e=(s([]),s.fn["clone"+Q].apply(this,arguments));return t||e.filter("["+R+"]").attr("title",function(){return s.attr(this,R)}).removeAttr(R),e}},function(t,e){if(!e||s.fn[t+Q])return C;var i=s.fn[t+Q]=s.fn[t];s.fn[t]=function(){return e.apply(this,arguments)||i.apply(this,arguments)}}),s.ui||(s["cleanData"+Q]=s.cleanData,s.cleanData=function(t){for(var e,i=0;(e=s(t[i])).length;i++)if(e.attr(D))try{e.triggerHandler("removeqtip")}catch(n){}s["cleanData"+Q].apply(this,arguments)}),b.version="2.2.0",b.nextid=0,b.inactiveEvents=$,b.zindex=15e3,b.defaults={prerender:j,id:j,overwrite:C,suppress:C,content:{text:C,attr:"title",title:j,button:j},position:{my:"top left",at:"bottom right",target:j,container:j,viewport:j,adjust:{x:0,y:0,mouse:C,scroll:C,resize:C,method:"flipinvert flipinvert"},effect:function(t,e){s(this).animate(e,{duration:200,queue:j})}},show:{target:j,event:"mouseenter",effect:C,delay:90,solo:j,ready:j,autofocus:j},hide:{target:j,event:"mouseleave",effect:C,delay:0,fixed:j,inactive:j,leave:"window",distance:j},style:{classes:"",widget:j,width:j,height:j,def:C},events:{render:q,move:q,show:q,hide:q,toggle:q,visible:q,hidden:q,focus:q,blur:q}}})})(window,document);
|
3
|
+
//@ sourceMappingURL=http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0/jquery.qtip.min.map
|
@@ -0,0 +1,288 @@
|
|
1
|
+
// tipsy, facebook style tooltips for jquery
|
2
|
+
// version 1.0.0a
|
3
|
+
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
|
4
|
+
// released under the MIT license
|
5
|
+
|
6
|
+
(function($) {
|
7
|
+
|
8
|
+
function maybeCall(thing, ctx) {
|
9
|
+
return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
|
10
|
+
}
|
11
|
+
|
12
|
+
function Tipsy(element, options) {
|
13
|
+
this.$element = $(element);
|
14
|
+
this.options = options;
|
15
|
+
this.enabled = true;
|
16
|
+
this.fixTitle();
|
17
|
+
}
|
18
|
+
|
19
|
+
Tipsy.prototype = {
|
20
|
+
show: function() {
|
21
|
+
var title = this.getTitle();
|
22
|
+
if (title && this.enabled) {
|
23
|
+
var $tip = this.tip();
|
24
|
+
|
25
|
+
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
|
26
|
+
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
|
27
|
+
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
|
28
|
+
|
29
|
+
var pos = $.extend({}, this.$element.offset(), {
|
30
|
+
width: this.$element[0].offsetWidth || 0,
|
31
|
+
height: this.$element[0].offsetHeight || 0
|
32
|
+
});
|
33
|
+
|
34
|
+
if (typeof this.$element[0].nearestViewportElement == 'object') {
|
35
|
+
// SVG
|
36
|
+
var el = this.$element[0];
|
37
|
+
var rect = el.getBoundingClientRect();
|
38
|
+
pos.width = rect.width;
|
39
|
+
pos.height = rect.height;
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
var actualWidth = $tip[0].offsetWidth,
|
44
|
+
actualHeight = $tip[0].offsetHeight,
|
45
|
+
gravity = maybeCall(this.options.gravity, this.$element[0]);
|
46
|
+
|
47
|
+
var tp;
|
48
|
+
switch (gravity.charAt(0)) {
|
49
|
+
case 'n':
|
50
|
+
tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
51
|
+
break;
|
52
|
+
case 's':
|
53
|
+
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
54
|
+
break;
|
55
|
+
case 'e':
|
56
|
+
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
|
57
|
+
break;
|
58
|
+
case 'w':
|
59
|
+
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
|
60
|
+
break;
|
61
|
+
}
|
62
|
+
|
63
|
+
if (gravity.length == 2) {
|
64
|
+
if (gravity.charAt(1) == 'w') {
|
65
|
+
tp.left = pos.left + pos.width / 2 - 15;
|
66
|
+
} else {
|
67
|
+
tp.left = pos.left + pos.width / 2 - actualWidth + 15;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
$tip.css(tp).addClass('tipsy-' + gravity);
|
72
|
+
$tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
|
73
|
+
if (this.options.className) {
|
74
|
+
$tip.addClass(maybeCall(this.options.className, this.$element[0]));
|
75
|
+
}
|
76
|
+
|
77
|
+
if (this.options.fade) {
|
78
|
+
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
|
79
|
+
} else {
|
80
|
+
$tip.css({visibility: 'visible', opacity: this.options.opacity});
|
81
|
+
}
|
82
|
+
|
83
|
+
var t = this;
|
84
|
+
var set_hovered = function(set_hover){
|
85
|
+
return function(){
|
86
|
+
t.$tip.stop();
|
87
|
+
t.tipHovered = set_hover;
|
88
|
+
if (!set_hover){
|
89
|
+
if (t.options.delayOut === 0) {
|
90
|
+
t.hide();
|
91
|
+
} else {
|
92
|
+
setTimeout(function() {
|
93
|
+
if (t.hoverState == 'out') t.hide(); }, t.options.delayOut);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
};
|
97
|
+
};
|
98
|
+
$tip.hover(set_hovered(true), set_hovered(false));
|
99
|
+
}
|
100
|
+
},
|
101
|
+
|
102
|
+
hide: function() {
|
103
|
+
if (this.options.fade) {
|
104
|
+
this.tip().stop().fadeOut(function() { $(this).remove(); });
|
105
|
+
} else {
|
106
|
+
this.tip().remove();
|
107
|
+
}
|
108
|
+
},
|
109
|
+
|
110
|
+
fixTitle: function() {
|
111
|
+
var $e = this.$element;
|
112
|
+
|
113
|
+
if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
|
114
|
+
$e.attr('original-title', $e.attr('title') || '').removeAttr('title');
|
115
|
+
}
|
116
|
+
if (typeof $e.context.nearestViewportElement == 'object'){
|
117
|
+
if ($e.children('title').length){
|
118
|
+
$e.append('<original-title>' + ($e.children('title').text() || '') + '</original-title>')
|
119
|
+
.children('title').remove();
|
120
|
+
}
|
121
|
+
}
|
122
|
+
},
|
123
|
+
|
124
|
+
getTitle: function() {
|
125
|
+
|
126
|
+
var title, $e = this.$element, o = this.options;
|
127
|
+
this.fixTitle();
|
128
|
+
|
129
|
+
if (typeof o.title == 'string') {
|
130
|
+
var title_name = o.title == 'title' ? 'original-title' : o.title;
|
131
|
+
if ($e.children(title_name).length){
|
132
|
+
title = $e.children(title_name).html();
|
133
|
+
} else{
|
134
|
+
title = $e.attr(title_name);
|
135
|
+
}
|
136
|
+
|
137
|
+
} else if (typeof o.title == 'function') {
|
138
|
+
title = o.title.call($e[0]);
|
139
|
+
}
|
140
|
+
title = ('' + title).replace(/(^\s*|\s*$)/, "");
|
141
|
+
return title || o.fallback;
|
142
|
+
},
|
143
|
+
|
144
|
+
tip: function() {
|
145
|
+
if (!this.$tip) {
|
146
|
+
this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
|
147
|
+
}
|
148
|
+
return this.$tip;
|
149
|
+
},
|
150
|
+
|
151
|
+
validate: function() {
|
152
|
+
if (!this.$element[0].parentNode) {
|
153
|
+
this.hide();
|
154
|
+
this.$element = null;
|
155
|
+
this.options = null;
|
156
|
+
}
|
157
|
+
},
|
158
|
+
|
159
|
+
enable: function() { this.enabled = true; },
|
160
|
+
disable: function() { this.enabled = false; },
|
161
|
+
toggleEnabled: function() { this.enabled = !this.enabled; }
|
162
|
+
};
|
163
|
+
|
164
|
+
$.fn.tipsy = function(options) {
|
165
|
+
|
166
|
+
if (options === true) {
|
167
|
+
return this.data('tipsy');
|
168
|
+
} else if (typeof options == 'string') {
|
169
|
+
var tipsy = this.data('tipsy');
|
170
|
+
if (tipsy) tipsy[options]();
|
171
|
+
return this;
|
172
|
+
}
|
173
|
+
|
174
|
+
options = $.extend({}, $.fn.tipsy.defaults, options);
|
175
|
+
|
176
|
+
if (options.hoverlock && options.delayOut === 0) {
|
177
|
+
options.delayOut = 100;
|
178
|
+
}
|
179
|
+
|
180
|
+
function get(ele) {
|
181
|
+
var tipsy = $.data(ele, 'tipsy');
|
182
|
+
if (!tipsy) {
|
183
|
+
tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
|
184
|
+
$.data(ele, 'tipsy', tipsy);
|
185
|
+
}
|
186
|
+
return tipsy;
|
187
|
+
}
|
188
|
+
|
189
|
+
function enter() {
|
190
|
+
var tipsy = get(this);
|
191
|
+
tipsy.hoverState = 'in';
|
192
|
+
if (options.delayIn === 0) {
|
193
|
+
tipsy.show();
|
194
|
+
} else {
|
195
|
+
tipsy.fixTitle();
|
196
|
+
setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
function leave() {
|
201
|
+
var tipsy = get(this);
|
202
|
+
tipsy.hoverState = 'out';
|
203
|
+
if (options.delayOut === 0) {
|
204
|
+
tipsy.hide();
|
205
|
+
} else {
|
206
|
+
var to = function() {
|
207
|
+
if (!tipsy.tipHovered || !options.hoverlock){
|
208
|
+
if (tipsy.hoverState == 'out') tipsy.hide();
|
209
|
+
}
|
210
|
+
};
|
211
|
+
setTimeout(to, options.delayOut);
|
212
|
+
}
|
213
|
+
}
|
214
|
+
|
215
|
+
if (options.trigger != 'manual') {
|
216
|
+
var binder = options.live ? 'live' : 'bind',
|
217
|
+
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
218
|
+
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
219
|
+
this[binder](eventIn, enter)[binder](eventOut, leave);
|
220
|
+
}
|
221
|
+
|
222
|
+
return this;
|
223
|
+
|
224
|
+
};
|
225
|
+
|
226
|
+
$.fn.tipsy.defaults = {
|
227
|
+
className: null,
|
228
|
+
delayIn: 0,
|
229
|
+
delayOut: 0,
|
230
|
+
fade: false,
|
231
|
+
fallback: '',
|
232
|
+
gravity: 'n',
|
233
|
+
html: false,
|
234
|
+
live: false,
|
235
|
+
offset: 0,
|
236
|
+
opacity: 0.8,
|
237
|
+
title: 'title',
|
238
|
+
trigger: 'hover',
|
239
|
+
hoverlock: false
|
240
|
+
};
|
241
|
+
|
242
|
+
// Overwrite this method to provide options on a per-element basis.
|
243
|
+
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
|
244
|
+
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
|
245
|
+
// (remember - do not modify 'options' in place!)
|
246
|
+
$.fn.tipsy.elementOptions = function(ele, options) {
|
247
|
+
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
|
248
|
+
};
|
249
|
+
|
250
|
+
$.fn.tipsy.autoNS = function() {
|
251
|
+
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
|
252
|
+
};
|
253
|
+
|
254
|
+
$.fn.tipsy.autoWE = function() {
|
255
|
+
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
|
256
|
+
};
|
257
|
+
|
258
|
+
/**
|
259
|
+
* yields a closure of the supplied parameters, producing a function that takes
|
260
|
+
* no arguments and is suitable for use as an autogravity function like so:
|
261
|
+
*
|
262
|
+
* @param margin (int) - distance from the viewable region edge that an
|
263
|
+
* element should be before setting its tooltip's gravity to be away
|
264
|
+
* from that edge.
|
265
|
+
* @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
|
266
|
+
* if there are no viewable region edges effecting the tooltip's
|
267
|
+
* gravity. It will try to vary from this minimally, for example,
|
268
|
+
* if 'sw' is preferred and an element is near the right viewable
|
269
|
+
* region edge, but not the top edge, it will set the gravity for
|
270
|
+
* that element's tooltip to be 'se', preserving the southern
|
271
|
+
* component.
|
272
|
+
*/
|
273
|
+
$.fn.tipsy.autoBounds = function(margin, prefer) {
|
274
|
+
return function() {
|
275
|
+
var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
|
276
|
+
boundTop = $(document).scrollTop() + margin,
|
277
|
+
boundLeft = $(document).scrollLeft() + margin,
|
278
|
+
$this = $(this);
|
279
|
+
|
280
|
+
if ($this.offset().top < boundTop) dir.ns = 'n';
|
281
|
+
if ($this.offset().left < boundLeft) dir.ew = 'w';
|
282
|
+
if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
|
283
|
+
if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
|
284
|
+
|
285
|
+
return dir.ns + (dir.ew ? dir.ew : '');
|
286
|
+
};
|
287
|
+
};
|
288
|
+
})(jQuery);
|