diff --git a/build/jslint-check.js b/build/jslint-check.js index 1c0a89cc..0daa2340 100644 --- a/build/jslint-check.js +++ b/build/jslint-check.js @@ -2,14 +2,15 @@ load("build/jslint.js"); var src = readFile("dist/jquery.qtip.js"); -JSLINT(src, { browser: true, onevar: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: true, forin: true }); +JSLINT(src, { evil: true, forin: true, maxerr: 100 }); // All of the following are known issues that we think are 'ok' // (in contradiction with JSLint) more information here: // http://docs.jquery.com/JQuery_Core_Style_Guidelines var ok = { "Expected an identifier and instead saw 'undefined' (a reserved word).": true, - "Expected a conditional expression and instead saw an assignment.": true + "Expected a conditional expression and instead saw an assignment.": true, + "Insecure '.'.": true }; var e = JSLINT.errors, found = 0, w; diff --git a/dist/jquery.qtip.css b/dist/jquery.qtip.css index 039e1c83..2944776b 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: Wed Nov 3 01:57:34 2010 +0000 +* Date: Wed Nov 3 02:03:26 2010 +0000 */ .ui-tooltip-accessible{ diff --git a/dist/jquery.qtip.js b/dist/jquery.qtip.js index 059e1814..318922e8 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: Wed Nov 3 01:57:34 2010 +0000 +* Date: Wed Nov 3 02:03:26 2010 +0000 */ "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ @@ -1403,9 +1403,9 @@ $.each({ }); }, - /* iPad offset fix - See trac ticket: http://bugs.jquery.com/ticket/6446#comment:1 + /* Mobile Safari offset fix - See trac ticket: http://bugs.jquery.com/ticket/6446 */ - offset: !$.fn.qtip.isiPad ? NULL : function() { + offset: parseFloat(((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)) || [0,'4_2'])[1].replace('_','.')) > 4.1 ? NULL : function() { var result = $(this).Oldoffset(); result.top -= window.scrollY; result.left -= window.scrollX; @@ -1437,9 +1437,6 @@ $.fn.qtip.nextid = 0; $.fn.qtip.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '); $.fn.qtip.zindex = 15000; -// iPad offset problem detection - http://bugs.jquery.com/ticket/6446#comment:1 -$.fn.qtip.isiPad = navigator.userAgent.indexOf('iPad') != -1 && /OS (?:3_2|4_0)/i.test(navigator.userAgent); - // Setup base plugins $.fn.qtip.plugins = { // Corner object parser diff --git a/dist/jquery.qtip.min.js b/dist/jquery.qtip.min.js index 4c5d85be..243028e9 100644 --- a/dist/jquery.qtip.min.js +++ b/dist/jquery.qtip.min.js @@ -9,7 +9,7 @@ * http://en.wikipedia.org/wiki/MIT_License * http://en.wikipedia.org/wiki/GNU_General_Public_License * -* Date: Wed Nov 3 01:57:34 2010 +0000 +* Date: Wed Nov 3 02:03:26 2010 +0000 */ "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ @@ -69,12 +69,12 @@ y=c.elements.tip,q;q=parseInt(g.css("border-left-width"),10);q={left:-q,top:-q}; M;else if("string"===typeof c){this.each(function(){var q=a(this).data("qtip");if(!q)return TRUE;if(/option|set/.test(g)&&e)if(i!==M)q.set(e,i);else o=q.get(e);else{if(!q.rendered&&(g==="show"||g==="toggle")){if(t&&t.timeStamp)q.cache.event=t;q.render()}else if(g==="enable"){g="disable";l=[FALSE]}q[g]&&q[g].apply(q[g],l)}});return o!==NULL?o:this}else if("object"===typeof c){y=O(m,this);m=a.extend(TRUE,{},a.fn.qtip.defaults,m);return a.fn.qtip.bind.call(y,m,t)}};a.fn.qtip.bind=function(c,e){return this.each(function(i){function g(z){function A(){m.render(typeof z=== "object"||y.show.ready);q.show.unbind(x.show);q.hide.unbind(x.hide)}if(m.cache.disabled)return FALSE;m.cache.event=a.extend({},z);if(y.show.delay>0){clearTimeout(m.timers.show);m.timers.show=setTimeout(A,y.show.delay);x.show!==x.hide&&q.hide.bind(x.hide,function(){clearTimeout(m.timers.show)})}else A()}var o=a(this),l=c.id,t=c.content.text,m,y,q,x,f;c.id=l=l===FALSE||l.length<1||a("#ui-tooltip-"+l).length?a.fn.qtip.nextid++:l;f=".qtip-"+l+"-create";m=S.call(this,l,c);if(m===FALSE)return TRUE;y=m.options; if(a.isArray(t))y.content.text=t[i];o.attr("title")&&o.data("oldtitle",o.attr("title")).removeAttr("title");a.each(a.fn.qtip.plugins,function(){this.initialize==="initialize"&&this(m)});q={show:y.show.target,hide:y.hide.target};x={show:String(y.show.event).replace(" ",f+" ")+f,hide:String(y.hide.event).replace(" ",f+" ")+f};q.show.bind(x.show,g);if(c.show.ready||c.prerender||c.show.event===FALSE)g(e)})};a.each({attr:function(c){var e=a(this).data("qtip");return arguments.length===1&&c==="title"&& -e&&e.rendered===TRUE?a(this).data("oldtitle"):NULL},remove:a.ui?NULL:function(c,e){this.each(function(){if(!e)if(!c||a.filter(c,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})},offset:!a.fn.qtip.isiPad?NULL:function(){var c=a(this).Oldoffset();c.top-=E.scrollY;c.left-=E.scrollX;return c}},function(c,e){if(!e)return TRUE;a.fn["Old"+c]=a.fn[c];a.fn[c]=function(){return e.apply(this,arguments)||a.fn["Old"+c].apply(this,arguments)}});a(document.body).attr("role", -function(c,e){return!e?"application":e});a(document).bind("mousemove.qtip",function(c){a.fn.qtip.mouse={pageX:c.pageX,pageY:c.pageY}});a.fn.qtip.nextid=0;a.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");a.fn.qtip.zindex=15E3;a.fn.qtip.isiPad=navigator.userAgent.indexOf("iPad")!=-1&&/OS (?:3_2|4_0)/i.test(navigator.userAgent);a.fn.qtip.plugins={Corner:function(c){this.x=(String(c).replace(/middle/i,"center").match(/left|right|center/i)||["false"])[0].toLowerCase(); -this.y=(String(c).replace(/middle/i,"center").match(/top|bottom|center/i)||["false"])[0].toLowerCase();this.precedance=c.charAt(0).search(/^(t|b)/)>-1?"y":"x";this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y};this.abbreviation=function(){var e=this.x.substr(0,1),i=this.y.substr(0,1);return e===i?e:e==="c"||e!=="c"&&i!=="c"?i+e:e+i}}};a.fn.qtip.defaults={prerender:FALSE,id:FALSE,overwrite:TRUE,metadata:{type:"class"},content:{text:TRUE,attr:"title",title:{text:FALSE, -button:FALSE}},position:{my:"top left",at:"bottom right",target:FALSE,container:FALSE,adjust:{x:0,y:0,mouse:TRUE,screen:FALSE,resize:TRUE,offset:FALSE},effect:TRUE},show:{target:FALSE,event:"mouseenter",effect:TRUE,delay:90,solo:FALSE,ready:FALSE},hide:{target:FALSE,event:"mouseleave",effect:TRUE,delay:0,fixed:FALSE,inactive:FALSE},style:{classes:"",widget:FALSE},events:{render:a.noop,move:a.noop,show:a.noop,hide:a.noop,focus:a.noop,blur:a.noop}};var N=a();a.fn.qtip.plugins.ajax=function(c){var e= -c.plugins.ajax,i=c.options.content.ajax;if(i&&i.url)if(e)return e;else{c.plugins.ajax=new T(c);return c.plugins.ajax}};a.fn.qtip.plugins.ajax.initialize="render";a.fn.qtip.plugins.ajax.sanitize=function(c){try{var e=c.content.ajax;if(typeof e!=="object")c.content.ajax={url:e};if(c.content.text===FALSE)c.content.text="Loading...";e.once=!!e.once;e.preload=!!e.preload;if(e.preload){var i=e.url;a("#qtip-preload").length||a('
').appendTo(document.body); -N.length||(N=a("").appendTo("#qtip-preload").load(i+" img"))}}catch(g){}};a.extend(TRUE,a.fn.qtip.defaults,{content:{ajax:{once:TRUE,preload:FALSE}}});a.fn.qtip.plugins.tip=function(c){var e=c.plugins.tip,i=c.options.style.tip;if(i&&i.corner)if(e)return e;else{c.plugins.tip=new U(c);c.plugins.tip.init();return c.plugins.tip}};a.fn.qtip.plugins.tip.initialize="render";a.fn.qtip.plugins.tip.sanitize=function(c){try{var e=c.style.tip;if(typeof e!=="object")c.style.tip={corner:!!e};if(typeof e.method!== +e&&e.rendered===TRUE?a(this).data("oldtitle"):NULL},remove:a.ui?NULL:function(c,e){this.each(function(){if(!e)if(!c||a.filter(c,[this]).length)a("*",this).add(this).each(function(){a(this).triggerHandler("remove")})})},offset:parseFloat((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(navigator.userAgent)||[0,"4_2"])[1].replace("_","."))>4.1?NULL:function(){var c=a(this).Oldoffset();c.top-=E.scrollY;c.left-=E.scrollX;return c}},function(c,e){if(!e)return TRUE;a.fn["Old"+c]=a.fn[c];a.fn[c]=function(){return e.apply(this, +arguments)||a.fn["Old"+c].apply(this,arguments)}});a(document.body).attr("role",function(c,e){return!e?"application":e});a(document).bind("mousemove.qtip",function(c){a.fn.qtip.mouse={pageX:c.pageX,pageY:c.pageY}});a.fn.qtip.nextid=0;a.fn.qtip.inactiveEvents="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" ");a.fn.qtip.zindex=15E3;a.fn.qtip.plugins={Corner:function(c){this.x=(String(c).replace(/middle/i,"center").match(/left|right|center/i)||["false"])[0].toLowerCase();this.y= +(String(c).replace(/middle/i,"center").match(/top|bottom|center/i)||["false"])[0].toLowerCase();this.precedance=c.charAt(0).search(/^(t|b)/)>-1?"y":"x";this.string=function(){return this.precedance==="y"?this.y+this.x:this.x+this.y};this.abbreviation=function(){var e=this.x.substr(0,1),i=this.y.substr(0,1);return e===i?e:e==="c"||e!=="c"&&i!=="c"?i+e:e+i}}};a.fn.qtip.defaults={prerender:FALSE,id:FALSE,overwrite:TRUE,metadata:{type:"class"},content:{text:TRUE,attr:"title",title:{text:FALSE,button:FALSE}}, +position:{my:"top left",at:"bottom right",target:FALSE,container:FALSE,adjust:{x:0,y:0,mouse:TRUE,screen:FALSE,resize:TRUE,offset:FALSE},effect:TRUE},show:{target:FALSE,event:"mouseenter",effect:TRUE,delay:90,solo:FALSE,ready:FALSE},hide:{target:FALSE,event:"mouseleave",effect:TRUE,delay:0,fixed:FALSE,inactive:FALSE},style:{classes:"",widget:FALSE},events:{render:a.noop,move:a.noop,show:a.noop,hide:a.noop,focus:a.noop,blur:a.noop}};var N=a();a.fn.qtip.plugins.ajax=function(c){var e=c.plugins.ajax, +i=c.options.content.ajax;if(i&&i.url)if(e)return e;else{c.plugins.ajax=new T(c);return c.plugins.ajax}};a.fn.qtip.plugins.ajax.initialize="render";a.fn.qtip.plugins.ajax.sanitize=function(c){try{var e=c.content.ajax;if(typeof e!=="object")c.content.ajax={url:e};if(c.content.text===FALSE)c.content.text="Loading...";e.once=!!e.once;e.preload=!!e.preload;if(e.preload){var i=e.url;a("#qtip-preload").length||a('').appendTo(document.body);N.length|| +(N=a("").appendTo("#qtip-preload").load(i+" img"))}}catch(g){}};a.extend(TRUE,a.fn.qtip.defaults,{content:{ajax:{once:TRUE,preload:FALSE}}});a.fn.qtip.plugins.tip=function(c){var e=c.plugins.tip,i=c.options.style.tip;if(i&&i.corner)if(e)return e;else{c.plugins.tip=new U(c);c.plugins.tip.init();return c.plugins.tip}};a.fn.qtip.plugins.tip.initialize="render";a.fn.qtip.plugins.tip.sanitize=function(c){try{var e=c.style.tip;if(typeof e!=="object")c.style.tip={corner:!!e};if(typeof e.method!== "string")e.method=TRUE;if(!/canvas|polygon/i.test(e.method))e.method=TRUE;if(typeof e.width!=="number")e.width=12;if(typeof e.height!=="number")e.height=12;if(typeof e.border!=="number")e.border=0}catch(i){}};a.extend(TRUE,a.fn.qtip.defaults,{style:{tip:{corner:TRUE,method:TRUE,width:12,height:12,border:0}}});a.fn.qtip.plugins.imagemap=function(c,e){function i(x,f){for(var z=0,A=1,b=1,d=0,h=0,k=x.width,j=x.height;k>0&&j>0&&A>0&&b>0;){k=Math.floor(k/2);j=Math.floor(j/2);if(e.x==="left")A=k;else if(e.x=== "right")A=x.width-k;else A+=Math.floor(k/2);if(e.y==="top")b=j;else if(e.y==="bottom")b=x.height-j;else b+=Math.floor(j/2);for(z=f.length;z--;){if(f.length<2)break;d=f[z][0]-x.offset.left;h=f[z][1]-x.offset.top;if(e.x==="left"&&d>=A||e.x==="right"&&d<=A||e.x==="center"&&(dx.width-A)||e.y==="top"&&h>=b||e.y==="bottom"&&h<=b||e.y==="center"&&(hx.height-b))f.splice(z,1)}}return{left:f[0][0],top:f[0][1]}}var g=c.attr("shape").toLowerCase(),o=c.attr("coords").split(","),l=[],t=a('img[usemap="#'+ c.parent("map").attr("name")+'"]').offset(),m={width:0,height:0,offset:{top:1E10,right:0,bottom:0,left:1E10}},y=0,q=0;if(g==="poly")for(y=o.length;y--;){q=[parseInt(o[--y],10),parseInt(o[y+1],10)];if(q[0]>m.offset.right)m.offset.right=q[0];if(q[0]