diff --git a/dist/jquery.qtip.basic.js b/dist/jquery.qtip.basic.js index ef9a557f..83b8a44a 100644 --- a/dist/jquery.qtip.basic.js +++ b/dist/jquery.qtip.basic.js @@ -9,7 +9,7 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Mon Apr 11 17:44:04 2011 +0100 +* Date: Mon Apr 11 19:54:32 2011 +0100 */ "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ @@ -87,11 +87,10 @@ function sanitizeOptions(opts) }; } - if('object' !== typeof opts.position.adjust) { - opts.position.adjust = {}; - } - if('string' !== typeof opts.position.adjust.method) { - opts.position.adjust.method = String(opts.position.adjust.method).toLowerCase(); + if('adjust' in opts.position) { + if(!(/flip|shift( horizontal| vertical)*/i).test(opts.position.adjust.method)) { + delete opts.position.adjust.method; + } } } @@ -129,7 +128,7 @@ function sanitizeOptions(opts) $.each(PLUGINS, function() { if(this.sanitize) { this.sanitize(opts); } }); - + return opts; } diff --git a/dist/jquery.qtip.css b/dist/jquery.qtip.css index 6ae0e4b4..1ca662ed 100644 --- a/dist/jquery.qtip.css +++ b/dist/jquery.qtip.css @@ -9,7 +9,7 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Mon Apr 11 17:44:04 2011 +0100 +* Date: Mon Apr 11 19:54:32 2011 +0100 */ /* Fluid class for determining actual width in IE */ diff --git a/dist/jquery.qtip.js b/dist/jquery.qtip.js index f62fe4ca..00c18917 100644 --- a/dist/jquery.qtip.js +++ b/dist/jquery.qtip.js @@ -9,7 +9,7 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Mon Apr 11 17:44:04 2011 +0100 +* Date: Mon Apr 11 19:54:32 2011 +0100 */ "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ @@ -87,11 +87,10 @@ function sanitizeOptions(opts) }; } - if('object' !== typeof opts.position.adjust) { - opts.position.adjust = {}; - } - if('string' !== typeof opts.position.adjust.method) { - opts.position.adjust.method = String(opts.position.adjust.method).toLowerCase(); + if('adjust' in opts.position) { + if(!(/flip|shift( horizontal| vertical)*/i).test(opts.position.adjust.method)) { + delete opts.position.adjust.method; + } } } @@ -129,7 +128,7 @@ function sanitizeOptions(opts) $.each(PLUGINS, function() { if(this.sanitize) { this.sanitize(opts); } }); - + return opts; } diff --git a/dist/jquery.qtip.min.js b/dist/jquery.qtip.min.js index 28b223cc..f7539572 100644 --- a/dist/jquery.qtip.min.js +++ b/dist/jquery.qtip.min.js @@ -9,5 +9,5 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Mon Apr 11 17:44:04 2011 +0100 -*/"use strict",function(a,b,c){function z(b){var c=this,d=b.elements,e=d.tooltip,f=".bgiframe-"+b.id;a.extend(c,{init:function(){d.bgiframe=a(''),d.bgiframe.appendTo(e),e.bind("tooltipmove"+f,c.adjust)},adjust:function(){var a=b.get("dimensions"),c=b.plugins.tip,f=d.tip,g,h;h=parseInt(e.css("border-left-width"),10)||0,h={left:-h,top:-h},c&&f&&(g=c.corner.precedance==="x"?["width","left"]:["height","top"],h[g[1]]-=f[g[0]]()),d.bgiframe.css(h).css(a)},destroy:function(){d.bgiframe.remove(),e.unbind(f)}}),c.init()}function y(c){var f=this,h=c.options.show.modal,i=c.elements,j=i.tooltip,k="#qtip-overlay",l=".qtipmodal",m="tooltipshow"+l+" tooltiphide"+l;c.checks.modal={"^show.modal.(on|blur)$":function(){f.init(),i.overlay.toggle(j.is(":visible"))}},a.extend(f,{init:function(){h.on&&(j.unbind(l).bind(m,function(b,c,d){var e=b.type.replace("tooltip","");a.isFunction(h[e])?h[e].call(i.overlay,d,c):f[e](d)}),f.create(),h.blur===d&&i.overlay.unbind(l+c.id).bind("click"+l+c.id,function(){c.hide.call(c)}),i.overlay.css("cursor",h.blur?"pointer":""))},create:function(){var c=a(k),d;if(c.length){i.overlay=c;return c}d=i.overlay=a("
",{id:k.substr(1),css:{position:"absolute",top:0,left:0,display:"none"},mousedown:function(){return e}}).appendTo(document.body),a(b).bind("resize"+l,function(){d.css({height:Math.max(a(b).height(),a(document).height()),width:Math.max(a(b).width(),a(document).width())})}).trigger("resize");return d},toggle:function(b){var h=i.overlay,k=c.options.show.modal.effect,l=b?"show":"hide",m;h||(h=f.create());if(!h.is(":animated")||b)h.stop(d,e),b&&(m=parseInt(a.css(j[0],"z-index"),10),h.css("z-index",(m||g.zindex)-1)),a.isFunction(k)?k.call(h,b):k===e?h[l]():h.fadeTo(90,b?.7:0,function(){b||a(this).hide()})},show:function(){f.toggle(d)},hide:function(){f.toggle(e)},destroy:function(){var d=i.overlay;d&&(a(k).each(function(){var b=a(this).data("qtip");if(b&&b.id!==b.id&&b.options.show.modal)return d=e}),d?(i.overlay.remove(),a(b).unbind(l)):i.overlay.unbind(l+c.id)),j.unbind(m)}}),f.init()}function x(b,g){function v(a){var b=a.precedance==="y",c=n[b?"width":"height"],d=n[b?"height":"width"],e=a.string().indexOf("center")>-1,f=c*(e?.5:1),g=Math.pow,h=Math.round,i,j,k,l=Math.sqrt(g(f,2)+g(d,2)),m=[p/f*l,p/d*l];m[2]=Math.sqrt(g(m[0],2)-g(p,2)),m[3]=Math.sqrt(g(m[1],2)-g(p,2)),i=l+m[2]+m[3]+(e?0:m[0]),j=i/l,k=[h(j*d),h(j*c)];return{height:k[b?0:1],width:k[b?1:0]}}function u(b){var c=k.titlebar&&b.y==="top",d=c?k.titlebar:k.content,e=a.browser.mozilla,f=e?"-moz-":a.browser.webkit?"-webkit-":"",g=b.y+(e?"":"-")+b.x,h=f+(e?"border-radius-"+g:"border-"+g+"-radius");return parseInt(d.css(h),10)||parseInt(l.css(h),10)||0}function t(a,b,c){b=b?b:a[a.precedance];var d=k.titlebar&&a.y==="top",e=d?k.titlebar:k.content,f="border-"+b+"-width",g=parseInt(e.css(f),10);return(c?g||parseInt(l.css(f),10):g)||0}function s(f,g,h,l){if(k.tip){var n=a.extend({},i.corner),o=h.adjusted,p=b.options.position.adjust.method.substr(0,5)==="shift",q={left:0,top:0},r;i.corner.fixed!==d&&(p?(o.top&&(q.top=Math.abs(o.top)),o.left&&(q.left=Math.abs(o.left)),n.precedance==="y"&&o.top?n.precedance=n.precedance==="y"?"x":"y":n.precedance==="x"&&o.left&&(n.precedance=n.precedance==="x"?"y":"x"),!q.left&&!q.top&&(p=e)):(o.left&&(n.x=n.x==="center"?o.left>0?"left":"right":n.x==="left"?"right":"left"),o.top&&(n.y=n.y==="center"?o.top>0?"top":"bottom":n.y==="top"?"bottom":"top")),n.string()!==m.corner&&(m.top!==o.top||m.left!==o.left)&&(r=i.update(n,e))),r=i.position(n,q,1),r.right!==c&&(r.left=r.right),r.bottom!==c&&(r.top=r.bottom),r.option=Math.max(0,j.offset);if(p&&q.top&&!q.left||!p||!r)h.left-=r.left.charAt?r.option:(r.right?-1:1)*r.left;if(p&&q.left&&!q.top||!p||!r)h.top-=r.top.charAt?r.option:(r.bottom?-1:1)*r.top;m.left=o.left,m.top=o.top,m.corner=n.string()}}var i=this,j=b.options.style.tip,k=b.elements,l=k.tooltip,m={top:0,left:0,corner:""},n={width:j.width,height:j.height},o={},p=j.border||0,q=".qtip-tip",r=a("")[0].getContext;i.corner=f,i.mimic=f,b.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){i.init()||i.destroy(),b.reposition()},"^style.tip.(height|width)$":function(){n={width:j.width,height:j.height},i.create(),i.update(),b.reposition()},"^content.title.text|style.(classes|widget)$":function(){k.tip&&i.update()}},a.extend(i,{init:function(){var b=i.detectCorner()&&(r||a.browser.msie);b&&(i.create(),i.update(),l.unbind(q).bind("tooltipmove"+q,s));return b},detectCorner:function(){var a=j.corner,c=b.options.position,f=c.at,g=c.my.string?c.my.string():c.my;if(a===e||g===e&&f===e)return e;a===d?i.corner=new h.Corner(g):a.string||(i.corner=new h.Corner(a),i.corner.fixed=d);return i.corner.string()!=="centercenter"},detectColours:function(){var c,d,e,f=k.tip.css({backgroundColor:"",border:""}),g=i.corner,h=g[g.precedance],m="border-"+h+"-color",p="border"+h.charAt(0)+h.substr(1)+"Color",q=/rgba?\(0, 0, 0(, 0)?\)|transparent/i,r="background-color",s="transparent",t="ui-tooltip-fluid",u=a(document.body).css("color"),v=b.elements.content.css("color"),w=k.titlebar&&(g.y==="top"||g.y==="center"&&f.position().top+n.height/2+j.offset