iflrandevu/assets/ext/jquery-qtip/jquery.qtip.min.js

8 lines
42 KiB
JavaScript
Raw Normal View History

/* qTip2 v2.0.1-70- tips modal viewport svg imagemap ie6 | qtip2.com | Licensed MIT, GPL | Mon Apr 15 2013 22:46:59 */
(function(t,e,o){(function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.qtip&&t(jQuery)})(function(s){function n(t,e,i,o){this.id=i,this.target=t,this.tooltip=L,this.elements=elements={target:t},this._id=$+"-"+i,this.timers={img:{}},this.options=e,this.plugins={},this.cache=cache={event:{},target:s(),disabled:I,attr:o,onTarget:I,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=I}function r(t){return t===L||!s.isPlainObject(t)}function a(t){return!s.isFunction(t)&&(!t&&!t.attr||1>t.length||"object"==typeof t&&!t.jquery&&!t.then)}function l(t){var e,i,o,n;return r(t)?I:(r(t.metadata)&&(t.metadata={type:t.metadata}),"content"in t&&(e=t.content,(r(e)||e.jquery||e.done)&&(e=t.content={text:i=a(e)?I:e}),"ajax"in e&&(o=e.ajax,n=o&&o.once!==I,e.ajax=null,e.text=function(t,e){var r=s.ajax(s.extend({},o,{context:e})).then(function(t){return n&&e.set("content.text",t),t},function(t,i,o){e.destroyed||0===t.status||e.set("content.text",i+": "+o)});return n?i||s(this).attr(e.options.content.attr)||"Loading...":r}),"title"in e&&(r(e.title)||(e.button=e.title.button,e.title=e.title.text),a(e.title||I)&&(e.title=I))),"position"in t&&r(t.position)&&(t.position={my:t.position,at:t.position}),"show"in t&&r(t.show)&&(t.show=t.show.jquery?{target:t.show}:t.show===k?{ready:k}:{event:t.show}),"hide"in t&&r(t.hide)&&(t.hide=t.hide.jquery?{target:t.hide}:{event:t.hide}),"style"in t&&r(t.style)&&(t.style={classes:t.style}),s.each(j,function(){this.sanitize&&this.sanitize(t)}),t)}function h(t,e){for(var i,o=0,s=t,n=e.split(".");s=s[n[o++]];)n.length>o&&(i=s);return[i||t,n.pop()]}function c(t,e){var i,o,s;for(i in this.checks)for(o in this.checks[i])(s=RegExp(o,"i").exec(t))&&(e.push(s),("builtin"===i||this.plugins[i])&&this.checks[i][o].apply(this.plugins[i]||this,e))}function d(t){return Y.concat("").join(t?"-"+t+" ":" ")}function p(t){if(this.tooltip.hasClass(J))return I;clearTimeout(this.timers.show),clearTimeout(this.timers.hide);var e=s.proxy(function(){this.toggle(k,t)},this);this.options.show.delay>0?this.timers.show=setTimeout(e,this.options.show.delay):e()}function u(t){if(this.tooltip.hasClass(J))return I;var e=s(t.relatedTarget),i=e.closest(G)[0]===this.tooltip[0],o=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||o))try{t.preventDefault(),t.stopImmediatePropagation()}catch(n){}else{var r=s.proxy(function(){this.toggle(I,t)},this);this.options.hide.delay>0?this.timers.hide=setTimeout(r,this.options.hide.delay):r()}}function f(t){return this.tooltip.hasClass(J)?I:(clearTimeout(this.timers.inactive),this.timers.inactive=setTimeout(s.proxy(function(){this.hide(t)},this),this.options.hide.inactive),o)}function g(t){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(t)}function m(t,i,o){var r,a,h,c,d,p=s(e.body),u=t[0]===e?p:t,f=t.metadata?t.metadata(o.metadata):L,g="html5"===o.metadata.type&&f?f[o.metadata.name]:L,m=t.data(o.metadata.name||"qtipopts");try{m="string"==typeof m?s.parseJSON(m):m}catch(v){}if(c=s.extend(k,{},T.defaults,o,"object"==typeof m?l(m):L,l(g||f)),a=c.position,c.id=i,"boolean"==typeof c.content.text){if(h=t.attr(c.content.attr),c.content.attr===I||!h)return I;c.content.text=h}if(a.container.length||(a.container=p),a.target===I&&(a.target=u),c.show.target===I&&(c.show.target=u),c.show.solo===k&&(c.show.solo=a.container.closest("body")),c.hide.target===I&&(c.hide.target=u),c.position.viewport===k&&(c.position.viewport=a.container),a.container=a.container.eq(0),a.at=new j.Corner(a.at,k),a.my=new j.Corner(a.my),t.data($))if(c.overwrite)t.qtip("destroy");else if(c.overwrite===I)return I;return t.attr(B,!0),c.suppress&&(d=t.attr("title"))&&t.removeAttr("title").attr(Z,d).attr("title",""),r=new n(t,c,i,!!h),t.data($,r),t.one("remove.qtip-"+i+" removeqtip.qtip-"+i,function(){var t;(t=s(this).data($))&&t.destroy()}),r}function v(t){return t
if(t===o&&n&&"object"==typeof n&&n.options.suppress)return 2>arguments.length?s.attr(i,Z):(n&&n.options.content.attr===o&&n.cache.attr&&n.set("content.text",e),this.attr(Z,e))}return s.fn["attr"+K].apply(this,arguments)},clone:function(t){var e=(s([]),s.fn["clone"+K].apply(this,arguments));return t||e.filter("["+Z+"]").attr("title",function(){return s.attr(this,Z)}).removeAttr(Z),e}},function(t,e){if(!e||s.fn[t+K])return k;var i=s.fn[t+K]=s.fn[t];s.fn[t]=function(){return e.apply(this,arguments)||i.apply(this,arguments)}}),s.ui||(s["cleanData"+K]=s.cleanData,s.cleanData=function(t){for(var e,i=0;(e=s(t[i])).length&&e.attr(B);i++)try{e.triggerHandler("removeqtip")}catch(o){}s["cleanData"+K](t)}),T.version="2.0.1-70-",T.nextid=0,T.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),T.zindex=15e3,T.defaults={prerender:I,id:I,overwrite:k,suppress:k,content:{text:k,attr:"title",title:I,button:I},position:{my:"top left",at:"bottom right",target:I,container:I,viewport:I,adjust:{x:0,y:0,mouse:k,scroll:k,resize:k,method:"flipinvert flipinvert"},effect:function(t,e){s(this).animate(e,{duration:200,queue:I})}},show:{target:I,event:"mouseenter",effect:k,delay:90,solo:I,ready:I,autofocus:I},hide:{target:I,event:"mouseleave",effect:k,delay:0,fixed:I,inactive:I,leave:"window",distance:I},style:{classes:"",widget:I,width:I,height:I,def:k},events:{render:L,move:L,show:L,hide:L,toggle:L,visible:L,hidden:L,focus:L,blur:L}};var ie,oe,se=".qtip-tip",ne="margin",re="border",ae="color",le="background-color",he="transparent",ce=" !important",de=!!e.createElement("canvas").getContext,pe=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i;if(s.curCSS){var ue={},fe=["Webkit","O","Moz","ms"];oe=function(t,e){var i,s,n,r=e.charAt(0).toUpperCase()+e.slice(1),a=(e+" "+fe.join(r+" ")+r).split(" ");if(ue[e])return t.css(ue[e]);for(n in a)if(i=a[n],(s=t.css(i))!==o)return ue[e]=i,s}}else oe=function(t,e){return t.css(e)};de||(createVML=function(t,e,i){return"<qvml:"+t+' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" '+(e||"")+' style="behavior: url(#default#VML); '+(i||"")+'" />'}),ie=j.tip=function(t){return new x(t)},ie.initialize="render",ie.sanitize=function(t){var e,i=t.style;i&&"tip"in i&&(e=t.style.tip,"object"!=typeof e&&(t.style.tip={corner:e}),/string|boolean/i.test(typeof e.corner)||(e.corner=k),"number"!=typeof e.width&&delete e.width,"number"!=typeof e.height&&delete e.height,"number"!=typeof e.border&&e.border!==k&&delete e.border,"number"!=typeof e.offset&&delete e.offset)},M.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){!this.init()&&this.destroy(),this.qtip.reposition()},"^style.tip.(height|width)$":function(t){this.size=size=[t.width,t.height],this.create(),this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){var t=this.qtip.elements.tip;t&&t.length&&this.update()}},s.extend(k,T.defaults,{style:{tip:{corner:k,mimic:I,width:6,height:6,border:k,offset:0}}});var ge,me,ve="qtip-modal",ye="."+ve;me=function(){function i(t){if(s.expr[":"].focusable)return s.expr[":"].focusable;var e,i,o,n=!isNaN(s.attr(t,"tabindex")),r=t.nodeName&&t.nodeName.toLowerCase();return"area"===r?(e=t.parentNode,i=e.name,t.href&&i&&"map"===e.nodeName.toLowerCase()?(o=s("img[usemap=#"+i+"]")[0],!!o&&o.is(":visible")):!1):/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||n:n}function o(t){1>d.length&&t.length?t.not("body").blur():d.first().focus()}function n(t){if(h.is(":visible")){var e,i=s(t.target),n=r.tooltip,l=i.closest(G);e=1>l.length?I:parseInt(l[0].style.zIndex,10)>parseInt(n[0].style.zIndex,10),e||i.closest(G)[0]===n[0]||o(i),a=t.target===d[d.length-1]}}var r,a,l,h,c=this,d={};s.extend(c,{init:function(){function i(){var t=s(this);h.css({height:t.height(),width:t.width()})}return h=c.elem=s("<div />",{id:"qtip-overlay",html:"<div></div>",mousedown:function(){return I}}).hide(),s(t).bind("resize"+ye,i),i(),s(e.body).bind("focusin"+ye,n),s(e).bind("keydown"+ye,function(t){r&&r.options.show.modal.escape&&27===t.keyCode&&r.hide(t)}),h.bind("cl
(function(c,q){var m="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";c.fn.imagesLoaded=function(f){function n(){var b=c(j),a=c(h);d&&(h.length?d.reject(e,b,a):d.resolve(e));c.isFunction(f)&&f.call(g,e,b,a)}function p(b){k(b.target,"error"===b.type)}function k(b,a){b.src===m||-1!==c.inArray(b,l)||(l.push(b),a?h.push(b):j.push(b),c.data(b,"imagesLoaded",{isBroken:a,src:b.src}),r&&d.notifyWith(c(b),[a,e,c(j),c(h)]),e.length===l.length&&(setTimeout(n),e.unbind(".imagesLoaded",
p)))}var g=this,d=c.isFunction(c.Deferred)?c.Deferred():0,r=c.isFunction(d.notify),e=g.find("img").add(g.filter("img")),l=[],j=[],h=[];c.isPlainObject(f)&&c.each(f,function(b,a){if("callback"===b)f=a;else if(d)d[b](a)});e.length?e.bind("load.imagesLoaded error.imagesLoaded",p).each(function(b,a){var d=a.src,e=c.data(a,"imagesLoaded");if(e&&e.src===d)k(a,e.isBroken);else if(a.complete&&a.naturalWidth!==q)k(a,0===a.naturalWidth||0===a.naturalHeight);else if(a.readyState||a.complete)a.src=m,a.src=d}):
n();return d?d.promise(g):g}})(jQuery);