Click here to download latest version
":"Download latest version from here
"),"A"==root.tagName&&(root.onclick=function(){location.href=URL})),opts.onFail){var ret=opts.onFail.call(this);"string"==typeof ret&&(root.innerHTML=ret)}IE&&(window[opts.id]=document.getElementById(opts.id)),extend(this,{getRoot:function(){return root},getOptions:function(){return opts},getConf:function(){return conf},getApi:function(){return root.firstChild}})}var IE=document.all,URL="http://www.adobe.com/go/getflashplayer",JQUERY="function"==typeof jQuery,RE=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,GLOBAL_OPTS={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:!0,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:!1,cachebusting:!1};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){},__flash_savedUnloadHandler=function(){}}),window.flashembed=function(root,opts,conf){return"string"==typeof root&&(root=document.getElementById(root.replace("#",""))),root?("string"==typeof opts&&(opts={src:opts}),new Flash(root,extend(extend({},GLOBAL_OPTS),opts),conf)):void 0};var f=extend(window.flashembed,{conf:GLOBAL_OPTS,getVersion:function(){var fo,ver;try{ver=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(e){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),ver=fo&&fo.GetVariable("$version")}catch(err){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),ver=fo&&fo.GetVariable("$version")}catch(err2){}}}return ver=RE.exec(ver),ver?[ver[1],ver[3]]:[0,0]},asString:function(obj){if(null===obj||void 0===obj)return null;var type=typeof obj;switch("object"==type&&obj.push&&(type="array"),type){case"string":return obj=obj.replace(new RegExp('(["\\\\])',"g"),"\\$1"),obj=obj.replace(/^\s?(\d+\.?\d*)%/,"$1pct"),'"'+obj+'"';case"array":return"["+map(obj,function(el){return f.asString(el)}).join(",")+"]";case"function":return'"function()"';case"object":var str=[];for(var prop in obj)obj.hasOwnProperty(prop)&&str.push('"'+prop+'":'+f.asString(obj[prop]));return"{"+str.join(",")+"}"}return String(obj).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(opts,conf){opts=extend({},opts);var html='"},isSupported:function(ver){return VERSION[0]>ver[0]||VERSION[0]==ver[0]&&VERSION[1]>=ver[1]}}),VERSION=f.getVersion();JQUERY&&(jQuery.tools=jQuery.tools||{version:"@VERSION"},jQuery.tools.flashembed={conf:GLOBAL_OPTS},jQuery.fn.flashembed=function(opts,conf){return this.each(function(){jQuery(this).data("flashembed",flashembed(this,opts,conf))})})}(),function($){function wheelHandler(event){switch(event.type){case"mousemove":return $.extend(event.data,{clientX:event.clientX,clientY:event.clientY,pageX:event.pageX,pageY:event.pageY});case"DOMMouseScroll":$.extend(event,event.data),event.delta=-event.detail/3;break;case"mousewheel":event.delta=event.wheelDelta/120}return event.type="wheel",$.event.handle.call(this,event,event.delta)}$.fn.mousewheel=function(fn){return this[fn?"on":"trigger"]("wheel",fn)},$.event.special.wheel={setup:function(){$.event.add(this,wheelEvents,wheelHandler,{})},teardown:function(){$.event.remove(this,wheelEvents,wheelHandler)}};var wheelEvents=$.browser.mozilla?"DOMMouseScroll"+($.browser.version<"1.9"?" mousemove":""):"mousewheel"}(jQuery); \ No newline at end of file +!function($){function getPosition(el){var p=el.offset();return{top:p.top+el.height()/2,left:p.left+el.width()/2}}var t=$.tools.overlay,w=$(window);$.extend(t.conf,{start:{top:null,left:null},fadeInSpeed:"fast",zIndex:9999});var loadEffect=function(pos,onLoad){var overlay=this.getOverlay(),conf=this.getConf(),trigger=this.getTrigger(),self=this,oWidth=overlay.outerWidth(!0),img=overlay.data("img"),position=conf.fixed?"fixed":"absolute";if(!img){var bg=overlay.css("backgroundImage");if(!bg)throw"background-image CSS property not set for overlay";bg=bg.slice(bg.indexOf("(")+1,bg.indexOf(")")).replace(/\"/g,""),overlay.css("backgroundImage","none"),img=$(''),img.css({border:0,display:"none"}).width(oWidth),$("body").append(img),overlay.data("img",img)}var itop=conf.start.top||Math.round(w.height()/2),ileft=conf.start.left||Math.round(w.width()/2);if(trigger){var p=getPosition(trigger);itop=p.top,ileft=p.left}conf.fixed?(itop-=w.scrollTop(),ileft-=w.scrollLeft()):(pos.top+=w.scrollTop(),pos.left+=w.scrollLeft()),img.css({position:"absolute",top:itop,left:ileft,width:0,zIndex:conf.zIndex}).show(),pos.position=position,overlay.css(pos),img.animate({top:pos.top,left:pos.left,width:oWidth},conf.speed,function(){overlay.css("zIndex",conf.zIndex+1).fadeIn(conf.fadeInSpeed,function(){self.isOpened()&&!$(this).index(overlay)?onLoad.call():overlay.hide()})}).css("position",position)},closeEffect=function(onClose){var overlay=this.getOverlay().hide(),conf=this.getConf(),trigger=this.getTrigger(),img=overlay.data("img"),css={top:conf.start.top,left:conf.start.left,width:0};trigger&&$.extend(css,getPosition(trigger)),conf.fixed&&img.css({position:"absolute"}).animate({top:"+="+w.scrollTop(),left:"+="+w.scrollLeft()},0),img.animate(css,conf.closeSpeed,onClose)};t.addEffect("apple",loadEffect,closeEffect)}(jQuery),function($){var t=$.tools.scrollable;t.autoscroll={conf:{autoplay:!0,interval:3e3,autopause:!0}},$.fn.autoscroll=function(conf){"number"==typeof conf&&(conf={interval:conf});var ret,opts=$.extend({},t.autoscroll.conf,conf);return this.each(function(){function scroll(){timer&&clearTimeout(timer),timer=setTimeout(function(){api.next()},opts.interval)}var timer,api=$(this).data("scrollable"),root=api.getRoot(),stopped=!1;api&&(ret=api),api.play=function(){timer||(stopped=!1,root.on("onSeek",scroll),scroll())},api.pause=function(){timer=clearTimeout(timer),root.off("onSeek",scroll)},api.resume=function(){stopped||api.play()},api.stop=function(){stopped=!0,api.pause()},opts.autopause&&root.add(api.getNaviButtons()).hover(api.pause,api.resume),opts.autoplay&&api.play()}),opts.api?ret:this}}(jQuery),function($){function find(root,query){var el=$(query);return el.length<2?el:root.parent().find(query)}var t=$.tools.scrollable;t.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:!1,idPrefix:null,history:!1}},$.fn.navigator=function(conf){"string"==typeof conf&&(conf={navi:conf}),conf=$.extend({},t.navigator.conf,conf);var ret;return this.each(function(){function doClick(el,i,e){api.seekTo(i),e.preventDefault(),hashed&&history.pushState({i:i},"")}function els(){return navi.find(conf.naviItem||"> *")}function addItem(i){var item=$("<"+(conf.naviItem||"a")+"/>").click(function(e){doClick($(this),i,e)});return 0===i&&item.addClass(cls),conf.indexed&&item.text(i+1),conf.idPrefix&&item.attr("id",conf.idPrefix+i),item.appendTo(navi)}var api=$(this).data("scrollable"),navi=conf.navi.jquery?conf.navi:find(api.getRoot(),conf.navi),buttons=api.getNaviButtons(),cls=conf.activeClass,hashed=conf.history&&!!history.pushState,size=api.getConf().size;api&&(ret=api),api.getNaviButtons=function(){return buttons.add(navi)},hashed&&(history.pushState({i:0},""),$(window).on("popstate",function(evt){var s=evt.originalEvent.state;s&&api.seekTo(s.i)})),els().length?els().each(function(i){$(this).click(function(e){doClick($(this),i,e)})}):$.each(api.getItems(),function(i){i%size==0&&addItem(i)}),api.onBeforeSeek(function(e,index){setTimeout(function(){if(!e.isDefaultPrevented()){var i=index/size,el=els().eq(i);el.length&&els().removeClass(cls).eq(i).addClass(cls)}},1)}),api.onAddItem(function(e,item){var i=api.getItems().index(item);i%size==0&&addItem(i)})}),conf.api?ret:this}}(jQuery),function($){function Slideshow(root,conf){function find(query){var el=$(query);return el.length<2?el:root.parent().find(query)}function next(){timer&&clearTimeout(timer),timer=setTimeout(function(){tabs.next()},conf.interval)}var timer,self=this,fire=root.add(this),tabs=root.data("tabs"),stopped=!0,nextButton=find(conf.next).click(function(){tabs.next()}),prevButton=find(conf.prev).click(function(){tabs.prev()});if($.extend(self,{getTabs:function(){return tabs},getConf:function(){return conf},play:function(){if(timer)return self;var e=$.Event("onBeforePlay");return fire.trigger(e),e.isDefaultPrevented()?self:(stopped=!1,fire.trigger("onPlay"),fire.on("onClick",next),next(),self)},pause:function(){if(!timer)return self;var e=$.Event("onBeforePause");return fire.trigger(e),e.isDefaultPrevented()?self:(timer=clearTimeout(timer),fire.trigger("onPause"),fire.off("onClick",next),self)},resume:function(){stopped||self.play()},stop:function(){self.pause(),stopped=!0}}),$.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","),function(i,name){$.isFunction(conf[name])&&$(self).on(name,conf[name]),self[name]=function(fn){return $(self).on(name,fn)}}),conf.autopause&&tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()).hover(self.pause,self.resume),conf.autoplay&&self.play(),conf.clickable&&tabs.getPanes().click(function(){tabs.next()}),!tabs.getConf().rotate){var disabled=conf.disabledClass;tabs.getIndex()||prevButton.addClass(disabled),tabs.onBeforeClick(function(e,i){prevButton.toggleClass(disabled,!i),nextButton.toggleClass(disabled,i==tabs.getTabs().length-1)})}}var tool;tool=$.tools.tabs.slideshow={conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:!1,autopause:!0,interval:3e3,clickable:!0,api:!1}},$.fn.slideshow=function(conf){var el=this.data("slideshow");return el?el:(conf=$.extend({},tool.conf,conf),this.each(function(){el=new Slideshow($(this),conf),$(this).data("slideshow",el)}),conf.api?el:this)}}(jQuery),function(){function extend(to,from){if(from)for(var key in from)from.hasOwnProperty(key)&&(to[key]=from[key]);return to}function map(arr,func){var newArr=[];for(var i in arr)arr.hasOwnProperty(i)&&(newArr[i]=func(arr[i]));return newArr}function Flash(root,opts,conf){if(f.isSupported(opts.version))root.innerHTML=f.getHTML(opts,conf);else if(opts.expressInstall&&f.isSupported([6,65]))root.innerHTML=f.getHTML(extend(opts,{src:opts.expressInstall}),{MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title});else if(root.innerHTML.replace(/\s/g,"")||(root.innerHTML="Click here to download latest version
":"Download latest version from here
"),"A"==root.tagName&&(root.onclick=function(){location.href=URL})),opts.onFail){var ret=opts.onFail.call(this);"string"==typeof ret&&(root.innerHTML=ret)}IE&&(window[opts.id]=document.getElementById(opts.id)),extend(this,{getRoot:function(){return root},getOptions:function(){return opts},getConf:function(){return conf},getApi:function(){return root.firstChild}})}var IE=document.all,URL="http://www.adobe.com/go/getflashplayer",JQUERY="function"==typeof jQuery,RE=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,GLOBAL_OPTS={width:"100%",height:"100%",id:"_"+(""+Math.random()).slice(9),allowfullscreen:!0,allowscriptaccess:"always",quality:"high",version:[3,0],onFail:null,expressInstall:null,w3c:!1,cachebusting:!1};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){},__flash_savedUnloadHandler=function(){}}),window.flashembed=function(root,opts,conf){if("string"==typeof root&&(root=document.getElementById(root.replace("#",""))),root)return"string"==typeof opts&&(opts={src:opts}),new Flash(root,extend(extend({},GLOBAL_OPTS),opts),conf)};var f=extend(window.flashembed,{conf:GLOBAL_OPTS,getVersion:function(){var fo,ver;try{ver=navigator.plugins["Shockwave Flash"].description.slice(16)}catch(e){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),ver=fo&&fo.GetVariable("$version")}catch(err){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),ver=fo&&fo.GetVariable("$version")}catch(err2){}}}return ver=RE.exec(ver),ver?[ver[1],ver[3]]:[0,0]},asString:function(obj){if(null===obj||void 0===obj)return null;var type=typeof obj;switch("object"==type&&obj.push&&(type="array"),type){case"string":return obj=obj.replace(new RegExp('(["\\\\])',"g"),"\\$1"),obj=obj.replace(/^\s?(\d+\.?\d*)%/,"$1pct"),'"'+obj+'"';case"array":return"["+map(obj,function(el){return f.asString(el)}).join(",")+"]";case"function":return'"function()"';case"object":var str=[];for(var prop in obj)obj.hasOwnProperty(prop)&&str.push('"'+prop+'":'+f.asString(obj[prop]));return"{"+str.join(",")+"}"}return String(obj).replace(/\s/g," ").replace(/\'/g,'"')},getHTML:function(opts,conf){opts=extend({},opts);var html='"},isSupported:function(ver){return VERSION[0]>ver[0]||VERSION[0]==ver[0]&&VERSION[1]>=ver[1]}}),VERSION=f.getVersion();JQUERY&&(jQuery.tools=jQuery.tools||{version:"@VERSION"},jQuery.tools.flashembed={conf:GLOBAL_OPTS},jQuery.fn.flashembed=function(opts,conf){return this.each(function(){jQuery(this).data("flashembed",flashembed(this,opts,conf))})})}(),function($){function wheelHandler(event){switch(event.type){case"mousemove":return $.extend(event.data,{clientX:event.clientX,clientY:event.clientY,pageX:event.pageX,pageY:event.pageY});case"DOMMouseScroll":$.extend(event,event.data),event.delta=-event.detail/3;break;case"mousewheel":event.delta=event.wheelDelta/120}return event.type="wheel",$.event.handle.call(this,event,event.delta)}$.fn.mousewheel=function(fn){return this[fn?"on":"trigger"]("wheel",fn)},$.event.special.wheel={setup:function(){$.event.add(this,wheelEvents,wheelHandler,{})},teardown:function(){$.event.remove(this,wheelEvents,wheelHandler)}};var wheelEvents=$.browser.mozilla?"DOMMouseScroll"+($.browser.version<"1.9"?" mousemove":""):"mousewheel"}(jQuery); \ No newline at end of file diff --git a/plone/app/jquerytools/browser/jquery.tools.rangeinput.min.js b/plone/app/jquerytools/browser/jquery.tools.rangeinput.min.js index 0ca8759..ccc38d3 100644 --- a/plone/app/jquerytools/browser/jquery.tools.rangeinput.min.js +++ b/plone/app/jquerytools/browser/jquery.tools.rangeinput.min.js @@ -1 +1 @@ -var oldFnData=jQuery.fn.data;jQuery.fn.data=function(name){var ret,evt,elem=this[0];return elem&&"events"===name&&1===arguments.length&&(ret=jQuery.data(elem,name),evt=jQuery._data(elem,name)),oldFnData.apply(this,arguments)},function($){function round(value,precision){var n=Math.pow(10,precision);return Math.round(value*n)/n}function dim(el,key){var v=parseInt(el.css(key),10);if(v)return v;var s=el[0].currentStyle;return s&&s.width&&parseInt(s.width,10)}function hasEvent(el){var e=el.data("events");return e&&e.onSlide}function RangeInput(input,conf){function slide(evt,x,val,isSetValue){if(void 0===val?val=x/len*range:isSetValue&&(val-=conf.min),step&&(val=Math.round(val/step)*step),(void 0===x||step)&&(x=val*len/range),isNaN(val))return self;x=Math.max(0,Math.min(x,len)),val=x/len*range,(isSetValue||!vertical)&&(val+=conf.min),vertical&&(isSetValue?x=len-x:val=conf.max-val),val=round(val,precision);var isClick="click"==evt.type;if(fireOnSlide&&void 0!==value&&!isClick&&(evt.type="onSlide",fire.trigger(evt,[val,x]),evt.isDefaultPrevented()))return self;var speed=isClick?conf.speed:0,callback=isClick?function(){evt.type="change",fire.trigger(evt,[val])}:null;return vertical?(handle.animate({top:x},speed,callback),conf.progress&&progress.animate({height:len-x+handle.height()/2},speed)):(handle.animate({left:x},speed,callback),conf.progress&&progress.animate({width:x+handle.width()/2},speed)),value=val,pos=x,input.val(val),self}function init(){vertical=conf.vertical||dim(root,"height")>dim(root,"width"),vertical?(len=dim(root,"height")-dim(handle,"height"),origo=root.offset().top+len):(len=dim(root,"width")-dim(handle,"width"),origo=root.offset().left)}function begin(){init(),self.setValue(void 0!==conf.value?conf.value:conf.min)}var vertical,value,origo,len,pos,self=this,css=conf.css,root=$("").data("rangeinput",self);input.before(root);var handle=root.addClass(css.slider).find("a").addClass(css.handle),progress=root.find("div").addClass(css.progress);$.each("min,max,step,value".split(","),function(i,key){var val=input.attr(key);parseFloat(val)&&(conf[key]=parseFloat(val,10))});var range=conf.max-conf.min,step="any"==conf.step?0:conf.step,precision=conf.precision;if(void 0===precision&&(precision=step.toString().split("."),precision=2===precision.length?precision[1].length:0),"range"==input.attr("type")){var def=input.clone().wrap("").parent().html(),clone=$(def.replace(/type/i,"type=text data-orig-type"));clone.val(conf.value),input.replaceWith(clone),input=clone}input.addClass(css.input);var fire=$(self).add(input),fireOnSlide=!0;$.extend(self,{getValue:function(){return value},setValue:function(val,e){return init(),slide(e||$.Event("api"),void 0,val,!0)},getConf:function(){return conf},getProgress:function(){return progress},getHandle:function(){return handle},getInput:function(){return input},step:function(am,e){e=e||$.Event();var step="any"==conf.step?1:conf.step;self.setValue(value+step*(am||1),e)},stepUp:function(am){return self.step(am||1)},stepDown:function(am){return self.step(-am||-1)}}),$.each("onSlide,change".split(","),function(i,name){$.isFunction(conf[name])&&$(self).on(name,conf[name]),self[name]=function(fn){return fn&&$(self).on(name,fn),self}}),handle.drag({drag:!1}).on("dragStart",function(){init(),fireOnSlide=hasEvent($(self))||hasEvent(input)}).on("drag",function(e,y,x){return input.is(":disabled")?!1:void slide(e,vertical?y:x)}).on("dragEnd",function(e){e.isDefaultPrevented()||(e.type="change",fire.trigger(e,[value]))}).click(function(e){return e.preventDefault()}),root.click(function(e){if(input.is(":disabled")||e.target==handle[0])return e.preventDefault();init();var fix=vertical?handle.height()/2:handle.width()/2;slide(e,vertical?len-origo-fix+e.pageY:e.pageX-origo-fix)}),conf.keyboard&&input.keydown(function(e){if(!input.attr("readonly")){var key=e.keyCode,up=-1!=$([75,76,38,33,39]).index(key),down=-1!=$([74,72,40,34,37]).index(key);return!up&&!down||e.shiftKey||e.altKey||e.ctrlKey?void 0:(up?self.step(33==key?10:1,e):down&&self.step(34==key?-10:-1,e),e.preventDefault())}}),input.blur(function(e){var val=$(this).val();val!==value&&self.setValue(val,e)}),$.extend(input[0],{stepUp:self.stepUp,stepDown:self.stepDown}),begin(),len||$(window).load(begin)}$.tools=$.tools||{version:"@VERSION"};var tool;tool=$.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:void 0,vertical:0,keyboard:!0,progress:!1,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var doc,draggable;$.fn.drag=function(conf){return document.ondragstart=function(){return!1},conf=$.extend({x:!0,y:!0,drag:!0},conf),doc=doc||$(document).on("mousedown mouseup",function(e){var el=$(e.target);if("mousedown"==e.type&&el.data("drag")){var offset=el.position(),x0=e.pageX-offset.left,y0=e.pageY-offset.top,start=!0;doc.on("mousemove.drag",function(e){var x=e.pageX-x0,y=e.pageY-y0,props={};conf.x&&(props.left=x),conf.y&&(props.top=y),start&&(el.trigger("dragStart"),start=!1),conf.drag&&el.css(props),el.trigger("drag",[y,x]),draggable=el}),e.preventDefault()}else try{draggable&&draggable.trigger("dragEnd")}finally{doc.off("mousemove.drag"),draggable=null}}),this.data("drag",!0)},$.expr[":"].range=function(el){var type=el.getAttribute("type");return type&&"range"==type||!!$(el).filter("input").data("rangeinput")},$.fn.rangeinput=function(conf){if(this.data("rangeinput"))return this;conf=$.extend(!0,{},tool.conf,conf);var els;return this.each(function(){var el=new RangeInput($(this),$.extend(!0,{},conf)),input=el.getInput().data("rangeinput",el);els=els?els.add(input):input}),els?els:this}}(jQuery); \ No newline at end of file +var oldFnData=jQuery.fn.data;jQuery.fn.data=function(name){var ret,evt,elem=this[0];return elem&&"events"===name&&1===arguments.length&&(ret=jQuery.data(elem,name),evt=jQuery._data(elem,name)),oldFnData.apply(this,arguments)},function($){function round(value,precision){var n=Math.pow(10,precision);return Math.round(value*n)/n}function dim(el,key){var v=parseInt(el.css(key),10);if(v)return v;var s=el[0].currentStyle;return s&&s.width&&parseInt(s.width,10)}function hasEvent(el){var e=el.data("events");return e&&e.onSlide}function RangeInput(input,conf){function slide(evt,x,val,isSetValue){if(void 0===val?val=x/len*range:isSetValue&&(val-=conf.min),step&&(val=Math.round(val/step)*step),(void 0===x||step)&&(x=val*len/range),isNaN(val))return self;x=Math.max(0,Math.min(x,len)),val=x/len*range,!isSetValue&&vertical||(val+=conf.min),vertical&&(isSetValue?x=len-x:val=conf.max-val),val=round(val,precision);var isClick="click"==evt.type;if(fireOnSlide&&void 0!==value&&!isClick&&(evt.type="onSlide",fire.trigger(evt,[val,x]),evt.isDefaultPrevented()))return self;var speed=isClick?conf.speed:0,callback=isClick?function(){evt.type="change",fire.trigger(evt,[val])}:null;return vertical?(handle.animate({top:x},speed,callback),conf.progress&&progress.animate({height:len-x+handle.height()/2},speed)):(handle.animate({left:x},speed,callback),conf.progress&&progress.animate({width:x+handle.width()/2},speed)),value=val,pos=x,input.val(val),self}function init(){vertical=conf.vertical||dim(root,"height")>dim(root,"width"),vertical?(len=dim(root,"height")-dim(handle,"height"),origo=root.offset().top+len):(len=dim(root,"width")-dim(handle,"width"),origo=root.offset().left)}function begin(){init(),self.setValue(void 0!==conf.value?conf.value:conf.min)}var vertical,value,origo,len,pos,self=this,css=conf.css,root=$("").data("rangeinput",self);input.before(root);var handle=root.addClass(css.slider).find("a").addClass(css.handle),progress=root.find("div").addClass(css.progress);$.each("min,max,step,value".split(","),function(i,key){var val=input.attr(key);parseFloat(val)&&(conf[key]=parseFloat(val,10))});var range=conf.max-conf.min,step="any"==conf.step?0:conf.step,precision=conf.precision;if(void 0===precision&&(precision=step.toString().split("."),precision=2===precision.length?precision[1].length:0),"range"==input.attr("type")){var def=input.clone().wrap("").parent().html(),clone=$(def.replace(/type/i,"type=text data-orig-type"));clone.val(conf.value),input.replaceWith(clone),input=clone}input.addClass(css.input);var fire=$(self).add(input),fireOnSlide=!0;$.extend(self,{getValue:function(){return value},setValue:function(val,e){return init(),slide(e||$.Event("api"),void 0,val,!0)},getConf:function(){return conf},getProgress:function(){return progress},getHandle:function(){return handle},getInput:function(){return input},step:function(am,e){e=e||$.Event();var step="any"==conf.step?1:conf.step;self.setValue(value+step*(am||1),e)},stepUp:function(am){return self.step(am||1)},stepDown:function(am){return self.step(-am||-1)}}),$.each("onSlide,change".split(","),function(i,name){$.isFunction(conf[name])&&$(self).on(name,conf[name]),self[name]=function(fn){return fn&&$(self).on(name,fn),self}}),handle.drag({drag:!1}).on("dragStart",function(){init(),fireOnSlide=hasEvent($(self))||hasEvent(input)}).on("drag",function(e,y,x){return!input.is(":disabled")&&void slide(e,vertical?y:x)}).on("dragEnd",function(e){e.isDefaultPrevented()||(e.type="change",fire.trigger(e,[value]))}).click(function(e){return e.preventDefault()}),root.click(function(e){if(input.is(":disabled")||e.target==handle[0])return e.preventDefault();init();var fix=vertical?handle.height()/2:handle.width()/2;slide(e,vertical?len-origo-fix+e.pageY:e.pageX-origo-fix)}),conf.keyboard&&input.keydown(function(e){if(!input.attr("readonly")){var key=e.keyCode,up=$([75,76,38,33,39]).index(key)!=-1,down=$([74,72,40,34,37]).index(key)!=-1;return!up&&!down||e.shiftKey||e.altKey||e.ctrlKey?void 0:(up?self.step(33==key?10:1,e):down&&self.step(34==key?-10:-1,e),e.preventDefault())}}),input.blur(function(e){var val=$(this).val();val!==value&&self.setValue(val,e)}),$.extend(input[0],{stepUp:self.stepUp,stepDown:self.stepDown}),begin(),len||$(window).load(begin)}$.tools=$.tools||{version:"@VERSION"};var tool;tool=$.tools.rangeinput={conf:{min:0,max:100,step:"any",steps:0,value:0,precision:void 0,vertical:0,keyboard:!0,progress:!1,speed:100,css:{input:"range",slider:"slider",progress:"progress",handle:"handle"}}};var doc,draggable;$.fn.drag=function(conf){return document.ondragstart=function(){return!1},conf=$.extend({x:!0,y:!0,drag:!0},conf),doc=doc||$(document).on("mousedown mouseup",function(e){var el=$(e.target);if("mousedown"==e.type&&el.data("drag")){var offset=el.position(),x0=e.pageX-offset.left,y0=e.pageY-offset.top,start=!0;doc.on("mousemove.drag",function(e){var x=e.pageX-x0,y=e.pageY-y0,props={};conf.x&&(props.left=x),conf.y&&(props.top=y),start&&(el.trigger("dragStart"),start=!1),conf.drag&&el.css(props),el.trigger("drag",[y,x]),draggable=el}),e.preventDefault()}else try{draggable&&draggable.trigger("dragEnd")}finally{doc.off("mousemove.drag"),draggable=null}}),this.data("drag",!0)},$.expr[":"].range=function(el){var type=el.getAttribute("type");return type&&"range"==type||!!$(el).filter("input").data("rangeinput")},$.fn.rangeinput=function(conf){if(this.data("rangeinput"))return this;conf=$.extend(!0,{},tool.conf,conf);var els;return this.each(function(){var el=new RangeInput($(this),$.extend(!0,{},conf)),input=el.getInput().data("rangeinput",el);els=els?els.add(input):input}),els?els:this}}(jQuery); \ No newline at end of file diff --git a/plone/app/jquerytools/browser/jquery.tools.tooltip.min.js b/plone/app/jquerytools/browser/jquery.tools.tooltip.min.js index e933be2..88eb5b1 100644 --- a/plone/app/jquerytools/browser/jquery.tools.tooltip.min.js +++ b/plone/app/jquerytools/browser/jquery.tools.tooltip.min.js @@ -1 +1 @@ -!function($){function getPosition(trigger,tip,conf){var top=conf.relative?trigger.position().top:trigger.offset().top,left=conf.relative?trigger.position().left:trigger.offset().left,pos=conf.position[0];top-=tip.outerHeight()-conf.offset[0],left+=trigger.outerWidth()+conf.offset[1],/iPad/i.test(navigator.userAgent)&&(top-=$(window).scrollTop());var height=tip.outerHeight()+trigger.outerHeight();"center"==pos&&(top+=height/2),"bottom"==pos&&(top+=height),pos=conf.position[1];var width=tip.outerWidth()+trigger.outerWidth();return"center"==pos&&(left-=width/2),"left"==pos&&(left-=width),{top:top,left:left}}function Tooltip(trigger,conf){var tip,shown,self=this,fire=trigger.add(self),timer=0,pretimer=0,title=trigger.attr("title"),tipAttr=trigger.attr("data-tooltip"),effect=effects[conf.effect],isInput=trigger.is(":input"),isWidget=isInput&&trigger.is(":checkbox, :radio, select, :button, :submit"),type=trigger.attr("type"),evt=conf.events[type]||conf.events[isInput?isWidget?"widget":"input":"def"];if(!effect)throw'Nonexistent effect "'+conf.effect+'"';if(evt=evt.split(/,\s*/),2!=evt.length)throw"Tooltip: bad events configuration for "+type;trigger.on(evt[0],function(e){clearTimeout(timer),conf.predelay?pretimer=setTimeout(function(){self.show(e)},conf.predelay):self.show(e)}).on(evt[1],function(e){clearTimeout(pretimer),conf.delay?timer=setTimeout(function(){self.hide(e)},conf.delay):self.hide(e)}),title&&conf.cancelDefault&&(trigger.removeAttr("title"),trigger.data("title",title)),$.extend(self,{show:function(e){if(!tip&&(tipAttr?tip=$(tipAttr):conf.tip?tip=$(conf.tip).eq(0):title?tip=$(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide().append(title):(tip=trigger.find("."+conf.tipClass),tip.length||(tip=trigger.next()),tip.length||(tip=trigger.parent().next())),!tip.length))throw"Cannot find tooltip for "+trigger;if(self.isShown())return self;tip.stop(!0,!0);var pos=getPosition(trigger,tip,conf);if(conf.tip&&tip.html(trigger.data("title")),e=$.Event(),e.type="onBeforeShow",fire.trigger(e,[pos]),e.isDefaultPrevented())return self;pos=getPosition(trigger,tip,conf),tip.css({position:"absolute",top:pos.top,left:pos.left}),shown=!0,effect[0].call(self,function(){e.type="onShow",shown="full",fire.trigger(e)});var event=conf.events.tooltip.split(/,\s*/);return tip.data("__set")||(tip.off(event[0]).on(event[0],function(){clearTimeout(timer),clearTimeout(pretimer)}),event[1]&&!trigger.is("input:not(:checkbox, :radio), textarea")&&tip.off(event[1]).on(event[1],function(e){e.relatedTarget!=trigger[0]&&trigger.trigger(evt[1].split(" ")[0])}),conf.tip||tip.data("__set",!0)),self},hide:function(e){return tip&&self.isShown()?(e=$.Event(),e.type="onBeforeHide",fire.trigger(e),e.isDefaultPrevented()?void 0:(shown=!1,effects[conf.effect][1].call(self,function(){e.type="onHide",fire.trigger(e)}),self)):self},isShown:function(fully){return fully?"full"==shown:shown},getConf:function(){return conf},getTip:function(){return tip},getTrigger:function(){return trigger}}),$.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(i,name){$.isFunction(conf[name])&&$(self).on(name,conf[name]),self[name]=function(fn){return fn&&$(self).on(name,fn),self}})}$.tools=$.tools||{version:"@VERSION"},$.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"",tipClass:"tooltip"},addEffect:function(name,loadFn,hideFn){effects[name]=[loadFn,hideFn]}};var effects={toggle:[function(done){var conf=this.getConf(),tip=this.getTip(),o=conf.opacity;1>o&&tip.css({opacity:o}),tip.show(),done.call()},function(done){this.getTip().hide(),done.call()}],fade:[function(done){var conf=this.getConf();!/msie/.test(navigator.userAgent.toLowerCase())||conf.fadeIE?this.getTip().fadeTo(conf.fadeInSpeed,conf.opacity,done):(this.getTip().show(),done())},function(done){var conf=this.getConf();!/msie/.test(navigator.userAgent.toLowerCase())||conf.fadeIE?this.getTip().fadeOut(conf.fadeOutSpeed,done):(this.getTip().hide(),done())}]};$.fn.tooltip=function(conf){var api=this.data("tooltip");return api?api:(conf=$.extend(!0,{},$.tools.tooltip.conf,conf),"string"==typeof conf.position&&(conf.position=conf.position.split(/,?\s/)),this.each(function(){api=new Tooltip($(this),conf),$(this).data("tooltip",api)}),conf.api?api:this)}}(jQuery); \ No newline at end of file +!function($){function getPosition(trigger,tip,conf){var top=conf.relative?trigger.position().top:trigger.offset().top,left=conf.relative?trigger.position().left:trigger.offset().left,pos=conf.position[0];top-=tip.outerHeight()-conf.offset[0],left+=trigger.outerWidth()+conf.offset[1],/iPad/i.test(navigator.userAgent)&&(top-=$(window).scrollTop());var height=tip.outerHeight()+trigger.outerHeight();"center"==pos&&(top+=height/2),"bottom"==pos&&(top+=height),pos=conf.position[1];var width=tip.outerWidth()+trigger.outerWidth();return"center"==pos&&(left-=width/2),"left"==pos&&(left-=width),{top:top,left:left}}function Tooltip(trigger,conf){var tip,shown,self=this,fire=trigger.add(self),timer=0,pretimer=0,title=trigger.attr("title"),tipAttr=trigger.attr("data-tooltip"),effect=effects[conf.effect],isInput=trigger.is(":input"),isWidget=isInput&&trigger.is(":checkbox, :radio, select, :button, :submit"),type=trigger.attr("type"),evt=conf.events[type]||conf.events[isInput?isWidget?"widget":"input":"def"];if(!effect)throw'Nonexistent effect "'+conf.effect+'"';if(evt=evt.split(/,\s*/),2!=evt.length)throw"Tooltip: bad events configuration for "+type;trigger.on(evt[0],function(e){clearTimeout(timer),conf.predelay?pretimer=setTimeout(function(){self.show(e)},conf.predelay):self.show(e)}).on(evt[1],function(e){clearTimeout(pretimer),conf.delay?timer=setTimeout(function(){self.hide(e)},conf.delay):self.hide(e)}),title&&conf.cancelDefault&&(trigger.removeAttr("title"),trigger.data("title",title)),$.extend(self,{show:function(e){if(!tip&&(tipAttr?tip=$(tipAttr):conf.tip?tip=$(conf.tip).eq(0):title?tip=$(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide().append(title):(tip=trigger.find("."+conf.tipClass),tip.length||(tip=trigger.next()),tip.length||(tip=trigger.parent().next())),!tip.length))throw"Cannot find tooltip for "+trigger;if(self.isShown())return self;tip.stop(!0,!0);var pos=getPosition(trigger,tip,conf);if(conf.tip&&tip.html(trigger.data("title")),e=$.Event(),e.type="onBeforeShow",fire.trigger(e,[pos]),e.isDefaultPrevented())return self;pos=getPosition(trigger,tip,conf),tip.css({position:"absolute",top:pos.top,left:pos.left}),shown=!0,effect[0].call(self,function(){e.type="onShow",shown="full",fire.trigger(e)});var event=conf.events.tooltip.split(/,\s*/);return tip.data("__set")||(tip.off(event[0]).on(event[0],function(){clearTimeout(timer),clearTimeout(pretimer)}),event[1]&&!trigger.is("input:not(:checkbox, :radio), textarea")&&tip.off(event[1]).on(event[1],function(e){e.relatedTarget!=trigger[0]&&trigger.trigger(evt[1].split(" ")[0])}),conf.tip||tip.data("__set",!0)),self},hide:function(e){return tip&&self.isShown()?(e=$.Event(),e.type="onBeforeHide",fire.trigger(e),e.isDefaultPrevented()?void 0:(shown=!1,effects[conf.effect][1].call(self,function(){e.type="onHide",fire.trigger(e)}),self)):self},isShown:function(fully){return fully?"full"==shown:shown},getConf:function(){return conf},getTip:function(){return tip},getTrigger:function(){return trigger}}),$.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(i,name){$.isFunction(conf[name])&&$(self).on(name,conf[name]),self[name]=function(fn){return fn&&$(self).on(name,fn),self}})}$.tools=$.tools||{version:"@VERSION"},$.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"",tipClass:"tooltip"},addEffect:function(name,loadFn,hideFn){effects[name]=[loadFn,hideFn]}};var effects={toggle:[function(done){var conf=this.getConf(),tip=this.getTip(),o=conf.opacity;o<1&&tip.css({opacity:o}),tip.show(),done.call()},function(done){this.getTip().hide(),done.call()}],fade:[function(done){var conf=this.getConf();!/msie/.test(navigator.userAgent.toLowerCase())||conf.fadeIE?this.getTip().fadeTo(conf.fadeInSpeed,conf.opacity,done):(this.getTip().show(),done())},function(done){var conf=this.getConf();!/msie/.test(navigator.userAgent.toLowerCase())||conf.fadeIE?this.getTip().fadeOut(conf.fadeOutSpeed,done):(this.getTip().hide(),done())}]};$.fn.tooltip=function(conf){var api=this.data("tooltip");return api?api:(conf=$.extend(!0,{},$.tools.tooltip.conf,conf),"string"==typeof conf.position&&(conf.position=conf.position.split(/,?\s/)),this.each(function(){api=new Tooltip($(this),conf),$(this).data("tooltip",api)}),conf.api?api:this)}}(jQuery); \ No newline at end of file diff --git a/plone/app/jquerytools/browser/jquery.tools.tooltip.plugins.min.js b/plone/app/jquerytools/browser/jquery.tools.tooltip.plugins.min.js index 607c200..d6c82aa 100644 --- a/plone/app/jquerytools/browser/jquery.tools.tooltip.plugins.min.js +++ b/plone/app/jquerytools/browser/jquery.tools.tooltip.plugins.min.js @@ -1 +1 @@ -!function($){function getCropping(el){var w=$(window),right=w.width()+w.scrollLeft(),bottom=w.height()+w.scrollTop();return[el.offset().top<=w.scrollTop(),right<=el.offset().left+el.width(),bottom<=el.offset().top+el.height(),w.scrollLeft()>=el.offset().left]}function isVisible(crop){for(var i=crop.length;i--;)if(crop[i])return!1;return!0}var t=$.tools.tooltip;t.dynamic={conf:{classNames:"top right bottom left"}},$.fn.dynamic=function(conf){"number"==typeof conf&&(conf={speed:conf}),conf=$.extend({},t.dynamic.conf,conf);var orig,ret,confOrigin=$.extend(!0,{},conf),cls=conf.classNames.split(/\s/);return this.each(function(){var api=$(this).tooltip().onBeforeShow(function(e,pos){var tip=this.getTip(),tipConf=this.getConf();orig||(orig=[tipConf.position[0],tipConf.position[1],tipConf.offset[0],tipConf.offset[1],$.extend({},tipConf)]),$.extend(tipConf,orig[4]),tipConf.position=[orig[0],orig[1]],tipConf.offset=[orig[2],orig[3]],tip.css({visibility:"hidden",position:"absolute",top:pos.top,left:pos.left}).show();var conf=$.extend(!0,{},confOrigin),crop=getCropping(tip);isVisible(crop)||(crop[2]&&($.extend(tipConf,conf.top),tipConf.position[0]="top",tip.addClass(cls[0])),crop[3]&&($.extend(tipConf,conf.right),tipConf.position[1]="right",tip.addClass(cls[1])),crop[0]&&($.extend(tipConf,conf.bottom),tipConf.position[0]="bottom",tip.addClass(cls[2])),crop[1]&&($.extend(tipConf,conf.left),tipConf.position[1]="left",tip.addClass(cls[3])),(crop[0]||crop[2])&&(tipConf.offset[0]*=-1),(crop[1]||crop[3])&&(tipConf.offset[1]*=-1)),tip.css({visibility:"visible"}).hide()});api.onBeforeShow(function(){{var c=this.getConf();this.getTip()}setTimeout(function(){c.position=[orig[0],orig[1]],c.offset=[orig[2],orig[3]]},0)}),api.onHide(function(){var tip=this.getTip();tip.removeClass(conf.classNames)}),ret=api}),conf.api?ret:this}}(jQuery),function($){var t=$.tools.tooltip;$.extend(t.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!/msie/.test(navigator.userAgent.toLowerCase())});var dirs={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};t.addEffect("slide",function(done){var conf=this.getConf(),tip=this.getTip(),params=conf.slideFade?{opacity:conf.opacity}:{},dir=dirs[conf.direction]||dirs.up;params[dir[1]]=dir[0]+"="+conf.slideOffset,conf.slideFade&&tip.css({opacity:0}),tip.show().animate(params,conf.slideInSpeed,done)},function(done){var conf=this.getConf(),offset=conf.slideOffset,params=conf.slideFade?{opacity:0}:{},dir=dirs[conf.direction]||dirs.up,sign=""+dir[0];conf.bounce&&(sign="+"==sign?"-":"+"),params[dir[1]]=sign+"="+offset,this.getTip().animate(params,conf.slideOutSpeed,function(){$(this).hide(),done.call()})})}(jQuery); \ No newline at end of file +!function($){function getCropping(el){var w=$(window),right=w.width()+w.scrollLeft(),bottom=w.height()+w.scrollTop();return[el.offset().top<=w.scrollTop(),right<=el.offset().left+el.width(),bottom<=el.offset().top+el.height(),w.scrollLeft()>=el.offset().left]}function isVisible(crop){for(var i=crop.length;i--;)if(crop[i])return!1;return!0}var t=$.tools.tooltip;t.dynamic={conf:{classNames:"top right bottom left"}},$.fn.dynamic=function(conf){"number"==typeof conf&&(conf={speed:conf}),conf=$.extend({},t.dynamic.conf,conf);var orig,ret,confOrigin=$.extend(!0,{},conf),cls=conf.classNames.split(/\s/);return this.each(function(){var api=$(this).tooltip().onBeforeShow(function(e,pos){var tip=this.getTip(),tipConf=this.getConf();orig||(orig=[tipConf.position[0],tipConf.position[1],tipConf.offset[0],tipConf.offset[1],$.extend({},tipConf)]),$.extend(tipConf,orig[4]),tipConf.position=[orig[0],orig[1]],tipConf.offset=[orig[2],orig[3]],tip.css({visibility:"hidden",position:"absolute",top:pos.top,left:pos.left}).show();var conf=$.extend(!0,{},confOrigin),crop=getCropping(tip);isVisible(crop)||(crop[2]&&($.extend(tipConf,conf.top),tipConf.position[0]="top",tip.addClass(cls[0])),crop[3]&&($.extend(tipConf,conf.right),tipConf.position[1]="right",tip.addClass(cls[1])),crop[0]&&($.extend(tipConf,conf.bottom),tipConf.position[0]="bottom",tip.addClass(cls[2])),crop[1]&&($.extend(tipConf,conf.left),tipConf.position[1]="left",tip.addClass(cls[3])),(crop[0]||crop[2])&&(tipConf.offset[0]*=-1),(crop[1]||crop[3])&&(tipConf.offset[1]*=-1)),tip.css({visibility:"visible"}).hide()});api.onBeforeShow(function(){var c=this.getConf();this.getTip();setTimeout(function(){c.position=[orig[0],orig[1]],c.offset=[orig[2],orig[3]]},0)}),api.onHide(function(){var tip=this.getTip();tip.removeClass(conf.classNames)}),ret=api}),conf.api?ret:this}}(jQuery),function($){var t=$.tools.tooltip;$.extend(t.conf,{direction:"up",bounce:!1,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!/msie/.test(navigator.userAgent.toLowerCase())});var dirs={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};t.addEffect("slide",function(done){var conf=this.getConf(),tip=this.getTip(),params=conf.slideFade?{opacity:conf.opacity}:{},dir=dirs[conf.direction]||dirs.up;params[dir[1]]=dir[0]+"="+conf.slideOffset,conf.slideFade&&tip.css({opacity:0}),tip.show().animate(params,conf.slideInSpeed,done)},function(done){var conf=this.getConf(),offset=conf.slideOffset,params=conf.slideFade?{opacity:0}:{},dir=dirs[conf.direction]||dirs.up,sign=""+dir[0];conf.bounce&&(sign="+"==sign?"-":"+"),params[dir[1]]=sign+"="+offset,this.getTip().animate(params,conf.slideOutSpeed,function(){$(this).hide(),done.call()})})}(jQuery); \ No newline at end of file diff --git a/plone/app/jquerytools/browser/jquery.tools.validator.min.js b/plone/app/jquerytools/browser/jquery.tools.validator.min.js index 7c6953a..47fa188 100644 --- a/plone/app/jquerytools/browser/jquery.tools.validator.min.js +++ b/plone/app/jquerytools/browser/jquery.tools.validator.min.js @@ -1 +1 @@ -!function($){function getPosition(trigger,el,conf){el=$(el).first()||el;var top=trigger.offset().top,left=trigger.offset().left,pos=conf.position.split(/,?\s+/),y=pos[0],x=pos[1];top-=el.outerHeight()-conf.offset[0],left+=trigger.outerWidth()+conf.offset[1],/iPad/i.test(navigator.userAgent)&&(top-=$(window).scrollTop());var height=el.outerHeight()+trigger.outerHeight();"center"==y&&(top+=height/2),"bottom"==y&&(top+=height);var width=trigger.outerWidth();return"center"==x&&(left-=(width+el.outerWidth())/2),"left"==x&&(left-=width),{top:top,left:left}}function isType(type){function fn(){return this.getAttribute("type")==type}return fn.key='[type="'+type+'"]',fn}function Validator(inputs,form,conf){function pushMessage(to,matcher,returnValue){if(conf.grouped||!to.length){var msg;if(returnValue===!1||$.isArray(returnValue)){msg=v.messages[matcher.key||matcher]||v.messages["*"],msg=msg[conf.lang]||v.messages["*"].en;var matches=msg.match(/\$\d/g);matches&&$.isArray(returnValue)&&$.each(matches,function(i){msg=msg.replace(this,returnValue[i])})}else msg=returnValue[conf.lang]||returnValue;to.push(msg)}}var self=this,fire=form.add(self);inputs=inputs.not(":button, :image, :reset, :submit"),form.attr("novalidate","novalidate"),$.extend(self,{getConf:function(){return conf},getForm:function(){return form},getInputs:function(){return inputs},reflow:function(){return inputs.each(function(){var input=$(this),msg=input.data("msg.el");if(msg){var pos=getPosition(input,msg,conf);msg.css({top:pos.top,left:pos.left})}}),self},invalidate:function(errs,e){if(!e){var errors=[];$.each(errs,function(key,val){var input=inputs.filter("[name='"+key+"']");input.length&&(input.trigger("OI",[val]),errors.push({input:input,messages:[val]}))}),errs=errors,e=$.Event()}return e.type="onFail",fire.trigger(e,[errs]),e.isDefaultPrevented()||effects[conf.effect][0].call(self,errs,e),self},reset:function(els){return els=els||inputs,els.removeClass(conf.errorClass).each(function(){var msg=$(this).data("msg.el");msg&&(msg.remove(),$(this).data("msg.el",null))}).off(conf.errorInputEvent+".v"||""),self},destroy:function(){return form.off(conf.formEvent+".V reset.V"),inputs.off(conf.inputEvent+".V change.V"),self.reset()},checkValidity:function(els,e){els=els||inputs,els=els.not(":disabled");var names={};if(els=els.filter(function(){var name=$(this).attr("name");return names[name]?void 0:(names[name]=!0,$(this))}),!els.length)return!0;if(e=e||$.Event(),e.type="onBeforeValidate",fire.trigger(e,[els]),e.isDefaultPrevented())return e.result;var errs=[];els.each(function(){var msgs=[],el=$(this).data("messages",msgs),event=dateInput&&el.is(":date")?"onHide.v":conf.errorInputEvent+".v";return el.off(event),$.each(fns,function(){var fn=this,match=fn[0];if(el.filter(match).length){var returnValue=fn[1].call(self,el,el.val());if(returnValue!==!0){if(e.type="onBeforeFail",fire.trigger(e,[el,match]),e.isDefaultPrevented())return!1;var msg=el.attr(conf.messageAttr);if(msg)return msgs=[msg],!1;pushMessage(msgs,match,returnValue)}}}),msgs.length&&(errs.push({input:el,messages:msgs}),el.trigger("OI",[msgs]),conf.errorInputEvent&&el.on(event,function(e){self.checkValidity(el,e)})),conf.singleError&&errs.length?!1:void 0});var eff=effects[conf.effect];if(!eff)throw'Validator: cannot find effect "'+conf.effect+'"';return errs.length?(self.invalidate(errs,e),!1):(eff[1].call(self,els,e),e.type="onSuccess",fire.trigger(e,[els]),els.off(conf.errorInputEvent+".v"),!0)}}),$.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","),function(i,name){$.isFunction(conf[name])&&$(self).on(name,conf[name]),self[name]=function(fn){return fn&&$(self).on(name,fn),self}}),conf.formEvent&&form.on(conf.formEvent+".V",function(e){return self.checkValidity(null,e)?(e.target=form,void(e.type=conf.formEvent)):e.preventDefault()}),form.on("reset.V",function(){self.reset()}),inputs[0]&&inputs[0].validity&&inputs.each(function(){this.oninvalid=function(){return!1}}),form[0]&&(form[0].checkValidity=self.checkValidity),conf.inputEvent&&inputs.on(conf.inputEvent+".V",function(e){self.checkValidity($(this),e)}),inputs.filter(":checkbox, select").filter("[required]").on("change.V",function(e){var el=$(this);(this.checked||el.is("select")&&$(this).val())&&effects[conf.effect][1].call(self,el,e)}),inputs.filter(":radio[required]").on("change.V",function(e){var els=$("[name='"+$(e.srcElement).attr("name")+"']");null!=els&&0!=els.length&&self.checkValidity(els,e)}),$(window).resize(function(){self.reflow()})}$.tools=$.tools||{version:"@VERSION"};var v,typeRe=/\[type=([a-z]+)\]/,numRe=/^-?[0-9]*(\.[0-9]+)?$/,dateInput=$.tools.dateinput,emailRe=/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,urlRe=/^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i;v=$.tools.validator={conf:{grouped:!1,effect:"default",errorClass:"invalid",inputEvent:null,errorInputEvent:"keyup",formEvent:"submit",lang:"en",message:"",messageAttr:"data-message",messageClass:"error",offset:[0,0],position:"center right",singleError:!1,speed:"normal"},messages:{"*":{en:"Please correct this value"}},localize:function(lang,messages){$.each(messages,function(key,msg){v.messages[key]=v.messages[key]||{},v.messages[key][lang]=msg})},localizeFn:function(key,messages){v.messages[key]=v.messages[key]||{},$.extend(v.messages[key],messages)},fn:function(matcher,msg,fn){$.isFunction(msg)?fn=msg:("string"==typeof msg&&(msg={en:msg}),this.messages[matcher.key||matcher]=msg);var test=typeRe.exec(matcher);test&&(matcher=isType(test[1])),fns.push([matcher,fn])},addEffect:function(name,showFn,closeFn){effects[name]=[showFn,closeFn]}};var fns=[],effects={"default":[function(errs){var conf=this.getConf();$.each(errs,function(i,err){var input=err.input;input.addClass(conf.errorClass);var msg=input.data("msg.el");msg||(msg=$(conf.message).addClass(conf.messageClass).appendTo(document.body),input.data("msg.el",msg)),msg.css({visibility:"hidden"}).find("p").remove(),$.each(err.messages,function(i,m){$("").html(m).appendTo(msg)}),msg.outerWidth()==msg.parent().width()&&msg.add(msg.find("p")).css({display:"inline"});var pos=getPosition(input,msg,conf);msg.css({visibility:"visible",position:"absolute",top:pos.top,left:pos.left}).fadeIn(conf.speed)})},function(inputs){var conf=this.getConf();inputs.removeClass(conf.errorClass).each(function(){var msg=$(this).data("msg.el");msg&&msg.css({visibility:"hidden"})})}]};$.each("email,url,number".split(","),function(i,key){$.expr[":"][key]=function(el){return el.getAttribute("type")===key}}),$.fn.oninvalid=function(fn){return this[fn?"on":"trigger"]("OI",fn)},v.fn(":email","Please enter a valid email address",function(el,v){return!v||emailRe.test(v)}),v.fn(":url","Please enter a valid URL",function(el,v){return!v||urlRe.test(v)}),v.fn(":number","Please enter a numeric value.",function(el,v){return numRe.test(v)}),v.fn("[max]","Please enter a value no larger than $1",function(el,v){if(""===v||dateInput&&el.is(":date"))return!0;var max=el.attr("max");return parseFloat(v)<=parseFloat(max)?!0:[max]}),v.fn("[min]","Please enter a value of at least $1",function(el,v){if(""===v||dateInput&&el.is(":date"))return!0;var min=el.attr("min");return parseFloat(v)>=parseFloat(min)?!0:[min]}),v.fn("[required]","Please complete this mandatory field.",function(el,v){return el.is(":checkbox")?el.is(":checked"):!!v}),v.fn("[pattern]",function(el,v){return""===v||new RegExp("^"+el.attr("pattern")+"$").test(v)}),v.fn(":radio[required]","Please select an option.",function(el){{var checked=!1;$("[name='"+el.attr("name")+"']").each(function(i,el){($(el).is(":checked")||checked)&&(checked=!0)})}return checked?!0:!1}),$.fn.validator=function(conf){var instance=this.data("validator");return instance&&(instance.destroy(),this.removeData("validator")),conf=$.extend(!0,{},v.conf,conf),this.is("form")?this.each(function(){var form=$(this);instance=new Validator(form.find(":input"),form,conf),form.data("validator",instance)}):(instance=new Validator(this,this.eq(0).closest("form"),conf),this.data("validator",instance))}}(jQuery); \ No newline at end of file +!function($){function getPosition(trigger,el,conf){el=$(el).first()||el;var top=trigger.offset().top,left=trigger.offset().left,pos=conf.position.split(/,?\s+/),y=pos[0],x=pos[1];top-=el.outerHeight()-conf.offset[0],left+=trigger.outerWidth()+conf.offset[1],/iPad/i.test(navigator.userAgent)&&(top-=$(window).scrollTop());var height=el.outerHeight()+trigger.outerHeight();"center"==y&&(top+=height/2),"bottom"==y&&(top+=height);var width=trigger.outerWidth();return"center"==x&&(left-=(width+el.outerWidth())/2),"left"==x&&(left-=width),{top:top,left:left}}function isType(type){function fn(){return this.getAttribute("type")==type}return fn.key='[type="'+type+'"]',fn}function Validator(inputs,form,conf){function pushMessage(to,matcher,returnValue){if(conf.grouped||!to.length){var msg;if(returnValue===!1||$.isArray(returnValue)){msg=v.messages[matcher.key||matcher]||v.messages["*"],msg=msg[conf.lang]||v.messages["*"].en;var matches=msg.match(/\$\d/g);matches&&$.isArray(returnValue)&&$.each(matches,function(i){msg=msg.replace(this,returnValue[i])})}else msg=returnValue[conf.lang]||returnValue;to.push(msg)}}var self=this,fire=form.add(self);inputs=inputs.not(":button, :image, :reset, :submit"),form.attr("novalidate","novalidate"),$.extend(self,{getConf:function(){return conf},getForm:function(){return form},getInputs:function(){return inputs},reflow:function(){return inputs.each(function(){var input=$(this),msg=input.data("msg.el");if(msg){var pos=getPosition(input,msg,conf);msg.css({top:pos.top,left:pos.left})}}),self},invalidate:function(errs,e){if(!e){var errors=[];$.each(errs,function(key,val){var input=inputs.filter("[name='"+key+"']");input.length&&(input.trigger("OI",[val]),errors.push({input:input,messages:[val]}))}),errs=errors,e=$.Event()}return e.type="onFail",fire.trigger(e,[errs]),e.isDefaultPrevented()||effects[conf.effect][0].call(self,errs,e),self},reset:function(els){return els=els||inputs,els.removeClass(conf.errorClass).each(function(){var msg=$(this).data("msg.el");msg&&(msg.remove(),$(this).data("msg.el",null))}).off(conf.errorInputEvent+".v"||""),self},destroy:function(){return form.off(conf.formEvent+".V reset.V"),inputs.off(conf.inputEvent+".V change.V"),self.reset()},checkValidity:function(els,e){els=els||inputs,els=els.not(":disabled");var names={};if(els=els.filter(function(){var name=$(this).attr("name");if(!names[name])return names[name]=!0,$(this)}),!els.length)return!0;if(e=e||$.Event(),e.type="onBeforeValidate",fire.trigger(e,[els]),e.isDefaultPrevented())return e.result;var errs=[];els.each(function(){var msgs=[],el=$(this).data("messages",msgs),event=dateInput&&el.is(":date")?"onHide.v":conf.errorInputEvent+".v";if(el.off(event),$.each(fns,function(){var fn=this,match=fn[0];if(el.filter(match).length){var returnValue=fn[1].call(self,el,el.val());if(returnValue!==!0){if(e.type="onBeforeFail",fire.trigger(e,[el,match]),e.isDefaultPrevented())return!1;var msg=el.attr(conf.messageAttr);if(msg)return msgs=[msg],!1;pushMessage(msgs,match,returnValue)}}}),msgs.length&&(errs.push({input:el,messages:msgs}),el.trigger("OI",[msgs]),conf.errorInputEvent&&el.on(event,function(e){self.checkValidity(el,e)})),conf.singleError&&errs.length)return!1});var eff=effects[conf.effect];if(!eff)throw'Validator: cannot find effect "'+conf.effect+'"';return errs.length?(self.invalidate(errs,e),!1):(eff[1].call(self,els,e),e.type="onSuccess",fire.trigger(e,[els]),els.off(conf.errorInputEvent+".v"),!0)}}),$.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","),function(i,name){$.isFunction(conf[name])&&$(self).on(name,conf[name]),self[name]=function(fn){return fn&&$(self).on(name,fn),self}}),conf.formEvent&&form.on(conf.formEvent+".V",function(e){return self.checkValidity(null,e)?(e.target=form,void(e.type=conf.formEvent)):e.preventDefault()}),form.on("reset.V",function(){self.reset()}),inputs[0]&&inputs[0].validity&&inputs.each(function(){this.oninvalid=function(){return!1}}),form[0]&&(form[0].checkValidity=self.checkValidity),conf.inputEvent&&inputs.on(conf.inputEvent+".V",function(e){self.checkValidity($(this),e)}),inputs.filter(":checkbox, select").filter("[required]").on("change.V",function(e){var el=$(this);(this.checked||el.is("select")&&$(this).val())&&effects[conf.effect][1].call(self,el,e)}),inputs.filter(":radio[required]").on("change.V",function(e){var els=$("[name='"+$(e.srcElement).attr("name")+"']");null!=els&&0!=els.length&&self.checkValidity(els,e)}),$(window).resize(function(){self.reflow()})}$.tools=$.tools||{version:"@VERSION"};var v,typeRe=/\[type=([a-z]+)\]/,numRe=/^-?[0-9]*(\.[0-9]+)?$/,dateInput=$.tools.dateinput,emailRe=/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,urlRe=/^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i;v=$.tools.validator={conf:{grouped:!1,effect:"default",errorClass:"invalid",inputEvent:null,errorInputEvent:"keyup",formEvent:"submit",lang:"en",message:"",messageAttr:"data-message",messageClass:"error",offset:[0,0],position:"center right",singleError:!1,speed:"normal"},messages:{"*":{en:"Please correct this value"}},localize:function(lang,messages){$.each(messages,function(key,msg){v.messages[key]=v.messages[key]||{},v.messages[key][lang]=msg})},localizeFn:function(key,messages){v.messages[key]=v.messages[key]||{},$.extend(v.messages[key],messages)},fn:function(matcher,msg,fn){$.isFunction(msg)?fn=msg:("string"==typeof msg&&(msg={en:msg}),this.messages[matcher.key||matcher]=msg);var test=typeRe.exec(matcher);test&&(matcher=isType(test[1])),fns.push([matcher,fn])},addEffect:function(name,showFn,closeFn){effects[name]=[showFn,closeFn]}};var fns=[],effects={default:[function(errs){var conf=this.getConf();$.each(errs,function(i,err){var input=err.input;input.addClass(conf.errorClass);var msg=input.data("msg.el");msg||(msg=$(conf.message).addClass(conf.messageClass).appendTo(document.body),input.data("msg.el",msg)),msg.css({visibility:"hidden"}).find("p").remove(),$.each(err.messages,function(i,m){$("").html(m).appendTo(msg)}),msg.outerWidth()==msg.parent().width()&&msg.add(msg.find("p")).css({display:"inline"});var pos=getPosition(input,msg,conf);msg.css({visibility:"visible",position:"absolute",top:pos.top,left:pos.left}).fadeIn(conf.speed)})},function(inputs){var conf=this.getConf();inputs.removeClass(conf.errorClass).each(function(){var msg=$(this).data("msg.el");msg&&msg.css({visibility:"hidden"})})}]};$.each("email,url,number".split(","),function(i,key){$.expr[":"][key]=function(el){return el.getAttribute("type")===key}}),$.fn.oninvalid=function(fn){return this[fn?"on":"trigger"]("OI",fn)},v.fn(":email","Please enter a valid email address",function(el,v){return!v||emailRe.test(v)}),v.fn(":url","Please enter a valid URL",function(el,v){return!v||urlRe.test(v)}),v.fn(":number","Please enter a numeric value.",function(el,v){return numRe.test(v)}),v.fn("[max]","Please enter a value no larger than $1",function(el,v){if(""===v||dateInput&&el.is(":date"))return!0;var max=el.attr("max");return parseFloat(v)<=parseFloat(max)||[max]}),v.fn("[min]","Please enter a value of at least $1",function(el,v){if(""===v||dateInput&&el.is(":date"))return!0;var min=el.attr("min");return parseFloat(v)>=parseFloat(min)||[min]}),v.fn("[required]","Please complete this mandatory field.",function(el,v){return el.is(":checkbox")?el.is(":checked"):!!v}),v.fn("[pattern]",function(el,v){return""===v||new RegExp("^"+el.attr("pattern")+"$").test(v)}),v.fn(":radio[required]","Please select an option.",function(el){var checked=!1;$("[name='"+el.attr("name")+"']").each(function(i,el){($(el).is(":checked")||checked)&&(checked=!0)});return!!checked}),$.fn.validator=function(conf){var instance=this.data("validator");return instance&&(instance.destroy(),this.removeData("validator")),conf=$.extend(!0,{},v.conf,conf),this.is("form")?this.each(function(){var form=$(this);instance=new Validator(form.find(":input"),form,conf),form.data("validator",instance)}):(instance=new Validator(this,this.eq(0).closest("form"),conf),this.data("validator",instance))}}(jQuery); \ No newline at end of file