code
stringlengths
501
5.19M
package
stringlengths
2
81
path
stringlengths
9
304
filename
stringlengths
4
145
(function(e){var c={};c.fileapi=e("<input type='file'/>").get(0).files!==undefined;c.formdata=window.FormData!==undefined;e.fn.ajaxSubmit=function(h){if(!this.length){d("ajaxSubmit: skipping submit process - no element selected");return this}var g,y,j,m=this;if(typeof h=="function"){h={success:h}}g=this.attr("method");y=this.attr("action");j=(typeof y==="string")?e.trim(y):"";j=j||window.location.href||"";if(j){j=(j.match(/^([^#]+)/)||[])[1]}h=e.extend(true,{url:j,success:e.ajaxSettings.success,type:g||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},h);var s={};this.trigger("form-pre-serialize",[this,h,s]);if(s.veto){d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(h.beforeSerialize&&h.beforeSerialize(this,h)===false){d("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var l=h.traditional;if(l===undefined){l=e.ajaxSettings.traditional}var p=[];var B,C=this.formToArray(h.semantic,p);if(h.data){h.extraData=h.data;B=e.param(h.data,l)}if(h.beforeSubmit&&h.beforeSubmit(C,this,h)===false){d("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[C,this,h,s]);if(s.veto){d("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var w=e.param(C,l);if(B){w=(w?(w+"&"+B):B)}if(h.type.toUpperCase()=="GET"){h.url+=(h.url.indexOf("?")>=0?"&":"?")+w;h.data=null}else{h.data=w}var E=[];if(h.resetForm){E.push(function(){m.resetForm()})}if(h.clearForm){E.push(function(){m.clearForm(h.includeHidden)})}if(!h.dataType&&h.target){var i=h.success||function(){};E.push(function(q){var k=h.replaceTarget?"replaceWith":"html";e(h.target)[k](q).each(i,arguments)})}else{if(h.success){E.push(h.success)}}h.success=function(H,q,I){var G=h.context||this;for(var F=0,k=E.length;F<k;F++){E[F].apply(G,[H,q,I||m,m])}};var A=e('input[type=file]:enabled[value!=""]',this);var n=A.length>0;var z="multipart/form-data";var v=(m.attr("enctype")==z||m.attr("encoding")==z);var u=c.fileapi&&c.formdata;d("fileAPI :"+u);var o=(n||v)&&!u;var t;if(h.iframe!==false&&(h.iframe||o)){if(h.closeKeepAlive){e.get(h.closeKeepAlive,function(){t=D(C)})}else{t=D(C)}}else{if((n||v)&&u){t=r(C)}else{t=e.ajax(h)}}m.removeData("jqxhr").data("jqxhr",t);for(var x=0;x<p.length;x++){p[x]=null}this.trigger("form-submit-notify",[this,h]);return this;function f(H){var I=e.param(H).split("&");var q=I.length;var k=[];var G,F;for(G=0;G<q;G++){I[G]=I[G].replace(/\+/g," ");F=I[G].split("=");k.push([decodeURIComponent(F[0]),decodeURIComponent(F[1])])}return k}function r(q){var k=new FormData();for(var F=0;F<q.length;F++){k.append(q[F].name,q[F].value)}if(h.extraData){var I=f(h.extraData);for(F=0;F<I.length;F++){if(I[F]){k.append(I[F][0],I[F][1])}}}h.data=null;var H=e.extend(true,{},e.ajaxSettings,h,{contentType:false,processData:false,cache:false,type:g||"POST"});if(h.uploadProgress){H.xhr=function(){var J=jQuery.ajaxSettings.xhr();if(J.upload){J.upload.addEventListener("progress",function(N){var M=0;var K=N.loaded||N.position;var L=N.total;if(N.lengthComputable){M=Math.ceil(K/L*100)}h.uploadProgress(N,K,L,M)},false)}return J}}H.data=null;var G=H.beforeSend;H.beforeSend=function(K,J){J.data=k;if(G){G.call(this,K,J)}};return e.ajax(H)}function D(ad){var I=m[0],H,Z,T,ab,W,K,O,M,N,X,aa,R;var L=!!e.fn.prop;var ag=e.Deferred();if(ad){for(Z=0;Z<p.length;Z++){H=e(p[Z]);if(L){H.prop("disabled",false)}else{H.removeAttr("disabled")}}}T=e.extend(true,{},e.ajaxSettings,h);T.context=T.context||T;W="jqFormIO"+(new Date().getTime());if(T.iframeTarget){K=e(T.iframeTarget);X=K.attr("name");if(!X){K.attr("name",W)}else{W=X}}else{K=e('<iframe name="'+W+'" src="'+T.iframeSrc+'" />');K.css({position:"absolute",top:"-1000px",left:"-1000px"})}O=K[0];M={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(ah){var ai=(ah==="timeout"?"timeout":"aborted");d("aborting upload... "+ai);this.aborted=1;try{if(O.contentWindow.document.execCommand){O.contentWindow.document.execCommand("Stop")}}catch(aj){}K.attr("src",T.iframeSrc);M.error=ai;if(T.error){T.error.call(T.context,M,ai,ah)}if(ab){e.event.trigger("ajaxError",[M,T,ai])}if(T.complete){T.complete.call(T.context,M,ai)}}};ab=T.global;if(ab&&0===e.active++){e.event.trigger("ajaxStart")}if(ab){e.event.trigger("ajaxSend",[M,T])}if(T.beforeSend&&T.beforeSend.call(T.context,M,T)===false){if(T.global){e.active--}ag.reject();return ag}if(M.aborted){ag.reject();return ag}N=I.clk;if(N){X=N.name;if(X&&!N.disabled){T.extraData=T.extraData||{};T.extraData[X]=N.value;if(N.type=="image"){T.extraData[X+".x"]=I.clk_x;T.extraData[X+".y"]=I.clk_y}}}var S=1;var P=2;function Q(ai){var ah=ai.contentWindow?ai.contentWindow.document:ai.contentDocument?ai.contentDocument:ai.document;return ah}var G=e("meta[name=csrf-token]").attr("content");var F=e("meta[name=csrf-param]").attr("content");if(F&&G){T.extraData=T.extraData||{};T.extraData[F]=G}function Y(){var aj=m.attr("target"),ah=m.attr("action");I.setAttribute("target",W);if(!g){I.setAttribute("method","POST")}if(ah!=T.url){I.setAttribute("action",T.url)}if(!T.skipEncodingOverride&&(!g||/post/i.test(g))){m.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(T.timeout){R=setTimeout(function(){aa=true;V(S)},T.timeout)}function ak(){try{var an=Q(O).readyState;d("state = "+an);if(an&&an.toLowerCase()=="uninitialized"){setTimeout(ak,50)}}catch(ao){d("Server abort: ",ao," (",ao.name,")");V(P);if(R){clearTimeout(R)}R=undefined}}var ai=[];try{if(T.extraData){for(var am in T.extraData){if(T.extraData.hasOwnProperty(am)){if(e.isPlainObject(T.extraData[am])&&T.extraData[am].hasOwnProperty("name")&&T.extraData[am].hasOwnProperty("value")){ai.push(e('<input type="hidden" name="'+T.extraData[am].name+'">').val(T.extraData[am].value).appendTo(I)[0])}else{ai.push(e('<input type="hidden" name="'+am+'">').val(T.extraData[am]).appendTo(I)[0])}}}}if(!T.iframeTarget){K.appendTo("body");if(O.attachEvent){O.attachEvent("onload",V)}else{O.addEventListener("load",V,false)}}setTimeout(ak,15);var al=document.createElement("form").submit;al.apply(I)}finally{I.setAttribute("action",ah);if(aj){I.setAttribute("target",aj)}else{m.removeAttr("target")}e(ai).remove()}}if(T.forceSync){Y()}else{setTimeout(Y,10)}var ae,af,ac=50,J;function V(am){if(M.aborted||J){return}try{af=Q(O)}catch(ap){d("cannot access response document: ",ap);am=P}if(am===S&&M){M.abort("timeout");ag.reject(M,"timeout");return}else{if(am==P&&M){M.abort("server abort");ag.reject(M,"error","server abort");return}}if(!af||af.location.href==T.iframeSrc){if(!aa){return}}if(O.detachEvent){O.detachEvent("onload",V)}else{O.removeEventListener("load",V,false)}var ak="success",ao;try{if(aa){throw"timeout"}var aj=T.dataType=="xml"||af.XMLDocument||e.isXMLDoc(af);d("isXml="+aj);if(!aj&&window.opera&&(af.body===null||!af.body.innerHTML)){if(--ac){d("requeing onLoad callback, DOM not available");setTimeout(V,250);return}}var aq=af.body?af.body:af.documentElement;M.responseText=aq?aq.innerHTML:null;M.responseXML=af.XMLDocument?af.XMLDocument:af;if(aj){T.dataType="xml"}M.getResponseHeader=function(au){var at={"content-type":T.dataType};return at[au]};if(aq){M.status=Number(aq.getAttribute("status"))||M.status;M.statusText=aq.getAttribute("statusText")||M.statusText}var ah=(T.dataType||"").toLowerCase();var an=/(json|script|text)/.test(ah);if(an||T.textarea){var al=af.getElementsByTagName("textarea")[0];if(al){M.responseText=al.value;M.status=Number(al.getAttribute("status"))||M.status;M.statusText=al.getAttribute("statusText")||M.statusText}else{if(an){var ai=af.getElementsByTagName("pre")[0];var ar=af.getElementsByTagName("body")[0];if(ai){M.responseText=ai.textContent?ai.textContent:ai.innerText}else{if(ar){M.responseText=ar.textContent?ar.textContent:ar.innerText}}}}}else{if(ah=="xml"&&!M.responseXML&&M.responseText){M.responseXML=U(M.responseText)}}try{ae=k(M,ah,T)}catch(am){ak="parsererror";M.error=ao=(am||ak)}}catch(am){d("error caught: ",am);ak="error";M.error=ao=(am||ak)}if(M.aborted){d("upload aborted");ak=null}if(M.status){ak=(M.status>=200&&M.status<300||M.status===304)?"success":"error"}if(ak==="success"){if(T.success){T.success.call(T.context,ae,"success",M)}ag.resolve(M.responseText,"success",M);if(ab){e.event.trigger("ajaxSuccess",[M,T])}}else{if(ak){if(ao===undefined){ao=M.statusText}if(T.error){T.error.call(T.context,M,ak,ao)}ag.reject(M,"error",ao);if(ab){e.event.trigger("ajaxError",[M,T,ao])}}}if(ab){e.event.trigger("ajaxComplete",[M,T])}if(ab&&!--e.active){e.event.trigger("ajaxStop")}if(T.complete){T.complete.call(T.context,M,ak)}J=true;if(T.timeout){clearTimeout(R)}setTimeout(function(){if(!T.iframeTarget){K.remove()}M.responseXML=null},100)}var U=e.parseXML||function(ah,ai){if(window.ActiveXObject){ai=new ActiveXObject("Microsoft.XMLDOM");ai.async="false";ai.loadXML(ah)}else{ai=(new DOMParser()).parseFromString(ah,"text/xml")}return(ai&&ai.documentElement&&ai.documentElement.nodeName!="parsererror")?ai:null};var q=e.parseJSON||function(ah){return window["eval"]("("+ah+")")};var k=function(am,ak,aj){var ai=am.getResponseHeader("content-type")||"",ah=ak==="xml"||!ak&&ai.indexOf("xml")>=0,al=ah?am.responseXML:am.responseText;if(ah&&al.documentElement.nodeName==="parsererror"){if(e.error){e.error("parsererror")}}if(aj&&aj.dataFilter){al=aj.dataFilter(al,ak)}if(typeof al==="string"){if(ak==="json"||!ak&&ai.indexOf("json")>=0){al=q(al)}else{if(ak==="script"||!ak&&ai.indexOf("javascript")>=0){e.globalEval(al)}}}return al};return ag}};e.fn.ajaxForm=function(f){f=f||{};f.delegation=f.delegation&&e.isFunction(e.fn.on);if(!f.delegation&&this.length===0){var g={s:this.selector,c:this.context};if(!e.isReady&&g.s){d("DOM not ready, queuing ajaxForm");e(function(){e(g.s,g.c).ajaxForm(f)});return this}d("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)"));return this}if(f.delegation){e(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,a).on("submit.form-plugin",this.selector,f,b).on("click.form-plugin",this.selector,f,a);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",f,b).bind("click.form-plugin",f,a)};function b(g){var f=g.data;if(!g.isDefaultPrevented()){g.preventDefault();e(this).ajaxSubmit(f)}}function a(j){var i=j.target;var g=e(i);if(!(g.is("[type=submit],[type=image]"))){var f=g.closest("[type=submit]");if(f.length===0){return}i=f[0]}var h=this;h.clk=i;if(i.type=="image"){if(j.offsetX!==undefined){h.clk_x=j.offsetX;h.clk_y=j.offsetY}else{if(typeof e.fn.offset=="function"){var k=g.offset();h.clk_x=j.pageX-k.left;h.clk_y=j.pageY-k.top}else{h.clk_x=j.pageX-i.offsetLeft;h.clk_y=j.pageY-i.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)}e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};e.fn.formToArray=function(w,f){var u=[];if(this.length===0){return u}var k=this[0];var o=w?k.getElementsByTagName("*"):k.elements;if(!o){return u}var q,p,m,x,l,s,h;for(q=0,s=o.length;q<s;q++){l=o[q];m=l.name;if(!m){continue}if(w&&k.clk&&l.type=="image"){if(!l.disabled&&k.clk==l){u.push({name:m,value:e(l).val(),type:l.type});u.push({name:m+".x",value:k.clk_x},{name:m+".y",value:k.clk_y})}continue}x=e.fieldValue(l,true);if(x&&x.constructor==Array){if(f){f.push(l)}for(p=0,h=x.length;p<h;p++){u.push({name:m,value:x[p]})}}else{if(c.fileapi&&l.type=="file"&&!l.disabled){if(f){f.push(l)}var g=l.files;if(g.length){for(p=0;p<g.length;p++){u.push({name:m,value:g[p],type:l.type})}}else{u.push({name:m,value:"",type:l.type})}}else{if(x!==null&&typeof x!="undefined"){if(f){f.push(l)}u.push({name:m,value:x,type:l.type,required:l.required})}}}}if(!w&&k.clk){var r=e(k.clk),t=r[0];m=t.name;if(m&&!t.disabled&&t.type=="image"){u.push({name:m,value:r.val()});u.push({name:m+".x",value:k.clk_x},{name:m+".y",value:k.clk_y})}}return u};e.fn.formSerialize=function(f){return e.param(this.formToArray(f))};e.fn.fieldSerialize=function(g){var f=[];this.each(function(){var l=this.name;if(!l){return}var j=e.fieldValue(this,g);if(j&&j.constructor==Array){for(var k=0,h=j.length;k<h;k++){f.push({name:l,value:j[k]})}}else{if(j!==null&&typeof j!="undefined"){f.push({name:this.name,value:j})}}});return e.param(f)};e.fn.fieldValue=function(l){for(var k=[],h=0,f=this.length;h<f;h++){var j=this[h];var g=e.fieldValue(j,l);if(g===null||typeof g=="undefined"||(g.constructor==Array&&!g.length)){continue}if(g.constructor==Array){e.merge(k,g)}else{k.push(g)}}return k};e.fieldValue=function(f,m){var h=f.name,s=f.type,u=f.tagName.toLowerCase();if(m===undefined){m=true}if(m&&(!h||f.disabled||s=="reset"||s=="button"||(s=="checkbox"||s=="radio")&&!f.checked||(s=="submit"||s=="image")&&f.form&&f.form.clk!=f||u=="select"&&f.selectedIndex==-1)){return null}if(u=="select"){var o=f.selectedIndex;if(o<0){return null}var q=[],g=f.options;var k=(s=="select-one");var p=(k?o+1:g.length);for(var j=(k?o:0);j<p;j++){var l=g[j];if(l.selected){var r=l.value;if(!r){r=(l.attributes&&l.attributes.value&&!(l.attributes.value.specified))?l.text:l.value}if(k){return r}q.push(r)}}return q}return e(f).val()};e.fn.clearForm=function(f){return this.each(function(){e("input,select,textarea",this).clearFields(f)})};e.fn.clearFields=e.fn.clearInputs=function(f){var g=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var i=this.type,h=this.tagName.toLowerCase();if(g.test(i)||h=="textarea"){this.value=""}else{if(i=="checkbox"||i=="radio"){this.checked=false}else{if(h=="select"){this.selectedIndex=-1}else{if(i=="file"){if(/MSIE/.test(navigator.userAgent)){e(this).replaceWith(e(this).clone())}else{e(this).val("")}}else{if(f){if((f===true&&/hidden/.test(i))||(typeof f=="string"&&e(this).is(f))){this.value=""}}}}}}})};e.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};e.fn.enable=function(f){if(f===undefined){f=true}return this.each(function(){this.disabled=!f})};e.fn.selected=function(f){if(f===undefined){f=true}return this.each(function(){var g=this.type;if(g=="checkbox"||g=="radio"){this.checked=f}else{if(this.tagName.toLowerCase()=="option"){var h=e(this).parent("select");if(f&&h[0]&&h[0].type=="select-one"){h.find("option").selected(false)}this.selected=f}}})};e.fn.ajaxSubmit.debug=false;function d(){if(!e.fn.ajaxSubmit.debug){return}var f="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(f)}else{if(window.opera&&window.opera.postError){window.opera.postError(f)}}}})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-form.min.js
jquery-form.min.js
(function($) { var abs = Math.abs, max = Math.max, min = Math.min, round = Math.round; function div() { return $('<div/>'); } $.imgAreaSelect = function (img, options) { var $img = $(img), imgLoaded, $box = div(), $area = div(), $border = div().add(div()).add(div()).add(div()), $outer = div().add(div()).add(div()).add(div()), $handles = $([]), $areaOpera, left, top, imgOfs, imgWidth, imgHeight, $parent, parOfs, zIndex = 0, position = 'absolute', startX, startY, scaleX, scaleY, resizeMargin = 10, resize, minWidth, minHeight, maxWidth, maxHeight, aspectRatio, shown, x1, y1, x2, y2, selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 }, docElem = document.documentElement, $p, d, i, o, w, h, adjusted; function viewX(x) { return x + imgOfs.left - parOfs.left; } function viewY(y) { return y + imgOfs.top - parOfs.top; } function selX(x) { return x - imgOfs.left + parOfs.left; } function selY(y) { return y - imgOfs.top + parOfs.top; } function evX(event) { return event.pageX - parOfs.left; } function evY(event) { return event.pageY - parOfs.top; } function getSelection(noScale) { var sx = noScale || scaleX, sy = noScale || scaleY; return { x1: round(selection.x1 * sx), y1: round(selection.y1 * sy), x2: round(selection.x2 * sx), y2: round(selection.y2 * sy), width: round(selection.x2 * sx) - round(selection.x1 * sx), height: round(selection.y2 * sy) - round(selection.y1 * sy) }; } function setSelection(x1, y1, x2, y2, noScale) { var sx = noScale || scaleX, sy = noScale || scaleY; selection = { x1: round(x1 / sx), y1: round(y1 / sy), x2: round(x2 / sx), y2: round(y2 / sy) }; selection.width = selection.x2 - selection.x1; selection.height = selection.y2 - selection.y1; } function adjust() { if (!$img.width()) return; imgOfs = { left: round($img.offset().left), top: round($img.offset().top) }; imgWidth = $img.width(); imgHeight = $img.height(); minWidth = options.minWidth || 0; minHeight = options.minHeight || 0; maxWidth = min(options.maxWidth || 1<<24, imgWidth); maxHeight = min(options.maxHeight || 1<<24, imgHeight); if ($().jquery == '1.3.2' && position == 'fixed' && !docElem['getBoundingClientRect']) { imgOfs.top += max(document.body.scrollTop, docElem.scrollTop); imgOfs.left += max(document.body.scrollLeft, docElem.scrollLeft); } parOfs = $.inArray($parent.css('position'), ['absolute', 'relative']) + 1 ? { left: round($parent.offset().left) - $parent.scrollLeft(), top: round($parent.offset().top) - $parent.scrollTop() } : position == 'fixed' ? { left: $(document).scrollLeft(), top: $(document).scrollTop() } : { left: 0, top: 0 }; left = viewX(0); top = viewY(0); if (selection.x2 > imgWidth || selection.y2 > imgHeight) doResize(); } function update(resetKeyPress) { if (!shown) return; $box.css({ left: viewX(selection.x1), top: viewY(selection.y1) }) .add($area).width(w = selection.width).height(h = selection.height); $area.add($border).add($handles).css({ left: 0, top: 0 }); $border .width(max(w - $border.outerWidth() + $border.innerWidth(), 0)) .height(max(h - $border.outerHeight() + $border.innerHeight(), 0)); $($outer[0]).css({ left: left, top: top, width: selection.x1, height: imgHeight }); $($outer[1]).css({ left: left + selection.x1, top: top, width: w, height: selection.y1 }); $($outer[2]).css({ left: left + selection.x2, top: top, width: imgWidth - selection.x2, height: imgHeight }); $($outer[3]).css({ left: left + selection.x1, top: top + selection.y2, width: w, height: imgHeight - selection.y2 }); w -= $handles.outerWidth(); h -= $handles.outerHeight(); switch ($handles.length) { case 8: $($handles[4]).css({ left: w / 2 }); $($handles[5]).css({ left: w, top: h / 2 }); $($handles[6]).css({ left: w / 2, top: h }); $($handles[7]).css({ top: h / 2 }); case 4: $handles.slice(1,3).css({ left: w }); $handles.slice(2,4).css({ top: h }); } if (resetKeyPress !== false) { if ($.imgAreaSelect.keyPress != docKeyPress) $(document).unbind($.imgAreaSelect.keyPress, $.imgAreaSelect.onKeyPress); if (options.keys) $(document)[$.imgAreaSelect.keyPress]( $.imgAreaSelect.onKeyPress = docKeyPress); } if ($.browser.msie && $border.outerWidth() - $border.innerWidth() == 2) { $border.css('margin', 0); setTimeout(function () { $border.css('margin', 'auto'); }, 0); } } function doUpdate(resetKeyPress) { adjust(); update(resetKeyPress); x1 = viewX(selection.x1); y1 = viewY(selection.y1); x2 = viewX(selection.x2); y2 = viewY(selection.y2); } function hide($elem, fn) { options.fadeSpeed ? $elem.fadeOut(options.fadeSpeed, fn) : $elem.hide(); } function areaMouseMove(event) { var x = selX(evX(event)) - selection.x1, y = selY(evY(event)) - selection.y1; if (!adjusted) { adjust(); adjusted = true; $box.one('mouseout', function () { adjusted = false; }); } resize = ''; if (options.resizable) { if (y <= resizeMargin) resize = 'n'; else if (y >= selection.height - resizeMargin) resize = 's'; if (x <= resizeMargin) resize += 'w'; else if (x >= selection.width - resizeMargin) resize += 'e'; } $box.css('cursor', resize ? resize + '-resize' : options.movable ? 'move' : ''); if ($areaOpera) $areaOpera.toggle(); } function docMouseUp(event) { $('body').css('cursor', ''); if (options.autoHide || selection.width * selection.height == 0) hide($box.add($outer), function () { $(this).hide(); }); options.onSelectEnd(img, getSelection()); $(document).unbind('mousemove', selectingMouseMove); $box.mousemove(areaMouseMove); } function areaMouseDown(event) { if (event.which != 1) return false; adjust(); if (resize) { $('body').css('cursor', resize + '-resize'); x1 = viewX(selection[/w/.test(resize) ? 'x2' : 'x1']); y1 = viewY(selection[/n/.test(resize) ? 'y2' : 'y1']); $(document).mousemove(selectingMouseMove) .one('mouseup', docMouseUp); $box.unbind('mousemove', areaMouseMove); } else if (options.movable) { startX = left + selection.x1 - evX(event); startY = top + selection.y1 - evY(event); $box.unbind('mousemove', areaMouseMove); $(document).mousemove(movingMouseMove) .one('mouseup', function () { options.onSelectEnd(img, getSelection()); $(document).unbind('mousemove', movingMouseMove); $box.mousemove(areaMouseMove); }); } else $img.mousedown(event); return false; } function fixAspectRatio(xFirst) { if (aspectRatio) if (xFirst) { x2 = max(left, min(left + imgWidth, x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))); y2 = round(max(top, min(top + imgHeight, y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)))); x2 = round(x2); } else { y2 = max(top, min(top + imgHeight, y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1))); x2 = round(max(left, min(left + imgWidth, x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)))); y2 = round(y2); } } function doResize() { x1 = min(x1, left + imgWidth); y1 = min(y1, top + imgHeight); if (abs(x2 - x1) < minWidth) { x2 = x1 - minWidth * (x2 < x1 || -1); if (x2 < left) x1 = left + minWidth; else if (x2 > left + imgWidth) x1 = left + imgWidth - minWidth; } if (abs(y2 - y1) < minHeight) { y2 = y1 - minHeight * (y2 < y1 || -1); if (y2 < top) y1 = top + minHeight; else if (y2 > top + imgHeight) y1 = top + imgHeight - minHeight; } x2 = max(left, min(x2, left + imgWidth)); y2 = max(top, min(y2, top + imgHeight)); fixAspectRatio(abs(x2 - x1) < abs(y2 - y1) * aspectRatio); if (abs(x2 - x1) > maxWidth) { x2 = x1 - maxWidth * (x2 < x1 || -1); fixAspectRatio(); } if (abs(y2 - y1) > maxHeight) { y2 = y1 - maxHeight * (y2 < y1 || -1); fixAspectRatio(true); } selection = { x1: selX(min(x1, x2)), x2: selX(max(x1, x2)), y1: selY(min(y1, y2)), y2: selY(max(y1, y2)), width: abs(x2 - x1), height: abs(y2 - y1) }; update(); options.onSelectChange(img, getSelection()); } function selectingMouseMove(event) { x2 = resize == '' || /w|e/.test(resize) || aspectRatio ? evX(event) : viewX(selection.x2); y2 = resize == '' || /n|s/.test(resize) || aspectRatio ? evY(event) : viewY(selection.y2); doResize(); return false; } function doMove(newX1, newY1) { x2 = (x1 = newX1) + selection.width; y2 = (y1 = newY1) + selection.height; $.extend(selection, { x1: selX(x1), y1: selY(y1), x2: selX(x2), y2: selY(y2) }); update(); options.onSelectChange(img, getSelection()); } function movingMouseMove(event) { x1 = max(left, min(startX + evX(event), left + imgWidth - selection.width)); y1 = max(top, min(startY + evY(event), top + imgHeight - selection.height)); doMove(x1, y1); event.preventDefault(); return false; } function startSelection() { adjust(); x2 = x1; y2 = y1; doResize(); resize = ''; if ($outer.is(':not(:visible)')) $box.add($outer).hide().fadeIn(options.fadeSpeed||0); shown = true; $(document).unbind('mouseup', cancelSelection) .mousemove(selectingMouseMove).one('mouseup', docMouseUp); $box.unbind('mousemove', areaMouseMove); options.onSelectStart(img, getSelection()); } function cancelSelection() { $(document).unbind('mousemove', startSelection); hide($box.add($outer)); selection = { x1: selX(x1), y1: selY(y1), x2: selX(x1), y2: selY(y1), width: 0, height: 0 }; options.onSelectChange(img, getSelection()); options.onSelectEnd(img, getSelection()); } function imgMouseDown(event) { if (event.which != 1 || $outer.is(':animated')) return false; adjust(); startX = x1 = evX(event); startY = y1 = evY(event); $(document).one('mousemove', startSelection) .one('mouseup', cancelSelection); return false; } function windowResize() { doUpdate(false); } function imgLoad() { imgLoaded = true; setOptions(options = $.extend({ classPrefix: 'imgareaselect', movable: true, resizable: true, parent: 'body', onInit: function () {}, onSelectStart: function () {}, onSelectChange: function () {}, onSelectEnd: function () {} }, options)); $box.add($outer).css({ visibility: '' }); if (options.show) { shown = true; adjust(); update(); $box.add($outer).hide().fadeIn(options.fadeSpeed||0); } setTimeout(function () { options.onInit(img, getSelection()); }, 0); } var docKeyPress = function(event) { var k = options.keys, d, t, key = event.keyCode; d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt : !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl : !isNaN(k.shift) && event.shiftKey ? k.shift : !isNaN(k.arrows) ? k.arrows : 10; if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) || (k.ctrl == 'resize' && event.ctrlKey) || (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey))) { switch (key) { case 37: d = -d; case 39: t = max(x1, x2); x1 = min(x1, x2); x2 = max(t + d, x1); fixAspectRatio(); break; case 38: d = -d; case 40: t = max(y1, y2); y1 = min(y1, y2); y2 = max(t + d, y1); fixAspectRatio(true); break; default: return; } doResize(); } else { x1 = min(x1, x2); y1 = min(y1, y2); switch (key) { case 37: doMove(max(x1 - d, left), y1); break; case 38: doMove(x1, max(y1 - d, top)); break; case 39: doMove(x1 + min(d, imgWidth - selX(x2)), y1); break; case 40: doMove(x1, y1 + min(d, imgHeight - selY(y2))); break; default: return; } } return false; }; function styleOptions($elem, props) { for (option in props) if (options[option] !== undefined) $elem.css(props[option], options[option]); } function setOptions(newOptions) { if (newOptions.parent) ($parent = $(newOptions.parent)).append($box.add($outer)); $.extend(options, newOptions); adjust(); if (newOptions.handles != null) { $handles.remove(); $handles = $([]); i = newOptions.handles ? newOptions.handles == 'corners' ? 4 : 8 : 0; while (i--) $handles = $handles.add(div()); $handles.addClass(options.classPrefix + '-handle').css({ position: 'absolute', fontSize: 0, zIndex: zIndex + 1 || 1 }); if (!parseInt($handles.css('width'))) $handles.width(5).height(5); if (o = options.borderWidth) $handles.css({ borderWidth: o, borderStyle: 'solid' }); styleOptions($handles, { borderColor1: 'border-color', borderColor2: 'background-color', borderOpacity: 'opacity' }); } scaleX = options.imageWidth / imgWidth || 1; scaleY = options.imageHeight / imgHeight || 1; if (newOptions.x1 != null) { setSelection(newOptions.x1, newOptions.y1, newOptions.x2, newOptions.y2); newOptions.show = !newOptions.hide; } if (newOptions.keys) options.keys = $.extend({ shift: 1, ctrl: 'resize' }, newOptions.keys); $outer.addClass(options.classPrefix + '-outer'); $area.addClass(options.classPrefix + '-selection'); for (i = 0; i++ < 4;) $($border[i-1]).addClass(options.classPrefix + '-border' + i); styleOptions($area, { selectionColor: 'background-color', selectionOpacity: 'opacity' }); styleOptions($border, { borderOpacity: 'opacity', borderWidth: 'border-width' }); styleOptions($outer, { outerColor: 'background-color', outerOpacity: 'opacity' }); if (o = options.borderColor1) $($border[0]).css({ borderStyle: 'solid', borderColor: o }); if (o = options.borderColor2) $($border[1]).css({ borderStyle: 'dashed', borderColor: o }); $box.append($area.add($border).add($handles).add($areaOpera)); if ($.browser.msie) { if (o = $outer.css('filter').match(/opacity=([0-9]+)/)) $outer.css('opacity', o[1]/100); if (o = $border.css('filter').match(/opacity=([0-9]+)/)) $border.css('opacity', o[1]/100); } if (newOptions.hide) hide($box.add($outer)); else if (newOptions.show && imgLoaded) { shown = true; $box.add($outer).fadeIn(options.fadeSpeed||0); doUpdate(); } aspectRatio = (d = (options.aspectRatio || '').split(/:/))[0] / d[1]; if (options.disable || options.enable === false) { $box.unbind('mousemove', areaMouseMove).unbind('mousedown', areaMouseDown); $img.add($outer).unbind('mousedown', imgMouseDown); $(window).unbind('resize', windowResize); } else if (options.enable || options.disable === false) { if (options.resizable || options.movable) $box.mousemove(areaMouseMove).mousedown(areaMouseDown); if (!options.persistent) $img.add($outer).mousedown(imgMouseDown); $(window).resize(windowResize); } options.enable = options.disable = undefined; } this.remove = function () { $img.unbind('mousedown', imgMouseDown); $box.add($outer).remove(); }; this.getOptions = function () { return options; }; this.setOptions = setOptions; this.getSelection = getSelection; this.setSelection = setSelection; this.update = doUpdate; $p = $img; while ($p.length) { zIndex = max(zIndex, !isNaN($p.css('z-index')) ? $p.css('z-index') : zIndex); if ($p.css('position') == 'fixed') position = 'fixed'; $p = $p.parent(':not(body)'); } zIndex = options.zIndex || zIndex; if ($.browser.msie) $img.attr('unselectable', 'on'); $.imgAreaSelect.keyPress = $.browser.msie || $.browser.safari ? 'keydown' : 'keypress'; if ($.browser.opera) $areaOpera = div().css({ width: '100%', height: '100%', position: 'absolute', zIndex: zIndex + 2 || 2 }); $box.add($outer).css({ visibility: 'hidden', position: position, overflow: 'hidden', zIndex: zIndex || '0' }); $box.css({ zIndex: zIndex + 2 || 2 }); $area.add($border).css({ position: 'absolute', fontSize: 0 }); img.complete || img.readyState == 'complete' || !$img.is('img') ? imgLoad() : $img.one('load', imgLoad); }; $.fn.imgAreaSelect = function (options) { options = options || {}; this.each(function () { if ($(this).data('imgAreaSelect')) { if (options.remove) { $(this).data('imgAreaSelect').remove(); $(this).removeData('imgAreaSelect'); } else $(this).data('imgAreaSelect').setOptions(options); } else if (!options.remove) { if (options.enable === undefined && options.disable === undefined) options.enable = true; $(this).data('imgAreaSelect', new $.imgAreaSelect(this, options)); } }); if (options.instance) return $(this).data('imgAreaSelect'); return this; }; })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-imgareaselect.js
jquery-imgareaselect.js
(function($){$.fn.dynDateTime=function(options){$.fn.dynDateTime.defaults={displayArea:null,button:null,eventName:"click",ifFormat:"%Y/%m/%d",daFormat:"%Y/%m/%d",singleClick:true,dateStatusFunc:null,dateText:null,firstDay:null,align:"Br",range:[1900,2999],weekNumbers:true,flat:null,flatCallback:null,onSelect:null,onClose:null,onUpdate:null,date:null,showsTime:false,timeFormat:"24",electric:true,step:2,position:null,cache:false,showOthers:false,multiple:null,debug:false};var opts=$.extend({},$.fn.dynDateTime.defaults,options);return this.each(function(){var this_inputField=this;var this_displayArea=null;var this_button=null;var this_flat=null;if(opts.displayArea){try{this_displayArea=eval("jQuery(this)"+opts.displayArea+".get(0);");}catch(err){opts.displayArea=null;}}if(opts.button){try{this_button=eval("jQuery(this)"+opts.button+".get(0);");}catch(err){opts.button=null;}}if(opts.flat){try{this_flat=eval("jQuery(this)"+opts.flat+".get(0);");}catch(err){opts.flat=null;}}if(!(this_flat||opts.multiple||this_inputField||this_displayArea||this_button)){log("opts");return;}function onSelect(cal){var p=cal.opts;var update=(cal.dateClicked||p.electric);if(update&&this_inputField){this_inputField.value=cal.date.print(p.ifFormat);if(typeof this_inputField.onchange=="function")this_inputField.onchange();}if(update&&this_displayArea)this_displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(this_flat!=null){var cal=new Calendar(opts.firstDay,opts.date,opts.onSelect||onSelect);cal.showsOtherMonths=opts.showOthers;cal.showsTime=opts.showsTime;cal.time24=(opts.timeFormat=="24");cal.opts=opts;cal.weekNumbers=opts.weekNumbers;cal.setRange(opts.range[0],opts.range[1]);cal.setDateStatusHandler(opts.dateStatusFunc);cal.getDateText=opts.dateText;if(opts.ifFormat){cal.setDateFormat(opts.ifFormat);}if(this_inputField&&typeof this_inputField.value=="string"){log("rar");}cal.create(this_flat);cal.show();return;}var triggerEl=this_button||this_displayArea||this_inputField;triggerEl["on"+opts.eventName]=function(){log("clicked");var dateEl=this_inputField||this_displayArea;var dateFmt=this_inputField?opts.ifFormat:opts.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)opts.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&opts.cache)){window.calendar=cal=new Calendar(opts.firstDay,opts.date,opts.onSelect||onSelect,opts.onClose||function(cal){cal.hide();});cal.showsTime=opts.showsTime;cal.time24=(opts.timeFormat=="24");cal.weekNumbers=opts.weekNumbers;mustCreate=true;}else{if(opts.date)cal.setDate(opts.date);cal.hide();}if(opts.multiple){cal.multiple={};for(var i=opts.multiple.length;--i>=0;){var d=opts.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=opts.showOthers;cal.yearStep=opts.step;cal.setRange(opts.range[0],opts.range[1]);cal.opts=opts;cal.setDateStatusHandler(opts.dateStatusFunc);cal.getDateText=opts.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!opts.position)cal.showAtElement(this_button||this_displayArea||this_inputField,opts.align);else cal.showAt(opts.position[0],opts.position[1]);return false;};});function log(msg){if(opts.debug){window.loadFirebugConsole();if(window.console&&window.console.log)window.console.log("dynDateTime: "+msg);}};};})(jQuery);Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <[email protected]> to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0);}break;case 2:if(year<cal.maxYear){date.setFullYear(year+1);}break;case 100:cal.setFirstDayOfWeek(el.fdow);return;case 50:var range=el._range;var current=el.innerHTML;for(var i=range.length;--i>=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML="&nbsp;";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn);}div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++y<cal.ar_days.length)ne=cal.ar_days[y][x];else{nextMonth();setVars();}break;}break;}if(ne){if(!ne.disabled)Calendar.cellClick(ne);else if(prev)prevMonth();else nextMonth();}}break;case 13:if(act)Calendar.cellClick(cal.currentDateEl,ev);break;default:return false;}return Calendar.stopEvent(ev);};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year);}else if(year>this.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML="&nbsp;";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case"T":p.y-=h;break;case"B":p.y+=el.offsetHeight;break;case"C":p.y+=(el.offsetHeight-h)/2;break;case"t":p.y+=el.offsetHeight-h;break;case"b":break;}switch(halign){case"L":p.x-=w;break;case"R":p.x+=el.offsetWidth;break;case"C":p.x+=(el.offsetWidth-w)/2;break;case"l":p.x+=el.offsetWidth-w;break;case"r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView.getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility=cc.__msh_save_visibility;}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility="hidden";}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell);}if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend");}cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling;}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";};Calendar.prototype._dragStart=function(ev){if(this.dragging){return;}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX;}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd);}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(str,fmt){var today=new Date();var y=0;var m=-1;var d=0;var a=str.split(/\W+/);var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i<a.length;++i){if(!a[i])continue;switch(b[i]){case"%d":case"%e":d=parseInt(a[i],10);break;case"%m":m=parseInt(a[i],10)-1;break;case"%Y":case"%y":y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);break;case"%b":case"%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case"%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}if(t!=-1){if(m!=-1){d=m+1;}m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i<a.length;i++){var tmp=s[a[i]];if(tmp){re=new RegExp(a[i],'g');str=str.replace(re,tmp);}}return str;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth())this.setDate(28);this.__msh_oldSetFullYear(y);};window._dynarch_popupCalendar=null;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-datetime.min.js
jquery-datetime.min.js
(function(o,d){var k="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",h=/^([\-+])=\s*(\d+\.?\d*)/,g=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(p){return[p[1],p[2],p[3],p[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(p){return[p[1]*2.55,p[2]*2.55,p[3]*2.55,p[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(p){return[parseInt(p[1],16),parseInt(p[2],16),parseInt(p[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(p){return[parseInt(p[1]+p[1],16),parseInt(p[2]+p[2],16),parseInt(p[3]+p[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(p){return[p[1],p[2]/100,p[3]/100,p[4]]}}],e=o.Color=function(q,r,p,s){return new o.Color.fn.parse(q,r,p,s)},j={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},n={"byte":{floor:true,max:255},percent:{max:1},degrees:{mod:360,floor:true}},m=e.support={},b=o("<p>")[0],a,l=o.each;b.style.cssText="background-color:rgba(1,1,1,.5)";m.rgba=b.style.backgroundColor.indexOf("rgba")>-1;l(j,function(p,q){q.cache="_"+p;q.props.alpha={idx:3,type:"percent",def:1}});function i(q,s,r){var p=n[s.type]||{};if(q==null){return(r||!s.def)?null:s.def}q=p.floor?~~q:parseFloat(q);if(isNaN(q)){return s.def}if(p.mod){return(q+p.mod)%p.mod}return 0>q?0:p.max<q?p.max:q}function f(p){var r=e(),q=r._rgba=[];p=p.toLowerCase();l(g,function(w,x){var u,v=x.re.exec(p),t=v&&x.parse(v),s=x.space||"rgba";if(t){u=r[s](t);r[j[s].cache]=u[j[s].cache];q=r._rgba=u._rgba;return false}});if(q.length){if(q.join()==="0,0,0,0"){o.extend(q,a.transparent)}return r}return a[p]}e.fn=o.extend(e.prototype,{parse:function(v,t,p,u){if(v===d){this._rgba=[null,null,null,null];return this}if(v.jquery||v.nodeType){v=o(v).css(t);t=d}var s=this,r=o.type(v),q=this._rgba=[];if(t!==d){v=[v,t,p,u];r="array"}if(r==="string"){return this.parse(f(v)||a._default)}if(r==="array"){l(j.rgba.props,function(w,x){q[x.idx]=i(v[x.idx],x)});return this}if(r==="object"){if(v instanceof e){l(j,function(w,x){if(v[x.cache]){s[x.cache]=v[x.cache].slice()}})}else{l(j,function(x,y){var w=y.cache;l(y.props,function(z,A){if(!s[w]&&y.to){if(z==="alpha"||v[z]==null){return}s[w]=y.to(s._rgba)}s[w][A.idx]=i(v[z],A,true)});if(s[w]&&o.inArray(null,s[w].slice(0,3))<0){s[w][3]=1;if(y.from){s._rgba=y.from(s[w])}}})}return this}},is:function(r){var p=e(r),s=true,q=this;l(j,function(t,v){var w,u=p[v.cache];if(u){w=q[v.cache]||v.to&&v.to(q._rgba)||[];l(v.props,function(x,y){if(u[y.idx]!=null){s=(u[y.idx]===w[y.idx]);return s}})}return s});return s},_space:function(){var p=[],q=this;l(j,function(r,s){if(q[s.cache]){p.push(r)}});return p.pop()},transition:function(q,w){var r=e(q),s=r._space(),t=j[s],u=this.alpha()===0?e("transparent"):this,v=u[t.cache]||t.to(u._rgba),p=v.slice();r=r[t.cache];l(t.props,function(A,C){var z=C.idx,y=v[z],x=r[z],B=n[C.type]||{};if(x===null){return}if(y===null){p[z]=x}else{if(B.mod){if(x-y>B.mod/2){y+=B.mod}else{if(y-x>B.mod/2){y-=B.mod}}}p[z]=i((x-y)*w+y,C)}});return this[s](p)},blend:function(s){if(this._rgba[3]===1){return this}var r=this._rgba.slice(),q=r.pop(),p=e(s)._rgba;return e(o.map(r,function(t,u){return(1-q)*p[u]+q*t}))},toRgbaString:function(){var q="rgba(",p=o.map(this._rgba,function(r,s){return r==null?(s>2?1:0):r});if(p[3]===1){p.pop();q="rgb("}return q+p.join()+")"},toHslaString:function(){var q="hsla(",p=o.map(this.hsla(),function(r,s){if(r==null){r=s>2?1:0}if(s&&s<3){r=Math.round(r*100)+"%"}return r});if(p[3]===1){p.pop();q="hsl("}return q+p.join()+")"},toHexString:function(p){var q=this._rgba.slice(),r=q.pop();if(p){q.push(~~(r*255))}return"#"+o.map(q,function(s){s=(s||0).toString(16);return s.length===1?"0"+s:s}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}});e.fn.parse.prototype=e.fn;function c(t,s,r){r=(r+1)%1;if(r*6<1){return t+(s-t)*r*6}if(r*2<1){return s}if(r*3<2){return t+(s-t)*((2/3)-r)*6}return t}j.hsla.to=function(t){if(t[0]==null||t[1]==null||t[2]==null){return[null,null,null,t[3]]}var p=t[0]/255,w=t[1]/255,x=t[2]/255,z=t[3],y=Math.max(p,w,x),u=Math.min(p,w,x),A=y-u,B=y+u,q=B*0.5,v,C;if(u===y){v=0}else{if(p===y){v=(60*(w-x)/A)+360}else{if(w===y){v=(60*(x-p)/A)+120}else{v=(60*(p-w)/A)+240}}}if(A===0){C=0}else{if(q<=0.5){C=A/B}else{C=A/(2-B)}}return[Math.round(v)%360,C,q,z==null?1:z]};j.hsla.from=function(w){if(w[0]==null||w[1]==null||w[2]==null){return[null,null,null,w[3]]}var v=w[0]/360,u=w[1],t=w[2],r=w[3],x=t<=0.5?t*(1+u):t+u-t*u,y=2*t-x;return[Math.round(c(y,x,v+(1/3))*255),Math.round(c(y,x,v)*255),Math.round(c(y,x,v-(1/3))*255),r]};l(j,function(q,s){var r=s.props,p=s.cache,u=s.to,t=s.from;e.fn[q]=function(z){if(u&&!this[p]){this[p]=u(this._rgba)}if(z===d){return this[p].slice()}var w,y=o.type(z),v=(y==="array"||y==="object")?z:arguments,x=this[p].slice();l(r,function(A,C){var B=v[y==="object"?A:C.idx];if(B==null){B=x[C.idx]}x[C.idx]=i(B,C)});if(t){w=e(t(x));w[p]=x;return w}else{return e(x)}};l(r,function(v,w){if(e.fn[v]){return}e.fn[v]=function(A){var C=o.type(A),z=(v==="alpha"?(this._hsla?"hsla":"rgba"):q),y=this[z](),B=y[w.idx],x;if(C==="undefined"){return B}if(C==="function"){A=A.call(this,B);C=o.type(A)}if(A==null&&w.empty){return this}if(C==="string"){x=h.exec(A);if(x){A=B+parseFloat(x[2])*(x[1]==="+"?1:-1)}}y[w.idx]=A;return this[z](y)}})});e.hook=function(q){var p=q.split(" ");l(p,function(r,s){o.cssHooks[s]={set:function(w,x){var u,v,t="";if(x!=="transparent"&&(o.type(x)!=="string"||(u=f(x)))){x=e(u||x);if(!m.rgba&&x._rgba[3]!==1){v=s==="backgroundColor"?w.parentNode:w;while((t===""||t==="transparent")&&v&&v.style){try{t=o.css(v,"backgroundColor");v=v.parentNode}catch(y){}}x=x.blend(t&&t!=="transparent"?t:"_default")}x=x.toRgbaString()}try{w.style[s]=x}catch(y){}}};o.fx.step[s]=function(t){if(!t.colorInit){t.start=e(t.elem,s);t.end=e(t.end);t.colorInit=true}o.cssHooks[s].set(t.elem,t.start.transition(t.end,t.pos))}})};e.hook(k);o.cssHooks.borderColor={expand:function(q){var p={};l(["Top","Right","Bottom","Left"],function(s,r){p["border"+r+"Color"]=q});return p}};a=o.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery));
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-color.min.js
jquery-color.min.js
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== "original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, _mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, 10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| !d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), 10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), 10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, (a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= "hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), 10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& !(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left; if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/ b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version< 526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b, c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.16"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert}); h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval= false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true); this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top; c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&& this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity= a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!= "x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left< c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()- c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this, width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&& o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t= p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&& (p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"), 10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery); ;/* * jQuery UI Droppable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Droppables * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.mouse.js * jquery.ui.draggable.js */ (function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this); a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&& this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass); this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g= d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop", a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.16"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height; switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>= i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!= "none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem|| a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance); if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parents(":not(body,html)").unbind("scroll.droppable"); a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery); ;/* * jQuery UI Resizable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Resizables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element, _proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= {width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, _mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, {top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._vBoundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width= b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b.height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&& a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)|| 0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), 10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); ;/* * jQuery UI Selectable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Selectables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting"); a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&& !a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d= e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.16"})})(jQuery); ;/* * jQuery UI Sortable 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Sortables * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== "disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& !b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top< b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()- b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this, a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers|| this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection(); var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)}, _getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element), this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&& this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| 0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b= this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width== ""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top= this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a= {top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"), 10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"? document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), 10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b= this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&& this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset(); var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g- this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0], this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]= "";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove", f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()}, _uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.16"})})(jQuery); ;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-ui-base-1.8.16.min.js
jquery-ui-base-1.8.16.min.js
(function(){(function($){var KEY;KEY={BACKSPACE:8,TAB:9,RETURN:13,ESCAPE:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,COLON:188,DOT:190};$.MultiSelect=(function(){MultiSelect.prototype.addLabel="Add ";function MultiSelect(element,options){this.options={readonly:false,input_type:"input",input_class:null,separator:",",completions:[],input_references:null,min_query_length:0,on_search:null,on_search_timeout:250,max_complete_results:5,max_selection_length:null,enable_new_options:true,complex_search:true,highlight:false,backspace_removes_last:true};$.extend(this.options,options||{});this.values=[];this.input=$(element);this.initialize_elements();this.initialize_events();this.parse_value();} MultiSelect.prototype.initialize_elements=function(){this.hidden=$(document.createElement("input"));this.hidden.attr("name",this.input.attr("name"));this.hidden.attr("type","hidden");this.input.removeAttr("name");if(this.options.input_class){this.input.addClass(this.options.input_class);} this.container=$(document.createElement("div"));this.container.addClass("jquery-multiselect");this.input_wrapper=$(document.createElement("a"));this.input_wrapper.addClass("bit-input");this.input.replaceWith(this.container);this.container.append(this.input_wrapper);this.input_wrapper.append(this.input);return this.container.before(this.hidden);};MultiSelect.prototype.initialize_events=function(){var _this=this;this.selection=new $.MultiSelect.Selection(this.input);this.resizable=new $.MultiSelect.ResizableInput(this.input);this.observer=new $.MultiSelect.InputObserver(this.input);this.autocomplete=new $.MultiSelect.AutoComplete(this,this.options.completions);this.input.click(function(e){return e.stopPropagation();});this.input.keyup(function(){return _this.parse_value(1);});this.container.click(function(){_this.input.focus();return _this.selection.set_caret_at_end();});this.observer.bind([KEY.TAB,KEY.RETURN],function(e){if(_this.autocomplete.val()){e.preventDefault();return _this.add_and_reset();}});this.observer.bind([KEY.BACKSPACE],function(e){var caret;if(_this.values.length<=0){return;} caret=_this.selection.get_caret();if((_this.options.backspace_removes_last||e.ctrlKey)&&caret[0]===0&&caret[1]===0){e.preventDefault();return _this.remove(_this.values[_this.values.length-1]);}});this.input.blur(function(){return setTimeout(function(){return _this.autocomplete.hide_complete_box();},200);});return this.observer.bind([KEY.ESCAPE],function(e){return _this.autocomplete.hide_complete_box();});};MultiSelect.prototype.values_real=function(){return $.map(this.values,function(v){return v[1];});};MultiSelect.prototype.parse_value=function(min){var caption,refs,value,values,_i,_len;if(min==null){min=0;} if(this.options.input_type==="input"){values=this.input.val().split(this.options.separator);}else{values=this.options.input_values;} if(values.length>min){for(_i=0,_len=values.length;_i<_len;_i++){value=values[_i];if(value.present()){if(this.options.input_references){refs=this.options.input_references;if(typeof refs==='function'){refs=refs();} caption=refs[value]||value;this.add([caption,value]);}else{this.add([value,value]);}}} this.input.val("");this.autocomplete.search();} if(this.options.readonly){return this.input.hide();}};MultiSelect.prototype.add_and_reset=function(){if(this.autocomplete.val()){this.add(this.autocomplete.val());this.input.val("");return this.autocomplete.search();}};MultiSelect.prototype.add=function(value){var a,close,_this=this;if($.inArray(value[1],this.values_real())>-1){return;} if(value[0].blank()){return;} value[1]=value[1].trim();this.values.push(value);a=$(document.createElement("a"));a.addClass("bit bit-box");a.mouseover(function(){return $(this).addClass("bit-hover");});a.mouseout(function(){return $(this).removeClass("bit-hover");});a.data("value",value);a.html(value[0].entitizeHTML());if(!this.options.readonly){close=$(document.createElement("a"));close.addClass("closebutton");close.click(function(){return _this.remove(a.data("value"));});a.append(close);} this.input_wrapper.before(a);if(this.options.readonly||(this.options.max_selection_length&&(this.values.length>=this.options.max_selection_length))){this.input.hide();} return this.refresh_hidden();};MultiSelect.prototype.remove=function(value){this.values=$.grep(this.values,function(v){return v[1]!==value[1];});this.container.find("a.bit-box").each(function(){if($(this).data("value")[1]===value[1]){return $(this).remove();}});this.input.show();return this.refresh_hidden();};MultiSelect.prototype.refresh_hidden=function(){return this.hidden.val(this.values_real().join(this.options.separator));};return MultiSelect;})();$.MultiSelect.InputObserver=(function(){function InputObserver(element){var _this=this;this.input=$(element);this.input.keydown(function(e){return _this.handle_keydown(e);});this.events=[];} InputObserver.prototype.bind=function(key,callback){return this.events.push([key,callback]);};InputObserver.prototype.handle_keydown=function(e){var callback,event,keys,_i,_len,_ref,_results;_ref=this.events;_results=[];for(_i=0,_len=_ref.length;_i<_len;_i++){event=_ref[_i];keys=event[0],callback=event[1];if(!keys.push){keys=[keys];} if($.inArray(e.keyCode,keys)>-1){_results.push(callback(e));}else{_results.push(void 0);}} return _results;};return InputObserver;})();$.MultiSelect.Selection=(function(){function Selection(element){this.input=$(element)[0];} Selection.prototype.get_caret=function(){var r;if(document.selection){r=document.selection.createRange().duplicate();r.moveEnd('character',this.input.value.length);if(r.text===''){return[this.input.value.length,this.input.value.length];}else{return[this.input.value.lastIndexOf(r.text),this.input.value.lastIndexOf(r.text)];}}else{return[this.input.selectionStart,this.input.selectionEnd];}};Selection.prototype.set_caret=function(begin,end){if(end==null){end=begin;} this.input.selectionStart=begin;return this.input.selectionEnd=end;};Selection.prototype.set_caret_at_end=function(){return this.set_caret(this.input.value.length);};return Selection;})();$.MultiSelect.ResizableInput=(function(){function ResizableInput(element){var _this=this;this.input=$(element);this.create_measurer();this.input.keypress(function(e){return _this.set_width(e);});this.input.keyup(function(e){return _this.set_width(e);});this.input.change(function(e){return _this.set_width(e);});} ResizableInput.prototype.create_measurer=function(){var measurer;if($("#__jquery_multiselect_measurer")[0]===void 0){measurer=$(document.createElement("div"));measurer.attr("id","__jquery_multiselect_measurer");measurer.css({position:"absolute",left:"-1000px",top:"-1000px"});$(document.body).append(measurer);} this.measurer=$("#__jquery_multiselect_measurer:first");return this.measurer.css({fontSize:this.input.css('font-size'),fontFamily:this.input.css('font-family')});};ResizableInput.prototype.calculate_width=function(){this.measurer.html(this.input.val().entitizeHTML()+'MM');return this.measurer.innerWidth();};ResizableInput.prototype.set_width=function(){return this.input.css("width",this.calculate_width()+"px");};return ResizableInput;})();$.MultiSelect.AutoComplete=(function(){function AutoComplete(multiselect,completions){this.timer=null;this.busy=0;this.multiselect=multiselect;this.input=this.multiselect.input;this.completions=this.parse_completions(completions);this.matches=[];this.create_elements();this.bind_events();} AutoComplete.prototype.parse_completions=function(completions){return $.map(completions,function(value){if(typeof value==="string"){return[[value,value]];}else if(value instanceof Array&&value.length===2){return[value];}else if(value.value&&value.caption){return[[value.caption,value.value]];}else{if(console){return console.error("Invalid option "+value);}}});};AutoComplete.prototype.create_elements=function(){var width;this.container=$(document.createElement("div"));this.container.addClass("jquery-multiselect-autocomplete");width=$(this.multiselect.container).outerWidth();if(width<400){width=400;} this.container.css("width",width);this.container.css("display","none");this.container.append(this.def);this.list=$(document.createElement("ul"));this.list.addClass("feed");this.container.append(this.list);return this.multiselect.container.after(this.container);};AutoComplete.prototype.bind_events=function(){var _this=this;this.input.keypress(function(e){return _this.search(e);});this.input.keyup(function(e){return _this.search(e);});this.input.change(function(e){return _this.search(e);});this.multiselect.observer.bind(KEY.UP,function(e){e.preventDefault();return _this.navigate_up();});return this.multiselect.observer.bind(KEY.DOWN,function(e){e.preventDefault();return _this.navigate_down();});};AutoComplete.prototype._setBusy=function(state){if(state){++this.busy;}else{--this.busy;} return this.busy=Math.max(this.busy,0);};AutoComplete.prototype.search=function(){var callback,that;if(this.multiselect.options.on_search_timeout){if(this.timer){clearTimeout(this.timer);} callback=function(obj){return obj._search();};that=this;this.timer=setTimeout((function(){return callback(that);}),this.multiselect.options.on_search_timeout);}else{this._search();}};AutoComplete.prototype._search=function(){var def,i,item,label,option,x,_i,_len,_ref,_this=this;if(this.busy){return;} if(this.input.val().trim()===this.query){return;} this.query=this.input.val().trim();this.list.html("");this.current=0;if(this.query.present()&&this.query.length>=this.multiselect.options.min_query_length){this.container.fadeIn("fast");if(this.multiselect.options.on_search){this._initSearch();} this.matches=this.matching_completions(this.query);if(this.multiselect.options.enable_new_options){if(this.multiselect.options.highlight){label=" <em>"+this.query+"</em>";}else{label=" "+this.query;} def=this.create_item($.MultiSelect.addLabel+label);def.mouseover(function(e){return _this.select_index(0);});} _ref=this.matches;for(i=_i=0,_len=_ref.length;_i<_len;i=++_i){option=_ref[i];x=this.multiselect.options.enable_new_options?i+1:i;item=this.create_item(this.highlight(option[0],this.query));$(item).attr('multiselect:index',x);item.mouseover(function(e){var target;target=window.event?window.event.srcElement:e.target;return _this.select_index($(target).attr('multiselect:index'));});} if(this.multiselect.options.enable_new_options){this.matches.unshift([this.query,this.query]);} return this.select_index(0);}else{this.matches=[];this.hide_complete_box();return this.query=null;}};AutoComplete.prototype._initSearch=function(){var callback;if(this.busy){callback=function(obj){return obj._initSearch();};return setTimeout(callback,100,this);}else{return this._doSearch();}};AutoComplete.prototype._doSearch=function(){var completions;if(this.busy){return;} this._setBusy(true);try{completions=this.multiselect.options.on_search(this.query);return this.completions=this.parse_completions(completions);}finally{this._setBusy(false);}};AutoComplete.prototype.hide_complete_box=function(){return this.container.fadeOut("fast");};AutoComplete.prototype.select_index=function(index){var items;items=this.list.find("li");items.removeClass("auto-focus");items.filter(":eq("+index+")").addClass("auto-focus");return this.current=index;};AutoComplete.prototype.navigate_down=function(){var next;next=this.current+1;if(next>=this.matches.length){next=0;} return this.select_index(next);};AutoComplete.prototype.navigate_up=function(){var next;next=this.current-1;if(next<0){next=this.matches.length-1;} return this.select_index(next);};AutoComplete.prototype.create_item=function(text,highlight){var item,_this=this;item=$(document.createElement("li"));item.click(function(){_this.multiselect.add_and_reset();_this.search();return _this.input.focus();});item.html(text);this.list.append(item);return item;};AutoComplete.prototype.val=function(){return this.matches[this.current];};AutoComplete.prototype.highlight=function(text,highlight){var char,current,highlighted,i,reg,_i,_len;if(!this.multiselect.options.highlight){return text;} if(this.multiselect.options.complex_search){highlighted="";current=0;for(i=_i=0,_len=text.length;_i<_len;i=++_i){char=text[i];char=text.charAt(i);if(current<highlight.length&&char.toLowerCase()===highlight.charAt(current).toLowerCase()){highlighted+="<em>"+char+"</em>";current++;}else{highlighted+=char;}} return highlighted;}else{reg="("+(RegExp.escape(highlight))+")";return text.replace(new RegExp(reg,"gi"),'<em>$1</em>');}};AutoComplete.prototype.matching_completions=function(text){var char,count,i,reg,_i,_len,_this=this;if(this.multiselect.options.on_search){reg=new RegExp(".*","i");}else if(this.multiselect.options.complex_search){reg="";for(i=_i=0,_len=text.length;_i<_len;i=++_i){char=text[i];char=text.charAt(i);reg+=RegExp.escape(char)+".*";} reg=new RegExp(reg,"i");}else{reg=new RegExp(RegExp.escape(text),"i");} count=0;return $.grep(this.completions,function(c){if(count>=_this.multiselect.options.max_complete_results){return false;} if($.inArray(c[1],_this.multiselect.values_real())>-1){return false;} if(c[0].match(reg)){count++;return true;}else{return false;}});};return AutoComplete;})();$.fn.multiselect=function(options){if(options==null){options={};} return $(this).each(function(){var completions,input,ms,option,select_options,values,_i,_len,_ref;ms=$(this).data('multiselect');if(ms){return ms;} if(this.tagName.toLowerCase()==="select"){input=$(document.createElement("input"));input.attr("type","text");input.attr("name",this.name);input.attr("id",this.id);completions=[];values=[];_ref=this.options;for(_i=0,_len=_ref.length;_i<_len;_i++){option=_ref[_i];completions.push([option.innerHTML,option.value]);if(option.selected){values.push(option.value);}} select_options={completions:completions,input_type:"select",input_values:values,enable_new_options:false};$.extend(select_options,options);$(this).replaceWith(input);ms=new $.MultiSelect(input,select_options);}else if(this.tagName.toLowerCase()==="input"&&this.type==="text"){ms=new $.MultiSelect(this,options);} $(this).data('multiselect',ms);return ms;});};return $(document).ready(function(){var lang,options;lang=$('HTML').attr('lang')||$('HTML').attr('xml:lang');if(lang&&(lang!=='en')){options={dataType:'script',cache:true,url:'/--static--/ztfy.jqueryui/js/i18n/'+lang+'.js',success:function(){$.i18n.setDictionary(I18n_multiselect);return $.MultiSelect.addLabel=$.i18n._('addLabel');}};return $.ajax(options);}});})(jQuery);$.extend(String.prototype,{trim:function(){return this.replace(/^[\r\n\s]/g,'').replace(/[\r\n\s]$/g,'');},entitizeHTML:function(){return this.replace(/</g,'&lt;').replace(/>/g,'&gt;');},unentitizeHTML:function(){return this.replace(/&lt;/g,'<').replace(/&gt;/g,'>');},blank:function(){return this.trim().length===0;},present:function(){return!this.blank();}});RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1');};}).call(this);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-multiselect.min.js
jquery-multiselect.min.js
(function($) { function fixTitle($ele) { if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') { $ele.attr('original-title', $ele.attr('title') || '').removeAttr('title'); } } function Tipsy(element, options) { this.$element = $(element); this.options = options; this.enabled = true; fixTitle(this.$element); } Tipsy.prototype = { show: function() { var title = this.getTitle(); if (title && this.enabled) { var $tip = this.tip(); $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body); var pos = $.extend({}, this.$element.offset(), { width: this.$element[0].offsetWidth, height: this.$element[0].offsetHeight }); var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight; var gravity = (typeof this.options.gravity == 'function') ? this.options.gravity.call(this.$element[0]) : this.options.gravity; var offset = (typeof this.options.offset == 'function') ? this.options.offset.call(this.$element[0]) : this.options.offset; var tp; switch (gravity.charAt(0)) { case 'n': tp = {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - actualWidth / 2}; break; case 's': tp = {top: pos.top - actualHeight - offset, left: pos.left + pos.width / 2 - actualWidth / 2}; break; case 'e': tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - offset}; break; case 'w': tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + offset}; break; } if (gravity.length == 2) { if (gravity.charAt(1) == 'w') { tp.left = pos.left - 5; } else { tp.left = pos.left + pos.width - actualWidth + 5; } } tp.left = Math.min(tp.left, $('html').width() - actualWidth -10); $tip.css(tp).addClass('tipsy-' + gravity); if (this.options.fade) { $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); } else { $tip.css({visibility: 'visible', opacity: this.options.opacity}); } } }, hide: function() { if (this.options.fade) { this.tip().stop().fadeOut(function() { $(this).remove(); }); } else { this.tip().remove(); } }, getTitle: function() { var title, $e = this.$element, o = this.options; fixTitle($e); var title, o = this.options; if (typeof o.title == 'string') { title = $e.attr(o.title == 'title' ? 'original-title' : o.title); } else if (typeof o.title == 'function') { title = o.title.call($e[0]); } title = ('' + title).replace(/(^\s*|\s*$)/, ""); return title || o.fallback; }, tip: function() { if (!this.$tip) { this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"/></div>'); } return this.$tip; }, validate: function() { if (!this.$element[0].parentNode) { this.hide(); this.$element = null; this.options = null; } }, enable: function() { this.enabled = true; }, disable: function() { this.enabled = false; }, toggleEnabled: function() { this.enabled = !this.enabled; } }; $.fn.tipsy = function(options) { if (options === true) { return this.data('tipsy'); } else if (typeof options == 'string') { return this.data('tipsy')[options](); } options = $.extend({}, $.fn.tipsy.defaults, options); function get(ele) { var tipsy = $.data(ele, 'tipsy'); if (!tipsy) { tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); $.data(ele, 'tipsy', tipsy); } return tipsy; } function enter() { var tipsy = get(this); tipsy.hoverState = 'in'; if (options.delayIn == 0) { tipsy.show(); } else { setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); } }; function leave() { var tipsy = get(this); tipsy.hoverState = 'out'; if (options.delayOut == 0) { tipsy.hide(); } else { setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); } }; if (!options.live) this.each(function() { get(this); }); if (options.trigger != 'manual') { var binder = options.live ? 'live' : 'bind', eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; this[binder](eventIn, enter)[binder](eventOut, leave); } return this; }; $.fn.tipsy.defaults = { delayIn: 0, delayOut: 0, fade: false, fallback: '', gravity: 'n', html: false, live: false, offset: 0, opacity: 0.8, title: 'title', trigger: 'hover' }; // Overwrite this method to provide options on a per-element basis. // For example, you could store the gravity in a 'tipsy-gravity' attribute: // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); // (remember - do not modify 'options' in place!) $.fn.tipsy.elementOptions = function(ele, options) { return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; }; $.fn.tipsy.autoNS = function() { return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; }; $.fn.tipsy.autoWE = function() { return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; }; })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-tipsy.js
jquery-tipsy.js
* getStyleProperty by kangax * http://perfectionkills.com/feature-testing-css-properties/ */ (function(c){var d="Webkit Moz ms Ms O".split(" ");var b=document.documentElement.style;function a(h){if(!h){return}if(typeof b[h]==="string"){return h}h=h.charAt(0).toUpperCase()+h.slice(1);var f;for(var g=0,e=d.length;g<e;g++){f=d[g]+h;if(typeof b[f]==="string"){return f}}}if(typeof define==="function"&&define.amd){define(function(){return a})}else{c.getStyleProperty=a}})(window);(function(e,g){var c=document.defaultView;var a=c&&c.getComputedStyle?function(i){return c.getComputedStyle(i,null)}:function(i){return i.currentStyle};function d(j){var i=parseFloat(j);var k=j.indexOf("%")===-1&&!isNaN(i);return k&&i}var b=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];function f(){var l={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var k=0,j=b.length;k<j;k++){var m=b[k];l[m]=0}return l}function h(k){var i=k("boxSizing");var j;(function(){if(!i){return}var o=document.createElement("div");o.style.width="200px";o.style.padding="1px 2px 3px 4px";o.style.borderStyle="solid";o.style.borderWidth="1px 2px 3px 4px";o.style[i]="border-box";var m=document.body||document.documentElement;m.appendChild(o);var n=a(o);j=d(n.width)===200;m.removeChild(o)})();function l(B){if(typeof B==="string"){B=document.querySelector(B)}if(!B||typeof B!=="object"||!B.nodeType){return}var z=a(B);if(z.display==="none"){return f()}var s={};s.width=B.offsetWidth;s.height=B.offsetHeight;var A=s.isBorderBox=!!(i&&z[i]&&z[i]==="border-box");for(var w=0,x=b.length;w<x;w++){var u=b[w];var v=z[u];var m=parseFloat(v);s[u]=!isNaN(m)?m:0}var y=s.paddingLeft+s.paddingRight;var r=s.paddingTop+s.paddingBottom;var D=s.marginLeft+s.marginRight;var p=s.marginTop+s.marginBottom;var C=s.borderLeftWidth+s.borderRightWidth;var o=s.borderTopWidth+s.borderBottomWidth;var n=A&&j;var q=d(z.width);if(q!==false){s.width=q+(n?0:y+C)}var t=d(z.height);if(t!==false){s.height=t+(n?0:r+o)}s.innerWidth=s.width-(y+C);s.innerHeight=s.height-(r+o);s.outerWidth=s.width+D;s.outerHeight=s.height+p;return s}return l}if(typeof define==="function"&&define.amd){define(["get-style-property"],h)}else{e.getSize=h(e.getStyleProperty)}})(window); /* * eventie v1.0.3 * event binding helper * eventie.bind( elem, 'click', myFn ) * eventie.unbind( elem, 'click', myFn ) */ (function(d){var a=document.documentElement;var e=function(){};if(a.addEventListener){e=function(h,g,f){h.addEventListener(g,f,false)}}else{if(a.attachEvent){e=function(h,g,f){h[g+f]=f.handleEvent?function(){var i=d.event;i.target=i.target||i.srcElement;f.handleEvent.call(f,i)}:function(){var i=d.event;i.target=i.target||i.srcElement;f.call(h,i)};h.attachEvent("on"+g,h[g+f])}}}var c=function(){};if(a.removeEventListener){c=function(h,g,f){h.removeEventListener(g,f,false)}}else{if(a.detachEvent){c=function(i,g,f){i.detachEvent("on"+g,i[g+f]);try{delete i[g+f]}catch(h){i[g+f]=undefined}}}}var b={bind:e,unbind:c};if(typeof define==="function"&&define.amd){define(b)}else{d.eventie=b}})(this); /* * docReady * Cross browser DOMContentLoaded event emitter */ (function(d){var b=d.document;var a=[];function c(g){if(typeof g!=="function"){return}if(c.isReady){g()}else{a.push(g)}}c.isReady=false;function f(l){var k=l.type==="readystatechange"&&b.readyState!=="complete";if(c.isReady||k){return}c.isReady=true;for(var h=0,g=a.length;h<g;h++){var j=a[h];j()}}function e(g){g.bind(b,"DOMContentLoaded",f);g.bind(b,"readystatechange",f);g.bind(d,"load",f);return c}if(typeof define==="function"&&define.amd){define(["eventie"],e)}else{d.docReady=e(d.eventie)}})(this); /* * EventEmitter v4.1.0 - git.io/ee * Oliver Caldwell * MIT license * @preserve */ (function(b){function e(){}var d=e.prototype,a=Array.prototype.indexOf?true:false;function c(h,g){if(a){return g.indexOf(h)}var f=g.length;while(f--){if(g[f]===h){return f}}return -1}d._getEvents=function(){return this._events||(this._events={})};d.getListeners=function(f){var i=this._getEvents(),g,h;if(typeof f==="object"){g={};for(h in i){if(i.hasOwnProperty(h)&&f.test(h)){g[h]=i[h]}}}else{g=i[f]||(i[f]=[])}return g};d.getListenersAsObject=function(f){var h=this.getListeners(f),g;if(h instanceof Array){g={};g[f]=h}return g||h};d.addListener=function(f,i){var h=this.getListenersAsObject(f),g;for(g in h){if(h.hasOwnProperty(g)&&c(i,h[g])===-1){h[g].push(i)}}return this};d.on=d.addListener;d.defineEvent=function(f){this.getListeners(f);return this};d.defineEvents=function(f){for(var g=0;g<f.length;g+=1){this.defineEvent(f[g])}return this};d.removeListener=function(f,j){var i=this.getListenersAsObject(f),g,h;for(h in i){if(i.hasOwnProperty(h)){g=c(j,i[h]);if(g!==-1){i[h].splice(g,1)}}}return this};d.off=d.removeListener;d.addListeners=function(f,g){return this.manipulateListeners(false,f,g)};d.removeListeners=function(f,g){return this.manipulateListeners(true,f,g)};d.manipulateListeners=function(g,h,k){var j,l,m=g?this.removeListener:this.addListener,f=g?this.removeListeners:this.addListeners;if(typeof h==="object"&&!(h instanceof RegExp)){for(j in h){if(h.hasOwnProperty(j)&&(l=h[j])){if(typeof l==="function"){m.call(this,j,l)}else{f.call(this,j,l)}}}}else{j=k.length;while(j--){m.call(this,h,k[j])}}return this};d.removeEvent=function(f){var i=typeof f,h=this._getEvents(),g;if(i==="string"){delete h[f]}else{if(i==="object"){for(g in h){if(h.hasOwnProperty(g)&&f.test(g)){delete h[g]}}}else{delete this._events}}return this};d.emitEvent=function(f,h){var l=this.getListenersAsObject(f),k,j,g;for(j in l){if(l.hasOwnProperty(j)){k=l[j].length;while(k--){g=h?l[j][k].apply(null,h):l[j][k]();if(g===true){this.removeListener(f,l[j][k])}}}}return this};d.trigger=d.emitEvent;d.emit=function(f){var g=Array.prototype.slice.call(arguments,1);return this.emitEvent(f,g)};if(typeof define==="function"&&define.amd){define(function(){return e})}else{b.EventEmitter=e}}(this));(function(c){var d=Array.prototype.slice;function b(){}function a(f){if(!f){return}function h(i){if(i.prototype.option){return}i.prototype.option=function(j){if(!f.isPlainObject(j)){return}this.options=f.extend(true,this.options,j)}}var e=typeof console==="undefined"?b:function(i){console.error(i)};function g(i,j){f.fn[i]=function(n){if(typeof n==="string"){var m=d.call(arguments,1);for(var o=0,l=this.length;o<l;o++){var q=this[o];var k=f.data(q,i);if(!k){e("cannot call methods on "+i+" prior to initialization; attempted to call '"+n+"'");continue}if(!f.isFunction(k[n])||n.charAt(0)==="_"){e("no such method '"+n+"' for "+i+" instance");continue}var p=k[n].apply(k,m);if(p!==undefined){return p}}return this}else{return this.each(function(){var r=f.data(this,i);if(r){r.option(n);r._init()}else{r=new j(this,n);f.data(this,i,r)}})}}}f.bridget=function(i,j){h(j);g(i,j)}}if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(c.jQuery)}})(window);(function(b,i){var g=(function(){if(i.matchesSelector){return"matchesSelector"}var n=["webkit","moz","ms","o"];for(var l=0,k=n.length;l<k;l++){var m=n[l];var o=m+"MatchesSelector";if(i[o]){return o}}})();function e(l,k){return l[g](k)}function h(l){if(l.parentNode){return}var k=document.createDocumentFragment();k.appendChild(l)}function f(o,l){h(o);var m=o.parentNode.querySelectorAll(l);for(var n=0,k=m.length;n<k;n++){if(m[n]===o){return true}}return false}function d(l,k){h(l);return e(l,k)}var j;if(g){var a=document.createElement("div");var c=e(a,"div");j=c?e:d}else{j=f}if(typeof define==="function"&&define.amd){define(function(){return j})}else{window.matchesSelector=j}})(this,Element.prototype);(function(i){var p=i.getSize;var d=i.getStyleProperty;var q=i.EventEmitter;var e=document.defaultView;var l=e&&e.getComputedStyle?function(r){return e.getComputedStyle(r,null)}:function(r){return r.currentStyle};function k(s,r){for(var t in r){s[t]=r[t]}return s}var o=d("transition");var j=d("transform");var m=o&&j;var g=!!d("perspective");var a={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[o];var f=["transform","transition","transitionDuration","transitionProperty"];var n=(function(){var s={};for(var t=0,r=f.length;t<r;t++){var v=f[t];var u=d(v);if(u&&u!==v){s[v]=u}}return s})();function c(r,s){if(!r){return}this.element=r;this.layout=s;this.position={x:0,y:0};this._create()}k(c.prototype,q.prototype);c.prototype._create=function(){this.css({position:"absolute"})};c.prototype.handleEvent=function(r){var s="on"+r.type;if(this[s]){this[s](r)}};c.prototype.getSize=function(){this.size=p(this.element)};c.prototype.css=function(t){var r=this.element.style;for(var u in t){var s=n[u]||u;r[s]=t[u]}};c.prototype.getPosition=function(){var u=l(this.element);var s=this.layout.options;var z=s.isOriginLeft;var w=s.isOriginTop;var r=parseInt(u[z?"left":"right"],10);var v=parseInt(u[w?"top":"bottom"],10);r=isNaN(r)?0:r;v=isNaN(v)?0:v;var t=this.layout.size;r-=z?t.paddingLeft:t.paddingRight;v-=w?t.paddingTop:t.paddingBottom;this.position.x=r;this.position.y=v};c.prototype.layoutPosition=function(){var s=this.layout.size;var r=this.layout.options;var t={};if(r.isOriginLeft){t.left=(this.position.x+s.paddingLeft)+"px";t.right=""}else{t.right=(this.position.x+s.paddingRight)+"px";t.left=""}if(r.isOriginTop){t.top=(this.position.y+s.paddingTop)+"px";t.bottom=""}else{t.bottom=(this.position.y+s.paddingBottom)+"px";t.top=""}this.css(t);this.emitEvent("layout",[this])};var b=g?function(r,s){return"translate3d("+r+"px, "+s+"px, 0)"}:function(r,s){return"translate("+r+"px, "+s+"px)"};c.prototype._transitionTo=function(C,B){this.getPosition();var s=this.position.x;var r=this.position.y;var A=parseInt(C,10);var z=parseInt(B,10);var w=A===this.position.x&&z===this.position.y;this.setPosition(C,B);if(w&&!this.isTransitioning){this.layoutPosition();return}var v=C-s;var u=B-r;var t={};var D=this.layout.options;v=D.isOriginLeft?v:-v;u=D.isOriginTop?u:-u;t.transform=b(v,u);this.transition({to:t,onTransitionEnd:this.layoutPosition,isCleaning:true})};c.prototype.goTo=function(r,s){this.setPosition(r,s);this.layoutPosition()};c.prototype.moveTo=m?c.prototype._transitionTo:c.prototype.goTo;c.prototype.setPosition=function(r,s){this.position.x=parseInt(r,10);this.position.y=parseInt(s,10)};c.prototype._nonTransition=function(r){this.css(r.to);if(r.isCleaning){this._removeStyles(r.to)}if(r.onTransitionEnd){r.onTransitionEnd.call(this)}};c.prototype._transition=function(t){var r=this.layout.options.transitionDuration;if(!parseFloat(r)){this._nonTransition(t);return}var w=t.to;var v=[];for(var x in w){v.push(x)}var s={};s.transitionProperty=v.join(",");s.transitionDuration=r;this.element.addEventListener(a,this,false);if(t.isCleaning||t.onTransitionEnd){this.on("transitionEnd",function(y){if(t.isCleaning){y._removeStyles(w)}if(t.onTransitionEnd){t.onTransitionEnd.call(y)}return true})}if(t.from){this.css(t.from);var u=this.element.offsetHeight;u=null}this.css(s);this.css(w);this.isTransitioning=true};c.prototype.transition=c.prototype[o?"_transition":"_nonTransition"];c.prototype.onwebkitTransitionEnd=function(r){this.ontransitionend(r)};c.prototype.onotransitionend=function(r){this.ontransitionend(r)};c.prototype.ontransitionend=function(r){if(r.target!==this.element){return}this.removeTransitionStyles();this.element.removeEventListener(a,this,false);this.isTransitioning=false;this.emitEvent("transitionEnd",[this])};c.prototype._removeStyles=function(s){var r={};for(var t in s){r[t]=""}this.css(r)};var h={transitionProperty:"",transitionDuration:""};c.prototype.removeTransitionStyles=function(){this.css(h)};c.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element);this.emitEvent("remove",[this])};c.prototype.remove=o?function(){var r=this;this.on("transitionEnd",function(){r.removeElem();return true});this.hide()}:c.prototype.removeElem;c.prototype.reveal=function(){this.css({display:""});var r=this.layout.options;this.transition({from:r.hiddenStyle,to:r.visibleStyle,isCleaning:true})};c.prototype.hide=function(){this.css({display:""});var r=this.layout.options;this.transition({from:r.visibleStyle,to:r.hiddenStyle,isCleaning:true,onTransitionEnd:function(){this.css({display:"none"})}})};c.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})};i.Outlayer={Item:c}})(window); /* * Outlayer v1.0.0 * the brains and guts of a layout library */ (function(n){var l=n.Outlayer;var f=l.Item;var h=n.docReady;var m=n.EventEmitter;var p=n.eventie;var g=n.getSize;var a=n.matchesSelector;var s=n.document;var v=n.console;var r=n.jQuery;var j=function(){};function x(A,z){for(var B in z){A[B]=z[B]}return A}var d=Object.prototype.toString;function q(z){return d.call(z)==="[object Array]"}function o(C){var B=[];if(q(C)){B=C}else{if(typeof C.length==="number"){for(var A=0,z=C.length;A<z;A++){B.push(C[A])}}else{B.push(C)}}return B}var t=(typeof HTMLElement==="object")?function u(z){return z instanceof HTMLElement}:function w(z){return z&&typeof z==="object"&&z.nodeType===1&&typeof z.nodeName==="string"};var c=Array.prototype.indexOf?function(z,A){return z.indexOf(A)}:function(B,C){for(var A=0,z=B.length;A<z;A++){if(B[A]===C){return A}}return -1};function k(z){return z.replace(/(.)([A-Z])/g,function(B,A,C){return A+"-"+C}).toLowerCase()}var y=0;var i={};function e(A,z){if(typeof A==="string"){A=s.querySelector(A)}if(!A||!t(A)){if(v){v.error("Bad "+this.settings.namespace+" element: "+A)}return}this.element=A;this.options=x({},this.options);x(this.options,z);var B=++y;this.element.outlayerGUID=B;i[B]=this;this._create();if(this.options.isInitLayout){this.layout()}}e.prototype.settings={namespace:"outlayer",item:l.Item};e.prototype.options={containerStyle:{position:"relative"},isInitLayout:true,isOriginLeft:true,isOriginTop:true,isResizeBound:true,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};x(e.prototype,m.prototype);e.prototype._create=function(){this.reloadItems();this.stamps=[];this.stamp(this.options.stamp);x(this.element.style,this.options.containerStyle);if(this.options.isResizeBound){this.bindResize()}};e.prototype.reloadItems=function(){this.items=this._getItems(this.element.children)};e.prototype._getItems=function(B){var E=this._filterFindItemElements(B);var C=this.settings.item;var A=[];for(var D=0,z=E.length;D<z;D++){var G=E[D];var F=new C(G,this,this.options.itemOptions);A.push(F)}return A};e.prototype._filterFindItemElements=function(z){z=o(z);var A=this.options.itemSelector;if(!A){return z}var E=[];for(var D=0,F=z.length;D<F;D++){var B=z[D];if(a(B,A)){E.push(B)}var G=B.querySelectorAll(A);for(var C=0,H=G.length;C<H;C++){E.push(G[C])}}return E};e.prototype.getItemElements=function(){var A=[];for(var B=0,z=this.items.length;B<z;B++){A.push(this.items[B].element)}return A};e.prototype.layout=function(){this._resetLayout();this._manageStamps();var z=this.options.isLayoutInstant!==undefined?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,z);this._isLayoutInited=true};e.prototype._init=e.prototype.layout;e.prototype._resetLayout=function(){this.getSize()};e.prototype.getSize=function(){this.size=g(this.element)};e.prototype._getMeasurement=function(B,z){var A=this.options[B];var C;if(!A){this[B]=0}else{if(typeof A==="string"){C=this.element.querySelector(A)}else{if(t(A)){C=A}}this[B]=C?g(C)[z]:A}};e.prototype.layoutItems=function(z,A){z=this._getItemsForLayout(z);this._layoutItems(z,A);this._postLayout()};e.prototype._getItemsForLayout=function(A){var D=[];for(var B=0,z=A.length;B<z;B++){var C=A[B];if(!C.isIgnored){D.push(C)}}return D};e.prototype._layoutItems=function(C,G){if(!C||!C.length){this.emitEvent("layoutComplete",[this,C]);return}this._itemsOn(C,"layout",function F(){this.emitEvent("layoutComplete",[this,C])});var B=[];for(var D=0,A=C.length;D<A;D++){var E=C[D];var z=this._getItemLayoutPosition(E);z.item=E;z.isInstant=G;B.push(z)}this._processLayoutQueue(B)};e.prototype._getItemLayoutPosition=function(){return{x:0,y:0}};e.prototype._processLayoutQueue=function(A){for(var B=0,z=A.length;B<z;B++){var C=A[B];this._positionItem(C.item,C.x,C.y,C.isInstant)}};e.prototype._positionItem=function(A,z,C,B){if(B){A.goTo(z,C)}else{A.moveTo(z,C)}};e.prototype._postLayout=function(){var z=this._getContainerSize();if(z){this._setContainerMeasure(z.width,true);this._setContainerMeasure(z.height,false)}};e.prototype._getContainerSize=j;e.prototype._setContainerMeasure=function(z,A){if(z===undefined){return}var B=this.size;if(B.isBorderBox){z+=A?B.paddingLeft+B.paddingRight+B.borderLeftWidth+B.borderRightWidth:B.paddingBottom+B.paddingTop+B.borderTopWidth+B.borderBottomWidth}z=Math.max(z,0);this.element.style[A?"width":"height"]=z+"px"};e.prototype._itemsOn=function(G,C,H){var z=0;var F=G.length;var E=this;function B(){z++;if(z===F){H.call(E)}return true}for(var A=0,D=G.length;A<D;A++){var I=G[A];I.on(C,B)}};e.prototype.ignore=function(A){var z=this.getItem(A);if(z){z.isIgnored=true}};e.prototype.unignore=function(A){var z=this.getItem(A);if(z){delete z.isIgnored}};e.prototype.stamp=function(A){A=this._find(A);if(!A){return}this.stamps=this.stamps.concat(A);for(var B=0,z=A.length;B<z;B++){var C=A[B];this.ignore(C)}};e.prototype.unstamp=function(A){A=this._find(A);if(!A){return}for(var C=0,z=A.length;C<z;C++){var D=A[C];var B=c(this.stamps,D);if(B!==-1){this.stamps.splice(B,1)}this.unignore(D)}};e.prototype._find=function(z){if(!z){return}if(typeof z==="string"){z=this.element.querySelectorAll(z)}z=o(z);return z};e.prototype._manageStamps=function(){if(!this.stamps||!this.stamps.length){return}this._getBoundingRect();for(var B=0,z=this.stamps.length;B<z;B++){var A=this.stamps[B];this._manageStamp(A)}};e.prototype._getBoundingRect=function(){var z=this.element.getBoundingClientRect();var A=this.size;this._boundingRect={left:z.left+A.paddingLeft+A.borderLeftWidth,top:z.top+A.paddingTop+A.borderTopWidth,right:z.right-(A.paddingRight+A.borderRightWidth),bottom:z.bottom-(A.paddingBottom+A.borderBottomWidth)}};e.prototype._manageStamp=j;e.prototype._getElementOffset=function(C){var z=C.getBoundingClientRect();var B=this._boundingRect;var A=g(C);var D={left:z.left-B.left-A.marginLeft,top:z.top-B.top-A.marginTop,right:B.right-z.right-A.marginRight,bottom:B.bottom-z.bottom-A.marginBottom};return D};e.prototype.handleEvent=function(z){var A="on"+z.type;if(this[A]){this[A](z)}};e.prototype.bindResize=function(){if(this.isResizeBound){return}p.bind(n,"resize",this);this.isResizeBound=true};e.prototype.unbindResize=function(){p.unbind(n,"resize",this);this.isResizeBound=false};e.prototype.onresize=function(){if(this.resizeTimeout){clearTimeout(this.resizeTimeout)}var A=this;function z(){A.resize()}this.resizeTimeout=setTimeout(z,100)};e.prototype.resize=function(){var A=g(this.element);var z=this.size&&A;if(z&&A.innerWidth===this.size.innerWidth){return}this.layout();delete this.resizeTimeout};e.prototype.addItems=function(A){var z=this._getItems(A);if(!z.length){return}this.items=this.items.concat(z);return z};e.prototype.appended=function(A){var z=this.addItems(A);if(!z.length){return}this.layoutItems(z,true);this.reveal(z)};e.prototype.prepended=function(A){var z=this._getItems(A);if(!z.length){return}var B=this.items.slice(0);this.items=z.concat(B);this._resetLayout();this.layoutItems(z,true);this.reveal(z);this.layoutItems(B)};e.prototype.reveal=function(A){if(!A||!A.length){return}for(var B=0,z=A.length;B<z;B++){var C=A[B];C.reveal()}};e.prototype.hide=function(A){if(!A||!A.length){return}for(var B=0,z=A.length;B<z;B++){var C=A[B];C.hide()}};e.prototype.getItem=function(C){for(var A=0,z=this.items.length;A<z;A++){var B=this.items[A];if(B.element===C){return B}}};e.prototype.getItems=function(B){if(!B||!B.length){return}var A=[];for(var C=0,z=B.length;C<z;C++){var E=B[C];var D=this.getItem(E);if(D){A.push(D)}}return A};e.prototype.remove=function(A){A=o(A);var D=this.getItems(A);this._itemsOn(D,"remove",function(){this.emitEvent("removeComplete",[this,D])});for(var C=0,z=D.length;C<z;C++){var E=D[C];E.remove();var B=c(this.items,E);this.items.splice(B,1)}};e.prototype.destroy=function(){var B=this.element.style;B.height="";B.position="";B.width="";for(var A=0,z=this.items.length;A<z;A++){var C=this.items[A];C.destroy()}this.unbindResize();delete this.element.outlayerGUID};e.data=function(z){var A=z&&z.outlayerGUID;return A&&i[A]};function b(A,z){A.prototype[z]=x({},e.prototype[z])}e.create=function(C,A){function B(){e.apply(this,arguments)}x(B.prototype,e.prototype);b(B,"options");b(B,"settings");x(B.prototype.options,A);B.prototype.settings.namespace=C;B.data=e.data;B.Item=function z(){f.apply(this,arguments)};B.Item.prototype=new e.Item();B.prototype.settings.item=B.Item;h(function(){var J=k(C);var D=s.querySelectorAll(".js-"+J);var K="data-"+J+"-options";for(var F=0,G=D.length;F<G;F++){var E=D[F];var H=E.getAttribute(K);var M;try{M=H&&JSON.parse(H)}catch(I){if(v){v.error("Error parsing "+K+" on "+E.nodeName.toLowerCase()+(E.id?"#"+E.id:"")+": "+I)}continue}var L=new B(E,M);if(r){r.data(E,C,L)}}});if(r&&r.bridget){r.bridget(C,B)}return B};e.Item=f;n.Outlayer=e})(window); /* * Masonry v3.0.0 * Cascading grid layout library * http://masonry.desandro.com * MIT License * by David DeSandro */ (function(c){var b=Array.prototype.indexOf?function(d,e){return d.indexOf(e)}:function(e,h){for(var f=0,d=e.length;f<d;f++){var g=e[f];if(g===h){return f}}return -1};function a(e,f){var d=e.create("masonry");d.prototype._resetLayout=function(){this.getSize();this._getMeasurement("columnWidth","outerWidth");this._getMeasurement("gutter","outerWidth");this.measureColumns();var g=this.cols;this.colYs=[];while(g--){this.colYs.push(0)}this.maxY=0};d.prototype.measureColumns=function(){var g=this.items[0].element;this.columnWidth=this.columnWidth||f(g).outerWidth;this.columnWidth+=this.gutter;this.cols=Math.floor((this.size.innerWidth+this.gutter)/this.columnWidth);this.cols=Math.max(this.cols,1)};d.prototype._getItemLayoutPosition=function(p){p.getSize();var m=Math.ceil(p.size.outerWidth/this.columnWidth);m=Math.min(m,this.cols);var g=this._getColGroup(m);var h=Math.min.apply(Math,g);var n=b(g,h);var l={x:this.columnWidth*n,y:h};var o=h+p.size.outerHeight;var j=this.cols+1-g.length;for(var k=0;k<j;k++){this.colYs[n+k]=o}return l};d.prototype._getColGroup=function(j){if(j===1){return this.colYs}var k=[];var l=this.cols+1-j;for(var g=0;g<l;g++){var h=this.colYs.slice(g,g+j);k[g]=Math.max.apply(Math,h)}return k};d.prototype._manageStamp=function(g){var n=f(g);var l=this._getElementOffset(g);var k=this.options.isOriginLeft?l.left:l.right;var h=k+n.outerWidth;var p=Math.floor(k/this.columnWidth);p=Math.max(0,p);var j=Math.floor(h/this.columnWidth);j=Math.min(this.cols-1,j);var o=(this.options.isOriginTop?l.top:l.bottom)+n.outerHeight;for(var m=p;m<=j;m++){this.colYs[m]=Math.max(o,this.colYs[m])}};d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);return{height:this.maxY}};return d}if(typeof define==="function"&&define.amd){define(["outlayer","get-size"],a)}else{c.Masonry=a(c.Outlayer,c.getSize)}})(window);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-masonry.min.js
jquery-masonry.min.js
(function(){ var // Will speed up references to window, and allows munging its name. window = this, // Will speed up references to undefined, and allows munging its name. undefined, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, jQuery = window.jQuery = window.$ = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context ); }, // A simple way to check for HTML strings or ID strings // (both of which we optimize for) quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, // Is it a simple selector isSimple = /^.[^:#\[\.,]*$/; jQuery.fn = jQuery.prototype = { init: function( selector, context ) { // Make sure that a selection was provided selector = selector || document; // Handle $(DOMElement) if ( selector.nodeType ) { this[0] = selector; this.length = 1; this.context = selector; return this; } // Handle HTML strings if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? var match = quickExpr.exec( selector ); // Verify a match, and that no context was specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) selector = jQuery.clean( [ match[1] ], context ); // HANDLE: $("#id") else { var elem = document.getElementById( match[3] ); // Make sure an element was located if ( elem ){ // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id != match[3] ) return jQuery().find( selector ); // Otherwise, we inject the element directly into the jQuery object var ret = jQuery( elem ); ret.context = document; ret.selector = selector; return ret; } selector = []; } // HANDLE: $(expr, [context]) // (which is just equivalent to: $(content).find(expr) } else return jQuery( context ).find( selector ); // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) return jQuery( document ).ready( selector ); // Make sure that old selector state is passed along if ( selector.selector && selector.context ) { this.selector = selector.selector; this.context = selector.context; } return this.setArray(jQuery.makeArray(selector)); }, // Start with an empty selector selector: "", // The current version of jQuery being used jquery: "1.3", // The number of elements contained in the matched element set size: function() { return this.length; }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num === undefined ? // Return a 'clean' array jQuery.makeArray( this ) : // Return just the object this[ num ]; }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = jQuery( elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; if ( name === "find" ) ret.selector = this.selector + (this.selector ? " " : "") + selector; else if ( name ) ret.selector = this.selector + "." + name + "(" + selector + ")"; // Return the newly-formed element set return ret; }, // Force the current matched set of elements to become // the specified array of elements (destroying the stack in the process) // You should use pushStack() in order to do this, but maintain the stack setArray: function( elems ) { // Resetting the length to 0, then using the native Array push // is a super-fast way to populate an object with array-like properties this.length = 0; Array.prototype.push.apply( this, elems ); return this; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem && elem.jquery ? elem[0] : elem , this ); }, attr: function( name, value, type ) { var options = name; // Look for the case where we're accessing a style value if ( typeof name === "string" ) if ( value === undefined ) return this[0] && jQuery[ type || "attr" ]( this[0], name ); else { options = {}; options[ name ] = value; } // Check to see if we're setting style values return this.each(function(i){ // Set all the styles for ( name in options ) jQuery.attr( type ? this.style : this, name, jQuery.prop( this, options[ name ], type, i, name ) ); }); }, css: function( key, value ) { // ignore negative width and height values if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) value = undefined; return this.attr( key, value, "curCSS" ); }, text: function( text ) { if ( typeof text !== "object" && text != null ) return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); var ret = ""; jQuery.each( text || this, function(){ jQuery.each( this.childNodes, function(){ if ( this.nodeType != 8 ) ret += this.nodeType != 1 ? this.nodeValue : jQuery.fn.text( [ this ] ); }); }); return ret; }, wrapAll: function( html ) { if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).clone(); if ( this[0].parentNode ) wrap.insertBefore( this[0] ); wrap.map(function(){ var elem = this; while ( elem.firstChild ) elem = elem.firstChild; return elem; }).append(this); } return this; }, wrapInner: function( html ) { return this.each(function(){ jQuery( this ).contents().wrapAll( html ); }); }, wrap: function( html ) { return this.each(function(){ jQuery( this ).wrapAll( html ); }); }, append: function() { return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.appendChild( elem ); }); }, prepend: function() { return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.insertBefore( elem, this.firstChild ); }); }, before: function() { return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this ); }); }, after: function() { return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this.nextSibling ); }); }, end: function() { return this.prevObject || jQuery( [] ); }, // For internal use only. // Behaves like an Array's .push method, not like a jQuery method. push: [].push, find: function( selector ) { if ( this.length === 1 && !/,/.test(selector) ) { var ret = this.pushStack( [], "find", selector ); ret.length = 0; jQuery.find( selector, this[0], ret ); return ret; } else { var elems = jQuery.map(this, function(elem){ return jQuery.find( selector, elem ); }); return this.pushStack( /[^+>] [^+>]/.test( selector ) ? jQuery.unique( elems ) : elems, "find", selector ); } }, clone: function( events ) { // Do the clone var ret = this.map(function(){ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { // IE copies events bound via attachEvent when // using cloneNode. Calling detachEvent on the // clone will also remove the events from the orignal // In order to get around this, we use innerHTML. // Unfortunately, this means some modifications to // attributes in IE that are actually only stored // as properties will not be copied (such as the // the name attribute on an input). var clone = this.cloneNode(true), container = document.createElement("div"); container.appendChild(clone); return jQuery.clean([container.innerHTML])[0]; } else return this.cloneNode(true); }); // Need to set the expando to null on the cloned set if it exists // removeData doesn't work here, IE removes it from the original as well // this is primarily for IE but the data expando shouldn't be copied over in any browser var clone = ret.find("*").andSelf().each(function(){ if ( this[ expando ] !== undefined ) this[ expando ] = null; }); // Copy the events from the original to the clone if ( events === true ) this.find("*").andSelf().each(function(i){ if (this.nodeType == 3) return; var events = jQuery.data( this, "events" ); for ( var type in events ) for ( var handler in events[ type ] ) jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); }); // Return the cloned set return ret; }, filter: function( selector ) { return this.pushStack( jQuery.isFunction( selector ) && jQuery.grep(this, function(elem, i){ return selector.call( elem, i ); }) || jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ return elem.nodeType === 1; }) ), "filter", selector ); }, closest: function( selector ) { var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null; return this.map(function(){ var cur = this; while ( cur && cur.ownerDocument ) { if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) return cur; cur = cur.parentNode; } }); }, not: function( selector ) { if ( typeof selector === "string" ) // test special case where just one selector is passed in if ( isSimple.test( selector ) ) return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); else selector = jQuery.multiFilter( selector, this ); var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; return this.filter(function() { return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; }); }, add: function( selector ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), typeof selector === "string" ? jQuery( selector ) : jQuery.makeArray( selector ) ))); }, is: function( selector ) { return !!selector && jQuery.multiFilter( selector, this ).length > 0; }, hasClass: function( selector ) { return !!selector && this.is( "." + selector ); }, val: function( value ) { if ( value === undefined ) { var elem = this[0]; if ( elem ) { if( jQuery.nodeName( elem, 'option' ) ) return (elem.attributes.value || {}).specified ? elem.value : elem.text; // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, values = [], options = elem.options, one = elem.type == "select-one"; // Nothing was selected if ( index < 0 ) return null; // Loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; if ( option.selected ) { // Get the specifc value for the option value = jQuery(option).val(); // We don't need an array for one selects if ( one ) return value; // Multi-Selects return an array values.push( value ); } } return values; } // Everything else, we just grab the value return (elem.value || "").replace(/\r/g, ""); } return undefined; } if ( typeof value === "number" ) value += ''; return this.each(function(){ if ( this.nodeType != 1 ) return; if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0); else if ( jQuery.nodeName( this, "select" ) ) { var values = jQuery.makeArray(value); jQuery( "option", this ).each(function(){ this.selected = (jQuery.inArray( this.value, values ) >= 0 || jQuery.inArray( this.text, values ) >= 0); }); if ( !values.length ) this.selectedIndex = -1; } else this.value = value; }); }, html: function( value ) { return value === undefined ? (this[0] ? this[0].innerHTML : null) : this.empty().append( value ); }, replaceWith: function( value ) { return this.after( value ).remove(); }, eq: function( i ) { return this.slice( i, +i + 1 ); }, slice: function() { return this.pushStack( Array.prototype.slice.apply( this, arguments ), "slice", Array.prototype.slice.call(arguments).join(",") ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function(elem, i){ return callback.call( elem, i, elem ); })); }, andSelf: function() { return this.add( this.prevObject ); }, domManip: function( args, table, callback ) { if ( this[0] ) { var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), first = fragment.firstChild, extra = this.length > 1 ? fragment.cloneNode(true) : fragment; if ( first ) for ( var i = 0, l = this.length; i < l; i++ ) callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment ); if ( scripts ) jQuery.each( scripts, evalScript ); } return this; function root( elem, cur ) { return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? (elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem; } } }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; function evalScript( i, elem ) { if ( elem.src ) jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); else jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); if ( elem.parentNode ) elem.parentNode.removeChild( elem ); } function now(){ return +new Date; } jQuery.extend = jQuery.fn.extend = function() { // copy reference to target object var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) target = {}; // extend jQuery itself if only one argument is passed if ( length == i ) { target = this; --i; } for ( ; i < length; i++ ) // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) // Extend the base object for ( var name in options ) { var src = target[ name ], copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) continue; // Recurse if we're merging object values if ( deep && copy && typeof copy === "object" && !copy.nodeType ) target[ name ] = jQuery.extend( deep, // Never move original objects, clone them src || ( copy.length != null ? [ ] : { } ) , copy ); // Don't bring in undefined values else if ( copy !== undefined ) target[ name ] = copy; } // Return the modified object return target; }; // exclude the following css properties to add px var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, // cache defaultView defaultView = document.defaultView || {}, toString = Object.prototype.toString; jQuery.extend({ noConflict: function( deep ) { window.$ = _$; if ( deep ) window.jQuery = _jQuery; return jQuery; }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return toString.call(obj) === "[object Function]"; }, isArray: function( obj ) { return toString.call(obj) === "[object Array]"; }, // check if an element is in a (or is an) XML document isXMLDoc: function( elem ) { return elem.documentElement && !elem.body || elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; }, // Evalulates a script in a global context globalEval: function( data ) { data = jQuery.trim( data ); if ( data ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement, script = document.createElement("script"); script.type = "text/javascript"; if ( jQuery.support.scriptEval ) script.appendChild( document.createTextNode( data ) ); else script.text = data; // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709). head.insertBefore( script, head.firstChild ); head.removeChild( script ); } }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length; if ( args ) { if ( length === undefined ) { for ( name in object ) if ( callback.apply( object[ name ], args ) === false ) break; } else for ( ; i < length; ) if ( callback.apply( object[ i++ ], args ) === false ) break; // A special, fast, case for the most common use of each } else { if ( length === undefined ) { for ( name in object ) if ( callback.call( object[ name ], name, object[ name ] ) === false ) break; } else for ( var value = object[0]; i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} } return object; }, prop: function( elem, value, type, i, name ) { // Handle executable functions if ( jQuery.isFunction( value ) ) value = value.call( elem, i ); // Handle passing in a number to a CSS property return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? value + "px" : value; }, className: { // internal only, use addClass("class") add: function( elem, classNames ) { jQuery.each((classNames || "").split(/\s+/), function(i, className){ if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) elem.className += (elem.className ? " " : "") + className; }); }, // internal only, use removeClass("class") remove: function( elem, classNames ) { if (elem.nodeType == 1) elem.className = classNames !== undefined ? jQuery.grep(elem.className.split(/\s+/), function(className){ return !jQuery.className.has( classNames, className ); }).join(" ") : ""; }, // internal only, use hasClass("class") has: function( elem, className ) { return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; } }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { var old = {}; // Remember the old values, and insert the new ones for ( var name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } callback.call( elem ); // Revert the old values for ( var name in options ) elem.style[ name ] = old[ name ]; }, css: function( elem, name, force ) { if ( name == "width" || name == "height" ) { var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; function getWH() { val = name == "width" ? elem.offsetWidth : elem.offsetHeight; var padding = 0, border = 0; jQuery.each( which, function() { padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; }); val -= Math.round(padding + border); } if ( jQuery(elem).is(":visible") ) getWH(); else jQuery.swap( elem, props, getWH ); return Math.max(0, val); } return jQuery.curCSS( elem, name, force ); }, curCSS: function( elem, name, force ) { var ret, style = elem.style; // We need to handle opacity special in IE if ( name == "opacity" && !jQuery.support.opacity ) { ret = jQuery.attr( style, "opacity" ); return ret == "" ? "1" : ret; } // Make sure we're using the right name for getting the float value if ( name.match( /float/i ) ) name = styleFloat; if ( !force && style && style[ name ] ) ret = style[ name ]; else if ( defaultView.getComputedStyle ) { // Only "float" is needed here if ( name.match( /float/i ) ) name = "float"; name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); var computedStyle = defaultView.getComputedStyle( elem, null ); if ( computedStyle ) ret = computedStyle.getPropertyValue( name ); // We should always get a number back from opacity if ( name == "opacity" && ret == "" ) ret = "1"; } else if ( elem.currentStyle ) { var camelCase = name.replace(/\-(\w)/g, function(all, letter){ return letter.toUpperCase(); }); ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { // Remember the original values var left = style.left, rsLeft = elem.runtimeStyle.left; // Put in the new values to get a computed value out elem.runtimeStyle.left = elem.currentStyle.left; style.left = ret || 0; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; elem.runtimeStyle.left = rsLeft; } } return ret; }, clean: function( elems, context, fragment ) { context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) context = context.ownerDocument || context[0] && context[0].ownerDocument || document; // If a single string is passed in and it's a single tag // just do a createElement and skip the rest if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); if ( match ) return [ context.createElement( match[1] ) ]; } var ret = [], scripts = [], div = context.createElement("div"); jQuery.each(elems, function(i, elem){ if ( typeof elem === "number" ) elem += ''; if ( !elem ) return; // Convert html string into DOM nodes if ( typeof elem === "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + "></" + tag + ">"; }); // Trim whitespace, otherwise indexOf won't work as expected var tags = jQuery.trim( elem ).toLowerCase(); var wrap = // option or optgroup !tags.indexOf("<opt") && [ 1, "<select multiple='multiple'>", "</select>" ] || !tags.indexOf("<leg") && [ 1, "<fieldset>", "</fieldset>" ] || tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && [ 1, "<table>", "</table>" ] || !tags.indexOf("<tr") && [ 2, "<table><tbody>", "</tbody></table>" ] || // <thead> matched above (!tags.indexOf("<td") || !tags.indexOf("<th")) && [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] || !tags.indexOf("<col") && [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || // IE can't serialize <link> and <script> tags normally !jQuery.support.htmlSerialize && [ 1, "div<div>", "</div>" ] || [ 0, "", "" ]; // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + elem + wrap[2]; // Move to the right depth while ( wrap[0]-- ) div = div.lastChild; // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ? div.firstChild && div.firstChild.childNodes : // String was a bare <thead> or <tfoot> wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ? div.childNodes : []; for ( var j = tbody.length - 1; j >= 0 ; --j ) if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) tbody[ j ].parentNode.removeChild( tbody[ j ] ); } // IE completely kills leading whitespace when innerHTML is used if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); elem = jQuery.makeArray( div.childNodes ); } if ( elem.nodeType ) ret.push( elem ); else ret = jQuery.merge( ret, elem ); }); if ( fragment ) { for ( var i = 0; ret[i]; i++ ) { if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); } else { if ( ret[i].nodeType === 1 ) ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); fragment.appendChild( ret[i] ); } } return scripts; } return ret; }, attr: function( elem, name, value ) { // don't set attributes on text and comment nodes if (!elem || elem.nodeType == 3 || elem.nodeType == 8) return undefined; var notxml = !jQuery.isXMLDoc( elem ), // Whether we are setting (or getting) set = value !== undefined; // Try to normalize/fix the name name = notxml && jQuery.props[ name ] || name; // Only do all the following if this is a node (faster for style) // IE elem.getAttribute passes even for style if ( elem.tagName ) { // These attributes require special treatment var special = /href|src|style/.test( name ); // Safari mis-reports the default selected property of a hidden option // Accessing the parent's selectedIndex property fixes it if ( name == "selected" && elem.parentNode ) elem.parentNode.selectedIndex; // If applicable, access the attribute via the DOM 0 way if ( name in elem && notxml && !special ) { if ( set ){ // We can't allow the type property to be changed (since it causes problems in IE) if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode ) throw "type property can't be changed"; elem[ name ] = value; } // browsers index elements by id/name on forms, give priority to attributes. if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) return elem.getAttributeNode( name ).nodeValue; // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ if ( name == "tabIndex" ) { var attributeNode = elem.getAttributeNode( "tabIndex" ); return attributeNode && attributeNode.specified ? attributeNode.value : elem.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i) ? 0 : undefined; } return elem[ name ]; } if ( !jQuery.support.style && notxml && name == "style" ) return jQuery.attr( elem.style, "cssText", value ); if ( set ) // convert the value to a string (all browsers do this but IE) see #1070 elem.setAttribute( name, "" + value ); var attr = !jQuery.support.hrefNormalized && notxml && special // Some attributes require a special call on IE ? elem.getAttribute( name, 2 ) : elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined return attr === null ? undefined : attr; } // elem is actually elem.style ... set the style // IE uses filters for opacity if ( !jQuery.support.opacity && name == "opacity" ) { if ( set ) { // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level elem.zoom = 1; // Set the alpha filter to set the opacity elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) + (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); } return elem.filter && elem.filter.indexOf("opacity=") >= 0 ? (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': ""; } name = name.replace(/-([a-z])/ig, function(all, letter){ return letter.toUpperCase(); }); if ( set ) elem[ name ] = value; return elem[ name ]; }, trim: function( text ) { return (text || "").replace( /^\s+|\s+$/g, "" ); }, makeArray: function( array ) { var ret = []; if( array != null ){ var i = array.length; // The window, strings (and functions) also have 'length' if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) ret[0] = array; else while( i ) ret[--i] = array[i]; } return ret; }, inArray: function( elem, array ) { for ( var i = 0, length = array.length; i < length; i++ ) // Use === because on IE, window == document if ( array[ i ] === elem ) return i; return -1; }, merge: function( first, second ) { // We have to loop this way because IE & Opera overwrite the length // expando of getElementsByTagName var i = 0, elem, pos = first.length; // Also, we need to make sure that the correct elements are being returned // (IE returns comment nodes in a '*' query) if ( !jQuery.support.getAll ) { while ( (elem = second[ i++ ]) != null ) if ( elem.nodeType != 8 ) first[ pos++ ] = elem; } else while ( (elem = second[ i++ ]) != null ) first[ pos++ ] = elem; return first; }, unique: function( array ) { var ret = [], done = {}; try { for ( var i = 0, length = array.length; i < length; i++ ) { var id = jQuery.data( array[ i ] ); if ( !done[ id ] ) { done[ id ] = true; ret.push( array[ i ] ); } } } catch( e ) { ret = array; } return ret; }, grep: function( elems, callback, inv ) { var ret = []; // Go through the array, only saving the items // that pass the validator function for ( var i = 0, length = elems.length; i < length; i++ ) if ( !inv != !callback( elems[ i ], i ) ) ret.push( elems[ i ] ); return ret; }, map: function( elems, callback ) { var ret = []; // Go through the array, translating each of the items to their // new value (or values). for ( var i = 0, length = elems.length; i < length; i++ ) { var value = callback( elems[ i ], i ); if ( value != null ) ret[ ret.length ] = value; } return ret.concat.apply( [], ret ); } }); // Use of jQuery.browser is deprecated. // It's included for backwards compatibility and plugins, // although they should work to migrate away. var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], safari: /webkit/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) }; jQuery.each({ parent: function(elem){return elem.parentNode;}, parents: function(elem){return jQuery.dir(elem,"parentNode");}, next: function(elem){return jQuery.nth(elem,2,"nextSibling");}, prev: function(elem){return jQuery.nth(elem,2,"previousSibling");}, nextAll: function(elem){return jQuery.dir(elem,"nextSibling");}, prevAll: function(elem){return jQuery.dir(elem,"previousSibling");}, siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);}, children: function(elem){return jQuery.sibling(elem.firstChild);}, contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);} }, function(name, fn){ jQuery.fn[ name ] = function( selector ) { var ret = jQuery.map( this, fn ); if ( selector && typeof selector == "string" ) ret = jQuery.multiFilter( selector, ret ); return this.pushStack( jQuery.unique( ret ), name, selector ); }; }); jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function(name, original){ jQuery.fn[ name ] = function() { var args = arguments; return this.each(function(){ for ( var i = 0, length = args.length; i < length; i++ ) jQuery( args[ i ] )[ original ]( this ); }); }; }); jQuery.each({ removeAttr: function( name ) { jQuery.attr( this, name, "" ); if (this.nodeType == 1) this.removeAttribute( name ); }, addClass: function( classNames ) { jQuery.className.add( this, classNames ); }, removeClass: function( classNames ) { jQuery.className.remove( this, classNames ); }, toggleClass: function( classNames, state ) { if( typeof state !== "boolean" ) state = !jQuery.className.has( this, classNames ); jQuery.className[ state ? "add" : "remove" ]( this, classNames ); }, remove: function( selector ) { if ( !selector || jQuery.filter( selector, [ this ] ).length ) { // Prevent memory leaks jQuery( "*", this ).add([this]).each(function(){ jQuery.event.remove(this); jQuery.removeData(this); }); if (this.parentNode) this.parentNode.removeChild( this ); } }, empty: function() { // Remove element nodes and prevent memory leaks jQuery( ">*", this ).remove(); // Remove any remaining nodes while ( this.firstChild ) this.removeChild( this.firstChild ); } }, function(name, fn){ jQuery.fn[ name ] = function(){ return this.each( fn, arguments ); }; }); // Helper function used by the dimensions and offset modules function num(elem, prop) { return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; } var expando = "jQuery" + now(), uuid = 0, windowData = {}; jQuery.extend({ cache: {}, data: function( elem, name, data ) { elem = elem == window ? windowData : elem; var id = elem[ expando ]; // Compute a unique ID for the element if ( !id ) id = elem[ expando ] = ++uuid; // Only generate the data cache if we're // trying to access or manipulate it if ( name && !jQuery.cache[ id ] ) jQuery.cache[ id ] = {}; // Prevent overriding the named cache with undefined values if ( data !== undefined ) jQuery.cache[ id ][ name ] = data; // Return the named cache data, or the ID for the element return name ? jQuery.cache[ id ][ name ] : id; }, removeData: function( elem, name ) { elem = elem == window ? windowData : elem; var id = elem[ expando ]; // If we want to remove a specific section of the element's data if ( name ) { if ( jQuery.cache[ id ] ) { // Remove the section of cache data delete jQuery.cache[ id ][ name ]; // If we've removed all the data, remove the element's cache name = ""; for ( name in jQuery.cache[ id ] ) break; if ( !name ) jQuery.removeData( elem ); } // Otherwise, we want to remove all of the element's data } else { // Clean up the element expando try { delete elem[ expando ]; } catch(e){ // IE has trouble directly removing the expando // but it's ok with using removeAttribute if ( elem.removeAttribute ) elem.removeAttribute( expando ); } // Completely remove the data cache delete jQuery.cache[ id ]; } }, queue: function( elem, type, data ) { if ( elem ){ type = (type || "fx") + "queue"; var q = jQuery.data( elem, type ); if ( !q || jQuery.isArray(data) ) q = jQuery.data( elem, type, jQuery.makeArray(data) ); else if( data ) q.push( data ); } return q; }, dequeue: function( elem, type ){ var queue = jQuery.queue( elem, type ), fn = queue.shift(); if( !type || type === "fx" ) fn = queue[0]; if( fn !== undefined ) fn.call(elem); } }); jQuery.fn.extend({ data: function( key, value ){ var parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value === undefined ) { var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); if ( data === undefined && this.length ) data = jQuery.data( this[0], key ); return data === undefined && parts[1] ? this.data( parts[0] ) : data; } else return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ jQuery.data( this, key, value ); }); }, removeData: function( key ){ return this.each(function(){ jQuery.removeData( this, key ); }); }, queue: function(type, data){ if ( typeof type !== "string" ) { data = type; type = "fx"; } if ( data === undefined ) return jQuery.queue( this[0], type ); return this.each(function(){ var queue = jQuery.queue( this, type, data ); if( type == "fx" && queue.length == 1 ) queue[0].call(this); }); }, dequeue: function(type){ return this.each(function(){ jQuery.dequeue( this, type ); }); } });/*! * Sizzle CSS Selector Engine - v0.9.1 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g, done = 0, toString = Object.prototype.toString; var Sizzle = function(selector, context, results, seed) { results = results || []; context = context || document; if ( context.nodeType !== 1 && context.nodeType !== 9 ) return []; if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, check, mode, extra, prune = true; // Reset the position of the chunker regexp (start from head) chunker.lastIndex = 0; while ( (m = chunker.exec(selector)) !== null ) { parts.push( m[1] ); if ( m[2] ) { extra = RegExp.rightContext; break; } } if ( parts.length > 1 && Expr.match.POS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { var later = "", match; // Position selectors must be done after the filter while ( (match = Expr.match.POS.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.POS, "" ); } set = Sizzle.filter( later, Sizzle( /\s$/.test(selector) ? selector + "*" : selector, context ) ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { var tmpSet = []; selector = parts.shift(); if ( Expr.relative[ selector ] ) selector += parts.shift(); for ( var i = 0, l = set.length; i < l; i++ ) { Sizzle( selector, set[i], tmpSet ); } set = tmpSet; } } } else { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context ); set = Sizzle.filter( ret.expr, ret.set ); if ( parts.length > 0 ) { checkSet = makeArray(set); } else { prune = false; } while ( parts.length ) { var cur = parts.pop(), pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, isXML(context) ); } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { throw "Syntax error, unrecognized expression: " + (cur || selector); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context.nodeType === 1 ) { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, context, results, seed ); } return results; }; Sizzle.matches = function(expr, set){ return Sizzle(expr, null, null, set); }; Sizzle.find = function(expr, context){ var set, match; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; if ( (match = Expr.match[ type ].exec( expr )) ) { var left = RegExp.leftContext; if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace(/\\/g, ""); set = Expr.find[ type ]( match, context ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = context.getElementsByTagName("*"); } return {set: set, expr: expr}; }; Sizzle.filter = function(expr, set, inplace, not){ var old = expr, result = [], curLoop = set, match, anyFound; while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.match[ type ].exec( expr )) != null ) { var filter = Expr.filter[ type ], goodArray = null, goodPos = 0, found, item; anyFound = false; if ( curLoop == result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } else if ( match[0] === true ) { goodArray = []; var last = null, elem; for ( var i = 0; (elem = curLoop[i]) !== undefined; i++ ) { if ( elem && last !== elem ) { goodArray.push( elem ); last = elem; } } } } if ( match ) { for ( var i = 0; (item = curLoop[i]) !== undefined; i++ ) { if ( item ) { if ( goodArray && item != goodArray[goodPos] ) { goodPos++; } found = filter( item, match, goodPos, goodArray ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } expr = expr.replace(/\s*,\s*/, ""); // Improper expression if ( expr == old ) { if ( anyFound == null ) { throw "Syntax error, unrecognized expression: " + expr; } else { break; } } old = expr; } return curLoop; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ }, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function(elem){ return elem.getAttribute("href"); } }, relative: { "+": function(checkSet, part){ for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var cur = elem.previousSibling; while ( cur && cur.nodeType !== 1 ) { cur = cur.previousSibling; } checkSet[i] = typeof part === "string" ? cur || false : cur === part; } } if ( typeof part === "string" ) { Sizzle.filter( part, checkSet, true ); } }, ">": function(checkSet, part, isXML){ if ( typeof part === "string" && !/\W/.test(part) ) { part = isXML ? part : part.toUpperCase(); for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName === part ? parent : false; } } } else { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { checkSet[i] = typeof part === "string" ? elem.parentNode : elem.parentNode === part; } } if ( typeof part === "string" ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var doneName = "done" + (done++), checkFn = dirCheck; if ( !part.match(/\W/) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); }, "~": function(checkSet, part, isXML){ var doneName = "done" + (done++), checkFn = dirCheck; if ( typeof part === "string" && !part.match(/\W/) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); } }, find: { ID: function(match, context){ if ( context.getElementById ) { var m = context.getElementById(match[1]); return m ? [m] : []; } }, NAME: function(match, context){ return context.getElementsByName ? context.getElementsByName(match[1]) : null; }, TAG: function(match, context){ return context.getElementsByTagName(match[1]); } }, preFilter: { CLASS: function(match, curLoop, inplace, result, not){ match = " " + match[1].replace(/\\/g, "") + " "; for ( var i = 0; curLoop[i]; i++ ) { if ( not ^ (" " + curLoop[i].className + " ").indexOf(match) >= 0 ) { if ( !inplace ) result.push( curLoop[i] ); } else if ( inplace ) { curLoop[i] = false; } } return false; }, ID: function(match){ return match[1].replace(/\\/g, ""); }, TAG: function(match, curLoop){ for ( var i = 0; !curLoop[i]; i++ ){} return isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); }, CHILD: function(match){ if ( match[1] == "nth" ) { // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); // calculate the numbers (first)n+(last) including if they are negative match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } // TODO: Move to normal caching system match[0] = "done" + (done++); return match; }, ATTR: function(match){ var name = match[1]; if ( Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function(match, curLoop, inplace, result, not){ if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one if ( match[3].match(chunker).length > 1 ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) ) { return true; } return match; }, POS: function(match){ match.unshift( true ); return match; } }, filters: { enabled: function(elem){ return elem.disabled === false && elem.type !== "hidden"; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ // Accessing this property makes selected-by-default // options in Safari work properly elem.parentNode.selectedIndex; return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, has: function(elem, i, match){ return !!Sizzle( match[3], elem ).length; }, header: function(elem){ return /h\d/i.test( elem.nodeName ); }, text: function(elem){ return "text" === elem.type; }, radio: function(elem){ return "radio" === elem.type; }, checkbox: function(elem){ return "checkbox" === elem.type; }, file: function(elem){ return "file" === elem.type; }, password: function(elem){ return "password" === elem.type; }, submit: function(elem){ return "submit" === elem.type; }, image: function(elem){ return "image" === elem.type; }, reset: function(elem){ return "reset" === elem.type; }, button: function(elem){ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; }, input: function(elem){ return /input|select|textarea|button/i.test(elem.nodeName); } }, setFilters: { first: function(elem, i){ return i === 0; }, last: function(elem, i, match, array){ return i === array.length - 1; }, even: function(elem, i){ return i % 2 === 0; }, odd: function(elem, i){ return i % 2 === 1; }, lt: function(elem, i, match){ return i < match[3] - 0; }, gt: function(elem, i, match){ return i > match[3] - 0; }, nth: function(elem, i, match){ return match[3] - 0 == i; }, eq: function(elem, i, match){ return match[3] - 0 == i; } }, filter: { CHILD: function(elem, match){ var type = match[1], parent = elem.parentNode; var doneName = "child" + parent.childNodes.length; if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) { var count = 1; for ( var node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType == 1 ) { node.nodeIndex = count++; } } parent[ doneName ] = count - 1; } if ( type == "first" ) { return elem.nodeIndex == 1; } else if ( type == "last" ) { return elem.nodeIndex == parent[ doneName ]; } else if ( type == "only" ) { return parent[ doneName ] == 1; } else if ( type == "nth" ) { var add = false, first = match[2], last = match[3]; if ( first == 1 && last == 0 ) { return true; } if ( first == 0 ) { if ( elem.nodeIndex == last ) { add = true; } } else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) { add = true; } return add; } }, PSEUDO: function(elem, match, i, array){ var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var i = 0, l = not.length; i < l; i++ ) { if ( not[i] === elem ) { return false; } } return true; } }, ID: function(elem, match){ return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function(elem, match){ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; }, CLASS: function(elem, match){ return match.test( elem.className ); }, ATTR: function(elem, match){ var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4]; return result == null ? false : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !match[4] ? result : type === "!=" ? value != check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function(elem, match, i, array){ var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; for ( var type in Expr.match ) { Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); } var makeArray = function(array, results) { array = Array.prototype.slice.call( array ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; // Perform a simple check to determine if the browser is capable of // converting a NodeList to an array using builtin methods. try { Array.prototype.slice.call( document.documentElement.childNodes ); // Provide a fallback method if it does not work } catch(e){ makeArray = function(array, results) { var ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var i = 0, l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( var i = 0; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } // Check to see if the browser returns elements by name when // querying by getElementById (and provide a workaround) (function(){ // We're going to inject a fake input element with a specified name var form = document.createElement("form"), id = "script" + (new Date).getTime(); form.innerHTML = "<input name='" + id + "'/>"; // Inject it into the root element, check its status, and remove it quickly var root = document.documentElement; root.insertBefore( form, root.firstChild ); // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( !!document.getElementById( id ) ) { Expr.find.ID = function(match, context){ if ( context.getElementById ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || m.getAttributeNode && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function(elem, match){ var node = elem.getAttributeNode && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); })(); (function(){ // Check to see if the browser returns only elements // when doing getElementsByTagName("*") // Create a fake element var div = document.createElement("div"); div.appendChild( document.createComment("") ); // Make sure no comments are found if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function(match, context){ var results = context.getElementsByTagName(match[1]); // Filter out possible comments if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } // Check to see if an attribute returns normalized href attributes div.innerHTML = "<a href='#'></a>"; if ( div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function(elem){ return elem.getAttribute("href", 2); }; } })(); if ( document.querySelectorAll ) (function(){ var oldSizzle = Sizzle; Sizzle = function(query, context, extra, seed){ context = context || document; if ( !seed && context.nodeType === 9 ) { try { return makeArray( context.querySelectorAll(query), extra ); } catch(e){} } return oldSizzle(query, context, extra, seed); }; Sizzle.find = oldSizzle.find; Sizzle.filter = oldSizzle.filter; Sizzle.selectors = oldSizzle.selectors; Sizzle.matches = oldSizzle.matches; })(); if ( document.documentElement.getElementsByClassName ) { Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context) { return context.getElementsByClassName(match[1]); }; } function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { elem = elem[dir]; var match = false; while ( elem && elem.nodeType ) { var done = elem[doneName]; if ( done ) { match = checkSet[ done ]; break; } if ( elem.nodeType === 1 && !isXML ) elem[doneName] = i; if ( elem.nodeName === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { elem = elem[dir]; var match = false; while ( elem && elem.nodeType ) { if ( elem[doneName] ) { match = checkSet[ elem[doneName] ]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) elem[doneName] = i; if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } var contains = document.compareDocumentPosition ? function(a, b){ return a.compareDocumentPosition(b) & 16; } : function(a, b){ return a !== b && (a.contains ? a.contains(b) : true); }; var isXML = function(elem){ return elem.documentElement && !elem.body || elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; }; // EXPOSE jQuery.find = Sizzle; jQuery.filter = Sizzle.filter; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; Sizzle.selectors.filters.hidden = function(elem){ return "hidden" === elem.type || jQuery.css(elem, "display") === "none" || jQuery.css(elem, "visibility") === "hidden"; }; Sizzle.selectors.filters.visible = function(elem){ return "hidden" !== elem.type && jQuery.css(elem, "display") !== "none" && jQuery.css(elem, "visibility") !== "hidden"; }; Sizzle.selectors.filters.animated = function(elem){ return jQuery.grep(jQuery.timers, function(fn){ return elem === fn.elem; }).length; }; jQuery.multiFilter = function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return Sizzle.matches(expr, elems); }; jQuery.dir = function( elem, dir ){ var matched = [], cur = elem[dir]; while ( cur && cur != document ) { if ( cur.nodeType == 1 ) matched.push( cur ); cur = cur[dir]; } return matched; }; jQuery.nth = function(cur, result, dir, elem){ result = result || 1; var num = 0; for ( ; cur; cur = cur[dir] ) if ( cur.nodeType == 1 && ++num == result ) break; return cur; }; jQuery.sibling = function(n, elem){ var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType == 1 && n != elem ) r.push( n ); } return r; }; return; window.Sizzle = Sizzle; })(); /* * A number of helper functions used for managing events. * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */ jQuery.event = { // Bind an event to an element // Original by Dean Edwards add: function(elem, types, handler, data) { if ( elem.nodeType == 3 || elem.nodeType == 8 ) return; // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( elem.setInterval && elem != window ) elem = window; // Make sure that the function being executed has a unique ID if ( !handler.guid ) handler.guid = this.guid++; // if data is passed, bind to handler if ( data !== undefined ) { // Create temporary function pointer to original handler var fn = handler; // Create unique handler function, wrapped around original handler handler = this.proxy( fn ); // Store data in unique handler handler.data = data; } // Init the element's event structure var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}), handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ // Handle the second event of a trigger and when // an event is called after a page has unloaded return typeof jQuery !== "undefined" && !jQuery.event.triggered ? jQuery.event.handle.apply(arguments.callee.elem, arguments) : undefined; }); // Add elem as a property of the handle function // This is to prevent a memory leak with non-native // event in IE. handle.elem = elem; // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); jQuery.each(types.split(/\s+/), function(index, type) { // Namespaced event handlers var namespaces = type.split("."); type = namespaces.shift(); handler.type = namespaces.slice().sort().join("."); // Get the current list of functions bound to this event var handlers = events[type]; if ( jQuery.event.specialAll[type] ) jQuery.event.specialAll[type].setup.call(elem, data, namespaces); // Init the event handler queue if (!handlers) { handlers = events[type] = {}; // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { // Bind the global event handler to the element if (elem.addEventListener) elem.addEventListener(type, handle, false); else if (elem.attachEvent) elem.attachEvent("on" + type, handle); } } // Add the function to the element's handler list handlers[handler.guid] = handler; // Keep track of which events have been used, for global triggering jQuery.event.global[type] = true; }); // Nullify elem to prevent memory leaks in IE elem = null; }, guid: 1, global: {}, // Detach an event or set of events from an element remove: function(elem, types, handler) { // don't do events on text and comment nodes if ( elem.nodeType == 3 || elem.nodeType == 8 ) return; var events = jQuery.data(elem, "events"), ret, index; if ( events ) { // Unbind all events for the element if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) for ( var type in events ) this.remove( elem, type + (types || "") ); else { // types is actually an event object here if ( types.type ) { handler = types.handler; types = types.type; } // Handle multiple events seperated by a space // jQuery(...).unbind("mouseover mouseout", fn); jQuery.each(types.split(/\s+/), function(index, type){ // Namespaced event handlers var namespaces = type.split("."); type = namespaces.shift(); var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); if ( events[type] ) { // remove the given handler for the given type if ( handler ) delete events[type][handler.guid]; // remove all handlers for the given type else for ( var handle in events[type] ) // Handle the removal of namespaced events if ( namespace.test(events[type][handle].type) ) delete events[type][handle]; if ( jQuery.event.specialAll[type] ) jQuery.event.specialAll[type].teardown.call(elem, namespaces); // remove generic event handler if no more handlers exist for ( ret in events[type] ) break; if ( !ret ) { if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { if (elem.removeEventListener) elem.removeEventListener(type, jQuery.data(elem, "handle"), false); else if (elem.detachEvent) elem.detachEvent("on" + type, jQuery.data(elem, "handle")); } ret = null; delete events[type]; } } }); } // Remove the expando if it's no longer used for ( ret in events ) break; if ( !ret ) { var handle = jQuery.data( elem, "handle" ); if ( handle ) handle.elem = null; jQuery.removeData( elem, "events" ); jQuery.removeData( elem, "handle" ); } } }, // bubbling is internal trigger: function( event, data, elem, bubbling ) { // Event object or event type var type = event.type || event; if( !bubbling ){ event = typeof event === "object" ? // jQuery.Event object event[expando] ? event : // Object literal jQuery.extend( jQuery.Event(type), event ) : // Just the event type (string) jQuery.Event(type); if ( type.indexOf("!") >= 0 ) { event.type = type = type.slice(0, -1); event.exclusive = true; } // Handle a global trigger if ( !elem ) { // Don't bubble custom events when global (to avoid too much overhead) event.stopPropagation(); // Only trigger if we've ever bound an event for it if ( this.global[type] ) jQuery.each( jQuery.cache, function(){ if ( this.events && this.events[type] ) jQuery.event.trigger( event, data, this.handle.elem ); }); } // Handle triggering a single element // don't do events on text and comment nodes if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) return undefined; // Clean up in case it is reused event.result = undefined; event.target = elem; // Clone the incoming data, if any data = jQuery.makeArray(data); data.unshift( event ); } event.currentTarget = elem; // Trigger the event, it is assumed that "handle" is a function var handle = jQuery.data(elem, "handle"); if ( handle ) handle.apply( elem, data ); // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) event.result = false; // Trigger the native events (except for clicks on links) if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) { this.triggered = true; try { elem[ type ](); // prevent IE from throwing an error for some hidden elements } catch (e) {} } this.triggered = false; if ( !event.isPropagationStopped() ) { var parent = elem.parentNode || elem.ownerDocument; if ( parent ) jQuery.event.trigger(event, data, parent, true); } }, handle: function(event) { // returned undefined or false var all, handlers; event = arguments[0] = jQuery.event.fix( event || window.event ); // Namespaced event handlers var namespaces = event.type.split("."); event.type = namespaces.shift(); // Cache this now, all = true means, any handler all = !namespaces.length && !event.exclusive; var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); handlers = ( jQuery.data(this, "events") || {} )[event.type]; for ( var j in handlers ) { var handler = handlers[j]; // Filter the functions by class if ( all || namespace.test(handler.type) ) { // Pass in a reference to the handler function itself // So that we can later remove it event.handler = handler; event.data = handler.data; var ret = handler.apply(this, arguments); if( ret !== undefined ){ event.result = ret; if ( ret === false ) { event.preventDefault(); event.stopPropagation(); } } if( event.isImmediatePropagationStopped() ) break; } } }, props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix: function(event) { if ( event[expando] ) return event; // store a copy of the original event object // and "clone" to set read-only properties var originalEvent = event; event = jQuery.Event( originalEvent ); for ( var i = this.props.length, prop; i; ){ prop = this.props[ --i ]; event[ prop ] = originalEvent[ prop ]; } // Fix target property, if necessary if ( !event.target ) event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either // check if target is a textnode (safari) if ( event.target.nodeType == 3 ) event.target = event.target.parentNode; // Add relatedTarget, if necessary if ( !event.relatedTarget && event.fromElement ) event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) { var doc = document.documentElement, body = document.body; event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0); event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0); } // Add which for key events if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) event.which = event.charCode || event.keyCode; // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) if ( !event.metaKey && event.ctrlKey ) event.metaKey = event.ctrlKey; // Add which for click: 1 == left; 2 == middle; 3 == right // Note: button is not normalized, so don't use it if ( !event.which && event.button ) event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); return event; }, proxy: function( fn, proxy ){ proxy = proxy || function(){ return fn.apply(this, arguments); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; // So proxy can be declared as an argument return proxy; }, special: { ready: { // Make sure the ready event is setup setup: bindReady, teardown: function() {} } }, specialAll: { live: { setup: function( selector, namespaces ){ jQuery.event.add( this, namespaces[0], liveHandler ); }, teardown: function( namespaces ){ if ( namespaces.length ) { var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); jQuery.each( (jQuery.data(this, "events").live || {}), function(){ if ( name.test(this.type) ) remove++; }); if ( remove < 1 ) jQuery.event.remove( this, namespaces[0], liveHandler ); } } } } }; jQuery.Event = function( src ){ // Allow instantiation without the 'new' keyword if( !this.preventDefault ) return new jQuery.Event(src); // Event object if( src && src.type ){ this.originalEvent = src; this.type = src.type; this.timeStamp = src.timeStamp; // Event type }else this.type = src; if( !this.timeStamp ) this.timeStamp = now(); // Mark it as fixed this[expando] = true; }; function returnFalse(){ return false; } function returnTrue(){ return true; } // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { preventDefault: function() { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if( !e ) return; // if preventDefault exists run it on the original event if (e.preventDefault) e.preventDefault(); // otherwise set the returnValue property of the original event to false (IE) e.returnValue = false; }, stopPropagation: function() { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if( !e ) return; // if stopPropagation exists run it on the original event if (e.stopPropagation) e.stopPropagation(); // otherwise set the cancelBubble property of the original event to true (IE) e.cancelBubble = true; }, stopImmediatePropagation:function(){ this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse }; // Checks if an event happened on an element within another element // Used in jQuery.event.special.mouseenter and mouseleave handlers var withinElement = function(event) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; // Traverse up the tree while ( parent && parent != this ) try { parent = parent.parentNode; } catch(e) { parent = this; } if( parent != this ){ // set the correct event type event.type = event.data; // handle event if we actually just moused on to a non sub-element jQuery.event.handle.apply( this, arguments ); } }; jQuery.each({ mouseover: 'mouseenter', mouseout: 'mouseleave' }, function( orig, fix ){ jQuery.event.special[ fix ] = { setup: function(){ jQuery.event.add( this, orig, withinElement, fix ); }, teardown: function(){ jQuery.event.remove( this, orig, withinElement ); } }; }); jQuery.fn.extend({ bind: function( type, data, fn ) { return type == "unload" ? this.one(type, data, fn) : this.each(function(){ jQuery.event.add( this, type, fn || data, fn && data ); }); }, one: function( type, data, fn ) { var one = jQuery.event.proxy( fn || data, function(event) { jQuery(this).unbind(event, one); return (fn || data).apply( this, arguments ); }); return this.each(function(){ jQuery.event.add( this, type, one, fn && data); }); }, unbind: function( type, fn ) { return this.each(function(){ jQuery.event.remove( this, type, fn ); }); }, trigger: function( type, data ) { return this.each(function(){ jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { if( this[0] ){ var event = jQuery.Event(type); event.preventDefault(); event.stopPropagation(); jQuery.event.trigger( event, data, this[0] ); return event.result; } }, toggle: function( fn ) { // Save reference to arguments for access in closure var args = arguments, i = 1; // link all the functions, so any of them can unbind this click handler while( i < args.length ) jQuery.event.proxy( fn, args[i++] ); return this.click( jQuery.event.proxy( fn, function(event) { // Figure out which function to execute this.lastToggle = ( this.lastToggle || 0 ) % i; // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ this.lastToggle++ ].apply( this, arguments ) || false; })); }, hover: function(fnOver, fnOut) { return this.mouseenter(fnOver).mouseleave(fnOut); }, ready: function(fn) { // Attach the listeners bindReady(); // If the DOM is already ready if ( jQuery.isReady ) // Execute the function immediately fn.call( document, jQuery ); // Otherwise, remember the function for later else // Add the function to the wait list jQuery.readyList.push( fn ); return this; }, live: function( type, fn ){ var proxy = jQuery.event.proxy( fn ); proxy.guid += this.selector + type; jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); return this; }, die: function( type, fn ){ jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); return this; } }); function liveHandler( event ){ var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), stop = true, elems = []; jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){ if ( check.test(fn.type) ) { var elem = jQuery(event.target).closest(fn.data)[0]; if ( elem ) elems.push({ elem: elem, fn: fn }); } }); jQuery.each(elems, function(){ if ( !event.isImmediatePropagationStopped() && this.fn.call(this.elem, event, this.fn.data) === false ) stop = false; }); return stop; } function liveConvert(type, selector){ return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); } jQuery.extend({ isReady: false, readyList: [], // Handle when the DOM is ready ready: function() { // Make sure that the DOM is not already loaded if ( !jQuery.isReady ) { // Remember that the DOM is ready jQuery.isReady = true; // If there are functions bound, to execute if ( jQuery.readyList ) { // Execute all of them jQuery.each( jQuery.readyList, function(){ this.call( document, jQuery ); }); // Reset the list of functions jQuery.readyList = null; } // Trigger any bound ready events jQuery(document).triggerHandler("ready"); } } }); var readyBound = false; function bindReady(){ if ( readyBound ) return; readyBound = true; // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", function(){ document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); jQuery.ready(); }, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", function(){ if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", arguments.callee ); jQuery.ready(); } }); // If IE and not an iframe // continually check to see if the document is ready if ( document.documentElement.doScroll && !window.frameElement ) (function(){ if ( jQuery.isReady ) return; try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch( error ) { setTimeout( arguments.callee, 0 ); return; } // and execute any waiting functions jQuery.ready(); })(); } // A fallback to window.onload, that will always work jQuery.event.add( window, "load", jQuery.ready ); } jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){ // Handle event binding jQuery.fn[name] = function(fn){ return fn ? this.bind(name, fn) : this.trigger(name); }; }); // Prevent memory leaks in IE // And prevent errors on refresh with events like mouseover in other browsers // Window isn't included so as not to unbind existing unload events jQuery( window ).bind( 'unload', function(){ for ( var id in jQuery.cache ) // Skip the window if ( id != 1 && jQuery.cache[ id ].handle ) jQuery.event.remove( jQuery.cache[ id ].handle.elem ); }); (function(){ jQuery.support = {}; var root = document.documentElement, script = document.createElement("script"), div = document.createElement("div"), id = "script" + (new Date).getTime(); div.style.display = "none"; div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; var all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0]; // Can't get basic test support if ( !all || !all.length || !a ) { return; } jQuery.support = { // IE strips leading whitespace when .innerHTML is used leadingWhitespace: div.firstChild.nodeType == 3, // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that you can get all elements in an <object> element // IE 7 always returns no results objectAll: !!div.getElementsByTagName("object")[0] .getElementsByTagName("*").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText insted) style: /red/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: a.getAttribute("href") === "/a", // Make sure that element opacity exists // (IE uses filter instead) opacity: a.style.opacity === "0.5", // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Will be defined later scriptEval: false, noCloneEvent: true, boxModel: null }; script.type = "text/javascript"; try { script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); } catch(e){} root.insertBefore( script, root.firstChild ); // Make sure that the execution of code works by injecting a script // tag with appendChild/createTextNode // (IE doesn't support this, fails, and uses .text instead) if ( window[ id ] ) { jQuery.support.scriptEval = true; delete window[ id ]; } root.removeChild( script ); if ( div.attachEvent && div.fireEvent ) { div.attachEvent("onclick", function(){ // Cloning a node shouldn't copy over any // bound event handlers (IE does this) jQuery.support.noCloneEvent = false; div.detachEvent("onclick", arguments.callee); }); div.cloneNode(true).fireEvent("onclick"); } // Figure out if the W3C box model works as expected // document.body must exist before we can do this jQuery(function(){ var div = document.createElement("div"); div.style.width = "1px"; div.style.paddingLeft = "1px"; document.body.appendChild( div ); jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; document.body.removeChild( div ); }); })(); var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; jQuery.props = { "for": "htmlFor", "class": "className", "float": styleFloat, cssFloat: styleFloat, styleFloat: styleFloat, readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", tabindex: "tabIndex" }; jQuery.fn.extend({ // Keep a copy of the old load _load: jQuery.fn.load, load: function( url, params, callback ) { if ( typeof url !== "string" ) return this._load( url ); var off = url.indexOf(" "); if ( off >= 0 ) { var selector = url.slice(off, url.length); url = url.slice(0, off); } // Default to a GET request var type = "GET"; // If the second parameter was provided if ( params ) // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = null; // Otherwise, build a param string } else if( typeof params === "object" ) { params = jQuery.param( params ); type = "POST"; } var self = this; // Request the remote document jQuery.ajax({ url: url, type: type, dataType: "html", data: params, complete: function(res, status){ // If successful, inject the HTML into all the matched elements if ( status == "success" || status == "notmodified" ) // See if a selector was specified self.html( selector ? // Create a dummy div to hold the results jQuery("<div/>") // inject the contents of the document in, removing the scripts // to avoid any 'Permission Denied' errors in IE .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, "")) // Locate the specified elements .find(selector) : // If not, just inject the full result res.responseText ); if( callback ) self.each( callback, [res.responseText, status, res] ); } }); return this; }, serialize: function() { return jQuery.param(this.serializeArray()); }, serializeArray: function() { return this.map(function(){ return this.elements ? jQuery.makeArray(this.elements) : this; }) .filter(function(){ return this.name && !this.disabled && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type)); }) .map(function(i, elem){ var val = jQuery(this).val(); return val == null ? null : jQuery.isArray(val) ? jQuery.map( val, function(val, i){ return {name: elem.name, value: val}; }) : {name: elem.name, value: val}; }).get(); } }); // Attach a bunch of functions for handling common AJAX events jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){ jQuery.fn[o] = function(f){ return this.bind(o, f); }; }); var jsc = now(); jQuery.extend({ get: function( url, data, callback, type ) { // shift arguments if data argument was ommited if ( jQuery.isFunction( data ) ) { callback = data; data = null; } return jQuery.ajax({ type: "GET", url: url, data: data, success: callback, dataType: type }); }, getScript: function( url, callback ) { return jQuery.get(url, null, callback, "script"); }, getJSON: function( url, data, callback ) { return jQuery.get(url, data, callback, "json"); }, post: function( url, data, callback, type ) { if ( jQuery.isFunction( data ) ) { callback = data; data = {}; } return jQuery.ajax({ type: "POST", url: url, data: data, success: callback, dataType: type }); }, ajaxSetup: function( settings ) { jQuery.extend( jQuery.ajaxSettings, settings ); }, ajaxSettings: { url: location.href, global: true, type: "GET", contentType: "application/x-www-form-urlencoded", processData: true, async: true, /* timeout: 0, data: null, username: null, password: null, */ // Create the request object; Microsoft failed to properly // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available // This function can be overriden by calling jQuery.ajaxSetup xhr:function(){ return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); }, accepts: { xml: "application/xml, text/xml", html: "text/html", script: "text/javascript, application/javascript", json: "application/json, text/javascript", text: "text/plain", _default: "*/*" } }, // Last-Modified header cache for next request lastModified: {}, ajax: function( s ) { // Extend the settings, but re-extend 's' so that it can be // checked again later (in the test suite, specifically) s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s)); var jsonp, jsre = /=\?(&|$)/g, status, data, type = s.type.toUpperCase(); // convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) s.data = jQuery.param(s.data); // Handle JSONP Parameter Callbacks if ( s.dataType == "jsonp" ) { if ( type == "GET" ) { if ( !s.url.match(jsre) ) s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?"; } else if ( !s.data || !s.data.match(jsre) ) s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; s.dataType = "json"; } // Build temporary JSONP function if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) { jsonp = "jsonp" + jsc++; // Replace the =? sequence both in the query string and the data if ( s.data ) s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); s.url = s.url.replace(jsre, "=" + jsonp + "$1"); // We need to make sure // that a JSONP style response is executed properly s.dataType = "script"; // Handle JSONP-style loading window[ jsonp ] = function(tmp){ data = tmp; success(); complete(); // Garbage collect window[ jsonp ] = undefined; try{ delete window[ jsonp ]; } catch(e){} if ( head ) head.removeChild( script ); }; } if ( s.dataType == "script" && s.cache == null ) s.cache = false; if ( s.cache === false && type == "GET" ) { var ts = now(); // try replacing _= if it is there var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2"); // if nothing was replaced, add timestamp to the end s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : ""); } // If data is available, append data to url for get requests if ( s.data && type == "GET" ) { s.url += (s.url.match(/\?/) ? "&" : "?") + s.data; // IE likes to send both get and post data, prevent this s.data = null; } // Watch for a new set of requests if ( s.global && ! jQuery.active++ ) jQuery.event.trigger( "ajaxStart" ); // Matches an absolute URL, and saves the domain var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); // If we're requesting a remote document // and trying to load JSON or Script with a GET if ( s.dataType == "script" && type == "GET" && parts && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = s.url; if (s.scriptCharset) script.charset = s.scriptCharset; // Handle Script loading if ( !jsonp ) { var done = false; // Attach handlers for all browsers script.onload = script.onreadystatechange = function(){ if ( !done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; success(); complete(); head.removeChild( script ); } }; } head.appendChild(script); // We handle everything using the script element injection return undefined; } var requestDone = false; // Create the request object var xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if( s.username ) xhr.open(type, s.url, s.async, s.username, s.password); else xhr.open(type, s.url, s.async); // Need an extra try/catch for cross domain requests in Firefox 3 try { // Set the correct header, if data is being sent if ( s.data ) xhr.setRequestHeader("Content-Type", s.contentType); // Set the If-Modified-Since header, if ifModified mode. if ( s.ifModified ) xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" ); // Set header so the called script knows that it's an XMLHttpRequest xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); // Set the Accepts header for the server, depending on the dataType xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? s.accepts[ s.dataType ] + ", */*" : s.accepts._default ); } catch(e){} // Allow custom headers/mimetypes and early abort if ( s.beforeSend && s.beforeSend(xhr, s) === false ) { // Handle the global AJAX counter if ( s.global && ! --jQuery.active ) jQuery.event.trigger( "ajaxStop" ); // close opended socket xhr.abort(); return false; } if ( s.global ) jQuery.event.trigger("ajaxSend", [xhr, s]); // Wait for a response to come back var onreadystatechange = function(isTimeout){ // The request was aborted, clear the interval and decrement jQuery.active if (xhr.readyState == 0) { if (ival) { // clear poll interval clearInterval(ival); ival = null; // Handle the global AJAX counter if ( s.global && ! --jQuery.active ) jQuery.event.trigger( "ajaxStop" ); } // The transfer is complete and the data is available, or the request timed out } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { requestDone = true; // clear poll interval if (ival) { clearInterval(ival); ival = null; } status = isTimeout == "timeout" ? "timeout" : !jQuery.httpSuccess( xhr ) ? "error" : s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : "success"; if ( status == "success" ) { // Watch for, and catch, XML document parse errors try { // process the data (runs the xml through httpData regardless of callback) data = jQuery.httpData( xhr, s.dataType, s ); } catch(e) { status = "parsererror"; } } // Make sure that the request was successful or notmodified if ( status == "success" ) { // Cache Last-Modified header, if ifModified mode. var modRes; try { modRes = xhr.getResponseHeader("Last-Modified"); } catch(e) {} // swallow exception thrown by FF if header is not available if ( s.ifModified && modRes ) jQuery.lastModified[s.url] = modRes; // JSONP handles its own success callback if ( !jsonp ) success(); } else jQuery.handleError(s, xhr, status); // Fire the complete handlers complete(); // Stop memory leaks if ( s.async ) xhr = null; } }; if ( s.async ) { // don't attach the handler to the request, just poll it instead var ival = setInterval(onreadystatechange, 13); // Timeout checker if ( s.timeout > 0 ) setTimeout(function(){ // Check to see if the request is still happening if ( xhr ) { if( !requestDone ) onreadystatechange( "timeout" ); // Cancel the request if ( xhr ) xhr.abort(); } }, s.timeout); } // Send the data try { xhr.send(s.data); } catch(e) { jQuery.handleError(s, xhr, null, e); } // firefox 1.5 doesn't fire statechange for sync requests if ( !s.async ) onreadystatechange(); function success(){ // If a local callback was specified, fire it and pass it the data if ( s.success ) s.success( data, status ); // Fire the global callback if ( s.global ) jQuery.event.trigger( "ajaxSuccess", [xhr, s] ); } function complete(){ // Process result if ( s.complete ) s.complete(xhr, status); // The request was completed if ( s.global ) jQuery.event.trigger( "ajaxComplete", [xhr, s] ); // Handle the global AJAX counter if ( s.global && ! --jQuery.active ) jQuery.event.trigger( "ajaxStop" ); } // return XMLHttpRequest to allow aborting the request etc. return xhr; }, handleError: function( s, xhr, status, e ) { // If a local callback was specified, fire it if ( s.error ) s.error( xhr, status, e ); // Fire the global callback if ( s.global ) jQuery.event.trigger( "ajaxError", [xhr, s, e] ); }, // Counter for holding the number of active queries active: 0, // Determines if an XMLHttpRequest was successful or not httpSuccess: function( xhr ) { try { // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 return !xhr.status && location.protocol == "file:" || ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223; } catch(e){} return false; }, // Determines if an XMLHttpRequest returns NotModified httpNotModified: function( xhr, url ) { try { var xhrRes = xhr.getResponseHeader("Last-Modified"); // Firefox always returns 200. check Last-Modified date return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; } catch(e){} return false; }, httpData: function( xhr, type, s ) { var ct = xhr.getResponseHeader("content-type"), xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, data = xml ? xhr.responseXML : xhr.responseText; if ( xml && data.documentElement.tagName == "parsererror" ) throw "parsererror"; // Allow a pre-filtering function to sanitize the response // s != null is checked to keep backwards compatibility if( s && s.dataFilter ) data = s.dataFilter( data, type ); // The filter can actually parse the response if( typeof data === "string" ){ // If the type is "script", eval it in global context if ( type == "script" ) jQuery.globalEval( data ); // Get the JavaScript object, if JSON is used. if ( type == "json" ) data = window["eval"]("(" + data + ")"); } return data; }, // Serialize an array of form elements or a set of // key/values into a query string param: function( a ) { var s = [ ]; function add( key, value ){ s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); }; // If an array was passed in, assume that it is an array // of form elements if ( jQuery.isArray(a) || a.jquery ) // Serialize the form elements jQuery.each( a, function(){ add( this.name, this.value ); }); // Otherwise, assume that it's an object of key/value pairs else // Serialize the key/values for ( var j in a ) // If the value is an array then the key names need to be repeated if ( jQuery.isArray(a[j]) ) jQuery.each( a[j], function(){ add( j, this ); }); else add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); // Return the resulting serialization return s.join("&").replace(/%20/g, "+"); } }); var elemdisplay = {}, fxAttrs = [ // height animations [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], // width animations [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], // opacity animations [ "opacity" ] ]; function genFx( type, num ){ var obj = {}; jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){ obj[ this ] = type; }); return obj; } jQuery.fn.extend({ show: function(speed,callback){ if ( speed ) { return this.animate( genFx("show", 3), speed, callback); } else { for ( var i = 0, l = this.length; i < l; i++ ){ var old = jQuery.data(this[i], "olddisplay"); this[i].style.display = old || ""; if ( jQuery.css(this[i], "display") === "none" ) { var tagName = this[i].tagName, display; if ( elemdisplay[ tagName ] ) { display = elemdisplay[ tagName ]; } else { var elem = jQuery("<" + tagName + " />").appendTo("body"); display = elem.css("display"); if ( display === "none" ) display = "block"; elem.remove(); elemdisplay[ tagName ] = display; } this[i].style.display = jQuery.data(this[i], "olddisplay", display); } } return this; } }, hide: function(speed,callback){ if ( speed ) { return this.animate( genFx("hide", 3), speed, callback); } else { for ( var i = 0, l = this.length; i < l; i++ ){ var old = jQuery.data(this[i], "olddisplay"); if ( !old && old !== "none" ) jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); this[i].style.display = "none"; } return this; } }, // Save the old toggle function _toggle: jQuery.fn.toggle, toggle: function( fn, fn2 ){ var bool = typeof fn === "boolean"; return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? this._toggle.apply( this, arguments ) : fn == null || bool ? this.each(function(){ var state = bool ? fn : jQuery(this).is(":hidden"); jQuery(this)[ state ? "show" : "hide" ](); }) : this.animate(genFx("toggle", 3), fn, fn2); }, fadeTo: function(speed,to,callback){ return this.animate({opacity: to}, speed, callback); }, animate: function( prop, speed, easing, callback ) { var optall = jQuery.speed(speed, easing, callback); return this[ optall.queue === false ? "each" : "queue" ](function(){ var opt = jQuery.extend({}, optall), p, hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), self = this; for ( p in prop ) { if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) return opt.complete.call(this); if ( ( p == "height" || p == "width" ) && this.style ) { // Store display property opt.display = jQuery.css(this, "display"); // Make sure that nothing sneaks out opt.overflow = this.style.overflow; } } if ( opt.overflow != null ) this.style.overflow = "hidden"; opt.curAnim = jQuery.extend({}, prop); jQuery.each( prop, function(name, val){ var e = new jQuery.fx( self, opt, name ); if ( /toggle|show|hide/.test(val) ) e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); else { var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/), start = e.cur(true) || 0; if ( parts ) { var end = parseFloat(parts[2]), unit = parts[3] || "px"; // We need to compute starting value if ( unit != "px" ) { self.style[ name ] = (end || 1) + unit; start = ((end || 1) / e.cur(true)) * start; self.style[ name ] = start + unit; } // If a +=/-= token was provided, we're doing a relative animation if ( parts[1] ) end = ((parts[1] == "-=" ? -1 : 1) * end) + start; e.custom( start, end, unit ); } else e.custom( start, val, "" ); } }); // For JS strict compliance return true; }); }, stop: function(clearQueue, gotoEnd){ var timers = jQuery.timers; if (clearQueue) this.queue([]); this.each(function(){ // go in reverse order so anything added to the queue during the loop is ignored for ( var i = timers.length - 1; i >= 0; i-- ) if ( timers[i].elem == this ) { if (gotoEnd) // force the next step to be the last timers[i](true); timers.splice(i, 1); } }); // start the next in the queue if the last step wasn't forced if (!gotoEnd) this.dequeue(); return this; } }); // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show", 1), slideUp: genFx("hide", 1), slideToggle: genFx("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" } }, function( name, props ){ jQuery.fn[ name ] = function( speed, callback ){ return this.animate( props, speed, callback ); }; }); jQuery.extend({ speed: function(speed, easing, fn) { var opt = typeof speed === "object" ? speed : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction(easing) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; // Queueing opt.old = opt.complete; opt.complete = function(){ if ( opt.queue !== false ) jQuery(this).dequeue(); if ( jQuery.isFunction( opt.old ) ) opt.old.call( this ); }; return opt; }, easing: { linear: function( p, n, firstNum, diff ) { return firstNum + diff * p; }, swing: function( p, n, firstNum, diff ) { return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; } }, timers: [], timerId: null, fx: function( elem, options, prop ){ this.options = options; this.elem = elem; this.prop = prop; if ( !options.orig ) options.orig = {}; } }); jQuery.fx.prototype = { // Simple function for setting a style value update: function(){ if ( this.options.step ) this.options.step.call( this.elem, this.now, this ); (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); // Set display property to block for height/width animations if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) this.elem.style.display = "block"; }, // Get the current size cur: function(force){ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) return this.elem[ this.prop ]; var r = parseFloat(jQuery.css(this.elem, this.prop, force)); return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0; }, // Start an animation from one number to another custom: function(from, to, unit){ this.startTime = now(); this.start = from; this.end = to; this.unit = unit || this.unit || "px"; this.now = this.start; this.pos = this.state = 0; var self = this; function t(gotoEnd){ return self.step(gotoEnd); } t.elem = this.elem; jQuery.timers.push(t); if ( t() && jQuery.timerId == null ) { jQuery.timerId = setInterval(function(){ var timers = jQuery.timers; for ( var i = 0; i < timers.length; i++ ) if ( !timers[i]() ) timers.splice(i--, 1); if ( !timers.length ) { clearInterval( jQuery.timerId ); jQuery.timerId = null; } }, 13); } }, // Simple 'show' function show: function(){ // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); this.options.show = true; // Begin the animation // Make sure that we start at a small width/height to avoid any // flash of content this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); // Start by showing the element jQuery(this.elem).show(); }, // Simple 'hide' function hide: function(){ // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop ); this.options.hide = true; // Begin the animation this.custom(this.cur(), 0); }, // Each step of an animation step: function(gotoEnd){ var t = now(); if ( gotoEnd || t >= this.options.duration + this.startTime ) { this.now = this.end; this.pos = this.state = 1; this.update(); this.options.curAnim[ this.prop ] = true; var done = true; for ( var i in this.options.curAnim ) if ( this.options.curAnim[i] !== true ) done = false; if ( done ) { if ( this.options.display != null ) { // Reset the overflow this.elem.style.overflow = this.options.overflow; // Reset the display this.elem.style.display = this.options.display; if ( jQuery.css(this.elem, "display") == "none" ) this.elem.style.display = "block"; } // Hide the element if the "hide" operation was done if ( this.options.hide ) jQuery(this.elem).hide(); // Reset the properties, if the item has been hidden or shown if ( this.options.hide || this.options.show ) for ( var p in this.options.curAnim ) jQuery.attr(this.elem.style, p, this.options.orig[p]); } if ( done ) // Execute the complete function this.options.complete.call( this.elem ); return false; } else { var n = t - this.startTime; this.state = n / this.options.duration; // Perform the easing function, defaults to swing this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration); this.now = this.start + ((this.end - this.start) * this.pos); // Perform the next step of the animation this.update(); } return true; } }; jQuery.extend( jQuery.fx, { speeds:{ slow: 600, fast: 200, // Default speed _default: 400 }, step: { opacity: function(fx){ jQuery.attr(fx.elem.style, "opacity", fx.now); }, _default: function(fx){ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) fx.elem.style[ fx.prop ] = fx.now + fx.unit; else fx.elem[ fx.prop ] = fx.now; } } }); if ( document.documentElement["getBoundingClientRect"] ) jQuery.fn.offset = function() { if ( !this[0] ) return { top: 0, left: 0 }; if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; return { top: top, left: left }; }; else jQuery.fn.offset = function() { if ( !this[0] ) return { top: 0, left: 0 }; if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); jQuery.offset.initialized || jQuery.offset.initialize(); var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, body = doc.body, defaultView = doc.defaultView, prevComputedStyle = defaultView.getComputedStyle(elem, null), top = elem.offsetTop, left = elem.offsetLeft; while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { computedStyle = defaultView.getComputedStyle(elem, null); top -= elem.scrollTop, left -= elem.scrollLeft; if ( elem === offsetParent ) { top += elem.offsetTop, left += elem.offsetLeft; if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) top += parseInt( computedStyle.borderTopWidth, 10) || 0, left += parseInt( computedStyle.borderLeftWidth, 10) || 0; prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; } if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) top += parseInt( computedStyle.borderTopWidth, 10) || 0, left += parseInt( computedStyle.borderLeftWidth, 10) || 0; prevComputedStyle = computedStyle; } if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) top += body.offsetTop, left += body.offsetLeft; if ( prevComputedStyle.position === "fixed" ) top += Math.max(docElem.scrollTop, body.scrollTop), left += Math.max(docElem.scrollLeft, body.scrollLeft); return { top: top, left: left }; }; jQuery.offset = { initialize: function() { if ( this.initialized ) return; var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>'; rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; for ( prop in rules ) container.style[prop] = rules[prop]; container.innerHTML = html; body.insertBefore(container, body.firstChild); innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; this.doesNotAddBorder = (checkDiv.offsetTop !== 5); this.doesAddBorderForTableAndCells = (td.offsetTop === 5); innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); body.style.marginTop = '1px'; this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); body.style.marginTop = bodyMarginTop; body.removeChild(container); this.initialized = true; }, bodyOffset: function(body) { jQuery.offset.initialized || jQuery.offset.initialize(); var top = body.offsetTop, left = body.offsetLeft; if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0, left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0; return { top: top, left: left }; } }; jQuery.fn.extend({ position: function() { var left = 0, top = 0, results; if ( this[0] ) { // Get *real* offsetParent var offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= num( this, 'marginTop' ); offset.left -= num( this, 'marginLeft' ); // Add offsetParent borders parentOffset.top += num( offsetParent, 'borderTopWidth' ); parentOffset.left += num( offsetParent, 'borderLeftWidth' ); // Subtract the two offsets results = { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; } return results; }, offsetParent: function() { var offsetParent = this[0].offsetParent || document.body; while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) offsetParent = offsetParent.offsetParent; return jQuery(offsetParent); } }); // Create scrollLeft and scrollTop methods jQuery.each( ['Left', 'Top'], function(i, name) { var method = 'scroll' + name; jQuery.fn[ method ] = function(val) { if (!this[0]) return null; return val !== undefined ? // Set the scroll offset this.each(function() { this == window || this == document ? window.scrollTo( !i ? val : jQuery(window).scrollLeft(), i ? val : jQuery(window).scrollTop() ) : this[ method ] = val; }) : // Return the scroll offset this[0] == window || this[0] == document ? self[ i ? 'pageYOffset' : 'pageXOffset' ] || jQuery.boxModel && document.documentElement[ method ] || document.body[ method ] : this[0][ method ]; }; }); // Create innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each([ "Height", "Width" ], function(i, name){ var tl = i ? "Left" : "Top", // top or left br = i ? "Right" : "Bottom"; // bottom or right // innerHeight and innerWidth jQuery.fn["inner" + name] = function(){ return this[ name.toLowerCase() ]() + num(this, "padding" + tl) + num(this, "padding" + br); }; // outerHeight and outerWidth jQuery.fn["outer" + name] = function(margin) { return this["inner" + name]() + num(this, "border" + tl + "Width") + num(this, "border" + br + "Width") + (margin ? num(this, "margin" + tl) + num(this, "margin" + br) : 0); }; var type = name.toLowerCase(); jQuery.fn[ type ] = function( size ) { // Get window width or height return this[0] == window ? // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] : // Get document width or height this[0] == document ? // Either scroll[Width/Height] or offset[Width/Height], whichever is greater Math.max( document.documentElement["client" + name], document.body["scroll" + name], document.documentElement["scroll" + name], document.body["offset" + name], document.documentElement["offset" + name] ) : // Get or set width or height on the element size === undefined ? // Get width or height on the element (this.length ? jQuery.css( this[0], type ) : null) : // Set the width or height on the element (default to pixels if value is unitless) this.css( type, typeof size === "string" ? size : size + "px" ); }; });})();
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-1.3.js
jquery-1.3.js
(function( $ ) { if ( $.fn.dotdotdot ) { return; } $.fn.dotdotdot = function( o ) { if ( this.length == 0 ) { debug( true, 'No element found for "' + this.selector + '".' ); return this; } if ( this.length > 1 ) { return this.each( function() { $(this).dotdotdot( o ); } ); } var $dot = this; if ( $dot.data( 'dotdotdot' ) ) { $dot.trigger( 'destroy.dot' ); } $dot.bind_events = function() { $dot.bind( 'update.dot', function( e, c ) { e.preventDefault(); e.stopPropagation(); opts.maxHeight = ( typeof opts.height == 'number' ) ? opts.height : getTrueInnerHeight( $dot ); opts.maxHeight += opts.tolerance; if ( typeof c != 'undefined' ) { if ( typeof c == 'string' || c instanceof HTMLElement ) { c = $('<div />').append( c ).contents(); } if ( c instanceof $ ) { orgContent = c; } } $inr = $dot.wrapInner( '<div class="dotdotdot" />' ).children(); $inr.empty() .append( orgContent.clone( true ) ) .css({ 'height' : 'auto', 'width' : 'auto', 'border' : 'none', 'padding' : 0, 'margin' : 0 }); var after = false, trunc = false; if ( conf.afterElement ) { after = conf.afterElement.clone( true ); conf.afterElement.remove(); } if ( test( $inr, opts ) ) { if ( opts.wrap == 'children' ) { trunc = children( $inr, opts, after ); } else { trunc = ellipsis( $inr, $dot, $inr, opts, after ); } } $inr.replaceWith( $inr.contents() ); $inr = null; if ( $.isFunction( opts.callback ) ) { opts.callback.call( $dot[ 0 ], trunc, orgContent ); } conf.isTruncated = trunc; return trunc; } ).bind( 'isTruncated.dot', function( e, fn ) { e.preventDefault(); e.stopPropagation(); if ( typeof fn == 'function' ) { fn.call( $dot[ 0 ], conf.isTruncated ); } return conf.isTruncated; } ).bind( 'originalContent.dot', function( e, fn ) { e.preventDefault(); e.stopPropagation(); if ( typeof fn == 'function' ) { fn.call( $dot[ 0 ], orgContent ); } return orgContent; } ).bind( 'destroy.dot', function( e ) { e.preventDefault(); e.stopPropagation(); $dot.unwatch() .unbind_events() .empty() .append( orgContent ) .data( 'dotdotdot', false ); } ); return $dot; }; // /bind_events $dot.unbind_events = function() { $dot.unbind('.dot'); return $dot; }; // /unbind_events $dot.watch = function() { $dot.unwatch(); if ( opts.watch == 'window' ) { var $window = $(window), _wWidth = $window.width(), _wHeight = $window.height(); $window.bind( 'resize.dot' + conf.dotId, function() { if ( _wWidth != $window.width() || _wHeight != $window.height() || !opts.windowResizeFix ) { _wWidth = $window.width(); _wHeight = $window.height(); if ( watchInt ) { clearInterval( watchInt ); } watchInt = setTimeout( function() { $dot.trigger( 'update.dot' ); }, 10 ); } } ); } else { watchOrg = getSizes( $dot ); watchInt = setInterval( function() { var watchNew = getSizes( $dot ); if ( watchOrg.width != watchNew.width || watchOrg.height != watchNew.height ) { $dot.trigger( 'update.dot' ); watchOrg = getSizes( $dot ); } }, 100 ); } return $dot; }; $dot.unwatch = function() { $(window).unbind( 'resize.dot' + conf.dotId ); if ( watchInt ) { clearInterval( watchInt ); } return $dot; }; var orgContent = $dot.contents(), opts = $.extend( true, {}, $.fn.dotdotdot.defaults, o ), conf = {}, watchOrg = {}, watchInt = null, $inr = null; conf.afterElement = getElement( opts.after, $dot ); conf.isTruncated = false; conf.dotId = dotId++; $dot.data( 'dotdotdot', true ) .bind_events() .trigger( 'update.dot' ); if ( opts.watch ) { $dot.watch(); } return $dot; }; // public $.fn.dotdotdot.defaults = { 'ellipsis' : '... ', 'wrap' : 'word', 'lastCharacter': { 'remove' : [ ' ', ',', ';', '.', '!', '?' ], 'noEllipsis' : [] }, 'tolerance' : 0, 'callback' : null, 'after' : null, 'height' : null, 'watch' : false, 'windowResizeFix': true, 'debug' : false }; // private var dotId = 1; function children( $elem, o, after ) { var $elements = $elem.children(), isTruncated = false; $elem.empty(); for ( var a = 0, l = $elements.length; a < l; a++ ) { var $e = $elements.eq( a ); $elem.append( $e ); if ( after ) { $elem.append( after ); } if ( test( $elem, o ) ) { $e.remove(); isTruncated = true; break; } else { if ( after ) { after.remove(); } } } return isTruncated; } function ellipsis( $elem, $d, $i, o, after ) { var $elements = $elem.contents(), isTruncated = false; $elem.empty(); var notx = 'table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style'; for ( var a = 0, l = $elements.length; a < l; a++ ) { if ( isTruncated ) { break; } var e = $elements[ a ], $e = $(e); if ( typeof e == 'undefined' ) { continue; } $elem.append( $e ); if ( after ) { $elem[ ( $elem.is( notx ) ) ? 'after' : 'append' ]( after ); } if ( e.nodeType == 3 ) { if ( test( $i, o ) ) { isTruncated = ellipsisElement( $e, $d, $i, o, after ); } } else { isTruncated = ellipsis( $e, $d, $i, o, after ); } if ( !isTruncated ) { if ( after ) { after.remove(); } } } return isTruncated; } function ellipsisElement( $e, $d, $i, o, after ) { var isTruncated = false, e = $e[ 0 ]; if ( typeof e == 'undefined' ) { return false; } var seporator = ( o.wrap == 'letter' ) ? '' : ' ', textArr = getTextContent( e ).split( seporator ), position = -1, midPos = -1, startPos = 0, endPos = textArr.length - 1; while ( startPos <= endPos ) { var m = Math.floor( ( startPos + endPos ) / 2 ); if ( m == midPos ) { break; } midPos = m; setTextContent( e, textArr.slice( 0, midPos + 1 ).join( seporator ) + o.ellipsis ); if ( !test( $i, o ) ) { position = midPos; startPos = midPos; } else { endPos = midPos; } } if ( position != -1 && !( textArr.length == 1 && textArr[ 0 ].length == 0 ) ) { var txt = addEllipsis( textArr.slice( 0, position + 1 ).join( seporator ), o ); isTruncated = true; setTextContent( e, txt ); } else { var $w = $e.parent(); $e.remove(); var afterLength = ( after ) ? after.length : 0 ; if ( $w.contents().size() > afterLength ) { var $n = $w.contents().eq( -1 - afterLength ); isTruncated = ellipsisElement( $n, $d, $i, o, after ); } else { var e = $w.prev().contents().eq( -1 )[ 0 ]; if ( typeof e != 'undefined' ) { var txt = addEllipsis( getTextContent( e ), o ); setTextContent( e, txt ); $w.remove(); isTruncated = true; } } } return isTruncated; } function test( $i, o ) { return $i.innerHeight() > o.maxHeight; } function addEllipsis( txt, o ) { while( $.inArray( txt.slice( -1 ), o.lastCharacter.remove ) > -1 ) { txt = txt.slice( 0, -1 ); } if ( $.inArray( txt.slice( -1 ), o.lastCharacter.noEllipsis ) < 0 ) { txt += o.ellipsis; } return txt; } function getSizes( $d ) { return { 'width' : $d.innerWidth(), 'height': $d.innerHeight() }; } function setTextContent( e, content ) { if ( e.innerText ) { e.innerText = content; } else if ( e.nodeValue ) { e.nodeValue = content; } else if (e.textContent) { e.textContent = content; } } function getTextContent( e ) { if ( e.innerText ) { return e.innerText; } else if ( e.nodeValue ) { return e.nodeValue; } else if ( e.textContent ) { return e.textContent; } else { return ""; } } function getElement( e, $i ) { if ( typeof e == 'undefined' ) { return false; } if ( !e ) { return false; } if ( typeof e == 'string' ) { e = $(e, $i); return ( e.length ) ? e : false; } if ( typeof e == 'object' ) { return ( typeof e.jquery == 'undefined' ) ? false : e; } return false; } function getTrueInnerHeight( $el ) { var h = $el.innerHeight(), a = [ 'paddingTop', 'paddingBottom' ]; for ( var z = 0, l = a.length; z < l; z++ ) { var m = parseInt( $el.css( a[ z ] ), 10 ); if ( isNaN( m ) ) { m = 0; } h -= m; } return h; } function debug( d, m ) { if ( !d ) { return false; } if ( typeof m == 'string' ) { m = 'dotdotdot: ' + m; } else { m = [ 'dotdotdot:', m ]; } if ( typeof window.console != 'undefined' ) { if ( typeof window.console.log != 'undefined' ) { window.console.log( m ); } } return false; } // override jQuery.html var _orgHtml = $.fn.html; $.fn.html = function( str ) { if ( typeof str != 'undefined' ) { if ( this.data( 'dotdotdot' ) ) { if ( typeof str != 'function' ) { return this.trigger( 'update', [ str ] ); } } return _orgHtml.call( this, str ); } return _orgHtml.call( this ); }; // override jQuery.text var _orgText = $.fn.text; $.fn.text = function( str ) { if ( typeof str != 'undefined' ) { if ( this.data( 'dotdotdot' ) ) { var temp = $( '<div />' ); temp.text( str ); str = temp.html(); temp.remove(); return this.trigger( 'update', [ str ] ); } return _orgText.call( this, str ); } return _orgText.call( this ); }; })( jQuery );
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-dotdotdot.js
jquery-dotdotdot.js
if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/json2.min.js
json2.min.js
(function(i){if(i.fn.dotdotdot){return}i.fn.dotdotdot=function(v){if(this.length==0){b(true,'No element found for "'+this.selector+'".');return this}if(this.length>1){return this.each(function(){i(this).dotdotdot(v)})}var r=this;if(r.data("dotdotdot")){r.trigger("destroy.dot")}r.bind_events=function(){r.bind("update.dot",function(y,A){y.preventDefault();y.stopPropagation();t.maxHeight=(typeof t.height=="number")?t.height:o(r);t.maxHeight+=t.tolerance;if(typeof A!="undefined"){if(typeof A=="string"||A instanceof HTMLElement){A=i("<div />").append(A).contents()}if(A instanceof i){w=A}}s=r.wrapInner('<div class="dotdotdot" />').children();s.empty().append(w.clone(true)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var z=false,x=false;if(q.afterElement){z=q.afterElement.clone(true);q.afterElement.remove()}if(k(s,t)){if(t.wrap=="children"){x=d(s,t,z)}else{x=m(s,r,s,t,z)}}s.replaceWith(s.contents());s=null;if(i.isFunction(t.callback)){t.callback.call(r[0],x,w)}q.isTruncated=x;return x}).bind("isTruncated.dot",function(y,x){y.preventDefault();y.stopPropagation();if(typeof x=="function"){x.call(r[0],q.isTruncated)}return q.isTruncated}).bind("originalContent.dot",function(y,x){y.preventDefault();y.stopPropagation();if(typeof x=="function"){x.call(r[0],w)}return w}).bind("destroy.dot",function(x){x.preventDefault();x.stopPropagation();r.unwatch().unbind_events().empty().append(w).data("dotdotdot",false)});return r};r.unbind_events=function(){r.unbind(".dot");return r};r.watch=function(){r.unwatch();if(t.watch=="window"){var z=i(window),y=z.width(),x=z.height();z.bind("resize.dot"+q.dotId,function(){if(y!=z.width()||x!=z.height()||!t.windowResizeFix){y=z.width();x=z.height();if(p){clearInterval(p)}p=setTimeout(function(){r.trigger("update.dot")},10)}})}else{u=j(r);p=setInterval(function(){var A=j(r);if(u.width!=A.width||u.height!=A.height){r.trigger("update.dot");u=j(r)}},100)}return r};r.unwatch=function(){i(window).unbind("resize.dot"+q.dotId);if(p){clearInterval(p)}return r};var w=r.contents(),t=i.extend(true,{},i.fn.dotdotdot.defaults,v),q={},u={},p=null,s=null;q.afterElement=c(t.after,r);q.isTruncated=false;q.dotId=l++;r.data("dotdotdot",true).bind_events().trigger("update.dot");if(t.watch){r.watch()}return r};i.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",lastCharacter:{remove:[" ",",",";",".","!","?"],noEllipsis:[]},tolerance:0,callback:null,after:null,height:null,watch:false,windowResizeFix:true,debug:false};var l=1;function d(s,w,v){var u=s.children(),p=false;s.empty();for(var r=0,q=u.length;r<q;r++){var t=u.eq(r);s.append(t);if(v){s.append(v)}if(k(s,w)){t.remove();p=true;break}else{if(v){v.remove()}}}return p}function m(s,r,A,t,q){var w=s.contents(),x=false;s.empty();var z="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, select, optgroup, option, textarea, script, style";for(var y=0,u=w.length;y<u;y++){if(x){break}var v=w[y],p=i(v);if(typeof v=="undefined"){continue}s.append(p);if(q){s[(s.is(z))?"after":"append"](q)}if(v.nodeType==3){if(k(A,t)){x=e(p,r,A,t,q)}}else{x=m(p,r,A,t,q)}if(!x){if(q){q.remove()}}}return x}function e(q,r,p,w,s){var D=false,A=q[0];if(typeof A=="undefined"){return false}var E=(w.wrap=="letter")?"":" ",t=h(A).split(E),F=-1,v=-1,G=0,y=t.length-1;while(G<=y){var x=Math.floor((G+y)/2);if(x==v){break}v=x;a(A,t.slice(0,v+1).join(E)+w.ellipsis);if(!k(p,w)){F=v;G=v}else{y=v}}if(F!=-1&&!(t.length==1&&t[0].length==0)){var u=f(t.slice(0,F+1).join(E),w);D=true;a(A,u)}else{var z=q.parent();q.remove();var C=(s)?s.length:0;if(z.contents().size()>C){var B=z.contents().eq(-1-C);D=e(B,r,p,w,s)}else{var A=z.prev().contents().eq(-1)[0];if(typeof A!="undefined"){var u=f(h(A),w);a(A,u);z.remove();D=true}}}return D}function k(q,p){return q.innerHeight()>p.maxHeight}function f(p,q){while(i.inArray(p.slice(-1),q.lastCharacter.remove)>-1){p=p.slice(0,-1)}if(i.inArray(p.slice(-1),q.lastCharacter.noEllipsis)<0){p+=q.ellipsis}return p}function j(p){return{width:p.innerWidth(),height:p.innerHeight()}}function a(q,p){if(q.innerText){q.innerText=p}else{if(q.nodeValue){q.nodeValue=p}else{if(q.textContent){q.textContent=p}}}}function h(p){if(p.innerText){return p.innerText}else{if(p.nodeValue){return p.nodeValue}else{if(p.textContent){return p.textContent}else{return""}}}}function c(p,q){if(typeof p=="undefined"){return false}if(!p){return false}if(typeof p=="string"){p=i(p,q);return(p.length)?p:false}if(typeof p=="object"){return(typeof p.jquery=="undefined")?false:p}return false}function o(s){var t=s.innerHeight(),r=["paddingTop","paddingBottom"];for(var u=0,q=r.length;u<q;u++){var p=parseInt(s.css(r[u]),10);if(isNaN(p)){p=0}t-=p}return t}function b(q,p){if(!q){return false}if(typeof p=="string"){p="dotdotdot: "+p}else{p=["dotdotdot:",p]}if(typeof window.console!="undefined"){if(typeof window.console.log!="undefined"){window.console.log(p)}}return false}var n=i.fn.html;i.fn.html=function(p){if(typeof p!="undefined"){if(this.data("dotdotdot")){if(typeof p!="function"){return this.trigger("update",[p])}}return n.call(this,p)}return n.call(this)};var g=i.fn.text;i.fn.text=function(q){if(typeof q!="undefined"){if(this.data("dotdotdot")){var p=i("<div />");p.text(q);q=p.html();p.remove();return this.trigger("update",[q])}return g.call(this,q)}return g.call(this)}})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-dotdotdot.min.js
jquery-dotdotdot.min.js
(function(e){var d;e.fn.treeTable=function(i){d=e.extend({},e.fn.treeTable.defaults,i);return this.each(function(){e(this).addClass("treeTable").find("tbody tr").each(function(){if(!d.expandable||e(this)[0].className.search("child-of-")==-1){a(e(this))}else{if(d.initialState=="collapsed"){this.style.display="none"}}})})};e.fn.treeTable.defaults={childPrefix:"child-of-",clickableNodeNames:false,expandable:true,indent:19,initialState:"collapsed",treeColumn:0};e.fn.collapse=function(){e(this).addClass("collapsed");f(e(this)).each(function(){if(!e(this).hasClass("collapsed")){e(this).collapse()}e(this).hide()});return this};e.fn.expand=function(){e(this).removeClass("collapsed").addClass("expanded");f(e(this)).each(function(){a(e(this));if(e(this).is(".expanded.parent")){e(this).expand()}e(this).show()});return this};e.fn.appendBranchTo=function(i){var l=e(this);var j=h(l);var k=e.map(g(e(i)),function(m){return m.id});if(e.inArray(l[0].id,k)==-1&&(!j||(i.id!=j[0].id))&&i.id!=l[0].id){b(l,g(l).length*d.indent*-1);if(j){l.removeClass(d.childPrefix+j[0].id)}l.addClass(d.childPrefix+i.id);c(l,i);b(l,g(l).length*d.indent);return this}return false};e.fn.reverse=function(){return this.pushStack(this.get().reverse(),arguments)};e.fn.toggleBranch=function(){if(e(this).hasClass("collapsed")){e(this).expand()}else{e(this).removeClass("expanded").collapse()}return this};function g(j){var i=[];while(j=h(j)){i[i.length]=j[0]}return i}function f(i){return e("table.treeTable tbody tr."+d.childPrefix+i[0].id)}function b(j,k){var i=e(j.children("td")[d.treeColumn]);var l=parseInt(i.css("padding-left"),10)+k;i.css("padding-left",+l+"px");f(j).each(function(){b(e(this),k)})}function a(j){if(!j.hasClass("initialized")){j.addClass("initialized");var l=f(j);if(!j.hasClass("parent")&&l.length>0){j.addClass("parent")}if(j.hasClass("parent")){var i=e(j.children("td")[d.treeColumn]);var k=parseInt(i.css("padding-left"),10)+d.indent;l.each(function(){e(e(this).children("td")[d.treeColumn]).css("padding-left",k+"px")});if(d.expandable){i.prepend('<span style="margin-left: -'+d.indent+"px; padding-left: "+d.indent+'px" class="expander"></span>');e(i[0].firstChild).click(function(){j.toggleBranch()});if(d.clickableNodeNames){e(i).css("cursor","pointer");e(i).click(function(m){if(m.target.className!="expander"){j.toggleBranch()}})}if(!(j.hasClass("expanded")||j.hasClass("collapsed"))){j.addClass(d.initialState)}if(j.hasClass("expanded")){j.expand()}}}}}function c(j,i){j.insertAfter(i);f(j).reverse().each(function(){c(e(this),j[0])})}function h(i){var j=i[0].className.split(" ");for(key in j){if(j[key].match("child-of-")){return e("#"+j[key].substring(9))}}}})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-treeTable.min.js
jquery-treeTable.min.js
(function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else { // Browser globals factory(jQuery); } }(function ($) { var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll']; var toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll']; var lowestDelta, lowestDeltaXY; if ($.event.fixHooks) { for ( var i=toFix.length; i; ) { $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; } } $.event.special.mousewheel = { setup: function() { if ( this.addEventListener ) { for ( var i=toBind.length; i; ) { this.addEventListener( toBind[--i], handler, false ); } } else { this.onmousewheel = handler; } }, teardown: function() { if ( this.removeEventListener ) { for ( var i=toBind.length; i; ) { this.removeEventListener( toBind[--i], handler, false ); } } else { this.onmousewheel = null; } } }; $.fn.extend({ mousewheel: function(fn) { return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); }, unmousewheel: function(fn) { return this.unbind("mousewheel", fn); } }); function handler(event) { var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, deltaX = 0, deltaY = 0, absDelta = 0, absDeltaXY = 0, fn; event = $.event.fix(orgEvent); event.type = "mousewheel"; // Old school scrollwheel delta if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; } if ( orgEvent.detail ) { delta = orgEvent.detail * -1; } // New school wheel delta (wheel event) if ( orgEvent.deltaY ) { deltaY = orgEvent.deltaY * -1; delta = deltaY; } if ( orgEvent.deltaX ) { deltaX = orgEvent.deltaX; delta = deltaX * -1; } // Webkit if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY; } if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = orgEvent.wheelDeltaX * -1; } // Look for lowest delta to normalize the delta values absDelta = Math.abs(delta); if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; } absDeltaXY = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); if ( !lowestDeltaXY || absDeltaXY < lowestDeltaXY ) { lowestDeltaXY = absDeltaXY; } // Get a whole value for the deltas fn = delta > 0 ? 'floor' : 'ceil'; delta = Math[fn](delta/lowestDelta); deltaX = Math[fn](deltaX/lowestDeltaXY); deltaY = Math[fn](deltaY/lowestDeltaXY); // Add event and delta to the front of the arguments args.unshift(event, delta, deltaX, deltaY); return ($.event.dispatch || $.event.handle).apply(this, args); } }));
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-mousewheel.js
jquery-mousewheel.js
(function(a){a.fn.liquidcarousel=function(b){var c={height:150,duration:100,hidearrows:true,centered:true};var b=a.extend(c,b);return this.each(function(){var e=a(this);a(e).height(b.height);a(e).css("overflow","hidden");a("> .wrapper",e).height(b.height).css("overflow","hidden").css("float","left");a("> .wrapper > ul",e).height(b.height).css("float","left").css("margin","0").css("padding","0").css("display","block");a("> .wrapper > ul > li",e).height(b.height).css("display","block").css("float","left");var h=parseInt(a("> .wrapper > ul > li",e).css("marginRight"));var m=parseInt(a("> .wrapper > ul > li",e).css("marginLeft"));var g=0;var f=a("> .wrapper > ul > li",this).length;var i=0;var d=a("> .wrapper > ul > li:first",e).outerWidth(true);var k=0;var j=d+k;a(window).resize(function(p){var o=a(e).width();var n=(o-a("> .previous",e).outerWidth(true)-a("> .next",e).outerWidth(true));previousvisiblelis=g;g=Math.floor((n/d));if(g<f){k=Math.floor((n-(g*d))/g)}else{if(b.centered){k=Math.floor((n-(f*d))/f)}else{k=0}}halfadditionalmargin=Math.floor(k/2);j=d+k;a("> .wrapper > ul > li",e).css("marginRight",h+halfadditionalmargin);a("> .wrapper > ul > li",e).css("marginLeft",m+halfadditionalmargin);if(g>previousvisiblelis||f<=g){i-=(g-previousvisiblelis);if(i<0||f<=g){i=0}}a("> .wrapper > ul",e).css("marginLeft",-(i*j));if(g>=f||((o>=(f*d))&&b.hidearrows)){if(b.hidearrows){a("> .previous",e).css("visibility","hidden");a("> .next",e).css("visibility","hidden")}a("> .wrapper",e).width(f*j);a("> ul",e).width(f*j);a("> .wrapper",e).css("marginLeft",0);i=0}else{a("> .previous",e).css("visibility",i>0?"visible":"hidden");a("> .next",e).css("visibility",i<f-g?"visible":"hidden");a("> .wrapper",e).width(g*j);a("> ul",e).width(g*j)}});a("> .next",e).click(function(){if(f<=g){i=0}else{if((i+(g*2))<f){i+=g}else{if((i+(g*2))>=f-1){i=f-g}}}a("> .wrapper > ul",e).stop();a("> .wrapper > ul",e).animate({marginLeft:-(i*j)},b.duration);a("> .next",e).css("visibility",i<f-g?"visible":"hidden");a("> .previous",e).css("visibility",i>0?"visible":"hidden")});a("> .previous",e).click(function(){if((i-g)>0){i-=g}else{if((i-(g*2))<=0){i=0}}a("> .wrapper > ul",e).stop();a("> .wrapper > ul",e).animate({marginLeft:-(i*j)},b.duration);a("> .previous",e).css("visibility",i>0?"visible":"hidden");a("> .next",e).css("visibility",i<f-g?"visible":"hidden")});a("> .next",e).dblclick(function(n){n.preventDefault();l()});a("> .previous",e).dblclick(function(n){n.preventDefault();l()});function l(){if(document.selection&&document.selection.empty){document.selection.empty()}else{if(window.getSelection){var n=window.getSelection();n.removeAllRanges()}}}a(window).resize()})}})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-liquidcarousel.min.js
jquery-liquidcarousel.min.js
(function( jQuery, undefined ) { var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", // plusequals test for += 100 -= 100 rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, // a set of RE's that can match strings and generate color tuples. stringParsers = [{ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function( execResult ) { return [ execResult[ 1 ], execResult[ 2 ], execResult[ 3 ], execResult[ 4 ] ]; } }, { re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function( execResult ) { return [ execResult[ 1 ] * 2.55, execResult[ 2 ] * 2.55, execResult[ 3 ] * 2.55, execResult[ 4 ] ]; } }, { // this regex ignores A-F because it's compared against an already lowercased string re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, parse: function( execResult ) { return [ parseInt( execResult[ 1 ], 16 ), parseInt( execResult[ 2 ], 16 ), parseInt( execResult[ 3 ], 16 ) ]; } }, { // this regex ignores A-F because it's compared against an already lowercased string re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, parse: function( execResult ) { return [ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) ]; } }, { re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, space: "hsla", parse: function( execResult ) { return [ execResult[ 1 ], execResult[ 2 ] / 100, execResult[ 3 ] / 100, execResult[ 4 ] ]; } }], // jQuery.Color( ) color = jQuery.Color = function( color, green, blue, alpha ) { return new jQuery.Color.fn.parse( color, green, blue, alpha ); }, spaces = { rgba: { props: { red: { idx: 0, type: "byte" }, green: { idx: 1, type: "byte" }, blue: { idx: 2, type: "byte" } } }, hsla: { props: { hue: { idx: 0, type: "degrees" }, saturation: { idx: 1, type: "percent" }, lightness: { idx: 2, type: "percent" } } } }, propTypes = { "byte": { floor: true, max: 255 }, "percent": { max: 1 }, "degrees": { mod: 360, floor: true } }, support = color.support = {}, // element for support tests supportElem = jQuery( "<p>" )[ 0 ], // colors = jQuery.Color.names colors, // local aliases of functions called often each = jQuery.each; // determine rgba support immediately supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; // define cache name and alpha properties // for rgba and hsla spaces each( spaces, function( spaceName, space ) { space.cache = "_" + spaceName; space.props.alpha = { idx: 3, type: "percent", def: 1 }; }); function clamp( value, prop, allowEmpty ) { var type = propTypes[ prop.type ] || {}; if ( value == null ) { return (allowEmpty || !prop.def) ? null : prop.def; } // ~~ is an short way of doing floor for positive numbers value = type.floor ? ~~value : parseFloat( value ); // IE will pass in empty strings as value for alpha, // which will hit this case if ( isNaN( value ) ) { return prop.def; } if ( type.mod ) { // we add mod before modding to make sure that negatives values // get converted properly: -10 -> 350 return (value + type.mod) % type.mod; } // for now all property types without mod have min and max return 0 > value ? 0 : type.max < value ? type.max : value; } function stringParse( string ) { var inst = color(), rgba = inst._rgba = []; string = string.toLowerCase(); each( stringParsers, function( i, parser ) { var parsed, match = parser.re.exec( string ), values = match && parser.parse( match ), spaceName = parser.space || "rgba"; if ( values ) { parsed = inst[ spaceName ]( values ); // if this was an rgba parse the assignment might happen twice // oh well.... inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; rgba = inst._rgba = parsed._rgba; // exit each( stringParsers ) here because we matched return false; } }); // Found a stringParser that handled it if ( rgba.length ) { // if this came from a parsed string, force "transparent" when alpha is 0 // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) if ( rgba.join() === "0,0,0,0" ) { jQuery.extend( rgba, colors.transparent ); } return inst; } // named colors return colors[ string ]; } color.fn = jQuery.extend( color.prototype, { parse: function( red, green, blue, alpha ) { if ( red === undefined ) { this._rgba = [ null, null, null, null ]; return this; } if ( red.jquery || red.nodeType ) { red = jQuery( red ).css( green ); green = undefined; } var inst = this, type = jQuery.type( red ), rgba = this._rgba = []; // more than 1 argument specified - assume ( red, green, blue, alpha ) if ( green !== undefined ) { red = [ red, green, blue, alpha ]; type = "array"; } if ( type === "string" ) { return this.parse( stringParse( red ) || colors._default ); } if ( type === "array" ) { each( spaces.rgba.props, function( key, prop ) { rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); }); return this; } if ( type === "object" ) { if ( red instanceof color ) { each( spaces, function( spaceName, space ) { if ( red[ space.cache ] ) { inst[ space.cache ] = red[ space.cache ].slice(); } }); } else { each( spaces, function( spaceName, space ) { var cache = space.cache; each( space.props, function( key, prop ) { // if the cache doesn't exist, and we know how to convert if ( !inst[ cache ] && space.to ) { // if the value was null, we don't need to copy it // if the key was alpha, we don't need to copy it either if ( key === "alpha" || red[ key ] == null ) { return; } inst[ cache ] = space.to( inst._rgba ); } // this is the only case where we allow nulls for ALL properties. // call clamp with alwaysAllowEmpty inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); }); // everything defined but alpha? if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { // use the default of 1 inst[ cache ][ 3 ] = 1; if ( space.from ) { inst._rgba = space.from( inst[ cache ] ); } } }); } return this; } }, is: function( compare ) { var is = color( compare ), same = true, inst = this; each( spaces, function( _, space ) { var localCache, isCache = is[ space.cache ]; if (isCache) { localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; each( space.props, function( _, prop ) { if ( isCache[ prop.idx ] != null ) { same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); return same; } }); } return same; }); return same; }, _space: function() { var used = [], inst = this; each( spaces, function( spaceName, space ) { if ( inst[ space.cache ] ) { used.push( spaceName ); } }); return used.pop(); }, transition: function( other, distance ) { var end = color( other ), spaceName = end._space(), space = spaces[ spaceName ], startColor = this.alpha() === 0 ? color( "transparent" ) : this, start = startColor[ space.cache ] || space.to( startColor._rgba ), result = start.slice(); end = end[ space.cache ]; each( space.props, function( key, prop ) { var index = prop.idx, startValue = start[ index ], endValue = end[ index ], type = propTypes[ prop.type ] || {}; // if null, don't override start value if ( endValue === null ) { return; } // if null - use end if ( startValue === null ) { result[ index ] = endValue; } else { if ( type.mod ) { if ( endValue - startValue > type.mod / 2 ) { startValue += type.mod; } else if ( startValue - endValue > type.mod / 2 ) { startValue -= type.mod; } } result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); } }); return this[ spaceName ]( result ); }, blend: function( opaque ) { // if we are already opaque - return ourself if ( this._rgba[ 3 ] === 1 ) { return this; } var rgb = this._rgba.slice(), a = rgb.pop(), blend = color( opaque )._rgba; return color( jQuery.map( rgb, function( v, i ) { return ( 1 - a ) * blend[ i ] + a * v; })); }, toRgbaString: function() { var prefix = "rgba(", rgba = jQuery.map( this._rgba, function( v, i ) { return v == null ? ( i > 2 ? 1 : 0 ) : v; }); if ( rgba[ 3 ] === 1 ) { rgba.pop(); prefix = "rgb("; } return prefix + rgba.join() + ")"; }, toHslaString: function() { var prefix = "hsla(", hsla = jQuery.map( this.hsla(), function( v, i ) { if ( v == null ) { v = i > 2 ? 1 : 0; } // catch 1 and 2 if ( i && i < 3 ) { v = Math.round( v * 100 ) + "%"; } return v; }); if ( hsla[ 3 ] === 1 ) { hsla.pop(); prefix = "hsl("; } return prefix + hsla.join() + ")"; }, toHexString: function( includeAlpha ) { var rgba = this._rgba.slice(), alpha = rgba.pop(); if ( includeAlpha ) { rgba.push( ~~( alpha * 255 ) ); } return "#" + jQuery.map( rgba, function( v ) { // default to 0 when nulls exist v = ( v || 0 ).toString( 16 ); return v.length === 1 ? "0" + v : v; }).join(""); }, toString: function() { return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); } }); color.fn.parse.prototype = color.fn; // hsla conversions adapted from: // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 function hue2rgb( p, q, h ) { h = ( h + 1 ) % 1; if ( h * 6 < 1 ) { return p + (q - p) * h * 6; } if ( h * 2 < 1) { return q; } if ( h * 3 < 2 ) { return p + (q - p) * ((2/3) - h) * 6; } return p; } spaces.hsla.to = function ( rgba ) { if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { return [ null, null, null, rgba[ 3 ] ]; } var r = rgba[ 0 ] / 255, g = rgba[ 1 ] / 255, b = rgba[ 2 ] / 255, a = rgba[ 3 ], max = Math.max( r, g, b ), min = Math.min( r, g, b ), diff = max - min, add = max + min, l = add * 0.5, h, s; if ( min === max ) { h = 0; } else if ( r === max ) { h = ( 60 * ( g - b ) / diff ) + 360; } else if ( g === max ) { h = ( 60 * ( b - r ) / diff ) + 120; } else { h = ( 60 * ( r - g ) / diff ) + 240; } // chroma (diff) == 0 means greyscale which, by definition, saturation = 0% // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) if ( diff === 0 ) { s = 0; } else if ( l <= 0.5 ) { s = diff / add; } else { s = diff / ( 2 - add ); } return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; }; spaces.hsla.from = function ( hsla ) { if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { return [ null, null, null, hsla[ 3 ] ]; } var h = hsla[ 0 ] / 360, s = hsla[ 1 ], l = hsla[ 2 ], a = hsla[ 3 ], q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, p = 2 * l - q; return [ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), Math.round( hue2rgb( p, q, h ) * 255 ), Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), a ]; }; each( spaces, function( spaceName, space ) { var props = space.props, cache = space.cache, to = space.to, from = space.from; // makes rgba() and hsla() color.fn[ spaceName ] = function( value ) { // generate a cache for this space if it doesn't exist if ( to && !this[ cache ] ) { this[ cache ] = to( this._rgba ); } if ( value === undefined ) { return this[ cache ].slice(); } var ret, type = jQuery.type( value ), arr = ( type === "array" || type === "object" ) ? value : arguments, local = this[ cache ].slice(); each( props, function( key, prop ) { var val = arr[ type === "object" ? key : prop.idx ]; if ( val == null ) { val = local[ prop.idx ]; } local[ prop.idx ] = clamp( val, prop ); }); if ( from ) { ret = color( from( local ) ); ret[ cache ] = local; return ret; } else { return color( local ); } }; // makes red() green() blue() alpha() hue() saturation() lightness() each( props, function( key, prop ) { // alpha is included in more than one space if ( color.fn[ key ] ) { return; } color.fn[ key ] = function( value ) { var vtype = jQuery.type( value ), fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), local = this[ fn ](), cur = local[ prop.idx ], match; if ( vtype === "undefined" ) { return cur; } if ( vtype === "function" ) { value = value.call( this, cur ); vtype = jQuery.type( value ); } if ( value == null && prop.empty ) { return this; } if ( vtype === "string" ) { match = rplusequals.exec( value ); if ( match ) { value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); } } local[ prop.idx ] = value; return this[ fn ]( local ); }; }); }); // add cssHook and .fx.step function for each named hook. // accept a space separated string of properties color.hook = function( hook ) { var hooks = hook.split( " " ); each( hooks, function( i, hook ) { jQuery.cssHooks[ hook ] = { set: function( elem, value ) { var parsed, curElem, backgroundColor = ""; if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) { value = color( parsed || value ); if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { curElem = hook === "backgroundColor" ? elem.parentNode : elem; while ( (backgroundColor === "" || backgroundColor === "transparent") && curElem && curElem.style ) { try { backgroundColor = jQuery.css( curElem, "backgroundColor" ); curElem = curElem.parentNode; } catch ( e ) { } } value = value.blend( backgroundColor && backgroundColor !== "transparent" ? backgroundColor : "_default" ); } value = value.toRgbaString(); } try { elem.style[ hook ] = value; } catch( e ) { // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' } } }; jQuery.fx.step[ hook ] = function( fx ) { if ( !fx.colorInit ) { fx.start = color( fx.elem, hook ); fx.end = color( fx.end ); fx.colorInit = true; } jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); }; }); }; color.hook( stepHooks ); jQuery.cssHooks.borderColor = { expand: function( value ) { var expanded = {}; each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { expanded[ "border" + part + "Color" ] = value; }); return expanded; } }; // Basic color names only. // Usage of any of the other color names requires adding yourself or including // jquery.color.svg-names.js. colors = jQuery.Color.names = { // 4.1. Basic color keywords aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", // 4.2.3. "transparent" color keyword transparent: [ null, null, null, 0 ], _default: "#ffffff" }; }( jQuery ));
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-color.js
jquery-color.js
(function(b){var a=function(){var S={},c,N=65,t,P='<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',B={eventName:"click",onShow:function(){},onBeforeShow:function(){},onHide:function(){},onChange:function(){},onSubmit:function(){},color:"ff0000",livePreview:true,flat:false},J=function(T,V){var U=j(T);b(V).data("colorpicker").fields.eq(1).val(U.r).end().eq(2).val(U.g).end().eq(3).val(U.b).end()},u=function(T,U){b(U).data("colorpicker").fields.eq(4).val(T.h).end().eq(5).val(T.s).end().eq(6).val(T.b).end()},g=function(T,U){b(U).data("colorpicker").fields.eq(0).val(R(T)).end()},l=function(T,U){b(U).data("colorpicker").selector.css("backgroundColor","#"+R({h:T.h,s:100,b:100}));b(U).data("colorpicker").selectorIndic.css({left:parseInt(150*T.s/100,10),top:parseInt(150*(100-T.b)/100,10)})},G=function(T,U){b(U).data("colorpicker").hue.css("top",parseInt(150-150*T.h/360,10))},h=function(T,U){b(U).data("colorpicker").currentColor.css("backgroundColor","#"+R(T))},E=function(T,U){b(U).data("colorpicker").newColor.css("backgroundColor","#"+R(T))},n=function(T){var V=T.charCode||T.keyCode||-1;if((V>N&&V<=90)||V==32){return false}var U=b(this).parent().parent();if(U.data("colorpicker").livePreview===true){e.apply(this)}},e=function(U){var V=b(this).parent().parent(),T;if(this.parentNode.className.indexOf("_hex")>0){V.data("colorpicker").color=T=m(y(this.value))}else{if(this.parentNode.className.indexOf("_hsb")>0){V.data("colorpicker").color=T=f({h:parseInt(V.data("colorpicker").fields.eq(4).val(),10),s:parseInt(V.data("colorpicker").fields.eq(5).val(),10),b:parseInt(V.data("colorpicker").fields.eq(6).val(),10)})}else{V.data("colorpicker").color=T=i(M({r:parseInt(V.data("colorpicker").fields.eq(1).val(),10),g:parseInt(V.data("colorpicker").fields.eq(2).val(),10),b:parseInt(V.data("colorpicker").fields.eq(3).val(),10)}))}}if(U){J(T,V.get(0));g(T,V.get(0));u(T,V.get(0))}l(T,V.get(0));G(T,V.get(0));E(T,V.get(0));V.data("colorpicker").onChange.apply(V,[T,R(T),j(T)])},o=function(T){var U=b(this).parent().parent();U.data("colorpicker").fields.parent().removeClass("colorpicker_focus")},K=function(){N=this.parentNode.className.indexOf("_hex")>0?70:65;b(this).parent().parent().data("colorpicker").fields.parent().removeClass("colorpicker_focus");b(this).parent().addClass("colorpicker_focus")},I=function(T){var V=b(this).parent().find("input").focus();var U={el:b(this).parent().addClass("colorpicker_slider"),max:this.parentNode.className.indexOf("_hsb_h")>0?360:(this.parentNode.className.indexOf("_hsb")>0?100:255),y:T.pageY,field:V,val:parseInt(V.val(),10),preview:b(this).parent().parent().data("colorpicker").livePreview};b(document).bind("mouseup",U,s);b(document).bind("mousemove",U,L)},L=function(T){T.data.field.val(Math.max(0,Math.min(T.data.max,parseInt(T.data.val+T.pageY-T.data.y,10))));if(T.data.preview){e.apply(T.data.field.get(0),[true])}return false},s=function(T){e.apply(T.data.field.get(0),[true]);T.data.el.removeClass("colorpicker_slider").find("input").focus();b(document).unbind("mouseup",s);b(document).unbind("mousemove",L);return false},w=function(T){var U={cal:b(this).parent(),y:b(this).offset().top};U.preview=U.cal.data("colorpicker").livePreview;b(document).bind("mouseup",U,r);b(document).bind("mousemove",U,k)},k=function(T){e.apply(T.data.cal.data("colorpicker").fields.eq(4).val(parseInt(360*(150-Math.max(0,Math.min(150,(T.pageY-T.data.y))))/150,10)).get(0),[T.data.preview]);return false},r=function(T){J(T.data.cal.data("colorpicker").color,T.data.cal.get(0));g(T.data.cal.data("colorpicker").color,T.data.cal.get(0));b(document).unbind("mouseup",r);b(document).unbind("mousemove",k);return false},x=function(T){var U={cal:b(this).parent(),pos:b(this).offset()};U.preview=U.cal.data("colorpicker").livePreview;b(document).bind("mouseup",U,A);b(document).bind("mousemove",U,q)},q=function(T){e.apply(T.data.cal.data("colorpicker").fields.eq(6).val(parseInt(100*(150-Math.max(0,Math.min(150,(T.pageY-T.data.pos.top))))/150,10)).end().eq(5).val(parseInt(100*(Math.max(0,Math.min(150,(T.pageX-T.data.pos.left))))/150,10)).get(0),[T.data.preview]);return false},A=function(T){J(T.data.cal.data("colorpicker").color,T.data.cal.get(0));g(T.data.cal.data("colorpicker").color,T.data.cal.get(0));b(document).unbind("mouseup",A);b(document).unbind("mousemove",q);return false},v=function(T){b(this).addClass("colorpicker_focus")},Q=function(T){b(this).removeClass("colorpicker_focus")},p=function(U){var V=b(this).parent();var T=V.data("colorpicker").color;V.data("colorpicker").origColor=T;h(T,V.get(0));V.data("colorpicker").onSubmit(T,R(T),j(T),V.data("colorpicker").el)},D=function(T){var X=b("#"+b(this).data("colorpickerId"));X.data("colorpicker").onBeforeShow.apply(this,[X.get(0)]);var Y=b(this).offset();var W=z();var V=Y.top+this.offsetHeight;var U=Y.left;if(V+176>W.t+W.h){V-=this.offsetHeight+176}if(U+356>W.l+W.w){U-=356}X.css({left:U+"px",top:V+"px"});if(X.data("colorpicker").onShow.apply(this,[X.get(0)])!=false){X.show()}b(document).bind("mousedown",{cal:X},O);return false},O=function(T){if(!H(T.data.cal.get(0),T.target,T.data.cal.get(0))){if(T.data.cal.data("colorpicker").onHide.apply(this,[T.data.cal.get(0)])!=false){T.data.cal.hide()}b(document).unbind("mousedown",O)}},H=function(V,U,T){if(V==U){return true}if(V.contains){return V.contains(U)}if(V.compareDocumentPosition){return !!(V.compareDocumentPosition(U)&16)}var W=U.parentNode;while(W&&W!=T){if(W==V){return true}W=W.parentNode}return false},z=function(){var T=document.compatMode=="CSS1Compat";return{l:window.pageXOffset||(T?document.documentElement.scrollLeft:document.body.scrollLeft),t:window.pageYOffset||(T?document.documentElement.scrollTop:document.body.scrollTop),w:window.innerWidth||(T?document.documentElement.clientWidth:document.body.clientWidth),h:window.innerHeight||(T?document.documentElement.clientHeight:document.body.clientHeight)}},f=function(T){return{h:Math.min(360,Math.max(0,T.h)),s:Math.min(100,Math.max(0,T.s)),b:Math.min(100,Math.max(0,T.b))}},M=function(T){return{r:Math.min(255,Math.max(0,T.r)),g:Math.min(255,Math.max(0,T.g)),b:Math.min(255,Math.max(0,T.b))}},y=function(V){var T=6-V.length;if(T>0){var W=[];for(var U=0;U<T;U++){W.push("0")}W.push(V);V=W.join("")}return V},d=function(T){var T=parseInt(((T.indexOf("#")>-1)?T.substring(1):T),16);return{r:T>>16,g:(T&65280)>>8,b:(T&255)}},m=function(T){return i(d(T))},i=function(V){var U={h:0,s:0,b:0};var W=Math.min(V.r,V.g,V.b);var T=Math.max(V.r,V.g,V.b);var X=T-W;U.b=T;if(T!=0){}U.s=T!=0?255*X/T:0;if(U.s!=0){if(V.r==T){U.h=(V.g-V.b)/X}else{if(V.g==T){U.h=2+(V.b-V.r)/X}else{U.h=4+(V.r-V.g)/X}}}else{U.h=-1}U.h*=60;if(U.h<0){U.h+=360}U.s*=100/255;U.b*=100/255;return U},j=function(T){var V={};var Z=Math.round(T.h);var Y=Math.round(T.s*255/100);var U=Math.round(T.b*255/100);if(Y==0){V.r=V.g=V.b=U}else{var aa=U;var X=(255-Y)*U/255;var W=(aa-X)*(Z%60)/60;if(Z==360){Z=0}if(Z<60){V.r=aa;V.b=X;V.g=X+W}else{if(Z<120){V.g=aa;V.b=X;V.r=aa-W}else{if(Z<180){V.g=aa;V.r=X;V.b=X+W}else{if(Z<240){V.b=aa;V.r=X;V.g=aa-W}else{if(Z<300){V.b=aa;V.g=X;V.r=X+W}else{if(Z<360){V.r=aa;V.g=X;V.b=aa-W}else{V.r=0;V.g=0;V.b=0}}}}}}}return{r:Math.round(V.r),g:Math.round(V.g),b:Math.round(V.b)}},C=function(T){var U=[T.r.toString(16),T.g.toString(16),T.b.toString(16)];b.each(U,function(V,W){if(W.length==1){U[V]="0"+W}});return U.join("")},R=function(T){return C(j(T))},F=function(){var U=b(this).parent();var T=U.data("colorpicker").origColor;U.data("colorpicker").color=T;J(T,U.get(0));g(T,U.get(0));u(T,U.get(0));l(T,U.get(0));G(T,U.get(0));E(T,U.get(0))};return{init:function(T){T=b.extend({},B,T||{});if(typeof T.color=="string"){T.color=m(T.color)}else{if(T.color.r!=undefined&&T.color.g!=undefined&&T.color.b!=undefined){T.color=i(T.color)}else{if(T.color.h!=undefined&&T.color.s!=undefined&&T.color.b!=undefined){T.color=f(T.color)}else{return this}}}return this.each(function(){if(!b(this).data("colorpickerId")){var U=b.extend({},T);U.origColor=T.color;var W="collorpicker_"+parseInt(Math.random()*1000);b(this).data("colorpickerId",W);var V=b(P).attr("id",W);if(U.flat){V.appendTo(this).show()}else{V.appendTo(document.body)}U.fields=V.find("input").bind("keyup",n).bind("change",e).bind("blur",o).bind("focus",K);V.find("span").bind("mousedown",I).end().find(">div.colorpicker_current_color").bind("click",F);U.selector=V.find("div.colorpicker_color").bind("mousedown",x);U.selectorIndic=U.selector.find("div div");U.el=this;U.hue=V.find("div.colorpicker_hue div");V.find("div.colorpicker_hue").bind("mousedown",w);U.newColor=V.find("div.colorpicker_new_color");U.currentColor=V.find("div.colorpicker_current_color");V.data("colorpicker",U);V.find("div.colorpicker_submit").bind("mouseenter",v).bind("mouseleave",Q).bind("click",p);J(U.color,V.get(0));u(U.color,V.get(0));g(U.color,V.get(0));G(U.color,V.get(0));l(U.color,V.get(0));h(U.color,V.get(0));E(U.color,V.get(0));if(U.flat){V.css({position:"relative",display:"block"})}else{b(this).bind(U.eventName,D)}}})},showPicker:function(){return this.each(function(){if(b(this).data("colorpickerId")){D.apply(this)}})},hidePicker:function(){return this.each(function(){if(b(this).data("colorpickerId")){b("#"+b(this).data("colorpickerId")).hide()}})},setColor:function(T){if(typeof T=="string"){T=m(T)}else{if(T.r!=undefined&&T.g!=undefined&&T.b!=undefined){T=i(T)}else{if(T.h!=undefined&&T.s!=undefined&&T.b!=undefined){T=f(T)}else{return this}}}return this.each(function(){if(b(this).data("colorpickerId")){var U=b("#"+b(this).data("colorpickerId"));U.data("colorpicker").color=T;U.data("colorpicker").origColor=T;J(T,U.get(0));u(T,U.get(0));g(T,U.get(0));G(T,U.get(0));l(T,U.get(0));h(T,U.get(0));E(T,U.get(0))}})}}}();b.fn.extend({ColorPicker:a.init,ColorPickerHide:a.hidePicker,ColorPickerShow:a.showPicker,ColorPickerSetColor:a.setColor})})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-colorpicker.min.js
jquery-colorpicker.min.js
jQuery.effects||(function(d){d.effects={version:"1.7.3",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/* * jQuery UI Effects Blind 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Blind * * Depends: * effects.core.js */ (function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/* * jQuery UI Effects Bounce 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Bounce * * Depends: * effects.core.js */ (function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* * jQuery UI Effects Clip 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Clip * * Depends: * effects.core.js */ (function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/* * jQuery UI Effects Drop 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Drop * * Depends: * effects.core.js */ (function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* * jQuery UI Effects Explode 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Explode * * Depends: * effects.core.js */ (function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"),10)||0;l.left-=parseInt(h.css("marginLeft"),10)||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* * jQuery UI Effects Fold 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Fold * * Depends: * effects.core.js */ (function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* * jQuery UI Effects Highlight 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Highlight * * Depends: * effects.core.js */ (function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* * jQuery UI Effects Pulsate 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Pulsate * * Depends: * effects.core.js */ (function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/* * jQuery UI Effects Scale 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Scale * * Depends: * effects.core.js */ (function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent,10)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/* * jQuery UI Effects Shake 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Shake * * Depends: * effects.core.js */ (function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* * jQuery UI Effects Slide 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Slide * * Depends: * effects.core.js */ (function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* * jQuery UI Effects Transfer 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Effects/Transfer * * Depends: * effects.core.js */ (function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-ui-effects-1.7.3.min.js
jquery-ui-effects-1.7.3.min.js
(function(){var l=this,g,x=l.jQuery,o=l.$,n=l.jQuery=l.$=function(D,E){return new n.fn.init(D,E)},C=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;n.fn=n.prototype={init:function(D,G){D=D||document;if(D.nodeType){this[0]=D;this.length=1;this.context=D;return this}if(typeof D==="string"){var F=C.exec(D);if(F&&(F[1]||!G)){if(F[1]){D=n.clean([F[1]],G)}else{var H=document.getElementById(F[3]);if(H){if(H.id!=F[3]){return n().find(D)}var E=n(H);E.context=document;E.selector=D;return E}D=[]}}else{return n(G).find(D)}}else{if(n.isFunction(D)){return n(document).ready(D)}}if(D.selector&&D.context){this.selector=D.selector;this.context=D.context}return this.setArray(n.makeArray(D))},selector:"",jquery:"1.3",size:function(){return this.length},get:function(D){return D===g?n.makeArray(this):this[D]},pushStack:function(E,G,D){var F=n(E);F.prevObject=this;F.context=this.context;if(G==="find"){F.selector=this.selector+(this.selector?" ":"")+D}else{if(G){F.selector=this.selector+"."+G+"("+D+")"}}return F},setArray:function(D){this.length=0;Array.prototype.push.apply(this,D);return this},each:function(E,D){return n.each(this,E,D)},index:function(D){return n.inArray(D&&D.jquery?D[0]:D,this)},attr:function(E,G,F){var D=E;if(typeof E==="string"){if(G===g){return this[0]&&n[F||"attr"](this[0],E)}else{D={};D[E]=G}}return this.each(function(H){for(E in D){n.attr(F?this.style:this,E,n.prop(this,D[E],F,H,E))}})},css:function(D,E){if((D=="width"||D=="height")&&parseFloat(E)<0){E=g}return this.attr(D,E,"curCSS")},text:function(E){if(typeof E!=="object"&&E!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(E))}var D="";n.each(E||this,function(){n.each(this.childNodes,function(){if(this.nodeType!=8){D+=this.nodeType!=1?this.nodeValue:n.fn.text([this])}})});return D},wrapAll:function(D){if(this[0]){var E=n(D,this[0].ownerDocument).clone();if(this[0].parentNode){E.insertBefore(this[0])}E.map(function(){var F=this;while(F.firstChild){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(D){return this.each(function(){n(this).contents().wrapAll(D)})},wrap:function(D){return this.each(function(){n(this).wrapAll(D)})},append:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.appendChild(D)}})},prepend:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.insertBefore(D,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this)})},after:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this.nextSibling)})},end:function(){return this.prevObject||n([])},push:[].push,find:function(D){if(this.length===1&&!/,/.test(D)){var F=this.pushStack([],"find",D);F.length=0;n.find(D,this[0],F);return F}else{var E=n.map(this,function(G){return n.find(D,G)});return this.pushStack(/[^+>] [^+>]/.test(D)?n.unique(E):E,"find",D)}},clone:function(E){var D=this.map(function(){if(!n.support.noCloneEvent&&!n.isXMLDoc(this)){var H=this.cloneNode(true),G=document.createElement("div");G.appendChild(H);return n.clean([G.innerHTML])[0]}else{return this.cloneNode(true)}});var F=D.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(E===true){this.find("*").andSelf().each(function(H){if(this.nodeType==3){return}var G=n.data(this,"events");for(var J in G){for(var I in G[J]){n.event.add(F[H],J,G[J][I],G[J][I].data)}}})}return D},filter:function(D){return this.pushStack(n.isFunction(D)&&n.grep(this,function(F,E){return D.call(F,E)})||n.multiFilter(D,n.grep(this,function(E){return E.nodeType===1})),"filter",D)},closest:function(D){var E=n.expr.match.POS.test(D)?n(D):null;return this.map(function(){var F=this;while(F&&F.ownerDocument){if(E?E.index(F)>-1:n(F).is(D)){return F}F=F.parentNode}})},not:function(D){if(typeof D==="string"){if(f.test(D)){return this.pushStack(n.multiFilter(D,this,true),"not",D)}else{D=n.multiFilter(D,this)}}var E=D.length&&D[D.length-1]!==g&&!D.nodeType;return this.filter(function(){return E?n.inArray(this,D)<0:this!=D})},add:function(D){return this.pushStack(n.unique(n.merge(this.get(),typeof D==="string"?n(D):n.makeArray(D))))},is:function(D){return !!D&&n.multiFilter(D,this).length>0},hasClass:function(D){return !!D&&this.is("."+D)},val:function(J){if(J===g){var D=this[0];if(D){if(n.nodeName(D,"option")){return(D.attributes.value||{}).specified?D.value:D.text}if(n.nodeName(D,"select")){var H=D.selectedIndex,K=[],L=D.options,G=D.type=="select-one";if(H<0){return null}for(var E=G?H:0,I=G?H+1:L.length;E<I;E++){var F=L[E];if(F.selected){J=n(F).val();if(G){return J}K.push(J)}}return K}return(D.value||"").replace(/\r/g,"")}return g}if(typeof J==="number"){J+=""}return this.each(function(){if(this.nodeType!=1){return}if(n.isArray(J)&&/radio|checkbox/.test(this.type)){this.checked=(n.inArray(this.value,J)>=0||n.inArray(this.name,J)>=0)}else{if(n.nodeName(this,"select")){var M=n.makeArray(J);n("option",this).each(function(){this.selected=(n.inArray(this.value,M)>=0||n.inArray(this.text,M)>=0)});if(!M.length){this.selectedIndex=-1}}else{this.value=J}}})},html:function(D){return D===g?(this[0]?this[0].innerHTML:null):this.empty().append(D)},replaceWith:function(D){return this.after(D).remove()},eq:function(D){return this.slice(D,+D+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(D){return this.pushStack(n.map(this,function(F,E){return D.call(F,E,F)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=n.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild,D=this.length>1?I.cloneNode(true):I;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),G>0?D.cloneNode(true):I)}}if(F){n.each(F,y)}}return this;function K(N,O){return M&&n.nodeName(N,"table")&&n.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};n.fn.init.prototype=n.fn;function y(D,E){if(E.src){n.ajax({url:E.src,async:false,dataType:"script"})}else{n.globalEval(E.text||E.textContent||E.innerHTML||"")}if(E.parentNode){E.parentNode.removeChild(E)}}function e(){return +new Date}n.extend=n.fn.extend=function(){var I=arguments[0]||{},G=1,H=arguments.length,D=false,F;if(typeof I==="boolean"){D=I;I=arguments[1]||{};G=2}if(typeof I!=="object"&&!n.isFunction(I)){I={}}if(H==G){I=this;--G}for(;G<H;G++){if((F=arguments[G])!=null){for(var E in F){var J=I[E],K=F[E];if(I===K){continue}if(D&&K&&typeof K==="object"&&!K.nodeType){I[E]=n.extend(D,J||(K.length!=null?[]:{}),K)}else{if(K!==g){I[E]=K}}}}}return I};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,p=document.defaultView||{},r=Object.prototype.toString;n.extend({noConflict:function(D){l.$=o;if(D){l.jQuery=x}return n},isFunction:function(D){return r.call(D)==="[object Function]"},isArray:function(D){return r.call(D)==="[object Array]"},isXMLDoc:function(D){return D.documentElement&&!D.body||D.tagName&&D.ownerDocument&&!D.ownerDocument.body},globalEval:function(F){F=n.trim(F);if(F){var E=document.getElementsByTagName("head")[0]||document.documentElement,D=document.createElement("script");D.type="text/javascript";if(n.support.scriptEval){D.appendChild(document.createTextNode(F))}else{D.text=F}E.insertBefore(D,E.firstChild);E.removeChild(D)}},nodeName:function(E,D){return E.nodeName&&E.nodeName.toUpperCase()==D.toUpperCase()},each:function(F,J,E){var D,G=0,H=F.length;if(E){if(H===g){for(D in F){if(J.apply(F[D],E)===false){break}}}else{for(;G<H;){if(J.apply(F[G++],E)===false){break}}}}else{if(H===g){for(D in F){if(J.call(F[D],D,F[D])===false){break}}}else{for(var I=F[0];G<H&&J.call(I,G,I)!==false;I=F[++G]){}}}return F},prop:function(G,H,F,E,D){if(n.isFunction(H)){H=H.call(G,E)}return typeof H==="number"&&F=="curCSS"&&!b.test(D)?H+"px":H},className:{add:function(D,E){n.each((E||"").split(/\s+/),function(F,G){if(D.nodeType==1&&!n.className.has(D.className,G)){D.className+=(D.className?" ":"")+G}})},remove:function(D,E){if(D.nodeType==1){D.className=E!==g?n.grep(D.className.split(/\s+/),function(F){return !n.className.has(E,F)}).join(" "):""}},has:function(E,D){return n.inArray(D,(E.className||E).toString().split(/\s+/))>-1}},swap:function(G,F,H){var D={};for(var E in F){D[E]=G.style[E];G.style[E]=F[E]}H.call(G);for(var E in F){G.style[E]=D[E]}},css:function(F,D,H){if(D=="width"||D=="height"){var J,E={position:"absolute",visibility:"hidden",display:"block"},I=D=="width"?["Left","Right"]:["Top","Bottom"];function G(){J=D=="width"?F.offsetWidth:F.offsetHeight;var L=0,K=0;n.each(I,function(){L+=parseFloat(n.curCSS(F,"padding"+this,true))||0;K+=parseFloat(n.curCSS(F,"border"+this+"Width",true))||0});J-=Math.round(L+K)}if(n(F).is(":visible")){G()}else{n.swap(F,E,G)}return Math.max(0,J)}return n.curCSS(F,D,H)},curCSS:function(H,E,F){var K,D=H.style;if(E=="opacity"&&!n.support.opacity){K=n.attr(D,"opacity");return K==""?"1":K}if(E.match(/float/i)){E=v}if(!F&&D&&D[E]){K=D[E]}else{if(p.getComputedStyle){if(E.match(/float/i)){E="float"}E=E.replace(/([A-Z])/g,"-$1").toLowerCase();var L=p.getComputedStyle(H,null);if(L){K=L.getPropertyValue(E)}if(E=="opacity"&&K==""){K="1"}}else{if(H.currentStyle){var I=E.replace(/\-(\w)/g,function(M,N){return N.toUpperCase()});K=H.currentStyle[E]||H.currentStyle[I];if(!/^\d+(px)?$/i.test(K)&&/^\d/.test(K)){var G=D.left,J=H.runtimeStyle.left;H.runtimeStyle.left=H.currentStyle.left;D.left=K||0;K=D.pixelLeft+"px";D.left=G;H.runtimeStyle.left=J}}}}return K},clean:function(E,J,H){J=J||document;if(typeof J.createElement==="undefined"){J=J.ownerDocument||J[0]&&J[0].ownerDocument||document}if(!H&&E.length===1&&typeof E[0]==="string"){var G=/^<(\w+)\s*\/?>$/.exec(E[0]);if(G){return[J.createElement(G[1])]}}var F=[],D=[],K=J.createElement("div");n.each(E,function(O,Q){if(typeof Q==="number"){Q+=""}if(!Q){return}if(typeof Q==="string"){Q=Q.replace(/(<(\w+)[^>]*?)\/>/g,function(S,T,R){return R.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?S:T+"></"+R+">"});var N=n.trim(Q).toLowerCase();var P=!N.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!N.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||N.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!N.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!N.indexOf("<td")||!N.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!N.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!n.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];K.innerHTML=P[1]+Q+P[2];while(P[0]--){K=K.lastChild}if(!n.support.tbody){var M=!N.indexOf("<table")&&N.indexOf("<tbody")<0?K.firstChild&&K.firstChild.childNodes:P[1]=="<table>"&&N.indexOf("<tbody")<0?K.childNodes:[];for(var L=M.length-1;L>=0;--L){if(n.nodeName(M[L],"tbody")&&!M[L].childNodes.length){M[L].parentNode.removeChild(M[L])}}}if(!n.support.leadingWhitespace&&/^\s/.test(Q)){K.insertBefore(J.createTextNode(Q.match(/^\s*/)[0]),K.firstChild)}Q=n.makeArray(K.childNodes)}if(Q.nodeType){F.push(Q)}else{F=n.merge(F,Q)}});if(H){for(var I=0;F[I];I++){if(n.nodeName(F[I],"script")&&(!F[I].type||F[I].type.toLowerCase()==="text/javascript")){D.push(F[I].parentNode?F[I].parentNode.removeChild(F[I]):F[I])}else{if(F[I].nodeType===1){F.splice.apply(F,[I+1,0].concat(n.makeArray(F[I].getElementsByTagName("script"))))}H.appendChild(F[I])}}return D}return F},attr:function(I,F,J){if(!I||I.nodeType==3||I.nodeType==8){return g}var G=!n.isXMLDoc(I),K=J!==g;F=G&&n.props[F]||F;if(I.tagName){var E=/href|src|style/.test(F);if(F=="selected"&&I.parentNode){I.parentNode.selectedIndex}if(F in I&&G&&!E){if(K){if(F=="type"&&n.nodeName(I,"input")&&I.parentNode){throw"type property can't be changed"}I[F]=J}if(n.nodeName(I,"form")&&I.getAttributeNode(F)){return I.getAttributeNode(F).nodeValue}if(F=="tabIndex"){var H=I.getAttributeNode("tabIndex");return H&&H.specified?H.value:I.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:g}return I[F]}if(!n.support.style&&G&&F=="style"){return n.attr(I.style,"cssText",J)}if(K){I.setAttribute(F,""+J)}var D=!n.support.hrefNormalized&&G&&E?I.getAttribute(F,2):I.getAttribute(F);return D===null?g:D}if(!n.support.opacity&&F=="opacity"){if(K){I.zoom=1;I.filter=(I.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(J)+""=="NaN"?"":"alpha(opacity="+J*100+")")}return I.filter&&I.filter.indexOf("opacity=")>=0?(parseFloat(I.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}F=F.replace(/-([a-z])/ig,function(L,M){return M.toUpperCase()});if(K){I[F]=J}return I[F]},trim:function(D){return(D||"").replace(/^\s+|\s+$/g,"")},makeArray:function(F){var D=[];if(F!=null){var E=F.length;if(E==null||typeof F==="string"||n.isFunction(F)||F.setInterval){D[0]=F}else{while(E){D[--E]=F[E]}}}return D},inArray:function(F,G){for(var D=0,E=G.length;D<E;D++){if(G[D]===F){return D}}return -1},merge:function(G,D){var E=0,F,H=G.length;if(!n.support.getAll){while((F=D[E++])!=null){if(F.nodeType!=8){G[H++]=F}}}else{while((F=D[E++])!=null){G[H++]=F}}return G},unique:function(J){var E=[],D={};try{for(var F=0,G=J.length;F<G;F++){var I=n.data(J[F]);if(!D[I]){D[I]=true;E.push(J[F])}}}catch(H){E=J}return E},grep:function(E,I,D){var F=[];for(var G=0,H=E.length;G<H;G++){if(!D!=!I(E[G],G)){F.push(E[G])}}return F},map:function(D,I){var E=[];for(var F=0,G=D.length;F<G;F++){var H=I(D[F],F);if(H!=null){E[E.length]=H}}return E.concat.apply([],E)}});var B=navigator.userAgent.toLowerCase();n.browser={version:(B.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(B),opera:/opera/.test(B),msie:/msie/.test(B)&&!/opera/.test(B),mozilla:/mozilla/.test(B)&&!/(compatible|webkit)/.test(B)};n.each({parent:function(D){return D.parentNode},parents:function(D){return n.dir(D,"parentNode")},next:function(D){return n.nth(D,2,"nextSibling")},prev:function(D){return n.nth(D,2,"previousSibling")},nextAll:function(D){return n.dir(D,"nextSibling")},prevAll:function(D){return n.dir(D,"previousSibling")},siblings:function(D){return n.sibling(D.parentNode.firstChild,D)},children:function(D){return n.sibling(D.firstChild)},contents:function(D){return n.nodeName(D,"iframe")?D.contentDocument||D.contentWindow.document:n.makeArray(D.childNodes)}},function(D,E){n.fn[D]=function(F){var G=n.map(this,E);if(F&&typeof F=="string"){G=n.multiFilter(F,G)}return this.pushStack(n.unique(G),D,F)}});n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(D,E){n.fn[D]=function(){var F=arguments;return this.each(function(){for(var G=0,H=F.length;G<H;G++){n(F[G])[E](this)}})}});n.each({removeAttr:function(D){n.attr(this,D,"");if(this.nodeType==1){this.removeAttribute(D)}},addClass:function(D){n.className.add(this,D)},removeClass:function(D){n.className.remove(this,D)},toggleClass:function(E,D){if(typeof D!=="boolean"){D=!n.className.has(this,E)}n.className[D?"add":"remove"](this,E)},remove:function(D){if(!D||n.filter(D,[this]).length){n("*",this).add([this]).each(function(){n.event.remove(this);n.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){n(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(D,E){n.fn[D]=function(){return this.each(E,arguments)}});function j(D,E){return D[0]&&parseInt(n.curCSS(D[0],E,true),10)||0}var h="jQuery"+e(),u=0,z={};n.extend({cache:{},data:function(E,D,F){E=E==l?z:E;var G=E[h];if(!G){G=E[h]=++u}if(D&&!n.cache[G]){n.cache[G]={}}if(F!==g){n.cache[G][D]=F}return D?n.cache[G][D]:G},removeData:function(E,D){E=E==l?z:E;var G=E[h];if(D){if(n.cache[G]){delete n.cache[G][D];D="";for(D in n.cache[G]){break}if(!D){n.removeData(E)}}}else{try{delete E[h]}catch(F){if(E.removeAttribute){E.removeAttribute(h)}}delete n.cache[G]}},queue:function(E,D,G){if(E){D=(D||"fx")+"queue";var F=n.data(E,D);if(!F||n.isArray(G)){F=n.data(E,D,n.makeArray(G))}else{if(G){F.push(G)}}}return F},dequeue:function(G,F){var D=n.queue(G,F),E=D.shift();if(!F||F==="fx"){E=D[0]}if(E!==g){E.call(G)}}});n.fn.extend({data:function(D,F){var G=D.split(".");G[1]=G[1]?"."+G[1]:"";if(F===g){var E=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(E===g&&this.length){E=n.data(this[0],D)}return E===g&&G[1]?this.data(G[0]):E}else{return this.trigger("setData"+G[1]+"!",[G[0],F]).each(function(){n.data(this,D,F)})}},removeData:function(D){return this.each(function(){n.removeData(this,D)})},queue:function(D,E){if(typeof D!=="string"){E=D;D="fx"}if(E===g){return n.queue(this[0],D)}return this.each(function(){var F=n.queue(this,D,E);if(D=="fx"&&F.length==1){F[0].call(this)}})},dequeue:function(D){return this.each(function(){n.dequeue(this,D)})}}); /* * Sizzle CSS Selector Engine - v0.9.1 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){var N=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,I=0,F=Object.prototype.toString;var E=function(ae,S,aa,V){aa=aa||[];S=S||document;if(S.nodeType!==1&&S.nodeType!==9){return[]}if(!ae||typeof ae!=="string"){return aa}var ab=[],ac,Y,ah,ag,Z,R,Q=true;N.lastIndex=0;while((ac=N.exec(ae))!==null){ab.push(ac[1]);if(ac[2]){R=RegExp.rightContext;break}}if(ab.length>1&&G.match.POS.exec(ae)){if(ab.length===2&&G.relative[ab[0]]){var U="",X;while((X=G.match.POS.exec(ae))){U+=X[0];ae=ae.replace(G.match.POS,"")}Y=E.filter(U,E(/\s$/.test(ae)?ae+"*":ae,S))}else{Y=G.relative[ab[0]]?[S]:E(ab.shift(),S);while(ab.length){var P=[];ae=ab.shift();if(G.relative[ae]){ae+=ab.shift()}for(var af=0,ad=Y.length;af<ad;af++){E(ae,Y[af],P)}Y=P}}}else{var ai=V?{expr:ab.pop(),set:D(V)}:E.find(ab.pop(),ab.length===1&&S.parentNode?S.parentNode:S);Y=E.filter(ai.expr,ai.set);if(ab.length>0){ah=D(Y)}else{Q=false}while(ab.length){var T=ab.pop(),W=T;if(!G.relative[T]){T=""}else{W=ab.pop()}if(W==null){W=S}G.relative[T](ah,W,M(S))}}if(!ah){ah=Y}if(!ah){throw"Syntax error, unrecognized expression: "+(T||ae)}if(F.call(ah)==="[object Array]"){if(!Q){aa.push.apply(aa,ah)}else{if(S.nodeType===1){for(var af=0;ah[af]!=null;af++){if(ah[af]&&(ah[af]===true||ah[af].nodeType===1&&H(S,ah[af]))){aa.push(Y[af])}}}else{for(var af=0;ah[af]!=null;af++){if(ah[af]&&ah[af].nodeType===1){aa.push(Y[af])}}}}}else{D(ah,aa)}if(R){E(R,S,aa,V)}return aa};E.matches=function(P,Q){return E(P,null,null,Q)};E.find=function(V,S){var W,Q;if(!V){return[]}for(var R=0,P=G.order.length;R<P;R++){var T=G.order[R],Q;if((Q=G.match[T].exec(V))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){Q[1]=(Q[1]||"").replace(/\\/g,"");W=G.find[T](Q,S);if(W!=null){V=V.replace(G.match[T],"");break}}}}if(!W){W=S.getElementsByTagName("*")}return{set:W,expr:V}};E.filter=function(S,ac,ad,T){var Q=S,Y=[],ah=ac,V,ab;while(S&&ac.length){for(var U in G.filter){if((V=G.match[U].exec(S))!=null){var Z=G.filter[U],R=null,X=0,aa,ag;ab=false;if(ah==Y){Y=[]}if(G.preFilter[U]){V=G.preFilter[U](V,ah,ad,Y,T);if(!V){ab=aa=true}else{if(V===true){continue}else{if(V[0]===true){R=[];var W=null,af;for(var ae=0;(af=ah[ae])!==g;ae++){if(af&&W!==af){R.push(af);W=af}}}}}}if(V){for(var ae=0;(ag=ah[ae])!==g;ae++){if(ag){if(R&&ag!=R[X]){X++}aa=Z(ag,V,X,R);var P=T^!!aa;if(ad&&aa!=null){if(P){ab=true}else{ah[ae]=false}}else{if(P){Y.push(ag);ab=true}}}}}if(aa!==g){if(!ad){ah=Y}S=S.replace(G.match[U],"");if(!ab){return[]}break}}}S=S.replace(/\s*,\s*/,"");if(S==Q){if(ab==null){throw"Syntax error, unrecognized expression: "+S}else{break}}Q=S}return ah};var G=E.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(P){return P.getAttribute("href")}},relative:{"+":function(T,Q){for(var R=0,P=T.length;R<P;R++){var S=T[R];if(S){var U=S.previousSibling;while(U&&U.nodeType!==1){U=U.previousSibling}T[R]=typeof Q==="string"?U||false:U===Q}}if(typeof Q==="string"){E.filter(Q,T,true)}},">":function(U,Q,V){if(typeof Q==="string"&&!/\W/.test(Q)){Q=V?Q:Q.toUpperCase();for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){var S=T.parentNode;U[R]=S.nodeName===Q?S:false}}}else{for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){U[R]=typeof Q==="string"?T.parentNode:T.parentNode===Q}}if(typeof Q==="string"){E.filter(Q,U,true)}}},"":function(S,Q,U){var R="done"+(I++),P=O;if(!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("parentNode",Q,R,S,T,U)},"~":function(S,Q,U){var R="done"+(I++),P=O;if(typeof Q==="string"&&!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("previousSibling",Q,R,S,T,U)}},find:{ID:function(Q,R){if(R.getElementById){var P=R.getElementById(Q[1]);return P?[P]:[]}},NAME:function(P,Q){return Q.getElementsByName?Q.getElementsByName(P[1]):null},TAG:function(P,Q){return Q.getElementsByTagName(P[1])}},preFilter:{CLASS:function(S,Q,R,P,U){S=" "+S[1].replace(/\\/g,"")+" ";for(var T=0;Q[T];T++){if(U^(" "+Q[T].className+" ").indexOf(S)>=0){if(!R){P.push(Q[T])}}else{if(R){Q[T]=false}}}return false},ID:function(P){return P[1].replace(/\\/g,"")},TAG:function(Q,P){for(var R=0;!P[R];R++){}return M(P[R])?Q[1]:Q[1].toUpperCase()},CHILD:function(P){if(P[1]=="nth"){var Q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(P[2]=="even"&&"2n"||P[2]=="odd"&&"2n+1"||!/\D/.test(P[2])&&"0n+"+P[2]||P[2]);P[2]=(Q[1]+(Q[2]||1))-0;P[3]=Q[3]-0}P[0]="done"+(I++);return P},ATTR:function(Q){var P=Q[1];if(G.attrMap[P]){Q[1]=G.attrMap[P]}if(Q[2]==="~="){Q[4]=" "+Q[4]+" "}return Q},PSEUDO:function(T,Q,R,P,U){if(T[1]==="not"){if(T[3].match(N).length>1){T[3]=E(T[3],null,null,Q)}else{var S=E.filter(T[3],Q,R,true^U);if(!R){P.push.apply(P,S)}return false}}else{if(G.match.POS.test(T[0])){return true}}return T},POS:function(P){P.unshift(true);return P}},filters:{enabled:function(P){return P.disabled===false&&P.type!=="hidden"},disabled:function(P){return P.disabled===true},checked:function(P){return P.checked===true},selected:function(P){P.parentNode.selectedIndex;return P.selected===true},parent:function(P){return !!P.firstChild},empty:function(P){return !P.firstChild},has:function(R,Q,P){return !!E(P[3],R).length},header:function(P){return/h\d/i.test(P.nodeName)},text:function(P){return"text"===P.type},radio:function(P){return"radio"===P.type},checkbox:function(P){return"checkbox"===P.type},file:function(P){return"file"===P.type},password:function(P){return"password"===P.type},submit:function(P){return"submit"===P.type},image:function(P){return"image"===P.type},reset:function(P){return"reset"===P.type},button:function(P){return"button"===P.type||P.nodeName.toUpperCase()==="BUTTON"},input:function(P){return/input|select|textarea|button/i.test(P.nodeName)}},setFilters:{first:function(Q,P){return P===0},last:function(R,Q,P,S){return Q===S.length-1},even:function(Q,P){return P%2===0},odd:function(Q,P){return P%2===1},lt:function(R,Q,P){return Q<P[3]-0},gt:function(R,Q,P){return Q>P[3]-0},nth:function(R,Q,P){return P[3]-0==Q},eq:function(R,Q,P){return P[3]-0==Q}},filter:{CHILD:function(P,S){var V=S[1],W=P.parentNode;var U="child"+W.childNodes.length;if(W&&(!W[U]||!P.nodeIndex)){var T=1;for(var Q=W.firstChild;Q;Q=Q.nextSibling){if(Q.nodeType==1){Q.nodeIndex=T++}}W[U]=T-1}if(V=="first"){return P.nodeIndex==1}else{if(V=="last"){return P.nodeIndex==W[U]}else{if(V=="only"){return W[U]==1}else{if(V=="nth"){var Y=false,R=S[2],X=S[3];if(R==1&&X==0){return true}if(R==0){if(P.nodeIndex==X){Y=true}}else{if((P.nodeIndex-X)%R==0&&(P.nodeIndex-X)/R>=0){Y=true}}return Y}}}}},PSEUDO:function(V,R,S,W){var Q=R[1],T=G.filters[Q];if(T){return T(V,S,R,W)}else{if(Q==="contains"){return(V.textContent||V.innerText||"").indexOf(R[3])>=0}else{if(Q==="not"){var U=R[3];for(var S=0,P=U.length;S<P;S++){if(U[S]===V){return false}}return true}}}},ID:function(Q,P){return Q.nodeType===1&&Q.getAttribute("id")===P},TAG:function(Q,P){return(P==="*"&&Q.nodeType===1)||Q.nodeName===P},CLASS:function(Q,P){return P.test(Q.className)},ATTR:function(T,R){var P=G.attrHandle[R[1]]?G.attrHandle[R[1]](T):T[R[1]]||T.getAttribute(R[1]),U=P+"",S=R[2],Q=R[4];return P==null?false:S==="="?U===Q:S==="*="?U.indexOf(Q)>=0:S==="~="?(" "+U+" ").indexOf(Q)>=0:!R[4]?P:S==="!="?U!=Q:S==="^="?U.indexOf(Q)===0:S==="$="?U.substr(U.length-Q.length)===Q:S==="|="?U===Q||U.substr(0,Q.length+1)===Q+"-":false},POS:function(T,Q,R,U){var P=Q[2],S=G.setFilters[P];if(S){return S(T,R,Q,U)}}}};for(var K in G.match){G.match[K]=RegExp(G.match[K].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var D=function(Q,P){Q=Array.prototype.slice.call(Q);if(P){P.push.apply(P,Q);return P}return Q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(J){D=function(T,S){var Q=S||[];if(F.call(T)==="[object Array]"){Array.prototype.push.apply(Q,T)}else{if(typeof T.length==="number"){for(var R=0,P=T.length;R<P;R++){Q.push(T[R])}}else{for(var R=0;T[R];R++){Q.push(T[R])}}}return Q}}(function(){var Q=document.createElement("form"),R="script"+(new Date).getTime();Q.innerHTML="<input name='"+R+"'/>";var P=document.documentElement;P.insertBefore(Q,P.firstChild);if(!!document.getElementById(R)){G.find.ID=function(T,U){if(U.getElementById){var S=U.getElementById(T[1]);return S?S.id===T[1]||S.getAttributeNode&&S.getAttributeNode("id").nodeValue===T[1]?[S]:g:[]}};G.filter.ID=function(U,S){var T=U.getAttributeNode&&U.getAttributeNode("id");return U.nodeType===1&&T&&T.nodeValue===S}}P.removeChild(Q)})();(function(){var P=document.createElement("div");P.appendChild(document.createComment(""));if(P.getElementsByTagName("*").length>0){G.find.TAG=function(Q,U){var T=U.getElementsByTagName(Q[1]);if(Q[1]==="*"){var S=[];for(var R=0;T[R];R++){if(T[R].nodeType===1){S.push(T[R])}}T=S}return T}}P.innerHTML="<a href='#'></a>";if(P.firstChild.getAttribute("href")!=="#"){G.attrHandle.href=function(Q){return Q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var P=E;E=function(T,S,Q,R){S=S||document;if(!R&&S.nodeType===9){try{return D(S.querySelectorAll(T),Q)}catch(U){}}return P(T,S,Q,R)};E.find=P.find;E.filter=P.filter;E.selectors=P.selectors;E.matches=P.matches})()}if(document.documentElement.getElementsByClassName){G.order.splice(1,0,"CLASS");G.find.CLASS=function(P,Q){return Q.getElementsByClassName(P[1])}}function L(Q,W,V,Z,X,Y){for(var T=0,R=Z.length;T<R;T++){var P=Z[T];if(P){P=P[Q];var U=false;while(P&&P.nodeType){var S=P[V];if(S){U=Z[S];break}if(P.nodeType===1&&!Y){P[V]=T}if(P.nodeName===W){U=P;break}P=P[Q]}Z[T]=U}}}function O(Q,V,U,Y,W,X){for(var S=0,R=Y.length;S<R;S++){var P=Y[S];if(P){P=P[Q];var T=false;while(P&&P.nodeType){if(P[U]){T=Y[P[U]];break}if(P.nodeType===1){if(!X){P[U]=S}if(typeof V!=="string"){if(P===V){T=true;break}}else{if(E.filter(V,[P]).length>0){T=P;break}}}P=P[Q]}Y[S]=T}}}var H=document.compareDocumentPosition?function(Q,P){return Q.compareDocumentPosition(P)&16}:function(Q,P){return Q!==P&&(Q.contains?Q.contains(P):true)};var M=function(P){return P.documentElement&&!P.body||P.tagName&&P.ownerDocument&&!P.ownerDocument.body};n.find=E;n.filter=E.filter;n.expr=E.selectors;n.expr[":"]=n.expr.filters;E.selectors.filters.hidden=function(P){return"hidden"===P.type||n.css(P,"display")==="none"||n.css(P,"visibility")==="hidden"};E.selectors.filters.visible=function(P){return"hidden"!==P.type&&n.css(P,"display")!=="none"&&n.css(P,"visibility")!=="hidden"};E.selectors.filters.animated=function(P){return n.grep(n.timers,function(Q){return P===Q.elem}).length};n.multiFilter=function(R,P,Q){if(Q){R=":not("+R+")"}return E.matches(R,P)};n.dir=function(R,Q){var P=[],S=R[Q];while(S&&S!=document){if(S.nodeType==1){P.push(S)}S=S[Q]}return P};n.nth=function(T,P,R,S){P=P||1;var Q=0;for(;T;T=T[R]){if(T.nodeType==1&&++Q==P){break}}return T};n.sibling=function(R,Q){var P=[];for(;R;R=R.nextSibling){if(R.nodeType==1&&R!=Q){P.push(R)}}return P};return;l.Sizzle=E})();n.event={add:function(H,E,G,J){if(H.nodeType==3||H.nodeType==8){return}if(H.setInterval&&H!=l){H=l}if(!G.guid){G.guid=this.guid++}if(J!==g){var F=G;G=this.proxy(F);G.data=J}var D=n.data(H,"events")||n.data(H,"events",{}),I=n.data(H,"handle")||n.data(H,"handle",function(){return typeof n!=="undefined"&&!n.event.triggered?n.event.handle.apply(arguments.callee.elem,arguments):g});I.elem=H;n.each(E.split(/\s+/),function(L,M){var N=M.split(".");M=N.shift();G.type=N.slice().sort().join(".");var K=D[M];if(n.event.specialAll[M]){n.event.specialAll[M].setup.call(H,J,N)}if(!K){K=D[M]={};if(!n.event.special[M]||n.event.special[M].setup.call(H,J,N)===false){if(H.addEventListener){H.addEventListener(M,I,false)}else{if(H.attachEvent){H.attachEvent("on"+M,I)}}}}K[G.guid]=G;n.event.global[M]=true});H=null},guid:1,global:{},remove:function(J,G,I){if(J.nodeType==3||J.nodeType==8){return}var F=n.data(J,"events"),E,D;if(F){if(G===g||(typeof G==="string"&&G.charAt(0)==".")){for(var H in F){this.remove(J,H+(G||""))}}else{if(G.type){I=G.handler;G=G.type}n.each(G.split(/\s+/),function(L,N){var P=N.split(".");N=P.shift();var M=RegExp("(^|\\.)"+P.slice().sort().join(".*\\.")+"(\\.|$)");if(F[N]){if(I){delete F[N][I.guid]}else{for(var O in F[N]){if(M.test(F[N][O].type)){delete F[N][O]}}}if(n.event.specialAll[N]){n.event.specialAll[N].teardown.call(J,P)}for(E in F[N]){break}if(!E){if(!n.event.special[N]||n.event.special[N].teardown.call(J,P)===false){if(J.removeEventListener){J.removeEventListener(N,n.data(J,"handle"),false)}else{if(J.detachEvent){J.detachEvent("on"+N,n.data(J,"handle"))}}}E=null;delete F[N]}}})}for(E in F){break}if(!E){var K=n.data(J,"handle");if(K){K.elem=null}n.removeData(J,"events");n.removeData(J,"handle")}}},trigger:function(H,J,G,D){var F=H.type||H;if(!D){H=typeof H==="object"?H[h]?H:n.extend(n.Event(F),H):n.Event(F);if(F.indexOf("!")>=0){H.type=F=F.slice(0,-1);H.exclusive=true}if(!G){H.stopPropagation();if(this.global[F]){n.each(n.cache,function(){if(this.events&&this.events[F]){n.event.trigger(H,J,this.handle.elem)}})}}if(!G||G.nodeType==3||G.nodeType==8){return g}H.result=g;H.target=G;J=n.makeArray(J);J.unshift(H)}H.currentTarget=G;var I=n.data(G,"handle");if(I){I.apply(G,J)}if((!G[F]||(n.nodeName(G,"a")&&F=="click"))&&G["on"+F]&&G["on"+F].apply(G,J)===false){H.result=false}if(!D&&G[F]&&!H.isDefaultPrevented()&&!(n.nodeName(G,"a")&&F=="click")){this.triggered=true;try{G[F]()}catch(K){}}this.triggered=false;if(!H.isPropagationStopped()){var E=G.parentNode||G.ownerDocument;if(E){n.event.trigger(H,J,E,true)}}},handle:function(J){var I,D;J=arguments[0]=n.event.fix(J||l.event);var K=J.type.split(".");J.type=K.shift();I=!K.length&&!J.exclusive;var H=RegExp("(^|\\.)"+K.slice().sort().join(".*\\.")+"(\\.|$)");D=(n.data(this,"events")||{})[J.type];for(var F in D){var G=D[F];if(I||H.test(G.type)){J.handler=G;J.data=G.data;var E=G.apply(this,arguments);if(E!==g){J.result=E;if(E===false){J.preventDefault();J.stopPropagation()}}if(J.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(G){if(G[h]){return G}var E=G;G=n.Event(E);for(var F=this.props.length,I;F;){I=this.props[--F];G[I]=E[I]}if(!G.target){G.target=G.srcElement||document}if(G.target.nodeType==3){G.target=G.target.parentNode}if(!G.relatedTarget&&G.fromElement){G.relatedTarget=G.fromElement==G.target?G.toElement:G.fromElement}if(G.pageX==null&&G.clientX!=null){var H=document.documentElement,D=document.body;G.pageX=G.clientX+(H&&H.scrollLeft||D&&D.scrollLeft||0)-(H.clientLeft||0);G.pageY=G.clientY+(H&&H.scrollTop||D&&D.scrollTop||0)-(H.clientTop||0)}if(!G.which&&((G.charCode||G.charCode===0)?G.charCode:G.keyCode)){G.which=G.charCode||G.keyCode}if(!G.metaKey&&G.ctrlKey){G.metaKey=G.ctrlKey}if(!G.which&&G.button){G.which=(G.button&1?1:(G.button&2?3:(G.button&4?2:0)))}return G},proxy:function(E,D){D=D||function(){return E.apply(this,arguments)};D.guid=E.guid=E.guid||D.guid||this.guid++;return D},special:{ready:{setup:A,teardown:function(){}}},specialAll:{live:{setup:function(D,E){n.event.add(this,E[0],c)},teardown:function(F){if(F.length){var D=0,E=RegExp("(^|\\.)"+F[0]+"(\\.|$)");n.each((n.data(this,"events").live||{}),function(){if(E.test(this.type)){D++}});if(D<1){n.event.remove(this,F[0],c)}}}}}};n.Event=function(D){if(!this.preventDefault){return new n.Event(D)}if(D&&D.type){this.originalEvent=D;this.type=D.type;this.timeStamp=D.timeStamp}else{this.type=D}if(!this.timeStamp){this.timeStamp=e()}this[h]=true};function k(){return false}function t(){return true}n.Event.prototype={preventDefault:function(){this.isDefaultPrevented=t;var D=this.originalEvent;if(!D){return}if(D.preventDefault){D.preventDefault()}D.returnValue=false},stopPropagation:function(){this.isPropagationStopped=t;var D=this.originalEvent;if(!D){return}if(D.stopPropagation){D.stopPropagation()}D.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(E){var D=E.relatedTarget;while(D&&D!=this){try{D=D.parentNode}catch(F){D=this}}if(D!=this){E.type=E.data;n.event.handle.apply(this,arguments)}};n.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(E,D){n.event.special[D]={setup:function(){n.event.add(this,E,a,D)},teardown:function(){n.event.remove(this,E,a)}}});n.fn.extend({bind:function(E,F,D){return E=="unload"?this.one(E,F,D):this.each(function(){n.event.add(this,E,D||F,D&&F)})},one:function(F,G,E){var D=n.event.proxy(E||G,function(H){n(this).unbind(H,D);return(E||G).apply(this,arguments)});return this.each(function(){n.event.add(this,F,D,E&&G)})},unbind:function(E,D){return this.each(function(){n.event.remove(this,E,D)})},trigger:function(D,E){return this.each(function(){n.event.trigger(D,E,this)})},triggerHandler:function(D,F){if(this[0]){var E=n.Event(D);E.preventDefault();E.stopPropagation();n.event.trigger(E,F,this[0]);return E.result}},toggle:function(F){var D=arguments,E=1;while(E<D.length){n.event.proxy(F,D[E++])}return this.click(n.event.proxy(F,function(G){this.lastToggle=(this.lastToggle||0)%E;G.preventDefault();return D[this.lastToggle++].apply(this,arguments)||false}))},hover:function(D,E){return this.mouseenter(D).mouseleave(E)},ready:function(D){A();if(n.isReady){D.call(document,n)}else{n.readyList.push(D)}return this},live:function(F,E){var D=n.event.proxy(E);D.guid+=this.selector+F;n(document).bind(i(F,this.selector),this.selector,D);return this},die:function(E,D){n(document).unbind(i(E,this.selector),D?{guid:D.guid+this.selector+E}:null);return this}});function c(G){var D=RegExp("(^|\\.)"+G.type+"(\\.|$)"),F=true,E=[];n.each(n.data(this,"events").live||[],function(H,I){if(D.test(I.type)){var J=n(G.target).closest(I.data)[0];if(J){E.push({elem:J,fn:I})}}});n.each(E,function(){if(!G.isImmediatePropagationStopped()&&this.fn.call(this.elem,G,this.fn.data)===false){F=false}});return F}function i(E,D){return["live",E,D.replace(/\./g,"`").replace(/ /g,"|")].join(".")}n.extend({isReady:false,readyList:[],ready:function(){if(!n.isReady){n.isReady=true;if(n.readyList){n.each(n.readyList,function(){this.call(document,n)});n.readyList=null}n(document).triggerHandler("ready")}}});var w=false;function A(){if(w){return}w=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);n.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);n.ready()}});if(document.documentElement.doScroll&&!l.frameElement){(function(){if(n.isReady){return}try{document.documentElement.doScroll("left")}catch(D){setTimeout(arguments.callee,0);return}n.ready()})()}}}n.event.add(l,"load",n.ready)}n.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(E,D){n.fn[D]=function(F){return F?this.bind(D,F):this.trigger(D)}});n(l).bind("unload",function(){for(var D in n.cache){if(D!=1&&n.cache[D].handle){n.event.remove(n.cache[D].handle.elem)}}});(function(){n.support={};var E=document.documentElement,F=document.createElement("script"),J=document.createElement("div"),I="script"+(new Date).getTime();J.style.display="none";J.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var G=J.getElementsByTagName("*"),D=J.getElementsByTagName("a")[0];if(!G||!G.length||!D){return}n.support={leadingWhitespace:J.firstChild.nodeType==3,tbody:!J.getElementsByTagName("tbody").length,objectAll:!!J.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(D.getAttribute("style")),hrefNormalized:D.getAttribute("href")==="/a",opacity:D.style.opacity==="0.5",cssFloat:!!D.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};F.type="text/javascript";try{F.appendChild(document.createTextNode("window."+I+"=1;"))}catch(H){}E.insertBefore(F,E.firstChild);if(l[I]){n.support.scriptEval=true;delete l[I]}E.removeChild(F);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function(){n.support.noCloneEvent=false;J.detachEvent("onclick",arguments.callee)});J.cloneNode(true).fireEvent("onclick")}n(function(){var K=document.createElement("div");K.style.width="1px";K.style.paddingLeft="1px";document.body.appendChild(K);n.boxModel=n.support.boxModel=K.offsetWidth===2;document.body.removeChild(K)})})();var v=n.support.cssFloat?"cssFloat":"styleFloat";n.props={"for":"htmlFor","class":"className","float":v,cssFloat:v,styleFloat:v,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};n.fn.extend({_load:n.fn.load,load:function(F,I,J){if(typeof F!=="string"){return this._load(F)}var H=F.indexOf(" ");if(H>=0){var D=F.slice(H,F.length);F=F.slice(0,H)}var G="GET";if(I){if(n.isFunction(I)){J=I;I=null}else{if(typeof I==="object"){I=n.param(I);G="POST"}}}var E=this;n.ajax({url:F,type:G,dataType:"html",data:I,complete:function(L,K){if(K=="success"||K=="notmodified"){E.html(D?n("<div/>").append(L.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(D):L.responseText)}if(J){E.each(J,[L.responseText,K,L])}}});return this},serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?n.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(D,E){var F=n(this).val();return F==null?null:n.isArray(F)?n.map(F,function(H,G){return{name:E.name,value:H}}):{name:E.name,value:F}}).get()}});n.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(D,E){n.fn[E]=function(F){return this.bind(E,F)}});var q=e();n.extend({get:function(D,F,G,E){if(n.isFunction(F)){G=F;F=null}return n.ajax({type:"GET",url:D,data:F,success:G,dataType:E})},getScript:function(D,E){return n.get(D,null,E,"script")},getJSON:function(D,E,F){return n.get(D,E,F,"json")},post:function(D,F,G,E){if(n.isFunction(F)){G=F;F={}}return n.ajax({type:"POST",url:D,data:F,success:G,dataType:E})},ajaxSetup:function(D){n.extend(n.ajaxSettings,D)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(L){L=n.extend(true,L,n.extend(true,{},n.ajaxSettings,L));var V,E=/=\?(&|$)/g,Q,U,F=L.type.toUpperCase();if(L.data&&L.processData&&typeof L.data!=="string"){L.data=n.param(L.data)}if(L.dataType=="jsonp"){if(F=="GET"){if(!L.url.match(E)){L.url+=(L.url.match(/\?/)?"&":"?")+(L.jsonp||"callback")+"=?"}}else{if(!L.data||!L.data.match(E)){L.data=(L.data?L.data+"&":"")+(L.jsonp||"callback")+"=?"}}L.dataType="json"}if(L.dataType=="json"&&(L.data&&L.data.match(E)||L.url.match(E))){V="jsonp"+q++;if(L.data){L.data=(L.data+"").replace(E,"="+V+"$1")}L.url=L.url.replace(E,"="+V+"$1");L.dataType="script";l[V]=function(W){U=W;H();K();l[V]=g;try{delete l[V]}catch(X){}if(G){G.removeChild(S)}}}if(L.dataType=="script"&&L.cache==null){L.cache=false}if(L.cache===false&&F=="GET"){var D=e();var T=L.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+D+"$2");L.url=T+((T==L.url)?(L.url.match(/\?/)?"&":"?")+"_="+D:"")}if(L.data&&F=="GET"){L.url+=(L.url.match(/\?/)?"&":"?")+L.data;L.data=null}if(L.global&&!n.active++){n.event.trigger("ajaxStart")}var P=/^(\w+:)?\/\/([^\/?#]+)/.exec(L.url);if(L.dataType=="script"&&F=="GET"&&P&&(P[1]&&P[1]!=location.protocol||P[2]!=location.host)){var G=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.src=L.url;if(L.scriptCharset){S.charset=L.scriptCharset}if(!V){var N=false;S.onload=S.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){N=true;H();K();G.removeChild(S)}}}G.appendChild(S);return g}var J=false;var I=L.xhr();if(L.username){I.open(F,L.url,L.async,L.username,L.password)}else{I.open(F,L.url,L.async)}try{if(L.data){I.setRequestHeader("Content-Type",L.contentType)}if(L.ifModified){I.setRequestHeader("If-Modified-Since",n.lastModified[L.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}I.setRequestHeader("X-Requested-With","XMLHttpRequest");I.setRequestHeader("Accept",L.dataType&&L.accepts[L.dataType]?L.accepts[L.dataType]+", */*":L.accepts._default)}catch(R){}if(L.beforeSend&&L.beforeSend(I,L)===false){if(L.global&&!--n.active){n.event.trigger("ajaxStop")}I.abort();return false}if(L.global){n.event.trigger("ajaxSend",[I,L])}var M=function(W){if(I.readyState==0){if(O){clearInterval(O);O=null;if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}}else{if(!J&&I&&(I.readyState==4||W=="timeout")){J=true;if(O){clearInterval(O);O=null}Q=W=="timeout"?"timeout":!n.httpSuccess(I)?"error":L.ifModified&&n.httpNotModified(I,L.url)?"notmodified":"success";if(Q=="success"){try{U=n.httpData(I,L.dataType,L)}catch(Y){Q="parsererror"}}if(Q=="success"){var X;try{X=I.getResponseHeader("Last-Modified")}catch(Y){}if(L.ifModified&&X){n.lastModified[L.url]=X}if(!V){H()}}else{n.handleError(L,I,Q)}K();if(L.async){I=null}}}};if(L.async){var O=setInterval(M,13);if(L.timeout>0){setTimeout(function(){if(I){if(!J){M("timeout")}if(I){I.abort()}}},L.timeout)}}try{I.send(L.data)}catch(R){n.handleError(L,I,null,R)}if(!L.async){M()}function H(){if(L.success){L.success(U,Q)}if(L.global){n.event.trigger("ajaxSuccess",[I,L])}}function K(){if(L.complete){L.complete(I,Q)}if(L.global){n.event.trigger("ajaxComplete",[I,L])}if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}return I},handleError:function(E,G,D,F){if(E.error){E.error(G,D,F)}if(E.global){n.event.trigger("ajaxError",[G,E,F])}},active:0,httpSuccess:function(E){try{return !E.status&&location.protocol=="file:"||(E.status>=200&&E.status<300)||E.status==304||E.status==1223}catch(D){}return false},httpNotModified:function(F,D){try{var G=F.getResponseHeader("Last-Modified");return F.status==304||G==n.lastModified[D]}catch(E){}return false},httpData:function(I,G,F){var E=I.getResponseHeader("content-type"),D=G=="xml"||!G&&E&&E.indexOf("xml")>=0,H=D?I.responseXML:I.responseText;if(D&&H.documentElement.tagName=="parsererror"){throw"parsererror"}if(F&&F.dataFilter){H=F.dataFilter(H,G)}if(typeof H==="string"){if(G=="script"){n.globalEval(H)}if(G=="json"){H=l["eval"]("("+H+")")}}return H},param:function(D){var F=[];function G(H,I){F[F.length]=encodeURIComponent(H)+"="+encodeURIComponent(I)}if(n.isArray(D)||D.jquery){n.each(D,function(){G(this.name,this.value)})}else{for(var E in D){if(n.isArray(D[E])){n.each(D[E],function(){G(E,this)})}else{G(E,n.isFunction(D[E])?D[E]():D[E])}}}return F.join("&").replace(/%20/g,"+")}});var m={},d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function s(E,D){var F={};n.each(d.concat.apply([],d.slice(0,D)),function(){F[this]=E});return F}n.fn.extend({show:function(I,K){if(I){return this.animate(s("show",3),I,K)}else{for(var G=0,E=this.length;G<E;G++){var D=n.data(this[G],"olddisplay");this[G].style.display=D||"";if(n.css(this[G],"display")==="none"){var F=this[G].tagName,J;if(m[F]){J=m[F]}else{var H=n("<"+F+" />").appendTo("body");J=H.css("display");if(J==="none"){J="block"}H.remove();m[F]=J}this[G].style.display=n.data(this[G],"olddisplay",J)}}return this}},hide:function(G,H){if(G){return this.animate(s("hide",3),G,H)}else{for(var F=0,E=this.length;F<E;F++){var D=n.data(this[F],"olddisplay");if(!D&&D!=="none"){n.data(this[F],"olddisplay",n.css(this[F],"display"))}this[F].style.display="none"}return this}},_toggle:n.fn.toggle,toggle:function(F,E){var D=typeof F==="boolean";return n.isFunction(F)&&n.isFunction(E)?this._toggle.apply(this,arguments):F==null||D?this.each(function(){var G=D?F:n(this).is(":hidden");n(this)[G?"show":"hide"]()}):this.animate(s("toggle",3),F,E)},fadeTo:function(D,F,E){return this.animate({opacity:F},D,E)},animate:function(H,E,G,F){var D=n.speed(E,G,F);return this[D.queue===false?"each":"queue"](function(){var J=n.extend({},D),L,K=this.nodeType==1&&n(this).is(":hidden"),I=this;for(L in H){if(H[L]=="hide"&&K||H[L]=="show"&&!K){return J.complete.call(this)}if((L=="height"||L=="width")&&this.style){J.display=n.css(this,"display");J.overflow=this.style.overflow}}if(J.overflow!=null){this.style.overflow="hidden"}J.curAnim=n.extend({},H);n.each(H,function(N,R){var Q=new n.fx(I,J,N);if(/toggle|show|hide/.test(R)){Q[R=="toggle"?K?"show":"hide":R](H)}else{var P=R.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),S=Q.cur(true)||0;if(P){var M=parseFloat(P[2]),O=P[3]||"px";if(O!="px"){I.style[N]=(M||1)+O;S=((M||1)/Q.cur(true))*S;I.style[N]=S+O}if(P[1]){M=((P[1]=="-="?-1:1)*M)+S}Q.custom(S,M,O)}else{Q.custom(S,R,"")}}});return true})},stop:function(E,D){var F=n.timers;if(E){this.queue([])}this.each(function(){for(var G=F.length-1;G>=0;G--){if(F[G].elem==this){if(D){F[G](true)}F.splice(G,1)}}});if(!D){this.dequeue()}return this}});n.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(D,E){n.fn[D]=function(F,G){return this.animate(E,F,G)}});n.extend({speed:function(F,G,E){var D=typeof F==="object"?F:{complete:E||!E&&G||n.isFunction(F)&&F,duration:F,easing:E&&G||G&&!n.isFunction(G)&&G};D.duration=n.fx.off?0:typeof D.duration==="number"?D.duration:n.fx.speeds[D.duration]||n.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){n(this).dequeue()}if(n.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(F,G,D,E){return D+E*F},swing:function(F,G,D,E){return((-Math.cos(F*Math.PI)/2)+0.5)*E+D}},timers:[],timerId:null,fx:function(E,D,F){this.options=D;this.elem=E;this.prop=F;if(!D.orig){D.orig={}}}});n.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(n.fx.step[this.prop]||n.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(E){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var D=parseFloat(n.css(this.elem,this.prop,E));return D&&D>-10000?D:parseFloat(n.curCSS(this.elem,this.prop))||0},custom:function(H,G,F){this.startTime=e();this.start=H;this.end=G;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var D=this;function E(I){return D.step(I)}E.elem=this.elem;n.timers.push(E);if(E()&&n.timerId==null){n.timerId=setInterval(function(){var J=n.timers;for(var I=0;I<J.length;I++){if(!J[I]()){J.splice(I--,1)}}if(!J.length){clearInterval(n.timerId);n.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());n(this.elem).show()},hide:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(G){var F=e();if(G||F>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var D=true;for(var E in this.options.curAnim){if(this.options.curAnim[E]!==true){D=false}}if(D){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(n.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){n(this.elem).hide()}if(this.options.hide||this.options.show){for(var H in this.options.curAnim){n.attr(this.elem.style,H,this.options.orig[H])}}}if(D){this.options.complete.call(this.elem)}return false}else{var I=F-this.startTime;this.state=I/this.options.duration;this.pos=n.easing[this.options.easing||(n.easing.swing?"swing":"linear")](this.state,I,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};n.extend(n.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(D){n.attr(D.elem.style,"opacity",D.now)},_default:function(D){if(D.elem.style&&D.elem.style[D.prop]!=null){D.elem.style[D.prop]=D.now+D.unit}else{D.elem[D.prop]=D.now}}}});if(document.documentElement.getBoundingClientRect){n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}var F=this[0].getBoundingClientRect(),I=this[0].ownerDocument,E=I.body,D=I.documentElement,K=D.clientTop||E.clientTop||0,J=D.clientLeft||E.clientLeft||0,H=F.top+(self.pageYOffset||n.boxModel&&D.scrollTop||E.scrollTop)-K,G=F.left+(self.pageXOffset||n.boxModel&&D.scrollLeft||E.scrollLeft)-J;return{top:H,left:G}}}else{n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}n.offset.initialized||n.offset.initialize();var I=this[0],F=I.offsetParent,E=I,N=I.ownerDocument,L,G=N.documentElement,J=N.body,K=N.defaultView,D=K.getComputedStyle(I,null),M=I.offsetTop,H=I.offsetLeft;while((I=I.parentNode)&&I!==J&&I!==G){L=K.getComputedStyle(I,null);M-=I.scrollTop,H-=I.scrollLeft;if(I===F){M+=I.offsetTop,H+=I.offsetLeft;if(n.offset.doesNotAddBorder&&!(n.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(I.tagName))){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}E=F,F=I.offsetParent}if(n.offset.subtractsBorderForOverflowNotVisible&&L.overflow!=="visible"){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}D=L}if(D.position==="relative"||D.position==="static"){M+=J.offsetTop,H+=J.offsetLeft}if(D.position==="fixed"){M+=Math.max(G.scrollTop,J.scrollTop),H+=Math.max(G.scrollLeft,J.scrollLeft)}return{top:M,left:H}}}n.offset={initialize:function(){if(this.initialized){return}var K=document.body,E=document.createElement("div"),G,F,M,H,L,D,I=K.style.marginTop,J='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';L={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(D in L){E.style[D]=L[D]}E.innerHTML=J;K.insertBefore(E,K.firstChild);G=E.firstChild,F=G.firstChild,H=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(F.offsetTop!==5);this.doesAddBorderForTableAndCells=(H.offsetTop===5);G.style.overflow="hidden",G.style.position="relative";this.subtractsBorderForOverflowNotVisible=(F.offsetTop===-5);K.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(K.offsetTop===0);K.style.marginTop=I;K.removeChild(E);this.initialized=true},bodyOffset:function(D){n.offset.initialized||n.offset.initialize();var F=D.offsetTop,E=D.offsetLeft;if(n.offset.doesNotIncludeMarginInBodyOffset){F+=parseInt(n.curCSS(D,"marginTop",true),10)||0,E+=parseInt(n.curCSS(D,"marginLeft",true),10)||0}return{top:F,left:E}}};n.fn.extend({position:function(){var H=0,G=0,E;if(this[0]){var F=this.offsetParent(),I=this.offset(),D=/^body|html$/i.test(F[0].tagName)?{top:0,left:0}:F.offset();I.top-=j(this,"marginTop");I.left-=j(this,"marginLeft");D.top+=j(F,"borderTopWidth");D.left+=j(F,"borderLeftWidth");E={top:I.top-D.top,left:I.left-D.left}}return E},offsetParent:function(){var D=this[0].offsetParent||document.body;while(D&&(!/^body|html$/i.test(D.tagName)&&n.css(D,"position")=="static")){D=D.offsetParent}return n(D)}});n.each(["Left","Top"],function(E,D){var F="scroll"+D;n.fn[F]=function(G){if(!this[0]){return null}return G!==g?this.each(function(){this==l||this==document?l.scrollTo(!E?G:n(l).scrollLeft(),E?G:n(l).scrollTop()):this[F]=G}):this[0]==l||this[0]==document?self[E?"pageYOffset":"pageXOffset"]||n.boxModel&&document.documentElement[F]||document.body[F]:this[0][F]}});n.each(["Height","Width"],function(G,E){var D=G?"Left":"Top",F=G?"Right":"Bottom";n.fn["inner"+E]=function(){return this[E.toLowerCase()]()+j(this,"padding"+D)+j(this,"padding"+F)};n.fn["outer"+E]=function(I){return this["inner"+E]()+j(this,"border"+D+"Width")+j(this,"border"+F+"Width")+(I?j(this,"margin"+D)+j(this,"margin"+F):0)};var H=E.toLowerCase();n.fn[H]=function(I){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+E]||document.body["client"+E]:this[0]==document?Math.max(document.documentElement["client"+E],document.body["scroll"+E],document.documentElement["scroll"+E],document.body["offset"+E],document.documentElement["offset"+E]):I===g?(this.length?n.css(this[0],H):null):this.css(H,typeof I==="string"?I:I+"px")}})})();
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-1.3.min.js
jquery-1.3.min.js
(function($) { $.alerts = { // These properties can be read/written by accessing $.alerts.propertyName from your scripts at any time verticalOffset: -75, // vertical offset of the dialog from center screen, in pixels horizontalOffset: 0, // horizontal offset of the dialog from center screen, in pixels/ repositionOnResize: true, // re-centers the dialog on window resize overlayOpacity: .01, // transparency level of overlay overlayColor: '#FFF', // base color of overlay draggable: true, // make the dialogs draggable (requires UI Draggables plugin) okButton: '&nbsp;OK&nbsp;', // text for the OK button cancelButton: '&nbsp;Cancel&nbsp;', // text for the Cancel button dialogClass: null, // if specified, this class will be applied to all dialogs // Public methods alert: function(message, title, callback) { if( title == null ) title = 'Alert'; $.alerts._show(title, message, null, 'alert', function(result) { if( callback ) callback(result); }); }, confirm: function(message, title, callback) { if( title == null ) title = 'Confirm'; $.alerts._show(title, message, null, 'confirm', function(result) { if( callback ) callback(result); }); }, prompt: function(message, value, title, callback) { if( title == null ) title = 'Prompt'; $.alerts._show(title, message, value, 'prompt', function(result) { if( callback ) callback(result); }); }, // Private methods _show: function(title, msg, value, type, callback) { $.alerts._hide(); $.alerts._overlay('show'); $("BODY").append( '<div id="popup_container">' + '<h1 id="popup_title"></h1>' + '<div id="popup_content">' + '<div id="popup_message"></div>' + '</div>' + '</div>'); if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass); // IE6 Fix var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed'; $("#popup_container").css({ position: pos, zIndex: 99999, padding: 0, margin: 0 }); $("#popup_title").text(title); $("#popup_content").addClass(type); $("#popup_message").text(msg); $("#popup_message").html( $("#popup_message").text().replace(/\n/g, '<br />') ); $("#popup_container").css({ minWidth: $("#popup_container").outerWidth(), maxWidth: $("#popup_container").outerWidth() }); $.alerts._reposition(); $.alerts._maintainPosition(true); switch( type ) { case 'alert': $("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /></div>'); $("#popup_ok").click( function() { $.alerts._hide(); callback(true); }); $("#popup_ok").focus().keypress( function(e) { if( e.keyCode == 13 || e.keyCode == 27 ) $("#popup_ok").trigger('click'); }); break; case 'confirm': $("#popup_message").after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>'); $("#popup_ok").click( function() { $.alerts._hide(); if( callback ) callback(true); }); $("#popup_cancel").click( function() { $.alerts._hide(); if( callback ) callback(false); }); $("#popup_ok").focus(); $("#popup_ok, #popup_cancel").keypress( function(e) { if( e.keyCode == 13 ) $("#popup_ok").trigger('click'); if( e.keyCode == 27 ) $("#popup_cancel").trigger('click'); }); break; case 'prompt': $("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + $.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + $.alerts.cancelButton + '" id="popup_cancel" /></div>'); $("#popup_prompt").width( $("#popup_message").width() ); $("#popup_ok").click( function() { var val = $("#popup_prompt").val(); $.alerts._hide(); if( callback ) callback( val ); }); $("#popup_cancel").click( function() { $.alerts._hide(); if( callback ) callback( null ); }); $("#popup_prompt, #popup_ok, #popup_cancel").keypress( function(e) { if( e.keyCode == 13 ) $("#popup_ok").trigger('click'); if( e.keyCode == 27 ) $("#popup_cancel").trigger('click'); }); if( value ) $("#popup_prompt").val(value); $("#popup_prompt").focus().select(); break; } // Make draggable if( $.alerts.draggable ) { try { $("#popup_container").draggable({ handle: $("#popup_title") }); $("#popup_title").css({ cursor: 'move' }); } catch(e) { /* requires jQuery UI draggables */ } } }, _hide: function() { $("#popup_container").remove(); $.alerts._overlay('hide'); $.alerts._maintainPosition(false); }, _overlay: function(status) { switch( status ) { case 'show': $.alerts._overlay('hide'); $("BODY").append('<div id="popup_overlay"></div>'); $("#popup_overlay").css({ position: 'absolute', zIndex: 99998, top: '0px', left: '0px', width: '100%', height: $(document).height(), background: $.alerts.overlayColor, opacity: $.alerts.overlayOpacity }); break; case 'hide': $("#popup_overlay").remove(); break; } }, _reposition: function() { var top = (($(window).height() / 2) - ($("#popup_container").outerHeight() / 2)) + $.alerts.verticalOffset; var left = (($(window).width() / 2) - ($("#popup_container").outerWidth() / 2)) + $.alerts.horizontalOffset; if( top < 0 ) top = 0; if( left < 0 ) left = 0; // IE6 fix if( $.browser.msie && parseInt($.browser.version) <= 6 ) top = top + $(window).scrollTop(); $("#popup_container").css({ top: top + 'px', left: left + 'px' }); $("#popup_overlay").height( $(document).height() ); }, _maintainPosition: function(status) { if( $.alerts.repositionOnResize ) { switch(status) { case true: $(window).bind('resize', $.alerts._reposition); break; case false: $(window).unbind('resize', $.alerts._reposition); break; } } } } // Shortuct functions jAlert = function(message, title, callback) { $.alerts.alert(message, title, callback); } jConfirm = function(message, title, callback) { $.alerts.confirm(message, title, callback); }; jPrompt = function(message, value, title, callback) { $.alerts.prompt(message, value, title, callback); }; $(document).ready(function() { var lang = $('HTML').attr('lang') || $('HTML').attr('xml:lang'); if (lang && (lang != 'en')) { $.ajax({ dataType: 'script', cache: true, url: '/--static--/ztfy.jqueryui/js/i18n/' + lang + '.js', success: function() { $.i18n.setDictionary(I18n_alerts); $.alerts.okButton = $.i18n._('okButton'); $.alerts.cancelButton = $.i18n._('cancelButton'); } }); } }); })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-alerts.js
jquery-alerts.js
(function($) { $.extend({ progressBar: new function() { this.defaults = { steps : 20, // steps taken to reach target step_duration : 20, max : 100, // Upon 100% i'd assume, but configurable showText : true, // show text with percentage in next to the progressbar? - default : true textFormat : 'percentage', // Or otherwise, set to 'fraction' width : 120, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' height : 12, // Height of the progressbar - don't forget to adjust your image too!!! callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc boxImage : '/--static--/ztfy.jqueryui/img/progressbar.gif', // boxImage : image around the progress bar barImage : { 0: '/--static--/ztfy.jqueryui/img/progressbg_red.gif', 30: '/--static--/ztfy.jqueryui/img/progressbg_orange.gif', 70: '/--static--/ztfy.jqueryui/img/progressbg_green.gif' }, // Internal use running_value : 0, value : 0, image : null }; /* public methods */ this.construct = function(arg1, arg2) { var argvalue = null; var argconfig = null; if (arg1 != null) { if (!isNaN(arg1)) { argvalue = arg1; if (arg2 != null) { argconfig = arg2; } } else { argconfig = arg1; } } return this.each(function(child) { var pb = this; var config = this.config; if (argvalue != null && this.bar != null && this.config != null) { this.config.value = argvalue if (argconfig != null) pb.config = $.extend(this.config, argconfig); config = pb.config; } else { var $this = $(this); var config = $.extend({}, $.progressBar.defaults, argconfig); config.id = $this.attr('id') ? $this.attr('id') : Math.ceil(Math.random() * 100000); // random id, if none provided if (argvalue == null) argvalue = $this.html().replace("%","") // parse percentage config.value = argvalue; config.running_value = 0; config.image = getBarImage(config); $this.html(""); var bar = document.createElement('img'); var text = document.createElement('span'); var $bar = $(bar); var $text = $(text); pb.bar = $bar; $bar.attr('id', config.id + "_pbImage"); $text.attr('id', config.id + "_pbText"); $text.html(getText(config)); $bar.attr('title', getText(config)); $bar.attr('alt', getText(config)); $bar.attr('src', config.boxImage); $bar.attr('width', config.width); $bar.css("width", config.width + "px"); $bar.css("height", config.height + "px"); $bar.css("background-image", "url(" + config.image + ")"); $bar.css("background-position", ((config.width * -1)) + 'px 50%'); $bar.css("padding", "0"); $bar.css("margin", "0"); $this.append($bar); $this.append($text); } function getPercentage(config) { return config.running_value * 100 / config.max; } function getBarImage(config) { var image = config.barImage; if (typeof(config.barImage) == 'object') { for (var i in config.barImage) { if (getPercentage(config) >= parseInt(i)) { image = config.barImage[i]; } else { break; } } } return image; } function getText(config) { if (config.showText) { if (config.textFormat == 'percentage') { return " " + Math.round(config.running_value) + "%"; } else if (config.textFormat == 'fraction') { return " " + config.running_value + '/' + config.max; } } } config.increment = Math.round((config.value - config.running_value)/config.steps); if (config.increment < 0) config.increment *= -1; if (config.increment < 1) config.increment = 1; var t = setInterval(function() { var pixels = config.width / 100; // Define how many pixels go into 1% var stop = false; if (config.running_value > config.value) { if (config.running_value - config.increment < config.value) { config.running_value = config.value; } else { config.running_value -= config.increment; } } else if (config.running_value < config.value) { if (config.running_value + config.increment > config.value) { config.running_value = config.value; } else { config.running_value += config.increment; } } if (config.running_value == config.value) clearInterval(t); var $bar = $("#" + config.id + "_pbImage"); var $text = $("#" + config.id + "_pbText"); var image = getBarImage(config); if (image != config.image) { $bar.css("background-image", "url(" + image + ")"); config.image = image; } $bar.css("background-position", (((config.width * -1)) + (getPercentage(config) * pixels)) + 'px 50%'); $bar.attr('title', getText(config)); $text.html(getText(config)); if (config.callback != null && typeof(config.callback) == 'function') config.callback(config); pb.config = config; }, config.step_duration); }); }; this.submit = function(form) { var files = $('input:file', form); if (files.length > 0) { var frame = $('iframe[name=progress]', form); if (frame) { var uuid = ""; for (var i = 0; i < 32; i++) { uuid += Math.floor(Math.random() * 16).toString(16); } var action = $(form).attr("action"); if(old_id = /X-Progress-ID=([^&]+)/.exec(action)) { action = action.replace(old_id[1], uuid); } else { action = action + "?X-Progress-ID=" + uuid; } $(form).attr("action", action); var progress = $(frame).get(0).contentWindow.updateUploadProgress; if (progress) { progress(uuid); return uuid; } } } } } }); $.fn.extend({ progressBar: $.progressBar.construct }); })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-progressbar.js
jquery-progressbar.js
(function(c){function a(d){if(d.attr("title")||typeof(d.attr("original-title"))!="string"){d.attr("original-title",d.attr("title")||"").removeAttr("title")}}function b(e,d){this.$element=c(e);this.options=d;this.enabled=true;a(this.$element)}b.prototype={show:function(){var h=this.getTitle();if(h&&this.enabled){var g=this.tip();g.find(".tipsy-inner")[this.options.html?"html":"text"](h);g[0].className="tipsy";g.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).appendTo(document.body);var k=c.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var d=g[0].offsetWidth,j=g[0].offsetHeight;var i=(typeof this.options.gravity=="function")?this.options.gravity.call(this.$element[0]):this.options.gravity;var f=(typeof this.options.offset=="function")?this.options.offset.call(this.$element[0]):this.options.offset;var e;switch(i.charAt(0)){case"n":e={top:k.top+k.height+f,left:k.left+k.width/2-d/2};break;case"s":e={top:k.top-j-f,left:k.left+k.width/2-d/2};break;case"e":e={top:k.top+k.height/2-j/2,left:k.left-d-f};break;case"w":e={top:k.top+k.height/2-j/2,left:k.left+k.width+f};break}if(i.length==2){if(i.charAt(1)=="w"){e.left=k.left-5}else{e.left=k.left+k.width-d+5}}e.left=Math.min(e.left,c("html").width()-d-10);g.css(e).addClass("tipsy-"+i);if(this.options.fade){g.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity})}else{g.css({visibility:"visible",opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){c(this).remove()})}else{this.tip().remove()}},getTitle:function(){var f,d=this.$element,e=this.options;a(d);var f,e=this.options;if(typeof e.title=="string"){f=d.attr(e.title=="title"?"original-title":e.title)}else{if(typeof e.title=="function"){f=e.title.call(d[0])}}f=(""+f).replace(/(^\s*|\s*$)/,"");return f||e.fallback},tip:function(){if(!this.$tip){this.$tip=c('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"/></div>')}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};c.fn.tipsy=function(h){if(h===true){return this.data("tipsy")}else{if(typeof h=="string"){return this.data("tipsy")[h]()}}h=c.extend({},c.fn.tipsy.defaults,h);function g(k){var l=c.data(k,"tipsy");if(!l){l=new b(k,c.fn.tipsy.elementOptions(k,h));c.data(k,"tipsy",l)}return l}function j(){var k=g(this);k.hoverState="in";if(h.delayIn==0){k.show()}else{setTimeout(function(){if(k.hoverState=="in"){k.show()}},h.delayIn)}}function f(){var k=g(this);k.hoverState="out";if(h.delayOut==0){k.hide()}else{setTimeout(function(){if(k.hoverState=="out"){k.hide()}},h.delayOut)}}if(!h.live){this.each(function(){g(this)})}if(h.trigger!="manual"){var d=h.live?"live":"bind",i=h.trigger=="hover"?"mouseenter":"focus",e=h.trigger=="hover"?"mouseleave":"blur";this[d](i,j)[d](e,f)}return this};c.fn.tipsy.defaults={delayIn:0,delayOut:0,fade:false,fallback:"",gravity:"n",html:false,live:false,offset:0,opacity:0.8,title:"title",trigger:"hover"};c.fn.tipsy.elementOptions=function(e,d){return c.metadata?c.extend({},d,c(e).metadata()):d};c.fn.tipsy.autoNS=function(){return c(this).offset().top>(c(document).scrollTop()+c(window).height()/2)?"s":"n"};c.fn.tipsy.autoWE=function(){return c(this).offset().left>(c(document).scrollLeft()+c(window).width()/2)?"e":"w"}})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-tipsy.min.js
jquery-tipsy.min.js
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{})) /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-easing-1.3.pack.js
jquery-easing-1.3.pack.js
(function( window, undefined ) { // Use the correct document accordingly with window argument (sandbox) var document = window.document; var jQuery = (function() { // Define a local copy of jQuery var jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context ); }, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // A central reference to the root jQuery(document) rootjQuery, // A simple way to check for HTML strings or ID strings // (both of which we optimize for) quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, // Is it a simple selector isSimple = /^.[^:#\[\.,]*$/, // Check if a string has a non-whitespace character in it rnotwhite = /\S/, rwhite = /\s/, // Used for trimming whitespace trimLeft = /^\s+/, trimRight = /\s+$/, // Check for non-word characters rnonword = /\W/, // Check for digits rdigit = /\d/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, // Useragent RegExp rwebkit = /(webkit)[ \/]([\w.]+)/, ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, rmsie = /(msie) ([\w.]+)/, rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, // Keep a UserAgent string for use with jQuery.browser userAgent = navigator.userAgent, // For matching the engine and version of the browser browserMatch, // Has the ready events already been bound? readyBound = false, // The functions to execute on DOM ready readyList = [], // The ready event handler DOMContentLoaded, // Save a reference to some core methods toString = Object.prototype.toString, hasOwn = Object.prototype.hasOwnProperty, push = Array.prototype.push, slice = Array.prototype.slice, trim = String.prototype.trim, indexOf = Array.prototype.indexOf, // [[Class]] -> type pairs class2type = {}; jQuery.fn = jQuery.prototype = { init: function( selector, context ) { var match, elem, ret, doc; // Handle $(""), $(null), or $(undefined) if ( !selector ) { return this; } // Handle $(DOMElement) if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; } // The body element only exists once, optimize finding it if ( selector === "body" && !context && document.body ) { this.context = document; this[0] = document.body; this.selector = "body"; this.length = 1; return this; } // Handle HTML strings if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? match = quickExpr.exec( selector ); // Verify a match, and that no context was specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { doc = (context ? context.ownerDocument || context : document); // If a single string is passed in and it's a single tag // just do a createElement and skip the rest ret = rsingleTag.exec( selector ); if ( ret ) { if ( jQuery.isPlainObject( context ) ) { selector = [ document.createElement( ret[1] ) ]; jQuery.fn.attr.call( selector, context, true ); } else { selector = [ doc.createElement( ret[1] ) ]; } } else { ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; } return jQuery.merge( this, selector ); // HANDLE: $("#id") } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $("TAG") } else if ( !context && !rnonword.test( selector ) ) { this.selector = selector; this.context = document; selector = document.getElementsByTagName( selector ); return jQuery.merge( this, selector ); // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return (context || rootjQuery).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return jQuery( context ).find( selector ); } // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if (selector.selector !== undefined) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The current version of jQuery being used jquery: "1.4.4", // The default length of a jQuery object is 0 length: 0, // The number of elements contained in the matched element set size: function() { return this.length; }, toArray: function() { return slice.call( this, 0 ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = jQuery(); if ( jQuery.isArray( elems ) ) { push.apply( ret, elems ); } else { jQuery.merge( ret, elems ); } // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; if ( name === "find" ) { ret.selector = this.selector + (this.selector ? " " : "") + selector; } else if ( name ) { ret.selector = this.selector + "." + name + "(" + selector + ")"; } // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Attach the listeners jQuery.bindReady(); // If the DOM is already ready if ( jQuery.isReady ) { // Execute the function immediately fn.call( document, jQuery ); // Otherwise, remember the function for later } else if ( readyList ) { // Add the function to the wait list readyList.push( fn ); } return this; }, eq: function( i ) { return i === -1 ? this.slice( i ) : this.slice( i, +i + 1 ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ), "slice", slice.call(arguments).join(",") ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || jQuery(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ noConflict: function( deep ) { window.$ = _$; if ( deep ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Handle when the DOM is ready ready: function( wait ) { // A third-party is pushing the ready event forwards if ( wait === true ) { jQuery.readyWait--; } // Make sure that the DOM is not already loaded if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready, 1 ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute if ( readyList ) { // Execute all of them var fn, i = 0, ready = readyList; // Reset the list of functions readyList = null; while ( (fn = ready[ i++ ]) ) { fn.call( document, jQuery ); } // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger( "ready" ).unbind( "ready" ); } } } }, bindReady: function() { if ( readyBound ) { return; } readyBound = true; // Catch cases where $(document).ready() is called after the // browser event has already occurred. if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready return setTimeout( jQuery.ready, 1 ); } // Mozilla, Opera and webkit nightlies currently support this event if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", jQuery.ready, false ); // If IE event model is used } else if ( document.attachEvent ) { // ensure firing before onload, // maybe late but safe also for iframes document.attachEvent("onreadystatechange", DOMContentLoaded); // A fallback to window.onload, that will always work window.attachEvent( "onload", jQuery.ready ); // If IE and not a frame // continually check to see if the document is ready var toplevel = false; try { toplevel = window.frameElement == null; } catch(e) {} if ( document.documentElement.doScroll && toplevel ) { doScrollCheck(); } } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, // A crude way of determining if an object is a window isWindow: function( obj ) { return obj && typeof obj === "object" && "setInterval" in obj; }, isNaN: function( obj ) { return obj == null || !rdigit.test( obj ) || isNaN( obj ); }, type: function( obj ) { return obj == null ? String( obj ) : class2type[ toString.call(obj) ] || "object"; }, isPlainObject: function( obj ) { // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { for ( var name in obj ) { return false; } return true; }, error: function( msg ) { throw msg; }, parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; } // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test(data.replace(rvalidescape, "@") .replace(rvalidtokens, "]") .replace(rvalidbraces, "")) ) { // Try to use the native JSON parser first return window.JSON && window.JSON.parse ? window.JSON.parse( data ) : (new Function("return " + data))(); } else { jQuery.error( "Invalid JSON: " + data ); } }, noop: function() {}, // Evalulates a script in a global context globalEval: function( data ) { if ( data && rnotwhite.test(data) ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement, script = document.createElement("script"); script.type = "text/javascript"; if ( jQuery.support.scriptEval ) { script.appendChild( document.createTextNode( data ) ); } else { script.text = data; } // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709). head.insertBefore( script, head.firstChild ); head.removeChild( script ); } }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); }, // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length, isObj = length === undefined || jQuery.isFunction(object); if ( args ) { if ( isObj ) { for ( name in object ) { if ( callback.apply( object[ name ], args ) === false ) { break; } } } else { for ( ; i < length; ) { if ( callback.apply( object[ i++ ], args ) === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isObj ) { for ( name in object ) { if ( callback.call( object[ name ], name, object[ name ] ) === false ) { break; } } } else { for ( var value = object[0]; i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} } } return object; }, // Use native String.trim function wherever possible trim: trim ? function( text ) { return text == null ? "" : trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); }, // results is for internal usage only makeArray: function( array, results ) { var ret = results || []; if ( array != null ) { // The window, strings (and functions) also have 'length' // The extra typeof function check is to prevent crashes // in Safari 2 (See: #3039) // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 var type = jQuery.type(array); if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { push.call( ret, array ); } else { jQuery.merge( ret, array ); } } return ret; }, inArray: function( elem, array ) { if ( array.indexOf ) { return array.indexOf( elem ); } for ( var i = 0, length = array.length; i < length; i++ ) { if ( array[ i ] === elem ) { return i; } } return -1; }, merge: function( first, second ) { var i = first.length, j = 0; if ( typeof second.length === "number" ) { for ( var l = second.length; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var ret = [], retVal; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( var i = 0, length = elems.length; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var ret = [], value; // Go through the array, translating each of the items to their // new value (or values). for ( var i = 0, length = elems.length; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } return ret.concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, proxy: function( fn, proxy, thisObject ) { if ( arguments.length === 2 ) { if ( typeof proxy === "string" ) { thisObject = fn; fn = thisObject[ proxy ]; proxy = undefined; } else if ( proxy && !jQuery.isFunction( proxy ) ) { thisObject = proxy; proxy = undefined; } } if ( !proxy && fn ) { proxy = function() { return fn.apply( thisObject || this, arguments ); }; } // Set the guid of unique handler to the same of original handler, so it can be removed if ( fn ) { proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; } // So proxy can be declared as an argument return proxy; }, // Mutifunctional method to get and set values to a collection // The value/s can be optionally by executed if its a function access: function( elems, key, value, exec, fn, pass ) { var length = elems.length; // Setting many attributes if ( typeof key === "object" ) { for ( var k in key ) { jQuery.access( elems, k, key[k], exec, fn, value ); } return elems; } // Setting one attribute if ( value !== undefined ) { // Optionally, function values get executed if exec is true exec = !pass && exec && jQuery.isFunction(value); for ( var i = 0; i < length; i++ ) { fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); } return elems; } // Getting an attribute return length ? fn( elems[0], key ) : undefined; }, now: function() { return (new Date()).getTime(); }, // Use of jQuery.browser is frowned upon. // More details: http://docs.jquery.com/Utilities/jQuery.browser uaMatch: function( ua ) { ua = ua.toLowerCase(); var match = rwebkit.exec( ua ) || ropera.exec( ua ) || rmsie.exec( ua ) || ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || []; return { browser: match[1] || "", version: match[2] || "0" }; }, browser: {} }); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); browserMatch = jQuery.uaMatch( userAgent ); if ( browserMatch.browser ) { jQuery.browser[ browserMatch.browser ] = true; jQuery.browser.version = browserMatch.version; } // Deprecated, use jQuery.browser.webkit instead if ( jQuery.browser.webkit ) { jQuery.browser.safari = true; } if ( indexOf ) { jQuery.inArray = function( elem, array ) { return indexOf.call( array, elem ); }; } // Verify that \s matches non-breaking spaces // (IE fails on this test) if ( !rwhite.test( "\xA0" ) ) { trimLeft = /^[\s\xA0]+/; trimRight = /[\s\xA0]+$/; } // All jQuery objects should point back to these rootjQuery = jQuery(document); // Cleanup functions for the document ready method if ( document.addEventListener ) { DOMContentLoaded = function() { document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); jQuery.ready(); }; } else if ( document.attachEvent ) { DOMContentLoaded = function() { // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( document.readyState === "complete" ) { document.detachEvent( "onreadystatechange", DOMContentLoaded ); jQuery.ready(); } }; } // The DOM ready check for Internet Explorer function doScrollCheck() { if ( jQuery.isReady ) { return; } try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch(e) { setTimeout( doScrollCheck, 1 ); return; } // and execute any waiting functions jQuery.ready(); } // Expose jQuery to the global object return (window.jQuery = window.$ = jQuery); })(); (function() { jQuery.support = {}; var root = document.documentElement, script = document.createElement("script"), div = document.createElement("div"), id = "script" + jQuery.now(); div.style.display = "none"; div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; var all = div.getElementsByTagName("*"), a = div.getElementsByTagName("a")[0], select = document.createElement("select"), opt = select.appendChild( document.createElement("option") ); // Can't get basic test support if ( !all || !all.length || !a ) { return; } jQuery.support = { // IE strips leading whitespace when .innerHTML is used leadingWhitespace: div.firstChild.nodeType === 3, // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables tbody: !div.getElementsByTagName("tbody").length, // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE htmlSerialize: !!div.getElementsByTagName("link").length, // Get the style information from getAttribute // (IE uses .cssText insted) style: /red/.test( a.getAttribute("style") ), // Make sure that URLs aren't manipulated // (IE normalizes it by default) hrefNormalized: a.getAttribute("href") === "/a", // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 opacity: /^0.55$/.test( a.style.opacity ), // Verify style float existence // (IE uses styleFloat instead of cssFloat) cssFloat: !!a.style.cssFloat, // Make sure that if no value is specified for a checkbox // that it defaults to "on". // (WebKit defaults to "" instead) checkOn: div.getElementsByTagName("input")[0].value === "on", // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) optSelected: opt.selected, // Will be defined later deleteExpando: true, optDisabled: false, checkClone: false, scriptEval: false, noCloneEvent: true, boxModel: null, inlineBlockNeedsLayout: false, shrinkWrapBlocks: false, reliableHiddenOffsets: true }; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as diabled) select.disabled = true; jQuery.support.optDisabled = !opt.disabled; script.type = "text/javascript"; try { script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); } catch(e) {} root.insertBefore( script, root.firstChild ); // Make sure that the execution of code works by injecting a script // tag with appendChild/createTextNode // (IE doesn't support this, fails, and uses .text instead) if ( window[ id ] ) { jQuery.support.scriptEval = true; delete window[ id ]; } // Test to see if it's possible to delete an expando from an element // Fails in Internet Explorer try { delete script.test; } catch(e) { jQuery.support.deleteExpando = false; } root.removeChild( script ); if ( div.attachEvent && div.fireEvent ) { div.attachEvent("onclick", function click() { // Cloning a node shouldn't copy over any // bound event handlers (IE does this) jQuery.support.noCloneEvent = false; div.detachEvent("onclick", click); }); div.cloneNode(true).fireEvent("onclick"); } div = document.createElement("div"); div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>"; var fragment = document.createDocumentFragment(); fragment.appendChild( div.firstChild ); // WebKit doesn't clone checked state correctly in fragments jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; // Figure out if the W3C box model works as expected // document.body must exist before we can do this jQuery(function() { var div = document.createElement("div"); div.style.width = div.style.paddingLeft = "1px"; document.body.appendChild( div ); jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; if ( "zoom" in div.style ) { // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout // (IE < 8 does this) div.style.display = "inline"; div.style.zoom = 1; jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; // Check if elements with layout shrink-wrap their children // (IE 6 does this) div.style.display = ""; div.innerHTML = "<div style='width:4px;'></div>"; jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; } div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>"; var tds = div.getElementsByTagName("td"); // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). // (only IE 8 fails this test) jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; tds[0].style.display = ""; tds[1].style.display = "none"; // Check if empty table cells still have offsetWidth/Height // (IE < 8 fail this test) jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; div.innerHTML = ""; document.body.removeChild( div ).style.display = "none"; div = tds = null; }); // Technique from Juriy Zaytsev // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ var eventSupported = function( eventName ) { var el = document.createElement("div"); eventName = "on" + eventName; var isSupported = (eventName in el); if ( !isSupported ) { el.setAttribute(eventName, "return;"); isSupported = typeof el[eventName] === "function"; } el = null; return isSupported; }; jQuery.support.submitBubbles = eventSupported("submit"); jQuery.support.changeBubbles = eventSupported("change"); // release memory in IE root = script = div = all = a = null; })(); var windowData = {}, rbrace = /^(?:\{.*\}|\[.*\])$/; jQuery.extend({ cache: {}, // Please use with caution uuid: 0, // Unique for each copy of jQuery on the page expando: "jQuery" + jQuery.now(), // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "applet": true }, data: function( elem, name, data ) { if ( !jQuery.acceptData( elem ) ) { return; } elem = elem == window ? windowData : elem; var isNode = elem.nodeType, id = isNode ? elem[ jQuery.expando ] : null, cache = jQuery.cache, thisCache; if ( isNode && !id && typeof name === "string" && data === undefined ) { return; } // Get the data from the object directly if ( !isNode ) { cache = elem; // Compute a unique ID for the element } else if ( !id ) { elem[ jQuery.expando ] = id = ++jQuery.uuid; } // Avoid generating a new cache unless none exists and we // want to manipulate it. if ( typeof name === "object" ) { if ( isNode ) { cache[ id ] = jQuery.extend(cache[ id ], name); } else { jQuery.extend( cache, name ); } } else if ( isNode && !cache[ id ] ) { cache[ id ] = {}; } thisCache = isNode ? cache[ id ] : cache; // Prevent overriding the named cache with undefined values if ( data !== undefined ) { thisCache[ name ] = data; } return typeof name === "string" ? thisCache[ name ] : thisCache; }, removeData: function( elem, name ) { if ( !jQuery.acceptData( elem ) ) { return; } elem = elem == window ? windowData : elem; var isNode = elem.nodeType, id = isNode ? elem[ jQuery.expando ] : elem, cache = jQuery.cache, thisCache = isNode ? cache[ id ] : id; // If we want to remove a specific section of the element's data if ( name ) { if ( thisCache ) { // Remove the section of cache data delete thisCache[ name ]; // If we've removed all the data, remove the element's cache if ( isNode && jQuery.isEmptyObject(thisCache) ) { jQuery.removeData( elem ); } } // Otherwise, we want to remove all of the element's data } else { if ( isNode && jQuery.support.deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); // Completely remove the data cache } else if ( isNode ) { delete cache[ id ]; // Remove all fields from the object } else { for ( var n in elem ) { delete elem[ n ]; } } } }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { if ( elem.nodeName ) { var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; if ( match ) { return !(match === true || elem.getAttribute("classid") !== match); } } return true; } }); jQuery.fn.extend({ data: function( key, value ) { var data = null; if ( typeof key === "undefined" ) { if ( this.length ) { var attr = this[0].attributes, name; data = jQuery.data( this[0] ); for ( var i = 0, l = attr.length; i < l; i++ ) { name = attr[i].name; if ( name.indexOf( "data-" ) === 0 ) { name = name.substr( 5 ); dataAttr( this[0], name, data[ name ] ); } } } return data; } else if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } var parts = key.split("."); parts[1] = parts[1] ? "." + parts[1] : ""; if ( value === undefined ) { data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); // Try to fetch any internally stored data first if ( data === undefined && this.length ) { data = jQuery.data( this[0], key ); data = dataAttr( this[0], key, data ); } return data === undefined && parts[1] ? this.data( parts[0] ) : data; } else { return this.each(function() { var $this = jQuery( this ), args = [ parts[0], value ]; $this.triggerHandler( "setData" + parts[1] + "!", args ); jQuery.data( this, key, value ); $this.triggerHandler( "changeData" + parts[1] + "!", args ); }); } }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { data = elem.getAttribute( "data-" + key ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : !jQuery.isNaN( data ) ? parseFloat( data ) : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } jQuery.extend({ queue: function( elem, type, data ) { if ( !elem ) { return; } type = (type || "fx") + "queue"; var q = jQuery.data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( !data ) { return q || []; } if ( !q || jQuery.isArray(data) ) { q = jQuery.data( elem, type, jQuery.makeArray(data) ); } else { q.push( data ); } return q; }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), fn = queue.shift(); // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift("inprogress"); } fn.call(elem, function() { jQuery.dequeue(elem, type); }); } } }); jQuery.fn.extend({ queue: function( type, data ) { if ( typeof type !== "string" ) { data = type; type = "fx"; } if ( data === undefined ) { return jQuery.queue( this[0], type ); } return this.each(function( i ) { var queue = jQuery.queue( this, type, data ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; type = type || "fx"; return this.queue( type, function() { var elem = this; setTimeout(function() { jQuery.dequeue( elem, type ); }, time ); }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); } }); var rclass = /[\n\t]/g, rspaces = /\s+/, rreturn = /\r/g, rspecialurl = /^(?:href|src|style)$/, rtype = /^(?:button|input)$/i, rfocusable = /^(?:button|input|object|select|textarea)$/i, rclickable = /^a(?:rea)?$/i, rradiocheck = /^(?:radio|checkbox)$/i; jQuery.props = { "for": "htmlFor", "class": "className", readonly: "readOnly", maxlength: "maxLength", cellspacing: "cellSpacing", rowspan: "rowSpan", colspan: "colSpan", tabindex: "tabIndex", usemap: "useMap", frameborder: "frameBorder" }; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, name, value, true, jQuery.attr ); }, removeAttr: function( name, fn ) { return this.each(function(){ jQuery.attr( this, name, "" ); if ( this.nodeType === 1 ) { this.removeAttribute( name ); } }); }, addClass: function( value ) { if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); self.addClass( value.call(this, i, self.attr("class")) ); }); } if ( value && typeof value === "string" ) { var classNames = (value || "").split( rspaces ); for ( var i = 0, l = this.length; i < l; i++ ) { var elem = this[i]; if ( elem.nodeType === 1 ) { if ( !elem.className ) { elem.className = value; } else { var className = " " + elem.className + " ", setClass = elem.className; for ( var c = 0, cl = classNames.length; c < cl; c++ ) { if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { setClass += " " + classNames[c]; } } elem.className = jQuery.trim( setClass ); } } } } return this; }, removeClass: function( value ) { if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); self.removeClass( value.call(this, i, self.attr("class")) ); }); } if ( (value && typeof value === "string") || value === undefined ) { var classNames = (value || "").split( rspaces ); for ( var i = 0, l = this.length; i < l; i++ ) { var elem = this[i]; if ( elem.nodeType === 1 && elem.className ) { if ( value ) { var className = (" " + elem.className + " ").replace(rclass, " "); for ( var c = 0, cl = classNames.length; c < cl; c++ ) { className = className.replace(" " + classNames[c] + " ", " "); } elem.className = jQuery.trim( className ); } else { elem.className = ""; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isBool = typeof stateVal === "boolean"; if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this); self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), state = stateVal, classNames = value.split( rspaces ); while ( (className = classNames[ i++ ]) ) { // check each className given, space seperated list state = isBool ? state : !self.hasClass( className ); self[ state ? "addClass" : "removeClass" ]( className ); } } else if ( type === "undefined" || type === "boolean" ) { if ( this.className ) { // store className if set jQuery.data( this, "__className__", this.className ); } // toggle whole className this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " "; for ( var i = 0, l = this.length; i < l; i++ ) { if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { return true; } } return false; }, val: function( value ) { if ( !arguments.length ) { var elem = this[0]; if ( elem ) { if ( jQuery.nodeName( elem, "option" ) ) { // attributes.value is undefined in Blackberry 4.7 but // uses .value. See #6932 var val = elem.attributes.value; return !val || val.specified ? elem.value : elem.text; } // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, values = [], options = elem.options, one = elem.type === "select-one"; // Nothing was selected if ( index < 0 ) { return null; } // Loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; // Don't return options that are disabled or in a disabled optgroup if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { // Get the specific value for the option value = jQuery(option).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; } // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { return elem.getAttribute("value") === null ? "on" : elem.value; } // Everything else, we just grab the value return (elem.value || "").replace(rreturn, ""); } return undefined; } var isFunction = jQuery.isFunction(value); return this.each(function(i) { var self = jQuery(this), val = value; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call(this, i, self.val()); } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray(val) ) { val = jQuery.map(val, function (value) { return value == null ? "" : value + ""; }); } if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { this.checked = jQuery.inArray( self.val(), val ) >= 0; } else if ( jQuery.nodeName( this, "select" ) ) { var values = jQuery.makeArray(val); jQuery( "option", this ).each(function() { this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; }); if ( !values.length ) { this.selectedIndex = -1; } } else { this.value = val; } }); } }); jQuery.extend({ attrFn: { val: true, css: true, html: true, text: true, data: true, width: true, height: true, offset: true }, attr: function( elem, name, value, pass ) { // don't set attributes on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } if ( pass && name in jQuery.attrFn ) { return jQuery(elem)[name](value); } var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), // Whether we are setting (or getting) set = value !== undefined; // Try to normalize/fix the name name = notxml && jQuery.props[ name ] || name; // These attributes require special treatment var special = rspecialurl.test( name ); // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( name === "selected" && !jQuery.support.optSelected ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } // If applicable, access the attribute via the DOM 0 way // 'in' checks fail in Blackberry 4.7 #6931 if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { if ( set ) { // We can't allow the type property to be changed (since it causes problems in IE) if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { jQuery.error( "type property can't be changed" ); } if ( value === null ) { if ( elem.nodeType === 1 ) { elem.removeAttribute( name ); } } else { elem[ name ] = value; } } // browsers index elements by id/name on forms, give priority to attributes. if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { return elem.getAttributeNode( name ).nodeValue; } // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ if ( name === "tabIndex" ) { var attributeNode = elem.getAttributeNode( "tabIndex" ); return attributeNode && attributeNode.specified ? attributeNode.value : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : undefined; } return elem[ name ]; } if ( !jQuery.support.style && notxml && name === "style" ) { if ( set ) { elem.style.cssText = "" + value; } return elem.style.cssText; } if ( set ) { // convert the value to a string (all browsers do this but IE) see #1070 elem.setAttribute( name, "" + value ); } // Ensure that missing attributes return undefined // Blackberry 4.7 returns "" from getAttribute #6938 if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { return undefined; } var attr = !jQuery.support.hrefNormalized && notxml && special ? // Some attributes require a special call on IE elem.getAttribute( name, 2 ) : elem.getAttribute( name ); // Non-existent attributes return null, we normalize to undefined return attr === null ? undefined : attr; } }); var rnamespaces = /\.(.*)$/, rformElems = /^(?:textarea|input|select)$/i, rperiod = /\./g, rspace = / /g, rescape = /[^\w\s.|`]/g, fcleanup = function( nm ) { return nm.replace(rescape, "\\$&"); }, focusCounts = { focusin: 0, focusout: 0 }; /* * A number of helper functions used for managing events. * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */ jQuery.event = { // Bind an event to an element // Original by Dean Edwards add: function( elem, types, handler, data ) { if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { elem = window; } if ( handler === false ) { handler = returnFalse; } else if ( !handler ) { // Fixes bug #7229. Fix recommended by jdalton return; } var handleObjIn, handleObj; if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; } // Make sure that the function being executed has a unique ID if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure var elemData = jQuery.data( elem ); // If no elemData is found then we must be trying to bind to one of the // banned noData elements if ( !elemData ) { return; } // Use a key less likely to result in collisions for plain JS objects. // Fixes bug #7150. var eventKey = elem.nodeType ? "events" : "__events__", events = elemData[ eventKey ], eventHandle = elemData.handle; if ( typeof events === "function" ) { // On plain objects events is a fn that holds the the data // which prevents this data from being JSON serialized // the function does not need to be called, it just contains the data eventHandle = events.handle; events = events.events; } else if ( !events ) { if ( !elem.nodeType ) { // On plain objects, create a fn that acts as the holder // of the values to avoid JSON serialization of event data elemData[ eventKey ] = elemData = function(){}; } elemData.events = events = {}; } if ( !eventHandle ) { elemData.handle = eventHandle = function() { // Handle the second event of a trigger and when // an event is called after a page has unloaded return typeof jQuery !== "undefined" && !jQuery.event.triggered ? jQuery.event.handle.apply( eventHandle.elem, arguments ) : undefined; }; } // Add elem as a property of the handle function // This is to prevent a memory leak with non-native events in IE. eventHandle.elem = elem; // Handle multiple events separated by a space // jQuery(...).bind("mouseover mouseout", fn); types = types.split(" "); var type, i = 0, namespaces; while ( (type = types[ i++ ]) ) { handleObj = handleObjIn ? jQuery.extend({}, handleObjIn) : { handler: handler, data: data }; // Namespaced event handlers if ( type.indexOf(".") > -1 ) { namespaces = type.split("."); type = namespaces.shift(); handleObj.namespace = namespaces.slice(0).sort().join("."); } else { namespaces = []; handleObj.namespace = ""; } handleObj.type = type; if ( !handleObj.guid ) { handleObj.guid = handler.guid; } // Get the current list of functions bound to this event var handlers = events[ type ], special = jQuery.event.special[ type ] || {}; // Init the event handler queue if ( !handlers ) { handlers = events[ type ] = []; // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add the function to the element's handler list handlers.push( handleObj ); // Keep track of which events have been used, for global triggering jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, global: {}, // Detach an event or set of events from an element remove: function( elem, types, handler, pos ) { // don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } if ( handler === false ) { handler = returnFalse; } var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, eventKey = elem.nodeType ? "events" : "__events__", elemData = jQuery.data( elem ), events = elemData && elemData[ eventKey ]; if ( !elemData || !events ) { return; } if ( typeof events === "function" ) { elemData = events; events = events.events; } // types is actually an event object here if ( types && types.type ) { handler = types.handler; types = types.type; } // Unbind all events for the element if ( !types || typeof types === "string" && types.charAt(0) === "." ) { types = types || ""; for ( type in events ) { jQuery.event.remove( elem, type + types ); } return; } // Handle multiple events separated by a space // jQuery(...).unbind("mouseover mouseout", fn); types = types.split(" "); while ( (type = types[ i++ ]) ) { origType = type; handleObj = null; all = type.indexOf(".") < 0; namespaces = []; if ( !all ) { // Namespaced event handlers namespaces = type.split("."); type = namespaces.shift(); namespace = new RegExp("(^|\\.)" + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); } eventType = events[ type ]; if ( !eventType ) { continue; } if ( !handler ) { for ( j = 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( all || namespace.test( handleObj.namespace ) ) { jQuery.event.remove( elem, origType, handleObj.handler, j ); eventType.splice( j--, 1 ); } } continue; } special = jQuery.event.special[ type ] || {}; for ( j = pos || 0; j < eventType.length; j++ ) { handleObj = eventType[ j ]; if ( handler.guid === handleObj.guid ) { // remove the given handler for the given type if ( all || namespace.test( handleObj.namespace ) ) { if ( pos == null ) { eventType.splice( j--, 1 ); } if ( special.remove ) { special.remove.call( elem, handleObj ); } } if ( pos != null ) { break; } } } // remove generic event handler if no more handlers exist if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } ret = null; delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { var handle = elemData.handle; if ( handle ) { handle.elem = null; } delete elemData.events; delete elemData.handle; if ( typeof elemData === "function" ) { jQuery.removeData( elem, eventKey ); } else if ( jQuery.isEmptyObject( elemData ) ) { jQuery.removeData( elem ); } } }, // bubbling is internal trigger: function( event, data, elem /*, bubbling */ ) { // Event object or event type var type = event.type || event, bubbling = arguments[3]; if ( !bubbling ) { event = typeof event === "object" ? // jQuery.Event object event[ jQuery.expando ] ? event : // Object literal jQuery.extend( jQuery.Event(type), event ) : // Just the event type (string) jQuery.Event(type); if ( type.indexOf("!") >= 0 ) { event.type = type = type.slice(0, -1); event.exclusive = true; } // Handle a global trigger if ( !elem ) { // Don't bubble custom events when global (to avoid too much overhead) event.stopPropagation(); // Only trigger if we've ever bound an event for it if ( jQuery.event.global[ type ] ) { jQuery.each( jQuery.cache, function() { if ( this.events && this.events[type] ) { jQuery.event.trigger( event, data, this.handle.elem ); } }); } } // Handle triggering a single element // don't do events on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { return undefined; } // Clean up in case it is reused event.result = undefined; event.target = elem; // Clone the incoming data, if any data = jQuery.makeArray( data ); data.unshift( event ); } event.currentTarget = elem; // Trigger the event, it is assumed that "handle" is a function var handle = elem.nodeType ? jQuery.data( elem, "handle" ) : (jQuery.data( elem, "__events__" ) || {}).handle; if ( handle ) { handle.apply( elem, data ); } var parent = elem.parentNode || elem.ownerDocument; // Trigger an inline bound script try { if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { event.result = false; event.preventDefault(); } } // prevent IE from throwing an error for some elements with some event types, see #3533 } catch (inlineError) {} if ( !event.isPropagationStopped() && parent ) { jQuery.event.trigger( event, data, parent, true ); } else if ( !event.isDefaultPrevented() ) { var old, target = event.target, targetType = type.replace( rnamespaces, "" ), isClick = jQuery.nodeName( target, "a" ) && targetType === "click", special = jQuery.event.special[ targetType ] || {}; if ( (!special._default || special._default.call( elem, event ) === false) && !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { try { if ( target[ targetType ] ) { // Make sure that we don't accidentally re-trigger the onFOO events old = target[ "on" + targetType ]; if ( old ) { target[ "on" + targetType ] = null; } jQuery.event.triggered = true; target[ targetType ](); } // prevent IE from throwing an error for some elements with some event types, see #3533 } catch (triggerError) {} if ( old ) { target[ "on" + targetType ] = old; } jQuery.event.triggered = false; } } }, handle: function( event ) { var all, handlers, namespaces, namespace_re, events, namespace_sort = [], args = jQuery.makeArray( arguments ); event = args[0] = jQuery.event.fix( event || window.event ); event.currentTarget = this; // Namespaced event handlers all = event.type.indexOf(".") < 0 && !event.exclusive; if ( !all ) { namespaces = event.type.split("."); event.type = namespaces.shift(); namespace_sort = namespaces.slice(0).sort(); namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); } event.namespace = event.namespace || namespace_sort.join("."); events = jQuery.data(this, this.nodeType ? "events" : "__events__"); if ( typeof events === "function" ) { events = events.events; } handlers = (events || {})[ event.type ]; if ( events && handlers ) { // Clone the handlers to prevent manipulation handlers = handlers.slice(0); for ( var j = 0, l = handlers.length; j < l; j++ ) { var handleObj = handlers[ j ]; // Filter the functions by class if ( all || namespace_re.test( handleObj.namespace ) ) { // Pass in a reference to the handler function itself // So that we can later remove it event.handler = handleObj.handler; event.data = handleObj.data; event.handleObj = handleObj; var ret = handleObj.handler.apply( this, args ); if ( ret !== undefined ) { event.result = ret; if ( ret === false ) { event.preventDefault(); event.stopPropagation(); } } if ( event.isImmediatePropagationStopped() ) { break; } } } } return event.result; }, props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // store a copy of the original event object // and "clone" to set read-only properties var originalEvent = event; event = jQuery.Event( originalEvent ); for ( var i = this.props.length, prop; i; ) { prop = this.props[ --i ]; event[ prop ] = originalEvent[ prop ]; } // Fix target property, if necessary if ( !event.target ) { // Fixes #1925 where srcElement might not be defined either event.target = event.srcElement || document; } // check if target is a textnode (safari) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Add relatedTarget, if necessary if ( !event.relatedTarget && event.fromElement ) { event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; } // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && event.clientX != null ) { var doc = document.documentElement, body = document.body; event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); } // Add which for key events if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { event.which = event.charCode != null ? event.charCode : event.keyCode; } // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) if ( !event.metaKey && event.ctrlKey ) { event.metaKey = event.ctrlKey; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && event.button !== undefined ) { event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); } return event; }, // Deprecated, use jQuery.guid instead guid: 1E8, // Deprecated, use jQuery.proxy instead proxy: jQuery.proxy, special: { ready: { // Make sure the ready event is setup setup: jQuery.bindReady, teardown: jQuery.noop }, live: { add: function( handleObj ) { jQuery.event.add( this, liveConvert( handleObj.origType, handleObj.selector ), jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); }, remove: function( handleObj ) { jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); } }, beforeunload: { setup: function( data, namespaces, eventHandle ) { // We only want to do this special case on windows if ( jQuery.isWindow( this ) ) { this.onbeforeunload = eventHandle; } }, teardown: function( namespaces, eventHandle ) { if ( this.onbeforeunload === eventHandle ) { this.onbeforeunload = null; } } } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { if ( elem.detachEvent ) { elem.detachEvent( "on" + type, handle ); } }; jQuery.Event = function( src ) { // Allow instantiation without the 'new' keyword if ( !this.preventDefault ) { return new jQuery.Event( src ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Event type } else { this.type = src; } // timeStamp is buggy for some events on Firefox(#3843) // So we won't rely on the native value this.timeStamp = jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; function returnFalse() { return false; } function returnTrue() { return true; } // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { preventDefault: function() { this.isDefaultPrevented = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if preventDefault exists run it on the original event if ( e.preventDefault ) { e.preventDefault(); // otherwise set the returnValue property of the original event to false (IE) } else { e.returnValue = false; } }, stopPropagation: function() { this.isPropagationStopped = returnTrue; var e = this.originalEvent; if ( !e ) { return; } // if stopPropagation exists run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // otherwise set the cancelBubble property of the original event to true (IE) e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse }; // Checks if an event happened on an element within another element // Used in jQuery.event.special.mouseenter and mouseleave handlers var withinElement = function( event ) { // Check if mouse(over|out) are still within the same parent element var parent = event.relatedTarget; // Firefox sometimes assigns relatedTarget a XUL element // which we cannot access the parentNode property of try { // Traverse up the tree while ( parent && parent !== this ) { parent = parent.parentNode; } if ( parent !== this ) { // set the correct event type event.type = event.data; // handle event if we actually just moused on to a non sub-element jQuery.event.handle.apply( this, arguments ); } // assuming we've left the element since we most likely mousedover a xul element } catch(e) { } }, // In case of event delegation, we only need to rename the event.type, // liveHandler will take care of the rest. delegate = function( event ) { event.type = event.data; jQuery.event.handle.apply( this, arguments ); }; // Create mouseenter and mouseleave events jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { setup: function( data ) { jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); }, teardown: function( data ) { jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); } }; }); // submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function( data, namespaces ) { if ( this.nodeName.toLowerCase() !== "form" ) { jQuery.event.add(this, "click.specialSubmit", function( e ) { var elem = e.target, type = elem.type; if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { e.liveFired = undefined; return trigger( "submit", this, arguments ); } }); jQuery.event.add(this, "keypress.specialSubmit", function( e ) { var elem = e.target, type = elem.type; if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { e.liveFired = undefined; return trigger( "submit", this, arguments ); } }); } else { return false; } }, teardown: function( namespaces ) { jQuery.event.remove( this, ".specialSubmit" ); } }; } // change delegation, happens here so we have bind. if ( !jQuery.support.changeBubbles ) { var changeFilters, getVal = function( elem ) { var type = elem.type, val = elem.value; if ( type === "radio" || type === "checkbox" ) { val = elem.checked; } else if ( type === "select-multiple" ) { val = elem.selectedIndex > -1 ? jQuery.map( elem.options, function( elem ) { return elem.selected; }).join("-") : ""; } else if ( elem.nodeName.toLowerCase() === "select" ) { val = elem.selectedIndex; } return val; }, testChange = function testChange( e ) { var elem = e.target, data, val; if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { return; } data = jQuery.data( elem, "_change_data" ); val = getVal(elem); // the current data will be also retrieved by beforeactivate if ( e.type !== "focusout" || elem.type !== "radio" ) { jQuery.data( elem, "_change_data", val ); } if ( data === undefined || val === data ) { return; } if ( data != null || val ) { e.type = "change"; e.liveFired = undefined; return jQuery.event.trigger( e, arguments[1], elem ); } }; jQuery.event.special.change = { filters: { focusout: testChange, beforedeactivate: testChange, click: function( e ) { var elem = e.target, type = elem.type; if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { return testChange.call( this, e ); } }, // Change has to be called before submit // Keydown will be called before keypress, which is used in submit-event delegation keydown: function( e ) { var elem = e.target, type = elem.type; if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || type === "select-multiple" ) { return testChange.call( this, e ); } }, // Beforeactivate happens also before the previous element is blurred // with this event you can't trigger a change event, but you can store // information beforeactivate: function( e ) { var elem = e.target; jQuery.data( elem, "_change_data", getVal(elem) ); } }, setup: function( data, namespaces ) { if ( this.type === "file" ) { return false; } for ( var type in changeFilters ) { jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); } return rformElems.test( this.nodeName ); }, teardown: function( namespaces ) { jQuery.event.remove( this, ".specialChange" ); return rformElems.test( this.nodeName ); } }; changeFilters = jQuery.event.special.change.filters; // Handle when the input is .focus()'d changeFilters.focus = changeFilters.beforeactivate; } function trigger( type, elem, args ) { args[0].type = type; return jQuery.event.handle.apply( elem, args ); } // Create "bubbling" focus and blur events if ( document.addEventListener ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { jQuery.event.special[ fix ] = { setup: function() { if ( focusCounts[fix]++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --focusCounts[fix] === 0 ) { document.removeEventListener( orig, handler, true ); } } }; function handler( e ) { e = jQuery.event.fix( e ); e.type = fix; return jQuery.event.trigger( e, null, e.target ); } }); } jQuery.each(["bind", "one"], function( i, name ) { jQuery.fn[ name ] = function( type, data, fn ) { // Handle object literals if ( typeof type === "object" ) { for ( var key in type ) { this[ name ](key, data, type[key], fn); } return this; } if ( jQuery.isFunction( data ) || data === false ) { fn = data; data = undefined; } var handler = name === "one" ? jQuery.proxy( fn, function( event ) { jQuery( this ).unbind( event, handler ); return fn.apply( this, arguments ); }) : fn; if ( type === "unload" && name !== "one" ) { this.one( type, data, fn ); } else { for ( var i = 0, l = this.length; i < l; i++ ) { jQuery.event.add( this[i], type, handler, data ); } } return this; }; }); jQuery.fn.extend({ unbind: function( type, fn ) { // Handle object literals if ( typeof type === "object" && !type.preventDefault ) { for ( var key in type ) { this.unbind(key, type[key]); } } else { for ( var i = 0, l = this.length; i < l; i++ ) { jQuery.event.remove( this[i], type, fn ); } } return this; }, delegate: function( selector, types, data, fn ) { return this.live( types, data, fn, selector ); }, undelegate: function( selector, types, fn ) { if ( arguments.length === 0 ) { return this.unbind( "live" ); } else { return this.die( types, null, fn, selector ); } }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { if ( this[0] ) { var event = jQuery.Event( type ); event.preventDefault(); event.stopPropagation(); jQuery.event.trigger( event, data, this[0] ); return event.result; } }, toggle: function( fn ) { // Save reference to arguments for access in closure var args = arguments, i = 1; // link all the functions, so any of them can unbind this click handler while ( i < args.length ) { jQuery.proxy( fn, args[ i++ ] ); } return this.click( jQuery.proxy( fn, function( event ) { // Figure out which function to execute var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; })); }, hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } }); var liveMap = { focus: "focusin", blur: "focusout", mouseenter: "mouseover", mouseleave: "mouseout" }; jQuery.each(["live", "die"], function( i, name ) { jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { var type, i = 0, match, namespaces, preType, selector = origSelector || this.selector, context = origSelector ? this : jQuery( this.context ); if ( typeof types === "object" && !types.preventDefault ) { for ( var key in types ) { context[ name ]( key, data, types[key], selector ); } return this; } if ( jQuery.isFunction( data ) ) { fn = data; data = undefined; } types = (types || "").split(" "); while ( (type = types[ i++ ]) != null ) { match = rnamespaces.exec( type ); namespaces = ""; if ( match ) { namespaces = match[0]; type = type.replace( rnamespaces, "" ); } if ( type === "hover" ) { types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); continue; } preType = type; if ( type === "focus" || type === "blur" ) { types.push( liveMap[ type ] + namespaces ); type = type + namespaces; } else { type = (liveMap[ type ] || type) + namespaces; } if ( name === "live" ) { // bind live handler for ( var j = 0, l = context.length; j < l; j++ ) { jQuery.event.add( context[j], "live." + liveConvert( type, selector ), { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); } } else { // unbind live handler context.unbind( "live." + liveConvert( type, selector ), fn ); } } return this; }; }); function liveHandler( event ) { var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, elems = [], selectors = [], events = jQuery.data( this, this.nodeType ? "events" : "__events__" ); if ( typeof events === "function" ) { events = events.events; } // Make sure we avoid non-left-click bubbling in Firefox (#3861) if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { return; } if ( event.namespace ) { namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); } event.liveFired = this; var live = events.live.slice(0); for ( j = 0; j < live.length; j++ ) { handleObj = live[j]; if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { selectors.push( handleObj.selector ); } else { live.splice( j--, 1 ); } } match = jQuery( event.target ).closest( selectors, event.currentTarget ); for ( i = 0, l = match.length; i < l; i++ ) { close = match[i]; for ( j = 0; j < live.length; j++ ) { handleObj = live[j]; if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { elem = close.elem; related = null; // Those two events require additional checking if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { event.type = handleObj.preType; related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; } if ( !related || related !== elem ) { elems.push({ elem: elem, handleObj: handleObj, level: close.level }); } } } } for ( i = 0, l = elems.length; i < l; i++ ) { match = elems[i]; if ( maxLevel && match.level > maxLevel ) { break; } event.currentTarget = match.elem; event.data = match.handleObj.data; event.handleObj = match.handleObj; ret = match.handleObj.origHandler.apply( match.elem, arguments ); if ( ret === false || event.isPropagationStopped() ) { maxLevel = match.level; if ( ret === false ) { stop = false; } if ( event.isImmediatePropagationStopped() ) { break; } } } return stop; } function liveConvert( type, selector ) { return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { if ( fn == null ) { fn = data; data = null; } return arguments.length > 0 ? this.bind( name, data, fn ) : this.trigger( name ); }; if ( jQuery.attrFn ) { jQuery.attrFn[ name ] = true; } }); // Prevent memory leaks in IE // Window isn't included so as not to unbind existing unload events // More info: // - http://isaacschlueter.com/2006/10/msie-memory-leaks/ if ( window.attachEvent && !window.addEventListener ) { jQuery(window).bind("unload", function() { for ( var id in jQuery.cache ) { if ( jQuery.cache[ id ].handle ) { // Try/Catch is to handle iframes being unloaded, see #4280 try { jQuery.event.remove( jQuery.cache[ id ].handle.elem ); } catch(e) {} } } }); } /*! * Sizzle CSS Selector Engine - v1.0 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true; // Here we check if the JavaScript engine is using some sort of // optimization where it does not always call our comparision // function. If that is the case, discard the hasDuplicate value. // Thus far that includes Google Chrome. [0, 0].sort(function() { baseHasDuplicate = false; return 0; }); var Sizzle = function( selector, context, results, seed ) { results = results || []; context = context || document; var origContext = context; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var m, set, checkSet, extra, ret, cur, pop, i, prune = true, contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); m = chunker.exec( soFar ); if ( m ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } } while ( m ); if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) { selector += parts.shift(); } set = posProcess( selector, set ); } } } else { // Take a shortcut and set the context if the root selector is an ID // (but not if it'll be faster if the inner selector is an ID) if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray( set ); } else { prune = false; } while ( parts.length ) { cur = parts.pop(); pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { Sizzle.error( cur || selector ); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function( results ) { if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort( sortOrder ); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[ i - 1 ] ) { results.splice( i--, 1 ); } } } } return results; }; Sizzle.matches = function( expr, set ) { return Sizzle( expr, null, null, set ); }; Sizzle.matchesSelector = function( node, expr ) { return Sizzle( expr, null, null, [node] ).length > 0; }; Sizzle.find = function( expr, context, isXML ) { var set; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace(/\\/g, ""); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = context.getElementsByTagName( "*" ); } return { set: set, expr: expr }; }; Sizzle.filter = function( expr, set, inplace, not ) { var match, anyFound, old = expr, result = [], curLoop = set, isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { var found, item, filter = Expr.filter[ type ], left = match[1]; anyFound = false; match.splice(1,1); if ( left.substr( left.length - 1 ) === "\\" ) { continue; } if ( curLoop === result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } // Improper expression if ( expr === old ) { if ( anyFound == null ) { Sizzle.error( expr ); } else { break; } } old = expr; } return curLoop; }; Sizzle.error = function( msg ) { throw "Syntax error, unrecognized expression: " + msg; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function( elem ) { return elem.getAttribute( "href" ); } }, relative: { "+": function(checkSet, part){ var isPartStr = typeof part === "string", isTag = isPartStr && !/\W/.test( part ), isPartStrNotTag = isPartStr && !isTag; if ( isTag ) { part = part.toLowerCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function( checkSet, part ) { var elem, isPartStr = typeof part === "string", i = 0, l = checkSet.length; if ( isPartStr && !/\W/.test( part ) ) { part = part.toLowerCase(); for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; } } } else { for ( ; i < l; i++ ) { elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !/\W/.test(part) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); }, "~": function( checkSet, part, isXML ) { var nodeCheck, doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !/\W/.test( part ) ) { part = part.toLowerCase(); nodeCheck = part; checkFn = dirNodeCheck; } checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); } }, find: { ID: function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }, NAME: function( match, context ) { if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName( match[1] ); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function( match, context ) { return context.getElementsByTagName( match[1] ); } }, preFilter: { CLASS: function( match, curLoop, inplace, result, not, isXML ) { match = " " + match[1].replace(/\\/g, "") + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { if ( !inplace ) { result.push( elem ); } } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function( match ) { return match[1].replace(/\\/g, ""); }, TAG: function( match, curLoop ) { return match[1].toLowerCase(); }, CHILD: function( match ) { if ( match[1] === "nth" ) { // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); // calculate the numbers (first)n+(last) including if they are negative match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } // TODO: Move to normal caching system match[0] = done++; return match; }, ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1].replace(/\\/g, ""); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function( match, curLoop, inplace, result, not ) { if ( match[1] === "not" ) { // If we're dealing with a complex expression, or a simple one if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function( match ) { match.unshift( true ); return match; } }, filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; }, disabled: function( elem ) { return elem.disabled === true; }, checked: function( elem ) { return elem.checked === true; }, selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly elem.parentNode.selectedIndex; return elem.selected === true; }, parent: function( elem ) { return !!elem.firstChild; }, empty: function( elem ) { return !elem.firstChild; }, has: function( elem, i, match ) { return !!Sizzle( match[3], elem ).length; }, header: function( elem ) { return (/h\d/i).test( elem.nodeName ); }, text: function( elem ) { return "text" === elem.type; }, radio: function( elem ) { return "radio" === elem.type; }, checkbox: function( elem ) { return "checkbox" === elem.type; }, file: function( elem ) { return "file" === elem.type; }, password: function( elem ) { return "password" === elem.type; }, submit: function( elem ) { return "submit" === elem.type; }, image: function( elem ) { return "image" === elem.type; }, reset: function( elem ) { return "reset" === elem.type; }, button: function( elem ) { return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; }, input: function( elem ) { return (/input|select|textarea|button/i).test( elem.nodeName ); } }, setFilters: { first: function( elem, i ) { return i === 0; }, last: function( elem, i, match, array ) { return i === array.length - 1; }, even: function( elem, i ) { return i % 2 === 0; }, odd: function( elem, i ) { return i % 2 === 1; }, lt: function( elem, i, match ) { return i < match[3] - 0; }, gt: function( elem, i, match ) { return i > match[3] - 0; }, nth: function( elem, i, match ) { return match[3] - 0 === i; }, eq: function( elem, i, match ) { return match[3] - 0 === i; } }, filter: { PSEUDO: function( elem, match, i, array ) { var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var j = 0, l = not.length; j < l; j++ ) { if ( not[j] === elem ) { return false; } } return true; } else { Sizzle.error( "Syntax error, unrecognized expression: " + name ); } }, CHILD: function( elem, match ) { var type = match[1], node = elem; switch ( type ) { case "only": case "first": while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) { return false; } } if ( type === "first" ) { return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) { return false; } } return true; case "nth": var first = match[2], last = match[3]; if ( first === 1 && last === 0 ) { return true; } var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first === 0 ) { return diff === 0; } else { return ( diff % first === 0 && diff / first >= 0 ); } } }, ID: function( elem, match ) { return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function( elem, match ) { var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value !== check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function( elem, match, i, array ) { var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS, fescape = function(all, num){ return "\\" + (num - 0 + 1); }; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); } var makeArray = function( array, results ) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; // Perform a simple check to determine if the browser is capable of // converting a NodeList to an array using builtin methods. // Also verifies that the returned array holds DOM nodes // (which is not the case in the Blackberry browser) try { Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; // Provide a fallback method if it does not work } catch( e ) { makeArray = function( array, results ) { var i = 0, ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( ; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder, siblingCheck; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { return a.compareDocumentPosition ? -1 : 1; } return a.compareDocumentPosition(b) & 4 ? -1 : 1; }; } else { sortOrder = function( a, b ) { var al, bl, ap = [], bp = [], aup = a.parentNode, bup = b.parentNode, cur = aup; // The nodes are identical, we can exit early if ( a === b ) { hasDuplicate = true; return 0; // If the nodes are siblings (or identical) we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); // If no parents were found then the nodes are disconnected } else if ( !aup ) { return -1; } else if ( !bup ) { return 1; } // Otherwise they're somewhere else in the tree so we need // to build up a full list of the parentNodes for comparison while ( cur ) { ap.unshift( cur ); cur = cur.parentNode; } cur = bup; while ( cur ) { bp.unshift( cur ); cur = cur.parentNode; } al = ap.length; bl = bp.length; // Start walking down the tree looking for a discrepancy for ( var i = 0; i < al && i < bl; i++ ) { if ( ap[i] !== bp[i] ) { return siblingCheck( ap[i], bp[i] ); } } // We ended someplace up the tree so do a sibling check return i === al ? siblingCheck( a, bp[i], -1 ) : siblingCheck( ap[i], b, 1 ); }; siblingCheck = function( a, b, ret ) { if ( a === b ) { return ret; } var cur = a.nextSibling; while ( cur ) { if ( cur === b ) { return -1; } cur = cur.nextSibling; } return 1; }; } // Utility function for retreiving the text value of an array of DOM nodes Sizzle.getText = function( elems ) { var ret = "", elem; for ( var i = 0; elems[i]; i++ ) { elem = elems[i]; // Get the text from text nodes and CDATA nodes if ( elem.nodeType === 3 || elem.nodeType === 4 ) { ret += elem.nodeValue; // Traverse everything else, except comment nodes } else if ( elem.nodeType !== 8 ) { ret += Sizzle.getText( elem.childNodes ); } } return ret; }; // Check to see if the browser returns elements by name when // querying by getElementById (and provide a workaround) (function(){ // We're going to inject a fake input element with a specified name var form = document.createElement("div"), id = "script" + (new Date()).getTime(), root = document.documentElement; form.innerHTML = "<a name='" + id + "'/>"; // Inject it into the root element, check its status, and remove it quickly root.insertBefore( form, root.firstChild ); // The workaround has to do additional checks after a getElementById // Which slows things down for other browsers (hence the branching) if ( document.getElementById( id ) ) { Expr.find.ID = function( match, context, isXML ) { if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function( elem, match ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); // release memory in IE root = form = null; })(); (function(){ // Check to see if the browser returns only elements // when doing getElementsByTagName("*") // Create a fake element var div = document.createElement("div"); div.appendChild( document.createComment("") ); // Make sure no comments are found if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function( match, context ) { var results = context.getElementsByTagName( match[1] ); // Filter out possible comments if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } // Check to see if an attribute returns normalized href attributes div.innerHTML = "<a href='#'></a>"; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function( elem ) { return elem.getAttribute( "href", 2 ); }; } // release memory in IE div = null; })(); if ( document.querySelectorAll ) { (function(){ var oldSizzle = Sizzle, div = document.createElement("div"), id = "__sizzle__"; div.innerHTML = "<p class='TEST'></p>"; // Safari can't handle uppercase or unicode characters when // in quirks mode. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function( query, context, extra, seed ) { context = context || document; // Make sure that attribute selectors are quoted query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); // Only use querySelectorAll on non-XML documents // (ID selectors don't work in non-HTML documents) if ( !seed && !Sizzle.isXML(context) ) { if ( context.nodeType === 9 ) { try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { var old = context.getAttribute( "id" ), nid = old || id; if ( !old ) { context.setAttribute( "id", nid ); } try { return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra ); } catch(pseudoError) { } finally { if ( !old ) { context.removeAttribute( "id" ); } } } } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } // release memory in IE div = null; })(); } (function(){ var html = document.documentElement, matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, pseudoWorks = false; try { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); } catch( pseudoError ) { pseudoWorks = true; } if ( matches ) { Sizzle.matchesSelector = function( node, expr ) { // Make sure that attribute selectors are quoted expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { return matches.call( node, expr ); } } catch(e) {} } return Sizzle(expr, null, null, [node]).length > 0; }; } })(); (function(){ var div = document.createElement("div"); div.innerHTML = "<div class='test e'></div><div class='test'></div>"; // Opera can't find a second classname (in 9.6) // Also, make sure that getElementsByClassName actually exists if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { return; } // Safari caches class attributes, doesn't catch changes (in 3.2) div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) { return; } Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; // release memory in IE div = null; })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName.toLowerCase() === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var match = false; elem = elem[dir]; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } if ( document.documentElement.contains ) { Sizzle.contains = function( a, b ) { return a !== b && (a.contains ? a.contains(b) : true); }; } else if ( document.documentElement.compareDocumentPosition ) { Sizzle.contains = function( a, b ) { return !!(a.compareDocumentPosition(b) & 16); }; } else { Sizzle.contains = function() { return false; }; } Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; var posProcess = function( selector, context ) { var match, tmpSet = [], later = "", root = context.nodeType ? [context] : context; // Position selectors must be done after the filter // And so must :not(positional) so we move all PSEUDOs to the end while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); }; // EXPOSE jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.filters; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })(); var runtil = /Until$/, rparentsprev = /^(?:parents|prevUntil|prevAll)/, // Note: This RegExp should be improved, or likely pulled from Sizzle rmultiselector = /,/, isSimple = /^.[^:#\[\.,]*$/, slice = Array.prototype.slice, POS = jQuery.expr.match.POS; jQuery.fn.extend({ find: function( selector ) { var ret = this.pushStack( "", "find", selector ), length = 0; for ( var i = 0, l = this.length; i < l; i++ ) { length = ret.length; jQuery.find( selector, this[i], ret ); if ( i > 0 ) { // Make sure that the results are unique for ( var n = length; n < ret.length; n++ ) { for ( var r = 0; r < length; r++ ) { if ( ret[r] === ret[n] ) { ret.splice(n--, 1); break; } } } } } return ret; }, has: function( target ) { var targets = jQuery( target ); return this.filter(function() { for ( var i = 0, l = targets.length; i < l; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector, false), "not", selector); }, filter: function( selector ) { return this.pushStack( winnow(this, selector, true), "filter", selector ); }, is: function( selector ) { return !!selector && jQuery.filter( selector, this ).length > 0; }, closest: function( selectors, context ) { var ret = [], i, l, cur = this[0]; if ( jQuery.isArray( selectors ) ) { var match, selector, matches = {}, level = 1; if ( cur && selectors.length ) { for ( i = 0, l = selectors.length; i < l; i++ ) { selector = selectors[i]; if ( !matches[selector] ) { matches[selector] = jQuery.expr.match.POS.test( selector ) ? jQuery( selector, context || this.context ) : selector; } } while ( cur && cur.ownerDocument && cur !== context ) { for ( selector in matches ) { match = matches[selector]; if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { ret.push({ selector: selector, elem: cur, level: level }); } } cur = cur.parentNode; level++; } } return ret; } var pos = POS.test( selectors ) ? jQuery( selectors, context || this.context ) : null; for ( i = 0, l = this.length; i < l; i++ ) { cur = this[i]; while ( cur ) { if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { ret.push( cur ); break; } else { cur = cur.parentNode; if ( !cur || !cur.ownerDocument || cur === context ) { break; } } } } ret = ret.length > 1 ? jQuery.unique(ret) : ret; return this.pushStack( ret, "closest", selectors ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { if ( !elem || typeof elem === "string" ) { return jQuery.inArray( this[0], // If it receives a string, the selector is used // If it receives nothing, the siblings are used elem ? jQuery( elem ) : this.parent().children() ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context || this.context ) : jQuery.makeArray( selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? all : jQuery.unique( all ) ); }, andSelf: function() { return this.add( this.prevObject ); } }); // A painfully simple check to see if an element is disconnected // from a document (should be improved, where feasible). function isDisconnected( node ) { return !node || !node.parentNode || node.parentNode.nodeType === 11; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return jQuery.nth( elem, 2, "nextSibling" ); }, prev: function( elem ) { return jQuery.nth( elem, 2, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( elem.parentNode.firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.makeArray( elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( !runtil.test( name ) ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } ret = this.length > 1 ? jQuery.unique( ret ) : ret; if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { ret = ret.reverse(); } return this.pushStack( ret, name, slice.call(arguments).join(",") ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 ? jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : jQuery.find.matches(expr, elems); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, nth: function( cur, result, dir, elem ) { result = result || 1; var num = 0; for ( ; cur; cur = cur[dir] ) { if ( cur.nodeType === 1 && ++num === result ) { break; } } return cur; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, keep ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep(elements, function( elem, i ) { var retVal = !!qualifier.call( elem, i, elem ); return retVal === keep; }); } else if ( qualifier.nodeType ) { return jQuery.grep(elements, function( elem, i ) { return (elem === qualifier) === keep; }); } else if ( typeof qualifier === "string" ) { var filtered = jQuery.grep(elements, function( elem ) { return elem.nodeType === 1; }); if ( isSimple.test( qualifier ) ) { return jQuery.filter(qualifier, filtered, !keep); } else { qualifier = jQuery.filter( qualifier, filtered ); } } return jQuery.grep(elements, function( elem, i ) { return (jQuery.inArray( elem, qualifier ) >= 0) === keep; }); } var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnocache = /<(?:script|object|embed|option|style)/i, // checked="checked" or checked (html5) rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, raction = /\=([^="'>\s]+\/)>/g, wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], area: [ 1, "<map>", "</map>" ], _default: [ 0, "", "" ] }; wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // IE can't serialize <link> and <script> tags normally if ( !jQuery.support.htmlSerialize ) { wrapMap._default = [ 1, "div<div>", "</div>" ]; } jQuery.fn.extend({ text: function( text ) { if ( jQuery.isFunction(text) ) { return this.each(function(i) { var self = jQuery( this ); self.text( text.call(this, i, self.text()) ); }); } if ( typeof text !== "object" && text !== undefined ) { return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); } return jQuery.text( this ); }, wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append(this); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { return this.each(function() { jQuery( this ).wrapAll( html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); }, append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.appendChild( elem ); } }); }, prepend: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 ) { this.insertBefore( elem, this.firstChild ); } }); }, before: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this ); }); } else if ( arguments.length ) { var set = jQuery(arguments[0]); set.push.apply( set, this.toArray() ); return this.pushStack( set, "before", arguments ); } }, after: function() { if ( this[0] && this[0].parentNode ) { return this.domManip(arguments, false, function( elem ) { this.parentNode.insertBefore( elem, this.nextSibling ); }); } else if ( arguments.length ) { var set = this.pushStack( this, "after", arguments ); set.push.apply( set, jQuery(arguments[0]).toArray() ); return set; } }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { if ( !selector || jQuery.filter( selector, [ elem ] ).length ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); jQuery.cleanData( [ elem ] ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } } return this; }, empty: function() { for ( var i = 0, elem; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( elem.getElementsByTagName("*") ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } } return this; }, clone: function( events ) { // Do the clone var ret = this.map(function() { if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { // IE copies events bound via attachEvent when // using cloneNode. Calling detachEvent on the // clone will also remove the events from the orignal // In order to get around this, we use innerHTML. // Unfortunately, this means some modifications to // attributes in IE that are actually only stored // as properties will not be copied (such as the // the name attribute on an input). var html = this.outerHTML, ownerDocument = this.ownerDocument; if ( !html ) { var div = ownerDocument.createElement("div"); div.appendChild( this.cloneNode(true) ); html = div.innerHTML; } return jQuery.clean([html.replace(rinlinejQuery, "") // Handle the case in IE 8 where action=/test/> self-closes a tag .replace(raction, '="$1">') .replace(rleadingWhitespace, "")], ownerDocument)[0]; } else { return this.cloneNode(true); } }); // Copy the events from the original to the clone if ( events === true ) { cloneCopyEvent( this, ret ); cloneCopyEvent( this.find("*"), ret.find("*") ); } // Return the cloned set return ret; }, html: function( value ) { if ( value === undefined ) { return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(rinlinejQuery, "") : null; // See if we can take a shortcut and just use innerHTML } else if ( typeof value === "string" && !rnocache.test( value ) && (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) && !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) { value = value.replace(rxhtmlTag, "<$1></$2>"); try { for ( var i = 0, l = this.length; i < l; i++ ) { // Remove element nodes and prevent memory leaks if ( this[i].nodeType === 1 ) { jQuery.cleanData( this[i].getElementsByTagName("*") ); this[i].innerHTML = value; } } // If using innerHTML throws an exception, use the fallback method } catch(e) { this.empty().append( value ); } } else if ( jQuery.isFunction( value ) ) { this.each(function(i){ var self = jQuery( this ); self.html( value.call(this, i, self.html()) ); }); } else { this.empty().append( value ); } return this; }, replaceWith: function( value ) { if ( this[0] && this[0].parentNode ) { // Make sure that the elements are removed from the DOM before they are inserted // this can help fix replacing a parent with child elements if ( jQuery.isFunction( value ) ) { return this.each(function(i) { var self = jQuery(this), old = self.html(); self.replaceWith( value.call( this, i, old ) ); }); } if ( typeof value !== "string" ) { value = jQuery( value ).detach(); } return this.each(function() { var next = this.nextSibling, parent = this.parentNode; jQuery( this ).remove(); if ( next ) { jQuery(next).before( value ); } else { jQuery(parent).append( value ); } }); } else { return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ); } }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, table, callback ) { var results, first, fragment, parent, value = args[0], scripts = []; // We can't cloneNode fragments that contain checked, in WebKit if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) { return this.each(function() { jQuery(this).domManip( args, table, callback, true ); }); } if ( jQuery.isFunction(value) ) { return this.each(function(i) { var self = jQuery(this); args[0] = value.call(this, i, table ? self.html() : undefined); self.domManip( args, table, callback ); }); } if ( this[0] ) { parent = value && value.parentNode; // If we're in a fragment, just use that instead of building a new one if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) { results = { fragment: parent }; } else { results = jQuery.buildFragment( args, this, scripts ); } fragment = results.fragment; if ( fragment.childNodes.length === 1 ) { first = fragment = fragment.firstChild; } else { first = fragment.firstChild; } if ( first ) { table = table && jQuery.nodeName( first, "tr" ); for ( var i = 0, l = this.length; i < l; i++ ) { callback.call( table ? root(this[i], first) : this[i], i > 0 || results.cacheable || this.length > 1 ? fragment.cloneNode(true) : fragment ); } } if ( scripts.length ) { jQuery.each( scripts, evalScript ); } } return this; } }); function root( elem, cur ) { return jQuery.nodeName(elem, "table") ? (elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem; } function cloneCopyEvent(orig, ret) { var i = 0; ret.each(function() { if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) { return; } var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( var type in events ) { for ( var handler in events[ type ] ) { jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); } } } }); } jQuery.buildFragment = function( args, nodes, scripts ) { var fragment, cacheable, cacheresults, doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document); // Only cache "small" (1/2 KB) strings that are associated with the main document // Cloning options loses the selected state, so don't cache them // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) { cacheable = true; cacheresults = jQuery.fragments[ args[0] ]; if ( cacheresults ) { if ( cacheresults !== 1 ) { fragment = cacheresults; } } } if ( !fragment ) { fragment = doc.createDocumentFragment(); jQuery.clean( args, doc, fragment, scripts ); } if ( cacheable ) { jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1; } return { fragment: fragment, cacheable: cacheable }; }; jQuery.fragments = {}; jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var ret = [], insert = jQuery( selector ), parent = this.length === 1 && this[0].parentNode; if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) { insert[ original ]( this[0] ); return this; } else { for ( var i = 0, l = insert.length; i < l; i++ ) { var elems = (i > 0 ? this.clone(true) : this).get(); jQuery( insert[i] )[ original ]( elems ); ret = ret.concat( elems ); } return this.pushStack( ret, name, insert.selector ); } }; }); jQuery.extend({ clean: function( elems, context, fragment, scripts ) { context = context || document; // !context.createElement fails in IE with an error but returns typeof 'object' if ( typeof context.createElement === "undefined" ) { context = context.ownerDocument || context[0] && context[0].ownerDocument || document; } var ret = []; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( typeof elem === "number" ) { elem += ""; } if ( !elem ) { continue; } // Convert html string into DOM nodes if ( typeof elem === "string" && !rhtml.test( elem ) ) { elem = context.createTextNode( elem ); } else if ( typeof elem === "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(rxhtmlTag, "<$1></$2>"); // Trim whitespace, otherwise indexOf won't work as expected var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(), wrap = wrapMap[ tag ] || wrapMap._default, depth = wrap[0], div = context.createElement("div"); // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + elem + wrap[2]; // Move to the right depth while ( depth-- ) { div = div.lastChild; } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> var hasBody = rtbody.test(elem), tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !hasBody ? div.childNodes : []; for ( var j = tbody.length - 1; j >= 0 ; --j ) { if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) { tbody[ j ].parentNode.removeChild( tbody[ j ] ); } } } // IE completely kills leading whitespace when innerHTML is used if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild ); } elem = div.childNodes; } if ( elem.nodeType ) { ret.push( elem ); } else { ret = jQuery.merge( ret, elem ); } } if ( fragment ) { for ( i = 0; ret[i]; i++ ) { if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); } else { if ( ret[i].nodeType === 1 ) { ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); } fragment.appendChild( ret[i] ); } } } return ret; }, cleanData: function( elems ) { var data, id, cache = jQuery.cache, special = jQuery.event.special, deleteExpando = jQuery.support.deleteExpando; for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { continue; } id = elem[ jQuery.expando ]; if ( id ) { data = cache[ id ]; if ( data && data.events ) { for ( var type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); } else { jQuery.removeEvent( elem, type, data.handle ); } } } if ( deleteExpando ) { delete elem[ jQuery.expando ]; } else if ( elem.removeAttribute ) { elem.removeAttribute( jQuery.expando ); } delete cache[ id ]; } } } }); function evalScript( i, elem ) { if ( elem.src ) { jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); } else { jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); } if ( elem.parentNode ) { elem.parentNode.removeChild( elem ); } } var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity=([^)]*)/, rdashAlpha = /-([a-z])/ig, rupper = /([A-Z])/g, rnumpx = /^-?\d+(?:px)?$/i, rnum = /^-?\d/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssWidth = [ "Left", "Right" ], cssHeight = [ "Top", "Bottom" ], curCSS, getComputedStyle, currentStyle, fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn.css = function( name, value ) { // Setting 'undefined' is a no-op if ( arguments.length === 2 && value === undefined ) { return this; } return jQuery.access( this, name, value, true, function( elem, name, value ) { return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }); }; jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity", "opacity" ); return ret === "" ? "1" : ret; } else { return elem.style.opacity; } } } }, // Exclude the following css properties to add px cssNumber: { "zIndex": true, "fontWeight": true, "opacity": true, "zoom": true, "lineHeight": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, origName = jQuery.camelCase( name ), style = elem.style, hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; // Check if we're setting a value if ( value !== undefined ) { // Make sure that NaN and null values aren't set. See: #7116 if ( typeof value === "number" && isNaN( value ) || value == null ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra ) { // Make sure that we're working with the right name var ret, origName = jQuery.camelCase( name ), hooks = jQuery.cssHooks[ origName ]; name = jQuery.cssProps[ origName ] || origName; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) { return ret; // Otherwise, if a way to get the computed value exists, use that } else if ( curCSS ) { return curCSS( elem, name, origName ); } }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { var old = {}; // Remember the old values, and insert the new ones for ( var name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } callback.call( elem ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } }, camelCase: function( string ) { return string.replace( rdashAlpha, fcamelCase ); } }); // DEPRECATED, Use jQuery.css() instead jQuery.curCSS = jQuery.css; jQuery.each(["height", "width"], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { var val; if ( computed ) { if ( elem.offsetWidth !== 0 ) { val = getWH( elem, name, extra ); } else { jQuery.swap( elem, cssShow, function() { val = getWH( elem, name, extra ); }); } if ( val <= 0 ) { val = curCSS( elem, name, name ); if ( val === "0px" && currentStyle ) { val = currentStyle( elem, name, name ); } if ( val != null ) { // Should return "auto" instead of 0, use 0 for // temporary backwards-compat return val === "" || val === "auto" ? "0px" : val; } } if ( val < 0 || val == null ) { val = elem.style[ name ]; // Should return "auto" instead of 0, use 0 for // temporary backwards-compat return val === "" || val === "auto" ? "0px" : val; } return typeof val === "string" ? val : val + "px"; } }, set: function( elem, value ) { if ( rnumpx.test( value ) ) { // ignore negative width and height values #1599 value = parseFloat(value); if ( value >= 0 ) { return value + "px"; } } else { return value; } } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ? (parseFloat(RegExp.$1) / 100) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // Set the alpha filter to set the opacity var opacity = jQuery.isNaN(value) ? "" : "alpha(opacity=" + value * 100 + ")", filter = style.filter || ""; style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : style.filter + ' ' + opacity; } }; } if ( document.defaultView && document.defaultView.getComputedStyle ) { getComputedStyle = function( elem, newName, name ) { var ret, defaultView, computedStyle; name = name.replace( rupper, "-$1" ).toLowerCase(); if ( !(defaultView = elem.ownerDocument.defaultView) ) { return undefined; } if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) { ret = computedStyle.getPropertyValue( name ); if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { ret = jQuery.style( elem, name ); } } return ret; }; } if ( document.documentElement.currentStyle ) { currentStyle = function( elem, name ) { var left, rsLeft, ret = elem.currentStyle && elem.currentStyle[ name ], style = elem.style; // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( !rnumpx.test( ret ) && rnum.test( ret ) ) { // Remember the original values left = style.left; rsLeft = elem.runtimeStyle.left; // Put in the new values to get a computed value out elem.runtimeStyle.left = elem.currentStyle.left; style.left = name === "fontSize" ? "1em" : (ret || 0); ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; elem.runtimeStyle.left = rsLeft; } return ret === "" ? "auto" : ret; }; } curCSS = getComputedStyle || currentStyle; function getWH( elem, name, extra ) { var which = name === "width" ? cssWidth : cssHeight, val = name === "width" ? elem.offsetWidth : elem.offsetHeight; if ( extra === "border" ) { return val; } jQuery.each( which, function() { if ( !extra ) { val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0; } if ( extra === "margin" ) { val += parseFloat(jQuery.css( elem, "margin" + this )) || 0; } else { val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0; } }); return val; } if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { var width = elem.offsetWidth, height = elem.offsetHeight; return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } var jsc = jQuery.now(), rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, rselectTextarea = /^(?:select|textarea)/i, rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, rnoContent = /^(?:GET|HEAD)$/, rbracket = /\[\]$/, jsre = /\=\?(&|$)/, rquery = /\?/, rts = /([?&])_=[^&]*/, rurl = /^(\w+:)?\/\/([^\/?#]+)/, r20 = /%20/g, rhash = /#.*$/, // Keep a copy of the old load method _load = jQuery.fn.load; jQuery.fn.extend({ load: function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); // Don't do a request if no elements are being requested } else if ( !this.length ) { return this; } var off = url.indexOf(" "); if ( off >= 0 ) { var selector = url.slice(off, url.length); url = url.slice(0, off); } // Default to a GET request var type = "GET"; // If the second parameter was provided if ( params ) { // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = null; // Otherwise, build a param string } else if ( typeof params === "object" ) { params = jQuery.param( params, jQuery.ajaxSettings.traditional ); type = "POST"; } } var self = this; // Request the remote document jQuery.ajax({ url: url, type: type, dataType: "html", data: params, complete: function( res, status ) { // If successful, inject the HTML into all the matched elements if ( status === "success" || status === "notmodified" ) { // See if a selector was specified self.html( selector ? // Create a dummy div to hold the results jQuery("<div>") // inject the contents of the document in, removing the scripts // to avoid any 'Permission Denied' errors in IE .append(res.responseText.replace(rscript, "")) // Locate the specified elements .find(selector) : // If not, just inject the full result res.responseText ); } if ( callback ) { self.each( callback, [res.responseText, status, res] ); } } }); return this; }, serialize: function() { return jQuery.param(this.serializeArray()); }, serializeArray: function() { return this.map(function() { return this.elements ? jQuery.makeArray(this.elements) : this; }) .filter(function() { return this.name && !this.disabled && (this.checked || rselectTextarea.test(this.nodeName) || rinput.test(this.type)); }) .map(function( i, elem ) { var val = jQuery(this).val(); return val == null ? null : jQuery.isArray(val) ? jQuery.map( val, function( val, i ) { return { name: elem.name, value: val }; }) : { name: elem.name, value: val }; }).get(); } }); // Attach a bunch of functions for handling common AJAX events jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) { jQuery.fn[o] = function( f ) { return this.bind(o, f); }; }); jQuery.extend({ get: function( url, data, callback, type ) { // shift arguments if data argument was omited if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = null; } return jQuery.ajax({ type: "GET", url: url, data: data, success: callback, dataType: type }); }, getScript: function( url, callback ) { return jQuery.get(url, null, callback, "script"); }, getJSON: function( url, data, callback ) { return jQuery.get(url, data, callback, "json"); }, post: function( url, data, callback, type ) { // shift arguments if data argument was omited if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = {}; } return jQuery.ajax({ type: "POST", url: url, data: data, success: callback, dataType: type }); }, ajaxSetup: function( settings ) { jQuery.extend( jQuery.ajaxSettings, settings ); }, ajaxSettings: { url: location.href, global: true, type: "GET", contentType: "application/x-www-form-urlencoded", processData: true, async: true, /* timeout: 0, data: null, username: null, password: null, traditional: false, */ // This function can be overriden by calling jQuery.ajaxSetup xhr: function() { return new window.XMLHttpRequest(); }, accepts: { xml: "application/xml, text/xml", html: "text/html", script: "text/javascript, application/javascript", json: "application/json, text/javascript", text: "text/plain", _default: "*/*" } }, ajax: function( origSettings ) { var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings), jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type); s.url = s.url.replace( rhash, "" ); // Use original (not extended) context object if it was provided s.context = origSettings && origSettings.context != null ? origSettings.context : s; // convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Handle JSONP Parameter Callbacks if ( s.dataType === "jsonp" ) { if ( type === "GET" ) { if ( !jsre.test( s.url ) ) { s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?"; } } else if ( !s.data || !jsre.test(s.data) ) { s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?"; } s.dataType = "json"; } // Build temporary JSONP function if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) { jsonp = s.jsonpCallback || ("jsonp" + jsc++); // Replace the =? sequence both in the query string and the data if ( s.data ) { s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1"); } s.url = s.url.replace(jsre, "=" + jsonp + "$1"); // We need to make sure // that a JSONP style response is executed properly s.dataType = "script"; // Handle JSONP-style loading var customJsonp = window[ jsonp ]; window[ jsonp ] = function( tmp ) { if ( jQuery.isFunction( customJsonp ) ) { customJsonp( tmp ); } else { // Garbage collect window[ jsonp ] = undefined; try { delete window[ jsonp ]; } catch( jsonpError ) {} } data = tmp; jQuery.handleSuccess( s, xhr, status, data ); jQuery.handleComplete( s, xhr, status, data ); if ( head ) { head.removeChild( script ); } }; } if ( s.dataType === "script" && s.cache === null ) { s.cache = false; } if ( s.cache === false && noContent ) { var ts = jQuery.now(); // try replacing _= if it is there var ret = s.url.replace(rts, "$1_=" + ts); // if nothing was replaced, add timestamp to the end s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : ""); } // If data is available, append data to url for GET/HEAD requests if ( s.data && noContent ) { s.url += (rquery.test(s.url) ? "&" : "?") + s.data; } // Watch for a new set of requests if ( s.global && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // Matches an absolute URL, and saves the domain var parts = rurl.exec( s.url ), remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host); // If we're requesting a remote document // and trying to load JSON or Script with a GET if ( s.dataType === "script" && type === "GET" && remote ) { var head = document.getElementsByTagName("head")[0] || document.documentElement; var script = document.createElement("script"); if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Handle Script loading if ( !jsonp ) { var done = false; // Attach handlers for all browsers script.onload = script.onreadystatechange = function() { if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) { done = true; jQuery.handleSuccess( s, xhr, status, data ); jQuery.handleComplete( s, xhr, status, data ); // Handle memory leak in IE script.onload = script.onreadystatechange = null; if ( head && script.parentNode ) { head.removeChild( script ); } } }; } // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709 and #4378). head.insertBefore( script, head.firstChild ); // We handle everything using the script element injection return undefined; } var requestDone = false; // Create the request object var xhr = s.xhr(); if ( !xhr ) { return; } // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open(type, s.url, s.async, s.username, s.password); } else { xhr.open(type, s.url, s.async); } // Need an extra try/catch for cross domain requests in Firefox 3 try { // Set content-type if data specified and content-body is valid for this type if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) { xhr.setRequestHeader("Content-Type", s.contentType); } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[s.url] ) { xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]); } if ( jQuery.etag[s.url] ) { xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]); } } // Set header so the called script knows that it's an XMLHttpRequest // Only send the header if it's not a remote XHR if ( !remote ) { xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); } // Set the Accepts header for the server, depending on the dataType xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ? s.accepts[ s.dataType ] + ", */*; q=0.01" : s.accepts._default ); } catch( headerError ) {} // Allow custom headers/mimetypes and early abort if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) { // Handle the global AJAX counter if ( s.global && jQuery.active-- === 1 ) { jQuery.event.trigger( "ajaxStop" ); } // close opended socket xhr.abort(); return false; } if ( s.global ) { jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] ); } // Wait for a response to come back var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) { // The request was aborted if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) { // Opera doesn't call onreadystatechange before this point // so we simulate the call if ( !requestDone ) { jQuery.handleComplete( s, xhr, status, data ); } requestDone = true; if ( xhr ) { xhr.onreadystatechange = jQuery.noop; } // The transfer is complete and the data is available, or the request timed out } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) { requestDone = true; xhr.onreadystatechange = jQuery.noop; status = isTimeout === "timeout" ? "timeout" : !jQuery.httpSuccess( xhr ) ? "error" : s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : "success"; var errMsg; if ( status === "success" ) { // Watch for, and catch, XML document parse errors try { // process the data (runs the xml through httpData regardless of callback) data = jQuery.httpData( xhr, s.dataType, s ); } catch( parserError ) { status = "parsererror"; errMsg = parserError; } } // Make sure that the request was successful or notmodified if ( status === "success" || status === "notmodified" ) { // JSONP handles its own success callback if ( !jsonp ) { jQuery.handleSuccess( s, xhr, status, data ); } } else { jQuery.handleError( s, xhr, status, errMsg ); } // Fire the complete handlers if ( !jsonp ) { jQuery.handleComplete( s, xhr, status, data ); } if ( isTimeout === "timeout" ) { xhr.abort(); } // Stop memory leaks if ( s.async ) { xhr = null; } } }; // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK) // Opera doesn't fire onreadystatechange at all on abort try { var oldAbort = xhr.abort; xhr.abort = function() { if ( xhr ) { // oldAbort has no call property in IE7 so // just do it this way, which works in all // browsers Function.prototype.call.call( oldAbort, xhr ); } onreadystatechange( "abort" ); }; } catch( abortError ) {} // Timeout checker if ( s.async && s.timeout > 0 ) { setTimeout(function() { // Check to see if the request is still happening if ( xhr && !requestDone ) { onreadystatechange( "timeout" ); } }, s.timeout); } // Send the data try { xhr.send( noContent || s.data == null ? null : s.data ); } catch( sendError ) { jQuery.handleError( s, xhr, null, sendError ); // Fire the complete handlers jQuery.handleComplete( s, xhr, status, data ); } // firefox 1.5 doesn't fire statechange for sync requests if ( !s.async ) { onreadystatechange(); } // return XMLHttpRequest to allow aborting the request etc. return xhr; }, // Serialize an array of form elements or a set of // key/values into a query string param: function( a, traditional ) { var s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction(value) ? value() : value; s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray(a) || a.jquery ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( var prefix in a ) { buildParams( prefix, a[prefix], traditional, add ); } } // Return the resulting serialization return s.join("&").replace(r20, "+"); } }); function buildParams( prefix, obj, traditional, add ) { if ( jQuery.isArray(obj) && obj.length ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // If array item is non-scalar (array or object), encode its // numeric index to resolve deserialization ambiguity issues. // Note that rack (as of 1.0.0) can't currently deserialize // nested arrays properly, and attempting to do so may cause // a server error. Possible fixes are to modify rack's // deserialization algorithm or to provide an option or flag // to force array serialization to be shallow. buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && obj != null && typeof obj === "object" ) { if ( jQuery.isEmptyObject( obj ) ) { add( prefix, "" ); // Serialize object item. } else { jQuery.each( obj, function( k, v ) { buildParams( prefix + "[" + k + "]", v, traditional, add ); }); } } else { // Serialize scalar item. add( prefix, obj ); } } // This is still on the jQuery object... for now // Want to move this to jQuery.ajax some day jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, handleError: function( s, xhr, status, e ) { // If a local callback was specified, fire it if ( s.error ) { s.error.call( s.context, xhr, status, e ); } // Fire the global callback if ( s.global ) { jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] ); } }, handleSuccess: function( s, xhr, status, data ) { // If a local callback was specified, fire it and pass it the data if ( s.success ) { s.success.call( s.context, data, status, xhr ); } // Fire the global callback if ( s.global ) { jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] ); } }, handleComplete: function( s, xhr, status ) { // Process result if ( s.complete ) { s.complete.call( s.context, xhr, status ); } // The request was completed if ( s.global ) { jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] ); } // Handle the global AJAX counter if ( s.global && jQuery.active-- === 1 ) { jQuery.event.trigger( "ajaxStop" ); } }, triggerGlobal: function( s, type, args ) { (s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args); }, // Determines if an XMLHttpRequest was successful or not httpSuccess: function( xhr ) { try { // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 return !xhr.status && location.protocol === "file:" || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304 || xhr.status === 1223; } catch(e) {} return false; }, // Determines if an XMLHttpRequest returns NotModified httpNotModified: function( xhr, url ) { var lastModified = xhr.getResponseHeader("Last-Modified"), etag = xhr.getResponseHeader("Etag"); if ( lastModified ) { jQuery.lastModified[url] = lastModified; } if ( etag ) { jQuery.etag[url] = etag; } return xhr.status === 304; }, httpData: function( xhr, type, s ) { var ct = xhr.getResponseHeader("content-type") || "", xml = type === "xml" || !type && ct.indexOf("xml") >= 0, data = xml ? xhr.responseXML : xhr.responseText; if ( xml && data.documentElement.nodeName === "parsererror" ) { jQuery.error( "parsererror" ); } // Allow a pre-filtering function to sanitize the response // s is checked to keep backwards compatibility if ( s && s.dataFilter ) { data = s.dataFilter( data, type ); } // The filter can actually parse the response if ( typeof data === "string" ) { // Get the JavaScript object, if JSON is used. if ( type === "json" || !type && ct.indexOf("json") >= 0 ) { data = jQuery.parseJSON( data ); // If the type is "script", eval it in global context } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) { jQuery.globalEval( data ); } } return data; } }); /* * Create the request object; Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ if ( window.ActiveXObject ) { jQuery.ajaxSettings.xhr = function() { if ( window.location.protocol !== "file:" ) { try { return new window.XMLHttpRequest(); } catch(xhrError) {} } try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch(activeError) {} }; } // Does this browser support XHR requests? jQuery.support.ajax = !!jQuery.ajaxSettings.xhr(); var elemdisplay = {}, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/, timerId, fxAttrs = [ // height animations [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], // width animations [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], // opacity animations [ "opacity" ] ]; jQuery.fn.extend({ show: function( speed, easing, callback ) { var elem, display; if ( speed || speed === 0 ) { return this.animate( genFx("show", 3), speed, easing, callback); } else { for ( var i = 0, j = this.length; i < j; i++ ) { elem = this[i]; display = elem.style.display; // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !jQuery.data(elem, "olddisplay") && display === "none" ) { display = elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( display === "" && jQuery.css( elem, "display" ) === "none" ) { jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName)); } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { elem = this[i]; display = elem.style.display; if ( display === "" || display === "none" ) { elem.style.display = jQuery.data(elem, "olddisplay") || ""; } } return this; } }, hide: function( speed, easing, callback ) { if ( speed || speed === 0 ) { return this.animate( genFx("hide", 3), speed, easing, callback); } else { for ( var i = 0, j = this.length; i < j; i++ ) { var display = jQuery.css( this[i], "display" ); if ( display !== "none" ) { jQuery.data( this[i], "olddisplay", display ); } } // Set the display of the elements in a second loop // to avoid the constant reflow for ( i = 0; i < j; i++ ) { this[i].style.display = "none"; } return this; } }, // Save the old toggle function _toggle: jQuery.fn.toggle, toggle: function( fn, fn2, callback ) { var bool = typeof fn === "boolean"; if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) { this._toggle.apply( this, arguments ); } else if ( fn == null || bool ) { this.each(function() { var state = bool ? fn : jQuery(this).is(":hidden"); jQuery(this)[ state ? "show" : "hide" ](); }); } else { this.animate(genFx("toggle", 3), fn, fn2, callback); } return this; }, fadeTo: function( speed, to, easing, callback ) { return this.filter(":hidden").css("opacity", 0).show().end() .animate({opacity: to}, speed, easing, callback); }, animate: function( prop, speed, easing, callback ) { var optall = jQuery.speed(speed, easing, callback); if ( jQuery.isEmptyObject( prop ) ) { return this.each( optall.complete ); } return this[ optall.queue === false ? "each" : "queue" ](function() { // XXX 'this' does not always have a nodeName when running the // test suite var opt = jQuery.extend({}, optall), p, isElement = this.nodeType === 1, hidden = isElement && jQuery(this).is(":hidden"), self = this; for ( p in prop ) { var name = jQuery.camelCase( p ); if ( p !== name ) { prop[ name ] = prop[ p ]; delete prop[ p ]; p = name; } if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) { return opt.complete.call(this); } if ( isElement && ( p === "height" || p === "width" ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height // animated if ( jQuery.css( this, "display" ) === "inline" && jQuery.css( this, "float" ) === "none" ) { if ( !jQuery.support.inlineBlockNeedsLayout ) { this.style.display = "inline-block"; } else { var display = defaultDisplay(this.nodeName); // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( display === "inline" ) { this.style.display = "inline-block"; } else { this.style.display = "inline"; this.style.zoom = 1; } } } } if ( jQuery.isArray( prop[p] ) ) { // Create (if needed) and add to specialEasing (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1]; prop[p] = prop[p][0]; } } if ( opt.overflow != null ) { this.style.overflow = "hidden"; } opt.curAnim = jQuery.extend({}, prop); jQuery.each( prop, function( name, val ) { var e = new jQuery.fx( self, opt, name ); if ( rfxtypes.test(val) ) { e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop ); } else { var parts = rfxnum.exec(val), start = e.cur() || 0; if ( parts ) { var end = parseFloat( parts[2] ), unit = parts[3] || "px"; // We need to compute starting value if ( unit !== "px" ) { jQuery.style( self, name, (end || 1) + unit); start = ((end || 1) / e.cur()) * start; jQuery.style( self, name, start + unit); } // If a +=/-= token was provided, we're doing a relative animation if ( parts[1] ) { end = ((parts[1] === "-=" ? -1 : 1) * end) + start; } e.custom( start, end, unit ); } else { e.custom( start, val, "" ); } } }); // For JS strict compliance return true; }); }, stop: function( clearQueue, gotoEnd ) { var timers = jQuery.timers; if ( clearQueue ) { this.queue([]); } this.each(function() { // go in reverse order so anything added to the queue during the loop is ignored for ( var i = timers.length - 1; i >= 0; i-- ) { if ( timers[i].elem === this ) { if (gotoEnd) { // force the next step to be the last timers[i](true); } timers.splice(i, 1); } } }); // start the next in the queue if the last step wasn't forced if ( !gotoEnd ) { this.dequeue(); } return this; } }); function genFx( type, num ) { var obj = {}; jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() { obj[ this ] = type; }); return obj; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show", 1), slideUp: genFx("hide", 1), slideToggle: genFx("toggle", 1), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.extend({ speed: function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction(easing) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default; // Queueing opt.old = opt.complete; opt.complete = function() { if ( opt.queue !== false ) { jQuery(this).dequeue(); } if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } }; return opt; }, easing: { linear: function( p, n, firstNum, diff ) { return firstNum + diff * p; }, swing: function( p, n, firstNum, diff ) { return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; } }, timers: [], fx: function( elem, options, prop ) { this.options = options; this.elem = elem; this.prop = prop; if ( !options.orig ) { options.orig = {}; } } }); jQuery.fx.prototype = { // Simple function for setting a style value update: function() { if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); }, // Get the current size cur: function() { if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) { return this.elem[ this.prop ]; } var r = parseFloat( jQuery.css( this.elem, this.prop ) ); return r && r > -10000 ? r : 0; }, // Start an animation from one number to another custom: function( from, to, unit ) { var self = this, fx = jQuery.fx; this.startTime = jQuery.now(); this.start = from; this.end = to; this.unit = unit || this.unit || "px"; this.now = this.start; this.pos = this.state = 0; function t( gotoEnd ) { return self.step(gotoEnd); } t.elem = this.elem; if ( t() && jQuery.timers.push(t) && !timerId ) { timerId = setInterval(fx.tick, fx.interval); } }, // Simple 'show' function show: function() { // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); this.options.show = true; // Begin the animation // Make sure that we start at a small width/height to avoid any // flash of content this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur()); // Start by showing the element jQuery( this.elem ).show(); }, // Simple 'hide' function hide: function() { // Remember where we started, so that we can go back to it later this.options.orig[this.prop] = jQuery.style( this.elem, this.prop ); this.options.hide = true; // Begin the animation this.custom(this.cur(), 0); }, // Each step of an animation step: function( gotoEnd ) { var t = jQuery.now(), done = true; if ( gotoEnd || t >= this.options.duration + this.startTime ) { this.now = this.end; this.pos = this.state = 1; this.update(); this.options.curAnim[ this.prop ] = true; for ( var i in this.options.curAnim ) { if ( this.options.curAnim[i] !== true ) { done = false; } } if ( done ) { // Reset the overflow if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) { var elem = this.elem, options = this.options; jQuery.each( [ "", "X", "Y" ], function (index, value) { elem.style[ "overflow" + value ] = options.overflow[index]; } ); } // Hide the element if the "hide" operation was done if ( this.options.hide ) { jQuery(this.elem).hide(); } // Reset the properties, if the item has been hidden or shown if ( this.options.hide || this.options.show ) { for ( var p in this.options.curAnim ) { jQuery.style( this.elem, p, this.options.orig[p] ); } } // Execute the complete function this.options.complete.call( this.elem ); } return false; } else { var n = t - this.startTime; this.state = n / this.options.duration; // Perform the easing function, defaults to swing var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop]; var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear"); this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration); this.now = this.start + ((this.end - this.start) * this.pos); // Perform the next step of the animation this.update(); } return true; } }; jQuery.extend( jQuery.fx, { tick: function() { var timers = jQuery.timers; for ( var i = 0; i < timers.length; i++ ) { if ( !timers[i]() ) { timers.splice(i--, 1); } } if ( !timers.length ) { jQuery.fx.stop(); } }, interval: 13, stop: function() { clearInterval( timerId ); timerId = null; }, speeds: { slow: 600, fast: 200, // Default speed _default: 400 }, step: { opacity: function( fx ) { jQuery.style( fx.elem, "opacity", fx.now ); }, _default: function( fx ) { if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) { fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit; } else { fx.elem[ fx.prop ] = fx.now; } } } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } function defaultDisplay( nodeName ) { if ( !elemdisplay[ nodeName ] ) { var elem = jQuery("<" + nodeName + ">").appendTo("body"), display = elem.css("display"); elem.remove(); if ( display === "none" || display === "" ) { display = "block"; } elemdisplay[ nodeName ] = display; } return elemdisplay[ nodeName ]; } var rtable = /^t(?:able|d|h)$/i, rroot = /^(?:body|html)$/i; if ( "getBoundingClientRect" in document.documentElement ) { jQuery.fn.offset = function( options ) { var elem = this[0], box; if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } if ( !elem || !elem.ownerDocument ) { return null; } if ( elem === elem.ownerDocument.body ) { return jQuery.offset.bodyOffset( elem ); } try { box = elem.getBoundingClientRect(); } catch(e) {} var doc = elem.ownerDocument, docElem = doc.documentElement; // Make sure we're not dealing with a disconnected DOM node if ( !box || !jQuery.contains( docElem, elem ) ) { return box || { top: 0, left: 0 }; } var body = doc.body, win = getWindow(doc), clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, scrollTop = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ), scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft), top = box.top + scrollTop - clientTop, left = box.left + scrollLeft - clientLeft; return { top: top, left: left }; }; } else { jQuery.fn.offset = function( options ) { var elem = this[0]; if ( options ) { return this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } if ( !elem || !elem.ownerDocument ) { return null; } if ( elem === elem.ownerDocument.body ) { return jQuery.offset.bodyOffset( elem ); } jQuery.offset.initialize(); var computedStyle, offsetParent = elem.offsetParent, prevOffsetParent = elem, doc = elem.ownerDocument, docElem = doc.documentElement, body = doc.body, defaultView = doc.defaultView, prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle, top = elem.offsetTop, left = elem.offsetLeft; while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { break; } computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle; top -= elem.scrollTop; left -= elem.scrollLeft; if ( elem === offsetParent ) { top += elem.offsetTop; left += elem.offsetLeft; if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevOffsetParent = offsetParent; offsetParent = elem.offsetParent; } if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) { top += parseFloat( computedStyle.borderTopWidth ) || 0; left += parseFloat( computedStyle.borderLeftWidth ) || 0; } prevComputedStyle = computedStyle; } if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) { top += body.offsetTop; left += body.offsetLeft; } if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) { top += Math.max( docElem.scrollTop, body.scrollTop ); left += Math.max( docElem.scrollLeft, body.scrollLeft ); } return { top: top, left: left }; }; } jQuery.offset = { initialize: function() { var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0, html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } ); container.innerHTML = html; body.insertBefore( container, body.firstChild ); innerDiv = container.firstChild; checkDiv = innerDiv.firstChild; td = innerDiv.nextSibling.firstChild.firstChild; this.doesNotAddBorder = (checkDiv.offsetTop !== 5); this.doesAddBorderForTableAndCells = (td.offsetTop === 5); checkDiv.style.position = "fixed"; checkDiv.style.top = "20px"; // safari subtracts parent border width here which is 5px this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15); checkDiv.style.position = checkDiv.style.top = ""; innerDiv.style.overflow = "hidden"; innerDiv.style.position = "relative"; this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop); body.removeChild( container ); body = container = innerDiv = checkDiv = table = td = null; jQuery.offset.initialize = jQuery.noop; }, bodyOffset: function( body ) { var top = body.offsetTop, left = body.offsetLeft; jQuery.offset.initialize(); if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) { top += parseFloat( jQuery.css(body, "marginTop") ) || 0; left += parseFloat( jQuery.css(body, "marginLeft") ) || 0; } return { top: top, left: left }; }, setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1), props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is absolute if ( calculatePosition ) { curPosition = curElem.position(); } curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0; curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0; if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if (options.top != null) { props.top = (options.top - curOffset.top) + curTop; } if (options.left != null) { props.left = (options.left - curOffset.left) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[0] ) { return null; } var elem = this[0], // Get *real* offsetParent offsetParent = this.offsetParent(), // Get correct offsets offset = this.offset(), parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset(); // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0; offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0; // Add offsetParent borders parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0; parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0; // Subtract the two offsets return { top: offset.top - parentOffset.top, left: offset.left - parentOffset.left }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || document.body; while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) { offsetParent = offsetParent.offsetParent; } return offsetParent; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( ["Left", "Top"], function( i, name ) { var method = "scroll" + name; jQuery.fn[ method ] = function(val) { var elem = this[0], win; if ( !elem ) { return null; } if ( val !== undefined ) { // Set the scroll offset return this.each(function() { win = getWindow( this ); if ( win ) { win.scrollTo( !i ? val : jQuery(win).scrollLeft(), i ? val : jQuery(win).scrollTop() ); } else { this[ method ] = val; } }); } else { win = getWindow( elem ); // Return the scroll offset return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] : jQuery.support.boxModel && win.document.documentElement[ method ] || win.document.body[ method ] : elem[ method ]; } }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, outerHeight and outerWidth methods jQuery.each([ "Height", "Width" ], function( i, name ) { var type = name.toLowerCase(); // innerHeight and innerWidth jQuery.fn["inner" + name] = function() { return this[0] ? parseFloat( jQuery.css( this[0], type, "padding" ) ) : null; }; // outerHeight and outerWidth jQuery.fn["outer" + name] = function( margin ) { return this[0] ? parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) : null; }; jQuery.fn[ type ] = function( size ) { // Get window width or height var elem = this[0]; if ( !elem ) { return size == null ? null : this; } if ( jQuery.isFunction( size ) ) { return this.each(function( i ) { var self = jQuery( this ); self[ type ]( size.call( this, i, self[ type ]() ) ); }); } if ( jQuery.isWindow( elem ) ) { // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] || elem.document.body[ "client" + name ]; // Get document width or height } else if ( elem.nodeType === 9 ) { // Either scroll[Width/Height] or offset[Width/Height], whichever is greater return Math.max( elem.documentElement["client" + name], elem.body["scroll" + name], elem.documentElement["scroll" + name], elem.body["offset" + name], elem.documentElement["offset" + name] ); // Get or set width or height on the element } else if ( size === undefined ) { var orig = jQuery.css( elem, type ), ret = parseFloat( orig ); return jQuery.isNaN( ret ) ? orig : ret; // Set the width or height on the element (default to pixels if value is unitless) } else { return this.css( type, typeof size === "string" ? size : size + "px" ); } }; }); })(window);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-1.4.4.js
jquery-1.4.4.js
* {!Object} non-nullable type (never NULL) * {?string} nullable type (sometimes NULL) - default for {Object} * {number=} optional parameter * {*} ALL types */ // NOTE: For best readability, view with a fixed-width font and tabs equal to 4-chars ;(function ($) { // alias Math methods - used a lot! var min = Math.min , max = Math.max , round = Math.floor ; function isStr (v) { return $.type(v) === "string"; } function runPluginCallbacks (Instance, a_fn) { if ($.isArray(a_fn)) for (var i=0, c=a_fn.length; i<c; i++) { var fn = a_fn[i]; try { if (isStr(fn)) // 'name' of a function fn = eval(fn); if ($.isFunction(fn)) fn( Instance ); } catch (ex) {} } }; /* * GENERIC $.layout METHODS - used by all layouts */ $.layout = { version: "1.3.rc30.51" , revision: 0.033005 // 1.3.0 final = 1.0300 - major(n+).minor(nn)+patch(nn+) // LANGUAGE CUSTOMIZATION , language: { // Tips and messages for resizers, togglers, custom buttons, etc. Open: "Open" // eg: "Open Pane" , Close: "Close" , Resize: "Resize" , Slide: "Slide Open" , Pin: "Pin" , Unpin: "Un-Pin" , noRoomToOpenTip: "Not enough room to show this pane." , minSizeWarning: "Panel has reached its minimum size" , maxSizeWarning: "Panel has reached its maximum size" // Developer error messages , pane: "pane" // description of "layout pane element" , selector: "selector" // description of "jQuery-selector" , errButton: "Error Adding Button \n\nInvalid " , errContainerMissing: "UI Layout Initialization Error\n\nThe specified layout-container does not exist." , errCenterPaneMissing: "UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element." , errContainerHeight: "UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!" } // can update code here if $.browser is phased out , browser: { mozilla: !!$.browser.mozilla , webkit: !!$.browser.webkit || !!$.browser.safari // webkit = jQ 1.4 , msie: !!$.browser.msie , isIE6: !!$.browser.msie && $.browser.version == 6 , version: $.browser.version // not used in Layout core, but may be used by plugins } // *PREDEFINED* EFFECTS & DEFAULTS // MUST list effect here - OR MUST set an fxSettings option (can be an empty hash: {}) , effects: { // Pane Open/Close Animations slide: { all: { duration: "fast" } // eg: duration: 1000, easing: "easeOutBounce" , north: { direction: "up" } , south: { direction: "down" } , east: { direction: "right"} , west: { direction: "left" } } , drop: { all: { duration: "slow" } , north: { direction: "up" } , south: { direction: "down" } , east: { direction: "right"} , west: { direction: "left" } } , scale: { all: { duration: "fast" } } // these are not recommended, but can be used , blind: {} , clip: {} , explode: {} , fade: {} , fold: {} , puff: {} // Pane Resize Animations , size: { all: { easing: "swing" } } } // INTERNAL CONFIG DATA - DO NOT CHANGE THIS! , config: { optionRootKeys: "effects,panes,north,south,west,east,center".split(",") , allPanes: "north,south,west,east,center".split(",") , borderPanes: "north,south,west,east".split(",") , oppositeEdge: { north: "south" , south: "north" , east: "west" , west: "east" } // offscreen data , offscreenCSS: { left: "-99999px", right: "auto" } // used by hide/close if useOffscreenClose=true , offscreenReset: "offscreenReset" // key used for data // CSS used in multiple places , hidden: { visibility: "hidden" } , visible: { visibility: "visible" } // layout element settings , resizers: { cssReq: { position: "absolute" , padding: 0 , margin: 0 , fontSize: "1px" , textAlign: "left" // to counter-act "center" alignment! , overflow: "hidden" // prevent toggler-button from overflowing // SEE $.layout.defaults.zIndexes.resizer_normal } , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true background: "#DDD" , border: "none" } } , togglers: { cssReq: { position: "absolute" , display: "block" , padding: 0 , margin: 0 , overflow: "hidden" , textAlign: "center" , fontSize: "1px" , cursor: "pointer" , zIndex: 1 } , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true background: "#AAA" } } , content: { cssReq: { position: "relative" /* contain floated or positioned elements */ } , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true overflow: "auto" , padding: "10px" } , cssDemoPane: { // DEMO CSS - REMOVE scrolling from 'pane' when it has a content-div overflow: "hidden" , padding: 0 } } , panes: { // defaults for ALL panes - overridden by 'per-pane settings' below cssReq: { position: "absolute" , margin: 0 // $.layout.defaults.zIndexes.pane_normal } , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true padding: "10px" , background: "#FFF" , border: "1px solid #BBB" , overflow: "auto" } } , north: { side: "Top" , sizeType: "Height" , dir: "horz" , cssReq: { top: 0 , bottom: "auto" , left: 0 , right: 0 , width: "auto" // height: DYNAMIC } } , south: { side: "Bottom" , sizeType: "Height" , dir: "horz" , cssReq: { top: "auto" , bottom: 0 , left: 0 , right: 0 , width: "auto" // height: DYNAMIC } } , east: { side: "Right" , sizeType: "Width" , dir: "vert" , cssReq: { left: "auto" , right: 0 , top: "auto" // DYNAMIC , bottom: "auto" // DYNAMIC , height: "auto" // width: DYNAMIC } } , west: { side: "Left" , sizeType: "Width" , dir: "vert" , cssReq: { left: 0 , right: "auto" , top: "auto" // DYNAMIC , bottom: "auto" // DYNAMIC , height: "auto" // width: DYNAMIC } } , center: { dir: "center" , cssReq: { left: "auto" // DYNAMIC , right: "auto" // DYNAMIC , top: "auto" // DYNAMIC , bottom: "auto" // DYNAMIC , height: "auto" , width: "auto" } } } // CALLBACK FUNCTION NAMESPACE - used to store reusable callback functions , callbacks: {} , getParentPaneElem: function (el) { // must pass either a container or pane element var $el = $(el) , layout = $el.data("layout") || $el.data("parentLayout"); if (layout) { var $cont = layout.container; // see if this container is directly-nested inside an outer-pane if ($cont.data("layoutPane")) return $cont; var $pane = $cont.closest("."+ $.layout.defaults.panes.paneClass); // if a pane was found, return it if ($pane.data("layoutPane")) return $pane; } return null; } , getParentPaneInstance: function (el) { // must pass either a container or pane element var $pane = $.layout.getParentPaneElem(el); return $pane ? $pane.data("layoutPane") : null; } , getParentLayoutInstance: function (el) { // must pass either a container or pane element var $pane = $.layout.getParentPaneElem(el); return $pane ? $pane.data("parentLayout") : null; } , getEventObject: function (evt) { return typeof evt === "object" && evt.stopPropagation ? evt : null; } , parsePaneName: function (evt_or_pane) { // getEventObject() automatically calls .stopPropagation(), WHICH MUST BE DONE! var evt = $.layout.getEventObject( evt_or_pane ); if (evt) { // ALWAYS stop propagation of events triggered in Layout! evt.stopPropagation(); return $(this).data("layoutEdge"); } else return evt_or_pane; } // LAYOUT-PLUGIN REGISTRATION // more plugins can added beyond this default list , plugins: { draggable: !!$.fn.draggable // resizing , effects: { core: !!$.effects // animimations (specific effects tested by initOptions) , slide: $.effects && $.effects.slide // default effect } } // arrays of plugin or other methods to be triggered for events in *each layout* - will be passed 'Instance' , onCreate: [] // runs when layout is just starting to be created - right after options are set , onLoad: [] // runs after layout container and global events init, but before initPanes is called , onReady: [] // runs after initialization *completes* - ie, after initPanes completes successfully , onDestroy: [] // runs after layout is destroyed , onUnload: [] // runs after layout is destroyed OR when page unloads , afterOpen: [] // runs after setAsOpen() completes , afterClose: [] // runs after setAsClosed() completes /* * GENERIC UTILITY METHODS */ // calculate and return the scrollbar width, as an integer , scrollbarWidth: function () { return window.scrollbarWidth || $.layout.getScrollbarSize('width'); } , scrollbarHeight: function () { return window.scrollbarHeight || $.layout.getScrollbarSize('height'); } , getScrollbarSize: function (dim) { var $c = $('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body"); var d = { width: $c.width() - $c[0].clientWidth, height: $c.height() - $c[0].clientHeight }; $c.remove(); window.scrollbarWidth = d.width; window.scrollbarHeight = d.height; return dim.match(/^(width|height)$/) ? d[dim] : d; } /** * Returns hash container 'display' and 'visibility' * * @see $.swap() - swaps CSS, runs callback, resets CSS */ , showInvisibly: function ($E, force) { if (!$E) return {}; if (!$E.jquery) $E = $($E); var CSS = { display: $E.css('display') , visibility: $E.css('visibility') }; if (force || CSS.display === "none") { // only if not *already hidden* $E.css({ display: "block", visibility: "hidden" }); // show element 'invisibly' so can be measured return CSS; } else return {}; } /** * Returns data for setting size of an element (container or a pane). * * @see _create(), onWindowResize() for container, plus others for pane * @return JSON Returns a hash of all dimensions: top, bottom, left, right, outerWidth, innerHeight, etc */ , getElementDimensions: function ($E) { var d = {} // dimensions hash , x = d.css = {} // CSS hash , i = {} // TEMP insets , b, p // TEMP border, padding , N = $.layout.cssNum , off = $E.offset() ; d.offsetLeft = off.left; d.offsetTop = off.top; $.each("Left,Right,Top,Bottom".split(","), function (idx, e) { // e = edge b = x["border" + e] = $.layout.borderWidth($E, e); p = x["padding"+ e] = $.layout.cssNum($E, "padding"+e); i[e] = b + p; // total offset of content from outer side d["inset"+ e] = p; }); d.offsetWidth = $E.innerWidth(); // offsetWidth is used in calc when doing manual resize d.offsetHeight = $E.innerHeight(); // ditto d.outerWidth = $E.outerWidth(); d.outerHeight = $E.outerHeight(); d.innerWidth = max(0, d.outerWidth - i.Left - i.Right); d.innerHeight = max(0, d.outerHeight - i.Top - i.Bottom); x.width = $E.width(); x.height = $E.height(); x.top = N($E,"top",true); x.bottom = N($E,"bottom",true); x.left = N($E,"left",true); x.right = N($E,"right",true); //d.visible = $E.is(":visible");// && x.width > 0 && x.height > 0; return d; } , getElementCSS: function ($E, list) { var CSS = {} , style = $E[0].style , props = list.split(",") , sides = "Top,Bottom,Left,Right".split(",") , attrs = "Color,Style,Width".split(",") , p, s, a, i, j, k ; for (i=0; i < props.length; i++) { p = props[i]; if (p.match(/(border|padding|margin)$/)) for (j=0; j < 4; j++) { s = sides[j]; if (p === "border") for (k=0; k < 3; k++) { a = attrs[k]; CSS[p+s+a] = style[p+s+a]; } else CSS[p+s] = style[p+s]; } else CSS[p] = style[p]; }; return CSS } /** * Return the innerWidth for the current browser/doctype * * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() * @param {Array.<Object>} $E Must pass a jQuery object - first element is processed * @param {number=} outerWidth (optional) Can pass a width, allowing calculations BEFORE element is resized * @return {number} Returns the innerWidth of the elem by subtracting padding and borders */ , cssWidth: function ($E, outerWidth) { var b = $.layout.borderWidth , n = $.layout.cssNum ; // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed if (outerWidth <= 0) return 0; if (!$.support.boxModel) return outerWidth; // strip border and padding from outerWidth to get CSS Width var W = outerWidth - b($E, "Left") - b($E, "Right") - n($E, "paddingLeft") - n($E, "paddingRight") ; return max(0,W); } /** * Return the innerHeight for the current browser/doctype * * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles() * @param {Array.<Object>} $E Must pass a jQuery object - first element is processed * @param {number=} outerHeight (optional) Can pass a width, allowing calculations BEFORE element is resized * @return {number} Returns the innerHeight of the elem by subtracting padding and borders */ , cssHeight: function ($E, outerHeight) { var b = $.layout.borderWidth , n = $.layout.cssNum ; // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed if (outerHeight <= 0) return 0; if (!$.support.boxModel) return outerHeight; // strip border and padding from outerHeight to get CSS Height var H = outerHeight - b($E, "Top") - b($E, "Bottom") - n($E, "paddingTop") - n($E, "paddingBottom") ; return max(0,H); } /** * Returns the 'current CSS numeric value' for a CSS property - 0 if property does not exist * * @see Called by many methods * @param {Array.<Object>} $E Must pass a jQuery object - first element is processed * @param {string} prop The name of the CSS property, eg: top, width, etc. * @param {boolean=} [allowAuto=false] true = return 'auto' if that is value; false = return 0 * @return {(string|number)} Usually used to get an integer value for position (top, left) or size (height, width) */ , cssNum: function ($E, prop, allowAuto) { if (!$E.jquery) $E = $($E); var CSS = $.layout.showInvisibly($E) , p = $.curCSS($E[0], prop, true) , v = allowAuto && p=="auto" ? p : (parseInt(p, 10) || 0); $E.css( CSS ); // RESET return v; } , borderWidth: function (el, side) { if (el.jquery) el = el[0]; var b = "border"+ side.substr(0,1).toUpperCase() + side.substr(1); // left => Left return $.curCSS(el, b+"Style", true) === "none" ? 0 : (parseInt($.curCSS(el, b+"Width", true), 10) || 0); } /** * Mouse-tracking utility - FUTURE REFERENCE * * init: if (!window.mouse) { * window.mouse = { x: 0, y: 0 }; * $(document).mousemove( $.layout.trackMouse ); * } * * @param {Object} evt * , trackMouse: function (evt) { window.mouse = { x: evt.clientX, y: evt.clientY }; } */ /** * SUBROUTINE for preventPrematureSlideClose option * * @param {Object} evt * @param {Object=} el */ , isMouseOverElem: function (evt, el) { var $E = $(el || this) , d = $E.offset() , T = d.top , L = d.left , R = L + $E.outerWidth() , B = T + $E.outerHeight() , x = evt.pageX // evt.clientX ? , y = evt.pageY // evt.clientY ? ; // if X & Y are < 0, probably means is over an open SELECT return ($.layout.browser.msie && x < 0 && y < 0) || ((x >= L && x <= R) && (y >= T && y <= B)); } /** * Message/Logging Utility * * @example $.layout.msg("My message"); // log text * @example $.layout.msg("My message", true); // alert text * @example $.layout.msg({ foo: "bar" }, "Title"); // log hash-data, with custom title * @example $.layout.msg({ foo: "bar" }, true, "Title", { sort: false }); -OR- * @example $.layout.msg({ foo: "bar" }, "Title", { sort: false, display: true }); // alert hash-data * * @param {(Object|string)} info String message OR Hash/Array * @param {(Boolean|string|Object)=} [popup=false] True means alert-box - can be skipped * @param {(Object|string)=} [debugTitle=""] Title for Hash data - can be skipped * @param {Object=} [debutOpts={}] Extra options for debug output */ , msg: function (info, popup, debugTitle, debugOpts) { if ($.isPlainObject(info) && window.debugData) { if (typeof popup === "string") { debugOpts = debugTitle; debugTitle = popup; } else if (typeof debugTitle === "object") { debugOpts = debugTitle; debugTitle = null; } var t = debugTitle || "log( <object> )" , o = $.extend({ sort: false, returnHTML: false, display: false }, debugOpts); if (popup === true || o.display) debugData( info, t, o ); else if (window.console) console.log(debugData( info, t, o )); } else if (popup) alert(info); else if (window.console) console.log(info); else { var id = "#layoutLogger" , $l = $(id); if (!$l.length) $l = createLog(); $l.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">'+ info.replace(/\</g,"&lt;").replace(/\>/g,"&gt;") +'</li>'); } function createLog () { var pos = $.support.fixedPosition ? 'fixed' : 'absolute' , $e = $('<div id="layoutLogger" style="position: '+ pos +'; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);">' + '<div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;">' + '<span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div>' + '<ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul>' + '</div>' ).appendTo("body"); $e.css('left', $(window).width() - $e.outerWidth() - 5) if ($.ui.draggable) $e.draggable({ handle: ':first-child' }); return $e; }; } }; var lang = $.layout.language; // alias used in defaults... // DEFAULT OPTIONS - CHANGE IF DESIRED $.layout.defaults = { /* * LAYOUT & LAYOUT-CONTAINER OPTIONS * - none of these options are applicable to individual panes */ name: "" // Not required, but useful for buttons and used for the state-cookie , containerSelector: "" // ONLY used when specifying a childOptions - to find container-element that is NOT directly-nested , containerClass: "ui-layout-container" // layout-container element , scrollToBookmarkOnLoad: true // after creating a layout, scroll to bookmark in URL (.../page.htm#myBookmark) , resizeWithWindow: true // bind thisLayout.resizeAll() to the window.resize event , resizeWithWindowDelay: 200 // delay calling resizeAll because makes window resizing very jerky , resizeWithWindowMaxDelay: 0 // 0 = none - force resize every XX ms while window is being resized , onresizeall_start: null // CALLBACK when resizeAll() STARTS - NOT pane-specific , onresizeall_end: null // CALLBACK when resizeAll() ENDS - NOT pane-specific , onload_start: null // CALLBACK when Layout inits - after options initialized, but before elements , onload_end: null // CALLBACK when Layout inits - after EVERYTHING has been initialized , onunload_start: null // CALLBACK when Layout is destroyed OR onWindowUnload , onunload_end: null // CALLBACK when Layout is destroyed OR onWindowUnload , autoBindCustomButtons: false // search for buttons with ui-layout-button class and auto-bind them , initPanes: true // false = DO NOT initialize the panes onLoad - will init later , showErrorMessages: true // enables fatal error messages to warn developers of common errors , showDebugMessages: false // display console-and-alert debug msgs - IF this Layout version _has_ debugging code! // Changing this zIndex value will cause other zIndex values to automatically change , zIndex: null // the PANE zIndex - resizers and masks will be +1 // DO NOT CHANGE the zIndex values below unless you clearly understand their relationships , zIndexes: { // set _default_ z-index values here... pane_normal: 0 // normal z-index for panes , content_mask: 1 // applied to overlays used to mask content INSIDE panes during resizing , resizer_normal: 2 // normal z-index for resizer-bars , pane_sliding: 100 // applied to *BOTH* the pane and its resizer when a pane is 'slid open' , pane_animate: 1000 // applied to the pane when being animated - not applied to the resizer , resizer_drag: 10000 // applied to the CLONED resizer-bar when being 'dragged' } /* * PANE DEFAULT SETTINGS * - settings under the 'panes' key become the default settings for *all panes* * - ALL pane-options can also be set specifically for each panes, which will override these 'default values' */ , panes: { // default options for 'all panes' - will be overridden by 'per-pane settings' applyDemoStyles: false // NOTE: renamed from applyDefaultStyles for clarity , closable: true // pane can open & close , resizable: true // when open, pane can be resized , slidable: true // when closed, pane can 'slide open' over other panes - closes on mouse-out , initClosed: false // true = init pane as 'closed' , initHidden: false // true = init pane as 'hidden' - no resizer-bar/spacing // SELECTORS //, paneSelector: "" // MUST be pane-specific - jQuery selector for pane , contentSelector: ".ui-layout-content" // INNER div/element to auto-size so only it scrolls, not the entire pane! , contentIgnoreSelector: ".ui-layout-ignore" // element(s) to 'ignore' when measuring 'content' , findNestedContent: false // true = $P.find(contentSelector), false = $P.children(contentSelector) // GENERIC ROOT-CLASSES - for auto-generated classNames , paneClass: "ui-layout-pane" // Layout Pane , resizerClass: "ui-layout-resizer" // Resizer Bar , togglerClass: "ui-layout-toggler" // Toggler Button , buttonClass: "ui-layout-button" // CUSTOM Buttons - eg: '[ui-layout-button]-toggle/-open/-close/-pin' // ELEMENT SIZE & SPACING //, size: 100 // MUST be pane-specific -initial size of pane , minSize: 0 // when manually resizing a pane , maxSize: 0 // ditto, 0 = no limit , spacing_open: 6 // space between pane and adjacent panes - when pane is 'open' , spacing_closed: 6 // ditto - when pane is 'closed' , togglerLength_open: 50 // Length = WIDTH of toggler button on north/south sides - HEIGHT on east/west sides , togglerLength_closed: 50 // 100% OR -1 means 'full height/width of resizer bar' - 0 means 'hidden' , togglerAlign_open: "center" // top/left, bottom/right, center, OR... , togglerAlign_closed: "center" // 1 => nn = offset from top/left, -1 => -nn == offset from bottom/right , togglerTip_open: lang.Close // Toggler tool-tip (title) , togglerTip_closed: lang.Open // ditto , togglerContent_open: "" // text or HTML to put INSIDE the toggler , togglerContent_closed: "" // ditto // RESIZING OPTIONS , resizerDblClickToggle: true // , autoResize: true // IF size is 'auto' or a percentage, then recalc 'pixel size' whenever the layout resizes , autoReopen: true // IF a pane was auto-closed due to noRoom, reopen it when there is room? False = leave it closed , resizerDragOpacity: 1 // option for ui.draggable //, resizerCursor: "" // MUST be pane-specific - cursor when over resizer-bar , maskContents: false // true = add DIV-mask over-or-inside this pane so can 'drag' over IFRAMES , maskObjects: false // true = add IFRAME-mask over-or-inside this pane to cover objects/applets - content-mask will overlay this mask , maskZindex: null // will override zIndexes.content_mask if specified - not applicable to iframe-panes , resizingGrid: false // grid size that the resizers will snap-to during resizing, eg: [20,20] , livePaneResizing: false // true = LIVE Resizing as resizer is dragged , liveContentResizing: false // true = re-measure header/footer heights as resizer is dragged , liveResizingTolerance: 1 // how many px change before pane resizes, to control performance // TIPS & MESSAGES - also see lang object , noRoomToOpenTip: lang.noRoomToOpenTip , resizerTip: lang.Resize // Resizer tool-tip (title) , sliderTip: lang.Slide // resizer-bar triggers 'sliding' when pane is closed , sliderCursor: "pointer" // cursor when resizer-bar will trigger 'sliding' , slideTrigger_open: "click" // click, dblclick, mouseenter , slideTrigger_close: "mouseleave"// click, mouseleave , slideDelay_open: 300 // applies only for mouseenter event - 0 = instant open , slideDelay_close: 300 // applies only for mouseleave event (300ms is the minimum!) , hideTogglerOnSlide: false // when pane is slid-open, should the toggler show? , preventQuickSlideClose: $.layout.browser.webkit // Chrome triggers slideClosed as it is opening , preventPrematureSlideClose: false // handle incorrect mouseleave trigger, like when over a SELECT-list in IE // HOT-KEYS & MISC , showOverflowOnHover: false // will bind allowOverflow() utility to pane.onMouseOver , enableCursorHotkey: true // enabled 'cursor' hotkeys //, customHotkey: "" // MUST be pane-specific - EITHER a charCode OR a character , customHotkeyModifier: "SHIFT" // either 'SHIFT', 'CTRL' or 'CTRL+SHIFT' - NOT 'ALT' // PANE ANIMATION // NOTE: fxSss_open, fxSss_close & fxSss_size options (eg: fxName_open) are auto-generated if not passed , fxName: "slide" // ('none' or blank), slide, drop, scale -- only relevant to 'open' & 'close', NOT 'size' , fxSpeed: null // slow, normal, fast, 200, nnn - if passed, will OVERRIDE fxSettings.duration , fxSettings: {} // can be passed, eg: { easing: "easeOutBounce", duration: 1500 } , fxOpacityFix: true // tries to fix opacity in IE to restore anti-aliasing after animation , animatePaneSizing: false // true = animate resizing after dragging resizer-bar OR sizePane() is called /* NOTE: Action-specific FX options are auto-generated from the options above if not specifically set: fxName_open: "slide" // 'Open' pane animation fnName_close: "slide" // 'Close' pane animation fxName_size: "slide" // 'Size' pane animation - when animatePaneSizing = true fxSpeed_open: null fxSpeed_close: null fxSpeed_size: null fxSettings_open: {} fxSettings_close: {} fxSettings_size: {} */ // CHILD/NESTED LAYOUTS , childOptions: null // Layout-options for nested/child layout - even {} is valid as options , initChildLayout: true // true = child layout will be created as soon as _this_ layout completes initialization , destroyChildLayout: true // true = destroy child-layout if this pane is destroyed , resizeChildLayout: true // true = trigger child-layout.resizeAll() when this pane is resized // PANE CALLBACKS , triggerEventsOnLoad: false // true = trigger onopen OR onclose callbacks when layout initializes , triggerEventsDuringLiveResize: true // true = trigger onresize callback REPEATEDLY if livePaneResizing==true , onshow_start: null // CALLBACK when pane STARTS to Show - BEFORE onopen/onhide_start , onshow_end: null // CALLBACK when pane ENDS being Shown - AFTER onopen/onhide_end , onhide_start: null // CALLBACK when pane STARTS to Close - BEFORE onclose_start , onhide_end: null // CALLBACK when pane ENDS being Closed - AFTER onclose_end , onopen_start: null // CALLBACK when pane STARTS to Open , onopen_end: null // CALLBACK when pane ENDS being Opened , onclose_start: null // CALLBACK when pane STARTS to Close , onclose_end: null // CALLBACK when pane ENDS being Closed , onresize_start: null // CALLBACK when pane STARTS being Resized ***FOR ANY REASON*** , onresize_end: null // CALLBACK when pane ENDS being Resized ***FOR ANY REASON*** , onsizecontent_start: null // CALLBACK when sizing of content-element STARTS , onsizecontent_end: null // CALLBACK when sizing of content-element ENDS , onswap_start: null // CALLBACK when pane STARTS to Swap , onswap_end: null // CALLBACK when pane ENDS being Swapped , ondrag_start: null // CALLBACK when pane STARTS being ***MANUALLY*** Resized , ondrag_end: null // CALLBACK when pane ENDS being ***MANUALLY*** Resized } /* * PANE-SPECIFIC SETTINGS * - options listed below MUST be specified per-pane - they CANNOT be set under 'panes' * - all options under the 'panes' key can also be set specifically for any pane * - most options under the 'panes' key apply only to 'border-panes' - NOT the the center-pane */ , north: { paneSelector: ".ui-layout-north" , size: "auto" // eg: "auto", "30%", .30, 200 , resizerCursor: "n-resize" // custom = url(myCursor.cur) , customHotkey: "" // EITHER a charCode (43) OR a character ("o") } , south: { paneSelector: ".ui-layout-south" , size: "auto" , resizerCursor: "s-resize" , customHotkey: "" } , east: { paneSelector: ".ui-layout-east" , size: 200 , resizerCursor: "e-resize" , customHotkey: "" } , west: { paneSelector: ".ui-layout-west" , size: 200 , resizerCursor: "w-resize" , customHotkey: "" } , center: { paneSelector: ".ui-layout-center" , minWidth: 0 , minHeight: 0 } }; $.layout.optionsMap = { // layout/global options - NOT pane-options layout: ("stateManagement,effects,zIndexes," + "name,zIndex,scrollToBookmarkOnLoad,showErrorMessages," + "resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay," + "onresizeall,onresizeall_start,onresizeall_end,onload,onunload,autoBindCustomButtons").split(",") // borderPanes: [ ALL options that are NOT specified as 'layout' ] // default.panes options that apply to the center-pane (most options apply _only_ to border-panes) , center: ("paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad," + "showOverflowOnHover,maskContents,maskObjects,liveContentResizing," + "childOptions,initChildLayout,resizeChildLayout,destroyChildLayout," + "onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end").split(",") // options that MUST be specifically set 'per-pane' - CANNOT set in the panes (defaults) key , noDefault: ("paneSelector,resizerCursor,customHotkey").split(",") }; /** * Processes options passed in converts flat-format data into subkey (JSON) format * In flat-format, subkeys are _currently_ separated with 2 underscores, like north__optName * Plugins may also call this method so they can transform their own data * * @param {!Object} hash Data/options passed by user - may be a single level or nested levels * @return {Object} Returns hash of minWidth & minHeight */ $.layout.transformData = function (hash) { var json = { panes: {}, center: {} } // init return object , data, branch, optKey, keys, key, val, i, c; if (typeof hash !== "object") return json; // no options passed // convert all 'flat-keys' to 'sub-key' format for (optKey in hash) { branch = json; data = $.layout.optionsMap.layout; val = hash[ optKey ]; keys = optKey.split("__"); // eg: west__size or north__fxSettings__duration c = keys.length - 1; // convert underscore-delimited to subkeys for (i=0; i <= c; i++) { key = keys[i]; if (i === c) branch[key] = val; else if (!branch[key]) branch[key] = {}; // create the subkey // recurse to sub-key for next loop - if not done branch = branch[key]; } } return json; } // INTERNAL CONFIG DATA - DO NOT CHANGE THIS! $.layout.backwardCompatibility = { // data used by renameOldOptions() map: { // OLD Option Name: NEW Option Name applyDefaultStyles: "applyDemoStyles" , resizeNestedLayout: "resizeChildLayout" , resizeWhileDragging: "livePaneResizing" , resizeContentWhileDragging: "liveContentResizing" , triggerEventsWhileDragging: "triggerEventsDuringLiveResize" , maskIframesOnResize: "maskContents" , useStateCookie: "stateManagement.enabled" , "cookie.autoLoad": "stateManagement.autoLoad" , "cookie.autoSave": "stateManagement.autoSave" , "cookie.keys": "stateManagement.stateKeys" , "cookie.name": "stateManagement.cookie.name" , "cookie.domain": "stateManagement.cookie.domain" , "cookie.path": "stateManagement.cookie.path" , "cookie.expires": "stateManagement.cookie.expires" , "cookie.secure": "stateManagement.cookie.secure" } /** * @param {Object} opts */ , renameOptions: function (opts) { var map = $.layout.backwardCompatibility.map , oldData, newData, value ; for (var itemPath in map) { oldData = getBranch( itemPath ); value = oldData.branch[ oldData.key ] if (value !== undefined) { newData = getBranch( map[itemPath], true ) newData.branch[ newData.key ] = value; delete oldData.branch[ oldData.key ]; } } /** * @param {string} path * @param {boolean=} [create=false] Create path if does not exist */ function getBranch (path, create) { var a = path.split(".") // split keys into array , c = a.length - 1 , D = { branch: opts, key: a[c] } // init branch at top & set key (last item) , i = 0, k, undef; for (; i<c; i++) { // skip the last key (data) k = a[i]; if (D.branch[ k ] == undefined) { // child-key does not exist if (create) { D.branch = D.branch[ k ] = {}; // create child-branch } else // can't go any farther D.branch = {}; // branch is undefined } else D.branch = D.branch[ k ]; // get child-branch } return D; }; } /** * @param {Object} opts */ , renameAllOptions: function (opts) { var ren = $.layout.backwardCompatibility.renameOptions; // rename root (layout) options ren( opts ); // rename 'defaults' to 'panes' if (opts.defaults) { if (typeof opts.panes !== "object") opts.panes = {}; $.extend(true, opts.panes, opts.defaults); delete opts.defaults; } // rename options in the the options.panes key if (opts.panes) ren( opts.panes ); // rename options inside *each pane key*, eg: options.west $.each($.layout.config.allPanes, function (i, pane) { if (opts[pane]) ren( opts[pane] ); }); return opts; } }; /* ============================================================ * BEGIN WIDGET: $( selector ).layout( {options} ); * ============================================================ */ $.fn.layout = function (opts) { var // local aliases to global data browser = $.layout.browser , lang = $.layout.language // internal alias , _c = $.layout.config // local aliases to utlity methods , cssW = $.layout.cssWidth , cssH = $.layout.cssHeight , elDims = $.layout.getElementDimensions , elCSS = $.layout.getElementCSS , evtObj = $.layout.getEventObject , evtPane = $.layout.parsePaneName /** * options - populated by initOptions() */ , options = $.extend(true, {}, $.layout.defaults) , effects = options.effects = $.extend(true, {}, $.layout.effects) /** * layout-state object */ , state = { // generate unique ID to use for event.namespace so can unbind only events added by 'this layout' id: "layout"+ $.now() // code uses alias: sID , initialized: false , container: {} // init all keys , north: {} , south: {} , east: {} , west: {} , center: {} } /** * parent/child-layout pointers */ //, hasParentLayout = false - exists ONLY inside Instance so can be set externally , children = { north: null , south: null , east: null , west: null , center: null } /* * ########################### * INTERNAL HELPER FUNCTIONS * ########################### */ /** * Manages all internal timers */ , timer = { data: {} , set: function (s, fn, ms) { timer.clear(s); timer.data[s] = setTimeout(fn, ms); } , clear: function (s) { var t=timer.data; if (t[s]) {clearTimeout(t[s]); delete t[s];} } } , _log = function (msg, popup) { $.layout.msg( options.name +' / '+ msg, (popup && options.showErrorMessages) ); } /** * Executes a Callback function after a trigger event, like resize, open or close * * @param {string} evtName Name of the layout callback, eg "onresize_start" * @param {?string} pane This is passed only so we can pass the 'pane object' to the callback * @param {?boolean} skipBoundEvents Accepts a function name, OR a comma-delimited array: [0]=function name, [1]=argument */ , _runCallbacks = function (evtName, pane, skipBoundEvents) { var o = pane ? options[pane] : options // names like onopen and onopen_end separate are interchangeable in options... , lng = evtName + (evtName.match(/_/) ? "" : "_end") , shrt = lng.match(/_end$/) ? lng.substr(0, lng.length - 4) : "" , fn = o[lng] , retVal = "NC" // NC = No Callback , args = [] ; if (!fn && shrt) fn = o[shrt]; // first trigger the callback set in the options if (fn) { //try { // convert function name (string) to function object if (isStr( fn )) { if (fn.match(/,/)) { // function name cannot contain a comma, // so must be a function name AND a parameter to pass args = fn.split(",") , fn = eval(args[0]); } else // just the name of an external function? fn = eval(fn); } // execute the callback, if exists if ($.isFunction( fn )) { if (args.length) retVal = fn(args[1]); // pass the argument parsed from 'list' else if (pane && $Ps[pane]) // pass data: pane-name, pane-element, pane-state, pane-options, and layout-name retVal = fn( pane, $Ps[pane], state[pane], options[pane], options.name ); else // must be a layout/container callback - pass suitable info retVal = fn( Instance, state, options, options.name ); } //} //catch (ex) {} } // trigger additional events bound directly to the pane if (!skipBoundEvents && retVal !== false) { if (pane) { // PANE events can be bound to each pane-elements $Ps[pane].triggerHandler('layoutpane'+ lng, [ pane, $Ps[pane], state[pane], options[pane], options.name ]); if (shrt) $Ps[pane].triggerHandler('layoutpane'+ shrt, [ pane, $Ps[pane], state[pane], options[pane], options.name ]); } else // LAYOUT events can be bound to the container-element $N.triggerHandler('layout'+ lng, [ pane, $Ps[pane], state[pane], options[pane], options.name ]); } // ALWAYS resizeChildLayout after a resize event - even during initialization if (evtName === "onresize_end" || evtName === "onsizecontent_end") resizeChildLayout(pane); return retVal; } /** * cure iframe display issues in IE & other browsers */ , _fixIframe = function (pane) { if (browser.mozilla) return; // skip FireFox - it auto-refreshes iframes onShow var $P = $Ps[pane]; // if the 'pane' is an iframe, do it if (state[pane].tagName === "IFRAME") $P.css(_c.hidden).css(_c.visible); else // ditto for any iframes INSIDE the pane $P.find('IFRAME').css(_c.hidden).css(_c.visible); } /** * @param {string} pane Can accept ONLY a 'pane' (east, west, etc) * @param {number=} outerSize (optional) Can pass a width, allowing calculations BEFORE element is resized * @return {number} Returns the innerHeight/Width of el by subtracting padding and borders */ , cssSize = function (pane, outerSize) { var fn = _c[pane].dir=="horz" ? cssH : cssW; return fn($Ps[pane], outerSize); } /** * @param {string} pane Can accept ONLY a 'pane' (east, west, etc) * @return {Object} Returns hash of minWidth & minHeight */ , cssMinDims = function (pane) { // minWidth/Height means CSS width/height = 1px var $P = $Ps[pane] , dir = _c[pane].dir , d = { minWidth: 1001 - cssW($P, 1000) , minHeight: 1001 - cssH($P, 1000) } ; if (dir === "horz") d.minSize = d.minHeight; if (dir === "vert") d.minSize = d.minWidth; return d; } // TODO: see if these methods can be made more useful... // TODO: *maybe* return cssW/H from these so caller can use this info /** * @param {(string|!Object)} el * @param {number=} outerWidth * @param {boolean=} [autoHide=false] */ , setOuterWidth = function (el, outerWidth, autoHide) { var $E = el, w; if (isStr(el)) $E = $Ps[el]; // west else if (!el.jquery) $E = $(el); w = cssW($E, outerWidth); $E.css({ width: w }); if (w > 0) { if (autoHide && $E.data('autoHidden') && $E.innerHeight() > 0) { $E.show().data('autoHidden', false); if (!browser.mozilla) // FireFox refreshes iframes - IE does not // make hidden, then visible to 'refresh' display after animation $E.css(_c.hidden).css(_c.visible); } } else if (autoHide && !$E.data('autoHidden')) $E.hide().data('autoHidden', true); } /** * @param {(string|!Object)} el * @param {number=} outerHeight * @param {boolean=} [autoHide=false] */ , setOuterHeight = function (el, outerHeight, autoHide) { var $E = el, h; if (isStr(el)) $E = $Ps[el]; // west else if (!el.jquery) $E = $(el); h = cssH($E, outerHeight); $E.css({ height: h, visibility: "visible" }); // may have been 'hidden' by sizeContent if (h > 0 && $E.innerWidth() > 0) { if (autoHide && $E.data('autoHidden')) { $E.show().data('autoHidden', false); if (!browser.mozilla) // FireFox refreshes iframes - IE does not $E.css(_c.hidden).css(_c.visible); } } else if (autoHide && !$E.data('autoHidden')) $E.hide().data('autoHidden', true); } /** * @param {(string|!Object)} el * @param {number=} outerSize * @param {boolean=} [autoHide=false] */ , setOuterSize = function (el, outerSize, autoHide) { if (_c[pane].dir=="horz") // pane = north or south setOuterHeight(el, outerSize, autoHide); else // pane = east or west setOuterWidth(el, outerSize, autoHide); } /** * Converts any 'size' params to a pixel/integer size, if not already * If 'auto' or a decimal/percentage is passed as 'size', a pixel-size is calculated * /** * @param {string} pane * @param {(string|number)=} size * @param {string=} [dir] * @return {number} */ , _parseSize = function (pane, size, dir) { if (!dir) dir = _c[pane].dir; if (isStr(size) && size.match(/%/)) size = (size === '100%') ? -1 : parseInt(size, 10) / 100; // convert % to decimal if (size === 0) return 0; else if (size >= 1) return parseInt(size, 10); var o = options, avail = 0; if (dir=="horz") // north or south or center.minHeight avail = sC.innerHeight - ($Ps.north ? o.north.spacing_open : 0) - ($Ps.south ? o.south.spacing_open : 0); else if (dir=="vert") // east or west or center.minWidth avail = sC.innerWidth - ($Ps.west ? o.west.spacing_open : 0) - ($Ps.east ? o.east.spacing_open : 0); if (size === -1) // -1 == 100% return avail; else if (size > 0) // percentage, eg: .25 return round(avail * size); else if (pane=="center") return 0; else { // size < 0 || size=='auto' || size==Missing || size==Invalid // auto-size the pane var dim = (dir === "horz" ? "height" : "width") , $P = $Ps[pane] , $C = dim === 'height' ? $Cs[pane] : false , vis = $.layout.showInvisibly($P) // show pane invisibly if hidden , szP = $P.css(dim) // SAVE current pane size , szC = $C ? $C.css(dim) : 0 // SAVE current content size ; $P.css(dim, "auto"); if ($C) $C.css(dim, "auto"); size = (dim === "height") ? $P.outerHeight() : $P.outerWidth(); // MEASURE $P.css(dim, szP).css(vis); // RESET size & visibility if ($C) $C.css(dim, szC); return size; } } /** * Calculates current 'size' (outer-width or outer-height) of a border-pane - optionally with 'pane-spacing' added * * @param {(string|!Object)} pane * @param {boolean=} [inclSpace=false] * @return {number} Returns EITHER Width for east/west panes OR Height for north/south panes - adjusted for boxModel & browser */ , getPaneSize = function (pane, inclSpace) { var $P = $Ps[pane] , o = options[pane] , s = state[pane] , oSp = (inclSpace ? o.spacing_open : 0) , cSp = (inclSpace ? o.spacing_closed : 0) ; if (!$P || s.isHidden) return 0; else if (s.isClosed || (s.isSliding && inclSpace)) return cSp; else if (_c[pane].dir === "horz") return $P.outerHeight() + oSp; else // dir === "vert" return $P.outerWidth() + oSp; } /** * Calculate min/max pane dimensions and limits for resizing * * @param {string} pane * @param {boolean=} [slide=false] */ , setSizeLimits = function (pane, slide) { if (!isInitialized()) return; var o = options[pane] , s = state[pane] , c = _c[pane] , dir = c.dir , side = c.side.toLowerCase() , type = c.sizeType.toLowerCase() , isSliding = (slide != undefined ? slide : s.isSliding) // only open() passes 'slide' param , $P = $Ps[pane] , paneSpacing = o.spacing_open // measure the pane on the *opposite side* from this pane , altPane = _c.oppositeEdge[pane] , altS = state[altPane] , $altP = $Ps[altPane] , altPaneSize = (!$altP || altS.isVisible===false || altS.isSliding ? 0 : (dir=="horz" ? $altP.outerHeight() : $altP.outerWidth())) , altPaneSpacing = ((!$altP || altS.isHidden ? 0 : options[altPane][ altS.isClosed !== false ? "spacing_closed" : "spacing_open" ]) || 0) // limitSize prevents this pane from 'overlapping' opposite pane , containerSize = (dir=="horz" ? sC.innerHeight : sC.innerWidth) , minCenterDims = cssMinDims("center") , minCenterSize = dir=="horz" ? max(options.center.minHeight, minCenterDims.minHeight) : max(options.center.minWidth, minCenterDims.minWidth) // if pane is 'sliding', then ignore center and alt-pane sizes - because 'overlays' them , limitSize = (containerSize - paneSpacing - (isSliding ? 0 : (_parseSize("center", minCenterSize, dir) + altPaneSize + altPaneSpacing))) , minSize = s.minSize = max( _parseSize(pane, o.minSize), cssMinDims(pane).minSize ) , maxSize = s.maxSize = min( (o.maxSize ? _parseSize(pane, o.maxSize) : 100000), limitSize ) , r = s.resizerPosition = {} // used to set resizing limits , top = sC.insetTop , left = sC.insetLeft , W = sC.innerWidth , H = sC.innerHeight , rW = o.spacing_open // subtract resizer-width to get top/left position for south/east ; switch (pane) { case "north": r.min = top + minSize; r.max = top + maxSize; break; case "west": r.min = left + minSize; r.max = left + maxSize; break; case "south": r.min = top + H - maxSize - rW; r.max = top + H - minSize - rW; break; case "east": r.min = left + W - maxSize - rW; r.max = left + W - minSize - rW; break; }; } /** * Returns data for setting the size/position of center pane. Also used to set Height for east/west panes * * @return JSON Returns a hash of all dimensions: top, bottom, left, right, (outer) width and (outer) height */ , calcNewCenterPaneDims = function () { var d = { top: getPaneSize("north", true) // true = include 'spacing' value for pane , bottom: getPaneSize("south", true) , left: getPaneSize("west", true) , right: getPaneSize("east", true) , width: 0 , height: 0 }; // NOTE: sC = state.container // calc center-pane outer dimensions d.width = sC.innerWidth - d.left - d.right; // outerWidth d.height = sC.innerHeight - d.bottom - d.top; // outerHeight // add the 'container border/padding' to get final positions relative to the container d.top += sC.insetTop; d.bottom += sC.insetBottom; d.left += sC.insetLeft; d.right += sC.insetRight; return d; } /** * @param {!Object} el * @param {boolean=} [allStates=false] */ , getHoverClasses = function (el, allStates) { var $El = $(el) , type = $El.data("layoutRole") , pane = $El.data("layoutEdge") , o = options[pane] , root = o[type +"Class"] , _pane = "-"+ pane // eg: "-west" , _open = "-open" , _closed = "-closed" , _slide = "-sliding" , _hover = "-hover " // NOTE the trailing space , _state = $El.hasClass(root+_closed) ? _closed : _open , _alt = _state === _closed ? _open : _closed , classes = (root+_hover) + (root+_pane+_hover) + (root+_state+_hover) + (root+_pane+_state+_hover) ; if (allStates) // when 'removing' classes, also remove alternate-state classes classes += (root+_alt+_hover) + (root+_pane+_alt+_hover); if (type=="resizer" && $El.hasClass(root+_slide)) classes += (root+_slide+_hover) + (root+_pane+_slide+_hover); return $.trim(classes); } , addHover = function (evt, el) { var $E = $(el || this); if (evt && $E.data("layoutRole") === "toggler") evt.stopPropagation(); // prevent triggering 'slide' on Resizer-bar $E.addClass( getHoverClasses($E) ); } , removeHover = function (evt, el) { var $E = $(el || this); $E.removeClass( getHoverClasses($E, true) ); } , onResizerEnter = function (evt) { // ALSO called by toggler.mouseenter if ($.fn.disableSelection) $("body").disableSelection(); } , onResizerLeave = function (evt, el) { var e = el || this // el is only passed when called by the timer , pane = $(e).data("layoutEdge") , name = pane +"ResizerLeave" ; timer.clear(pane+"_openSlider"); // cancel slideOpen timer, if set timer.clear(name); // cancel enableSelection timer - may re/set below // this method calls itself on a timer because it needs to allow // enough time for dragging to kick-in and set the isResizing flag // dragging has a 100ms delay set, so this delay must be >100 if (!el) // 1st call - mouseleave event timer.set(name, function(){ onResizerLeave(evt, e); }, 200); // if user is resizing, then dragStop will enableSelection(), so can skip it here else if (!state[pane].isResizing && $.fn.enableSelection) // 2nd call - by timer $("body").enableSelection(); } /* * ########################### * INITIALIZATION METHODS * ########################### */ /** * Initialize the layout - called automatically whenever an instance of layout is created * * @see none - triggered onInit * @return mixed true = fully initialized | false = panes not initialized (yet) | 'cancel' = abort */ , _create = function () { // initialize config/options initOptions(); var o = options; // TEMP state so isInitialized returns true during init process state.creatingLayout = true; // init plugins for this layout, if there are any (eg: stateManagement) runPluginCallbacks( Instance, $.layout.onCreate ); // options & state have been initialized, so now run beforeLoad callback // onload will CANCEL layout creation if it returns false if (false === _runCallbacks("onload_start")) return 'cancel'; // initialize the container element _initContainer(); // bind hotkey function - keyDown - if required initHotkeys(); // bind window.onunload $(window).bind("unload."+ sID, unload); // init plugins for this layout, if there are any (eg: customButtons) runPluginCallbacks( Instance, $.layout.onLoad ); // if layout elements are hidden, then layout WILL NOT complete initialization! // initLayoutElements will set initialized=true and run the onload callback IF successful if (o.initPanes) _initLayoutElements(); delete state.creatingLayout; return state.initialized; } /** * Initialize the layout IF not already * * @see All methods in Instance run this test * @return boolean true = layoutElements have been initialized | false = panes are not initialized (yet) */ , isInitialized = function () { if (state.initialized || state.creatingLayout) return true; // already initialized else return _initLayoutElements(); // try to init panes NOW } /** * Initialize the layout - called automatically whenever an instance of layout is created * * @see _create() & isInitialized * @return An object pointer to the instance created */ , _initLayoutElements = function (retry) { // initialize config/options var o = options; // CANNOT init panes inside a hidden container! if (!$N.is(":visible")) { // handle Chrome bug where popup window 'has no height' // if layout is BODY element, try again in 50ms // SEE: http://layout.jquery-dev.net/samples/test_popup_window.html if ( !retry && browser.webkit && $N[0].tagName === "BODY" ) setTimeout(function(){ _initLayoutElements(true); }, 50); return false; } // a center pane is required, so make sure it exists if (!getPane("center").length) { if (options.showErrorMessages) _log( lang.errCenterPaneMissing, true ); return false; } // TEMP state so isInitialized returns true during init process state.creatingLayout = true; // update Container dims $.extend(sC, elDims( $N )); // initialize all layout elements initPanes(); // size & position panes - calls initHandles() - which calls initResizable() if (o.scrollToBookmarkOnLoad) { var l = self.location; if (l.hash) l.replace( l.hash ); // scrollTo Bookmark } // check to see if this layout 'nested' inside a pane if (Instance.hasParentLayout) o.resizeWithWindow = false; // bind resizeAll() for 'this layout instance' to window.resize event else if (o.resizeWithWindow) $(window).bind("resize."+ sID, windowResize); delete state.creatingLayout; state.initialized = true; // init plugins for this layout, if there are any runPluginCallbacks( Instance, $.layout.onReady ); // now run the onload callback, if exists _runCallbacks("onload_end"); return true; // elements initialized successfully } /** * Initialize nested layouts - called when _initLayoutElements completes * * NOT CURRENTLY USED * * @see _initLayoutElements * @return An object pointer to the instance created */ , _initChildLayouts = function () { $.each(_c.allPanes, function (idx, pane) { if (options[pane].initChildLayout) createChildLayout( pane ); }); } /** * Initialize nested layouts for a specific pane - can optionally pass layout-options * * @see _initChildLayouts * @param {string} pane The pane being opened, ie: north, south, east, or west * @param {Object=} [opts] Layout-options - if passed, will OVERRRIDE options[pane].childOptions * @return An object pointer to the layout instance created - or null */ , createChildLayout = function (evt_or_pane, opts) { var pane = evtPane.call(this, evt_or_pane) , $P = $Ps[pane] , C = children ; if ($P) { var $C = $Cs[pane] , o = opts || options[pane].childOptions , d = "layout" // determine which element is supposed to be the 'child container' // if pane has a 'containerSelector' OR a 'content-div', use those instead of the pane , $Cont = o.containerSelector ? $P.find( o.containerSelector ) : ($C || $P) , containerFound = $Cont.length // see if a child-layout ALREADY exists on this element , child = containerFound ? (C[pane] = $Cont.data(d) || null) : null ; // if no layout exists, but childOptions are set, try to create the layout now if (!child && containerFound && o) child = C[pane] = $Cont.eq(0).layout(o) || null; if (child) child.hasParentLayout = true; // set parent-flag in child } Instance[pane].child = C[pane]; // ALWAYS set pane-object pointer, even if null } , windowResize = function () { var delay = Number(options.resizeWithWindowDelay); if (delay < 10) delay = 100; // MUST have a delay! // resizing uses a delay-loop because the resize event fires repeatly - except in FF, but delay anyway timer.clear("winResize"); // if already running timer.set("winResize", function(){ timer.clear("winResize"); timer.clear("winResizeRepeater"); var dims = elDims( $N ); // only trigger resizeAll() if container has changed size if (dims.innerWidth !== sC.innerWidth || dims.innerHeight !== sC.innerHeight) resizeAll(); }, delay); // ALSO set fixed-delay timer, if not already running if (!timer.data["winResizeRepeater"]) setWindowResizeRepeater(); } , setWindowResizeRepeater = function () { var delay = Number(options.resizeWithWindowMaxDelay); if (delay > 0) timer.set("winResizeRepeater", function(){ setWindowResizeRepeater(); resizeAll(); }, delay); } , unload = function () { var o = options; _runCallbacks("onunload_start"); // trigger plugin callabacks for this layout (eg: stateManagement) runPluginCallbacks( Instance, $.layout.onUnload ); _runCallbacks("onunload_end"); } /** * Validate and initialize container CSS and events * * @see _create() */ , _initContainer = function () { var N = $N[0] , tag = sC.tagName = N.tagName , id = sC.id = N.id , cls = sC.className = N.className , o = options , name = o.name , fullPage= (tag === "BODY") , props = "overflow,position,margin,padding,border" , css = "layoutCSS" , CSS = {} , hid = "hidden" // used A LOT! // see if this container is a 'pane' inside an outer-layout , parent = $N.data("parentLayout") // parent-layout Instance , pane = $N.data("layoutEdge") // pane-name in parent-layout , isChild = parent && pane ; // sC -> state.container sC.selector = $N.selector.split(".slice")[0]; sC.ref = (o.name ? o.name +' layout / ' : '') + tag + (id ? "#"+id : cls ? '.['+cls+']' : ''); // used in messages $N .data({ layout: Instance , layoutContainer: sID // FLAG to indicate this is a layout-container - contains unique internal ID }) .addClass(o.containerClass) ; var layoutMethods = { destroy: '' , initPanes: '' , resizeAll: 'resizeAll' , resize: 'resizeAll' } , name; // loop hash and bind all methods - include layoutID namespacing for (name in layoutMethods) { $N.bind("layout"+ name.toLowerCase() +"."+ sID, Instance[ layoutMethods[name] || name ]); } // if this container is another layout's 'pane', then set child/parent pointers if (isChild) { // update parent flag Instance.hasParentLayout = true; // set pointers to THIS child-layout (Instance) in parent-layout // NOTE: parent.PANE.child is an ALIAS to parent.children.PANE parent[pane].child = parent.children[pane] = $N.data("layout"); } // SAVE original container CSS for use in destroy() if (!$N.data(css)) { // handle props like overflow different for BODY & HTML - has 'system default' values if (fullPage) { CSS = $.extend( elCSS($N, props), { height: $N.css("height") , overflow: $N.css("overflow") , overflowX: $N.css("overflowX") , overflowY: $N.css("overflowY") }); // ALSO SAVE <HTML> CSS var $H = $("html"); $H.data(css, { height: "auto" // FF would return a fixed px-size! , overflow: $H.css("overflow") , overflowX: $H.css("overflowX") , overflowY: $H.css("overflowY") }); } else // handle props normally for non-body elements CSS = elCSS($N, props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY"); $N.data(css, CSS); } try { // format html/body if this is a full page layout if (fullPage) { $("html").css({ height: "100%" , overflow: hid , overflowX: hid , overflowY: hid }); $("body").css({ position: "relative" , height: "100%" , overflow: hid , overflowX: hid , overflowY: hid , margin: 0 , padding: 0 // TODO: test whether body-padding could be handled? , border: "none" // a body-border creates problems because it cannot be measured! }); // set current layout-container dimensions $.extend(sC, elDims( $N )); } else { // set required CSS for overflow and position // ENSURE container will not 'scroll' CSS = { overflow: hid, overflowX: hid, overflowY: hid } var p = $N.css("position") , h = $N.css("height") ; // if this is a NESTED layout, then container/outer-pane ALREADY has position and height if (!isChild) { if (!p || !p.match(/fixed|absolute|relative/)) CSS.position = "relative"; // container MUST have a 'position' /* if (!h || h=="auto") CSS.height = "100%"; // container MUST have a 'height' */ } $N.css( CSS ); // set current layout-container dimensions if ( $N.is(":visible") ) { $.extend(sC, elDims( $N )); if (o.showErrorMessages && sC.innerHeight < 1) _log( lang.errContainerHeight.replace(/CONTAINER/, sC.ref), true ); } } } catch (ex) {} } /** * Bind layout hotkeys - if options enabled * * @see _create() and addPane() * @param {string=} [panes=""] The edge(s) to process */ , initHotkeys = function (panes) { panes = panes ? panes.split(",") : _c.borderPanes; // bind keyDown to capture hotkeys, if option enabled for ANY pane $.each(panes, function (i, pane) { var o = options[pane]; if (o.enableCursorHotkey || o.customHotkey) { $(document).bind("keydown."+ sID, keyDown); // only need to bind this ONCE return false; // BREAK - binding was done } }); } /** * Build final OPTIONS data * * @see _create() */ , initOptions = function () { var data, d, pane, key, val, i, c, o; // reprocess user's layout-options to have correct options sub-key structure opts = $.layout.transformData( opts ); // panes = default subkey // auto-rename old options for backward compatibility opts = $.layout.backwardCompatibility.renameAllOptions( opts ); // if user-options has 'panes' key (pane-defaults), process it... if (!$.isEmptyObject(opts.panes)) { // REMOVE any pane-defaults that MUST be set per-pane data = $.layout.optionsMap.noDefault; for (i=0, c=data.length; i<c; i++) { key = data[i]; delete opts.panes[key]; // OK if does not exist } // REMOVE any layout-options specified under opts.panes data = $.layout.optionsMap.layout; for (i=0, c=data.length; i<c; i++) { key = data[i]; delete opts.panes[key]; // OK if does not exist } } // MOVE any NON-layout-options to opts.panes data = $.layout.optionsMap.layout; var rootKeys = $.layout.config.optionRootKeys; for (key in opts) { val = opts[key]; if ($.inArray(key, rootKeys) < 0 && $.inArray(key, data) < 0) { if (!opts.panes[key]) opts.panes[key] = $.isPlainObject(val) ? $.extend(true, {}, val) : val; delete opts[key] } } // START by updating ALL options from opts $.extend(true, options, opts); // CREATE final options (and config) for EACH pane $.each(_c.allPanes, function (i, pane) { // apply 'pane-defaults' to CONFIG.[PANE] _c[pane] = $.extend( true, {}, _c.panes, _c[pane] ); d = options.panes; o = options[pane]; // center-pane uses SOME keys in defaults.panes branch if (pane === 'center') { // ONLY copy keys from opts.panes listed in: $.layout.optionsMap.center data = $.layout.optionsMap.center; // list of 'center-pane keys' for (i=0, c=data.length; i<c; i++) { // loop the list... key = data[i]; // only need to use pane-default if pane-specific value not set if (!opts.center[key] && (opts.panes[key] || !o[key])) o[key] = d[key]; // pane-default } } else { // border-panes use ALL keys in defaults.panes branch o = options[pane] = $.extend({}, d, o); // re-apply pane-specific opts AFTER pane-defaults createFxOptions( pane ); // ensure all border-pane-specific base-classes exist if (!o.resizerClass) o.resizerClass = "ui-layout-resizer"; if (!o.togglerClass) o.togglerClass = "ui-layout-toggler"; } // ensure we have base pane-class (ALL panes) if (!o.paneClass) o.paneClass = "ui-layout-pane"; }); // update options.zIndexes if a zIndex-option specified var zo = opts.zIndex , z = options.zIndexes; if (zo > 0) { z.pane_normal = zo; z.content_mask = max(zo+1, z.content_mask); // MIN = +1 z.resizer_normal = max(zo+2, z.resizer_normal); // MIN = +2 } function createFxOptions ( pane ) { var o = options[pane] , d = options.panes; // ensure fxSettings key to avoid errors if (!o.fxSettings) o.fxSettings = {}; if (!d.fxSettings) d.fxSettings = {}; $.each(["_open","_close","_size"], function (i,n) { var sName = "fxName"+ n , sSpeed = "fxSpeed"+ n , sSettings = "fxSettings"+ n // recalculate fxName according to specificity rules , fxName = o[sName] = o[sName] // options.west.fxName_open || d[sName] // options.panes.fxName_open || o.fxName // options.west.fxName || d.fxName // options.panes.fxName || "none" // MEANS $.layout.defaults.panes.fxName == "" || false || null || 0 ; // validate fxName to ensure is valid effect - MUST have effect-config data in options.effects if (fxName === "none" || !$.effects || !$.effects[fxName] || !options.effects[fxName]) fxName = o[sName] = "none"; // effect not loaded OR unrecognized fxName // set vars for effects subkeys to simplify logic var fx = options.effects[fxName] || {} // effects.slide , fx_all = fx.all || null // effects.slide.all , fx_pane = fx[pane] || null // effects.slide.west ; // create fxSpeed[_open|_close|_size] o[sSpeed] = o[sSpeed] // options.west.fxSpeed_open || d[sSpeed] // options.west.fxSpeed_open || o.fxSpeed // options.west.fxSpeed || d.fxSpeed // options.panes.fxSpeed || null // DEFAULT - let fxSetting.duration control speed ; // create fxSettings[_open|_close|_size] o[sSettings] = $.extend( {} , fx_all // effects.slide.all , fx_pane // effects.slide.west , d.fxSettings // options.panes.fxSettings , o.fxSettings // options.west.fxSettings , d[sSettings] // options.panes.fxSettings_open , o[sSettings] // options.west.fxSettings_open ); }); // DONE creating action-specific-settings for this pane, // so DELETE generic options - are no longer meaningful delete o.fxName; delete o.fxSpeed; delete o.fxSettings; } // DELETE 'panes' key now that we are done - values were copied to EACH pane delete options.panes; } /** * Initialize module objects, styling, size and position for all panes * * @see _initElements() * @param {string} pane The pane to process */ , getPane = function (pane) { var sel = options[pane].paneSelector if (sel.substr(0,1)==="#") // ID selector // NOTE: elements selected 'by ID' DO NOT have to be 'children' return $N.find(sel).eq(0); else { // class or other selector var $P = $N.children(sel).eq(0); // look for the pane nested inside a 'form' element return $P.length ? $P : $N.children("form:first").children(sel).eq(0); } } , initPanes = function () { // NOTE: do north & south FIRST so we can measure their height - do center LAST $.each(_c.allPanes, function (idx, pane) { addPane( pane, true ); }); // init the pane-handles NOW in case we have to hide or close the pane below initHandles(); // now that all panes have been initialized and initially-sized, // make sure there is really enough space available for each pane $.each(_c.borderPanes, function (i, pane) { if ($Ps[pane] && state[pane].isVisible) { // pane is OPEN setSizeLimits(pane); makePaneFit(pane); // pane may be Closed, Hidden or Resized by makePaneFit() } }); // size center-pane AGAIN in case we 'closed' a border-pane in loop above sizeMidPanes("center"); // Chrome/Webkit sometimes fires callbacks BEFORE it completes resizing! // Before RC30.3, there was a 10ms delay here, but that caused layout // to load asynchrously, which is BAD, so try skipping delay for now // process pane contents and callbacks, and init/resize child-layout if exists $.each(_c.allPanes, function (i, pane) { var o = options[pane]; if ($Ps[pane]) { if (state[pane].isVisible) { // pane is OPEN sizeContent(pane); // trigger pane.onResize if triggerEventsOnLoad = true if (o.triggerEventsOnLoad) _runCallbacks("onresize_end", pane); else // automatic if onresize called, otherwise call it specifically // resize child - IF inner-layout already exists (created before this layout) resizeChildLayout(pane); } // init childLayout - even if pane is not visible if (o.initChildLayout && o.childOptions) createChildLayout(pane); } }); } /** * Add a pane to the layout - subroutine of initPanes() * * @see initPanes() * @param {string} pane The pane to process * @param {boolean=} [force=false] Size content after init */ , addPane = function (pane, force) { if (!force && !isInitialized()) return; var o = options[pane] , s = state[pane] , c = _c[pane] , fx = s.fx , dir = c.dir , spacing = o.spacing_open || 0 , isCenter = (pane === "center") , CSS = {} , $P = $Ps[pane] , size, minSize, maxSize ; // if pane-pointer already exists, remove the old one first if ($P) removePane( pane, false, true, false ); else $Cs[pane] = false; // init $P = $Ps[pane] = getPane(pane); if (!$P.length) { $Ps[pane] = false; // logic return; } // SAVE original Pane CSS if (!$P.data("layoutCSS")) { var props = "position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"; $P.data("layoutCSS", elCSS($P, props)); } // create alias for pane data in Instance - initHandles will add more Instance[pane] = { name: pane, pane: $Ps[pane], content: $Cs[pane], options: options[pane], state: state[pane], child: children[pane] }; // add classes, attributes & events $P .data({ parentLayout: Instance // pointer to Layout Instance , layoutPane: Instance[pane] // NEW pointer to pane-alias-object , layoutEdge: pane , layoutRole: "pane" }) .css(c.cssReq).css("zIndex", options.zIndexes.pane_normal) .css(o.applyDemoStyles ? c.cssDemo : {}) // demo styles .addClass( o.paneClass +" "+ o.paneClass+"-"+pane ) // default = "ui-layout-pane ui-layout-pane-west" - may be a dupe of 'paneSelector' .bind("mouseenter."+ sID, addHover ) .bind("mouseleave."+ sID, removeHover ) ; var paneMethods = { hide: '' , show: '' , toggle: '' , close: '' , open: '' , slideOpen: '' , slideClose: '' , slideToggle: '' , size: 'manualSizePane' , sizePane: 'manualSizePane' , sizeContent: '' , sizeHandles: '' , enableClosable: '' , disableClosable: '' , enableSlideable: '' , disableSlideable: '' , enableResizable: '' , disableResizable: '' , swapPanes: 'swapPanes' , swap: 'swapPanes' , move: 'swapPanes' , removePane: 'removePane' , remove: 'removePane' , createChildLayout: '' , resizeChildLayout: '' , resizeAll: 'resizeAll' , resizeLayout: 'resizeAll' } , name; // loop hash and bind all methods - include layoutID namespacing for (name in paneMethods) { $P.bind("layoutpane"+ name.toLowerCase() +"."+ sID, Instance[ paneMethods[name] || name ]); } // see if this pane has a 'scrolling-content element' initContent(pane, false); // false = do NOT sizeContent() - called later if (!isCenter) { // call _parseSize AFTER applying pane classes & styles - but before making visible (if hidden) // if o.size is auto or not valid, then MEASURE the pane and use that as its 'size' size = s.size = _parseSize(pane, o.size); minSize = _parseSize(pane,o.minSize) || 1; maxSize = _parseSize(pane,o.maxSize) || 100000; if (size > 0) size = max(min(size, maxSize), minSize); // state for border-panes s.isClosed = false; // true = pane is closed s.isSliding = false; // true = pane is currently open by 'sliding' over adjacent panes s.isResizing= false; // true = pane is in process of being resized s.isHidden = false; // true = pane is hidden - no spacing, resizer or toggler is visible! // array for 'pin buttons' whose classNames are auto-updated on pane-open/-close if (!s.pins) s.pins = []; } // states common to ALL panes s.tagName = $P[0].tagName; s.edge = pane; // useful if pane is (or about to be) 'swapped' - easy find out where it is (or is going) s.noRoom = false; // true = pane 'automatically' hidden due to insufficient room - will unhide automatically s.isVisible = true; // false = pane is invisible - closed OR hidden - simplify logic // set css-position to account for container borders & padding switch (pane) { case "north": CSS.top = sC.insetTop; CSS.left = sC.insetLeft; CSS.right = sC.insetRight; break; case "south": CSS.bottom = sC.insetBottom; CSS.left = sC.insetLeft; CSS.right = sC.insetRight; break; case "west": CSS.left = sC.insetLeft; // top, bottom & height set by sizeMidPanes() break; case "east": CSS.right = sC.insetRight; // ditto break; case "center": // top, left, width & height set by sizeMidPanes() } if (dir === "horz") // north or south pane CSS.height = cssH($P, size); else if (dir === "vert") // east or west pane CSS.width = cssW($P, size); //else if (isCenter) {} $P.css(CSS); // apply size -- top, bottom & height will be set by sizeMidPanes if (dir != "horz") sizeMidPanes(pane, true); // true = skipCallback // close or hide the pane if specified in settings if (o.initClosed && o.closable && !o.initHidden) close(pane, true, true); // true, true = force, noAnimation else if (o.initHidden || o.initClosed) hide(pane); // will be completely invisible - no resizer or spacing else if (!s.noRoom) // make the pane visible - in case was initially hidden $P.css("display","block"); // ELSE setAsOpen() - called later by initHandles() // RESET visibility now - pane will appear IF display:block $P.css("visibility","visible"); // check option for auto-handling of pop-ups & drop-downs if (o.showOverflowOnHover) $P.hover( allowOverflow, resetOverflow ); // if manually adding a pane AFTER layout initialization, then... if (state.initialized) { initHandles( pane ); initHotkeys( pane ); resizeAll(); // will sizeContent if pane is visible if (s.isVisible) { // pane is OPEN if (o.triggerEventsOnLoad) _runCallbacks("onresize_end", pane); else // automatic if onresize called, otherwise call it specifically // resize child - IF inner-layout already exists (created before this layout) resizeChildLayout(pane); // a previously existing childLayout } if (o.initChildLayout && o.childOptions) createChildLayout(pane); } } /** * Initialize module objects, styling, size and position for all resize bars and toggler buttons * * @see _create() * @param {string=} [panes=""] The edge(s) to process */ , initHandles = function (panes) { panes = panes ? panes.split(",") : _c.borderPanes; // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV $.each(panes, function (i, pane) { var $P = $Ps[pane]; $Rs[pane] = false; // INIT $Ts[pane] = false; if (!$P) return; // pane does not exist - skip var o = options[pane] , s = state[pane] , c = _c[pane] , rClass = o.resizerClass , tClass = o.togglerClass , side = c.side.toLowerCase() , spacing = (s.isVisible ? o.spacing_open : o.spacing_closed) , _pane = "-"+ pane // used for classNames , _state = (s.isVisible ? "-open" : "-closed") // used for classNames , I = Instance[pane] // INIT RESIZER BAR , $R = I.resizer = $Rs[pane] = $("<div></div>") // INIT TOGGLER BUTTON , $T = I.toggler = (o.closable ? $Ts[pane] = $("<div></div>") : false) ; //if (s.isVisible && o.resizable) ... handled by initResizable if (!s.isVisible && o.slidable) $R.attr("title", o.sliderTip).css("cursor", o.sliderCursor); $R // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "paneLeft-resizer" .attr("id", (o.paneSelector.substr(0,1)=="#" ? o.paneSelector.substr(1) + "-resizer" : "")) .data({ parentLayout: Instance , layoutPane: Instance[pane] // NEW pointer to pane-alias-object , layoutEdge: pane , layoutRole: "resizer" }) .css(_c.resizers.cssReq).css("zIndex", options.zIndexes.resizer_normal) .css(o.applyDemoStyles ? _c.resizers.cssDemo : {}) // add demo styles .addClass(rClass +" "+ rClass+_pane) .hover(addHover, removeHover) // ALWAYS add hover-classes, even if resizing is not enabled - handle with CSS instead .hover(onResizerEnter, onResizerLeave) // ALWAYS NEED resizer.mouseleave to balance toggler.mouseenter .appendTo($N) // append DIV to container ; if ($T) { $T // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "#paneLeft-toggler" .attr("id", (o.paneSelector.substr(0,1)=="#" ? o.paneSelector.substr(1) + "-toggler" : "")) .data({ parentLayout: Instance , layoutPane: Instance[pane] // NEW pointer to pane-alias-object , layoutEdge: pane , layoutRole: "toggler" }) .css(_c.togglers.cssReq) // add base/required styles .css(o.applyDemoStyles ? _c.togglers.cssDemo : {}) // add demo styles .addClass(tClass +" "+ tClass+_pane) .hover(addHover, removeHover) // ALWAYS add hover-classes, even if toggling is not enabled - handle with CSS instead .bind("mouseenter", onResizerEnter) // NEED toggler.mouseenter because mouseenter MAY NOT fire on resizer .appendTo($R) // append SPAN to resizer DIV ; // ADD INNER-SPANS TO TOGGLER if (o.togglerContent_open) // ui-layout-open $("<span>"+ o.togglerContent_open +"</span>") .data({ layoutEdge: pane , layoutRole: "togglerContent" }) .data("layoutRole", "togglerContent") .data("layoutEdge", pane) .addClass("content content-open") .css("display","none") .appendTo( $T ) //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-open instead! ; if (o.togglerContent_closed) // ui-layout-closed $("<span>"+ o.togglerContent_closed +"</span>") .data({ layoutEdge: pane , layoutRole: "togglerContent" }) .addClass("content content-closed") .css("display","none") .appendTo( $T ) //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-closed instead! ; // ADD TOGGLER.click/.hover enableClosable(pane); } // add Draggable events initResizable(pane); // ADD CLASSNAMES & SLIDE-BINDINGS - eg: class="resizer resizer-west resizer-open" if (s.isVisible) setAsOpen(pane); // onOpen will be called, but NOT onResize else { setAsClosed(pane); // onClose will be called bindStartSlidingEvent(pane, true); // will enable events IF option is set } }); // SET ALL HANDLE DIMENSIONS sizeHandles(); } /** * Initialize scrolling ui-layout-content div - if exists * * @see initPane() - or externally after an Ajax injection * @param {string} [pane] The pane to process * @param {boolean=} [resize=true] Size content after init */ , initContent = function (pane, resize) { if (!isInitialized()) return; var o = options[pane] , sel = o.contentSelector , I = Instance[pane] , $P = $Ps[pane] , $C ; if (sel) $C = I.content = $Cs[pane] = (o.findNestedContent) ? $P.find(sel).eq(0) // match 1-element only : $P.children(sel).eq(0) ; if ($C && $C.length) { $C.data("layoutRole", "content"); // SAVE original Pane CSS if (!$C.data("layoutCSS")) $C.data("layoutCSS", elCSS($C, "height")); $C.css( _c.content.cssReq ); if (o.applyDemoStyles) { $C.css( _c.content.cssDemo ); // add padding & overflow: auto to content-div $P.css( _c.content.cssDemoPane ); // REMOVE padding/scrolling from pane } state[pane].content = {}; // init content state if (resize !== false) sizeContent(pane); // sizeContent() is called AFTER init of all elements } else I.content = $Cs[pane] = false; } /** * Add resize-bars to all panes that specify it in options * -dependancy: $.fn.resizable - will skip if not found * * @see _create() * @param {string=} [panes=""] The edge(s) to process */ , initResizable = function (panes) { var draggingAvailable = $.layout.plugins.draggable , side // set in start() ; panes = panes ? panes.split(",") : _c.borderPanes; $.each(panes, function (idx, pane) { var o = options[pane]; if (!draggingAvailable || !$Ps[pane] || !o.resizable) { o.resizable = false; return true; // skip to next } var s = state[pane] , z = options.zIndexes , c = _c[pane] , side = c.dir=="horz" ? "top" : "left" , opEdge = _c.oppositeEdge[pane] , masks = pane +",center,"+ opEdge + (c.dir=="horz" ? ",west,east" : "") , $P = $Ps[pane] , $R = $Rs[pane] , base = o.resizerClass , lastPos = 0 // used when live-resizing , r, live // set in start because may change // 'drag' classes are applied to the ORIGINAL resizer-bar while dragging is in process , resizerClass = base+"-drag" // resizer-drag , resizerPaneClass = base+"-"+pane+"-drag" // resizer-north-drag // 'helper' class is applied to the CLONED resizer-bar while it is being dragged , helperClass = base+"-dragging" // resizer-dragging , helperPaneClass = base+"-"+pane+"-dragging" // resizer-north-dragging , helperLimitClass = base+"-dragging-limit" // resizer-drag , helperPaneLimitClass = base+"-"+pane+"-dragging-limit" // resizer-north-drag , helperClassesSet = false // logic var ; if (!s.isClosed) $R.attr("title", o.resizerTip) .css("cursor", o.resizerCursor); // n-resize, s-resize, etc $R.draggable({ containment: $N[0] // limit resizing to layout container , axis: (c.dir=="horz" ? "y" : "x") // limit resizing to horz or vert axis , delay: 0 , distance: 1 , grid: o.resizingGrid // basic format for helper - style it using class: .ui-draggable-dragging , helper: "clone" , opacity: o.resizerDragOpacity , addClasses: false // avoid ui-state-disabled class when disabled //, iframeFix: o.draggableIframeFix // TODO: consider using when bug is fixed , zIndex: z.resizer_drag , start: function (e, ui) { // REFRESH options & state pointers in case we used swapPanes o = options[pane]; s = state[pane]; // re-read options live = o.livePaneResizing; // ondrag_start callback - will CANCEL hide if returns false // TODO: dragging CANNOT be cancelled like this, so see if there is a way? if (false === _runCallbacks("ondrag_start", pane)) return false; s.isResizing = true; // prevent pane from closing while resizing timer.clear(pane+"_closeSlider"); // just in case already triggered // SET RESIZER LIMITS - used in drag() setSizeLimits(pane); // update pane/resizer state r = s.resizerPosition; lastPos = ui.position[ side ] $R.addClass( resizerClass +" "+ resizerPaneClass ); // add drag classes helperClassesSet = false; // reset logic var - see drag() // DISABLE TEXT SELECTION (probably already done by resizer.mouseOver) $('body').disableSelection(); // MASK PANES CONTAINING IFRAMES, APPLETS OR OTHER TROUBLESOME ELEMENTS showMasks( masks ); } , drag: function (e, ui) { if (!helperClassesSet) { // can only add classes after clone has been added to the DOM //$(".ui-draggable-dragging") ui.helper .addClass( helperClass +" "+ helperPaneClass ) // add helper classes .css({ right: "auto", bottom: "auto" }) // fix dir="rtl" issue .children().css("visibility","hidden") // hide toggler inside dragged resizer-bar ; helperClassesSet = true; // draggable bug!? RE-SET zIndex to prevent E/W resize-bar showing through N/S pane! if (s.isSliding) $Ps[pane].css("zIndex", z.pane_sliding); } // CONTAIN RESIZER-BAR TO RESIZING LIMITS var limit = 0; if (ui.position[side] < r.min) { ui.position[side] = r.min; limit = -1; } else if (ui.position[side] > r.max) { ui.position[side] = r.max; limit = 1; } // ADD/REMOVE dragging-limit CLASS if (limit) { ui.helper.addClass( helperLimitClass +" "+ helperPaneLimitClass ); // at dragging-limit window.defaultStatus = (limit>0 && pane.match(/north|west/)) || (limit<0 && pane.match(/south|east/)) ? lang.maxSizeWarning : lang.minSizeWarning; } else { ui.helper.removeClass( helperLimitClass +" "+ helperPaneLimitClass ); // not at dragging-limit window.defaultStatus = ""; } // DYNAMICALLY RESIZE PANES IF OPTION ENABLED // won't trigger unless resizer has actually moved! if (live && Math.abs(ui.position[side] - lastPos) >= o.liveResizingTolerance) { lastPos = ui.position[side]; resizePanes(e, ui, pane) } } , stop: function (e, ui) { $('body').enableSelection(); // RE-ENABLE TEXT SELECTION window.defaultStatus = ""; // clear 'resizing limit' message from statusbar $R.removeClass( resizerClass +" "+ resizerPaneClass ); // remove drag classes from Resizer s.isResizing = false; resizePanes(e, ui, pane, true, masks); // true = resizingDone } }); }); /** * resizePanes * * Sub-routine called from stop() - and drag() if livePaneResizing * * @param {!Object} evt * @param {!Object} ui * @param {string} pane * @param {boolean=} [resizingDone=false] */ var resizePanes = function (evt, ui, pane, resizingDone, masks) { var dragPos = ui.position , c = _c[pane] , o = options[pane] , s = state[pane] , resizerPos ; switch (pane) { case "north": resizerPos = dragPos.top; break; case "west": resizerPos = dragPos.left; break; case "south": resizerPos = sC.offsetHeight - dragPos.top - o.spacing_open; break; case "east": resizerPos = sC.offsetWidth - dragPos.left - o.spacing_open; break; }; // remove container margin from resizer position to get the pane size var newSize = resizerPos - sC["inset"+ c.side]; // Disable OR Resize Mask(s) created in drag.start if (!resizingDone) { // ensure we meet liveResizingTolerance criteria if (Math.abs(newSize - s.size) < o.liveResizingTolerance) return; // SKIP resize this time // resize the pane manualSizePane(pane, newSize, false, true); // true = noAnimation sizeMasks(); // resize all visible masks } else { // resizingDone // ondrag_end callback if (false !== _runCallbacks("ondrag_end", pane)) manualSizePane(pane, newSize, false, true); // true = noAnimation hideMasks(); // hide all masks, which include panes with 'content/iframe-masks' if (s.isSliding && masks) // RE-SHOW only 'object-masks' so objects won't show through sliding pane showMasks( masks, true ); // true = onlyForObjects } }; } /** * sizeMask * * Needed to overlay a DIV over an IFRAME-pane because mask CANNOT be *inside* the pane * Called when mask created, and during livePaneResizing */ , sizeMask = function () { var $M = $(this) , pane = $M.data("layoutMask") // eg: "west" , s = state[pane] ; // only masks over an IFRAME-pane need manual resizing if (s.tagName == "IFRAME" && s.isVisible) // no need to mask closed/hidden panes $M.css({ top: s.offsetTop , left: s.offsetLeft , width: s.outerWidth , height: s.outerHeight }); /* ALT Method... var $P = $Ps[pane]; $M.css( $P.position() ).css({ width: $P[0].offsetWidth, height: $P[0].offsetHeight }); */ } , sizeMasks = function () { $Ms.each( sizeMask ); // resize all 'visible' masks } , showMasks = function (panes, onlyForObjects) { var a = panes ? panes.split(",") : $.layout.config.allPanes , z = options.zIndexes , o, s; $.each(a, function(i,p){ s = state[p]; o = options[p]; if (s.isVisible && ( (!onlyForObjects && o.maskContents) || o.maskObjects )) { getMasks(p).each(function(){ sizeMask.call(this); this.style.zIndex = s.isSliding ? z.pane_sliding+1 : z.pane_normal+1 this.style.display = "block"; }); } }); } , hideMasks = function () { // ensure no pane is resizing - could be a timing issue var skip; $.each( $.layout.config.borderPanes, function(i,p){ if (state[p].isResizing) { skip = true; return false; // BREAK } }); if (!skip) $Ms.hide(); // hide ALL masks } , getMasks = function (pane) { var $Masks = $([]) , $M, i = 0, c = $Ms.length ; for (; i<c; i++) { $M = $Ms.eq(i); if ($M.data("layoutMask") === pane) $Masks = $Masks.add( $M ); } if ($Masks.length) return $Masks; else return createMasks(pane); } /** * createMasks * * Generates both DIV (ALWAYS used) and IFRAME (optional) elements as masks * An IFRAME mask is created *under* the DIV when maskObjects=true, because a DIV cannot mask an applet */ , createMasks = function (pane) { var $P = $Ps[pane] , s = state[pane] , o = options[pane] , z = options.zIndexes //, objMask = o.maskObjects && s.tagName != "IFRAME" // check for option , $Masks = $([]) , isIframe, el, $M, css, i ; if (!o.maskContents && !o.maskObjects) return $Masks; // if o.maskObjects=true, then loop TWICE to create BOTH kinds of mask, else only create a DIV for (i=0; i < (o.maskObjects ? 2 : 1); i++) { isIframe = o.maskObjects && i==0; el = document.createElement( isIframe ? "iframe" : "div" ); $M = $(el).data("layoutMask", pane); // add data to relate mask to pane el.className = "ui-layout-mask ui-layout-mask-"+ pane; // for user styling css = el.style; // styles common to both DIVs and IFRAMES css.display = "block"; css.position = "absolute"; if (isIframe) { // IFRAME-only props el.frameborder = 0; el.src = "about:blank"; css.opacity = 0; css.filter = "Alpha(Opacity='0')"; css.border = 0; } // if pane is an IFRAME, then must mask the pane itself if (s.tagName == "IFRAME") { // NOTE sizing done by a subroutine so can be called during live-resizing css.zIndex = z.pane_normal+1; // 1-higher than pane $N.append( el ); // append to LAYOUT CONTAINER } // otherwise put masks *inside the pane* to mask its contents else { $M.addClass("ui-layout-mask-inside-pane"); css.zIndex = o.maskZindex || z.content_mask; // usually 1, but customizable css.top = 0; css.left = 0; css.width = "100%"; css.height = "100%"; $P.append( el ); // append INSIDE pane element } // add to return object $Masks = $Masks.add( el ); // add Mask to cached array so can be resized & reused $Ms = $Ms.add( el ); } return $Masks; } /** * Destroy this layout and reset all elements * * @param {boolean=} [destroyChildren=false] Destory Child-Layouts first? */ , destroy = function (destroyChildren) { // UNBIND layout events and remove global object $(window).unbind("."+ sID); // resize & unload $(document).unbind("."+ sID); // keyDown (hotkeys) // need to look for parent layout BEFORE we remove the container data, else skips a level //var parentPane = Instance.hasParentLayout ? $.layout.getParentPaneInstance( $N ) : null; // reset layout-container $N .clearQueue() .removeData("layout") .removeData("layoutContainer") .removeClass(options.containerClass) .unbind("."+ sID) // remove ALL Layout events ; // remove all mask elements that have been created $Ms.remove(); // loop all panes to remove layout classes, attributes and bindings $.each(_c.allPanes, function (i, pane) { removePane( pane, false, true, destroyChildren ); // true = skipResize }); // do NOT reset container CSS if is a 'pane' (or 'content') in an outer-layout - ie, THIS layout is 'nested' var css = "layoutCSS"; if ($N.data(css) && !$N.data("layoutRole")) // RESET CSS $N.css( $N.data(css) ).removeData(css); // for full-page layouts, also reset the <HTML> CSS if (sC.tagName === "BODY" && ($N = $("html")).data(css)) // RESET <HTML> CSS $N.css( $N.data(css) ).removeData(css); // trigger plugins for this layout, if there are any runPluginCallbacks( Instance, $.layout.onDestroy ); // trigger state-management and onunload callback unload(); // clear the Instance of everything except for container & options (so could recreate) // RE-CREATE: myLayout = myLayout.container.layout( myLayout.options ); for (n in Instance) if (!n.match(/^(container|options)$/)) delete Instance[ n ]; // add a 'destroyed' flag to make it easy to check Instance.destroyed = true; // if this is a child layout, CLEAR the child-pointer in the parent /* for now the pointer REMAINS, but with only container, options and destroyed keys if (parentPane) { var layout = parentPane.pane.data("parentLayout"); parentPane.child = layout.children[ parentPane.name ] = null; } */ return Instance; // for coding convenience } /** * Remove a pane from the layout - subroutine of destroy() * * @see destroy() * @param {string} pane The pane to process * @param {boolean=} [remove=false] Remove the DOM element? * @param {boolean=} [skipResize=false] Skip calling resizeAll()? */ , removePane = function (evt_or_pane, remove, skipResize, destroyChild) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $P = $Ps[pane] , $C = $Cs[pane] , $R = $Rs[pane] , $T = $Ts[pane] ; //alert( '$P.length = '+ $P.length ); // NOTE: elements can still exist even after remove() // so check for missing data(), which is cleared by removed() if ($P && $.isEmptyObject( $P.data() )) $P = false; if ($C && $.isEmptyObject( $C.data() )) $C = false; if ($R && $.isEmptyObject( $R.data() )) $R = false; if ($T && $.isEmptyObject( $T.data() )) $T = false; if ($P) $P.stop(true, true); // check for a child layout var o = options[pane] , s = state[pane] , d = "layout" , css = "layoutCSS" , child = children[pane] || ($P ? $P.data(d) : 0) || ($C ? $C.data(d) : 0) || null , destroy = destroyChild !== undefined ? destroyChild : o.destroyChildLayout ; // FIRST destroy the child-layout(s) if (destroy && child && !child.destroyed) { child.destroy(true); // tell child-layout to destroy ALL its child-layouts too if (child.destroyed) // destroy was successful child = null; // clear pointer for logic below } if ($P && remove && !child) $P.remove(); else if ($P && $P[0]) { // create list of ALL pane-classes that need to be removed var root = o.paneClass // default="ui-layout-pane" , pRoot = root +"-"+ pane // eg: "ui-layout-pane-west" , _open = "-open" , _sliding= "-sliding" , _closed = "-closed" , classes = [ root, root+_open, root+_closed, root+_sliding, // generic classes pRoot, pRoot+_open, pRoot+_closed, pRoot+_sliding ] // pane-specific classes ; $.merge(classes, getHoverClasses($P, true)); // ADD hover-classes // remove all Layout classes from pane-element $P .removeClass( classes.join(" ") ) // remove ALL pane-classes .removeData("parentLayout") .removeData("layoutPane") .removeData("layoutRole") .removeData("layoutEdge") .removeData("autoHidden") // in case set .unbind("."+ sID) // remove ALL Layout events // TODO: remove these extra unbind commands when jQuery is fixed //.unbind("mouseenter"+ sID) //.unbind("mouseleave"+ sID) ; // do NOT reset CSS if this pane/content is STILL the container of a nested layout! // the nested layout will reset its 'container' CSS when/if it is destroyed if ($C && $C.data(d)) { // a content-div may not have a specific width, so give it one to contain the Layout $C.width( $C.width() ); child.resizeAll(); // now resize the Layout } else if ($C) $C.css( $C.data(css) ).removeData(css).removeData("layoutRole"); // remove pane AFTER content in case there was a nested layout if (!$P.data(d)) $P.css( $P.data(css) ).removeData(css); } // REMOVE pane resizer and toggler elements if ($T) $T.remove(); if ($R) $R.remove(); // CLEAR all pointers and state data Instance[pane] = $Ps[pane] = $Cs[pane] = $Rs[pane] = $Ts[pane] = children[pane] = false; s = { removed: true }; if (!skipResize) resizeAll(); } /* * ########################### * ACTION METHODS * ########################### */ , _hidePane = function (pane) { var $P = $Ps[pane] , o = options[pane] , s = $P[0].style ; if (o.useOffscreenClose) { if (!$P.data(_c.offscreenReset)) $P.data(_c.offscreenReset, { left: s.left, right: s.right }); $P.css( _c.offscreenCSS ); } else $P.hide().removeData(_c.offscreenReset); } , _showPane = function (pane) { var $P = $Ps[pane] , o = options[pane] , off = _c.offscreenCSS , old = $P.data(_c.offscreenReset) , s = $P[0].style ; $P .show() // ALWAYS show, just in case .removeData(_c.offscreenReset); if (o.useOffscreenClose && old) { if (s.left == off.left) s.left = old.left; if (s.right == off.right) s.right = old.right; } } /** * Completely 'hides' a pane, including its spacing - as if it does not exist * The pane is not actually 'removed' from the source, so can use 'show' to un-hide it * * @param {string} pane The pane being hidden, ie: north, south, east, or west * @param {boolean=} [noAnimation=false] */ , hide = function (evt_or_pane, noAnimation) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] ; if (!$P || s.isHidden) return; // pane does not exist OR is already hidden // onhide_start callback - will CANCEL hide if returns false if (state.initialized && false === _runCallbacks("onhide_start", pane)) return; s.isSliding = false; // just in case // now hide the elements if ($R) $R.hide(); // hide resizer-bar if (!state.initialized || s.isClosed) { s.isClosed = true; // to trigger open-animation on show() s.isHidden = true; s.isVisible = false; if (!state.initialized) _hidePane(pane); // no animation when loading page sizeMidPanes(_c[pane].dir === "horz" ? "" : "center"); if (state.initialized || o.triggerEventsOnLoad) _runCallbacks("onhide_end", pane); } else { s.isHiding = true; // used by onclose close(pane, false, noAnimation); // adjust all panes to fit } } /** * Show a hidden pane - show as 'closed' by default unless openPane = true * * @param {string} pane The pane being opened, ie: north, south, east, or west * @param {boolean=} [openPane=false] * @param {boolean=} [noAnimation=false] * @param {boolean=} [noAlert=false] */ , show = function (evt_or_pane, openPane, noAnimation, noAlert) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] ; if (!$P || !s.isHidden) return; // pane does not exist OR is not hidden // onshow_start callback - will CANCEL show if returns false if (false === _runCallbacks("onshow_start", pane)) return; s.isSliding = false; // just in case s.isShowing = true; // used by onopen/onclose //s.isHidden = false; - will be set by open/close - if not cancelled // now show the elements //if ($R) $R.show(); - will be shown by open/close if (openPane === false) close(pane, true); // true = force else open(pane, false, noAnimation, noAlert); // adjust all panes to fit } /** * Toggles a pane open/closed by calling either open or close * * @param {string} pane The pane being toggled, ie: north, south, east, or west * @param {boolean=} [slide=false] */ , toggle = function (evt_or_pane, slide) { if (!isInitialized()) return; var evt = evtObj(evt_or_pane) , pane = evtPane.call(this, evt_or_pane) , s = state[pane] ; if (evt) // called from to $R.dblclick OR triggerPaneEvent evt.stopImmediatePropagation(); if (s.isHidden) show(pane); // will call 'open' after unhiding it else if (s.isClosed) open(pane, !!slide); else close(pane); } /** * Utility method used during init or other auto-processes * * @param {string} pane The pane being closed * @param {boolean=} [setHandles=false] */ , _closePane = function (pane, setHandles) { var $P = $Ps[pane] , s = state[pane] ; _hidePane(pane); s.isClosed = true; s.isVisible = false; // UNUSED: if (setHandles) setAsClosed(pane, true); // true = force } /** * Close the specified pane (animation optional), and resize all other panes as needed * * @param {string} pane The pane being closed, ie: north, south, east, or west * @param {boolean=} [force=false] * @param {boolean=} [noAnimation=false] * @param {boolean=} [skipCallback=false] */ , close = function (evt_or_pane, force, noAnimation, skipCallback) { var pane = evtPane.call(this, evt_or_pane); // if pane has been initialized, but NOT the complete layout, close pane instantly if (!state.initialized && $Ps[pane]) { _closePane(pane); // INIT pane as closed return; } if (!isInitialized()) return; var $P = $Ps[pane] , $R = $Rs[pane] , $T = $Ts[pane] , o = options[pane] , s = state[pane] , c = _c[pane] , doFX, isShowing, isHiding, wasSliding; // QUEUE in case another action/animation is in progress $N.queue(function( queueNext ){ if ( !$P || (!o.closable && !s.isShowing && !s.isHiding) // invalid request // (!o.resizable && !o.closable) ??? || (!force && s.isClosed && !s.isShowing) // already closed ) return queueNext(); // onclose_start callback - will CANCEL hide if returns false // SKIP if just 'showing' a hidden pane as 'closed' var abort = !s.isShowing && false === _runCallbacks("onclose_start", pane); // transfer logic vars to temp vars isShowing = s.isShowing; isHiding = s.isHiding; wasSliding = s.isSliding; // now clear the logic vars (REQUIRED before aborting) delete s.isShowing; delete s.isHiding; if (abort) return queueNext(); doFX = !noAnimation && !s.isClosed && (o.fxName_close != "none"); s.isMoving = true; s.isClosed = true; s.isVisible = false; // update isHidden BEFORE sizing panes if (isHiding) s.isHidden = true; else if (isShowing) s.isHidden = false; if (s.isSliding) // pane is being closed, so UNBIND trigger events bindStopSlidingEvents(pane, false); // will set isSliding=false else // resize panes adjacent to this one sizeMidPanes(_c[pane].dir === "horz" ? "" : "center", false); // false = NOT skipCallback // if this pane has a resizer bar, move it NOW - before animation setAsClosed(pane); // CLOSE THE PANE if (doFX) { // animate the close // mask panes with objects var masks = "center"+ (c.dir=="horz" ? ",west,east" : ""); showMasks( masks, true ); // true = ONLY mask panes with maskObjects=true lockPaneForFX(pane, true); // need to set left/top so animation will work $P.hide( o.fxName_close, o.fxSettings_close, o.fxSpeed_close, function () { lockPaneForFX(pane, false); // undo if (s.isClosed) close_2(); queueNext(); }); } else { // hide the pane without animation _hidePane(pane); close_2(); queueNext(); }; }); // SUBROUTINE function close_2 () { s.isMoving = false; bindStartSlidingEvent(pane, true); // will enable if o.slidable = true // if opposite-pane was autoClosed, see if it can be autoOpened now var altPane = _c.oppositeEdge[pane]; if (state[ altPane ].noRoom) { setSizeLimits( altPane ); makePaneFit( altPane ); } // hide any masks shown while closing hideMasks(); if (!skipCallback && (state.initialized || o.triggerEventsOnLoad)) { // onclose callback - UNLESS just 'showing' a hidden pane as 'closed' if (!isShowing) _runCallbacks("onclose_end", pane); // onhide OR onshow callback if (isShowing) _runCallbacks("onshow_end", pane); if (isHiding) _runCallbacks("onhide_end", pane); } } } /** * @param {string} pane The pane just closed, ie: north, south, east, or west */ , setAsClosed = function (pane) { var $P = $Ps[pane] , $R = $Rs[pane] , $T = $Ts[pane] , o = options[pane] , s = state[pane] , side = _c[pane].side.toLowerCase() , inset = "inset"+ _c[pane].side , rClass = o.resizerClass , tClass = o.togglerClass , _pane = "-"+ pane // used for classNames , _open = "-open" , _sliding= "-sliding" , _closed = "-closed" ; $R .css(side, sC[inset]) // move the resizer .removeClass( rClass+_open +" "+ rClass+_pane+_open ) .removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) .addClass( rClass+_closed +" "+ rClass+_pane+_closed ) .unbind("dblclick."+ sID) ; // DISABLE 'resizing' when closed - do this BEFORE bindStartSlidingEvent? if (o.resizable && $.layout.plugins.draggable) $R .draggable("disable") .removeClass("ui-state-disabled") // do NOT apply disabled styling - not suitable here .css("cursor", "default") .attr("title","") ; // if pane has a toggler button, adjust that too if ($T) { $T .removeClass( tClass+_open +" "+ tClass+_pane+_open ) .addClass( tClass+_closed +" "+ tClass+_pane+_closed ) .attr("title", o.togglerTip_closed) // may be blank ; // toggler-content - if exists $T.children(".content-open").hide(); $T.children(".content-closed").css("display","block"); } // sync any 'pin buttons' syncPinBtns(pane, false); if (state.initialized) { // resize 'length' and position togglers for adjacent panes sizeHandles(); } } /** * Open the specified pane (animation optional), and resize all other panes as needed * * @param {string} pane The pane being opened, ie: north, south, east, or west * @param {boolean=} [slide=false] * @param {boolean=} [noAnimation=false] * @param {boolean=} [noAlert=false] */ , open = function (evt_or_pane, slide, noAnimation, noAlert) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $P = $Ps[pane] , $R = $Rs[pane] , $T = $Ts[pane] , o = options[pane] , s = state[pane] , c = _c[pane] , doFX, isShowing ; // QUEUE in case another action/animation is in progress $N.queue(function( queueNext ){ if ( !$P || (!o.resizable && !o.closable && !s.isShowing) // invalid request || (s.isVisible && !s.isSliding) // already open ) return queueNext(); // pane can ALSO be unhidden by just calling show(), so handle this scenario if (s.isHidden && !s.isShowing) { queueNext(); // call before show() because it needs the queue free show(pane, true); return; } if (o.autoResize && s.size != o.size) // resize pane to original size set in options sizePane(pane, o.size, true, true, true); // true=skipCallback/forceResize/noAnimation else // make sure there is enough space available to open the pane setSizeLimits(pane, slide); // onopen_start callback - will CANCEL open if returns false var cbReturn = _runCallbacks("onopen_start", pane); if (cbReturn === "abort") return queueNext(); // update pane-state again in case options were changed in onopen_start if (cbReturn !== "NC") // NC = "No Callback" setSizeLimits(pane, slide); if (s.minSize > s.maxSize) { // INSUFFICIENT ROOM FOR PANE TO OPEN! syncPinBtns(pane, false); // make sure pin-buttons are reset if (!noAlert && o.noRoomToOpenTip) alert(o.noRoomToOpenTip); return queueNext(); // ABORT } if (slide) // START Sliding - will set isSliding=true bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane else if (s.isSliding) // PIN PANE (stop sliding) - open pane 'normally' instead bindStopSlidingEvents(pane, false); // UNBIND trigger events - will set isSliding=false else if (o.slidable) bindStartSlidingEvent(pane, false); // UNBIND trigger events s.noRoom = false; // will be reset by makePaneFit if 'noRoom' makePaneFit(pane); // transfer logic var to temp var isShowing = s.isShowing; // now clear the logic var delete s.isShowing; doFX = !noAnimation && s.isClosed && (o.fxName_open != "none"); s.isMoving = true; s.isVisible = true; s.isClosed = false; // update isHidden BEFORE sizing panes - WHY??? Old? if (isShowing) s.isHidden = false; if (doFX) { // ANIMATE // mask panes with objects var masks = "center"+ (c.dir=="horz" ? ",west,east" : ""); if (s.isSliding) masks += ","+ _c.oppositeEdge[pane]; showMasks( masks, true ); // true = ONLY mask panes with maskObjects=true lockPaneForFX(pane, true); // need to set left/top so animation will work $P.show( o.fxName_open, o.fxSettings_open, o.fxSpeed_open, function() { lockPaneForFX(pane, false); // undo if (s.isVisible) open_2(); // continue queueNext(); }); } else { // no animation _showPane(pane);// just show pane and... open_2(); // continue queueNext(); }; }); // SUBROUTINE function open_2 () { s.isMoving = false; // cure iframe display issues _fixIframe(pane); // NOTE: if isSliding, then other panes are NOT 'resized' if (!s.isSliding) { // resize all panes adjacent to this one hideMasks(); // remove any masks shown while opening sizeMidPanes(_c[pane].dir=="vert" ? "center" : "", false); // false = NOT skipCallback } // set classes, position handles and execute callbacks... setAsOpen(pane); }; } /** * @param {string} pane The pane just opened, ie: north, south, east, or west * @param {boolean=} [skipCallback=false] */ , setAsOpen = function (pane, skipCallback) { var $P = $Ps[pane] , $R = $Rs[pane] , $T = $Ts[pane] , o = options[pane] , s = state[pane] , side = _c[pane].side.toLowerCase() , inset = "inset"+ _c[pane].side , rClass = o.resizerClass , tClass = o.togglerClass , _pane = "-"+ pane // used for classNames , _open = "-open" , _closed = "-closed" , _sliding= "-sliding" ; $R .css(side, sC[inset] + getPaneSize(pane)) // move the resizer .removeClass( rClass+_closed +" "+ rClass+_pane+_closed ) .addClass( rClass+_open +" "+ rClass+_pane+_open ) ; if (s.isSliding) $R.addClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) else // in case 'was sliding' $R.removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding ) if (o.resizerDblClickToggle) $R.bind("dblclick", toggle ); removeHover( 0, $R ); // remove hover classes if (o.resizable && $.layout.plugins.draggable) $R .draggable("enable") .css("cursor", o.resizerCursor) .attr("title", o.resizerTip); else if (!s.isSliding) $R.css("cursor", "default"); // n-resize, s-resize, etc // if pane also has a toggler button, adjust that too if ($T) { $T .removeClass( tClass+_closed +" "+ tClass+_pane+_closed ) .addClass( tClass+_open +" "+ tClass+_pane+_open ) .attr("title", o.togglerTip_open); // may be blank removeHover( 0, $T ); // remove hover classes // toggler-content - if exists $T.children(".content-closed").hide(); $T.children(".content-open").css("display","block"); } // sync any 'pin buttons' syncPinBtns(pane, !s.isSliding); // update pane-state dimensions - BEFORE resizing content $.extend(s, elDims($P)); if (state.initialized) { // resize resizer & toggler sizes for all panes sizeHandles(); // resize content every time pane opens - to be sure sizeContent(pane, true); // true = remeasure headers/footers, even if 'pane.isMoving' } if (!skipCallback && (state.initialized || o.triggerEventsOnLoad) && $P.is(":visible")) { // onopen callback _runCallbacks("onopen_end", pane); // onshow callback - TODO: should this be here? if (s.isShowing) _runCallbacks("onshow_end", pane); // ALSO call onresize because layout-size *may* have changed while pane was closed if (state.initialized) _runCallbacks("onresize_end", pane); } // TODO: Somehow sizePane("north") is being called after this point??? } /** * slideOpen / slideClose / slideToggle * * Pass-though methods for sliding */ , slideOpen = function (evt_or_pane) { if (!isInitialized()) return; var evt = evtObj(evt_or_pane) , pane = evtPane.call(this, evt_or_pane) , s = state[pane] , delay = options[pane].slideDelay_open ; // prevent event from triggering on NEW resizer binding created below if (evt) evt.stopImmediatePropagation(); if (s.isClosed && evt && evt.type === "mouseenter" && delay > 0) // trigger = mouseenter - use a delay timer.set(pane+"_openSlider", open_NOW, delay); else open_NOW(); // will unbind events if is already open /** * SUBROUTINE for timed open */ function open_NOW () { if (!s.isClosed) // skip if no longer closed! bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane else if (!s.isMoving) open(pane, true); // true = slide - open() will handle binding }; } , slideClose = function (evt_or_pane) { if (!isInitialized()) return; var evt = evtObj(evt_or_pane) , pane = evtPane.call(this, evt_or_pane) , o = options[pane] , s = state[pane] , delay = s.isMoving ? 1000 : 300 // MINIMUM delay - option may override ; if (s.isClosed || s.isResizing) return; // skip if already closed OR in process of resizing else if (o.slideTrigger_close === "click") close_NOW(); // close immediately onClick else if (o.preventQuickSlideClose && s.isMoving) return; // handle Chrome quick-close on slide-open else if (o.preventPrematureSlideClose && evt && $.layout.isMouseOverElem(evt, $Ps[pane])) return; // handle incorrect mouseleave trigger, like when over a SELECT-list in IE else if (evt) // trigger = mouseleave - use a delay // 1 sec delay if 'opening', else .3 sec timer.set(pane+"_closeSlider", close_NOW, max(o.slideDelay_close, delay)); else // called programically close_NOW(); /** * SUBROUTINE for timed close */ function close_NOW () { if (s.isClosed) // skip 'close' if already closed! bindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here? else if (!s.isMoving) close(pane); // close will handle unbinding }; } /** * @param {string} pane The pane being opened, ie: north, south, east, or west */ , slideToggle = function (evt_or_pane) { var pane = evtPane.call(this, evt_or_pane); toggle(pane, true); } /** * Must set left/top on East/South panes so animation will work properly * * @param {string} pane The pane to lock, 'east' or 'south' - any other is ignored! * @param {boolean} doLock true = set left/top, false = remove */ , lockPaneForFX = function (pane, doLock) { var $P = $Ps[pane] , s = state[pane] , o = options[pane] , z = options.zIndexes ; if (doLock) { $P.css({ zIndex: z.pane_animate }); // overlay all elements during animation if (pane=="south") $P.css({ top: sC.insetTop + sC.innerHeight - $P.outerHeight() }); else if (pane=="east") $P.css({ left: sC.insetLeft + sC.innerWidth - $P.outerWidth() }); } else { // animation DONE - RESET CSS // TODO: see if this can be deleted. It causes a quick-close when sliding in Chrome $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); if (pane=="south") $P.css({ top: "auto" }); // if pane is positioned 'off-screen', then DO NOT screw with it! else if (pane=="east" && !$P.css("left").match(/\-99999/)) $P.css({ left: "auto" }); // fix anti-aliasing in IE - only needed for animations that change opacity if (browser.msie && o.fxOpacityFix && o.fxName_open != "slide" && $P.css("filter") && $P.css("opacity") == 1) $P[0].style.removeAttribute('filter'); } } /** * Toggle sliding functionality of a specific pane on/off by adding removing 'slide open' trigger * * @see open(), close() * @param {string} pane The pane to enable/disable, 'north', 'south', etc. * @param {boolean} enable Enable or Disable sliding? */ , bindStartSlidingEvent = function (pane, enable) { var o = options[pane] , $P = $Ps[pane] , $R = $Rs[pane] , evtName = o.slideTrigger_open.toLowerCase() ; if (!$R || (enable && !o.slidable)) return; // make sure we have a valid event if (evtName.match(/mouseover/)) evtName = o.slideTrigger_open = "mouseenter"; else if (!evtName.match(/click|dblclick|mouseenter/)) evtName = o.slideTrigger_open = "click"; $R // add or remove event [enable ? "bind" : "unbind"](evtName +'.'+ sID, slideOpen) // set the appropriate cursor & title/tip .css("cursor", enable ? o.sliderCursor : "default") .attr("title", enable ? o.sliderTip : "") ; } /** * Add or remove 'mouseleave' events to 'slide close' when pane is 'sliding' open or closed * Also increases zIndex when pane is sliding open * See bindStartSlidingEvent for code to control 'slide open' * * @see slideOpen(), slideClose() * @param {string} pane The pane to process, 'north', 'south', etc. * @param {boolean} enable Enable or Disable events? */ , bindStopSlidingEvents = function (pane, enable) { var o = options[pane] , s = state[pane] , c = _c[pane] , z = options.zIndexes , evtName = o.slideTrigger_close.toLowerCase() , action = (enable ? "bind" : "unbind") , $P = $Ps[pane] , $R = $Rs[pane] ; s.isSliding = enable; // logic timer.clear(pane+"_closeSlider"); // just in case // remove 'slideOpen' event from resizer // ALSO will raise the zIndex of the pane & resizer if (enable) bindStartSlidingEvent(pane, false); // RE/SET zIndex - increases when pane is sliding-open, resets to normal when not $P.css("zIndex", enable ? z.pane_sliding : z.pane_normal); $R.css("zIndex", enable ? z.pane_sliding+2 : z.resizer_normal); // NOTE: mask = pane_sliding+1 // make sure we have a valid event if (!evtName.match(/click|mouseleave/)) evtName = o.slideTrigger_close = "mouseleave"; // also catches 'mouseout' // add/remove slide triggers $R[action](evtName, slideClose); // base event on resize // need extra events for mouseleave if (evtName === "mouseleave") { // also close on pane.mouseleave $P[action]("mouseleave."+ sID, slideClose); // cancel timer when mouse moves between 'pane' and 'resizer' $R[action]("mouseenter."+ sID, cancelMouseOut); $P[action]("mouseenter."+ sID, cancelMouseOut); } if (!enable) timer.clear(pane+"_closeSlider"); else if (evtName === "click" && !o.resizable) { // IF pane is not resizable (which already has a cursor and tip) // then set the a cursor & title/tip on resizer when sliding $R.css("cursor", enable ? o.sliderCursor : "default"); $R.attr("title", enable ? o.togglerTip_open : ""); // use Toggler-tip, eg: "Close Pane" } // SUBROUTINE for mouseleave timer clearing function cancelMouseOut (evt) { timer.clear(pane+"_closeSlider"); evt.stopPropagation(); } } /** * Hides/closes a pane if there is insufficient room - reverses this when there is room again * MUST have already called setSizeLimits() before calling this method * * @param {string} pane The pane being resized * @param {boolean=} [isOpening=false] Called from onOpen? * @param {boolean=} [skipCallback=false] Should the onresize callback be run? * @param {boolean=} [force=false] */ , makePaneFit = function (pane, isOpening, skipCallback, force) { var o = options[pane] , s = state[pane] , c = _c[pane] , $P = $Ps[pane] , $R = $Rs[pane] , isSidePane = c.dir==="vert" , hasRoom = false ; // special handling for center & east/west panes if (pane === "center" || (isSidePane && s.noVerticalRoom)) { // see if there is enough room to display the pane // ERROR: hasRoom = s.minHeight <= s.maxHeight && (isSidePane || s.minWidth <= s.maxWidth); hasRoom = (s.maxHeight >= 0); if (hasRoom && s.noRoom) { // previously hidden due to noRoom, so show now _showPane(pane); if ($R) $R.show(); s.isVisible = true; s.noRoom = false; if (isSidePane) s.noVerticalRoom = false; _fixIframe(pane); } else if (!hasRoom && !s.noRoom) { // not currently hidden, so hide now _hidePane(pane); if ($R) $R.hide(); s.isVisible = false; s.noRoom = true; } } // see if there is enough room to fit the border-pane if (pane === "center") { // ignore center in this block } else if (s.minSize <= s.maxSize) { // pane CAN fit hasRoom = true; if (s.size > s.maxSize) // pane is too big - shrink it sizePane(pane, s.maxSize, skipCallback, force, true); // true = noAnimation else if (s.size < s.minSize) // pane is too small - enlarge it sizePane(pane, s.minSize, skipCallback, force, true); // need s.isVisible because new pseudoClose method keeps pane visible, but off-screen else if ($R && s.isVisible && $P.is(":visible")) { // make sure resizer-bar is positioned correctly // handles situation where nested layout was 'hidden' when initialized var side = c.side.toLowerCase() , pos = s.size + sC["inset"+ c.side] ; if ($.layout.cssNum($R, side) != pos) $R.css( side, pos ); } // if was previously hidden due to noRoom, then RESET because NOW there is room if (s.noRoom) { // s.noRoom state will be set by open or show if (s.wasOpen && o.closable) { if (o.autoReopen) open(pane, false, true, true); // true = noAnimation, true = noAlert else // leave the pane closed, so just update state s.noRoom = false; } else show(pane, s.wasOpen, true, true); // true = noAnimation, true = noAlert } } else { // !hasRoom - pane CANNOT fit if (!s.noRoom) { // pane not set as noRoom yet, so hide or close it now... s.noRoom = true; // update state s.wasOpen = !s.isClosed && !s.isSliding; if (s.isClosed){} // SKIP else if (o.closable) // 'close' if possible close(pane, true, true); // true = force, true = noAnimation else // 'hide' pane if cannot just be closed hide(pane, true); // true = noAnimation } } } /** * sizePane / manualSizePane * sizePane is called only by internal methods whenever a pane needs to be resized * manualSizePane is an exposed flow-through method allowing extra code when pane is 'manually resized' * * @param {string} pane The pane being resized * @param {number} size The *desired* new size for this pane - will be validated * @param {boolean=} [skipCallback=false] Should the onresize callback be run? * @param {boolean=} [noAnimation=false] */ , manualSizePane = function (evt_or_pane, size, skipCallback, noAnimation) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , o = options[pane] , s = state[pane] // if resizing callbacks have been delayed and resizing is now DONE, force resizing to complete... , forceResize = o.livePaneResizing && !s.isResizing ; // ANY call to manualSizePane disables autoResize - ie, percentage sizing o.autoResize = false; // flow-through... sizePane(pane, size, skipCallback, forceResize, noAnimation); // will animate resize if option enabled } /** * @param {string} pane The pane being resized * @param {number} size The *desired* new size for this pane - will be validated * @param {boolean=} [skipCallback=false] Should the onresize callback be run? * @param {boolean=} [force=false] Force resizing even if does not seem necessary * @param {boolean=} [noAnimation=false] */ , sizePane = function (evt_or_pane, size, skipCallback, force, noAnimation) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) // probably NEVER called from event? , o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] , side = _c[pane].side.toLowerCase() , dimName = _c[pane].sizeType.toLowerCase() , inset = "inset"+ _c[pane].side , skipResizeWhileDragging = s.isResizing && !o.triggerEventsDuringLiveResize , doFX = noAnimation !== true && o.animatePaneSizing , oldSize, newSize ; // QUEUE in case another action/animation is in progress $N.queue(function( queueNext ){ // calculate 'current' min/max sizes setSizeLimits(pane); // update pane-state oldSize = s.size; size = _parseSize(pane, size); // handle percentages & auto size = max(size, _parseSize(pane, o.minSize)); size = min(size, s.maxSize); if (size < s.minSize) { // not enough room for pane! queueNext(); // call before makePaneFit() because it needs the queue free makePaneFit(pane, false, skipCallback); // will hide or close pane return; } // IF newSize is same as oldSize, then nothing to do - abort if (!force && size === oldSize) return queueNext(); // onresize_start callback CANNOT cancel resizing because this would break the layout! if (!skipCallback && state.initialized && s.isVisible) _runCallbacks("onresize_start", pane); // resize the pane, and make sure its visible newSize = cssSize(pane, size); if (doFX && $P.is(":visible")) { // ANIMATE var fx = $.layout.effects.size[pane] || $.layout.effects.size.all , easing = o.fxSettings_size.easing || fx.easing , z = options.zIndexes , props = {}; props[ dimName ] = newSize +'px'; s.isMoving = true; // overlay all elements during animation $P.css({ zIndex: z.pane_animate }) .show().animate( props, o.fxSpeed_size, easing, function(){ // reset zIndex after animation $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) }); s.isMoving = false; sizePane_2(); // continue queueNext(); }); } else { // no animation $P.css( dimName, newSize ); // resize pane // if pane is visible, then if ($P.is(":visible")) sizePane_2(); // continue else { // pane is NOT VISIBLE, so just update state data... // when pane is *next opened*, it will have the new size s.size = size; // update state.size $.extend(s, elDims($P)); // update state dimensions } queueNext(); }; }); // SUBROUTINE function sizePane_2 () { /* Panes are sometimes not sized precisely in some browsers!? * This code will resize the pane up to 3 times to nudge the pane to the correct size */ var actual = dimName==='width' ? $P.outerWidth() : $P.outerHeight() , tries = [{ pane: pane , count: 1 , target: size , actual: actual , correct: (size === actual) , attempt: size , cssSize: newSize }] , lastTry = tries[0] , msg = 'Inaccurate size after resizing the '+ pane +'-pane.' ; while ( !lastTry.correct ) { thisTry = { pane: pane, count: lastTry.count+1, target: size }; if (lastTry.actual > size) thisTry.attempt = max(0, lastTry.attempt - (lastTry.actual - size)); else // lastTry.actual < size thisTry.attempt = max(0, lastTry.attempt + (size - lastTry.actual)); thisTry.cssSize = cssSize(pane, thisTry.attempt); $P.css( dimName, thisTry.cssSize ); thisTry.actual = dimName=='width' ? $P.outerWidth() : $P.outerHeight(); thisTry.correct = (size === thisTry.actual); // if showDebugMessages, log attempts and alert the user of this *non-fatal error* if (options.showDebugMessages) { if ( tries.length === 1) { _log(msg, false); _log(lastTry, false); } _log(thisTry, false); } // after 4 tries, is as close as its gonna get! if (tries.length > 3) break; tries.push( thisTry ); lastTry = tries[ tries.length - 1 ]; } // END TESTING CODE // update pane-state dimensions s.size = size; $.extend(s, elDims($P)); if (s.isVisible && $P.is(":visible")) { // reposition the resizer-bar if ($R) $R.css( side, size + sC[inset] ); // resize the content-div sizeContent(pane); } if (!skipCallback && !skipResizeWhileDragging && state.initialized && s.isVisible) _runCallbacks("onresize_end", pane); // resize all the adjacent panes, and adjust their toggler buttons // when skipCallback passed, it means the controlling method will handle 'other panes' if (!skipCallback) { // also no callback if live-resize is in progress and NOT triggerEventsDuringLiveResize if (!s.isSliding) sizeMidPanes(_c[pane].dir=="horz" ? "" : "center", skipResizeWhileDragging, force); sizeHandles(); } // if opposite-pane was autoClosed, see if it can be autoOpened now var altPane = _c.oppositeEdge[pane]; if (size < oldSize && state[ altPane ].noRoom) { setSizeLimits( altPane ); makePaneFit( altPane, false, skipCallback ); } // DEBUG - ALERT user/developer so they know there was a sizing problem if (options.showDebugMessages && tries.length > 1) _log(msg +'\nSee the Error Console for details.', true); } } /** * @see initPanes(), sizePane(), resizeAll(), open(), close(), hide() * @param {string} panes The pane(s) being resized, comma-delmited string * @param {boolean=} [skipCallback=false] Should the onresize callback be run? * @param {boolean=} [force=false] */ , sizeMidPanes = function (panes, skipCallback, force) { panes = (panes ? panes : "east,west,center").split(","); $.each(panes, function (i, pane) { if (!$Ps[pane]) return; // NO PANE - skip var o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] , isCenter= (pane=="center") , hasRoom = true , CSS = {} , newCenter = calcNewCenterPaneDims() ; // update pane-state dimensions $.extend(s, elDims($P)); if (pane === "center") { if (!force && s.isVisible && newCenter.width === s.outerWidth && newCenter.height === s.outerHeight) return true; // SKIP - pane already the correct size // set state for makePaneFit() logic $.extend(s, cssMinDims(pane), { maxWidth: newCenter.width , maxHeight: newCenter.height }); CSS = newCenter; // convert OUTER width/height to CSS width/height CSS.width = cssW($P, CSS.width); // NEW - allow pane to extend 'below' visible area rather than hide it CSS.height = cssH($P, CSS.height); hasRoom = CSS.width >= 0 && CSS.height >= 0; // height >= 0 = ALWAYS TRUE NOW // during layout init, try to shrink east/west panes to make room for center if (!state.initialized && o.minWidth > s.outerWidth) { var reqPx = o.minWidth - s.outerWidth , minE = options.east.minSize || 0 , minW = options.west.minSize || 0 , sizeE = state.east.size , sizeW = state.west.size , newE = sizeE , newW = sizeW ; if (reqPx > 0 && state.east.isVisible && sizeE > minE) { newE = max( sizeE-minE, sizeE-reqPx ); reqPx -= sizeE-newE; } if (reqPx > 0 && state.west.isVisible && sizeW > minW) { newW = max( sizeW-minW, sizeW-reqPx ); reqPx -= sizeW-newW; } // IF we found enough extra space, then resize the border panes as calculated if (reqPx === 0) { if (sizeE != minE) sizePane('east', newE, true, force, true); // true = skipCallback/noAnimation - initPanes will handle when done if (sizeW != minW) sizePane('west', newW, true, force, true); // now start over! sizeMidPanes('center', skipCallback, force); return; // abort this loop } } } else { // for east and west, set only the height, which is same as center height // set state.min/maxWidth/Height for makePaneFit() logic if (s.isVisible && !s.noVerticalRoom) $.extend(s, elDims($P), cssMinDims(pane)) if (!force && !s.noVerticalRoom && newCenter.height === s.outerHeight) return true; // SKIP - pane already the correct size // east/west have same top, bottom & height as center CSS.top = newCenter.top; CSS.bottom = newCenter.bottom; // NEW - allow pane to extend 'below' visible area rather than hide it CSS.height = cssH($P, newCenter.height); s.maxHeight = CSS.height; hasRoom = (s.maxHeight >= 0); // ALWAYS TRUE NOW if (!hasRoom) s.noVerticalRoom = true; // makePaneFit() logic } if (hasRoom) { // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized if (!skipCallback && state.initialized) _runCallbacks("onresize_start", pane); $P.css(CSS); // apply the CSS to pane sizeHandles(pane); // also update resizer length if (s.noRoom && !s.isClosed && !s.isHidden) makePaneFit(pane); // will re-open/show auto-closed/hidden pane if (s.isVisible) { $.extend(s, elDims($P)); // update pane dimensions if (state.initialized) sizeContent(pane); // also resize the contents, if exists } } else if (!s.noRoom && s.isVisible) // no room for pane makePaneFit(pane); // will hide or close pane if (!s.isVisible) return true; // DONE - next pane /* * Extra CSS for IE6 or IE7 in Quirks-mode - add 'width' to NORTH/SOUTH panes * Normally these panes have only 'left' & 'right' positions so pane auto-sizes * ALSO required when pane is an IFRAME because will NOT default to 'full width' */ if (pane === "center") { // finished processing midPanes var b = $.layout.browser; var fix = b.isIE6 || (b.msie && !$.support.boxModel); if ($Ps.north && (fix || state.north.tagName=="IFRAME")) $Ps.north.css("width", cssW($Ps.north, sC.innerWidth)); if ($Ps.south && (fix || state.south.tagName=="IFRAME")) $Ps.south.css("width", cssW($Ps.south, sC.innerWidth)); } // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized if (!skipCallback && state.initialized) _runCallbacks("onresize_end", pane); }); } /** * @see window.onresize(), callbacks or custom code */ , resizeAll = function () { if (!state.initialized) { _initLayoutElements(); return; // no need to resize since we just initialized! } var oldW = sC.innerWidth , oldH = sC.innerHeight ; // cannot size layout when 'container' is hidden or collapsed if (!$N.is(":visible:") ) return; $.extend( state.container, elDims( $N ) ); // UPDATE container dimensions if (!sC.outerHeight) return; // onresizeall_start will CANCEL resizing if returns false // state.container has already been set, so user can access this info for calcuations if (false === _runCallbacks("onresizeall_start")) return false; var // see if container is now 'smaller' than before shrunkH = (sC.innerHeight < oldH) , shrunkW = (sC.innerWidth < oldW) , $P, o, s, dir ; // NOTE special order for sizing: S-N-E-W $.each(["south","north","east","west"], function (i, pane) { if (!$Ps[pane]) return; // no pane - SKIP s = state[pane]; o = options[pane]; dir = _c[pane].dir; if (o.autoResize && s.size != o.size) // resize pane to original size set in options sizePane(pane, o.size, true, true, true); // true=skipCallback/forceResize/noAnimation else { setSizeLimits(pane); makePaneFit(pane, false, true, true); // true=skipCallback/forceResize } }); sizeMidPanes("", true, true); // true=skipCallback, true=forceResize sizeHandles(); // reposition the toggler elements // trigger all individual pane callbacks AFTER layout has finished resizing o = options; // reuse alias $.each(_c.allPanes, function (i, pane) { $P = $Ps[pane]; if (!$P) return; // SKIP if (state[pane].isVisible) // undefined for non-existent panes _runCallbacks("onresize_end", pane); // callback - if exists }); _runCallbacks("onresizeall_end"); //_triggerLayoutEvent(pane, 'resizeall'); } /** * Whenever a pane resizes or opens that has a nested layout, trigger resizeAll * * @param {string} pane The pane just resized or opened */ , resizeChildLayout = function (evt_or_pane) { var pane = evtPane.call(this, evt_or_pane); if (!options[pane].resizeChildLayout) return; var $P = $Ps[pane] , $C = $Cs[pane] , d = "layout" , P = Instance[pane] , L = children[pane] ; // user may have manually set EITHER instance pointer, so handle that if (P.child && !L) { // have to reverse the pointers! var el = P.child.container; L = children[pane] = (el ? el.data(d) : 0) || null; // set pointer _directly_ to layout instance } // if a layout-pointer exists, see if child has been destroyed if (L && L.destroyed) L = children[pane] = null; // clear child pointers // no child layout pointer is set - see if there is a child layout NOW if (!L) L = children[pane] = $P.data(d) || ($C ? $C.data(d) : 0) || null; // set/update child pointers // ALWAYS refresh the pane.child alias P.child = children[pane]; if (L) L.resizeAll(); } /** * IF pane has a content-div, then resize all elements inside pane to fit pane-height * * @param {string=} [panes=""] The pane(s) being resized * @param {boolean=} [remeasure=false] Should the content (header/footer) be remeasured? */ , sizeContent = function (evt_or_panes, remeasure) { if (!isInitialized()) return; var panes = evtPane.call(this, evt_or_panes); panes = panes ? panes.split(",") : _c.allPanes; $.each(panes, function (idx, pane) { var $P = $Ps[pane] , $C = $Cs[pane] , o = options[pane] , s = state[pane] , m = s.content // m = measurements ; if (!$P || !$C || !$P.is(":visible")) return true; // NOT VISIBLE - skip // if content-element was REMOVED, update OR remove the pointer if (!$C.length) { initContent(pane, false); // false = do NOT sizeContent() - already there! if (!$C) return; // no replacement element found - pointer have been removed } // onsizecontent_start will CANCEL resizing if returns false if (false === _runCallbacks("onsizecontent_start", pane)) return; // skip re-measuring offsets if live-resizing if ((!s.isMoving && !s.isResizing) || o.liveContentResizing || remeasure || m.top == undefined) { _measure(); // if any footers are below pane-bottom, they may not measure correctly, // so allow pane overflow and re-measure if (m.hiddenFooters > 0 && $P.css("overflow") === "hidden") { $P.css("overflow", "visible"); _measure(); // remeasure while overflowing $P.css("overflow", "hidden"); } } // NOTE: spaceAbove/Below *includes* the pane paddingTop/Bottom, but not pane.borders var newH = s.innerHeight - (m.spaceAbove - s.css.paddingTop) - (m.spaceBelow - s.css.paddingBottom); if (!$C.is(":visible") || m.height != newH) { // size the Content element to fit new pane-size - will autoHide if not enough room setOuterHeight($C, newH, true); // true=autoHide m.height = newH; // save new height }; if (state.initialized) _runCallbacks("onsizecontent_end", pane); function _below ($E) { return max(s.css.paddingBottom, (parseInt($E.css("marginBottom"), 10) || 0)); }; function _measure () { var ignore = options[pane].contentIgnoreSelector , $Fs = $C.nextAll().not(ignore || ':lt(0)') // not :lt(0) = ALL , $Fs_vis = $Fs.filter(':visible') , $F = $Fs_vis.filter(':last') ; m = { top: $C[0].offsetTop , height: $C.outerHeight() , numFooters: $Fs.length , hiddenFooters: $Fs.length - $Fs_vis.length , spaceBelow: 0 // correct if no content footer ($E) } m.spaceAbove = m.top; // just for state - not used in calc m.bottom = m.top + m.height; if ($F.length) //spaceBelow = (LastFooter.top + LastFooter.height) [footerBottom] - Content.bottom + max(LastFooter.marginBottom, pane.paddingBotom) m.spaceBelow = ($F[0].offsetTop + $F.outerHeight()) - m.bottom + _below($F); else // no footer - check marginBottom on Content element itself m.spaceBelow = _below($C); }; }); } /** * Called every time a pane is opened, closed, or resized to slide the togglers to 'center' and adjust their length if necessary * * @see initHandles(), open(), close(), resizeAll() * @param {string=} [panes=""] The pane(s) being resized */ , sizeHandles = function (evt_or_panes) { var panes = evtPane.call(this, evt_or_panes) panes = panes ? panes.split(",") : _c.borderPanes; $.each(panes, function (i, pane) { var o = options[pane] , s = state[pane] , $P = $Ps[pane] , $R = $Rs[pane] , $T = $Ts[pane] , $TC ; if (!$P || !$R) return; var dir = _c[pane].dir , _state = (s.isClosed ? "_closed" : "_open") , spacing = o["spacing"+ _state] , togAlign = o["togglerAlign"+ _state] , togLen = o["togglerLength"+ _state] , paneLen , left , offset , CSS = {} ; if (spacing === 0) { $R.hide(); return; } else if (!s.noRoom && !s.isHidden) // skip if resizer was hidden for any reason $R.show(); // in case was previously hidden // Resizer Bar is ALWAYS same width/height of pane it is attached to if (dir === "horz") { // north/south //paneLen = $P.outerWidth(); // s.outerWidth || paneLen = sC.innerWidth; // handle offscreen-panes s.resizerLength = paneLen; left = $.layout.cssNum($P, "left") $R.css({ width: cssW($R, paneLen) // account for borders & padding , height: cssH($R, spacing) // ditto , left: left > -9999 ? left : sC.insetLeft // handle offscreen-panes }); } else { // east/west paneLen = $P.outerHeight(); // s.outerHeight || s.resizerLength = paneLen; $R.css({ height: cssH($R, paneLen) // account for borders & padding , width: cssW($R, spacing) // ditto , top: sC.insetTop + getPaneSize("north", true) // TODO: what if no North pane? //, top: $.layout.cssNum($Ps["center"], "top") }); } // remove hover classes removeHover( o, $R ); if ($T) { if (togLen === 0 || (s.isSliding && o.hideTogglerOnSlide)) { $T.hide(); // always HIDE the toggler when 'sliding' return; } else $T.show(); // in case was previously hidden if (!(togLen > 0) || togLen === "100%" || togLen > paneLen) { togLen = paneLen; offset = 0; } else { // calculate 'offset' based on options.PANE.togglerAlign_open/closed if (isStr(togAlign)) { switch (togAlign) { case "top": case "left": offset = 0; break; case "bottom": case "right": offset = paneLen - togLen; break; case "middle": case "center": default: offset = round((paneLen - togLen) / 2); // 'default' catches typos } } else { // togAlign = number var x = parseInt(togAlign, 10); // if (togAlign >= 0) offset = x; else offset = paneLen - togLen + x; // NOTE: x is negative! } } if (dir === "horz") { // north/south var width = cssW($T, togLen); $T.css({ width: width // account for borders & padding , height: cssH($T, spacing) // ditto , left: offset // TODO: VERIFY that toggler positions correctly for ALL values , top: 0 }); // CENTER the toggler content SPAN $T.children(".content").each(function(){ $TC = $(this); $TC.css("marginLeft", round((width-$TC.outerWidth())/2)); // could be negative }); } else { // east/west var height = cssH($T, togLen); $T.css({ height: height // account for borders & padding , width: cssW($T, spacing) // ditto , top: offset // POSITION the toggler , left: 0 }); // CENTER the toggler content SPAN $T.children(".content").each(function(){ $TC = $(this); $TC.css("marginTop", round((height-$TC.outerHeight())/2)); // could be negative }); } // remove ALL hover classes removeHover( 0, $T ); } // DONE measuring and sizing this resizer/toggler, so can be 'hidden' now if (!state.initialized && (o.initHidden || s.noRoom)) { $R.hide(); if ($T) $T.hide(); } }); } /** * @param {string} pane */ , enableClosable = function (evt_or_pane) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $T = $Ts[pane] , o = options[pane] ; if (!$T) return; o.closable = true; $T .bind("click."+ sID, function(evt){ evt.stopPropagation(); toggle(pane); }) .css("visibility", "visible") .css("cursor", "pointer") .attr("title", state[pane].isClosed ? o.togglerTip_closed : o.togglerTip_open) // may be blank .show(); } /** * @param {string} pane * @param {boolean=} [hide=false] */ , disableClosable = function (evt_or_pane, hide) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $T = $Ts[pane] ; if (!$T) return; options[pane].closable = false; // is closable is disable, then pane MUST be open! if (state[pane].isClosed) open(pane, false, true); $T .unbind("."+ sID) .css("visibility", hide ? "hidden" : "visible") // instead of hide(), which creates logic issues .css("cursor", "default") .attr("title", ""); } /** * @param {string} pane */ , enableSlidable = function (evt_or_pane) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $R = $Rs[pane] ; if (!$R || !$R.data('draggable')) return; options[pane].slidable = true; if (s.isClosed) bindStartSlidingEvent(pane, true); } /** * @param {string} pane */ , disableSlidable = function (evt_or_pane) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $R = $Rs[pane] ; if (!$R) return; options[pane].slidable = false; if (state[pane].isSliding) close(pane, false, true); else { bindStartSlidingEvent(pane, false); $R .css("cursor", "default") .attr("title", ""); removeHover(null, $R[0]); // in case currently hovered } } /** * @param {string} pane */ , enableResizable = function (evt_or_pane) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $R = $Rs[pane] , o = options[pane] ; if (!$R || !$R.data('draggable')) return; o.resizable = true; $R.draggable("enable"); if (!state[pane].isClosed) $R .css("cursor", o.resizerCursor) .attr("title", o.resizerTip); } /** * @param {string} pane */ , disableResizable = function (evt_or_pane) { if (!isInitialized()) return; var pane = evtPane.call(this, evt_or_pane) , $R = $Rs[pane] ; if (!$R || !$R.data('draggable')) return; options[pane].resizable = false; $R .draggable("disable") .css("cursor", "default") .attr("title", ""); removeHover(null, $R[0]); // in case currently hovered } /** * Move a pane from source-side (eg, west) to target-side (eg, east) * If pane exists on target-side, move that to source-side, ie, 'swap' the panes * * @param {string} pane1 The pane/edge being swapped * @param {string} pane2 ditto */ , swapPanes = function (evt_or_pane1, pane2) { if (!isInitialized()) return; var pane1 = evtPane.call(this, evt_or_pane1); // change state.edge NOW so callbacks can know where pane is headed... state[pane1].edge = pane2; state[pane2].edge = pane1; // run these even if NOT state.initialized if (false === _runCallbacks("onswap_start", pane1) || false === _runCallbacks("onswap_start", pane2) ) { state[pane1].edge = pane1; // reset state[pane2].edge = pane2; return; } var oPane1 = copy( pane1 ) , oPane2 = copy( pane2 ) , sizes = {} ; sizes[pane1] = oPane1 ? oPane1.state.size : 0; sizes[pane2] = oPane2 ? oPane2.state.size : 0; // clear pointers & state $Ps[pane1] = false; $Ps[pane2] = false; state[pane1] = {}; state[pane2] = {}; // ALWAYS remove the resizer & toggler elements if ($Ts[pane1]) $Ts[pane1].remove(); if ($Ts[pane2]) $Ts[pane2].remove(); if ($Rs[pane1]) $Rs[pane1].remove(); if ($Rs[pane2]) $Rs[pane2].remove(); $Rs[pane1] = $Rs[pane2] = $Ts[pane1] = $Ts[pane2] = false; // transfer element pointers and data to NEW Layout keys move( oPane1, pane2 ); move( oPane2, pane1 ); // cleanup objects oPane1 = oPane2 = sizes = null; // make panes 'visible' again if ($Ps[pane1]) $Ps[pane1].css(_c.visible); if ($Ps[pane2]) $Ps[pane2].css(_c.visible); // fix any size discrepancies caused by swap resizeAll(); // run these even if NOT state.initialized _runCallbacks("onswap_end", pane1); _runCallbacks("onswap_end", pane2); return; function copy (n) { // n = pane var $P = $Ps[n] , $C = $Cs[n] ; return !$P ? false : { pane: n , P: $P ? $P[0] : false , C: $C ? $C[0] : false , state: $.extend(true, {}, state[n]) , options: $.extend(true, {}, options[n]) } }; function move (oPane, pane) { if (!oPane) return; var P = oPane.P , C = oPane.C , oldPane = oPane.pane , c = _c[pane] , side = c.side.toLowerCase() , inset = "inset"+ c.side // save pane-options that should be retained , s = $.extend({}, state[pane]) , o = options[pane] // RETAIN side-specific FX Settings - more below , fx = { resizerCursor: o.resizerCursor } , re, size, pos ; $.each("fxName,fxSpeed,fxSettings".split(","), function (i, k) { fx[k +"_open"] = o[k +"_open"]; fx[k +"_close"] = o[k +"_close"]; fx[k +"_size"] = o[k +"_size"]; }); // update object pointers and attributes $Ps[pane] = $(P) .data({ layoutPane: Instance[pane] // NEW pointer to pane-alias-object , layoutEdge: pane }) .css(_c.hidden) .css(c.cssReq) ; $Cs[pane] = C ? $(C) : false; // set options and state options[pane] = $.extend({}, oPane.options, fx); state[pane] = $.extend({}, oPane.state); // change classNames on the pane, eg: ui-layout-pane-east ==> ui-layout-pane-west re = new RegExp(o.paneClass +"-"+ oldPane, "g"); P.className = P.className.replace(re, o.paneClass +"-"+ pane); // ALWAYS regenerate the resizer & toggler elements initHandles(pane); // create the required resizer & toggler // if moving to different orientation, then keep 'target' pane size if (c.dir != _c[oldPane].dir) { size = sizes[pane] || 0; setSizeLimits(pane); // update pane-state size = max(size, state[pane].minSize); // use manualSizePane to disable autoResize - not useful after panes are swapped manualSizePane(pane, size, true, true); // true/true = skipCallback/noAnimation } else // move the resizer here $Rs[pane].css(side, sC[inset] + (state[pane].isVisible ? getPaneSize(pane) : 0)); // ADD CLASSNAMES & SLIDE-BINDINGS if (oPane.state.isVisible && !s.isVisible) setAsOpen(pane, true); // true = skipCallback else { setAsClosed(pane); bindStartSlidingEvent(pane, true); // will enable events IF option is set } // DESTROY the object oPane = null; }; } /** * INTERNAL method to sync pin-buttons when pane is opened or closed * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes * * @see open(), setAsOpen(), setAsClosed() * @param {string} pane These are the params returned to callbacks by layout() * @param {boolean} doPin True means set the pin 'down', False means 'up' */ , syncPinBtns = function (pane, doPin) { if ($.layout.plugins.buttons) $.each(state[pane].pins, function (i, selector) { $.layout.buttons.setPinState(Instance, $(selector), pane, doPin); }); } ; // END var DECLARATIONS /** * Capture keys when enableCursorHotkey - toggle pane if hotkey pressed * * @see document.keydown() */ function keyDown (evt) { if (!evt) return true; var code = evt.keyCode; if (code < 33) return true; // ignore special keys: ENTER, TAB, etc var PANE = { 38: "north" // Up Cursor - $.ui.keyCode.UP , 40: "south" // Down Cursor - $.ui.keyCode.DOWN , 37: "west" // Left Cursor - $.ui.keyCode.LEFT , 39: "east" // Right Cursor - $.ui.keyCode.RIGHT } , ALT = evt.altKey // no worky! , SHIFT = evt.shiftKey , CTRL = evt.ctrlKey , CURSOR = (CTRL && code >= 37 && code <= 40) , o, k, m, pane ; if (CURSOR && options[PANE[code]].enableCursorHotkey) // valid cursor-hotkey pane = PANE[code]; else if (CTRL || SHIFT) // check to see if this matches a custom-hotkey $.each(_c.borderPanes, function (i, p) { // loop each pane to check its hotkey o = options[p]; k = o.customHotkey; m = o.customHotkeyModifier; // if missing or invalid, treated as "CTRL+SHIFT" if ((SHIFT && m=="SHIFT") || (CTRL && m=="CTRL") || (CTRL && SHIFT)) { // Modifier matches if (k && code === (isNaN(k) || k <= 9 ? k.toUpperCase().charCodeAt(0) : k)) { // Key matches pane = p; return false; // BREAK } } }); // validate pane if (!pane || !$Ps[pane] || !options[pane].closable || state[pane].isHidden) return true; toggle(pane); evt.stopPropagation(); evt.returnValue = false; // CANCEL key return false; }; /* * ###################################### * UTILITY METHODS * called externally or by initButtons * ###################################### */ /** * Change/reset a pane overflow setting & zIndex to allow popups/drop-downs to work * * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event */ function allowOverflow (el) { if (!isInitialized()) return; if (this && this.tagName) el = this; // BOUND to element var $P; if (isStr(el)) $P = $Ps[el]; else if ($(el).data("layoutRole")) $P = $(el); else $(el).parents().each(function(){ if ($(this).data("layoutRole")) { $P = $(this); return false; // BREAK } }); if (!$P || !$P.length) return; // INVALID var pane = $P.data("layoutEdge") , s = state[pane] ; // if pane is already raised, then reset it before doing it again! // this would happen if allowOverflow is attached to BOTH the pane and an element if (s.cssSaved) resetOverflow(pane); // reset previous CSS before continuing // if pane is raised by sliding or resizing, or its closed, then abort if (s.isSliding || s.isResizing || s.isClosed) { s.cssSaved = false; return; } var newCSS = { zIndex: (options.zIndexes.resizer_normal + 1) } , curCSS = {} , of = $P.css("overflow") , ofX = $P.css("overflowX") , ofY = $P.css("overflowY") ; // determine which, if any, overflow settings need to be changed if (of != "visible") { curCSS.overflow = of; newCSS.overflow = "visible"; } if (ofX && !ofX.match(/visible|auto/)) { curCSS.overflowX = ofX; newCSS.overflowX = "visible"; } if (ofY && !ofY.match(/visible|auto/)) { curCSS.overflowY = ofX; newCSS.overflowY = "visible"; } // save the current overflow settings - even if blank! s.cssSaved = curCSS; // apply new CSS to raise zIndex and, if necessary, make overflow 'visible' $P.css( newCSS ); // make sure the zIndex of all other panes is normal $.each(_c.allPanes, function(i, p) { if (p != pane) resetOverflow(p); }); }; /** * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event */ function resetOverflow (el) { if (!isInitialized()) return; if (this && this.tagName) el = this; // BOUND to element var $P; if (isStr(el)) $P = $Ps[el]; else if ($(el).data("layoutRole")) $P = $(el); else $(el).parents().each(function(){ if ($(this).data("layoutRole")) { $P = $(this); return false; // BREAK } }); if (!$P || !$P.length) return; // INVALID var pane = $P.data("layoutEdge") , s = state[pane] , CSS = s.cssSaved || {} ; // reset the zIndex if (!s.isSliding && !s.isResizing) $P.css("zIndex", options.zIndexes.pane_normal); // reset Overflow - if necessary $P.css( CSS ); // clear var s.cssSaved = false; }; /* * ##################### * CREATE/RETURN LAYOUT * ##################### */ // validate that container exists var $N = $(this).eq(0); // FIRST matching Container element if (!$N.length) { if (options.showErrorMessages) _log( lang.errContainerMissing, true ); return null; }; // Users retrieve Instance of a layout with: $N.layout() OR $N.data("layout") // return the Instance-pointer if layout has already been initialized if ($N.data("layoutContainer") && $N.data("layout")) return $N.data("layout"); // cached pointer // init global vars var $Ps = {} // Panes x5 - set in initPanes() , $Cs = {} // Content x5 - set in initPanes() , $Rs = {} // Resizers x4 - set in initHandles() , $Ts = {} // Togglers x4 - set in initHandles() , $Ms = $([]) // Masks - up to 2 masks per pane (IFRAME + DIV) // aliases for code brevity , sC = state.container // alias for easy access to 'container dimensions' , sID = state.id // alias for unique layout ID/namespace - eg: "layout435" ; // create Instance object to expose data & option Properties, and primary action Methods var Instance = { // layout data options: options // property - options hash , state: state // property - dimensions hash // object pointers , container: $N // property - object pointers for layout container , panes: $Ps // property - object pointers for ALL Panes: panes.north, panes.center , contents: $Cs // property - object pointers for ALL Content: contents.north, contents.center , resizers: $Rs // property - object pointers for ALL Resizers, eg: resizers.north , togglers: $Ts // property - object pointers for ALL Togglers, eg: togglers.north // border-pane open/close , hide: hide // method - ditto , show: show // method - ditto , toggle: toggle // method - pass a 'pane' ("north", "west", etc) , open: open // method - ditto , close: close // method - ditto , slideOpen: slideOpen // method - ditto , slideClose: slideClose // method - ditto , slideToggle: slideToggle // method - ditto // pane actions , setSizeLimits: setSizeLimits // method - pass a 'pane' - update state min/max data , _sizePane: sizePane // method -intended for user by plugins only! , sizePane: manualSizePane // method - pass a 'pane' AND an 'outer-size' in pixels or percent, or 'auto' , sizeContent: sizeContent // method - pass a 'pane' , swapPanes: swapPanes // method - pass TWO 'panes' - will swap them // pane element methods , initContent: initContent // method - ditto , addPane: addPane // method - pass a 'pane' , removePane: removePane // method - pass a 'pane' to remove from layout, add 'true' to delete the pane-elem , createChildLayout: createChildLayout// method - pass a 'pane' and (optional) layout-options (OVERRIDES options[pane].childOptions // special pane option setting , enableClosable: enableClosable // method - pass a 'pane' , disableClosable: disableClosable // method - ditto , enableSlidable: enableSlidable // method - ditto , disableSlidable: disableSlidable // method - ditto , enableResizable: enableResizable // method - ditto , disableResizable: disableResizable// method - ditto // utility methods for panes , allowOverflow: allowOverflow // utility - pass calling element (this) , resetOverflow: resetOverflow // utility - ditto // layout control , destroy: destroy // method - no parameters , initPanes: isInitialized // method - no parameters , resizeAll: resizeAll // method - no parameters // callback triggering , runCallbacks: _runCallbacks // method - pass evtName & pane (if a pane-event), eg: trigger("onopen", "west") // alias collections of options, state and children - created in addPane and extended elsewhere , hasParentLayout: false // set by initContainer() , children: children // pointers to child-layouts, eg: Instance.children["west"] , north: false // alias group: { name: pane, pane: $Ps[pane], options: options[pane], state: state[pane], child: children[pane] } , south: false // ditto , west: false // ditto , east: false // ditto , center: false // ditto }; // create the border layout NOW if (_create() === 'cancel') // onload_start callback returned false to CANCEL layout creation return null; else // true OR false -- if layout-elements did NOT init (hidden or do not exist), can auto-init later return Instance; // return the Instance object } /** * jquery.layout.state 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * * Copyright (c) 2010 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @dependancies: UI Layout 1.3.0.rc30.1 or higher * @dependancies: $.ui.cookie (above) * * @support: http://groups.google.com/group/jquery-ui-layout */ /* * State-management options stored in options.stateManagement, which includes a .cookie hash * Default options saves ALL KEYS for ALL PANES, ie: pane.size, pane.isClosed, pane.isHidden * * // STATE/COOKIE OPTIONS * @example $(el).layout({ stateManagement: { enabled: true , stateKeys: "east.size,west.size,east.isClosed,west.isClosed" , cookie: { name: "appLayout", path: "/" } } }) * @example $(el).layout({ stateManagement__enabled: true }) // enable auto-state-management using cookies * @example $(el).layout({ stateManagement__cookie: { name: "appLayout", path: "/" } }) * @example $(el).layout({ stateManagement__cookie__name: "appLayout", stateManagement__cookie__path: "/" }) * * // STATE/COOKIE METHODS * @example myLayout.saveCookie( "west.isClosed,north.size,south.isHidden", {expires: 7} ); * @example myLayout.loadCookie(); * @example myLayout.deleteCookie(); * @example var JSON = myLayout.readState(); // CURRENT Layout State * @example var JSON = myLayout.readCookie(); // SAVED Layout State (from cookie) * @example var JSON = myLayout.state.stateData; // LAST LOADED Layout State (cookie saved in layout.state hash) * * CUSTOM STATE-MANAGEMENT (eg, saved in a database) * @example var JSON = myLayout.readState( "west.isClosed,north.size,south.isHidden" ); * @example myLayout.loadState( JSON ); */ /** * UI COOKIE UTILITY * * A $.cookie OR $.ui.cookie namespace *should be standard*, but until then... * This creates $.ui.cookie so Layout does not need the cookie.jquery.js plugin * NOTE: This utility is REQUIRED by the layout.state plugin * * Cookie methods in Layout are created as part of State Management */ if (!$.ui) $.ui = {}; $.ui.cookie = { // cookieEnabled is not in DOM specs, but DOES works in all browsers,including IE6 acceptsCookies: !!navigator.cookieEnabled , read: function (name) { var c = document.cookie , cs = c ? c.split(';') : [] , pair // loop var ; for (var i=0, n=cs.length; i < n; i++) { pair = $.trim(cs[i]).split('='); // name=value pair if (pair[0] == name) // found the layout cookie return decodeURIComponent(pair[1]); } return null; } , write: function (name, val, cookieOpts) { var params = '' , date = '' , clear = false , o = cookieOpts || {} , x = o.expires ; if (x && x.toUTCString) date = x; else if (x === null || typeof x === 'number') { date = new Date(); if (x > 0) date.setDate(date.getDate() + x); else { date.setFullYear(1970); clear = true; } } if (date) params += ';expires='+ date.toUTCString(); if (o.path) params += ';path='+ o.path; if (o.domain) params += ';domain='+ o.domain; if (o.secure) params += ';secure'; document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie } , clear: function (name) { $.ui.cookie.write(name, '', {expires: -1}); } }; // if cookie.jquery.js is not loaded, create an alias to replicate it // this may be useful to other plugins or code dependent on that plugin if (!$.cookie) $.cookie = function (k, v, o) { var C = $.ui.cookie; if (v === null) C.clear(k); else if (v === undefined) return C.read(k); else C.write(k, v, o); }; // tell Layout that the state plugin is available $.layout.plugins.stateManagement = true; // Add State-Management options to layout.defaults $.layout.config.optionRootKeys.push("stateManagement"); $.layout.defaults.stateManagement = { enabled: false // true = enable state-management, even if not using cookies , autoSave: true // Save a state-cookie when page exits? , autoLoad: true // Load the state-cookie when Layout inits? // List state-data to save - must be pane-specific , stateKeys: "north.size,south.size,east.size,west.size,"+ "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+ "north.isHidden,south.isHidden,east.isHidden,west.isHidden" , cookie: { name: "" // If not specified, will use Layout.name, else just "Layout" , domain: "" // blank = current domain , path: "" // blank = current page, '/' = entire website , expires: "" // 'days' to keep cookie - leave blank for 'session cookie' , secure: false } }; // Set stateManagement as a layout-option, NOT a pane-option $.layout.optionsMap.layout.push("stateManagement"); /* * State Management methods */ $.layout.state = { /** * Get the current layout state and save it to a cookie * * myLayout.saveCookie( keys, cookieOpts ) * * @param {Object} inst * @param {(string|Array)=} keys * @param {Object=} opts */ saveCookie: function (inst, keys, cookieOpts) { var o = inst.options , oS = o.stateManagement , oC = $.extend(true, {}, oS.cookie, cookieOpts || null) , data = inst.state.stateData = inst.readState( keys || oS.stateKeys ) // read current panes-state ; $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC ); return $.extend(true, {}, data); // return COPY of state.stateData data } /** * Remove the state cookie * * @param {Object} inst */ , deleteCookie: function (inst) { var o = inst.options; $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" ); } /** * Read & return data from the cookie - as JSON * * @param {Object} inst */ , readCookie: function (inst) { var o = inst.options; var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" ); // convert cookie string back to a hash and return it return c ? $.layout.state.decodeJSON(c) : {}; } /** * Get data from the cookie and USE IT to loadState * * @param {Object} inst */ , loadCookie: function (inst) { var c = $.layout.state.readCookie(inst); // READ the cookie if (c) { inst.state.stateData = $.extend(true, {}, c); // SET state.stateData inst.loadState(c); // LOAD the retrieved state } return c; } /** * Update layout options from the cookie, if one exists * * @param {Object} inst * @param {Object=} stateData * @param {boolean=} animate */ , loadState: function (inst, stateData, animate) { stateData = $.layout.transformData( stateData ); // panes = default subkey if ($.isEmptyObject( stateData )) return; $.extend(true, inst.options, stateData); // update layout options // if layout has already been initialized, then UPDATE layout state if (inst.state.initialized) { var pane, vis, o, s, h, c , noAnimate = (animate===false) ; $.each($.layout.config.borderPanes, function (idx, pane) { state = inst.state[pane]; o = stateData[ pane ]; if (typeof o != 'object') return; // no key, continue s = o.size; c = o.initClosed; h = o.initHidden; vis = state.isVisible; // resize BEFORE opening if (!vis) inst.sizePane(pane, s, false, false); if (h === true) inst.hide(pane, noAnimate); else if (c === false) inst.open (pane, false, noAnimate); else if (c === true) inst.close(pane, false, noAnimate); else if (h === false) inst.show (pane, false, noAnimate); // resize AFTER any other actions if (vis) inst.sizePane(pane, s, false, noAnimate); // animate resize if option passed }); }; } /** * Get the *current layout state* and return it as a hash * * @param {Object=} inst * @param {(string|Array)=} keys */ , readState: function (inst, keys) { var data = {} , alt = { isClosed: 'initClosed', isHidden: 'initHidden' } , state = inst.state , panes = $.layout.config.allPanes , pair, pane, key, val ; if (!keys) keys = inst.options.stateManagement.stateKeys; // if called by user if ($.isArray(keys)) keys = keys.join(","); // convert keys to an array and change delimiters from '__' to '.' keys = keys.replace(/__/g, ".").split(','); // loop keys and create a data hash for (var i=0, n=keys.length; i < n; i++) { pair = keys[i].split("."); pane = pair[0]; key = pair[1]; if ($.inArray(pane, panes) < 0) continue; // bad pane! val = state[ pane ][ key ]; if (val == undefined) continue; if (key=="isClosed" && state[pane]["isSliding"]) val = true; // if sliding, then *really* isClosed ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val; } return data; } /** * Stringify a JSON hash so can save in a cookie or db-field */ , encodeJSON: function (JSON) { return parse(JSON); function parse (h) { var D=[], i=0, k, v, t; // k = key, v = value for (k in h) { v = h[k]; t = typeof v; if (t == 'string') // STRING - add quotes v = '"'+ v +'"'; else if (t == 'object') // SUB-KEY - recurse into it v = parse(v); D[i++] = '"'+ k +'":'+ v; } return '{'+ D.join(',') +'}'; }; } /** * Convert stringified JSON back to a hash object * @see $.parseJSON(), adding in jQuery 1.4.1 */ , decodeJSON: function (str) { try { return $.parseJSON ? $.parseJSON(str) : window["eval"]("("+ str +")") || {}; } catch (e) { return {}; } } , _create: function (inst) { var _ = $.layout.state; // ADD State-Management plugin methods to inst $.extend( inst, { // readCookie - update options from cookie - returns hash of cookie data readCookie: function () { return _.readCookie(inst); } // deleteCookie , deleteCookie: function () { _.deleteCookie(inst); } // saveCookie - optionally pass keys-list and cookie-options (hash) , saveCookie: function (keys, cookieOpts) { return _.saveCookie(inst, keys, cookieOpts); } // loadCookie - readCookie and use to loadState() - returns hash of cookie data , loadCookie: function () { return _.loadCookie(inst); } // loadState - pass a hash of state to use to update options , loadState: function (stateData, animate) { _.loadState(inst, stateData, animate); } // readState - returns hash of current layout-state , readState: function (keys) { return _.readState(inst, keys); } // add JSON utility methods too... , encodeJSON: _.encodeJSON , decodeJSON: _.decodeJSON }); // init state.stateData key, even if plugin is initially disabled inst.state.stateData = {}; // read and load cookie-data per options var oS = inst.options.stateManagement; if (oS.enabled) { if (oS.autoLoad) // update the options from the cookie inst.loadCookie(); else // don't modify options - just store cookie data in state.stateData inst.state.stateData = inst.readCookie(); } } , _unload: function (inst) { var oS = inst.options.stateManagement; if (oS.enabled) { if (oS.autoSave) // save a state-cookie automatically inst.saveCookie(); else // don't save a cookie, but do store state-data in state.stateData key inst.state.stateData = inst.readState(); } } }; // add state initialization method to Layout's onCreate array of functions $.layout.onCreate.push( $.layout.state._create ); $.layout.onUnload.push( $.layout.state._unload ); /** * jquery.layout.buttons 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * * Copyright (c) 2010 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @dependancies: UI Layout 1.3.0.rc30.1 or higher * * @support: http://groups.google.com/group/jquery-ui-layout * * Docs: [ to come ] * Tips: [ to come ] */ // tell Layout that the state plugin is available $.layout.plugins.buttons = true; // Add buttons options to layout.defaults $.layout.defaults.autoBindCustomButtons = false; // Specify autoBindCustomButtons as a layout-option, NOT a pane-option $.layout.optionsMap.layout.push("autoBindCustomButtons"); var lang = $.layout.language; /* * Button methods */ $.layout.buttons = { /** * Searches for .ui-layout-button-xxx elements and auto-binds them as layout-buttons * * @see _create() * * @param {Object} inst Layout Instance object */ init: function (inst) { var pre = "ui-layout-button-" , layout = inst.options.name || "" , name; $.each("toggle,open,close,pin,toggle-slide,open-slide".split(","), function (i, action) { $.each($.layout.config.borderPanes, function (ii, pane) { $("."+pre+action+"-"+pane).each(function(){ // if button was previously 'bound', data.layoutName was set, but is blank if layout has no 'name' name = $(this).data("layoutName") || $(this).attr("layoutName"); if (name == undefined || name === layout) inst.bindButton(this, action, pane); }); }); }); } /** * Helper function to validate params received by addButton utilities * * Two classes are added to the element, based on the buttonClass... * The type of button is appended to create the 2nd className: * - ui-layout-button-pin // action btnClass * - ui-layout-button-pin-west // action btnClass + pane * - ui-layout-button-toggle * - ui-layout-button-open * - ui-layout-button-close * * @param {Object} inst Layout Instance object * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. * * @return {Array.<Object>} If both params valid, the element matching 'selector' in a jQuery wrapper - otherwise returns null */ , get: function (inst, selector, pane, action) { var $E = $(selector) , o = inst.options , err = o.showErrorMessages ; if (!$E.length) { // element not found if (err) $.layout.msg(lang.errButton + lang.selector +": "+ selector, true); } else if ($.inArray(pane, $.layout.config.borderPanes) < 0) { // invalid 'pane' sepecified if (err) $.layout.msg(lang.errButton + lang.pane +": "+ pane, true); $E = $(""); // NO BUTTON } else { // VALID var btn = o[pane].buttonClass +"-"+ action; $E .addClass( btn +" "+ btn +"-"+ pane ) .data("layoutName", o.name); // add layout identifier - even if blank! } return $E; } /** * NEW syntax for binding layout-buttons - will eventually replace addToggle, addOpen, etc. * * @param {Object} inst Layout Instance object * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" * @param {string} action * @param {string} pane */ , bind: function (inst, selector, action, pane) { var _ = $.layout.buttons; switch (action.toLowerCase()) { case "toggle": _.addToggle (inst, selector, pane); break; case "open": _.addOpen (inst, selector, pane); break; case "close": _.addClose (inst, selector, pane); break; case "pin": _.addPin (inst, selector, pane); break; case "toggle-slide": _.addToggle (inst, selector, pane, true); break; case "open-slide": _.addOpen (inst, selector, pane, true); break; } return inst; } /** * Add a custom Toggler button for a pane * * @param {Object} inst Layout Instance object * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. * @param {boolean=} slide true = slide-open, false = pin-open */ , addToggle: function (inst, selector, pane, slide) { $.layout.buttons.get(inst, selector, pane, "toggle") .click(function(evt){ inst.toggle(pane, !!slide); evt.stopPropagation(); }); return inst; } /** * Add a custom Open button for a pane * * @param {Object} inst Layout Instance object * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. * @param {boolean=} slide true = slide-open, false = pin-open */ , addOpen: function (inst, selector, pane, slide) { $.layout.buttons.get(inst, selector, pane, "open") .attr("title", lang.Open) .click(function (evt) { inst.open(pane, !!slide); evt.stopPropagation(); }); return inst; } /** * Add a custom Close button for a pane * * @param {Object} inst Layout Instance object * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" * @param {string} pane Name of the pane the button is for: 'north', 'south', etc. */ , addClose: function (inst, selector, pane) { $.layout.buttons.get(inst, selector, pane, "close") .attr("title", lang.Close) .click(function (evt) { inst.close(pane); evt.stopPropagation(); }); return inst; } /** * Add a custom Pin button for a pane * * Four classes are added to the element, based on the paneClass for the associated pane... * Assuming the default paneClass and the pin is 'up', these classes are added for a west-pane pin: * - ui-layout-pane-pin * - ui-layout-pane-west-pin * - ui-layout-pane-pin-up * - ui-layout-pane-west-pin-up * * @param {Object} inst Layout Instance object * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button" * @param {string} pane Name of the pane the pin is for: 'north', 'south', etc. */ , addPin: function (inst, selector, pane) { var _ = $.layout.buttons , $E = _.get(inst, selector, pane, "pin"); if ($E.length) { var s = inst.state[pane]; $E.click(function (evt) { _.setPinState(inst, $(this), pane, (s.isSliding || s.isClosed)); if (s.isSliding || s.isClosed) inst.open( pane ); // change from sliding to open else inst.close( pane ); // slide-closed evt.stopPropagation(); }); // add up/down pin attributes and classes _.setPinState(inst, $E, pane, (!s.isClosed && !s.isSliding)); // add this pin to the pane data so we can 'sync it' automatically // PANE.pins key is an array so we can store multiple pins for each pane s.pins.push( selector ); // just save the selector string } return inst; } /** * Change the class of the pin button to make it look 'up' or 'down' * * @see addPin(), syncPins() * * @param {Object} inst Layout Instance object * @param {Array.<Object>} $Pin The pin-span element in a jQuery wrapper * @param {string} pane These are the params returned to callbacks by layout() * @param {boolean} doPin true = set the pin 'down', false = set it 'up' */ , setPinState: function (inst, $Pin, pane, doPin) { var updown = $Pin.attr("pin"); if (updown && doPin === (updown=="down")) return; // already in correct state var pin = inst.options[pane].buttonClass +"-pin" , side = pin +"-"+ pane , UP = pin +"-up "+ side +"-up" , DN = pin +"-down "+side +"-down" ; $Pin .attr("pin", doPin ? "down" : "up") // logic .attr("title", doPin ? lang.Unpin : lang.Pin) .removeClass( doPin ? UP : DN ) .addClass( doPin ? DN : UP ) ; } /** * INTERNAL function to sync 'pin buttons' when pane is opened or closed * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes * * @see open(), close() * * @param {Object} inst Layout Instance object * @param {string} pane These are the params returned to callbacks by layout() * @param {boolean} doPin True means set the pin 'down', False means 'up' */ , syncPinBtns: function (inst, pane, doPin) { // REAL METHOD IS _INSIDE_ LAYOUT - THIS IS HERE JUST FOR REFERENCE $.each(state[pane].pins, function (i, selector) { $.layout.buttons.setPinState(inst, $(selector), pane, doPin); }); } , _load: function (inst) { var _ = $.layout.buttons; // ADD Button methods to Layout Instance // Note: sel = jQuery Selector string $.extend( inst, { bindButton: function (sel, action, pane) { return _.bind(inst, sel, action, pane); } // DEPRECATED METHODS , addToggleBtn: function (sel, pane, slide) { return _.addToggle(inst, sel, pane, slide); } , addOpenBtn: function (sel, pane, slide) { return _.addOpen(inst, sel, pane, slide); } , addCloseBtn: function (sel, pane) { return _.addClose(inst, sel, pane); } , addPinBtn: function (sel, pane) { return _.addPin(inst, sel, pane); } }); // init state array to hold pin-buttons for (var i=0; i<4; i++) { var pane = $.layout.config.borderPanes[i]; inst.state[pane].pins = []; } // auto-init buttons onLoad if option is enabled if ( inst.options.autoBindCustomButtons ) _.init(inst); } , _unload: function (inst) { // TODO: unbind all buttons??? } }; // add initialization method to Layout's onLoad array of functions $.layout.onLoad.push( $.layout.buttons._load ); //$.layout.onUnload.push( $.layout.buttons._unload ); /** * jquery.layout.browserZoom 1.0 * $Date: 2011-12-29 08:00:00 (Thu, 29 Dec 2011) $ * * Copyright (c) 2012 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @dependancies: UI Layout 1.3.0.rc30.1 or higher * * @support: http://groups.google.com/group/jquery-ui-layout * * @todo: Extend logic to handle other problematic zooming in browsers * @todo: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event */ // tell Layout that the plugin is available $.layout.plugins.browserZoom = true; $.layout.defaults.browserZoomCheckInterval = 1000; $.layout.optionsMap.layout.push("browserZoomCheckInterval"); /* * browserZoom methods */ $.layout.browserZoom = { _init: function (inst) { // abort if browser does not need this check if ($.layout.browserZoom.ratio() !== false) $.layout.browserZoom._setTimer(inst); } , _setTimer: function (inst) { // abort if layout destroyed or browser does not need this check if (inst.destroyed) return; var o = inst.options , s = inst.state // don't need check if inst has parentLayout, but check occassionally in case parent destroyed! // MINIMUM 100ms interval, for performance , ms = inst.hasParentLayout ? 5000 : Math.max( o.browserZoomCheckInterval, 100 ) ; // set the timer setTimeout(function(){ if (inst.destroyed || !o.resizeWithWindow) return; var d = $.layout.browserZoom.ratio(); if (d !== s.browserZoom) { s.browserZoom = d; inst.resizeAll(); } // set a NEW timeout $.layout.browserZoom._setTimer(inst); } , ms ); } , ratio: function () { var w = window , s = screen , d = document , dE = d.documentElement || d.body , b = $.layout.browser , v = b.version , r, sW, cW ; // we can ignore all browsers that fire window.resize event onZoom if ((b.msie && v > 8) || !b.msie ) return false; // don't need to track zoom if (s.deviceXDPI) return calc(s.deviceXDPI, s.systemXDPI); // everything below is just for future reference! if (b.webkit && (r = d.body.getBoundingClientRect)) return calc((r.left - r.right), d.body.offsetWidth); if (b.webkit && (sW = w.outerWidth)) return calc(sW, w.innerWidth); if ((sW = s.width) && (cW = dE.clientWidth)) return calc(sW, cW); return false; // no match, so cannot - or don't need to - track zoom function calc (x,y) { return (parseInt(x,10) / parseInt(y,10) * 100).toFixed(); } } }; // add initialization method to Layout's onLoad array of functions $.layout.onReady.push( $.layout.browserZoom._init ); })( jQuery );
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-layout.js
jquery-layout.js
(function ($) { var ColorPicker = function () { var ids = {}, inAction, charMin = 65, visible, tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>', defaults = { eventName: 'click', onShow: function () {}, onBeforeShow: function(){}, onHide: function () {}, onChange: function () {}, onSubmit: function () {}, color: 'ff0000', livePreview: true, flat: false }, fillRGBFields = function (hsb, cal) { var rgb = HSBToRGB(hsb); $(cal).data('colorpicker').fields .eq(1).val(rgb.r).end() .eq(2).val(rgb.g).end() .eq(3).val(rgb.b).end(); }, fillHSBFields = function (hsb, cal) { $(cal).data('colorpicker').fields .eq(4).val(hsb.h).end() .eq(5).val(hsb.s).end() .eq(6).val(hsb.b).end(); }, fillHexFields = function (hsb, cal) { $(cal).data('colorpicker').fields .eq(0).val(HSBToHex(hsb)).end(); }, setSelector = function (hsb, cal) { $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100})); $(cal).data('colorpicker').selectorIndic.css({ left: parseInt(150 * hsb.s/100, 10), top: parseInt(150 * (100-hsb.b)/100, 10) }); }, setHue = function (hsb, cal) { $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10)); }, setCurrentColor = function (hsb, cal) { $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb)); }, setNewColor = function (hsb, cal) { $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb)); }, keyDown = function (ev) { var pressedKey = ev.charCode || ev.keyCode || -1; if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) { return false; } var cal = $(this).parent().parent(); if (cal.data('colorpicker').livePreview === true) { change.apply(this); } }, change = function (ev) { var cal = $(this).parent().parent(), col; if (this.parentNode.className.indexOf('_hex') > 0) { cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value)); } else if (this.parentNode.className.indexOf('_hsb') > 0) { cal.data('colorpicker').color = col = fixHSB({ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10), s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10), b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10) }); } else { cal.data('colorpicker').color = col = RGBToHSB(fixRGB({ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10), g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10), b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10) })); } if (ev) { fillRGBFields(col, cal.get(0)); fillHexFields(col, cal.get(0)); fillHSBFields(col, cal.get(0)); } setSelector(col, cal.get(0)); setHue(col, cal.get(0)); setNewColor(col, cal.get(0)); cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]); }, blur = function (ev) { var cal = $(this).parent().parent(); cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus'); }, focus = function () { charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65; $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus'); $(this).parent().addClass('colorpicker_focus'); }, downIncrement = function (ev) { var field = $(this).parent().find('input').focus(); var current = { el: $(this).parent().addClass('colorpicker_slider'), max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255), y: ev.pageY, field: field, val: parseInt(field.val(), 10), preview: $(this).parent().parent().data('colorpicker').livePreview }; $(document).bind('mouseup', current, upIncrement); $(document).bind('mousemove', current, moveIncrement); }, moveIncrement = function (ev) { ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10)))); if (ev.data.preview) { change.apply(ev.data.field.get(0), [true]); } return false; }, upIncrement = function (ev) { change.apply(ev.data.field.get(0), [true]); ev.data.el.removeClass('colorpicker_slider').find('input').focus(); $(document).unbind('mouseup', upIncrement); $(document).unbind('mousemove', moveIncrement); return false; }, downHue = function (ev) { var current = { cal: $(this).parent(), y: $(this).offset().top }; current.preview = current.cal.data('colorpicker').livePreview; $(document).bind('mouseup', current, upHue); $(document).bind('mousemove', current, moveHue); }, moveHue = function (ev) { change.apply( ev.data.cal.data('colorpicker') .fields .eq(4) .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10)) .get(0), [ev.data.preview] ); return false; }, upHue = function (ev) { fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); $(document).unbind('mouseup', upHue); $(document).unbind('mousemove', moveHue); return false; }, downSelector = function (ev) { var current = { cal: $(this).parent(), pos: $(this).offset() }; current.preview = current.cal.data('colorpicker').livePreview; $(document).bind('mouseup', current, upSelector); $(document).bind('mousemove', current, moveSelector); }, moveSelector = function (ev) { change.apply( ev.data.cal.data('colorpicker') .fields .eq(6) .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10)) .end() .eq(5) .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10)) .get(0), [ev.data.preview] ); return false; }, upSelector = function (ev) { fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); $(document).unbind('mouseup', upSelector); $(document).unbind('mousemove', moveSelector); return false; }, enterSubmit = function (ev) { $(this).addClass('colorpicker_focus'); }, leaveSubmit = function (ev) { $(this).removeClass('colorpicker_focus'); }, clickSubmit = function (ev) { var cal = $(this).parent(); var col = cal.data('colorpicker').color; cal.data('colorpicker').origColor = col; setCurrentColor(col, cal.get(0)); cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el); }, show = function (ev) { var cal = $('#' + $(this).data('colorpickerId')); cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]); var pos = $(this).offset(); var viewPort = getViewport(); var top = pos.top + this.offsetHeight; var left = pos.left; if (top + 176 > viewPort.t + viewPort.h) { top -= this.offsetHeight + 176; } if (left + 356 > viewPort.l + viewPort.w) { left -= 356; } cal.css({left: left + 'px', top: top + 'px'}); if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) { cal.show(); } $(document).bind('mousedown', {cal: cal}, hide); return false; }, hide = function (ev) { if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) { if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) { ev.data.cal.hide(); } $(document).unbind('mousedown', hide); } }, isChildOf = function(parentEl, el, container) { if (parentEl == el) { return true; } if (parentEl.contains) { return parentEl.contains(el); } if ( parentEl.compareDocumentPosition ) { return !!(parentEl.compareDocumentPosition(el) & 16); } var prEl = el.parentNode; while(prEl && prEl != container) { if (prEl == parentEl) return true; prEl = prEl.parentNode; } return false; }, getViewport = function () { var m = document.compatMode == 'CSS1Compat'; return { l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft), t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop), w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth), h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight) }; }, fixHSB = function (hsb) { return { h: Math.min(360, Math.max(0, hsb.h)), s: Math.min(100, Math.max(0, hsb.s)), b: Math.min(100, Math.max(0, hsb.b)) }; }, fixRGB = function (rgb) { return { r: Math.min(255, Math.max(0, rgb.r)), g: Math.min(255, Math.max(0, rgb.g)), b: Math.min(255, Math.max(0, rgb.b)) }; }, fixHex = function (hex) { var len = 6 - hex.length; if (len > 0) { var o = []; for (var i=0; i<len; i++) { o.push('0'); } o.push(hex); hex = o.join(''); } return hex; }, HexToRGB = function (hex) { var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16); return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)}; }, HexToHSB = function (hex) { return RGBToHSB(HexToRGB(hex)); }, RGBToHSB = function (rgb) { var hsb = { h: 0, s: 0, b: 0 }; var min = Math.min(rgb.r, rgb.g, rgb.b); var max = Math.max(rgb.r, rgb.g, rgb.b); var delta = max - min; hsb.b = max; if (max != 0) { } hsb.s = max != 0 ? 255 * delta / max : 0; if (hsb.s != 0) { if (rgb.r == max) { hsb.h = (rgb.g - rgb.b) / delta; } else if (rgb.g == max) { hsb.h = 2 + (rgb.b - rgb.r) / delta; } else { hsb.h = 4 + (rgb.r - rgb.g) / delta; } } else { hsb.h = -1; } hsb.h *= 60; if (hsb.h < 0) { hsb.h += 360; } hsb.s *= 100/255; hsb.b *= 100/255; return hsb; }, HSBToRGB = function (hsb) { var rgb = {}; var h = Math.round(hsb.h); var s = Math.round(hsb.s*255/100); var v = Math.round(hsb.b*255/100); if(s == 0) { rgb.r = rgb.g = rgb.b = v; } else { var t1 = v; var t2 = (255-s)*v/255; var t3 = (t1-t2)*(h%60)/60; if(h==360) h = 0; if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3} else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3} else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3} else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3} else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3} else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3} else {rgb.r=0; rgb.g=0; rgb.b=0} } return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)}; }, RGBToHex = function (rgb) { var hex = [ rgb.r.toString(16), rgb.g.toString(16), rgb.b.toString(16) ]; $.each(hex, function (nr, val) { if (val.length == 1) { hex[nr] = '0' + val; } }); return hex.join(''); }, HSBToHex = function (hsb) { return RGBToHex(HSBToRGB(hsb)); }, restoreOriginal = function () { var cal = $(this).parent(); var col = cal.data('colorpicker').origColor; cal.data('colorpicker').color = col; fillRGBFields(col, cal.get(0)); fillHexFields(col, cal.get(0)); fillHSBFields(col, cal.get(0)); setSelector(col, cal.get(0)); setHue(col, cal.get(0)); setNewColor(col, cal.get(0)); }; return { init: function (opt) { opt = $.extend({}, defaults, opt||{}); if (typeof opt.color == 'string') { opt.color = HexToHSB(opt.color); } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) { opt.color = RGBToHSB(opt.color); } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) { opt.color = fixHSB(opt.color); } else { return this; } return this.each(function () { if (!$(this).data('colorpickerId')) { var options = $.extend({}, opt); options.origColor = opt.color; var id = 'collorpicker_' + parseInt(Math.random() * 1000); $(this).data('colorpickerId', id); var cal = $(tpl).attr('id', id); if (options.flat) { cal.appendTo(this).show(); } else { cal.appendTo(document.body); } options.fields = cal .find('input') .bind('keyup', keyDown) .bind('change', change) .bind('blur', blur) .bind('focus', focus); cal .find('span').bind('mousedown', downIncrement).end() .find('>div.colorpicker_current_color').bind('click', restoreOriginal); options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector); options.selectorIndic = options.selector.find('div div'); options.el = this; options.hue = cal.find('div.colorpicker_hue div'); cal.find('div.colorpicker_hue').bind('mousedown', downHue); options.newColor = cal.find('div.colorpicker_new_color'); options.currentColor = cal.find('div.colorpicker_current_color'); cal.data('colorpicker', options); cal.find('div.colorpicker_submit') .bind('mouseenter', enterSubmit) .bind('mouseleave', leaveSubmit) .bind('click', clickSubmit); fillRGBFields(options.color, cal.get(0)); fillHSBFields(options.color, cal.get(0)); fillHexFields(options.color, cal.get(0)); setHue(options.color, cal.get(0)); setSelector(options.color, cal.get(0)); setCurrentColor(options.color, cal.get(0)); setNewColor(options.color, cal.get(0)); if (options.flat) { cal.css({ position: 'relative', display: 'block' }); } else { $(this).bind(options.eventName, show); } } }); }, showPicker: function() { return this.each( function () { if ($(this).data('colorpickerId')) { show.apply(this); } }); }, hidePicker: function() { return this.each( function () { if ($(this).data('colorpickerId')) { $('#' + $(this).data('colorpickerId')).hide(); } }); }, setColor: function(col) { if (typeof col == 'string') { col = HexToHSB(col); } else if (col.r != undefined && col.g != undefined && col.b != undefined) { col = RGBToHSB(col); } else if (col.h != undefined && col.s != undefined && col.b != undefined) { col = fixHSB(col); } else { return this; } return this.each(function(){ if ($(this).data('colorpickerId')) { var cal = $('#' + $(this).data('colorpickerId')); cal.data('colorpicker').color = col; cal.data('colorpicker').origColor = col; fillRGBFields(col, cal.get(0)); fillHSBFields(col, cal.get(0)); fillHexFields(col, cal.get(0)); setHue(col, cal.get(0)); setSelector(col, cal.get(0)); setCurrentColor(col, cal.get(0)); setNewColor(col, cal.get(0)); } }); } }; }(); $.fn.extend({ ColorPicker: ColorPicker.init, ColorPickerHide: ColorPicker.hidePicker, ColorPickerShow: ColorPicker.showPicker, ColorPickerSetColor: ColorPicker.setColor }); })(jQuery)
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-colorpicker.js
jquery-colorpicker.js
(function($) { // Helps to make options available to all functions // TODO: This gives problems when there are both expandable and // non-expandable // trees on a page. The options shouldn't be global to all these instances! var options; $.fn.treeTable = function(opts) { options = $.extend( {}, $.fn.treeTable.defaults, opts); return this.each(function() { $(this).addClass("treeTable").find("tbody tr").each(function() { // Initialize root nodes only if possible if (!options.expandable || $(this)[0].className.search("child-of-") == -1) { initialize($(this)); } else if (options.initialState == "collapsed") { this.style.display = "none"; // Performance! // $(this).hide() is // slow... } }); }); }; $.fn.treeTable.defaults = { childPrefix : "child-of-", clickableNodeNames : false, expandable : true, indent : 19, initialState : "collapsed", treeColumn : 0 }; // Recursively hide all node's children in a tree $.fn.collapse = function() { $(this).addClass("collapsed"); childrenOf($(this)).each(function() { if (!$(this).hasClass("collapsed")) { $(this).collapse(); } $(this).hide(); }); return this; }; // Recursively show all node's children in a tree $.fn.expand = function() { $(this).removeClass("collapsed").addClass("expanded"); childrenOf($(this)).each(function() { initialize($(this)); if ($(this).is(".expanded.parent")) { $(this).expand(); } $(this).show(); }); return this; }; // Add an entire branch to +destination+ $.fn.appendBranchTo = function(destination) { var node = $(this); var parent = parentOf(node); var ancestorNames = $.map(ancestorsOf($(destination)), function(a) { return a.id; }); // Conditions: // 1: +node+ should not be inserted in a location in a branch if this // would // result in +node+ being an ancestor of itself. // 2: +node+ should not have a parent OR the destination should not be // the // same as +node+'s current parent (this last condition prevents +node+ // from being moved to the same location where it already is). // 3: +node+ should not be inserted as a child of +node+ itself. if ($.inArray(node[0].id, ancestorNames) == -1 && (!parent || (destination.id != parent[0].id)) && destination.id != node[0].id) { indent(node, ancestorsOf(node).length * options.indent * -1); // Remove // indentation if (parent) { node.removeClass(options.childPrefix + parent[0].id); } node.addClass(options.childPrefix + destination.id); move(node, destination); // Recursively move nodes to new // location indent(node, ancestorsOf(node).length * options.indent); return this; } return false; }; // Add reverse() function from JS Arrays $.fn.reverse = function() { return this.pushStack(this.get().reverse(), arguments); }; // Toggle an entire branch $.fn.toggleBranch = function() { if ($(this).hasClass("collapsed")) { $(this).expand(); } else { $(this).removeClass("expanded").collapse(); } return this; }; // === Private functions function ancestorsOf(node) { var ancestors = []; while (node = parentOf(node)) { ancestors[ancestors.length] = node[0]; } return ancestors; }; function childrenOf(node) { return $("table.treeTable tbody tr." + options.childPrefix + node[0].id); }; function indent(node, value) { var cell = $(node.children("td")[options.treeColumn]); var padding = parseInt(cell.css("padding-left"), 10) + value; cell.css("padding-left", +padding + "px"); childrenOf(node).each(function() { indent($(this), value); }); }; function initialize(node) { if (!node.hasClass("initialized")) { node.addClass("initialized"); var childNodes = childrenOf(node); if (!node.hasClass("parent") && childNodes.length > 0) { node.addClass("parent"); } if (node.hasClass("parent")) { var cell = $(node.children("td")[options.treeColumn]); var padding = parseInt(cell.css("padding-left"), 10) + options.indent; childNodes.each(function() { $($(this).children("td")[options.treeColumn]).css( "padding-left", padding + "px"); }); if (options.expandable) { cell.prepend('<span style="margin-left: -' + options.indent + 'px; padding-left: ' + options.indent + 'px" class="expander"></span>'); $(cell[0].firstChild).click(function() { node.toggleBranch(); }); if (options.clickableNodeNames) { $(cell).css('cursor', 'pointer'); $(cell).click(function(e) { // Don't double-toggle if the click is on the // existing expander icon if (e.target.className != 'expander') { node.toggleBranch(); } }); } // Check for a class set explicitly by the user, otherwise // set the default class if (!(node.hasClass("expanded") || node .hasClass("collapsed"))) { node.addClass(options.initialState); } if (node.hasClass("expanded")) { node.expand(); } } } } }; function move(node, destination) { node.insertAfter(destination); childrenOf(node).reverse().each(function() { move($(this), node[0]); }); }; function parentOf(node) { var classNames = node[0].className.split(' '); for (key in classNames) { if (classNames[key].match("child-of-")) { return $("#" + classNames[key].substring(9)); } } }; })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-treeTable.js
jquery-treeTable.js
;(function($) { var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right, selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [], ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i, loadingTimer, loadingFrame = 1, titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }), isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest, /* * Private methods */ _abort = function() { loading.hide(); imgPreloader.onerror = imgPreloader.onload = null; if (ajaxLoader) { ajaxLoader.abort(); } tmp.empty(); }, _error = function() { if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) { loading.hide(); busy = false; return; } selectedOpts.titleShow = false; selectedOpts.width = 'auto'; selectedOpts.height = 'auto'; tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' ); _process_inline(); }, _start = function() { var obj = selectedArray[ selectedIndex ], href, type, title, str, emb, ret; _abort(); selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox'))); ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts); if (ret === false) { busy = false; return; } else if (typeof ret == 'object') { selectedOpts = $.extend(selectedOpts, ret); } title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || ''; if (obj.nodeName && !selectedOpts.orig) { selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj); } if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) { title = selectedOpts.orig.attr('alt'); } href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null; if ((/^(?:javascript)/i).test(href) || href == '#') { href = null; } if (selectedOpts.type) { type = selectedOpts.type; if (!href) { href = selectedOpts.content; } } else if (selectedOpts.content) { type = 'html'; } else if (href) { if (href.match(imgRegExp)) { type = 'image'; } else if (href.match(swfRegExp)) { type = 'swf'; } else if ($(obj).hasClass("iframe")) { type = 'iframe'; } else if (href.indexOf("#") === 0) { type = 'inline'; } else { type = 'ajax'; } } if (!type) { _error(); return; } if (type == 'inline') { obj = href.substr(href.indexOf("#")); type = $(obj).length > 0 ? 'inline' : 'ajax'; } selectedOpts.type = type; selectedOpts.href = href; selectedOpts.title = title; if (selectedOpts.autoDimensions) { if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') { selectedOpts.width = 'auto'; selectedOpts.height = 'auto'; } else { selectedOpts.autoDimensions = false; } } if (selectedOpts.modal) { selectedOpts.overlayShow = true; selectedOpts.hideOnOverlayClick = false; selectedOpts.hideOnContentClick = false; selectedOpts.enableEscapeButton = false; selectedOpts.showCloseButton = false; } selectedOpts.padding = parseInt(selectedOpts.padding, 10); selectedOpts.margin = parseInt(selectedOpts.margin, 10); tmp.css('padding', (selectedOpts.padding + selectedOpts.margin)); $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() { $(this).replaceWith(content.children()); }); switch (type) { case 'html' : tmp.html( selectedOpts.content ); _process_inline(); break; case 'inline' : if ( $(obj).parent().is('#fancybox-content') === true) { busy = false; return; } $('<div class="fancybox-inline-tmp" />') .hide() .insertBefore( $(obj) ) .bind('fancybox-cleanup', function() { $(this).replaceWith(content.children()); }).bind('fancybox-cancel', function() { $(this).replaceWith(tmp.children()); }); $(obj).appendTo(tmp); _process_inline(); break; case 'image': busy = false; $.fancybox.showActivity(); imgPreloader = new Image(); imgPreloader.onerror = function() { _error(); }; imgPreloader.onload = function() { busy = true; imgPreloader.onerror = imgPreloader.onload = null; _process_image(); }; imgPreloader.src = href; break; case 'swf': selectedOpts.scrolling = 'no'; str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>'; emb = ''; $.each(selectedOpts.swf, function(name, val) { str += '<param name="' + name + '" value="' + val + '"></param>'; emb += ' ' + name + '="' + val + '"'; }); str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>'; tmp.html(str); _process_inline(); break; case 'ajax': busy = false; $.fancybox.showActivity(); selectedOpts.ajax.win = selectedOpts.ajax.success; ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, { url : href, data : selectedOpts.ajax.data || {}, error : function(XMLHttpRequest, textStatus, errorThrown) { if ( XMLHttpRequest.status > 0 ) { _error(); } }, success : function(data, textStatus, XMLHttpRequest) { var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader; if (o.status == 200) { if ( typeof selectedOpts.ajax.win == 'function' ) { ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest); if (ret === false) { loading.hide(); return; } else if (typeof ret == 'string' || typeof ret == 'object') { data = ret; } } tmp.html( data ); _process_inline(); } } })); break; case 'iframe': _show(); break; } }, _process_inline = function() { var w = selectedOpts.width, h = selectedOpts.height; if (w.toString().indexOf('%') > -1) { w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px'; } else { w = w == 'auto' ? 'auto' : w + 'px'; } if (h.toString().indexOf('%') > -1) { h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px'; } else { h = h == 'auto' ? 'auto' : h + 'px'; } tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>'); selectedOpts.width = tmp.width(); selectedOpts.height = tmp.height(); _show(); }, _process_image = function() { selectedOpts.width = imgPreloader.width; selectedOpts.height = imgPreloader.height; $("<img />").attr({ 'id' : 'fancybox-img', 'src' : imgPreloader.src, 'alt' : selectedOpts.title }).appendTo( tmp ); _show(); }, _show = function() { var pos, equal; loading.hide(); if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { $.event.trigger('fancybox-cancel'); busy = false; return; } busy = true; $(content.add( overlay )).unbind(); $(window).unbind("resize.fb scroll.fb"); $(document).unbind('keydown.fb'); if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') { wrap.css('height', wrap.height()); } currentArray = selectedArray; currentIndex = selectedIndex; currentOpts = selectedOpts; if (currentOpts.overlayShow) { overlay.css({ 'background-color' : currentOpts.overlayColor, 'opacity' : currentOpts.overlayOpacity, 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto', 'height' : $(document).height() }); if (!overlay.is(':visible')) { if (isIE6) { $('select:not(#fancybox-tmp select)').filter(function() { return this.style.visibility !== 'hidden'; }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() { this.style.visibility = 'inherit'; }); } overlay.show(); } } else { overlay.hide(); } final_pos = _get_zoom_to(); _process_title(); if (wrap.is(":visible")) { $( close.add( nav_left ).add( nav_right ) ).hide(); pos = wrap.position(), start_pos = { top : pos.top, left : pos.left, width : wrap.width(), height : wrap.height() }; equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height); content.fadeTo(currentOpts.changeFade, 0.3, function() { var finish_resizing = function() { content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish); }; $.event.trigger('fancybox-change'); content .empty() .removeAttr('filter') .css({ 'border-width' : currentOpts.padding, 'width' : final_pos.width - currentOpts.padding * 2, 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 }); if (equal) { finish_resizing(); } else { fx.prop = 0; $(fx).animate({prop: 1}, { duration : currentOpts.changeSpeed, easing : currentOpts.easingChange, step : _draw, complete : finish_resizing }); } }); return; } wrap.removeAttr("style"); content.css('border-width', currentOpts.padding); if (currentOpts.transitionIn == 'elastic') { start_pos = _get_zoom_from(); content.html( tmp.contents() ); wrap.show(); if (currentOpts.opacity) { final_pos.opacity = 0; } fx.prop = 0; $(fx).animate({prop: 1}, { duration : currentOpts.speedIn, easing : currentOpts.easingIn, step : _draw, complete : _finish }); return; } if (currentOpts.titlePosition == 'inside' && titleHeight > 0) { title.show(); } content .css({ 'width' : final_pos.width - currentOpts.padding * 2, 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2 }) .html( tmp.contents() ); wrap .css(final_pos) .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish ); }, _format_title = function(title) { if (title && title.length) { if (currentOpts.titlePosition == 'float') { return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>'; } return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>'; } return false; }, _process_title = function() { titleStr = currentOpts.title || ''; titleHeight = 0; title .empty() .removeAttr('style') .removeClass(); if (currentOpts.titleShow === false) { title.hide(); return; } titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr); if (!titleStr || titleStr === '') { title.hide(); return; } title .addClass('fancybox-title-' + currentOpts.titlePosition) .html( titleStr ) .appendTo( 'body' ) .show(); switch (currentOpts.titlePosition) { case 'inside': title .css({ 'width' : final_pos.width - (currentOpts.padding * 2), 'marginLeft' : currentOpts.padding, 'marginRight' : currentOpts.padding }); titleHeight = title.outerHeight(true); title.appendTo( outer ); final_pos.height += titleHeight; break; case 'over': title .css({ 'marginLeft' : currentOpts.padding, 'width' : final_pos.width - (currentOpts.padding * 2), 'bottom' : currentOpts.padding }) .appendTo( outer ); break; case 'float': title .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1) .appendTo( wrap ); break; default: title .css({ 'width' : final_pos.width - (currentOpts.padding * 2), 'paddingLeft' : currentOpts.padding, 'paddingRight' : currentOpts.padding }) .appendTo( wrap ); break; } title.hide(); }, _set_navigation = function() { if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) { $(document).bind('keydown.fb', function(e) { if (e.keyCode == 27 && currentOpts.enableEscapeButton) { e.preventDefault(); $.fancybox.close(); } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') { e.preventDefault(); $.fancybox[ e.keyCode == 37 ? 'prev' : 'next'](); } }); } if (!currentOpts.showNavArrows) { nav_left.hide(); nav_right.hide(); return; } if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) { nav_left.show(); } if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) { nav_right.show(); } }, _finish = function () { if (!$.support.opacity) { content.get(0).style.removeAttribute('filter'); wrap.get(0).style.removeAttribute('filter'); } if (selectedOpts.autoDimensions) { content.css('height', 'auto'); } wrap.css('height', 'auto'); if (titleStr && titleStr.length) { title.show(); } if (currentOpts.showCloseButton) { close.show(); } _set_navigation(); if (currentOpts.hideOnContentClick) { content.bind('click', $.fancybox.close); } if (currentOpts.hideOnOverlayClick) { overlay.bind('click', $.fancybox.close); } $(window).bind("resize.fb", $.fancybox.resize); if (currentOpts.centerOnScroll) { $(window).bind("scroll.fb", $.fancybox.center); } if (currentOpts.type == 'iframe') { $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content); } wrap.show(); busy = false; $.fancybox.center(); currentOpts.onComplete(currentArray, currentIndex, currentOpts); _preload_images(); }, _preload_images = function() { var href, objNext; if ((currentArray.length -1) > currentIndex) { href = currentArray[ currentIndex + 1 ].href; if (typeof href !== 'undefined' && href.match(imgRegExp)) { objNext = new Image(); objNext.src = href; } } if (currentIndex > 0) { href = currentArray[ currentIndex - 1 ].href; if (typeof href !== 'undefined' && href.match(imgRegExp)) { objNext = new Image(); objNext.src = href; } } }, _draw = function(pos) { var dim = { width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10), height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10), top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10), left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10) }; if (typeof final_pos.opacity !== 'undefined') { dim.opacity = pos < 0.5 ? 0.5 : pos; } wrap.css(dim); content.css({ 'width' : dim.width - currentOpts.padding * 2, 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2 }); }, _get_viewport = function() { return [ $(window).width() - (currentOpts.margin * 2), $(window).height() - (currentOpts.margin * 2), $(document).scrollLeft() + currentOpts.margin, $(document).scrollTop() + currentOpts.margin ]; }, _get_zoom_to = function () { var view = _get_viewport(), to = {}, resize = currentOpts.autoScale, double_padding = currentOpts.padding * 2, ratio; if (currentOpts.width.toString().indexOf('%') > -1) { to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10); } else { to.width = currentOpts.width + double_padding; } if (currentOpts.height.toString().indexOf('%') > -1) { to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10); } else { to.height = currentOpts.height + double_padding; } if (resize && (to.width > view[0] || to.height > view[1])) { if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') { ratio = (currentOpts.width ) / (currentOpts.height ); if ((to.width ) > view[0]) { to.width = view[0]; to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10); } if ((to.height) > view[1]) { to.height = view[1]; to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10); } } else { to.width = Math.min(to.width, view[0]); to.height = Math.min(to.height, view[1]); } } to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10); to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10); return to; }, _get_obj_pos = function(obj) { var pos = obj.offset(); pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0; pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0; pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0; pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0; pos.width = obj.width(); pos.height = obj.height(); return pos; }, _get_zoom_from = function() { var orig = selectedOpts.orig ? $(selectedOpts.orig) : false, from = {}, pos, view; if (orig && orig.length) { pos = _get_obj_pos(orig); from = { width : pos.width + (currentOpts.padding * 2), height : pos.height + (currentOpts.padding * 2), top : pos.top - currentOpts.padding - 20, left : pos.left - currentOpts.padding - 20 }; } else { view = _get_viewport(); from = { width : currentOpts.padding * 2, height : currentOpts.padding * 2, top : parseInt(view[3] + view[1] * 0.5, 10), left : parseInt(view[2] + view[0] * 0.5, 10) }; } return from; }, _animate_loading = function() { if (!loading.is(':visible')){ clearInterval(loadingTimer); return; } $('div', loading).css('top', (loadingFrame * -40) + 'px'); loadingFrame = (loadingFrame + 1) % 12; }; /* * Public methods */ $.fn.fancybox = function(options) { if (!$(this).length) { return this; } $(this) .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {}))) .unbind('click.fb') .bind('click.fb', function(e) { e.preventDefault(); if (busy) { return; } busy = true; $(this).blur(); selectedArray = []; selectedIndex = 0; var rel = $(this).attr('rel') || ''; if (!rel || rel == '' || rel === 'nofollow') { selectedArray.push(this); } else { selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]"); selectedIndex = selectedArray.index( this ); } _start(); return; }); return this; }; $.fancybox = function(obj) { var opts; if (busy) { return; } busy = true; opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {}; selectedArray = []; selectedIndex = parseInt(opts.index, 10) || 0; if ($.isArray(obj)) { for (var i = 0, j = obj.length; i < j; i++) { if (typeof obj[i] == 'object') { $(obj[i]).data('fancybox', $.extend({}, opts, obj[i])); } else { obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts)); } } selectedArray = jQuery.merge(selectedArray, obj); } else { if (typeof obj == 'object') { $(obj).data('fancybox', $.extend({}, opts, obj)); } else { obj = $({}).data('fancybox', $.extend({content : obj}, opts)); } selectedArray.push(obj); } if (selectedIndex > selectedArray.length || selectedIndex < 0) { selectedIndex = 0; } _start(); }; $.fancybox.showActivity = function() { clearInterval(loadingTimer); loading.show(); loadingTimer = setInterval(_animate_loading, 66); }; $.fancybox.hideActivity = function() { loading.hide(); }; $.fancybox.next = function() { return $.fancybox.pos( currentIndex + 1); }; $.fancybox.prev = function() { return $.fancybox.pos( currentIndex - 1); }; $.fancybox.pos = function(pos) { if (busy) { return; } pos = parseInt(pos); selectedArray = currentArray; if (pos > -1 && pos < currentArray.length) { selectedIndex = pos; _start(); } else if (currentOpts.cyclic && currentArray.length > 1) { selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1; _start(); } return; }; $.fancybox.cancel = function() { if (busy) { return; } busy = true; $.event.trigger('fancybox-cancel'); _abort(); selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts); busy = false; }; // Note: within an iframe use - parent.$.fancybox.close(); $.fancybox.close = function() { if (busy || wrap.is(':hidden')) { return; } busy = true; if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) { busy = false; return; } _abort(); $(close.add( nav_left ).add( nav_right )).hide(); $(content.add( overlay )).unbind(); $(window).unbind("resize.fb scroll.fb"); $(document).unbind('keydown.fb'); content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank'); if (currentOpts.titlePosition !== 'inside') { title.empty(); } wrap.stop(); function _cleanup() { overlay.fadeOut('fast'); title.empty().hide(); wrap.hide(); $.event.trigger('fancybox-cleanup'); content.empty(); currentOpts.onClosed(currentArray, currentIndex, currentOpts); currentArray = selectedOpts = []; currentIndex = selectedIndex = 0; currentOpts = selectedOpts = {}; busy = false; } if (currentOpts.transitionOut == 'elastic') { start_pos = _get_zoom_from(); var pos = wrap.position(); final_pos = { top : pos.top , left : pos.left, width : wrap.width(), height : wrap.height() }; if (currentOpts.opacity) { final_pos.opacity = 1; } title.empty().hide(); fx.prop = 1; $(fx).animate({ prop: 0 }, { duration : currentOpts.speedOut, easing : currentOpts.easingOut, step : _draw, complete : _cleanup }); } else { wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup); } }; $.fancybox.resize = function() { if (overlay.is(':visible')) { overlay.css('height', $(document).height()); } $.fancybox.center(true); }; $.fancybox.center = function() { var view, align; if (busy) { return; } align = arguments[0] === true ? 1 : 0; view = _get_viewport(); if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) { return; } wrap .stop() .animate({ 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)), 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding)) }, typeof arguments[0] == 'number' ? arguments[0] : 200); }; $.fancybox.init = function() { if ($("#fancybox-wrap").length) { return; } $('body').append( tmp = $('<div id="fancybox-tmp"></div>'), loading = $('<div id="fancybox-loading"><div></div></div>'), overlay = $('<div id="fancybox-overlay"></div>'), wrap = $('<div id="fancybox-wrap"></div>') ); outer = $('<div id="fancybox-outer"></div>') .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>') .appendTo( wrap ); outer.append( content = $('<div id="fancybox-content"></div>'), close = $('<a id="fancybox-close"></a>'), title = $('<div id="fancybox-title"></div>'), nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'), nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>') ); close.click($.fancybox.close); loading.click($.fancybox.cancel); nav_left.click(function(e) { e.preventDefault(); $.fancybox.prev(); }); nav_right.click(function(e) { e.preventDefault(); $.fancybox.next(); }); if ($.fn.mousewheel) { wrap.bind('mousewheel.fb', function(e, delta) { if (busy) { e.preventDefault(); } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) { e.preventDefault(); $.fancybox[ delta > 0 ? 'prev' : 'next'](); } }); } if (!$.support.opacity) { wrap.addClass('fancybox-ie'); } if (isIE6) { loading.addClass('fancybox-ie6'); wrap.addClass('fancybox-ie6'); $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer); } }; $.fn.fancybox.defaults = { padding : 10, margin : 40, opacity : false, modal : false, cyclic : false, scrolling : 'auto', // 'auto', 'yes' or 'no' width : 560, height : 340, autoScale : true, autoDimensions : true, centerOnScroll : false, ajax : {}, swf : { wmode: 'transparent' }, hideOnOverlayClick : true, hideOnContentClick : false, overlayShow : true, overlayOpacity : 0.7, overlayColor : '#777', titleShow : true, titlePosition : 'float', // 'float', 'outside', 'inside' or 'over' titleFormat : null, titleFromAlt : false, transitionIn : 'fade', // 'elastic', 'fade' or 'none' transitionOut : 'fade', // 'elastic', 'fade' or 'none' speedIn : 300, speedOut : 300, changeSpeed : 300, changeFade : 'fast', easingIn : 'swing', easingOut : 'swing', showCloseButton : true, showNavArrows : true, enableEscapeButton : true, enableKeyboardNav : true, onStart : function(){}, onCancel : function(){}, onComplete : function(){}, onCleanup : function(){}, onClosed : function(){}, onError : function(){} }; $(document).ready(function() { $.fancybox.init(); }); })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-fancybox-1.3.4.js
jquery-fancybox-1.3.4.js
(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var ay,Q=this,Y,aj,v,al,T,Z,y,q,az,aE,au,i,I,h,j,aa,U,ap,X,t,A,aq,af,am,G,l,at,ax,x,av,aH,f,L,ai=true,P=true,aG=false,k=false,ao=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aH=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function ar(aQ){var aL,aN,aM,aJ,aI,aP,aO=false,aK=false;ay=aQ;if(Y===c){aI=D.scrollTop();aP=D.scrollLeft();D.css({overflow:"hidden",padding:0});aj=D.innerWidth()+f;v=D.innerHeight();D.width(aj);Y=b('<div class="jspPane" />').css("padding",aH).append(D.children());al=b('<div class="jspContainer" />').css({width:aj+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aO=ay.stickToBottom&&K();aK=ay.stickToRight&&B();aJ=D.innerWidth()+f!=aj||D.outerHeight()!=v;if(aJ){aj=D.innerWidth()+f;v=D.innerHeight();al.css({width:aj+"px",height:v+"px"})}if(!aJ&&L==T&&Y.outerHeight()==Z){D.width(aj);return}L=T;Y.css("width","");D.width(aj);al.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aQ.contentWidth){T=aQ.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/aj;q=Z/v;az=q>1;aE=y>1;if(!(aE||az)){D.removeClass("jspScrollable");Y.css({top:0,width:al.width()-f});n();E();R();w()}else{D.addClass("jspScrollable");aL=ay.maintainPosition&&(I||aa);if(aL){aN=aC();aM=aA()}aF();z();F();if(aL){N(aK?(T-aj):aN,false);M(aO?(Z-v):aM,false)}J();ag();an();if(ay.enableKeyboardNavigation){S()}if(ay.clickOnTrack){p()}C();if(ay.hijackInternalLinks){m()}}if(ay.autoReinitialise&&!av){av=setInterval(function(){ar(ay)},ay.autoReinitialiseDelay)}else{if(!ay.autoReinitialise&&av){clearInterval(av)}}aI&&D.scrollTop(0)&&M(aI,false);aP&&D.scrollLeft(0)&&N(aP,false);D.trigger("jsp-initialised",[aE||az])}function aF(){if(az){al.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));U=al.find(">.jspVerticalBar");ap=U.find(">.jspTrack");au=ap.find(">.jspDrag");if(ay.showArrows){aq=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aD(0,-1)).bind("click.jsp",aB);af=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aD(0,1)).bind("click.jsp",aB);if(ay.arrowScrollOnHover){aq.bind("mouseover.jsp",aD(0,-1,aq));af.bind("mouseover.jsp",aD(0,1,af))}ak(ap,ay.verticalArrowPositions,aq,af)}t=v;al.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});au.hover(function(){au.addClass("jspHover")},function(){au.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);au.addClass("jspActive");var s=aI.pageY-au.position().top;b("html").bind("mousemove.jsp",function(aJ){V(aJ.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});o()}}function o(){ap.height(t+"px");I=0;X=ay.verticalGutter+ap.outerWidth();Y.width(aj-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aE){al.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));am=al.find(">.jspHorizontalBar");G=am.find(">.jspTrack");h=G.find(">.jspDrag");if(ay.showArrows){ax=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aD(-1,0)).bind("click.jsp",aB);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aD(1,0)).bind("click.jsp",aB); if(ay.arrowScrollOnHover){ax.bind("mouseover.jsp",aD(-1,0,ax));x.bind("mouseover.jsp",aD(1,0,x))}ak(G,ay.horizontalArrowPositions,ax,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);h.addClass("jspActive");var s=aI.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aJ){W(aJ.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});l=al.innerWidth();ah()}}function ah(){al.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aE&&az){var aI=G.outerHeight(),s=ap.outerWidth();t-=aI;b(am).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;aj-=aI;G.parent().append(b('<div class="jspCorner" />').css("width",aI+"px"));o();ah()}if(aE){Y.width((al.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aE){at=Math.ceil(1/y*l);if(at>ay.horizontalDragMaxWidth){at=ay.horizontalDragMaxWidth}else{if(at<ay.horizontalDragMinWidth){at=ay.horizontalDragMinWidth}}h.width(at+"px");j=l-at;ae(aa)}if(az){A=Math.ceil(1/q*t);if(A>ay.verticalDragMaxHeight){A=ay.verticalDragMaxHeight}else{if(A<ay.verticalDragMinHeight){A=ay.verticalDragMinHeight}}au.height(A+"px");i=t-A;ad(I)}}function ak(aJ,aL,aI,s){var aN="before",aK="after",aM;if(aL=="os"){aL=/Mac/.test(navigator.platform)?"after":"split"}if(aL==aN){aK=aL}else{if(aL==aK){aN=aL;aM=aI;aI=s;s=aM}}aJ[aN](aI)[aK](s)}function aD(aI,s,aJ){return function(){H(aI,s,this,aJ);this.blur();return false}}function H(aL,aK,aO,aN){aO=b(aO).addClass("jspActive");var aM,aJ,aI=true,s=function(){if(aL!==0){Q.scrollByX(aL*ay.arrowButtonSpeed)}if(aK!==0){Q.scrollByY(aK*ay.arrowButtonSpeed)}aJ=setTimeout(s,aI?ay.initialDelay:ay.arrowRepeatFreq);aI=false};s();aM=aN?"mouseout.jsp":"mouseup.jsp";aN=aN||b("html");aN.bind(aM,function(){aO.removeClass("jspActive");aJ&&clearTimeout(aJ);aJ=null;aN.unbind(aM)})}function p(){w();if(az){ap.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageY-aO.top-I,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageY-aR.top-A/2,aP=v*ay.scrollPagePercent,aQ=i*aP/(Z-v);if(aM<0){if(I-aQ>aS){Q.scrollByY(-aP)}else{V(aS)}}else{if(aM>0){if(I+aQ<aS){Q.scrollByY(aP)}else{V(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}if(aE){G.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageX-aO.left-aa,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageX-aR.left-at/2,aP=aj*ay.scrollPagePercent,aQ=j*aP/(T-aj);if(aM<0){if(aa-aQ>aS){Q.scrollByX(-aP)}else{W(aS)}}else{if(aM>0){if(aa+aQ<aS){Q.scrollByX(aP)}else{W(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}}function w(){if(G){G.unbind("mousedown.jsp")}if(ap){ap.unbind("mousedown.jsp")}}function aw(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(au){au.removeClass("jspActive")}if(h){h.removeClass("jspActive")}}function V(s,aI){if(!az){return}if(s<0){s=0}else{if(s>i){s=i}}if(aI===c){aI=ay.animateScroll}if(aI){Q.animate(au,"top",s,ad)}else{au.css("top",s);ad(s)}}function ad(aI){if(aI===c){aI=au.position().top}al.scrollTop(0);I=aI;var aL=I===0,aJ=I==i,aK=aI/i,s=-aK*(Z-v);if(ai!=aL||aG!=aJ){ai=aL;aG=aJ;D.trigger("jsp-arrow-change",[ai,aG,P,k])}u(aL,aJ);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aL,aJ]).trigger("scroll")}function W(aI,s){if(!aE){return}if(aI<0){aI=0}else{if(aI>j){aI=j}}if(s===c){s=ay.animateScroll}if(s){Q.animate(h,"left",aI,ae) }else{h.css("left",aI);ae(aI)}}function ae(aI){if(aI===c){aI=h.position().left}al.scrollTop(0);aa=aI;var aL=aa===0,aK=aa==j,aJ=aI/j,s=-aJ*(T-aj);if(P!=aL||k!=aK){P=aL;k=aK;D.trigger("jsp-arrow-change",[ai,aG,P,k])}r(aL,aK);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aL,aK]).trigger("scroll")}function u(aI,s){if(ay.showArrows){aq[aI?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aI,s){if(ay.showArrows){ax[aI?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aI){var aJ=s/(Z-v);V(aJ*i,aI)}function N(aI,s){var aJ=aI/(T-aj);W(aJ*j,s)}function ab(aV,aQ,aJ){var aN,aK,aL,s=0,aU=0,aI,aP,aO,aS,aR,aT;try{aN=b(aV)}catch(aM){return}aK=aN.outerHeight();aL=aN.outerWidth();al.scrollTop(0);al.scrollLeft(0);while(!aN.is(".jspPane")){s+=aN.position().top;aU+=aN.position().left;aN=aN.offsetParent();if(/^body|html$/i.test(aN[0].nodeName)){return}}aI=aA();aO=aI+v;if(s<aI||aQ){aR=s-ay.verticalGutter}else{if(s+aK>aO){aR=s-v+aK+ay.verticalGutter}}if(aR){M(aR,aJ)}aP=aC();aS=aP+aj;if(aU<aP||aQ){aT=aU-ay.horizontalGutter}else{if(aU+aL>aS){aT=aU-aj+aL+ay.horizontalGutter}}if(aT){N(aT,aJ)}}function aC(){return -Y.position().left}function aA(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aA()<10)}function B(){var s=T-aj;return(s>20)&&(s-aC()<10)}function ag(){al.unbind(ac).bind(ac,function(aL,aM,aK,aI){var aJ=aa,s=I;Q.scrollBy(aK*ay.mouseWheelSpeed,-aI*ay.mouseWheelSpeed,false);return aJ==aa&&s==I})}function n(){al.unbind(ac)}function aB(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aI,aK=[];aE&&aK.push(am[0]);az&&aK.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aN){if(aN.target!==this&&!(aK.length&&b(aN.target).closest(aK).length)){return}var aM=aa,aL=I;switch(aN.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aN.keyCode;aJ();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aI=aN.keyCode==s&&aM!=aa||aL!=I;return !aI}).bind("keypress.jsp",function(aL){if(aL.keyCode==s){aJ()}return !aI});if(ay.hideFocus){D.css("outline","none");if("hideFocus" in al[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in al[0]){D.attr("hideFocus",false)}}function aJ(){var aM=aa,aL=I;switch(s){case 40:Q.scrollByY(ay.keyboardSpeed,false);break;case 38:Q.scrollByY(-ay.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*ay.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*ay.scrollPagePercent,false);break;case 39:Q.scrollByX(ay.keyboardSpeed,false);break;case 37:Q.scrollByX(-ay.keyboardSpeed,false);break}aI=aM!=aa||aL!=I;return aI}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aK,aI,aJ=escape(location.hash.substr(1));try{aK=b("#"+aJ+', a[name="'+aJ+'"]')}catch(s){return}if(aK.length&&Y.find(aJ)){if(al.scrollTop()===0){aI=setInterval(function(){if(al.scrollTop()>0){ab(aK,true);b(document).scrollTop(al.position().top);clearInterval(aI)}},50)}else{ab(aK,true);b(document).scrollTop(al.position().top)}}}}function m(){if(b(document.body).data("jspHijack")){return}b(document.body).data("jspHijack",true);b(document.body).delegate("a[href*=#]","click",function(s){var aI=this.href.substr(0,this.href.indexOf("#")),aK=location.href,aO,aP,aJ,aM,aL,aN;if(location.href.indexOf("#")!==-1){aK=location.href.substr(0,location.href.indexOf("#"))}if(aI!==aK){return}aO=escape(this.href.substr(this.href.indexOf("#")+1));aP;try{aP=b("#"+aO+', a[name="'+aO+'"]')}catch(aQ){return}if(!aP.length){return}aJ=aP.closest(".jspScrollable");aM=aJ.data("jsp");aM.scrollToElement(aP,true);if(aJ[0].scrollIntoView){aL=b(a).scrollTop();aN=aP.offset().top;if(aN<aL||aN>aL+b(a).height()){aJ[0].scrollIntoView()}}s.preventDefault() })}function an(){var aJ,aI,aL,aK,aM,s=false;al.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aN){var aO=aN.originalEvent.touches[0];aJ=aC();aI=aA();aL=aO.pageX;aK=aO.pageY;aM=false;s=true}).bind("touchmove.jsp",function(aQ){if(!s){return}var aP=aQ.originalEvent.touches[0],aO=aa,aN=I;Q.scrollTo(aJ+aL-aP.pageX,aI+aK-aP.pageY);aM=aM||Math.abs(aL-aP.pageX)>5||Math.abs(aK-aP.pageY)>5;return aO==aa&&aN==I}).bind("touchend.jsp",function(aN){s=false}).bind("click.jsp-touchclick",function(aN){if(aM){aM=false;return false}})}function g(){var s=aA(),aI=aC();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ao.append(Y.children()));ao.scrollTop(s);ao.scrollLeft(aI);if(av){clearInterval(av)}}b.extend(Q,{reinitialise:function(aI){aI=b.extend({},ay,aI);ar(aI)},scrollToElement:function(aJ,aI,s){ab(aJ,aI,s)},scrollTo:function(aJ,s,aI){N(aJ,aI);M(s,aI)},scrollToX:function(aI,s){N(aI,s)},scrollToY:function(s,aI){M(s,aI)},scrollToPercentX:function(aI,s){N(aI*(T-aj),s)},scrollToPercentY:function(aI,s){M(aI*(Z-v),s)},scrollBy:function(aI,s,aJ){Q.scrollByX(aI,aJ);Q.scrollByY(s,aJ)},scrollByX:function(s,aJ){var aI=aC()+Math[s<0?"floor":"ceil"](s),aK=aI/(T-aj);W(aK*j,aJ)},scrollByY:function(s,aJ){var aI=aA()+Math[s<0?"floor":"ceil"](s),aK=aI/(Z-v);V(aK*i,aJ)},positionDragX:function(s,aI){W(s,aI)},positionDragY:function(aI,s){V(aI,s)},animate:function(aI,aL,s,aK){var aJ={};aJ[aL]=s;aI.animate(aJ,{duration:ay.animateDuration,easing:ay.animateEase,queue:false,step:aK})},getContentPositionX:function(){return aC()},getContentPositionY:function(){return aA()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aC()/(T-aj)},getPercentScrolledY:function(){return aA()/(Z-v)},getIsScrollableH:function(){return aE},getIsScrollableV:function(){return az},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:b.noop,destroy:function(){g()}});ar(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{b("script",f).filter('[type="text/javascript"],:not([type])').remove();g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-jscrollpane.min.js
jquery-jscrollpane.min.js
;(function($) { "use strict"; /* Usage Note: ----------- Do not use both ajaxSubmit and ajaxForm on the same form. These functions are mutually exclusive. Use ajaxSubmit if you want to bind your own submit handler to the form. For example, $(document).ready(function() { $('#myForm').on('submit', function(e) { e.preventDefault(); // <-- important $(this).ajaxSubmit({ target: '#output' }); }); }); Use ajaxForm when you want the plugin to manage all the event binding for you. For example, $(document).ready(function() { $('#myForm').ajaxForm({ target: '#output' }); }); You can also use ajaxForm with delegation (requires jQuery v1.7+), so the form does not have to exist when you invoke ajaxForm: $('#myForm').ajaxForm({ delegation: true, target: '#output' }); When using ajaxForm, the ajaxSubmit function will be invoked for you at the appropriate time. */ /** * Feature detection */ var feature = {}; feature.fileapi = $("<input type='file'/>").get(0).files !== undefined; feature.formdata = window.FormData !== undefined; /** * ajaxSubmit() provides a mechanism for immediately submitting * an HTML form using AJAX. */ $.fn.ajaxSubmit = function(options) { /*jshint scripturl:true */ // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) if (!this.length) { log('ajaxSubmit: skipping submit process - no element selected'); return this; } var method, action, url, $form = this; if (typeof options == 'function') { options = { success: options }; } method = this.attr('method'); action = this.attr('action'); url = (typeof action === 'string') ? $.trim(action) : ''; url = url || window.location.href || ''; if (url) { // clean url (don't include hash vaue) url = (url.match(/^([^#]+)/)||[])[1]; } options = $.extend(true, { url: url, success: $.ajaxSettings.success, type: method || 'GET', iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' }, options); // hook for manipulating the form data before it is extracted; // convenient for use with rich editors like tinyMCE or FCKEditor var veto = {}; this.trigger('form-pre-serialize', [this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); return this; } // provide opportunity to alter form data before it is serialized if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { log('ajaxSubmit: submit aborted via beforeSerialize callback'); return this; } var traditional = options.traditional; if ( traditional === undefined ) { traditional = $.ajaxSettings.traditional; } var elements = []; var qx, a = this.formToArray(options.semantic, elements); if (options.data) { options.extraData = options.data; qx = $.param(options.data, traditional); } // give pre-submit callback an opportunity to abort the submit if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { log('ajaxSubmit: submit aborted via beforeSubmit callback'); return this; } // fire vetoable 'validate' event this.trigger('form-submit-validate', [a, this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); return this; } var q = $.param(a, traditional); if (qx) { q = ( q ? (q + '&' + qx) : qx ); } if (options.type.toUpperCase() == 'GET') { options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; options.data = null; // data is null for 'get' } else { options.data = q; // data is the query string for 'post' } var callbacks = []; if (options.resetForm) { callbacks.push(function() { $form.resetForm(); }); } if (options.clearForm) { callbacks.push(function() { $form.clearForm(options.includeHidden); }); } // perform a load on the target only if dataType is not provided if (!options.dataType && options.target) { var oldSuccess = options.success || function(){}; callbacks.push(function(data) { var fn = options.replaceTarget ? 'replaceWith' : 'html'; $(options.target)[fn](data).each(oldSuccess, arguments); }); } else if (options.success) { callbacks.push(options.success); } options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg var context = options.context || this ; // jQuery 1.4+ supports scope context for (var i=0, max=callbacks.length; i < max; i++) { callbacks[i].apply(context, [data, status, xhr || $form, $form]); } }; // are there files to upload? // [value] (issue #113), also see comment: // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219 var fileInputs = $('input[type=file]:enabled[value!=""]', this); var hasFileInputs = fileInputs.length > 0; var mp = 'multipart/form-data'; var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); var fileAPI = feature.fileapi && feature.formdata; log("fileAPI :" + fileAPI); var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; var jqxhr; // options.iframe allows user to force iframe mode // 06-NOV-09: now defaulting to iframe mode if file input is detected if (options.iframe !== false && (options.iframe || shouldUseFrame)) { // hack to fix Safari hang (thanks to Tim Molendijk for this) // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d if (options.closeKeepAlive) { $.get(options.closeKeepAlive, function() { jqxhr = fileUploadIframe(a); }); } else { jqxhr = fileUploadIframe(a); } } else if ((hasFileInputs || multipart) && fileAPI) { jqxhr = fileUploadXhr(a); } else { jqxhr = $.ajax(options); } $form.removeData('jqxhr').data('jqxhr', jqxhr); // clear element array for (var k=0; k < elements.length; k++) elements[k] = null; // fire 'notify' event this.trigger('form-submit-notify', [this, options]); return this; // utility fn for deep serialization function deepSerialize(extraData){ var serialized = $.param(extraData).split('&'); var len = serialized.length; var result = []; var i, part; for (i=0; i < len; i++) { // #252; undo param space replacement serialized[i] = serialized[i].replace(/\+/g,' '); part = serialized[i].split('='); // #278; use array instead of object storage, favoring array serializations result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]); } return result; } // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) function fileUploadXhr(a) { var formdata = new FormData(); for (var i=0; i < a.length; i++) { formdata.append(a[i].name, a[i].value); } if (options.extraData) { var serializedData = deepSerialize(options.extraData); for (i=0; i < serializedData.length; i++) if (serializedData[i]) formdata.append(serializedData[i][0], serializedData[i][1]); } options.data = null; var s = $.extend(true, {}, $.ajaxSettings, options, { contentType: false, processData: false, cache: false, type: method || 'POST' }); if (options.uploadProgress) { // workaround because jqXHR does not expose upload property s.xhr = function() { var xhr = jQuery.ajaxSettings.xhr(); if (xhr.upload) { xhr.upload.addEventListener('progress', function(event) { var percent = 0; var position = event.loaded || event.position; /*event.position is deprecated*/ var total = event.total; if (event.lengthComputable) { percent = Math.ceil(position / total * 100); } options.uploadProgress(event, position, total, percent); }, false); } return xhr; }; } s.data = null; var beforeSend = s.beforeSend; s.beforeSend = function(xhr, o) { o.data = formdata; if(beforeSend) beforeSend.call(this, xhr, o); }; return $.ajax(s); } // private function for handling file uploads (hat tip to YAHOO!) function fileUploadIframe(a) { var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; var useProp = !!$.fn.prop; var deferred = $.Deferred(); if (a) { // ensure that every serialized input is still enabled for (i=0; i < elements.length; i++) { el = $(elements[i]); if ( useProp ) el.prop('disabled', false); else el.removeAttr('disabled'); } } s = $.extend(true, {}, $.ajaxSettings, options); s.context = s.context || s; id = 'jqFormIO' + (new Date().getTime()); if (s.iframeTarget) { $io = $(s.iframeTarget); n = $io.attr('name'); if (!n) $io.attr('name', id); else id = n; } else { $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />'); $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); } io = $io[0]; xhr = { // mock object aborted: 0, responseText: null, responseXML: null, status: 0, statusText: 'n/a', getAllResponseHeaders: function() {}, getResponseHeader: function() {}, setRequestHeader: function() {}, abort: function(status) { var e = (status === 'timeout' ? 'timeout' : 'aborted'); log('aborting upload... ' + e); this.aborted = 1; try { // #214, #257 if (io.contentWindow.document.execCommand) { io.contentWindow.document.execCommand('Stop'); } } catch(ignore) {} $io.attr('src', s.iframeSrc); // abort op in progress xhr.error = e; if (s.error) s.error.call(s.context, xhr, e, status); if (g) $.event.trigger("ajaxError", [xhr, s, e]); if (s.complete) s.complete.call(s.context, xhr, e); } }; g = s.global; // trigger ajax global events so that activity/block indicators work like normal if (g && 0 === $.active++) { $.event.trigger("ajaxStart"); } if (g) { $.event.trigger("ajaxSend", [xhr, s]); } if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) { if (s.global) { $.active--; } deferred.reject(); return deferred; } if (xhr.aborted) { deferred.reject(); return deferred; } // add submitting element to data if we know it sub = form.clk; if (sub) { n = sub.name; if (n && !sub.disabled) { s.extraData = s.extraData || {}; s.extraData[n] = sub.value; if (sub.type == "image") { s.extraData[n+'.x'] = form.clk_x; s.extraData[n+'.y'] = form.clk_y; } } } var CLIENT_TIMEOUT_ABORT = 1; var SERVER_ABORT = 2; function getDoc(frame) { var doc = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument ? frame.contentDocument : frame.document; return doc; } // Rails CSRF hack (thanks to Yvan Barthelemy) var csrf_token = $('meta[name=csrf-token]').attr('content'); var csrf_param = $('meta[name=csrf-param]').attr('content'); if (csrf_param && csrf_token) { s.extraData = s.extraData || {}; s.extraData[csrf_param] = csrf_token; } // take a breath so that pending repaints get some cpu time before the upload starts function doSubmit() { // make sure form attrs are set var t = $form.attr('target'), a = $form.attr('action'); // update form attrs in IE friendly way form.setAttribute('target',id); if (!method) { form.setAttribute('method', 'POST'); } if (a != s.url) { form.setAttribute('action', s.url); } // ie borks in some cases when setting encoding if (! s.skipEncodingOverride && (!method || /post/i.test(method))) { $form.attr({ encoding: 'multipart/form-data', enctype: 'multipart/form-data' }); } // support timout if (s.timeout) { timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout); } // look for server aborts function checkState() { try { var state = getDoc(io).readyState; log('state = ' + state); if (state && state.toLowerCase() == 'uninitialized') setTimeout(checkState,50); } catch(e) { log('Server abort: ' , e, ' (', e.name, ')'); cb(SERVER_ABORT); if (timeoutHandle) clearTimeout(timeoutHandle); timeoutHandle = undefined; } } // add "extra" data to form if provided in options var extraInputs = []; try { if (s.extraData) { for (var n in s.extraData) { if (s.extraData.hasOwnProperty(n)) { // if using the $.param format that allows for multiple values with the same name if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) { extraInputs.push( $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value) .appendTo(form)[0]); } else { extraInputs.push( $('<input type="hidden" name="'+n+'">').val(s.extraData[n]) .appendTo(form)[0]); } } } } if (!s.iframeTarget) { // add iframe to doc and submit the form $io.appendTo('body'); if (io.attachEvent) io.attachEvent('onload', cb); else io.addEventListener('load', cb, false); } setTimeout(checkState,15); // just in case form has element with name/id of 'submit' var submitFn = document.createElement('form').submit; submitFn.apply(form); } finally { // reset attrs and remove "extra" input elements form.setAttribute('action',a); if(t) { form.setAttribute('target', t); } else { $form.removeAttr('target'); } $(extraInputs).remove(); } } if (s.forceSync) { doSubmit(); } else { setTimeout(doSubmit, 10); // this lets dom updates render } var data, doc, domCheckCount = 50, callbackProcessed; function cb(e) { if (xhr.aborted || callbackProcessed) { return; } try { doc = getDoc(io); } catch(ex) { log('cannot access response document: ', ex); e = SERVER_ABORT; } if (e === CLIENT_TIMEOUT_ABORT && xhr) { xhr.abort('timeout'); deferred.reject(xhr, 'timeout'); return; } else if (e == SERVER_ABORT && xhr) { xhr.abort('server abort'); deferred.reject(xhr, 'error', 'server abort'); return; } if (!doc || doc.location.href == s.iframeSrc) { // response not received yet if (!timedOut) return; } if (io.detachEvent) io.detachEvent('onload', cb); else io.removeEventListener('load', cb, false); var status = 'success', errMsg; try { if (timedOut) { throw 'timeout'; } var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc); log('isXml='+isXml); if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) { if (--domCheckCount) { // in some browsers (Opera) the iframe DOM is not always traversable when // the onload callback fires, so we loop a bit to accommodate log('requeing onLoad callback, DOM not available'); setTimeout(cb, 250); return; } // let this fall through because server response could be an empty document //log('Could not access iframe DOM after mutiple tries.'); //throw 'DOMException: not available'; } //log('response detected'); var docRoot = doc.body ? doc.body : doc.documentElement; xhr.responseText = docRoot ? docRoot.innerHTML : null; xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; if (isXml) s.dataType = 'xml'; xhr.getResponseHeader = function(header){ var headers = {'content-type': s.dataType}; return headers[header]; }; // support for XHR 'status' & 'statusText' emulation : if (docRoot) { xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status; xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText; } var dt = (s.dataType || '').toLowerCase(); var scr = /(json|script|text)/.test(dt); if (scr || s.textarea) { // see if user embedded response in textarea var ta = doc.getElementsByTagName('textarea')[0]; if (ta) { xhr.responseText = ta.value; // support for XHR 'status' & 'statusText' emulation : xhr.status = Number( ta.getAttribute('status') ) || xhr.status; xhr.statusText = ta.getAttribute('statusText') || xhr.statusText; } else if (scr) { // account for browsers injecting pre around json response var pre = doc.getElementsByTagName('pre')[0]; var b = doc.getElementsByTagName('body')[0]; if (pre) { xhr.responseText = pre.textContent ? pre.textContent : pre.innerText; } else if (b) { xhr.responseText = b.textContent ? b.textContent : b.innerText; } } } else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) { xhr.responseXML = toXml(xhr.responseText); } try { data = httpData(xhr, dt, s); } catch (e) { status = 'parsererror'; xhr.error = errMsg = (e || status); } } catch (e) { log('error caught: ',e); status = 'error'; xhr.error = errMsg = (e || status); } if (xhr.aborted) { log('upload aborted'); status = null; } if (xhr.status) { // we've set xhr.status status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error'; } // ordering of these callbacks/triggers is odd, but that's how $.ajax does it if (status === 'success') { if (s.success) s.success.call(s.context, data, 'success', xhr); deferred.resolve(xhr.responseText, 'success', xhr); if (g) $.event.trigger("ajaxSuccess", [xhr, s]); } else if (status) { if (errMsg === undefined) errMsg = xhr.statusText; if (s.error) s.error.call(s.context, xhr, status, errMsg); deferred.reject(xhr, 'error', errMsg); if (g) $.event.trigger("ajaxError", [xhr, s, errMsg]); } if (g) $.event.trigger("ajaxComplete", [xhr, s]); if (g && ! --$.active) { $.event.trigger("ajaxStop"); } if (s.complete) s.complete.call(s.context, xhr, status); callbackProcessed = true; if (s.timeout) clearTimeout(timeoutHandle); // clean up setTimeout(function() { if (!s.iframeTarget) $io.remove(); xhr.responseXML = null; }, 100); } var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+) if (window.ActiveXObject) { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = 'false'; doc.loadXML(s); } else { doc = (new DOMParser()).parseFromString(s, 'text/xml'); } return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null; }; var parseJSON = $.parseJSON || function(s) { /*jslint evil:true */ return window['eval']('(' + s + ')'); }; var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4 var ct = xhr.getResponseHeader('content-type') || '', xml = type === 'xml' || !type && ct.indexOf('xml') >= 0, data = xml ? xhr.responseXML : xhr.responseText; if (xml && data.documentElement.nodeName === 'parsererror') { if ($.error) $.error('parsererror'); } if (s && s.dataFilter) { data = s.dataFilter(data, type); } if (typeof data === 'string') { if (type === 'json' || !type && ct.indexOf('json') >= 0) { data = parseJSON(data); } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) { $.globalEval(data); } } return data; }; return deferred; } }; /** * ajaxForm() provides a mechanism for fully automating form submission. * * The advantages of using this method instead of ajaxSubmit() are: * * 1: This method will include coordinates for <input type="image" /> elements (if the element * is used to submit the form). * 2. This method will include the submit element's name/value data (for the element that was * used to submit the form). * 3. This method binds the submit() method to the form for you. * * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely * passes the options argument along after properly binding events for submit elements and * the form itself. */ $.fn.ajaxForm = function(options) { options = options || {}; options.delegation = options.delegation && $.isFunction($.fn.on); // in jQuery 1.3+ we can fix mistakes with the ready state if (!options.delegation && this.length === 0) { var o = { s: this.selector, c: this.context }; if (!$.isReady && o.s) { log('DOM not ready, queuing ajaxForm'); $(function() { $(o.s,o.c).ajaxForm(options); }); return this; } // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); return this; } if ( options.delegation ) { $(document) .off('submit.form-plugin', this.selector, doAjaxSubmit) .off('click.form-plugin', this.selector, captureSubmittingElement) .on('submit.form-plugin', this.selector, options, doAjaxSubmit) .on('click.form-plugin', this.selector, options, captureSubmittingElement); return this; } return this.ajaxFormUnbind() .bind('submit.form-plugin', options, doAjaxSubmit) .bind('click.form-plugin', options, captureSubmittingElement); }; // private event handlers function doAjaxSubmit(e) { /*jshint validthis:true */ var options = e.data; if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed e.preventDefault(); $(this).ajaxSubmit(options); } } function captureSubmittingElement(e) { /*jshint validthis:true */ var target = e.target; var $el = $(target); if (!($el.is("[type=submit],[type=image]"))) { // is this a child element of the submit el? (ex: a span within a button) var t = $el.closest('[type=submit]'); if (t.length === 0) { return; } target = t[0]; } var form = this; form.clk = target; if (target.type == 'image') { if (e.offsetX !== undefined) { form.clk_x = e.offsetX; form.clk_y = e.offsetY; } else if (typeof $.fn.offset == 'function') { var offset = $el.offset(); form.clk_x = e.pageX - offset.left; form.clk_y = e.pageY - offset.top; } else { form.clk_x = e.pageX - target.offsetLeft; form.clk_y = e.pageY - target.offsetTop; } } // clear form vars setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100); } // ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm $.fn.ajaxFormUnbind = function() { return this.unbind('submit.form-plugin click.form-plugin'); }; /** * formToArray() gathers form element data into an array of objects that can * be passed to any of the following ajax functions: $.get, $.post, or load. * Each object in the array has both a 'name' and 'value' property. An example of * an array for a simple login form might be: * * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] * * It is this array that is passed to pre-submit callback functions provided to the * ajaxSubmit() and ajaxForm() methods. */ $.fn.formToArray = function(semantic, elements) { var a = []; if (this.length === 0) { return a; } var form = this[0]; var els = semantic ? form.getElementsByTagName('*') : form.elements; if (!els) { return a; } var i,j,n,v,el,max,jmax; for(i=0, max=els.length; i < max; i++) { el = els[i]; n = el.name; if (!n) { continue; } if (semantic && form.clk && el.type == "image") { // handle image inputs on the fly when semantic == true if(!el.disabled && form.clk == el) { a.push({name: n, value: $(el).val(), type: el.type }); a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); } continue; } v = $.fieldValue(el, true); if (v && v.constructor == Array) { if (elements) elements.push(el); for(j=0, jmax=v.length; j < jmax; j++) { a.push({name: n, value: v[j]}); } } else if (feature.fileapi && el.type == 'file' && !el.disabled) { if (elements) elements.push(el); var files = el.files; if (files.length) { for (j=0; j < files.length; j++) { a.push({name: n, value: files[j], type: el.type}); } } else { // #180 a.push({ name: n, value: '', type: el.type }); } } else if (v !== null && typeof v != 'undefined') { if (elements) elements.push(el); a.push({name: n, value: v, type: el.type, required: el.required}); } } if (!semantic && form.clk) { // input type=='image' are not found in elements array! handle it here var $input = $(form.clk), input = $input[0]; n = input.name; if (n && !input.disabled && input.type == 'image') { a.push({name: n, value: $input.val()}); a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); } } return a; }; /** * Serializes form data into a 'submittable' string. This method will return a string * in the format: name1=value1&amp;name2=value2 */ $.fn.formSerialize = function(semantic) { //hand off to jQuery.param for proper encoding return $.param(this.formToArray(semantic)); }; /** * Serializes all field elements in the jQuery object into a query string. * This method will return a string in the format: name1=value1&amp;name2=value2 */ $.fn.fieldSerialize = function(successful) { var a = []; this.each(function() { var n = this.name; if (!n) { return; } var v = $.fieldValue(this, successful); if (v && v.constructor == Array) { for (var i=0,max=v.length; i < max; i++) { a.push({name: n, value: v[i]}); } } else if (v !== null && typeof v != 'undefined') { a.push({name: this.name, value: v}); } }); //hand off to jQuery.param for proper encoding return $.param(a); }; /** * Returns the value(s) of the element in the matched set. For example, consider the following form: * * <form><fieldset> * <input name="A" type="text" /> * <input name="A" type="text" /> * <input name="B" type="checkbox" value="B1" /> * <input name="B" type="checkbox" value="B2"/> * <input name="C" type="radio" value="C1" /> * <input name="C" type="radio" value="C2" /> * </fieldset></form> * * var v = $('input[type=text]').fieldValue(); * // if no values are entered into the text inputs * v == ['',''] * // if values entered into the text inputs are 'foo' and 'bar' * v == ['foo','bar'] * * var v = $('input[type=checkbox]').fieldValue(); * // if neither checkbox is checked * v === undefined * // if both checkboxes are checked * v == ['B1', 'B2'] * * var v = $('input[type=radio]').fieldValue(); * // if neither radio is checked * v === undefined * // if first radio is checked * v == ['C1'] * * The successful argument controls whether or not the field element must be 'successful' * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). * The default value of the successful argument is true. If this value is false the value(s) * for each element is returned. * * Note: This method *always* returns an array. If no valid value can be determined the * array will be empty, otherwise it will contain one or more values. */ $.fn.fieldValue = function(successful) { for (var val=[], i=0, max=this.length; i < max; i++) { var el = this[i]; var v = $.fieldValue(el, successful); if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) { continue; } if (v.constructor == Array) $.merge(val, v); else val.push(v); } return val; }; /** * Returns the value of the field element. */ $.fieldValue = function(el, successful) { var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); if (successful === undefined) { successful = true; } if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || (t == 'checkbox' || t == 'radio') && !el.checked || (t == 'submit' || t == 'image') && el.form && el.form.clk != el || tag == 'select' && el.selectedIndex == -1)) { return null; } if (tag == 'select') { var index = el.selectedIndex; if (index < 0) { return null; } var a = [], ops = el.options; var one = (t == 'select-one'); var max = (one ? index+1 : ops.length); for(var i=(one ? index : 0); i < max; i++) { var op = ops[i]; if (op.selected) { var v = op.value; if (!v) { // extra pain for IE... v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; } if (one) { return v; } a.push(v); } } return a; } return $(el).val(); }; /** * Clears the form data. Takes the following actions on the form's input fields: * - input text fields will have their 'value' property set to the empty string * - select elements will have their 'selectedIndex' property set to -1 * - checkbox and radio inputs will have their 'checked' property set to false * - inputs of type submit, button, reset, and hidden will *not* be effected * - button elements will *not* be effected */ $.fn.clearForm = function(includeHidden) { return this.each(function() { $('input,select,textarea', this).clearFields(includeHidden); }); }; /** * Clears the selected form elements. */ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) { var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list return this.each(function() { var t = this.type, tag = this.tagName.toLowerCase(); if (re.test(t) || tag == 'textarea') { this.value = ''; } else if (t == 'checkbox' || t == 'radio') { this.checked = false; } else if (tag == 'select') { this.selectedIndex = -1; } else if (t == "file") { if (/MSIE/.test(navigator.userAgent)) { $(this).replaceWith($(this).clone()); } else { $(this).val(''); } } else if (includeHidden) { // includeHidden can be the value true, or it can be a selector string // indicating a special test; for example: // $('#myForm').clearForm('.special:hidden') // the above would clean hidden inputs that have the class of 'special' if ( (includeHidden === true && /hidden/.test(t)) || (typeof includeHidden == 'string' && $(this).is(includeHidden)) ) this.value = ''; } }); }; /** * Resets the form data. Causes all form elements to be reset to their original value. */ $.fn.resetForm = function() { return this.each(function() { // guard against an input with the name of 'reset' // note that IE reports the reset function as an 'object' if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) { this.reset(); } }); }; /** * Enables or disables any matching elements. */ $.fn.enable = function(b) { if (b === undefined) { b = true; } return this.each(function() { this.disabled = !b; }); }; /** * Checks/unchecks any matching checkboxes or radio buttons and * selects/deselects and matching option elements. */ $.fn.selected = function(select) { if (select === undefined) { select = true; } return this.each(function() { var t = this.type; if (t == 'checkbox' || t == 'radio') { this.checked = select; } else if (this.tagName.toLowerCase() == 'option') { var $sel = $(this).parent('select'); if (select && $sel[0] && $sel[0].type == 'select-one') { // deselect all other options $sel.find('option').selected(false); } this.selected = select; } }); }; // expose debug var $.fn.ajaxSubmit.debug = false; // helper fn for console logging function log() { if (!$.fn.ajaxSubmit.debug) return; var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,''); if (window.console && window.console.log) { window.console.log(msg); } else if (window.opera && window.opera.postError) { window.opera.postError(msg); } } })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-form-3.27.js
jquery-form-3.27.js
(function(a){a.extend({progressBar:new function(){this.defaults={steps:20,step_duration:20,max:100,showText:true,textFormat:"percentage",width:120,height:12,callback:null,boxImage:"/--static--/ztfy.jqueryui/img/progressbar.gif",barImage:{0:"/--static--/ztfy.jqueryui/img/progressbg_red.gif",30:"/--static--/ztfy.jqueryui/img/progressbg_orange.gif",70:"/--static--/ztfy.jqueryui/img/progressbg_green.gif"},running_value:0,value:0,image:null};this.construct=function(c,b){var d=null;var e=null;if(c!=null){if(!isNaN(c)){d=c;if(b!=null){e=b}}else{e=c}}return this.each(function(f){var n=this;var h=this.config;if(d!=null&&this.bar!=null&&this.config!=null){this.config.value=d;if(e!=null){n.config=a.extend(this.config,e)}h=n.config}else{var l=a(this);var h=a.extend({},a.progressBar.defaults,e);h.id=l.attr("id")?l.attr("id"):Math.ceil(Math.random()*100000);if(d==null){d=l.html().replace("%","")}h.value=d;h.running_value=0;h.image=k(h);l.html("");var j=document.createElement("img");var p=document.createElement("span");var g=a(j);var m=a(p);n.bar=g;g.attr("id",h.id+"_pbImage");m.attr("id",h.id+"_pbText");m.html(o(h));g.attr("title",o(h));g.attr("alt",o(h));g.attr("src",h.boxImage);g.attr("width",h.width);g.css("width",h.width+"px");g.css("height",h.height+"px");g.css("background-image","url("+h.image+")");g.css("background-position",((h.width*-1))+"px 50%");g.css("padding","0");g.css("margin","0");l.append(g);l.append(m)}function i(r){return r.running_value*100/r.max}function k(r){var t=r.barImage;if(typeof(r.barImage)=="object"){for(var s in r.barImage){if(i(r)>=parseInt(s)){t=r.barImage[s]}else{break}}}return t}function o(r){if(r.showText){if(r.textFormat=="percentage"){return" "+Math.round(r.running_value)+"%"}else{if(r.textFormat=="fraction"){return" "+r.running_value+"/"+r.max}}}}h.increment=Math.round((h.value-h.running_value)/h.steps);if(h.increment<0){h.increment*=-1}if(h.increment<1){h.increment=1}var q=setInterval(function(){var v=h.width/100;var r=false;if(h.running_value>h.value){if(h.running_value-h.increment<h.value){h.running_value=h.value}else{h.running_value-=h.increment}}else{if(h.running_value<h.value){if(h.running_value+h.increment>h.value){h.running_value=h.value}else{h.running_value+=h.increment}}}if(h.running_value==h.value){clearInterval(q)}var u=a("#"+h.id+"_pbImage");var s=a("#"+h.id+"_pbText");var t=k(h);if(t!=h.image){u.css("background-image","url("+t+")");h.image=t}u.css("background-position",(((h.width*-1))+(i(h)*v))+"px 50%");u.attr("title",o(h));s.html(o(h));if(h.callback!=null&&typeof(h.callback)=="function"){h.callback(h)}n.config=h},h.step_duration)})};this.submit=function(f){var e=a("input:file",f);if(e.length>0){var h=a("iframe[name=progress]",f);if(h){var d="";for(var c=0;c<32;c++){d+=Math.floor(Math.random()*16).toString(16)}var g=a(f).attr("action");if(old_id=/X-Progress-ID=([^&]+)/.exec(g)){g=g.replace(old_id[1],d)}else{g=g+"?X-Progress-ID="+d}a(f).attr("action",g);var b=a(h).get(0).contentWindow.updateUploadProgress;if(b){b(d);return d}}}}}});a.fn.extend({progressBar:a.progressBar.construct})})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-progressbar.min.js
jquery-progressbar.min.js
jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){o[n]||(o[n]=!0,e.migrateWarnings.push(n),t.console&&console.warn&&!e.migrateMute&&(console.warn("JQMIGRATE: "+n),e.migrateTrace&&console.trace&&console.trace()))}function a(t,a,o,i){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(i),o},set:function(e){r(i),o=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=o}var o={};e.migrateWarnings=[],!e.migrateMute&&t.console&&console.log&&console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){o={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var i=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",i||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,o,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(i?a in i:e.isFunction(e.fn[a])))?e(t)[a](o):("type"===a&&o!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,o=e.prop(t,r);return o===!0||"boolean"!=typeof o&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,o))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^(?:[^<]*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;e.fn.init=function(t,n,a){var o;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(o=y.exec(t))&&o[1]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(e.trim(t),n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,o,i=this[0];return!i||"events"!==t||1!==arguments.length||(a=e.data(i,t),o=e._data(i,t),a!==n&&a!==o||o===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),o)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,o,i){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),o)for(c=function(e){return!e.type||j.test(e.type)?i?i.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(o.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,C=e.fn.live,S=e.fn.die,T="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",M=RegExp("\\b(?:"+T+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,o){e!==document&&M.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,o)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,o=t.guid||e.guid++,i=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%i;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=o;a.length>i;)a[i++].guid=o;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),C?C.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),S?S.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||M.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(T.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window); //@ sourceMappingURL=dist/jquery-migrate.min.map
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-migrate-1.1.1.min.js
jquery-migrate-1.1.1.min.js
(function(B){var L,T,Q,M,d,m,J,A,O,z,C=0,H={},j=[],e=0,G={},y=[],f=null,o=new Image(),i=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,k=/[^\.]\.(swf)\s*$/i,p,N=1,h=0,t="",b,c,P=false,s=B.extend(B("<div/>")[0],{prop:0}),S=B.browser.msie&&B.browser.version<7&&!window.XMLHttpRequest,r=function(){T.hide();o.onerror=o.onload=null;if(f){f.abort()}L.empty()},x=function(){if(false===H.onError(j,C,H)){T.hide();P=false;return}H.titleShow=false;H.width="auto";H.height="auto";L.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');n()},w=function(){var Z=j[C],W,Y,ab,aa,V,X;r();H=B.extend({},B.fn.fancybox.defaults,(typeof B(Z).data("fancybox")=="undefined"?H:B(Z).data("fancybox")));X=H.onStart(j,C,H);if(X===false){P=false;return}else{if(typeof X=="object"){H=B.extend(H,X)}}ab=H.title||(Z.nodeName?B(Z).attr("title"):Z.title)||"";if(Z.nodeName&&!H.orig){H.orig=B(Z).children("img:first").length?B(Z).children("img:first"):B(Z)}if(ab===""&&H.orig&&H.titleFromAlt){ab=H.orig.attr("alt")}W=H.href||(Z.nodeName?B(Z).attr("href"):Z.href)||null;if((/^(?:javascript)/i).test(W)||W=="#"){W=null}if(H.type){Y=H.type;if(!W){W=H.content}}else{if(H.content){Y="html"}else{if(W){if(W.match(i)){Y="image"}else{if(W.match(k)){Y="swf"}else{if(B(Z).hasClass("iframe")){Y="iframe"}else{if(W.indexOf("#")===0){Y="inline"}else{Y="ajax"}}}}}}}if(!Y){x();return}if(Y=="inline"){Z=W.substr(W.indexOf("#"));Y=B(Z).length>0?"inline":"ajax"}H.type=Y;H.href=W;H.title=ab;if(H.autoDimensions){if(H.type=="html"||H.type=="inline"||H.type=="ajax"){H.width="auto";H.height="auto"}else{H.autoDimensions=false}}if(H.modal){H.overlayShow=true;H.hideOnOverlayClick=false;H.hideOnContentClick=false;H.enableEscapeButton=false;H.showCloseButton=false}H.padding=parseInt(H.padding,10);H.margin=parseInt(H.margin,10);L.css("padding",(H.padding+H.margin));B(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){B(this).replaceWith(m.children())});switch(Y){case"html":L.html(H.content);n();break;case"inline":if(B(Z).parent().is("#fancybox-content")===true){P=false;return}B('<div class="fancybox-inline-tmp" />').hide().insertBefore(B(Z)).bind("fancybox-cleanup",function(){B(this).replaceWith(m.children())}).bind("fancybox-cancel",function(){B(this).replaceWith(L.children())});B(Z).appendTo(L);n();break;case"image":P=false;B.fancybox.showActivity();o=new Image();o.onerror=function(){x()};o.onload=function(){P=true;o.onerror=o.onload=null;F()};o.src=W;break;case"swf":H.scrolling="no";aa='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+H.width+'" height="'+H.height+'"><param name="movie" value="'+W+'"></param>';V="";B.each(H.swf,function(ac,ad){aa+='<param name="'+ac+'" value="'+ad+'"></param>';V+=" "+ac+'="'+ad+'"'});aa+='<embed src="'+W+'" type="application/x-shockwave-flash" width="'+H.width+'" height="'+H.height+'"'+V+"></embed></object>";L.html(aa);n();break;case"ajax":P=false;B.fancybox.showActivity();H.ajax.win=H.ajax.success;f=B.ajax(B.extend({},H.ajax,{url:W,data:H.ajax.data||{},error:function(ac,ae,ad){if(ac.status>0){x()}},success:function(ad,af,ac){var ae=typeof ac=="object"?ac:f;if(ae.status==200){if(typeof H.ajax.win=="function"){X=H.ajax.win(W,ad,af,ac);if(X===false){T.hide();return}else{if(typeof X=="string"||typeof X=="object"){ad=X}}}L.html(ad);n()}}}));break;case"iframe":E();break}},n=function(){var V=H.width,W=H.height;if(V.toString().indexOf("%")>-1){V=parseInt((B(window).width()-(H.margin*2))*parseFloat(V)/100,10)+"px"}else{V=V=="auto"?"auto":V+"px"}if(W.toString().indexOf("%")>-1){W=parseInt((B(window).height()-(H.margin*2))*parseFloat(W)/100,10)+"px"}else{W=W=="auto"?"auto":W+"px"}L.wrapInner('<div style="width:'+V+";height:"+W+";overflow: "+(H.scrolling=="auto"?"auto":(H.scrolling=="yes"?"scroll":"hidden"))+';position:relative;"></div>');H.width=L.width();H.height=L.height();E()},F=function(){H.width=o.width;H.height=o.height;B("<img />").attr({id:"fancybox-img",src:o.src,alt:H.title}).appendTo(L);E()},E=function(){var W,V;T.hide();if(M.is(":visible")&&false===G.onCleanup(y,e,G)){B.event.trigger("fancybox-cancel");P=false;return}P=true;B(m.add(Q)).unbind();B(window).unbind("resize.fb scroll.fb");B(document).unbind("keydown.fb");if(M.is(":visible")&&G.titlePosition!=="outside"){M.css("height",M.height())}y=j;e=C;G=H;if(G.overlayShow){Q.css({"background-color":G.overlayColor,opacity:G.overlayOpacity,cursor:G.hideOnOverlayClick?"pointer":"auto",height:B(document).height()});if(!Q.is(":visible")){if(S){B("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"})}Q.show()}}else{Q.hide()}c=R();l();if(M.is(":visible")){B(J.add(O).add(z)).hide();W=M.position(),b={top:W.top,left:W.left,width:M.width(),height:M.height()};V=(b.width==c.width&&b.height==c.height);m.fadeTo(G.changeFade,0.3,function(){var X=function(){m.html(L.contents()).fadeTo(G.changeFade,1,v)};B.event.trigger("fancybox-change");m.empty().removeAttr("filter").css({"border-width":G.padding,width:c.width-G.padding*2,height:H.autoDimensions?"auto":c.height-h-G.padding*2});if(V){X()}else{s.prop=0;B(s).animate({prop:1},{duration:G.changeSpeed,easing:G.easingChange,step:U,complete:X})}});return}M.removeAttr("style");m.css("border-width",G.padding);if(G.transitionIn=="elastic"){b=I();m.html(L.contents());M.show();if(G.opacity){c.opacity=0}s.prop=0;B(s).animate({prop:1},{duration:G.speedIn,easing:G.easingIn,step:U,complete:v});return}if(G.titlePosition=="inside"&&h>0){A.show()}m.css({width:c.width-G.padding*2,height:H.autoDimensions?"auto":c.height-h-G.padding*2}).html(L.contents());M.css(c).fadeIn(G.transitionIn=="none"?0:G.speedIn,v)},D=function(V){if(V&&V.length){if(G.titlePosition=="float"){return'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+V+'</td><td id="fancybox-title-float-right"></td></tr></table>'}return'<div id="fancybox-title-'+G.titlePosition+'">'+V+"</div>"}return false},l=function(){t=G.title||"";h=0;A.empty().removeAttr("style").removeClass();if(G.titleShow===false){A.hide();return}t=B.isFunction(G.titleFormat)?G.titleFormat(t,y,e,G):D(t);if(!t||t===""){A.hide();return}A.addClass("fancybox-title-"+G.titlePosition).html(t).appendTo("body").show();switch(G.titlePosition){case"inside":A.css({width:c.width-(G.padding*2),marginLeft:G.padding,marginRight:G.padding});h=A.outerHeight(true);A.appendTo(d);c.height+=h;break;case"over":A.css({marginLeft:G.padding,width:c.width-(G.padding*2),bottom:G.padding}).appendTo(d);break;case"float":A.css("left",parseInt((A.width()-c.width-40)/2,10)*-1).appendTo(M);break;default:A.css({width:c.width-(G.padding*2),paddingLeft:G.padding,paddingRight:G.padding}).appendTo(M);break}A.hide()},g=function(){if(G.enableEscapeButton||G.enableKeyboardNav){B(document).bind("keydown.fb",function(V){if(V.keyCode==27&&G.enableEscapeButton){V.preventDefault();B.fancybox.close()}else{if((V.keyCode==37||V.keyCode==39)&&G.enableKeyboardNav&&V.target.tagName!=="INPUT"&&V.target.tagName!=="TEXTAREA"&&V.target.tagName!=="SELECT"){V.preventDefault();B.fancybox[V.keyCode==37?"prev":"next"]()}}})}if(!G.showNavArrows){O.hide();z.hide();return}if((G.cyclic&&y.length>1)||e!==0){O.show()}if((G.cyclic&&y.length>1)||e!=(y.length-1)){z.show()}},v=function(){if(!B.support.opacity){m.get(0).style.removeAttribute("filter");M.get(0).style.removeAttribute("filter")}if(H.autoDimensions){m.css("height","auto")}M.css("height","auto");if(t&&t.length){A.show()}if(G.showCloseButton){J.show()}g();if(G.hideOnContentClick){m.bind("click",B.fancybox.close)}if(G.hideOnOverlayClick){Q.bind("click",B.fancybox.close)}B(window).bind("resize.fb",B.fancybox.resize);if(G.centerOnScroll){B(window).bind("scroll.fb",B.fancybox.center)}if(G.type=="iframe"){B('<iframe id="fancybox-frame" name="fancybox-frame'+new Date().getTime()+'" frameborder="0" hspace="0" '+(B.browser.msie?'allowtransparency="true""':"")+' scrolling="'+H.scrolling+'" src="'+G.href+'"></iframe>').appendTo(m)}M.show();P=false;B.fancybox.center();G.onComplete(y,e,G);K()},K=function(){var V,W;if((y.length-1)>e){V=y[e+1].href;if(typeof V!=="undefined"&&V.match(i)){W=new Image();W.src=V}}if(e>0){V=y[e-1].href;if(typeof V!=="undefined"&&V.match(i)){W=new Image();W.src=V}}},U=function(W){var V={width:parseInt(b.width+(c.width-b.width)*W,10),height:parseInt(b.height+(c.height-b.height)*W,10),top:parseInt(b.top+(c.top-b.top)*W,10),left:parseInt(b.left+(c.left-b.left)*W,10)};if(typeof c.opacity!=="undefined"){V.opacity=W<0.5?0.5:W}M.css(V);m.css({width:V.width-G.padding*2,height:V.height-(h*W)-G.padding*2})},u=function(){return[B(window).width()-(G.margin*2),B(window).height()-(G.margin*2),B(document).scrollLeft()+G.margin,B(document).scrollTop()+G.margin]},R=function(){var V=u(),Z={},W=G.autoScale,X=G.padding*2,Y;if(G.width.toString().indexOf("%")>-1){Z.width=parseInt((V[0]*parseFloat(G.width))/100,10)}else{Z.width=G.width+X}if(G.height.toString().indexOf("%")>-1){Z.height=parseInt((V[1]*parseFloat(G.height))/100,10)}else{Z.height=G.height+X}if(W&&(Z.width>V[0]||Z.height>V[1])){if(H.type=="image"||H.type=="swf"){Y=(G.width)/(G.height);if((Z.width)>V[0]){Z.width=V[0];Z.height=parseInt(((Z.width-X)/Y)+X,10)}if((Z.height)>V[1]){Z.height=V[1];Z.width=parseInt(((Z.height-X)*Y)+X,10)}}else{Z.width=Math.min(Z.width,V[0]);Z.height=Math.min(Z.height,V[1])}}Z.top=parseInt(Math.max(V[3]-20,V[3]+((V[1]-Z.height-40)*0.5)),10);Z.left=parseInt(Math.max(V[2]-20,V[2]+((V[0]-Z.width-40)*0.5)),10);return Z},q=function(V){var W=V.offset();W.top+=parseInt(V.css("paddingTop"),10)||0;W.left+=parseInt(V.css("paddingLeft"),10)||0;W.top+=parseInt(V.css("border-top-width"),10)||0;W.left+=parseInt(V.css("border-left-width"),10)||0;W.width=V.width();W.height=V.height();return W},I=function(){var Y=H.orig?B(H.orig):false,X={},W,V;if(Y&&Y.length){W=q(Y);X={width:W.width+(G.padding*2),height:W.height+(G.padding*2),top:W.top-G.padding-20,left:W.left-G.padding-20}}else{V=u();X={width:G.padding*2,height:G.padding*2,top:parseInt(V[3]+V[1]*0.5,10),left:parseInt(V[2]+V[0]*0.5,10)}}return X},a=function(){if(!T.is(":visible")){clearInterval(p);return}B("div",T).css("top",(N*-40)+"px");N=(N+1)%12};B.fn.fancybox=function(V){if(!B(this).length){return this}B(this).data("fancybox",B.extend({},V,(B.metadata?B(this).metadata():{}))).unbind("click.fb").bind("click.fb",function(X){X.preventDefault();if(P){return}P=true;B(this).blur();j=[];C=0;var W=B(this).attr("rel")||"";if(!W||W==""||W==="nofollow"){j.push(this)}else{j=B("a[rel="+W+"], area[rel="+W+"]");C=j.index(this)}w();return});return this};B.fancybox=function(Y){var X;if(P){return}P=true;X=typeof arguments[1]!=="undefined"?arguments[1]:{};j=[];C=parseInt(X.index,10)||0;if(B.isArray(Y)){for(var W=0,V=Y.length;W<V;W++){if(typeof Y[W]=="object"){B(Y[W]).data("fancybox",B.extend({},X,Y[W]))}else{Y[W]=B({}).data("fancybox",B.extend({content:Y[W]},X))}}j=jQuery.merge(j,Y)}else{if(typeof Y=="object"){B(Y).data("fancybox",B.extend({},X,Y))}else{Y=B({}).data("fancybox",B.extend({content:Y},X))}j.push(Y)}if(C>j.length||C<0){C=0}w()};B.fancybox.showActivity=function(){clearInterval(p);T.show();p=setInterval(a,66)};B.fancybox.hideActivity=function(){T.hide()};B.fancybox.next=function(){return B.fancybox.pos(e+1)};B.fancybox.prev=function(){return B.fancybox.pos(e-1)};B.fancybox.pos=function(V){if(P){return}V=parseInt(V);j=y;if(V>-1&&V<y.length){C=V;w()}else{if(G.cyclic&&y.length>1){C=V>=y.length?0:y.length-1;w()}}return};B.fancybox.cancel=function(){if(P){return}P=true;B.event.trigger("fancybox-cancel");r();H.onCancel(j,C,H);P=false};B.fancybox.close=function(){if(P||M.is(":hidden")){return}P=true;if(G&&false===G.onCleanup(y,e,G)){P=false;return}r();B(J.add(O).add(z)).hide();B(m.add(Q)).unbind();B(window).unbind("resize.fb scroll.fb");B(document).unbind("keydown.fb");m.find("iframe").attr("src",S&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");if(G.titlePosition!=="inside"){A.empty()}M.stop();function V(){Q.fadeOut("fast");A.empty().hide();M.hide();B.event.trigger("fancybox-cleanup");m.empty();G.onClosed(y,e,G);y=H=[];e=C=0;G=H={};P=false}if(G.transitionOut=="elastic"){b=I();var W=M.position();c={top:W.top,left:W.left,width:M.width(),height:M.height()};if(G.opacity){c.opacity=1}A.empty().hide();s.prop=1;B(s).animate({prop:0},{duration:G.speedOut,easing:G.easingOut,step:U,complete:V})}else{M.fadeOut(G.transitionOut=="none"?0:G.speedOut,V)}};B.fancybox.resize=function(){if(Q.is(":visible")){Q.css("height",B(document).height())}B.fancybox.center(true)};B.fancybox.center=function(){var V,W;if(P){return}W=arguments[0]===true?1:0;V=u();if(!W&&(M.width()>V[0]||M.height()>V[1])){return}M.stop().animate({top:parseInt(Math.max(V[3]-20,V[3]+((V[1]-m.height()-40)*0.5)-G.padding)),left:parseInt(Math.max(V[2]-20,V[2]+((V[0]-m.width()-40)*0.5)-G.padding))},typeof arguments[0]=="number"?arguments[0]:200)};B.fancybox.init=function(){if(B("#fancybox-wrap").length){return}B("body").append(L=B('<div id="fancybox-tmp"></div>'),T=B('<div id="fancybox-loading"><div></div></div>'),Q=B('<div id="fancybox-overlay"></div>'),M=B('<div id="fancybox-wrap"></div>'));d=B('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(M);d.append(m=B('<div id="fancybox-content"></div>'),J=B('<a id="fancybox-close"></a>'),A=B('<div id="fancybox-title"></div>'),O=B('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),z=B('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));J.click(B.fancybox.close);T.click(B.fancybox.cancel);O.click(function(V){V.preventDefault();B.fancybox.prev()});z.click(function(V){V.preventDefault();B.fancybox.next()});if(B.fn.mousewheel){M.bind("mousewheel.fb",function(V,W){if(P){V.preventDefault()}else{if(B(V.target).get(0).clientHeight==0||B(V.target).get(0).scrollHeight===B(V.target).get(0).clientHeight){V.preventDefault();B.fancybox[W>0?"prev":"next"]()}}})}if(!B.support.opacity){M.addClass("fancybox-ie")}if(S){T.addClass("fancybox-ie6");M.addClass("fancybox-ie6");B('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(d)}};B.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};B(document).ready(function(){B.fancybox.init()})})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-fancybox.min.js
jquery-fancybox.min.js
jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], 16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", "borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, 0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, 211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})}; f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this, [{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b= 0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}), d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement; if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)}); return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this, arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/ 2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b, d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c, a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b, d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g= 0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158; if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c, a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery); ;/* * jQuery UI Effects Blind 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Blind * * Depends: * jquery.effects.core.js */ (function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a, g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery); ;/* * jQuery UI Effects Bounce 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Bounce * * Depends: * jquery.effects.core.js */ (function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/ 3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a); b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery); ;/* * jQuery UI Effects Clip 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Clip * * Depends: * jquery.effects.core.js */ (function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position, c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Drop 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Drop * * Depends: * jquery.effects.core.js */ (function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e== "show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Explode 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Explode * * Depends: * jquery.effects.core.js */ (function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f= 0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); ;/* * jQuery UI Effects Fade 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Fade * * Depends: * jquery.effects.core.js */ (function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Fold 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Fold * * Depends: * jquery.effects.core.js */ (function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1], 10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); ;/* * jQuery UI Effects Highlight 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Highlight * * Depends: * jquery.effects.core.js */ (function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Pulsate 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Pulsate * * Depends: * jquery.effects.core.js */ (function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration, a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery); ;/* * jQuery UI Effects Scale 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Scale * * Depends: * jquery.effects.core.js */ (function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a, b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity= 1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"], p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}}; if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a); a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from); child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a, n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Shake 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Shake * * Depends: * jquery.effects.core.js */ (function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]= (h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery); ;/* * jQuery UI Effects Slide 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Slide * * Depends: * jquery.effects.core.js */ (function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e); var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); ;/* * jQuery UI Effects Transfer 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Effects/Transfer * * Depends: * jquery.effects.core.js */ (function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); b.dequeue()})})}})(jQuery); ;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-ui-effects-1.8.16.min.js
jquery-ui-effects-1.8.16.min.js
(function($) { $.fn.dynDateTime = function(options) { // plugin defaults $.fn.dynDateTime.defaults = { displayArea: null, button: null, eventName: "click", ifFormat: "%Y/%m/%d", daFormat: "%Y/%m/%d", singleClick: true, dateStatusFunc: null, dateText: null, firstDay: null, align: "Br", range: [1900, 2999], weekNumbers: true, flat: null, flatCallback: null, onSelect: null, onClose: null, onUpdate: null, date: null, showsTime: false, timeFormat: "24", electric: true, step: 2, position: null, cache: false, showOthers: false, multiple: null, debug: false }; var opts = $.extend({}, $.fn.dynDateTime.defaults, options); return this.each(function() { //opts are shared per jQuery call; create per inputField closures of non-shared values for each instance var this_inputField = this; var this_displayArea = null; var this_button = null; var this_flat = null; if(opts.displayArea) { try { this_displayArea = eval("jQuery(this)" + opts.displayArea + ".get(0);"); } catch (err) { opts.displayArea = null; } } if(opts.button) { try { this_button = eval("jQuery(this)" + opts.button + ".get(0);"); } catch (err) { opts.button = null; } } if(opts.flat) { try { this_flat = eval("jQuery(this)" + opts.flat + ".get(0);"); } catch (err) { opts.flat = null; } } if (!(this_flat || opts.multiple || this_inputField || this_displayArea || this_button)) { log("opts"); //nothing to do return; } //default onSelect function onSelect(cal) { var p = cal.opts; var update = (cal.dateClicked || p.electric); if (update && this_inputField) { this_inputField.value = cal.date.print(p.ifFormat); if (typeof this_inputField.onchange == "function") this_inputField.onchange(); } if (update && this_displayArea) this_displayArea.innerHTML = cal.date.print(p.daFormat); if (update && typeof p.onUpdate == "function") p.onUpdate(cal); if (update && p.flat) { if (typeof p.flatCallback == "function") p.flatCallback(cal); } if (update && p.singleClick && cal.dateClicked) cal.callCloseHandler(); }; //flat setup if (this_flat != null) { var cal = new Calendar(opts.firstDay, opts.date, opts.onSelect || onSelect); cal.showsOtherMonths = opts.showOthers; cal.showsTime = opts.showsTime; cal.time24 = (opts.timeFormat == "24"); cal.opts = opts; cal.weekNumbers = opts.weekNumbers; cal.setRange(opts.range[0], opts.range[1]); cal.setDateStatusHandler(opts.dateStatusFunc); cal.getDateText = opts.dateText; if (opts.ifFormat) { cal.setDateFormat(opts.ifFormat); } if (this_inputField && typeof this_inputField.value == "string") { //cal.parseDate(this_inputField.value); log("rar"); } cal.create(this_flat); cal.show(); return; } //find the element to mount show/hide event var triggerEl = this_button || this_displayArea || this_inputField ; //bolt on event triggerEl["on" + opts.eventName] = function() { log("clicked"); var dateEl = this_inputField || this_displayArea; var dateFmt = this_inputField ? opts.ifFormat : opts.daFormat; var mustCreate = false; var cal = window.calendar; if (dateEl) opts.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); if (!(cal && opts.cache)) { window.calendar = cal = new Calendar(opts.firstDay, opts.date, opts.onSelect || onSelect, opts.onClose || function(cal) { cal.hide(); }); cal.showsTime = opts.showsTime; cal.time24 = (opts.timeFormat == "24"); cal.weekNumbers = opts.weekNumbers; mustCreate = true; } else { if (opts.date) cal.setDate(opts.date); cal.hide(); } if (opts.multiple) { cal.multiple = {}; for (var i = opts.multiple.length; --i >= 0;) { var d = opts.multiple[i]; var ds = d.print("%Y%m%d"); cal.multiple[ds] = d; } } cal.showsOtherMonths = opts.showOthers; cal.yearStep = opts.step; cal.setRange(opts.range[0], opts.range[1]); cal.opts = opts; cal.setDateStatusHandler(opts.dateStatusFunc); cal.getDateText = opts.dateText; cal.setDateFormat(dateFmt); if (mustCreate) cal.create(); cal.refresh(); if (!opts.position) cal.showAtElement(this_button || this_displayArea || this_inputField, opts.align); else cal.showAt(opts.position[0], opts.position[1]); return false; }; }); // private function for debugging function log(msg) { if(opts.debug) { window.loadFirebugConsole(); // file:// based access seems to disable this for me! if (window.console && window.console.log ) window.console.log("dynDateTime: " + msg); } }; }; })(jQuery); // Begin old dynarch code /* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo * ----------------------------------------------------------- * * The DHTML Calendar, version 1.0 "It is happening again" * * Details and latest version at: * www.dynarch.com/projects/calendar * * This script is developed by Dynarch.com. Visit us at www.dynarch.com. * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ // $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $ /** The Calendar object constructor. */ Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { // member variables this.activeDiv = null; this.currentDateEl = null; this.getDateStatus = null; this.getDateToolTip = null; this.getDateText = null; this.timeout = null; this.onSelected = onSelected || null; this.onClose = onClose || null; this.dragging = false; this.hidden = false; this.minYear = 1970; this.maxYear = 2050; this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; this.isPopup = true; this.weekNumbers = true; this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc. this.showsOtherMonths = false; this.dateStr = dateStr; this.ar_days = null; this.showsTime = false; this.time24 = true; this.yearStep = 2; this.hiliteToday = true; this.multiple = null; // HTML elements this.table = null; this.element = null; this.tbody = null; this.firstdayname = null; // Combo boxes this.monthsCombo = null; this.yearsCombo = null; this.hilitedMonth = null; this.activeMonth = null; this.hilitedYear = null; this.activeYear = null; // Information this.dateClicked = false; // one-time initializations if (typeof Calendar._SDN == "undefined") { // table of short day names if (typeof Calendar._SDN_len == "undefined") Calendar._SDN_len = 3; var ar = new Array(); for (var i = 8; i > 0;) { ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len); } Calendar._SDN = ar; // table of short month names if (typeof Calendar._SMN_len == "undefined") Calendar._SMN_len = 3; ar = new Array(); for (var i = 12; i > 0;) { ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len); } Calendar._SMN = ar; } }; // ** constants /// "static", needed for event handlers. Calendar._C = null; /// detect a special case of "web browser" Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ); Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) ); /// detect Opera browser Calendar.is_opera = /opera/i.test(navigator.userAgent); /// detect KHTML-based browsers Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent); // BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate // library, at some point. Calendar.getAbsolutePos = function(el) { var SL = 0, ST = 0; var is_div = /^div$/i.test(el.tagName); if (is_div && el.scrollLeft) SL = el.scrollLeft; if (is_div && el.scrollTop) ST = el.scrollTop; var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST }; if (el.offsetParent) { var tmp = this.getAbsolutePos(el.offsetParent); r.x += tmp.x; r.y += tmp.y; } return r; }; Calendar.isRelated = function (el, evt) { var related = evt.relatedTarget; if (!related) { var type = evt.type; if (type == "mouseover") { related = evt.fromElement; } else if (type == "mouseout") { related = evt.toElement; } } while (related) { if (related == el) { return true; } related = related.parentNode; } return false; }; Calendar.removeClass = function(el, className) { if (!(el && el.className)) { return; } var cls = el.className.split(" "); var ar = new Array(); for (var i = cls.length; i > 0;) { if (cls[--i] != className) { ar[ar.length] = cls[i]; } } el.className = ar.join(" "); }; Calendar.addClass = function(el, className) { Calendar.removeClass(el, className); el.className += " " + className; }; // FIXME: the following 2 functions totally suck, are useless and should be replaced immediately. Calendar.getElement = function(ev) { var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget; while (f.nodeType != 1 || /^div$/i.test(f.tagName)) f = f.parentNode; return f; }; Calendar.getTargetElement = function(ev) { var f = Calendar.is_ie ? window.event.srcElement : ev.target; while (f.nodeType != 1) f = f.parentNode; return f; }; Calendar.stopEvent = function(ev) { ev || (ev = window.event); if (Calendar.is_ie) { ev.cancelBubble = true; ev.returnValue = false; } else { ev.preventDefault(); ev.stopPropagation(); } return false; }; Calendar.addEvent = function(el, evname, func) { if (el.attachEvent) { // IE el.attachEvent("on" + evname, func); } else if (el.addEventListener) { // Gecko / W3C el.addEventListener(evname, func, true); } else { el["on" + evname] = func; } }; Calendar.removeEvent = function(el, evname, func) { if (el.detachEvent) { // IE el.detachEvent("on" + evname, func); } else if (el.removeEventListener) { // Gecko / W3C el.removeEventListener(evname, func, true); } else { el["on" + evname] = null; } }; Calendar.createElement = function(type, parent) { var el = null; if (document.createElementNS) { // use the XHTML namespace; IE won't normally get here unless // _they_ "fix" the DOM2 implementation. el = document.createElementNS("http://www.w3.org/1999/xhtml", type); } else { el = document.createElement(type); } if (typeof parent != "undefined") { parent.appendChild(el); } return el; }; // END: UTILITY FUNCTIONS // BEGIN: CALENDAR STATIC FUNCTIONS /** Internal -- adds a set of events to make some element behave like a button. */ Calendar._add_evs = function(el) { with (Calendar) { addEvent(el, "mouseover", dayMouseOver); addEvent(el, "mousedown", dayMouseDown); addEvent(el, "mouseout", dayMouseOut); if (is_ie) { addEvent(el, "dblclick", dayMouseDblClick); el.setAttribute("unselectable", true); } } }; Calendar.findMonth = function(el) { if (typeof el.month != "undefined") { return el; } else if (typeof el.parentNode.month != "undefined") { return el.parentNode; } return null; }; Calendar.findYear = function(el) { if (typeof el.year != "undefined") { return el; } else if (typeof el.parentNode.year != "undefined") { return el.parentNode; } return null; }; Calendar.showMonthsCombo = function () { var cal = Calendar._C; if (!cal) { return false; } var cal = cal; var cd = cal.activeDiv; var mc = cal.monthsCombo; if (cal.hilitedMonth) { Calendar.removeClass(cal.hilitedMonth, "hilite"); } if (cal.activeMonth) { Calendar.removeClass(cal.activeMonth, "active"); } var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()]; Calendar.addClass(mon, "active"); cal.activeMonth = mon; var s = mc.style; s.display = "block"; if (cd.navtype < 0) s.left = cd.offsetLeft + "px"; else { var mcw = mc.offsetWidth; if (typeof mcw == "undefined") // Konqueror brain-dead techniques mcw = 50; s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px"; } s.top = (cd.offsetTop + cd.offsetHeight) + "px"; }; Calendar.showYearsCombo = function (fwd) { var cal = Calendar._C; if (!cal) { return false; } var cal = cal; var cd = cal.activeDiv; var yc = cal.yearsCombo; if (cal.hilitedYear) { Calendar.removeClass(cal.hilitedYear, "hilite"); } if (cal.activeYear) { Calendar.removeClass(cal.activeYear, "active"); } cal.activeYear = null; var Y = cal.date.getFullYear() + (fwd ? 1 : -1); var yr = yc.firstChild; var show = false; for (var i = 12; i > 0; --i) { if (Y >= cal.minYear && Y <= cal.maxYear) { yr.innerHTML = Y; yr.year = Y; yr.style.display = "block"; show = true; } else { yr.style.display = "none"; } yr = yr.nextSibling; Y += fwd ? cal.yearStep : -cal.yearStep; } if (show) { var s = yc.style; s.display = "block"; if (cd.navtype < 0) s.left = cd.offsetLeft + "px"; else { var ycw = yc.offsetWidth; if (typeof ycw == "undefined") // Konqueror brain-dead techniques ycw = 50; s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px"; } s.top = (cd.offsetTop + cd.offsetHeight) + "px"; } }; // event handlers Calendar.tableMouseUp = function(ev) { var cal = Calendar._C; if (!cal) { return false; } if (cal.timeout) { clearTimeout(cal.timeout); } var el = cal.activeDiv; if (!el) { return false; } var target = Calendar.getTargetElement(ev); ev || (ev = window.event); Calendar.removeClass(el, "active"); if (target == el || target.parentNode == el) { Calendar.cellClick(el, ev); } var mon = Calendar.findMonth(target); var date = null; if (mon) { date = new Date(cal.date); if (mon.month != date.getMonth()) { date.setMonth(mon.month); cal.setDate(date); cal.dateClicked = false; cal.callHandler(); } } else { var year = Calendar.findYear(target); if (year) { date = new Date(cal.date); if (year.year != date.getFullYear()) { date.setFullYear(year.year); cal.setDate(date); cal.dateClicked = false; cal.callHandler(); } } } with (Calendar) { removeEvent(document, "mouseup", tableMouseUp); removeEvent(document, "mouseover", tableMouseOver); removeEvent(document, "mousemove", tableMouseOver); cal._hideCombos(); _C = null; return stopEvent(ev); } }; Calendar.tableMouseOver = function (ev) { var cal = Calendar._C; if (!cal) { return; } var el = cal.activeDiv; var target = Calendar.getTargetElement(ev); if (target == el || target.parentNode == el) { Calendar.addClass(el, "hilite active"); Calendar.addClass(el.parentNode, "rowhilite"); } else { if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2))) Calendar.removeClass(el, "active"); Calendar.removeClass(el, "hilite"); Calendar.removeClass(el.parentNode, "rowhilite"); } ev || (ev = window.event); if (el.navtype == 50 && target != el) { var pos = Calendar.getAbsolutePos(el); var w = el.offsetWidth; var x = ev.clientX; var dx; var decrease = true; if (x > pos.x + w) { dx = x - pos.x - w; decrease = false; } else dx = pos.x - x; if (dx < 0) dx = 0; var range = el._range; var current = el._current; var count = Math.floor(dx / 10) % range.length; for (var i = range.length; --i >= 0;) if (range[i] == current) break; while (count-- > 0) if (decrease) { if (--i < 0) i = range.length - 1; } else if ( ++i >= range.length ) i = 0; var newval = range[i]; el.innerHTML = newval; cal.onUpdateTime(); } var mon = Calendar.findMonth(target); if (mon) { if (mon.month != cal.date.getMonth()) { if (cal.hilitedMonth) { Calendar.removeClass(cal.hilitedMonth, "hilite"); } Calendar.addClass(mon, "hilite"); cal.hilitedMonth = mon; } else if (cal.hilitedMonth) { Calendar.removeClass(cal.hilitedMonth, "hilite"); } } else { if (cal.hilitedMonth) { Calendar.removeClass(cal.hilitedMonth, "hilite"); } var year = Calendar.findYear(target); if (year) { if (year.year != cal.date.getFullYear()) { if (cal.hilitedYear) { Calendar.removeClass(cal.hilitedYear, "hilite"); } Calendar.addClass(year, "hilite"); cal.hilitedYear = year; } else if (cal.hilitedYear) { Calendar.removeClass(cal.hilitedYear, "hilite"); } } else if (cal.hilitedYear) { Calendar.removeClass(cal.hilitedYear, "hilite"); } } return Calendar.stopEvent(ev); }; Calendar.tableMouseDown = function (ev) { if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) { return Calendar.stopEvent(ev); } }; Calendar.calDragIt = function (ev) { var cal = Calendar._C; if (!(cal && cal.dragging)) { return false; } var posX; var posY; if (Calendar.is_ie) { posY = window.event.clientY + document.body.scrollTop; posX = window.event.clientX + document.body.scrollLeft; } else { posX = ev.pageX; posY = ev.pageY; } cal.hideShowCovered(); var st = cal.element.style; st.left = (posX - cal.xOffs) + "px"; st.top = (posY - cal.yOffs) + "px"; return Calendar.stopEvent(ev); }; Calendar.calDragEnd = function (ev) { var cal = Calendar._C; if (!cal) { return false; } cal.dragging = false; with (Calendar) { removeEvent(document, "mousemove", calDragIt); removeEvent(document, "mouseup", calDragEnd); tableMouseUp(ev); } cal.hideShowCovered(); }; Calendar.dayMouseDown = function(ev) { var el = Calendar.getElement(ev); if (el.disabled) { return false; } var cal = el.calendar; cal.activeDiv = el; Calendar._C = cal; if (el.navtype != 300) with (Calendar) { if (el.navtype == 50) { el._current = el.innerHTML; addEvent(document, "mousemove", tableMouseOver); } else addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); addClass(el, "hilite active"); addEvent(document, "mouseup", tableMouseUp); } else if (cal.isPopup) { cal._dragStart(ev); } if (el.navtype == -1 || el.navtype == 1) { if (cal.timeout) clearTimeout(cal.timeout); cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); } else if (el.navtype == -2 || el.navtype == 2) { if (cal.timeout) clearTimeout(cal.timeout); cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); } else { cal.timeout = null; } return Calendar.stopEvent(ev); }; Calendar.dayMouseDblClick = function(ev) { Calendar.cellClick(Calendar.getElement(ev), ev || window.event); if (Calendar.is_ie) { document.selection.empty(); } }; Calendar.dayMouseOver = function(ev) { var el = Calendar.getElement(ev); if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { return false; } if (el.ttip) { if (el.ttip.substr(0, 1) == "_") { el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); } el.calendar.tooltips.innerHTML = el.ttip; } if (el.navtype != 300) { Calendar.addClass(el, "hilite"); if (el.caldate) { Calendar.addClass(el.parentNode, "rowhilite"); } } return Calendar.stopEvent(ev); }; Calendar.dayMouseOut = function(ev) { with (Calendar) { var el = getElement(ev); if (isRelated(el, ev) || _C || el.disabled) return false; removeClass(el, "hilite"); if (el.caldate) removeClass(el.parentNode, "rowhilite"); if (el.calendar) el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; return stopEvent(ev); } }; /** * A generic "click" handler :) handles all types of buttons defined in this * calendar. */ Calendar.cellClick = function(el, ev) { var cal = el.calendar; var closing = false; var newdate = false; var date = null; if (typeof el.navtype == "undefined") { if (cal.currentDateEl) { Calendar.removeClass(cal.currentDateEl, "selected"); Calendar.addClass(el, "selected"); closing = (cal.currentDateEl == el); if (!closing) { cal.currentDateEl = el; } } cal.date.setDateOnly(el.caldate); date = cal.date; var other_month = !(cal.dateClicked = !el.otherMonth); if (!other_month && !cal.currentDateEl) cal._toggleMultipleDate(new Date(date)); else newdate = !el.disabled; // a date was clicked if (other_month) cal._init(cal.firstDayOfWeek, date); } else { if (el.navtype == 200) { Calendar.removeClass(el, "hilite"); cal.callCloseHandler(); return; } date = new Date(cal.date); if (el.navtype == 0) date.setDateOnly(new Date()); // TODAY // unless "today" was clicked, we assume no date was clicked so // the selected handler will know not to close the calenar when // in single-click mode. // cal.dateClicked = (el.navtype == 0); cal.dateClicked = false; var year = date.getFullYear(); var mon = date.getMonth(); function setMonth(m) { var day = date.getDate(); var max = date.getMonthDays(m); if (day > max) { date.setDate(max); } date.setMonth(m); }; switch (el.navtype) { case 400: Calendar.removeClass(el, "hilite"); var text = Calendar._TT["ABOUT"]; if (typeof text != "undefined") { text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; } else { // FIXME: this should be removed as soon as lang files get updated! text = "Help and about box text is not translated into this language.\n" + "If you know this language and you feel generous please update\n" + "the corresponding file in \"lang\" subdir to match calendar-en.js\n" + "and send it back to <[email protected]> to get it into the distribution ;-)\n\n" + "Thank you!\n" + "http://dynarch.com/mishoo/calendar.epl\n"; } alert(text); return; case -2: if (year > cal.minYear) { date.setFullYear(year - 1); } break; case -1: if (mon > 0) { setMonth(mon - 1); } else if (year-- > cal.minYear) { date.setFullYear(year); setMonth(11); } break; case 1: if (mon < 11) { setMonth(mon + 1); } else if (year < cal.maxYear) { date.setFullYear(year + 1); setMonth(0); } break; case 2: if (year < cal.maxYear) { date.setFullYear(year + 1); } break; case 100: cal.setFirstDayOfWeek(el.fdow); return; case 50: var range = el._range; var current = el.innerHTML; for (var i = range.length; --i >= 0;) if (range[i] == current) break; if (ev && ev.shiftKey) { if (--i < 0) i = range.length - 1; } else if ( ++i >= range.length ) i = 0; var newval = range[i]; el.innerHTML = newval; cal.onUpdateTime(); return; case 0: // TODAY will bring us here if ((typeof cal.getDateStatus == "function") && cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { return false; } break; } if (!date.equalsTo(cal.date)) { cal.setDate(date); newdate = true; } else if (el.navtype == 0) newdate = closing = true; } if (newdate) { ev && cal.callHandler(); } if (closing) { Calendar.removeClass(el, "hilite"); ev && cal.callCloseHandler(); } }; // END: CALENDAR STATIC FUNCTIONS // BEGIN: CALENDAR OBJECT FUNCTIONS /** * This function creates the calendar inside the given parent. If _par is * null than it creates a popup calendar inside the BODY element. If _par is * an element, be it BODY, then it creates a non-popup calendar (still * hidden). Some properties need to be set before calling this function. */ Calendar.prototype.create = function (_par) { var parent = null; if (! _par) { // default parent is the document body, in which case we create // a popup calendar. parent = document.getElementsByTagName("body")[0]; this.isPopup = true; } else { parent = _par; this.isPopup = false; } this.date = this.dateStr ? new Date(this.dateStr) : new Date(); var table = Calendar.createElement("table"); this.table = table; table.cellSpacing = 0; table.cellPadding = 0; table.calendar = this; Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown); var div = Calendar.createElement("div"); this.element = div; div.className = "calendar"; if (this.isPopup) { div.style.position = "absolute"; div.style.display = "none"; } div.appendChild(table); var thead = Calendar.createElement("thead", table); var cell = null; var row = null; var cal = this; var hh = function (text, cs, navtype) { cell = Calendar.createElement("td", row); cell.colSpan = cs; cell.className = "button"; if (navtype != 0 && Math.abs(navtype) <= 2) cell.className += " nav"; Calendar._add_evs(cell); cell.calendar = cal; cell.navtype = navtype; cell.innerHTML = "<div unselectable='on'>" + text + "</div>"; return cell; }; row = Calendar.createElement("tr", thead); var title_length = 6; (this.isPopup) && --title_length; (this.weekNumbers) && ++title_length; hh("?", 1, 400).ttip = Calendar._TT["INFO"]; this.title = hh("", title_length, 300); this.title.className = "title"; if (this.isPopup) { this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; this.title.style.cursor = "move"; hh("&#x00d7;", 1, 200).ttip = Calendar._TT["CLOSE"]; } row = Calendar.createElement("tr", thead); row.className = "headrow"; this._nav_py = hh("&#x00ab;", 1, -2); this._nav_py.ttip = Calendar._TT["PREV_YEAR"]; this._nav_pm = hh("&#x2039;", 1, -1); this._nav_pm.ttip = Calendar._TT["PREV_MONTH"]; this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); this._nav_now.ttip = Calendar._TT["GO_TODAY"]; this._nav_nm = hh("&#x203a;", 1, 1); this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"]; this._nav_ny = hh("&#x00bb;", 1, 2); this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; // day names row = Calendar.createElement("tr", thead); row.className = "daynames"; if (this.weekNumbers) { cell = Calendar.createElement("td", row); cell.className = "name wn"; cell.innerHTML = Calendar._TT["WK"]; } for (var i = 7; i > 0; --i) { cell = Calendar.createElement("td", row); if (!i) { cell.navtype = 100; cell.calendar = this; Calendar._add_evs(cell); } } this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; this._displayWeekdays(); var tbody = Calendar.createElement("tbody", table); this.tbody = tbody; for (i = 6; i > 0; --i) { row = Calendar.createElement("tr", tbody); if (this.weekNumbers) { cell = Calendar.createElement("td", row); } for (var j = 7; j > 0; --j) { cell = Calendar.createElement("td", row); cell.calendar = this; Calendar._add_evs(cell); } } if (this.showsTime) { row = Calendar.createElement("tr", tbody); row.className = "time"; cell = Calendar.createElement("td", row); cell.className = "time"; cell.colSpan = 2; cell.innerHTML = Calendar._TT["TIME"] || "&nbsp;"; cell = Calendar.createElement("td", row); cell.className = "time"; cell.colSpan = this.weekNumbers ? 4 : 3; (function(){ function makeTimePart(className, init, range_start, range_end) { var part = Calendar.createElement("span", cell); part.className = className; part.innerHTML = init; part.calendar = cal; part.ttip = Calendar._TT["TIME_PART"]; part.navtype = 50; part._range = []; if (typeof range_start != "number") part._range = range_start; else { for (var i = range_start; i <= range_end; ++i) { var txt; if (i < 10 && range_end >= 10) txt = '0' + i; else txt = '' + i; part._range[part._range.length] = txt; } } Calendar._add_evs(part); return part; }; var hrs = cal.date.getHours(); var mins = cal.date.getMinutes(); var t12 = !cal.time24; var pm = (hrs > 12); if (t12 && pm) hrs -= 12; var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); var span = Calendar.createElement("span", cell); span.innerHTML = ":"; span.className = "colon"; var M = makeTimePart("minute", mins, 0, 59); var AP = null; cell = Calendar.createElement("td", row); cell.className = "time"; cell.colSpan = 2; if (t12) AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); else cell.innerHTML = "&nbsp;"; cal.onSetTime = function() { var pm, hrs = this.date.getHours(), mins = this.date.getMinutes(); if (t12) { pm = (hrs >= 12); if (pm) hrs -= 12; if (hrs == 0) hrs = 12; AP.innerHTML = pm ? "pm" : "am"; } H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; M.innerHTML = (mins < 10) ? ("0" + mins) : mins; }; cal.onUpdateTime = function() { var date = this.date; var h = parseInt(H.innerHTML, 10); if (t12) { if (/pm/i.test(AP.innerHTML) && h < 12) h += 12; else if (/am/i.test(AP.innerHTML) && h == 12) h = 0; } var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); date.setHours(h); date.setMinutes(parseInt(M.innerHTML, 10)); date.setFullYear(y); date.setMonth(m); date.setDate(d); this.dateClicked = false; this.callHandler(); }; })(); } else { this.onSetTime = this.onUpdateTime = function() {}; } var tfoot = Calendar.createElement("tfoot", table); row = Calendar.createElement("tr", tfoot); row.className = "footrow"; cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); cell.className = "ttip"; if (this.isPopup) { cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; cell.style.cursor = "move"; } this.tooltips = cell; div = Calendar.createElement("div", this.element); this.monthsCombo = div; div.className = "combo"; for (i = 0; i < Calendar._MN.length; ++i) { var mn = Calendar.createElement("div"); mn.className = Calendar.is_ie ? "label-IEfix" : "label"; mn.month = i; mn.innerHTML = Calendar._SMN[i]; div.appendChild(mn); } div = Calendar.createElement("div", this.element); this.yearsCombo = div; div.className = "combo"; for (i = 12; i > 0; --i) { var yr = Calendar.createElement("div"); yr.className = Calendar.is_ie ? "label-IEfix" : "label"; div.appendChild(yr); } this._init(this.firstDayOfWeek, this.date); parent.appendChild(this.element); }; /** keyboard navigation, only for popup calendars */ Calendar._keyEvent = function(ev) { var cal = window._dynarch_popupCalendar; if (!cal || cal.multiple) return false; (Calendar.is_ie) && (ev = window.event); var act = (Calendar.is_ie || ev.type == "keypress"), K = ev.keyCode; if (ev.ctrlKey) { switch (K) { case 37: // KEY left act && Calendar.cellClick(cal._nav_pm); break; case 38: // KEY up act && Calendar.cellClick(cal._nav_py); break; case 39: // KEY right act && Calendar.cellClick(cal._nav_nm); break; case 40: // KEY down act && Calendar.cellClick(cal._nav_ny); break; default: return false; } } else switch (K) { case 32: // KEY space (now) Calendar.cellClick(cal._nav_now); break; case 27: // KEY esc act && cal.callCloseHandler(); break; case 37: // KEY left case 38: // KEY up case 39: // KEY right case 40: // KEY down if (act) { var prev, x, y, ne, el, step; prev = K == 37 || K == 38; step = (K == 37 || K == 39) ? 1 : 7; function setVars() { el = cal.currentDateEl; var p = el.pos; x = p & 15; y = p >> 4; ne = cal.ar_days[y][x]; };setVars(); function prevMonth() { var date = new Date(cal.date); date.setDate(date.getDate() - step); cal.setDate(date); }; function nextMonth() { var date = new Date(cal.date); date.setDate(date.getDate() + step); cal.setDate(date); }; while (1) { switch (K) { case 37: // KEY left if (--x >= 0) ne = cal.ar_days[y][x]; else { x = 6; K = 38; continue; } break; case 38: // KEY up if (--y >= 0) ne = cal.ar_days[y][x]; else { prevMonth(); setVars(); } break; case 39: // KEY right if (++x < 7) ne = cal.ar_days[y][x]; else { x = 0; K = 40; continue; } break; case 40: // KEY down if (++y < cal.ar_days.length) ne = cal.ar_days[y][x]; else { nextMonth(); setVars(); } break; } break; } if (ne) { if (!ne.disabled) Calendar.cellClick(ne); else if (prev) prevMonth(); else nextMonth(); } } break; case 13: // KEY enter if (act) Calendar.cellClick(cal.currentDateEl, ev); break; default: return false; } return Calendar.stopEvent(ev); }; /** * (RE)Initializes the calendar to the given date and firstDayOfWeek */ Calendar.prototype._init = function (firstDayOfWeek, date) { var today = new Date(), TY = today.getFullYear(), TM = today.getMonth(), TD = today.getDate(); this.table.style.visibility = "hidden"; var year = date.getFullYear(); if (year < this.minYear) { year = this.minYear; date.setFullYear(year); } else if (year > this.maxYear) { year = this.maxYear; date.setFullYear(year); } this.firstDayOfWeek = firstDayOfWeek; this.date = new Date(date); var month = date.getMonth(); var mday = date.getDate(); var no_days = date.getMonthDays(); // calendar voodoo for computing the first day that would actually be // displayed in the calendar, even if it's from the previous month. // WARNING: this is magic. ;-) date.setDate(1); var day1 = (date.getDay() - this.firstDayOfWeek) % 7; if (day1 < 0) day1 += 7; date.setDate(-day1); date.setDate(date.getDate() + 1); var row = this.tbody.firstChild; var MN = Calendar._SMN[month]; var ar_days = this.ar_days = new Array(); var weekend = Calendar._TT["WEEKEND"]; var dates = this.multiple ? (this.datesCells = {}) : null; for (var i = 0; i < 6; ++i, row = row.nextSibling) { var cell = row.firstChild; if (this.weekNumbers) { cell.className = "day wn"; cell.innerHTML = date.getWeekNumber(); cell = cell.nextSibling; } row.className = "daysrow"; var hasdays = false, iday, dpos = ar_days[i] = []; for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { iday = date.getDate(); var wday = date.getDay(); cell.className = "day"; cell.pos = i << 4 | j; dpos[j] = cell; var current_month = (date.getMonth() == month); if (!current_month) { if (this.showsOtherMonths) { cell.className += " othermonth"; cell.otherMonth = true; } else { cell.className = "emptycell"; cell.innerHTML = "&nbsp;"; cell.disabled = true; continue; } } else { cell.otherMonth = false; hasdays = true; } cell.disabled = false; cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; if (dates) dates[date.print("%Y%m%d")] = cell; if (this.getDateStatus) { var status = this.getDateStatus(date, year, month, iday); if (this.getDateToolTip) { var toolTip = this.getDateToolTip(date, year, month, iday); if (toolTip) cell.title = toolTip; } if (status === true) { cell.className += " disabled"; cell.disabled = true; } else { if (/disabled/i.test(status)) cell.disabled = true; cell.className += " " + status; } } if (!cell.disabled) { cell.caldate = new Date(date); cell.ttip = "_"; if (!this.multiple && current_month && iday == mday && this.hiliteToday) { cell.className += " selected"; this.currentDateEl = cell; } if (date.getFullYear() == TY && date.getMonth() == TM && iday == TD) { cell.className += " today"; cell.ttip += Calendar._TT["PART_TODAY"]; } if (weekend.indexOf(wday.toString()) != -1) cell.className += cell.otherMonth ? " oweekend" : " weekend"; } } if (!(hasdays || this.showsOtherMonths)) row.className = "emptyrow"; } this.title.innerHTML = Calendar._MN[month] + ", " + year; this.onSetTime(); this.table.style.visibility = "visible"; this._initMultipleDates(); // PROFILE // this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms"; }; Calendar.prototype._initMultipleDates = function() { if (this.multiple) { for (var i in this.multiple) { var cell = this.datesCells[i]; var d = this.multiple[i]; if (!d) continue; if (cell) cell.className += " selected"; } } }; Calendar.prototype._toggleMultipleDate = function(date) { if (this.multiple) { var ds = date.print("%Y%m%d"); var cell = this.datesCells[ds]; if (cell) { var d = this.multiple[ds]; if (!d) { Calendar.addClass(cell, "selected"); this.multiple[ds] = date; } else { Calendar.removeClass(cell, "selected"); delete this.multiple[ds]; } } } }; Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { this.getDateToolTip = unaryFunction; }; /** * Calls _init function above for going to a certain date (but only if the * date is different than the currently selected one). */ Calendar.prototype.setDate = function (date) { if (!date.equalsTo(this.date)) { this._init(this.firstDayOfWeek, date); } }; /** * Refreshes the calendar. Useful if the "disabledHandler" function is * dynamic, meaning that the list of disabled date can change at runtime. * Just * call this function if you think that the list of disabled dates * should * change. */ Calendar.prototype.refresh = function () { this._init(this.firstDayOfWeek, this.date); }; /** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */ Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { this._init(firstDayOfWeek, this.date); this._displayWeekdays(); }; /** * Allows customization of what dates are enabled. The "unaryFunction" * parameter must be a function object that receives the date (as a JS Date * object) and returns a boolean value. If the returned value is true then * the passed date will be marked as disabled. */ Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { this.getDateStatus = unaryFunction; }; /** Customization of allowed year range for the calendar. */ Calendar.prototype.setRange = function (a, z) { this.minYear = a; this.maxYear = z; }; /** Calls the first user handler (selectedHandler). */ Calendar.prototype.callHandler = function () { if (this.onSelected) { this.onSelected(this, this.date.print(this.dateFormat)); } }; /** Calls the second user handler (closeHandler). */ Calendar.prototype.callCloseHandler = function () { if (this.onClose) { this.onClose(this); } this.hideShowCovered(); }; /** Removes the calendar object from the DOM tree and destroys it. */ Calendar.prototype.destroy = function () { var el = this.element.parentNode; el.removeChild(this.element); Calendar._C = null; window._dynarch_popupCalendar = null; }; /** * Moves the calendar element to a different section in the DOM tree (changes * its parent). */ Calendar.prototype.reparent = function (new_parent) { var el = this.element; el.parentNode.removeChild(el); new_parent.appendChild(el); }; // This gets called when the user presses a mouse button anywhere in the // document, if the calendar is shown. If the click was outside the open // calendar this function closes it. Calendar._checkCalendar = function(ev) { var calendar = window._dynarch_popupCalendar; if (!calendar) { return false; } var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); for (; el != null && el != calendar.element; el = el.parentNode); if (el == null) { // calls closeHandler which should hide the calendar. window._dynarch_popupCalendar.callCloseHandler(); return Calendar.stopEvent(ev); } }; /** Shows the calendar. */ Calendar.prototype.show = function () { var rows = this.table.getElementsByTagName("tr"); for (var i = rows.length; i > 0;) { var row = rows[--i]; Calendar.removeClass(row, "rowhilite"); var cells = row.getElementsByTagName("td"); for (var j = cells.length; j > 0;) { var cell = cells[--j]; Calendar.removeClass(cell, "hilite"); Calendar.removeClass(cell, "active"); } } this.element.style.display = "block"; this.hidden = false; if (this.isPopup) { window._dynarch_popupCalendar = this; Calendar.addEvent(document, "keydown", Calendar._keyEvent); Calendar.addEvent(document, "keypress", Calendar._keyEvent); Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); } this.hideShowCovered(); }; /** * Hides the calendar. Also removes any "hilite" from the class of any TD * element. */ Calendar.prototype.hide = function () { if (this.isPopup) { Calendar.removeEvent(document, "keydown", Calendar._keyEvent); Calendar.removeEvent(document, "keypress", Calendar._keyEvent); Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); } this.element.style.display = "none"; this.hidden = true; this.hideShowCovered(); }; /** * Shows the calendar at a given absolute position (beware that, depending on * the calendar element style -- position property -- this might be relative * to the parent's containing rectangle). */ Calendar.prototype.showAt = function (x, y) { var s = this.element.style; s.left = x + "px"; s.top = y + "px"; this.show(); }; /** Shows the calendar near a given element. */ Calendar.prototype.showAtElement = function (el, opts) { var self = this; var p = Calendar.getAbsolutePos(el); if (!opts || typeof opts != "string") { this.showAt(p.x, p.y + el.offsetHeight); return true; } function fixPosition(box) { if (box.x < 0) box.x = 0; if (box.y < 0) box.y = 0; var cp = document.createElement("div"); var s = cp.style; s.position = "absolute"; s.right = s.bottom = s.width = s.height = "0px"; document.body.appendChild(cp); var br = Calendar.getAbsolutePos(cp); document.body.removeChild(cp); if (Calendar.is_ie) { br.y += document.body.scrollTop; br.x += document.body.scrollLeft; } else { br.y += window.scrollY; br.x += window.scrollX; } var tmp = box.x + box.width - br.x; if (tmp > 0) box.x -= tmp; tmp = box.y + box.height - br.y; if (tmp > 0) box.y -= tmp; }; this.element.style.display = "block"; Calendar.continuation_for_the_fucking_khtml_browser = function() { var w = self.element.offsetWidth; var h = self.element.offsetHeight; self.element.style.display = "none"; var valign = opts.substr(0, 1); var halign = "l"; if (opts.length > 1) { halign = opts.substr(1, 1); } // vertical alignment switch (valign) { case "T": p.y -= h; break; case "B": p.y += el.offsetHeight; break; case "C": p.y += (el.offsetHeight - h) / 2; break; case "t": p.y += el.offsetHeight - h; break; case "b": break; // already there } // horizontal alignment switch (halign) { case "L": p.x -= w; break; case "R": p.x += el.offsetWidth; break; case "C": p.x += (el.offsetWidth - w) / 2; break; case "l": p.x += el.offsetWidth - w; break; case "r": break; // already there } p.width = w; p.height = h + 40; self.monthsCombo.style.display = "none"; fixPosition(p); self.showAt(p.x, p.y); }; if (Calendar.is_khtml) setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); else Calendar.continuation_for_the_fucking_khtml_browser(); }; /** Customizes the date format. */ Calendar.prototype.setDateFormat = function (str) { this.dateFormat = str; }; /** Customizes the tooltip date format. */ Calendar.prototype.setTtDateFormat = function (str) { this.ttDateFormat = str; }; /** * Tries to identify the date represented in a string. If successful it also * calls this.setDate which moves the calendar to the given date. */ Calendar.prototype.parseDate = function(str, fmt) { if (!fmt) fmt = this.dateFormat; this.setDate(Date.parseDate(str, fmt)); }; Calendar.prototype.hideShowCovered = function () { if (!Calendar.is_ie && !Calendar.is_opera) return; function getVisib(obj){ var value = obj.style.visibility; if (!value) { if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C if (!Calendar.is_khtml) value = document.defaultView. getComputedStyle(obj, "").getPropertyValue("visibility"); else value = ''; } else if (obj.currentStyle) { // IE value = obj.currentStyle.visibility; } else value = ''; } return value; }; var tags = new Array("applet", "iframe", "select"); var el = this.element; var p = Calendar.getAbsolutePos(el); var EX1 = p.x; var EX2 = el.offsetWidth + EX1; var EY1 = p.y; var EY2 = el.offsetHeight + EY1; for (var k = tags.length; k > 0; ) { var ar = document.getElementsByTagName(tags[--k]); var cc = null; for (var i = ar.length; i > 0;) { cc = ar[--i]; p = Calendar.getAbsolutePos(cc); var CX1 = p.x; var CX2 = cc.offsetWidth + CX1; var CY1 = p.y; var CY2 = cc.offsetHeight + CY1; if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { if (!cc.__msh_save_visibility) { cc.__msh_save_visibility = getVisib(cc); } cc.style.visibility = cc.__msh_save_visibility; } else { if (!cc.__msh_save_visibility) { cc.__msh_save_visibility = getVisib(cc); } cc.style.visibility = "hidden"; } } } }; /** Internal function; it displays the bar with the names of the weekday. */ Calendar.prototype._displayWeekdays = function () { var fdow = this.firstDayOfWeek; var cell = this.firstdayname; var weekend = Calendar._TT["WEEKEND"]; for (var i = 0; i < 7; ++i) { cell.className = "day name"; var realday = (i + fdow) % 7; if (i) { cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); cell.navtype = 100; cell.calendar = this; cell.fdow = realday; Calendar._add_evs(cell); } if (weekend.indexOf(realday.toString()) != -1) { Calendar.addClass(cell, "weekend"); } cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; cell = cell.nextSibling; } }; /** Internal function. Hides all combo boxes that might be displayed. */ Calendar.prototype._hideCombos = function () { this.monthsCombo.style.display = "none"; this.yearsCombo.style.display = "none"; }; /** Internal function. Starts dragging the element. */ Calendar.prototype._dragStart = function (ev) { if (this.dragging) { return; } this.dragging = true; var posX; var posY; if (Calendar.is_ie) { posY = window.event.clientY + document.body.scrollTop; posX = window.event.clientX + document.body.scrollLeft; } else { posY = ev.clientY + window.scrollY; posX = ev.clientX + window.scrollX; } var st = this.element.style; this.xOffs = posX - parseInt(st.left); this.yOffs = posY - parseInt(st.top); with (Calendar) { addEvent(document, "mousemove", calDragIt); addEvent(document, "mouseup", calDragEnd); } }; // BEGIN: DATE OBJECT PATCHES /** Adds the number of days array to the Date object. */ Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); /** Constants used for time computations */ Date.SECOND = 1000 /* milliseconds */; Date.MINUTE = 60 * Date.SECOND; Date.HOUR = 60 * Date.MINUTE; Date.DAY = 24 * Date.HOUR; Date.WEEK = 7 * Date.DAY; Date.parseDate = function(str, fmt) { var today = new Date(); var y = 0; var m = -1; var d = 0; var a = str.split(/\W+/); var b = fmt.match(/%./g); var i = 0, j = 0; var hr = 0; var min = 0; for (i = 0; i < a.length; ++i) { if (!a[i]) continue; switch (b[i]) { case "%d": case "%e": d = parseInt(a[i], 10); break; case "%m": m = parseInt(a[i], 10) - 1; break; case "%Y": case "%y": y = parseInt(a[i], 10); (y < 100) && (y += (y > 29) ? 1900 : 2000); break; case "%b": case "%B": for (j = 0; j < 12; ++j) { if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } } break; case "%H": case "%I": case "%k": case "%l": hr = parseInt(a[i], 10); break; case "%P": case "%p": if (/pm/i.test(a[i]) && hr < 12) hr += 12; else if (/am/i.test(a[i]) && hr >= 12) hr -= 12; break; case "%M": min = parseInt(a[i], 10); break; } } if (isNaN(y)) y = today.getFullYear(); if (isNaN(m)) m = today.getMonth(); if (isNaN(d)) d = today.getDate(); if (isNaN(hr)) hr = today.getHours(); if (isNaN(min)) min = today.getMinutes(); if (y != 0 && m != -1 && d != 0) return new Date(y, m, d, hr, min, 0); y = 0; m = -1; d = 0; for (i = 0; i < a.length; ++i) { if (a[i].search(/[a-zA-Z]+/) != -1) { var t = -1; for (j = 0; j < 12; ++j) { if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } } if (t != -1) { if (m != -1) { d = m+1; } m = t; } } else if (parseInt(a[i], 10) <= 12 && m == -1) { m = a[i]-1; } else if (parseInt(a[i], 10) > 31 && y == 0) { y = parseInt(a[i], 10); (y < 100) && (y += (y > 29) ? 1900 : 2000); } else if (d == 0) { d = a[i]; } } if (y == 0) y = today.getFullYear(); if (m != -1 && d != 0) return new Date(y, m, d, hr, min, 0); return today; }; /** Returns the number of days in the current month */ Date.prototype.getMonthDays = function(month) { var year = this.getFullYear(); if (typeof month == "undefined") { month = this.getMonth(); } if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { return 29; } else { return Date._MD[month]; } }; /** Returns the number of day in the year. */ Date.prototype.getDayOfYear = function() { var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); var time = now - then; return Math.floor(time / Date.DAY); }; /** Returns the number of the week in year, as defined in ISO 8601. */ Date.prototype.getWeekNumber = function() { var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); var DoW = d.getDay(); d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu var ms = d.valueOf(); // GMT d.setMonth(0); d.setDate(4); // Thu in Week 1 return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; }; /** Checks date and time equality */ Date.prototype.equalsTo = function(date) { return ((this.getFullYear() == date.getFullYear()) && (this.getMonth() == date.getMonth()) && (this.getDate() == date.getDate()) && (this.getHours() == date.getHours()) && (this.getMinutes() == date.getMinutes())); }; /** Set only the year, month, date parts (keep existing time) */ Date.prototype.setDateOnly = function(date) { var tmp = new Date(date); this.setDate(1); this.setFullYear(tmp.getFullYear()); this.setMonth(tmp.getMonth()); this.setDate(tmp.getDate()); }; /** Prints the date in a string according to the given format. */ Date.prototype.print = function (str) { var m = this.getMonth(); var d = this.getDate(); var y = this.getFullYear(); var wn = this.getWeekNumber(); var w = this.getDay(); var s = {}; var hr = this.getHours(); var pm = (hr >= 12); var ir = (pm) ? (hr - 12) : hr; var dy = this.getDayOfYear(); if (ir == 0) ir = 12; var min = this.getMinutes(); var sec = this.getSeconds(); s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N] s["%A"] = Calendar._DN[w]; // full weekday name s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N] s["%B"] = Calendar._MN[m]; // full month name // FIXME: %c : preferred date and time representation for the current locale s["%C"] = 1 + Math.floor(y / 100); // the century number s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) s["%e"] = d; // the day of the month (range 1 to 31) // FIXME: %D : american date style: %m/%d/%y // FIXME: %E, %F, %G, %g, %h (man strftime) s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format) s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format) s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366) s["%k"] = hr; // hour, range 0 to 23 (24h format) s["%l"] = ir; // hour, range 1 to 12 (12h format) s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12 s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59 s["%n"] = "\n"; // a newline character s["%p"] = pm ? "PM" : "AM"; s["%P"] = pm ? "pm" : "am"; // FIXME: %r : the time in am/pm notation %I:%M:%S %p // FIXME: %R : the time in 24-hour notation %H:%M s["%s"] = Math.floor(this.getTime() / 1000); s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59 s["%t"] = "\t"; // a tab character // FIXME: %T : the time in 24-hour notation (%H:%M:%S) s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON) s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN) // FIXME: %x : preferred date representation for the current locale without the time // FIXME: %X : preferred time representation for the current locale without the date s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99) s["%Y"] = y; // year with the century s["%%"] = "%"; // a literal '%' character var re = /%./g; if (!Calendar.is_ie5 && !Calendar.is_khtml) return str.replace(re, function (par) { return s[par] || par; }); var a = str.match(re); for (var i = 0; i < a.length; i++) { var tmp = s[a[i]]; if (tmp) { re = new RegExp(a[i], 'g'); str = str.replace(re, tmp); } } return str; }; Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; Date.prototype.setFullYear = function(y) { var d = new Date(this); d.__msh_oldSetFullYear(y); if (d.getMonth() != this.getMonth()) this.setDate(28); this.__msh_oldSetFullYear(y); }; // END: DATE OBJECT PATCHES // global object that remembers the calendar window._dynarch_popupCalendar = null;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-datetime.js
jquery-datetime.js
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a= this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"); this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(), e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight|| e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false", "aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16", animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/); f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide", paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); ;/* * jQuery UI Autocomplete 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.position.js */ (function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g= false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!= a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)}; this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&& a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"); d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&& b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source= this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close(); this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label|| b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this; d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery); (function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", -1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id"); this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b, this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active|| this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery); ;/* * jQuery UI Button 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Button * * Depends: * jquery.ui.core.js * jquery.ui.widget.js */ (function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!== "boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover"); this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g= false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed","true"); var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE|| d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type=== "radio"){var a=this.element.parents().filter(":last"),c="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element}, widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title"); b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true"):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"), c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only": "ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")=== "ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); b.Widget.prototype.destroy.call(this)}})})(jQuery); ;/* * jQuery UI Dialog 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog * * Depends: * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.button.js * jquery.ui.draggable.js * jquery.ui.mouse.js * jquery.ui.position.js * jquery.ui.resizable.js */ (function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id", e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1; d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): [a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||"&#160;"));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&!d.isDefaultPrevented()&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()|| c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&& c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+ "px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery); ;/* * jQuery UI Slider 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Slider * * Depends: * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js */ (function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+ this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>"); this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length? (h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i- m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false; this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c}); a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value= this._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this._value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a): this.value();else return this._values()},_setOption:function(a,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation(); this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a]; return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e- g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"}, b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); ;/* * jQuery UI Datepicker 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker * * Depends: * jquery.ui.core.js */ (function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass= "ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su", "Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout", function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv}, setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c== "focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker(): d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a, b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+= 1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ 2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b= d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a, "datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f== a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"? d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e); this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl"); b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}else d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target, a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c= a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b, "stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode); return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input", a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value= "";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b); c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing= true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}); a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&& !a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(), h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b= this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, _checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): 0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"? "Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a); this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField"); if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"? b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D= o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s= function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position "+q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s();else switch(a.charAt(A)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+ 1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd", COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames: null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()- (new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f= 0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a); var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date; i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g= Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()> 12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m, g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&& a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+ B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O= "";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&& x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()== P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+ r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>': "");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&& (!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ (c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, "dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== "string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery); ;/* * jQuery UI Progressbar 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar * * Depends: * jquery.ui.core.js * jquery.ui.widget.js */ (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery); ;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-ui-widgets-1.8.16.min.js
jquery-ui-widgets-1.8.16.min.js
(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.3",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* * jQuery UI Dialog 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Dialog * * Depends: * ui.core.js * ui.draggable.js * ui.resizable.js */ (function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||"&nbsp;",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||"&nbsp;");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.3",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/* * jQuery UI Slider 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Slider * * Depends: * ui.core.js */ (function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.3",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* * jQuery UI Datepicker 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Datepicker * * Depends: * ui.core.js */ (function($){$.extend($.ui,{datepicker:{version:"1.7.3"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?"&#xa0;":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?"&#xa0;":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.3";window.DP_jQuery=$})(jQuery);;/* * jQuery UI Progressbar 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Progressbar * * Depends: * ui.core.js */ (function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.3",defaults:{value:0}})})(jQuery);;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-ui-widgets-1.7.3.min.js
jquery-ui-widgets-1.7.3.min.js
(function( jQuery, window, undefined ) { // See http://bugs.jquery.com/ticket/13335 // "use strict"; var warnedAbout = {}; // List of warnings already given; public read only jQuery.migrateWarnings = []; // Set to true to prevent console output; migrateWarnings still maintained // jQuery.migrateMute = false; // Show a message on the console so devs know we're active if ( !jQuery.migrateMute && window.console && console.log ) { console.log("JQMIGRATE: Logging is active"); } // Set to false to disable traces that appear with warnings if ( jQuery.migrateTrace === undefined ) { jQuery.migrateTrace = true; } // Forget any warnings we've already given; public jQuery.migrateReset = function() { warnedAbout = {}; jQuery.migrateWarnings.length = 0; }; function migrateWarn( msg) { if ( !warnedAbout[ msg ] ) { warnedAbout[ msg ] = true; jQuery.migrateWarnings.push( msg ); if ( window.console && console.warn && !jQuery.migrateMute ) { console.warn( "JQMIGRATE: " + msg ); if ( jQuery.migrateTrace && console.trace ) { console.trace(); } } } } function migrateWarnProp( obj, prop, value, msg ) { if ( Object.defineProperty ) { // On ES5 browsers (non-oldIE), warn if the code tries to get prop; // allow property to be overwritten in case some other plugin wants it try { Object.defineProperty( obj, prop, { configurable: true, enumerable: true, get: function() { migrateWarn( msg ); return value; }, set: function( newValue ) { migrateWarn( msg ); value = newValue; } }); return; } catch( err ) { // IE8 is a dope about Object.defineProperty, can't warn there } } // Non-ES5 (or broken) browser; just set the property jQuery._definePropertyBroken = true; obj[ prop ] = value; } if ( document.compatMode === "BackCompat" ) { // jQuery has never supported or tested Quirks Mode migrateWarn( "jQuery is not compatible with Quirks Mode" ); } var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn, oldAttr = jQuery.attr, valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || function() { return null; }, valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || function() { return undefined; }, rnoType = /^(?:input|button)$/i, rnoAttrNodeType = /^[238]$/, rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, ruseDefault = /^(?:checked|selected)$/i; // jQuery.attrFn migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" ); jQuery.attr = function( elem, name, value, pass ) { var lowerName = name.toLowerCase(), nType = elem && elem.nodeType; if ( pass ) { // Since pass is used internally, we only warn for new jQuery // versions where there isn't a pass arg in the formal params if ( oldAttr.length < 4 ) { migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); } if ( elem && !rnoAttrNodeType.test( nType ) && (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) { return jQuery( elem )[ name ]( value ); } } // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking // for disconnected elements we don't warn on $( "<button>", { type: "button" } ). if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) { migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8"); } // Restore boolHook for boolean property/attribute synchronization if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) { jQuery.attrHooks[ lowerName ] = { get: function( elem, name ) { // Align boolean attributes with corresponding properties // Fall back to attribute presence where some booleans are not supported var attrNode, property = jQuery.prop( elem, name ); return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? name.toLowerCase() : undefined; }, set: function( elem, value, name ) { var propName; if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else { // value is true since we know at this point it's type boolean and not false // Set boolean attributes to the same name and set the DOM property propName = jQuery.propFix[ name ] || name; if ( propName in elem ) { // Only set the IDL specifically if it already exists on the element elem[ propName ] = true; } elem.setAttribute( name, name.toLowerCase() ); } return name; } }; // Warn only for attributes that can remain distinct from their properties post-1.9 if ( ruseDefault.test( lowerName ) ) { migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" ); } } return oldAttr.call( jQuery, elem, name, value ); }; // attrHooks: value jQuery.attrHooks.value = { get: function( elem, name ) { var nodeName = ( elem.nodeName || "" ).toLowerCase(); if ( nodeName === "button" ) { return valueAttrGet.apply( this, arguments ); } if ( nodeName !== "input" && nodeName !== "option" ) { migrateWarn("jQuery.fn.attr('value') no longer gets properties"); } return name in elem ? elem.value : null; }, set: function( elem, value ) { var nodeName = ( elem.nodeName || "" ).toLowerCase(); if ( nodeName === "button" ) { return valueAttrSet.apply( this, arguments ); } if ( nodeName !== "input" && nodeName !== "option" ) { migrateWarn("jQuery.fn.attr('value', val) no longer sets properties"); } // Does not return so that setAttribute is also used elem.value = value; } }; var matched, browser, oldInit = jQuery.fn.init, oldParseJSON = jQuery.parseJSON, // Note this does NOT include the #9521 XSS fix from 1.7! rquickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*|#([\w\-]*))$/; // $(html) "looks like html" rule change jQuery.fn.init = function( selector, context, rootjQuery ) { var match; if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) && (match = rquickExpr.exec( selector )) && match[1] ) { // This is an HTML string according to the "old" rules; is it still? if ( selector.charAt( 0 ) !== "<" ) { migrateWarn("$(html) HTML strings must start with '<' character"); } // Now process using loose rules; let pre-1.8 play too if ( context && context.context ) { // jQuery object as context; parseHTML expects a DOM object context = context.context; } if ( jQuery.parseHTML ) { return oldInit.call( this, jQuery.parseHTML( jQuery.trim(selector), context, true ), context, rootjQuery ); } } return oldInit.apply( this, arguments ); }; jQuery.fn.init.prototype = jQuery.fn; // Let $.parseJSON(falsy_value) return null jQuery.parseJSON = function( json ) { if ( !json && json !== null ) { migrateWarn("jQuery.parseJSON requires a valid JSON string"); return null; } return oldParseJSON.apply( this, arguments ); }; jQuery.uaMatch = function( ua ) { ua = ua.toLowerCase(); var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || /(webkit)[ \/]([\w.]+)/.exec( ua ) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || /(msie) ([\w.]+)/.exec( ua ) || ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || []; return { browser: match[ 1 ] || "", version: match[ 2 ] || "0" }; }; // Don't clobber any existing jQuery.browser in case it's different if ( !jQuery.browser ) { matched = jQuery.uaMatch( navigator.userAgent ); browser = {}; if ( matched.browser ) { browser[ matched.browser ] = true; browser.version = matched.version; } // Chrome is Webkit, but Webkit is also Safari. if ( browser.chrome ) { browser.webkit = true; } else if ( browser.webkit ) { browser.safari = true; } jQuery.browser = browser; } // Warn if the code tries to get jQuery.browser migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" ); jQuery.sub = function() { function jQuerySub( selector, context ) { return new jQuerySub.fn.init( selector, context ); } jQuery.extend( true, jQuerySub, this ); jQuerySub.superclass = this; jQuerySub.fn = jQuerySub.prototype = this(); jQuerySub.fn.constructor = jQuerySub; jQuerySub.sub = this.sub; jQuerySub.fn.init = function init( selector, context ) { if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { context = jQuerySub( context ); } return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); }; jQuerySub.fn.init.prototype = jQuerySub.fn; var rootjQuerySub = jQuerySub(document); migrateWarn( "jQuery.sub() is deprecated" ); return jQuerySub; }; // Ensure that $.ajax gets the new parseJSON defined in core.js jQuery.ajaxSetup({ converters: { "text json": jQuery.parseJSON } }); var oldFnData = jQuery.fn.data; jQuery.fn.data = function( name ) { var ret, evt, elem = this[0]; // Handles 1.7 which has this behavior and 1.8 which doesn't if ( elem && name === "events" && arguments.length === 1 ) { ret = jQuery.data( elem, name ); evt = jQuery._data( elem, name ); if ( ( ret === undefined || ret === evt ) && evt !== undefined ) { migrateWarn("Use of jQuery.fn.data('events') is deprecated"); return evt; } } return oldFnData.apply( this, arguments ); }; var rscriptType = /\/(java|ecma)script/i, oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; jQuery.fn.andSelf = function() { migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"); return oldSelf.apply( this, arguments ); }; // Since jQuery.clean is used internally on older versions, we only shim if it's missing if ( !jQuery.clean ) { jQuery.clean = function( elems, context, fragment, scripts ) { // Set context per 1.8 logic context = context || document; context = !context.nodeType && context[0] || context; context = context.ownerDocument || context; migrateWarn("jQuery.clean() is deprecated"); var i, elem, handleScript, jsTags, ret = []; jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes ); // Complex logic lifted directly from jQuery 1.8 if ( fragment ) { // Special handling of each script element handleScript = function( elem ) { // Check if we consider it executable if ( !elem.type || rscriptType.test( elem.type ) ) { // Detach the script and store it in the scripts array (if provided) or the fragment // Return truthy to indicate that it has been handled return scripts ? scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) : fragment.appendChild( elem ); } }; for ( i = 0; (elem = ret[i]) != null; i++ ) { // Check if we're done after handling an executable script if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) { // Append to fragment and handle embedded scripts fragment.appendChild( elem ); if ( typeof elem.getElementsByTagName !== "undefined" ) { // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript ); // Splice the scripts into ret after their former ancestor and advance our index beyond them ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) ); i += jsTags.length; } } } } return ret; }; } var eventAdd = jQuery.event.add, eventRemove = jQuery.event.remove, eventTrigger = jQuery.event.trigger, oldToggle = jQuery.fn.toggle, oldLive = jQuery.fn.live, oldDie = jQuery.fn.die, ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess", rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ), rhoverHack = /(?:^|\s)hover(\.\S+|)\b/, hoverHack = function( events ) { if ( typeof( events ) !== "string" || jQuery.event.special.hover ) { return events; } if ( rhoverHack.test( events ) ) { migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"); } return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); }; // Event props removed in 1.9, put them back if needed; no practical way to warn them if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) { jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" ); } // Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7 if ( jQuery.event.dispatch ) { migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" ); } // Support for 'hover' pseudo-event and ajax event warnings jQuery.event.add = function( elem, types, handler, data, selector ){ if ( elem !== document && rajaxEvent.test( types ) ) { migrateWarn( "AJAX events should be attached to document: " + types ); } eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector ); }; jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){ eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes ); }; jQuery.fn.error = function() { var args = Array.prototype.slice.call( arguments, 0); migrateWarn("jQuery.fn.error() is deprecated"); args.splice( 0, 0, "error" ); if ( arguments.length ) { return this.bind.apply( this, args ); } // error event should not bubble to window, although it does pre-1.7 this.triggerHandler.apply( this, args ); return this; }; jQuery.fn.toggle = function( fn, fn2 ) { // Don't mess with animation or css toggles if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) { return oldToggle.apply( this, arguments ); } migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated"); // Save reference to arguments for access in closure var args = arguments, guid = fn.guid || jQuery.guid++, i = 0, toggler = function( event ) { // Figure out which function to execute var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function return args[ lastToggle ].apply( this, arguments ) || false; }; // link all the functions, so any of them can unbind this click handler toggler.guid = guid; while ( i < args.length ) { args[ i++ ].guid = guid; } return this.click( toggler ); }; jQuery.fn.live = function( types, data, fn ) { migrateWarn("jQuery.fn.live() is deprecated"); if ( oldLive ) { return oldLive.apply( this, arguments ); } jQuery( this.context ).on( types, this.selector, data, fn ); return this; }; jQuery.fn.die = function( types, fn ) { migrateWarn("jQuery.fn.die() is deprecated"); if ( oldDie ) { return oldDie.apply( this, arguments ); } jQuery( this.context ).off( types, this.selector || "**", fn ); return this; }; // Turn global events into document-triggered events jQuery.event.trigger = function( event, data, elem, onlyHandlers ){ if ( !elem && !rajaxEvent.test( event ) ) { migrateWarn( "Global events are undocumented and deprecated" ); } return eventTrigger.call( this, event, data, elem || document, onlyHandlers ); }; jQuery.each( ajaxEvents.split("|"), function( _, name ) { jQuery.event.special[ name ] = { setup: function() { var elem = this; // The document needs no shimming; must be !== for oldIE if ( elem !== document ) { jQuery.event.add( document, name + "." + jQuery.guid, function() { jQuery.event.trigger( name, null, elem, true ); }); jQuery._data( this, name, jQuery.guid++ ); } return false; }, teardown: function() { if ( this !== document ) { jQuery.event.remove( document, name + "." + jQuery._data( this, name ) ); } return false; } }; } ); })( jQuery, window );
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-migrate-1.1.1.js
jquery-migrate-1.1.1.js
(function($) { /** * i18n provides a mechanism for translating strings using a jscript dictionary. * */ /* * i18n property list */ $.i18n = { dict: null, /** * setDictionary() * Initialise the dictionary and translate nodes * * @param property_list i18n_dict : The dictionary to use for translation */ setDictionary: function(i18n_dict) { this.dict = i18n_dict; }, /** * _() * The actual translation function. Looks the given string up in the * dictionary and returns the translation if one exists. If a translation * is not found, returns the original word * * @param string str : The string to translate * @param property_list params : params for using printf() on the string * @return string : Translated word * */ _: function (str, params) { var transl = str; if (this.dict && this.dict[str]) { transl = this.dict[str]; } return this.printf(transl, params); }, /** * toEntity() * Change non-ASCII characters to entity representation * * @param string str : The string to transform * @return string result : Original string with non-ASCII content converted to entities * */ toEntity: function (str) { var result = ''; for (var i=0;i<str.length; i++) { if (str.charCodeAt(i) > 128) result += "&#"+str.charCodeAt(i)+";"; else result += str.charAt(i); } return result; }, /** * stripStr() * * @param string str : The string to strip * @return string result : Stripped string * */ stripStr: function(str) { return str.replace(/^\s*/, "").replace(/\s*$/, ""); }, /** * stripStrML() * * @param string str : The multi-line string to strip * @return string result : Stripped string * */ stripStrML: function(str) { // Split because m flag doesn't exist before JS1.5 and we need to // strip newlines anyway var parts = str.split('\n'); for (var i=0; i<parts.length; i++) parts[i] = stripStr(parts[i]); // Don't join with empty strings, because it "concats" words // And strip again return stripStr(parts.join(" ")); }, /* * printf() * C-printf like function, which substitutes %s with parameters * given in list. %%s is used to escape %s. * * Doesn't work in IE5.0 (splice) * * @param string S : string to perform printf on. * @param string L : Array of arguments for printf() */ printf: function(S, L) { if (!L) return S; var nS = ""; var search = /%(\d+)\$s/g; // replace %n1$ where n is a number while (result = search.exec(S)) { var index = parseInt(result[1], 10) - 1; S = S.replace('%' + result[1] + '\$s', (L[index])); L.splice(index, 1); } var tS = S.split("%s"); if (tS.length > 1) { for(var i=0; i<L.length; i++) { if (tS[i].lastIndexOf('%') == tS[i].length-1 && i != L.length-1) tS[i] += "s"+tS.splice(i+1,1)[0]; nS += tS[i] + L[i]; } } return nS + tS[tS.length-1]; } }; /* * _t * Allows you to translate a jQuery selector * * eg $('h1')._t('some text') * * @param string str : The string to translate * @param property_list params : params for using printf() on the string * @return element : chained and translated element(s) */ $.fn._t = function(str, params) { return $(this).text($.i18n._(str, params)); }; })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-i18n.js
jquery-i18n.js
// Create a JSON object only if one does not already exist. We create the // methods in a closure to avoid creating global variables. if (!this.JSON) { this.JSON = {}; } (function () { function f(n) { // Format integers to have at least two digits. return n < 10 ? '0' + n : n; } if (typeof Date.prototype.toJSON !== 'function') { Date.prototype.toJSON = function (key) { return isFinite(this.valueOf()) ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z' : null; }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) { return this.valueOf(); }; } var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = { // table of character substitutions '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"' : '\\"', '\\': '\\\\' }, rep; function quote(string) { // If the string contains no control characters, no quote characters, and no // backslash characters, then we can safely slap some quotes around it. // Otherwise we must also replace the offending characters with safe escape // sequences. escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function (a) { var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + string + '"'; } function str(key, holder) { // Produce a string from holder[key]. var i, // The loop counter. k, // The member key. v, // The member value. length, mind = gap, partial, value = holder[key]; // If the value has a toJSON method, call it to obtain a replacement value. if (value && typeof value === 'object' && typeof value.toJSON === 'function') { value = value.toJSON(key); } // If we were called with a replacer function, then call the replacer to // obtain a replacement value. if (typeof rep === 'function') { value = rep.call(holder, key, value); } // What happens next depends on the value's type. switch (typeof value) { case 'string': return quote(value); case 'number': // JSON numbers must be finite. Encode non-finite numbers as null. return isFinite(value) ? String(value) : 'null'; case 'boolean': case 'null': // If the value is a boolean or null, convert it to a string. Note: // typeof null does not produce 'null'. The case is included here in // the remote chance that this gets fixed someday. return String(value); // If the type is 'object', we might be dealing with an object or an array or // null. case 'object': // Due to a specification blunder in ECMAScript, typeof null is 'object', // so watch out for that case. if (!value) { return 'null'; } // Make an array to hold the partial results of stringifying this object value. gap += indent; partial = []; // Is the value an array? if (Object.prototype.toString.apply(value) === '[object Array]') { // The value is an array. Stringify every element. Use null as a placeholder // for non-JSON values. length = value.length; for (i = 0; i < length; i += 1) { partial[i] = str(i, value) || 'null'; } // Join all of the elements together, separated with commas, and wrap them in // brackets. v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']'; gap = mind; return v; } // If the replacer is an array, use it to select the members to be stringified. if (rep && typeof rep === 'object') { length = rep.length; for (i = 0; i < length; i += 1) { k = rep[i]; if (typeof k === 'string') { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } else { // Otherwise, iterate through all of the keys in the object. for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = str(k, value); if (v) { partial.push(quote(k) + (gap ? ': ' : ':') + v); } } } } // Join all of the member texts together, separated with commas, // and wrap them in braces. v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}'; gap = mind; return v; } } // If the JSON object does not yet have a stringify method, give it one. if (typeof JSON.stringify !== 'function') { JSON.stringify = function (value, replacer, space) { // The stringify method takes a value and an optional replacer, and an optional // space parameter, and returns a JSON text. The replacer can be a function // that can replace values, or an array of strings that will select the keys. // A default replacer method can be provided. Use of the space parameter can // produce text that is more easily readable. var i; gap = ''; indent = ''; // If the space parameter is a number, make an indent string containing that // many spaces. if (typeof space === 'number') { for (i = 0; i < space; i += 1) { indent += ' '; } // If the space parameter is a string, it will be used as the indent string. } else if (typeof space === 'string') { indent = space; } // If there is a replacer, it must be a function or an array. // Otherwise, throw an error. rep = replacer; if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { throw new Error('JSON.stringify'); } // Make a fake root object containing our value under the key of ''. // Return the result of stringifying the value. return str('', {'': value}); }; } // If the JSON object does not yet have a parse method, give it one. if (typeof JSON.parse !== 'function') { JSON.parse = function (text, reviver) { // The parse method takes a text and an optional reviver function, and returns // a JavaScript value if the text is a valid JSON text. var j; function walk(holder, key) { // The walk method is used to recursively walk the resulting structure so // that modifications can be made. var k, v, value = holder[key]; if (value && typeof value === 'object') { for (k in value) { if (Object.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); } // Parsing happens in four stages. In the first stage, we replace certain // Unicode characters with escape sequences. JavaScript handles many characters // incorrectly, either silently deleting them, or treating them as line endings. cx.lastIndex = 0; if (cx.test(text)) { text = text.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } // In the second stage, we run the text against regular expressions that look // for non-JSON patterns. We are especially concerned with '()' and 'new' // because they can cause invocation, and '=' because it can cause mutation. // But just to be safe, we want to reject all unexpected forms. // We split the second stage into 4 regexp operations in order to work around // crippling inefficiencies in IE's and Safari's regexp engines. First we // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we // replace all simple value tokens with ']' characters. Third, we delete all // open brackets that follow a colon or comma or that begin the text. Finally, // we look to see that the remaining characters are only whitespace or ']' or // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. if (/^[\],:{}\s]*$/. test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { // In the third stage we use the eval function to compile the text into a // JavaScript structure. The '{' operator is subject to a syntactic ambiguity // in JavaScript: it can begin a block or an object literal. We wrap the text // in parens to eliminate the ambiguity. j = eval('(' + text + ')'); // In the optional fourth stage, we recursively walk the new structure, passing // each name/value pair to a reviver function for possible transformation. return typeof reviver === 'function' ? walk({'': j}, '') : j; } // If the text is not JSON parseable, then a SyntaxError is thrown. throw new SyntaxError('JSON.parse'); }; } }());
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/json2.js
json2.js
(function($, undefined) { /* TODO: preserve today highlighted */ $.tools = $.tools || {version: '@VERSION'}; var instances = [], formatters = {}, tool, // h=72, j=74, k=75, l=76, down=40, left=37, up=38, right=39 KEYS = [75, 76, 38, 39, 74, 72, 40, 37], LABELS = {}; tool = $.tools.dateinput = { conf: { format: 'mm/dd/yy', formatter: 'default', selectors: false, yearRange: [-5, 5], lang: 'en', offset: [0, 0], speed: 0, firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... min: undefined, max: undefined, trigger: 0, toggle: 0, editable: 0, css: { prefix: 'cal', input: 'date', // ids root: 0, head: 0, title: 0, prev: 0, next: 0, month: 0, year: 0, days: 0, body: 0, weeks: 0, today: 0, current: 0, // classnames week: 0, off: 0, sunday: 0, focus: 0, disabled: 0, trigger: 0 } }, addFormatter: function(name, fn) { formatters[name] = fn; }, localize: function(language, labels) { $.each(labels, function(key, val) { labels[key] = val.split(","); }); LABELS[language] = labels; } }; tool.localize("en", { months: 'January,February,March,April,May,June,July,August,September,October,November,December', shortMonths: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec', days: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday', shortDays: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat' }); //{{{ private functions // @return amount of days in certain month function dayAm(year, month) { return new Date(year, month + 1, 0).getDate(); } function zeropad(val, len) { val = '' + val; len = len || 2; while (val.length < len) { val = "0" + val; } return val; } // thanks: http://stevenlevithan.com/assets/misc/date.format.js var tmpTag = $("<a/>"); function format(formatter, date, text, lang) { var d = date.getDate(), D = date.getDay(), m = date.getMonth(), y = date.getFullYear(), flags = { d: d, dd: zeropad(d), ddd: LABELS[lang].shortDays[D], dddd: LABELS[lang].days[D], m: m + 1, mm: zeropad(m + 1), mmm: LABELS[lang].shortMonths[m], mmmm: LABELS[lang].months[m], yy: String(y).slice(2), yyyy: y }; var ret = formatters[formatter](text, date, flags, lang); // a small trick to handle special characters return tmpTag.html(ret).html(); } tool.addFormatter('default', function(text, date, flags, lang) { return text.replace(/d{1,4}|m{1,4}|yy(?:yy)?|"[^"]*"|'[^']*'/g, function ($0) { return $0 in flags ? flags[$0] : $0; }); }); tool.addFormatter('prefixed', function(text, date, flags, lang) { return text.replace(/%(d{1,4}|m{1,4}|yy(?:yy)?|"[^"]*"|'[^']*')/g, function ($0, $1) { return $1 in flags ? flags[$1] : $0; }); }); function integer(val) { return parseInt(val, 10); } function isSameDay(d1, d2) { return d1.getFullYear() === d2.getFullYear() && d1.getMonth() == d2.getMonth() && d1.getDate() == d2.getDate(); } function parseDate(val) { if (val === undefined) { return; } if (val.constructor == Date) { return val; } if (typeof val == 'string') { // rfc3339? var els = val.split("-"); if (els.length == 3) { return new Date(integer(els[0]), integer(els[1]) -1, integer(els[2])); } // invalid offset if ( !(/^-?\d+$/).test(val) ) { return; } // convert to integer val = integer(val); } var date = new Date; date.setDate(date.getDate() + val); return date; } //}}} function Dateinput(input, conf) { // variables var self = this, now = new Date, yearNow = now.getFullYear(), css = conf.css, labels = LABELS[conf.lang], root = $("#" + css.root), title = root.find("#" + css.title), trigger, pm, nm, currYear, currMonth, currDay, value = input.attr("data-value") || conf.value || input.val(), min = input.attr("min") || conf.min, max = input.attr("max") || conf.max, opened, original; // zero min is not undefined if (min === 0) { min = "0"; } // use sane values for value, min & max value = parseDate(value) || now; min = parseDate(min || new Date(yearNow + conf.yearRange[0], 1, 1)); max = parseDate(max || new Date( yearNow + conf.yearRange[1]+ 1, 1, -1)); // check that language exists if (!labels) { throw "Dateinput: invalid language: " + conf.lang; } // Replace built-in date input: NOTE: input.attr("type", "text") throws exception by the browser if (input.attr("type") == 'date') { var original = input.clone(), def = original.wrap("<div/>").parent().html(), clone = $(def.replace(/type/i, "type=text data-orig-type")); if (conf.value) clone.val(conf.value); // jquery 1.6.2 val(undefined) will clear val() input.replaceWith(clone); input = clone; } input.addClass(css.input); var fire = input.add(self); // construct layout if (!root.length) { // root root = $('<div><div><a/><div/><a/></div><div><div/><div/></div></div>') .hide().css({position: 'absolute'}).attr("id", css.root); // elements root.children() .eq(0).attr("id", css.head).end() .eq(1).attr("id", css.body).children() .eq(0).attr("id", css.days).end() .eq(1).attr("id", css.weeks).end().end().end() .find("a").eq(0).attr("id", css.prev).end().eq(1).attr("id", css.next); // title title = root.find("#" + css.head).find("div").attr("id", css.title); // year & month selectors if (conf.selectors) { var monthSelector = $("<select/>").attr("id", css.month), yearSelector = $("<select/>").attr("id", css.year); title.html(monthSelector.add(yearSelector)); } // day titles var days = root.find("#" + css.days); // days of the week for (var d = 0; d < 7; d++) { days.append($("<span/>").text(labels.shortDays[(d + conf.firstDay) % 7])); } $("body").append(root); } // trigger icon if (conf.trigger) { trigger = $("<a/>").attr("href", "#").addClass(css.trigger).click(function(e) { conf.toggle ? self.toggle() : self.show(); return e.preventDefault(); }).insertAfter(input); } // layout elements var weeks = root.find("#" + css.weeks); yearSelector = root.find("#" + css.year); monthSelector = root.find("#" + css.month); //{{{ pick function select(date, conf, e) { // current value value = date; currYear = date.getFullYear(); currMonth = date.getMonth(); currDay = date.getDate(); e || (e = $.Event("api")); // focus the input after selection (doesn't work in IE) if (e.type == "click" && !$.browser.msie) { input.focus(); } // beforeChange e.type = "beforeChange"; fire.trigger(e, [date]); if (e.isDefaultPrevented()) { return; } // formatting input.val(format(conf.formatter, date, conf.format, conf.lang)); // change e.type = "change"; fire.trigger(e); // store value into input input.data("date", date); self.hide(e); } //}}} //{{{ onShow function onShow(ev) { ev.type = "onShow"; fire.trigger(ev); $(document).on("keydown.d", function(e) { if (e.ctrlKey) { return true; } var key = e.keyCode; // backspace or delete clears the value if (key == 8 || key == 46) { input.val(""); return self.hide(e); } // esc or tab key exits if (key == 27 || key == 9) { return self.hide(e); } if ($(KEYS).index(key) >= 0) { if (!opened) { self.show(e); return e.preventDefault(); } var days = $("#" + css.weeks + " a"), el = $("." + css.focus), index = days.index(el); el.removeClass(css.focus); if (key == 74 || key == 40) { index += 7; } else if (key == 75 || key == 38) { index -= 7; } else if (key == 76 || key == 39) { index += 1; } else if (key == 72 || key == 37) { index -= 1; } if (index > 41) { self.addMonth(); el = $("#" + css.weeks + " a:eq(" + (index-42) + ")"); } else if (index < 0) { self.addMonth(-1); el = $("#" + css.weeks + " a:eq(" + (index+42) + ")"); } else { el = days.eq(index); } el.addClass(css.focus); return e.preventDefault(); } // pageUp / pageDown if (key == 34) { return self.addMonth(); } if (key == 33) { return self.addMonth(-1); } // home if (key == 36) { return self.today(); } // enter if (key == 13) { if (!$(e.target).is("select")) { $("." + css.focus).click(); } } return $([16, 17, 18, 9]).index(key) >= 0; }); // click outside dateinput $(document).on("click.d", function(e) { var el = e.target; if (!$(el).parents("#" + css.root).length && el != input[0] && (!trigger || el != trigger[0])) { self.hide(e); } }); } //}}} $.extend(self, { /** * @public * Show the calendar */ show: function(e) { if (input.attr("readonly") || input.attr("disabled") || opened) { return; } // onBeforeShow e = e || $.Event(); e.type = "onBeforeShow"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } $.each(instances, function() { this.hide(); }); opened = true; // month selector monthSelector.off("change").change(function() { self.setValue(integer(yearSelector.val()), integer($(this).val())); }); // year selector yearSelector.off("change").change(function() { self.setValue(integer($(this).val()), integer(monthSelector.val())); }); // prev / next month pm = root.find("#" + css.prev).off("click").click(function(e) { if (!pm.hasClass(css.disabled)) { self.addMonth(-1); } return false; }); nm = root.find("#" + css.next).off("click").click(function(e) { if (!nm.hasClass(css.disabled)) { self.addMonth(); } return false; }); // set date self.setValue(value); // show calendar var pos = input.offset(); // iPad position fix if (/iPad/i.test(navigator.userAgent)) { pos.top -= $(window).scrollTop(); } root.css({ top: pos.top + input.outerHeight({margins: true}) + conf.offset[0], left: pos.left + conf.offset[1] }); if (conf.speed) { root.show(conf.speed, function() { onShow(e); }); } else { root.show(); onShow(e); } return self; }, /** * @public * * Set the value of the dateinput */ setValue: function(year, month, day) { var date = integer(month) >= -1 ? new Date(integer(year), integer(month), integer(day == undefined || isNaN(day) ? 1 : day)) : year || value; if (date < min) { date = min; } else if (date > max) { date = max; } // date given as ISO string if (typeof year == 'string') { date = parseDate(year); } year = date.getFullYear(); month = date.getMonth(); day = date.getDate(); // roll year & month if (month == -1) { month = 11; year--; } else if (month == 12) { month = 0; year++; } if (!opened) { select(date, conf); return self; } currMonth = month; currYear = year; currDay = day; // variables var tmp = new Date(year, month, 1 - conf.firstDay), begin = tmp.getDay(), days = dayAm(year, month), prevDays = dayAm(year, month - 1), week; // selectors if (conf.selectors) { // month selector monthSelector.empty(); $.each(labels.months, function(i, m) { if (min < new Date(year, i + 1, 1) && max > new Date(year, i, 0)) { monthSelector.append($("<option/>").html(m).attr("value", i)); } }); // year selector yearSelector.empty(); var yearNow = now.getFullYear(); for (var i = yearNow + conf.yearRange[0]; i < yearNow + conf.yearRange[1]; i++) { if (min < new Date(i + 1, 0, 1) && max > new Date(i, 0, 0)) { yearSelector.append($("<option/>").text(i)); } } monthSelector.val(month); yearSelector.val(year); // title } else { title.html(labels.months[month] + " " + year); } // populate weeks weeks.empty(); pm.add(nm).removeClass(css.disabled); // !begin === "sunday" for (var j = !begin ? -7 : 0, a, num; j < (!begin ? 35 : 42); j++) { a = $("<a/>"); if (j % 7 === 0) { week = $("<div/>").addClass(css.week); weeks.append(week); } if (j < begin) { a.addClass(css.off); num = prevDays - begin + j + 1; date = new Date(year, month-1, num); } else if (j >= begin + days) { a.addClass(css.off); num = j - days - begin + 1; date = new Date(year, month+1, num); } else { num = j - begin + 1; date = new Date(year, month, num); // current date if (isSameDay(value, date)) { a.attr("id", css.current).addClass(css.focus); // today } else if (isSameDay(now, date)) { a.attr("id", css.today); } } // disabled if (min && date < min) { a.add(pm).addClass(css.disabled); } if (max && date > max) { a.add(nm).addClass(css.disabled); } a.attr("href", "#" + num).text(num).data("date", date); week.append(a); } // date picking weeks.find("a").click(function(e) { var el = $(this); if (!el.hasClass(css.disabled)) { $("#" + css.current).removeAttr("id"); el.attr("id", css.current); select(el.data("date"), conf, e); } return false; }); // sunday if (css.sunday) { weeks.find("." + css.week).each(function() { var beg = conf.firstDay ? 7 - conf.firstDay : 0; $(this).children().slice(beg, beg + 1).addClass(css.sunday); }); } return self; }, //}}} setMin: function(val, fit) { min = parseDate(val); if (fit && value < min) { self.setValue(min); } return self; }, setMax: function(val, fit) { max = parseDate(val); if (fit && value > max) { self.setValue(max); } return self; }, today: function() { return self.setValue(now); }, addDay: function(amount) { return this.setValue(currYear, currMonth, currDay + (amount || 1)); }, addMonth: function(amount) { var targetMonth = currMonth + (amount || 1), daysInTargetMonth = dayAm(currYear, targetMonth), targetDay = currDay <= daysInTargetMonth ? currDay : daysInTargetMonth; return this.setValue(currYear, targetMonth, targetDay); }, addYear: function(amount) { return this.setValue(currYear + (amount || 1), currMonth, currDay); }, destroy: function() { input.add(document).off("click.d keydown.d"); root.add(trigger).remove(); input.removeData("dateinput").removeClass(css.input); if (original) { input.replaceWith(original); } }, hide: function(e) { if (opened) { // onHide e = $.Event(); e.type = "onHide"; fire.trigger(e); // cancelled ? if (e.isDefaultPrevented()) { return; } $(document).off("click.d keydown.d"); // do the hide root.hide(); opened = false; } return self; }, toggle: function(){ return self.isOpen() ? self.hide() : self.show(); }, getConf: function() { return conf; }, getInput: function() { return input; }, getCalendar: function() { return root; }, getValue: function(dateFormat) { return dateFormat ? format(conf.formatter, value, dateFormat, conf.lang) : value; }, isOpen: function() { return opened; } }); // callbacks $.each(['onBeforeShow','onShow','change','onHide'], function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } // API methods self[name] = function(fn) { if (fn) { $(self).on(name, fn); } return self; }; }); if (!conf.editable) { // show dateinput & assign keyboard shortcuts input.on("focus.d click.d", self.show).keydown(function(e) { var key = e.keyCode; // open dateinput with navigation keyw if (!opened && $(KEYS).index(key) >= 0) { self.show(e); return e.preventDefault(); // clear value on backspace or delete } else if (key == 8 || key == 46) { input.val(""); } // allow tab return e.shiftKey || e.ctrlKey || e.altKey || key == 9 ? true : e.preventDefault(); }); } // initial value if (parseDate(input.val())) { select(value, conf); } } $.expr[':'].date = function(el) { var type = el.getAttribute("type"); return type && type == 'date' || !!$(el).data("dateinput"); }; $.fn.dateinput = function(conf) { // already instantiated if (this.data("dateinput")) { return this; } // configuration conf = $.extend(true, {}, tool.conf, conf); // CSS prefix $.each(conf.css, function(key, val) { if (!val && key != 'prefix') { conf.css[key] = (conf.css.prefix || '') + (val || key); } }); var els; this.each(function() { var el = new Dateinput($(this), conf); instances.push(el); var input = el.getInput().data("dateinput", el); els = els ? els.add(input) : input; }); return els ? els : this; }; }) (jQuery); /** * @license * jQuery Tools @VERSION Overlay - Overlay base. Extend it. * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/overlay/ * * Since: March 2008 * Date: @DATE */ (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.overlay = { addEffect: function(name, loadFn, closeFn) { effects[name] = [loadFn, closeFn]; }, conf: { close: null, closeOnClick: true, closeOnEsc: true, closeSpeed: 'fast', effect: 'default', // since 1.2. fixed positioning not supported by IE6 fixed: !$.browser.msie || $.browser.version > 6, left: 'center', load: false, // 1.2 mask: null, oneInstance: true, speed: 'normal', target: null, // target element to be overlayed. by default taken from [rel] top: '10%' } }; var instances = [], effects = {}; // the default effect. nice and easy! $.tools.overlay.addEffect('default', /* onLoad/onClose functions must be called otherwise none of the user supplied callback methods won't be called */ function(pos, onLoad) { var conf = this.getConf(), w = $(window); if (!conf.fixed) { pos.top += w.scrollTop(); pos.left += w.scrollLeft(); } pos.position = conf.fixed ? 'fixed' : 'absolute'; this.getOverlay().css(pos).fadeIn(conf.speed, onLoad); }, function(onClose) { this.getOverlay().fadeOut(this.getConf().closeSpeed, onClose); } ); function Overlay(trigger, conf) { // private variables var self = this, fire = trigger.add(self), w = $(window), closers, overlay, opened, maskConf = $.tools.expose && (conf.mask || conf.expose), uid = Math.random().toString().slice(10); // mask configuration if (maskConf) { if (typeof maskConf == 'string') { maskConf = {color: maskConf}; } maskConf.closeOnClick = maskConf.closeOnEsc = false; } // get overlay and trigger var jq = conf.target || trigger.attr("rel"); overlay = jq ? $(jq) : null || trigger; // overlay not found. cannot continue if (!overlay.length) { throw "Could not find Overlay: " + jq; } // trigger's click event if (trigger && trigger.index(overlay) == -1) { trigger.click(function(e) { self.load(e); return e.preventDefault(); }); } // API methods $.extend(self, { load: function(e) { // can be opened only once if (self.isOpened()) { return self; } // find the effect var eff = effects[conf.effect]; if (!eff) { throw "Overlay: cannot find effect : \"" + conf.effect + "\""; } // close other instances? if (conf.oneInstance) { $.each(instances, function() { this.close(e); }); } // onBeforeLoad e = e || $.Event(); e.type = "onBeforeLoad"; fire.trigger(e); if (e.isDefaultPrevented()) { return self; } // opened opened = true; // possible mask effect if (maskConf) { $(overlay).expose(maskConf); } // position & dimensions var top = conf.top, left = conf.left, oWidth = overlay.outerWidth({margin:true}), oHeight = overlay.outerHeight({margin:true}); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : parseInt(top, 10) / 100 * w.height(); } if (left == 'center') { left = Math.max((w.width() - oWidth) / 2, 0); } // load effect eff[0].call(self, {top: top, left: left}, function() { if (opened) { e.type = "onLoad"; fire.trigger(e); } }); // mask.click closes overlay if (maskConf && conf.closeOnClick) { $.mask.getMask().one("click", self.close); } // when window is clicked outside overlay, we close if (conf.closeOnClick) { $(document).on("click." + uid, function(e) { if (!$(e.target).parents(overlay).length) { self.close(e); } }); } // keyboard::escape if (conf.closeOnEsc) { // one callback is enough if multiple instances are loaded simultaneously $(document).on("keydown." + uid, function(e) { if (e.keyCode == 27) { self.close(e); } }); } return self; }, close: function(e) { if (!self.isOpened()) { return self; } e = e || $.Event(); e.type = "onBeforeClose"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } opened = false; // close effect effects[conf.effect][1].call(self, function() { e.type = "onClose"; fire.trigger(e); }); // unbind the keyboard / clicking actions $(document).off("click." + uid + " keydown." + uid); if (maskConf) { $.mask.close(); } return self; }, getOverlay: function() { return overlay; }, getTrigger: function() { return trigger; }, getClosers: function() { return closers; }, isOpened: function() { return opened; }, // manipulate start, finish and speeds getConf: function() { return conf; } }); // callbacks $.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } // API self[name] = function(fn) { if (fn) { $(self).on(name, fn); } return self; }; }); // close button closers = overlay.find(conf.close || ".close"); if (!closers.length && !conf.close) { closers = $('<a class="close"></a>'); overlay.prepend(closers); } closers.click(function(e) { self.close(e); }); // autoload if (conf.load) { self.load(); } } // jQuery plugin initialization $.fn.overlay = function(conf) { // already constructed --> return API var el = this.data("overlay"); if (el) { return el; } if ($.isFunction(conf)) { conf = {onBeforeLoad: conf}; } conf = $.extend(true, {}, $.tools.overlay.conf, conf); this.each(function() { el = new Overlay($(this), conf); instances.push(el); $(this).data("overlay", el); }); return conf.api ? el: this; }; })(jQuery); /** * @license * jQuery Tools @VERSION / Overlay Apple effect. * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/overlay/apple.html * * Since: July 2009 * Date: @DATE */ (function($) { // version number var t = $.tools.overlay, w = $(window); // extend global configuragion with effect specific defaults $.extend(t.conf, { start: { top: null, left: null }, fadeInSpeed: 'fast', zIndex: 9999 }); // utility function function getPosition(el) { var p = el.offset(); return { top: p.top + el.height() / 2, left: p.left + el.width() / 2 }; } //{{{ load var loadEffect = function(pos, onLoad) { var overlay = this.getOverlay(), conf = this.getConf(), trigger = this.getTrigger(), self = this, oWidth = overlay.outerWidth({margin:true}), img = overlay.data("img"), position = conf.fixed ? 'fixed' : 'absolute'; // growing image is required. if (!img) { var bg = overlay.css("backgroundImage"); if (!bg) { throw "background-image CSS property not set for overlay"; } // url("bg.jpg") --> bg.jpg bg = bg.slice(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); overlay.css("backgroundImage", "none"); img = $('<img src="' + bg + '"/>'); img.css({border:0, display:'none'}).width(oWidth); $('body').append(img); overlay.data("img", img); } // initial top & left 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; } // put overlay into final position if (conf.fixed) { itop -= w.scrollTop(); ileft -= w.scrollLeft(); } else { pos.top += w.scrollTop(); pos.left += w.scrollLeft(); } // initialize background image and make it visible img.css({ position: 'absolute', top: itop, left: ileft, width: 0, zIndex: conf.zIndex }).show(); pos.position = position; overlay.css(pos); // begin growing img.animate({ top: pos.top, left: pos.left, width: oWidth}, conf.speed, function() { // set close button and content over the image overlay.css("zIndex", conf.zIndex + 1).fadeIn(conf.fadeInSpeed, function() { if (self.isOpened() && !$(this).index(overlay)) { onLoad.call(); } else { overlay.hide(); } }); }).css("position", position); }; //}}} var closeEffect = function(onClose) { // variables 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 position if (trigger) { $.extend(css, getPosition(trigger)); } // change from fixed to absolute position if (conf.fixed) { img.css({position: 'absolute'}) .animate({ top: "+=" + w.scrollTop(), left: "+=" + w.scrollLeft()}, 0); } // shrink image img.animate(css, conf.closeSpeed, onClose); }; // add overlay effect t.addEffect("apple", loadEffect, closeEffect); })(jQuery); /** * @license * jQuery Tools @VERSION Rangeinput - HTML5 <input type="range" /> for humans * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/rangeinput/ * * Since: Mar 2010 * Date: @DATE */ (function($) { $.tools = $.tools || {version: '@VERSION'}; var tool; tool = $.tools.rangeinput = { conf: { min: 0, max: 100, // as defined in the standard step: 'any', // granularity of the value. a non-zero float or int (or "any") steps: 0, value: 0, precision: undefined, vertical: 0, keyboard: true, progress: false, speed: 100, // set to null if not needed css: { input: 'range', slider: 'slider', progress: 'progress', handle: 'handle' } } }; //{{{ fn.drag /* FULL featured drag and drop. 0.7 kb minified, 0.3 gzipped. done. Who told d'n'd is rocket science? Usage: $(".myelement").drag({y: false}).on("drag", function(event, x, y) { // do your custom thing }); Configuration: x: true, // enable horizontal drag y: true, // enable vertical drag drag: true // true = perform drag, false = only fire events Events: dragStart, drag, dragEnd. */ var doc, draggable; $.fn.drag = function(conf) { // disable IE specialities document.ondragstart = function () { return false; }; conf = $.extend({x: true, y: true, drag: true}, conf); doc = doc || $(document).on("mousedown mouseup", function(e) { var el = $(e.target); // start if (e.type == "mousedown" && el.data("drag")) { var offset = el.position(), x0 = e.pageX - offset.left, y0 = e.pageY - offset.top, start = true; doc.on("mousemove.drag", function(e) { var x = e.pageX -x0, y = e.pageY -y0, props = {}; if (conf.x) { props.left = x; } if (conf.y) { props.top = y; } if (start) { el.trigger("dragStart"); start = false; } if (conf.drag) { el.css(props); } el.trigger("drag", [y, x]); draggable = el; }); e.preventDefault(); } else { try { if (draggable) { draggable.trigger("dragEnd"); } } finally { doc.off("mousemove.drag"); draggable = null; } } }); return this.data("drag", true); }; //}}} function round(value, precision) { var n = Math.pow(10, precision); return Math.round(value * n) / n; } // get hidden element's width or height even though it's hidden 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) { // private variables var self = this, css = conf.css, root = $("<div><div/><a href='#'/></div>").data("rangeinput", self), vertical, value, // current value origo, // handle's start point len, // length of the range pos; // current position of the handle // create range input.before(root); var handle = root.addClass(css.slider).find("a").addClass(css.handle), progress = root.find("div").addClass(css.progress); // get (HTML5) attributes into configuration $.each("min,max,step,value".split(","), function(i, key) { var val = input.attr(key); if (parseFloat(val)) { conf[key] = parseFloat(val, 10); } }); var range = conf.max - conf.min, step = conf.step == 'any' ? 0 : conf.step, precision = conf.precision; if (precision === undefined) { precision = step.toString().split("."); precision = precision.length === 2 ? precision[1].length : 0; } // Replace built-in range input (type attribute cannot be changed) if (input.attr("type") == 'range') { var def = input.clone().wrap("<div/>").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 = true; /** The flesh and bone of this tool. All sliding is routed trough this. @param evt types include: click, keydown, blur and api (setValue call) @param isSetValue when called trough setValue() call (keydown, blur, api) vertical configuration gives additional complexity. */ function slide(evt, x, val, isSetValue) { // calculate value based on slide position if (val === undefined) { val = x / len * range; // x is calculated based on val. we need to strip off min during calculation } else if (isSetValue) { val -= conf.min; } // increment in steps if (step) { val = Math.round(val / step) * step; } // count x based on value or tweak x if stepping is done if (x === undefined || step) { x = val * len / range; } // crazy value? if (isNaN(val)) { return self; } // stay within range x = Math.max(0, Math.min(x, len)); val = x / len * range; if (isSetValue || !vertical) { val += conf.min; } // in vertical ranges value rises upwards if (vertical) { if (isSetValue) { x = len -x; } else { val = conf.max - val; } } // precision val = round(val, precision); // onSlide var isClick = evt.type == "click"; if (fireOnSlide && value !== undefined && !isClick) { evt.type = "onSlide"; fire.trigger(evt, [val, x]); if (evt.isDefaultPrevented()) { return self; } } // speed & callback var speed = isClick ? conf.speed : 0, callback = isClick ? function() { evt.type = "change"; fire.trigger(evt, [val]); } : null; if (vertical) { handle.animate({top: x}, speed, callback); if (conf.progress) { progress.animate({height: len - x + handle.height() / 2}, speed); } } else { handle.animate({left: x}, speed, callback); if (conf.progress) { progress.animate({width: x + handle.width() / 2}, speed); } } // store current value value = val; pos = x; // se input field's value input.val(val); return self; } $.extend(self, { getValue: function() { return value; }, setValue: function(val, e) { init(); return slide(e || $.Event("api"), undefined, val, true); }, 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 = conf.step == 'any' ? 1 : conf.step; self.setValue(value + step * (am || 1), e); }, // HTML5 compatible name stepUp: function(am) { return self.step(am || 1); }, // HTML5 compatible name stepDown: function(am) { return self.step(-am || -1); } }); // callbacks $.each("onSlide,change".split(","), function(i, name) { // from configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } // API methods self[name] = function(fn) { if (fn) { $(self).on(name, fn); } return self; }; }); // dragging handle.drag({drag: false}).on("dragStart", function() { /* do some pre- calculations for seek() function. improves performance */ init(); // avoid redundant event triggering (= heavy stuff) fireOnSlide = hasEvent($(self)) || hasEvent(input); }).on("drag", function(e, y, x) { if (input.is(":disabled")) { return false; } slide(e, vertical ? y : x); }).on("dragEnd", function(e) { if (!e.isDefaultPrevented()) { e.type = "change"; fire.trigger(e, [value]); } }).click(function(e) { return e.preventDefault(); }); // clicking 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); }); if (conf.keyboard) { input.keydown(function(e) { if (input.attr("readonly")) { return; } var key = e.keyCode, up = $([75, 76, 38, 33, 39]).index(key) != -1, down = $([74, 72, 40, 34, 37]).index(key) != -1; if ((up || down) && !(e.shiftKey || e.altKey || e.ctrlKey)) { // UP: k=75, l=76, up=38, pageup=33, right=39 if (up) { self.step(key == 33 ? 10 : 1, e); // DOWN: j=74, h=72, down=40, pagedown=34, left=37 } else if (down) { self.step(key == 34 ? -10 : -1, e); } return e.preventDefault(); } }); } input.blur(function(e) { var val = $(this).val(); if (val !== value) { self.setValue(val, e); } }); // HTML5 DOM methods $.extend(input[0], { stepUp: self.stepUp, stepDown: self.stepDown}); // calculate all dimension related stuff function init() { vertical = conf.vertical || dim(root, "height") > dim(root, "width"); if (vertical) { len = dim(root, "height") - dim(handle, "height"); origo = root.offset().top + len; } else { len = dim(root, "width") - dim(handle, "width"); origo = root.offset().left; } } function begin() { init(); self.setValue(conf.value !== undefined ? conf.value : conf.min); } begin(); // some browsers cannot get dimensions upon initialization if (!len) { $(window).load(begin); } } $.expr[':'].range = function(el) { var type = el.getAttribute("type"); return type && type == 'range' || !!$(el).filter("input").data("rangeinput"); }; // jQuery plugin implementation $.fn.rangeinput = function(conf) { // already installed if (this.data("rangeinput")) { return this; } // extend configuration with globals conf = $.extend(true, {}, tool.conf, conf); var els; this.each(function() { var el = new RangeInput($(this), $.extend(true, {}, conf)); var input = el.getInput().data("rangeinput", el); els = els ? els.add(input) : input; }); return els ? els : this; }; }) (jQuery); /** * @license * jQuery Tools @VERSION Scrollable - New wave UI design * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/scrollable.html * * Since: March 2008 * Date: @DATE */ (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: '> *', items: '.items', keyboard: true, mousewheel: false, next: '.next', prev: '.prev', size: 1, speed: 400, vertical: false, touch: true, wheelSpeed: 0 } }; // get hidden element's width or height even though it's hidden 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 find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, vertical = conf.vertical; if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // in this version circular not supported when size > 1 if (conf.size > 1) { conf.circular = false; } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.find(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(conf.size, time); }, prev: function(time) { return self.move(-conf.size, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); next.removeClass("disabled"); } else { itemWrap.children().last().before(item); itemWrap.children().first().replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // ensure numeric index if (!i.jquery) { i *= 1; } // avoid seeking from end clone to the beginning if (conf.circular && i === 0 && index == -1 && time !== 0) { return self; } // check that index is sane if (!conf.circular && i < 0 || i > self.getSize() || i < -1) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; index = i; current = self; if (time === undefined) { time = conf.speed; } itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); return self; } }); // callbacks $.each(['onBeforeSeek', 'onSeek', 'onAddItem'], function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } self[name] = function(fn) { if (fn) { $(self).on(name, fn); } return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); // seek over the cloned item // if the scrollable is hidden the calculations for seekTo position // will be incorrect (eg, if the scrollable is inside an overlay). // ensure the elements are shown, calculate the correct position, // then re-hide the elements. This must be done synchronously to // prevent the hidden elements being shown to the user. // See: https://github.com/jquerytools/jquerytools/issues#issue/87 var hidden_parents = root.parents().add(root).filter(function () { if ($(this).css('display') === 'none') { return true; } }); if (hidden_parents.length) { hidden_parents.show(); self.seekTo(0, 0, function() {}); hidden_parents.hide(); } else { self.seekTo(0, 0, function() {}); } } // next/prev buttons var prev = find(root, conf.prev).click(function(e) { e.stopPropagation(); self.prev(); }), next = find(root, conf.next).click(function(e) { e.stopPropagation(); self.next(); }); if (!conf.circular) { self.onBeforeSeek(function(e, i) { setTimeout(function() { if (!e.isDefaultPrevented()) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); } }, 1); }); if (!conf.initialIndex) { prev.addClass(conf.disabledClass); } } if (self.getSize() < 2) { prev.add(next).addClass(conf.disabledClass); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } // touch event if (conf.touch) { var touch = {}; itemWrap[0].ontouchstart = function(e) { var t = e.touches[0]; touch.x = t.clientX; touch.y = t.clientY; }; itemWrap[0].ontouchmove = function(e) { // only deal with one finger if (e.touches.length == 1 && !itemWrap.is(":animated")) { var t = e.touches[0], deltaX = touch.x - t.clientX, deltaY = touch.y - t.clientY; self[vertical && deltaY > 0 || !vertical && deltaX > 0 ? 'next' : 'prev'](); e.preventDefault(); } }; } if (conf.keyboard) { $(document).on("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || evt.metaKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // initial index if (conf.initialIndex) { self.seekTo(conf.initialIndex, 0, function() {}); } } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); /** * @license * jQuery Tools @VERSION / Scrollable Autoscroll * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/scrollable/autoscroll.html * * Since: September 2009 * Date: @DATE */ (function($) { var t = $.tools.scrollable; t.autoscroll = { conf: { autoplay: true, interval: 3000, autopause: true } }; // jQuery plugin implementation $.fn.autoscroll = function(conf) { if (typeof conf == 'number') { conf = {interval: conf}; } var opts = $.extend({}, t.autoscroll.conf, conf), ret; this.each(function() { var api = $(this).data("scrollable"), root = api.getRoot(), // interval stuff timer, stopped = false; /** * * Function to run autoscroll through event binding rather than setInterval * Fixes this bug: http://flowplayer.org/tools/forum/25/72029 */ function scroll(){ // Fixes https://github.com/jquerytools/jquerytools/issues/591 if (timer) clearTimeout(timer); // reset timeout, especially for onSeek event timer = setTimeout(function(){ api.next(); }, opts.interval); } if (api) { ret = api; } api.play = function() { // do not start additional timer if already exists if (timer) { return; } stopped = false; root.on('onSeek', scroll); scroll(); }; api.pause = function() { timer = clearTimeout(timer); // clear any queued items immediately root.off('onSeek', scroll); }; // resume playing if not stopped api.resume = function() { stopped || api.play(); }; // when stopped - mouseover won't restart api.stop = function() { stopped = true; api.pause(); }; /* when mouse enters, autoscroll stops */ if (opts.autopause) { root.add(api.getNaviButtons()).hover(api.pause, api.resume); } if (opts.autoplay) { api.play(); } }); return opts.api ? ret : this; }; })(jQuery); /** * @license * jQuery Tools @VERSION / Scrollable Navigator * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/scrollable/navigator.html * * Since: September 2009 * Date: @DATE */ (function($) { var t = $.tools.scrollable; t.navigator = { conf: { navi: '.navi', naviItem: null, activeClass: 'active', indexed: false, idPrefix: null, // 1.2 history: false } }; function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } // jQuery plugin implementation $.fn.navigator = function(conf) { // configuration if (typeof conf == 'string') { conf = {navi: conf}; } conf = $.extend({}, t.navigator.conf, conf); var ret; this.each(function() { 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; // @deprecated stuff if (api) { ret = api; } api.getNaviButtons = function() { return buttons.add(navi); }; if (hashed) { history.pushState({i: 0}, ''); $(window).on("popstate", function(evt) { var s = evt.originalEvent.state; if (s) { api.seekTo(s.i); } }); } function doClick(el, i, e) { api.seekTo(i); e.preventDefault(); if (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); }); // index number / id attribute if (i === 0) { item.addClass(cls); } if (conf.indexed) { item.text(i + 1); } if (conf.idPrefix) { item.attr("id", conf.idPrefix + i); } return item.appendTo(navi); } // generate navigator if (els().length) { els().each(function(i) { $(this).click(function(e) { doClick($(this), i, e); }); }); } else { $.each(api.getItems(), function(i) { if (i % size == 0) addItem(i); }); } // activate correct entry api.onBeforeSeek(function(e, index) { setTimeout(function() { if (!e.isDefaultPrevented()) { var i = index / size, el = els().eq(i); if (el.length) { els().removeClass(cls).eq(i).addClass(cls); } } }, 1); }); // new item being added api.onAddItem(function(e, item) { var i = api.getItems().index(item); if (i % size == 0) addItem(i); }); }); return conf.api ? ret : this; }; })(jQuery); /** * @license * jQuery Tools @VERSION Tabs- The basics of UI design. * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/tabs/ * * Since: November 2008 * Date: @DATE */ (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.tabs = { conf: { tabs: 'a', current: 'current', onBeforeClick: null, onClick: null, effect: 'default', initialEffect: false, // whether or not to show effect in first init of tabs initialIndex: 0, event: 'click', rotate: false, // slide effect slideUpSpeed: 400, slideDownSpeed: 400, // 1.2 history: false }, addEffect: function(name, fn) { effects[name] = fn; } }; var effects = { // simple "toggle" effect 'default': function(i, done) { this.getPanes().hide().eq(i).show(); done.call(); }, /* configuration: - fadeOutSpeed (positive value does "crossfading") - fadeInSpeed */ fade: function(i, done) { var conf = this.getConf(), speed = conf.fadeOutSpeed, panes = this.getPanes(); if (speed) { panes.fadeOut(speed); } else { panes.hide(); } panes.eq(i).fadeIn(conf.fadeInSpeed, done); }, // for basic accordions slide: function(i, done) { var conf = this.getConf(); this.getPanes().slideUp(conf.slideUpSpeed); this.getPanes().eq(i).slideDown(conf.slideDownSpeed, done); }, /** * AJAX effect */ ajax: function(i, done) { this.getPanes().eq(0).load(this.getTabs().eq(i).attr("href"), done); } }; /** * Horizontal accordion * * @deprecated will be replaced with a more robust implementation */ var /** * @type {Boolean} * * Mutex to control horizontal animation * Disables clicking of tabs while animating * They mess up otherwise as currentPane gets set *after* animation is done */ animating, /** * @type {Number} * * Initial width of tab panes */ w; $.tools.tabs.addEffect("horizontal", function(i, done) { if (animating) return; // don't allow other animations var nextPane = this.getPanes().eq(i), currentPane = this.getCurrentPane(); // store original width of a pane into memory w || ( w = this.getPanes().eq(0).width() ); animating = true; nextPane.show(); // hidden by default // animate current pane's width to zero // animate next pane's width at the same time for smooth animation currentPane.animate({width: 0}, { step: function(now){ nextPane.css("width", w-now); }, complete: function(){ $(this).hide(); done.call(); animating = false; } }); // Dirty hack... onLoad, currentPant will be empty and nextPane will be the first pane // If this is the case, manually run callback since the animation never occured, and reset animating if (!currentPane.length){ done.call(); animating = false; } }); function Tabs(root, paneSelector, conf) { var self = this, trigger = root.add(this), tabs = root.find(conf.tabs), panes = paneSelector.jquery ? paneSelector : root.children(paneSelector), current; // make sure tabs and panes are found if (!tabs.length) { tabs = root.children(); } if (!panes.length) { panes = root.parent().find(paneSelector); } if (!panes.length) { panes = $(paneSelector); } // public methods $.extend(this, { click: function(i, e) { var tab = tabs.eq(i), firstRender = !root.data('tabs'); if (typeof i == 'string' && i.replace("#", "")) { tab = tabs.filter("[href*=\"" + i.replace("#", "") + "\"]"); i = Math.max(tabs.index(tab), 0); } if (conf.rotate) { var last = tabs.length -1; if (i < 0) { return self.click(last, e); } if (i > last) { return self.click(0, e); } } if (!tab.length) { if (current >= 0) { return self; } i = conf.initialIndex; tab = tabs.eq(i); } // current tab is being clicked if (i === current) { return self; } // possibility to cancel click action e = e || $.Event(); e.type = "onBeforeClick"; trigger.trigger(e, [i]); if (e.isDefaultPrevented()) { return; } // if firstRender, only run effect if initialEffect is set, otherwise default var effect = firstRender ? conf.initialEffect && conf.effect || 'default' : conf.effect; // call the effect effects[effect].call(self, i, function() { current = i; // onClick callback e.type = "onClick"; trigger.trigger(e, [i]); }); // default behaviour tabs.removeClass(conf.current); tab.addClass(conf.current); return self; }, getConf: function() { return conf; }, getTabs: function() { return tabs; }, getPanes: function() { return panes; }, getCurrentPane: function() { return panes.eq(current); }, getCurrentTab: function() { return tabs.eq(current); }, getIndex: function() { return current; }, next: function() { return self.click(current + 1); }, prev: function() { return self.click(current - 1); }, destroy: function() { tabs.off(conf.event).removeClass(conf.current); panes.find("a[href^=\"#\"]").off("click.T"); return self; } }); // callbacks $.each("onBeforeClick,onClick".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } // API self[name] = function(fn) { if (fn) { $(self).on(name, fn); } return self; }; }); if (conf.history && $.fn.history) { $.tools.history.init(tabs); conf.event = 'history'; } // setup click actions for each tab tabs.each(function(i) { $(this).on(conf.event, function(e) { self.click(i, e); return e.preventDefault(); }); }); // cross tab anchor link panes.find("a[href^=\"#\"]").on("click.T", function(e) { self.click($(this).attr("href"), e); }); // open initial tab if (location.hash && conf.tabs == "a" && root.find("[href=\"" +location.hash+ "\"]").length) { self.click(location.hash); } else { if (conf.initialIndex === 0 || conf.initialIndex > 0) { self.click(conf.initialIndex); } } } // jQuery plugin implementation $.fn.tabs = function(paneSelector, conf) { // return existing instance var el = this.data("tabs"); if (el) { el.destroy(); this.removeData("tabs"); } if ($.isFunction(conf)) { conf = {onBeforeClick: conf}; } // setup conf conf = $.extend({}, $.tools.tabs.conf, conf); this.each(function() { el = new Tabs($(this), paneSelector, conf); $(this).data("tabs", el); }); return conf.api ? el: this; }; }) (jQuery); /** * @license * jQuery Tools @VERSION Slideshow - Extend it. * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/tabs/slideshow.html * * Since: September 2009 * Date: @DATE */ (function($) { var tool; tool = $.tools.tabs.slideshow = { conf: { next: '.forward', prev: '.backward', disabledClass: 'disabled', autoplay: false, autopause: true, interval: 3000, clickable: true, api: false } }; function Slideshow(root, conf) { var self = this, fire = root.add(this), tabs = root.data("tabs"), timer, stopped = true; // next / prev buttons function find(query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var nextButton = find(conf.next).click(function() { tabs.next(); }); var prevButton = find(conf.prev).click(function() { tabs.prev(); }); /** * * Similar fix for autoscroll animation queue problem */ function next(){ timer = setTimeout(function(){ tabs.next(); }, conf.interval); } // extend the Tabs API with slideshow methods $.extend(self, { // return tabs API getTabs: function() { return tabs; }, getConf: function() { return conf; }, play: function() { // do not start additional timer if already exists if (timer) { return self; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // onPlay fire.trigger("onPlay"); fire.on('onClick', next); next(); return self; }, pause: function() { if (!timer) { return self; } // onBeforePause var e = $.Event("onBeforePause"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } timer = clearTimeout(timer); // onPause fire.trigger("onPause"); fire.off('onClick', next); return self; }, // resume playing if not stopped resume: function() { stopped || self.play(); }, // when stopped - mouseover won't restart stop: function() { self.pause(); stopped = true; } }); // callbacks $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } // API methods self[name] = function(fn) { return $(self).on(name, fn); }; }); /* when mouse enters, slideshow stops */ if (conf.autopause) { tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()).hover(self.pause, self.resume); } if (conf.autoplay) { self.play(); } if (conf.clickable) { tabs.getPanes().click(function() { tabs.next(); }); } // manage disabling of next/prev buttons if (!tabs.getConf().rotate) { var disabled = conf.disabledClass; if (!tabs.getIndex()) { prevButton.addClass(disabled); } tabs.onBeforeClick(function(e, i) { prevButton.toggleClass(disabled, !i); nextButton.toggleClass(disabled, i == tabs.getTabs().length -1); }); } } // jQuery plugin implementation $.fn.slideshow = function(conf) { // return existing instance var el = this.data("slideshow"); if (el) { return el; } conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slideshow($(this), conf); $(this).data("slideshow", el); }); return conf.api ? el : this; }; })(jQuery); /** * @license * jQuery Tools @VERSION / Expose - Dim the lights * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/toolbox/expose.html * * Since: Mar 2010 * Date: @DATE */ (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; var tool; tool = $.tools.expose = { conf: { maskId: 'exposeMask', loadSpeed: 'slow', closeSpeed: 'fast', closeOnClick: true, closeOnEsc: true, // css settings zIndex: 9998, opacity: 0.8, startOpacity: 0, color: '#fff', // callbacks onLoad: null, onClose: null } }; /* one of the greatest headaches in the tool. finally made it */ function viewport() { // the horror case if ($.browser.msie) { // if there are no scrollbars then use window.height var d = $(document).height(), w = $(window).height(); return [ window.innerWidth || // ie7+ document.documentElement.clientWidth || // ie6 document.body.clientWidth, // ie6 quirks mode d - w < 20 ? w : d ]; } // other well behaving browsers return [$(document).width(), $(document).height()]; } function call(fn) { if (fn) { return fn.call($.mask); } } var mask, exposed, loaded, config, overlayIndex; $.mask = { load: function(conf, els) { // already loaded ? if (loaded) { return this; } // configuration if (typeof conf == 'string') { conf = {color: conf}; } // use latest config conf = conf || config; config = conf = $.extend($.extend({}, tool.conf), conf); // get the mask mask = $("#" + conf.maskId); // or create it if (!mask.length) { mask = $('<div/>').attr("id", conf.maskId); $("body").append(mask); } // set position and dimensions var size = viewport(); mask.css({ position:'absolute', top: 0, left: 0, width: size[0], height: size[1], display: 'none', opacity: conf.startOpacity, zIndex: conf.zIndex }); if (conf.color) { mask.css("backgroundColor", conf.color); } // onBeforeLoad if (call(conf.onBeforeLoad) === false) { return this; } // esc button if (conf.closeOnEsc) { $(document).on("keydown.mask", function(e) { if (e.keyCode == 27) { $.mask.close(e); } }); } // mask click closes if (conf.closeOnClick) { mask.on("click.mask", function(e) { $.mask.close(e); }); } // resize mask when window is resized $(window).on("resize.mask", function() { $.mask.fit(); }); // exposed elements if (els && els.length) { overlayIndex = els.eq(0).css("zIndex"); // make sure element is positioned absolutely or relatively $.each(els, function() { var el = $(this); if (!/relative|absolute|fixed/i.test(el.css("position"))) { el.css("position", "relative"); } }); // make elements sit on top of the mask exposed = els.css({ zIndex: Math.max(conf.zIndex + 1, overlayIndex == 'auto' ? 0 : overlayIndex)}); } // reveal mask mask.css({display: 'block'}).fadeTo(conf.loadSpeed, conf.opacity, function() { $.mask.fit(); call(conf.onLoad); loaded = "full"; }); loaded = true; return this; }, close: function() { if (loaded) { // onBeforeClose if (call(config.onBeforeClose) === false) { return this; } mask.fadeOut(config.closeSpeed, function() { call(config.onClose); if (exposed) { exposed.css({zIndex: overlayIndex}); } loaded = false; }); // unbind various event listeners $(document).off("keydown.mask"); mask.off("click.mask"); $(window).off("resize.mask"); } return this; }, fit: function() { if (loaded) { var size = viewport(); mask.css({width: size[0], height: size[1]}); } }, getMask: function() { return mask; }, isLoaded: function(fully) { return fully ? loaded == 'full' : loaded; }, getConf: function() { return config; }, getExposed: function() { return exposed; } }; $.fn.mask = function(conf) { $.mask.load(conf); return this; }; $.fn.expose = function(conf) { $.mask.load(conf, this); return this; }; })(jQuery); /** * @license * jQuery Tools @VERSION / Flashembed - New wave Flash embedding * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/toolbox/flashembed.html * * Since : March 2008 * Date : @DATE */ (function() { var IE = document.all, URL = 'http://www.adobe.com/go/getflashplayer', JQUERY = typeof jQuery == 'function', RE = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/, GLOBAL_OPTS = { // very common opts width: '100%', height: '100%', id: "_" + ("" + Math.random()).slice(9), // flashembed defaults allowfullscreen: true, allowscriptaccess: 'always', quality: 'high', // flashembed specific options version: [3, 0], onFail: null, expressInstall: null, w3c: false, cachebusting: false }; // version 9 bugfix: (http://blog.deconcept.com/2006/07/28/swfobject-143-released/) if (window.attachEvent) { window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() {}; __flash_savedUnloadHandler = function() {}; }); } // simple extend function extend(to, from) { if (from) { for (var key in from) { if (from.hasOwnProperty(key)) { to[key] = from[key]; } } } return to; } // used by asString method function map(arr, func) { var newArr = []; for (var i in arr) { if (arr.hasOwnProperty(i)) { newArr[i] = func(arr[i]); } } return newArr; } window.flashembed = function(root, opts, conf) { // root must be found / loaded if (typeof root == 'string') { root = document.getElementById(root.replace("#", "")); } // not found if (!root) { return; } if (typeof opts == 'string') { opts = {src: opts}; } return new Flash(root, extend(extend({}, GLOBAL_OPTS), opts), conf); }; // flashembed "static" API 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) { } } } ver = RE.exec(ver); return ver ? [ver[1], ver[3]] : [0, 0]; }, asString: function(obj) { if (obj === null || obj === undefined) { return null; } var type = typeof obj; if (type == 'object' && obj.push) { type = 'array'; } switch (type){ case 'string': obj = obj.replace(new RegExp('(["\\\\])', 'g'), '\\$1'); // flash does not handle %- characters well. transforms "50%" to "50pct" (a dirty hack, I admit) obj = obj.replace(/^\s?(\d+\.?\d*)%/, "$1pct"); return '"' +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) { if (obj.hasOwnProperty(prop)) { str.push('"'+prop+'":'+ f.asString(obj[prop])); } } return '{'+str.join(',')+'}'; } // replace ' --> " and remove spaces return String(obj).replace(/\s/g, " ").replace(/\'/g, "\""); }, getHTML: function(opts, conf) { opts = extend({}, opts); /******* OBJECT tag and it's attributes *******/ var html = '<object width="' + opts.width + '" height="' + opts.height + '" id="' + opts.id + '" name="' + opts.id + '"'; if (opts.cachebusting) { opts.src += ((opts.src.indexOf("?") != -1 ? "&" : "?") + Math.random()); } if (opts.w3c || !IE) { html += ' data="' +opts.src+ '" type="application/x-shockwave-flash"'; } else { html += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'; } html += '>'; /******* nested PARAM tags *******/ if (opts.w3c || IE) { html += '<param name="movie" value="' +opts.src+ '" />'; } // not allowed params opts.width = opts.height = opts.id = opts.w3c = opts.src = null; opts.onFail = opts.version = opts.expressInstall = null; for (var key in opts) { if (opts[key]) { html += '<param name="'+ key +'" value="'+ opts[key] +'" />'; } } /******* FLASHVARS *******/ var vars = ""; if (conf) { for (var k in conf) { if (conf[k]) { var val = conf[k]; vars += k +'='+ encodeURIComponent(/function|object/.test(typeof val) ? f.asString(val) : val) + '&'; } } vars = vars.slice(0, -1); html += '<param name="flashvars" value=\'' + vars + '\' />'; } html += "</object>"; return html; }, isSupported: function(ver) { return VERSION[0] > ver[0] || VERSION[0] == ver[0] && VERSION[1] >= ver[1]; } }); var VERSION = f.getVersion(); function Flash(root, opts, conf) { // version is ok if (f.isSupported(opts.version)) { root.innerHTML = f.getHTML(opts, conf); // express install } 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 { // fail #2.1 custom content inside container if (!root.innerHTML.replace(/\s/g, '')) { root.innerHTML = "<h2>Flash version " + opts.version + " or greater is required</h2>" + "<h3>" + (VERSION[0] > 0 ? "Your version is " + VERSION : "You have no flash plugin installed") + "</h3>" + (root.tagName == 'A' ? "<p>Click here to download latest version</p>" : "<p>Download latest version from <a href='" + URL + "'>here</a></p>"); if (root.tagName == 'A') { root.onclick = function() { location.href = URL; }; } } // onFail if (opts.onFail) { var ret = opts.onFail.call(this); if (typeof ret == 'string') { root.innerHTML = ret; } } } // http://flowplayer.org/forum/8/18186#post-18593 if (IE) { window[opts.id] = document.getElementById(opts.id); } // API methods for callback extend(this, { getRoot: function() { return root; }, getOptions: function() { return opts; }, getConf: function() { return conf; }, getApi: function() { return root.firstChild; } }); } // setup jquery support if (JQUERY) { // tools version number 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)); }); }; } })(); /** * @license * jQuery Tools @VERSION History "Back button for AJAX apps" * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/toolbox/history.html * * Since: Mar 2010 * Date: @DATE */ (function($) { var hash, iframe, links, inited; $.tools = $.tools || {version: '@VERSION'}; $.tools.history = { init: function(els) { if (inited) { return; } // IE if ($.browser.msie && $.browser.version < '8') { // create iframe that is constantly checked for hash changes if (!iframe) { iframe = $("<iframe/>").attr("src", "javascript:false;").hide().get(0); $("body").append(iframe); setInterval(function() { var idoc = iframe.contentWindow.document, h = idoc.location.hash; if (hash !== h) { $(window).trigger("hash", h); } }, 100); setIframeLocation(location.hash || '#'); } // other browsers scans for location.hash changes directly without iframe hack } else { setInterval(function() { var h = location.hash; if (h !== hash) { $(window).trigger("hash", h); } }, 100); } links = !links ? els : links.add(els); els.click(function(e) { var href = $(this).attr("href"); if (iframe) { setIframeLocation(href); } // handle non-anchor links if (href.slice(0, 1) != "#") { location.href = "#" + href; return e.preventDefault(); } }); inited = true; } }; function setIframeLocation(h) { if (h) { var doc = iframe.contentWindow.document; doc.open().close(); doc.location.hash = h; } } // global histroy change listener $(window).on("hash", function(e, h) { if (h) { links.filter(function() { var href = $(this).attr("href"); return href == h || href == h.replace("#", ""); }).trigger("history", [h]); } else { links.eq(0).trigger("history", [h]); } hash = h; }); // jQuery plugin implementation $.fn.history = function(fn) { $.tools.history.init(this); // return jQuery return this.on("history", fn); }; })(jQuery); /** * @license * jQuery Tools @VERSION Mousewheel * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/toolbox/mousewheel.html * * based on jquery.event.wheel.js ~ rev 1 ~ * Copyright (c) 2008, Three Dub Media * http://threedubmedia.com * * Since: Mar 2010 * Date: @DATE */ (function($) { $.fn.mousewheel = function( fn ){ return this[ fn ? "on" : "trigger" ]( "wheel", fn ); }; // special event config $.event.special.wheel = { setup: function() { $.event.add( this, wheelEvents, wheelHandler, {} ); }, teardown: function(){ $.event.remove( this, wheelEvents, wheelHandler ); } }; // events to bind ( browser sniffed... ) var wheelEvents = !$.browser.mozilla ? "mousewheel" : // IE, opera, safari "DOMMouseScroll"+( $.browser.version<"1.9" ? " mousemove" : "" ); // firefox // shared event handler function wheelHandler( event ) { switch ( event.type ) { // FF2 has incorrect event positions case "mousemove": return $.extend( event.data, { // store the correct properties clientX: event.clientX, clientY: event.clientY, pageX: event.pageX, pageY: event.pageY }); // firefox case "DOMMouseScroll": $.extend( event, event.data ); // fix event properties in FF2 if (event.originalEvent !== undefined) event.delta = -event.originalEvent.detail / 3; else event.delta = -event.detail / 3; // normalize delta break; // IE, opera, safari case "mousewheel": if (event.originalEvent instanceof WheelEvent) event.delta = event.originalEvent.wheelDelta / 120; else event.delta = event.wheelDelta / 120; break; } event.type = "wheel"; // hijack the event return $.event.handle.call( this, event, event.delta ); } })(jQuery); /** * @license * jQuery Tools @VERSION Tooltip - UI essentials * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/tooltip/ * * Since: November 2008 * Date: @DATE */ (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.tooltip = { conf: { // default effect variables effect: 'toggle', fadeOutSpeed: "fast", predelay: 0, delay: 30, opacity: 1, tip: 0, fadeIE: false, // enables fade effect in IE // 'top', 'bottom', 'right', 'left', 'center' position: ['top', 'center'], offset: [0, 0], relative: false, cancelDefault: true, // type to event mapping events: { def: "mouseenter,mouseleave", input: "focus,blur", widget: "focus mouseenter,blur mouseleave", tooltip: "mouseenter,mouseleave" }, // 1.2 layout: '<div/>', 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; if (o < 1) { tip.css({opacity: o}); } tip.show(); done.call(); }, function(done) { this.getTip().hide(); done.call(); } ], fade: [ function(done) { var conf = this.getConf(); if (!$.browser.msie || conf.fadeIE) { this.getTip().fadeTo(conf.fadeInSpeed, conf.opacity, done); } else { this.getTip().show(); done(); } }, function(done) { var conf = this.getConf(); if (!$.browser.msie || conf.fadeIE) { this.getTip().fadeOut(conf.fadeOutSpeed, done); } else { this.getTip().hide(); done(); } } ] }; /* calculate tip position relative to the trigger */ function getPosition(trigger, tip, conf) { // get origin top/left position 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 position fix if (/iPad/i.test(navigator.userAgent)) { top -= $(window).scrollTop(); } // adjust Y var height = tip.outerHeight() + trigger.outerHeight(); if (pos == 'center') { top += height / 2; } if (pos == 'bottom') { top += height; } // adjust X pos = conf.position[1]; var width = tip.outerWidth() + trigger.outerWidth(); if (pos == 'center') { left -= width / 2; } if (pos == 'left') { left -= width; } return {top: top, left: left}; } function Tooltip(trigger, conf) { var self = this, fire = trigger.add(self), tip, timer = 0, pretimer = 0, title = trigger.attr("title"), tipAttr = trigger.attr("data-tooltip"), effect = effects[conf.effect], shown, // get show/hide configuration 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']; // check that configuration is sane if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; } evt = evt.split(/,\s*/); if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } // trigger --> show trigger.on(evt[0], function(e) { clearTimeout(timer); if (conf.predelay) { pretimer = setTimeout(function() { self.show(e); }, conf.predelay); } else { self.show(e); } // trigger --> hide }).on(evt[1], function(e) { clearTimeout(pretimer); if (conf.delay) { timer = setTimeout(function() { self.hide(e); }, conf.delay); } else { self.hide(e); } }); // remove default title if (title && conf.cancelDefault) { trigger.removeAttr("title"); trigger.data("title", title); } $.extend(self, { show: function(e) { // tip not initialized yet if (!tip) { // data-tooltip if (tipAttr) { tip = $(tipAttr); // single tip element for all } else if (conf.tip) { tip = $(conf.tip).eq(0); // autogenerated tooltip } else if (title) { tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body) .hide().append(title); // manual tooltip } else { tip = trigger.next(); if (!tip.length) { tip = trigger.parent().next(); } } if (!tip.length) { throw "Cannot find tooltip for " + trigger; } } if (self.isShown()) { return self; } // stop previous animation tip.stop(true, true); // get position var pos = getPosition(trigger, tip, conf); // restore title for single tooltip element if (conf.tip) { tip.html(trigger.data("title")); } // onBeforeShow e = $.Event(); e.type = "onBeforeShow"; fire.trigger(e, [pos]); if (e.isDefaultPrevented()) { return self; } // onBeforeShow may have altered the configuration pos = getPosition(trigger, tip, conf); // set position tip.css({position:'absolute', top: pos.top, left: pos.left}); shown = true; // invoke effect effect[0].call(self, function() { e.type = "onShow"; shown = 'full'; fire.trigger(e); }); // tooltip events var event = conf.events.tooltip.split(/,\s*/); if (!tip.data("__set")) { tip.off(event[0]).on(event[0], function() { clearTimeout(timer); clearTimeout(pretimer); }); if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) { tip.off(event[1]).on(event[1], function(e) { // being moved to the trigger element if (e.relatedTarget != trigger[0]) { trigger.trigger(evt[1].split(" ")[0]); } }); } // bind agein for if same tip element if (!conf.tip) tip.data("__set", true); } return self; }, hide: function(e) { if (!tip || !self.isShown()) { return self; } // onBeforeHide e = $.Event(); e.type = "onBeforeHide"; fire.trigger(e); if (e.isDefaultPrevented()) { return; } shown = false; effects[conf.effect][1].call(self, function() { e.type = "onHide"; fire.trigger(e); }); return self; }, isShown: function(fully) { return fully ? shown == 'full' : shown; }, getConf: function() { return conf; }, getTip: function() { return tip; }, getTrigger: function() { return trigger; } }); // callbacks $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } // API self[name] = function(fn) { if (fn) { $(self).on(name, fn); } return self; }; }); } // jQuery plugin implementation $.fn.tooltip = function(conf) { // return existing instance var api = this.data("tooltip"); if (api) { return api; } conf = $.extend(true, {}, $.tools.tooltip.conf, conf); // position can also be given as string if (typeof conf.position == 'string') { conf.position = conf.position.split(/,?\s/); } // install tooltip for each entry in jQuery object this.each(function() { api = new Tooltip($(this), conf); $(this).data("tooltip", api); }); return conf.api ? api: this; }; }) (jQuery); /** * @license * jQuery Tools @VERSION / Tooltip Dynamic Positioning * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/tooltip/dynamic.html * * Since: July 2009 * Date: @DATE */ (function($) { // version number var t = $.tools.tooltip; t.dynamic = { conf: { classNames: "top right bottom left" } }; /* * See if element is on the viewport. Returns an boolean array specifying which * edges are hidden. Edges are in following order: * * [top, right, bottom, left] * * For example following return value means that top and right edges are hidden * * [true, true, false, false] * */ function getCropping(el) { var w = $(window); var right = w.width() + w.scrollLeft(); var bottom = w.height() + w.scrollTop(); return [ el.offset().top <= w.scrollTop(), // top right <= el.offset().left + el.width(), // right bottom <= el.offset().top + el.height(), // bottom w.scrollLeft() >= el.offset().left // left ]; } /* Returns true if all edges of an element are on viewport. false if not @param crop the cropping array returned by getCropping function */ function isVisible(crop) { var i = crop.length; while (i--) { if (crop[i]) { return false; } } return true; } // dynamic plugin $.fn.dynamic = function(conf) { if (typeof conf == 'number') { conf = {speed: conf}; } conf = $.extend({}, t.dynamic.conf, conf); var confOrigin = $.extend(true,{},conf), cls = conf.classNames.split(/\s/), orig; this.each(function() { var api = $(this).tooltip().onBeforeShow(function(e, pos) { // get nessessary variables var tip = this.getTip(), tipConf = this.getConf(); /* We store the original configuration and use it to restore back to the original state. */ if (!orig) { orig = [ tipConf.position[0], tipConf.position[1], tipConf.offset[0], tipConf.offset[1], $.extend({}, tipConf) ]; } /* display tip in it's default position and by setting visibility to hidden. this way we can check whether it will be on the viewport */ $.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(true,{},confOrigin), // now let's see for hidden edges crop = getCropping(tip); // possibly alter the configuration if (!isVisible(crop)) { // change the position and add class if (crop[2]) { $.extend(tipConf, conf.top); tipConf.position[0] = 'top'; tip.addClass(cls[0]); } if (crop[3]) { $.extend(tipConf, conf.right); tipConf.position[1] = 'right'; tip.addClass(cls[1]); } if (crop[0]) { $.extend(tipConf, conf.bottom); tipConf.position[0] = 'bottom'; tip.addClass(cls[2]); } if (crop[1]) { $.extend(tipConf, conf.left); tipConf.position[1] = 'left'; tip.addClass(cls[3]); } // vertical offset if (crop[0] || crop[2]) { tipConf.offset[0] *= -1; } // horizontal offset if (crop[1] || crop[3]) { tipConf.offset[1] *= -1; } } tip.css({visibility: 'visible'}).hide(); }); // restore positioning as soon as possible api.onBeforeShow(function() { var c = this.getConf(), tip = this.getTip(); setTimeout(function() { c.position = [orig[0], orig[1]]; c.offset = [orig[2], orig[3]]; }, 0); }); // remove custom class names and restore original effect api.onHide(function() { var tip = this.getTip(); tip.removeClass(conf.classNames); }); ret = api; }); return conf.api ? ret : this; }; }) (jQuery); /** * @license * jQuery Tools @VERSION / Tooltip Slide Effect * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/tooltip/slide.html * * Since: September 2009 * Date: @DATE */ (function($) { // version number var t = $.tools.tooltip; // extend global configuragion with effect specific defaults $.extend(t.conf, { direction: 'up', // down, left, right bounce: false, slideOffset: 10, slideInSpeed: 200, slideOutSpeed: 200, slideFade: !$.browser.msie }); // directions for slide effect var dirs = { up: ['-', 'top'], down: ['+', 'top'], left: ['-', 'left'], right: ['+', 'left'] }; /* default effect: "slide" */ t.addEffect("slide", // show effect function(done) { // variables var conf = this.getConf(), tip = this.getTip(), params = conf.slideFade ? {opacity: conf.opacity} : {}, dir = dirs[conf.direction] || dirs.up; // direction params[dir[1]] = dir[0] +'='+ conf.slideOffset; // perform animation if (conf.slideFade) { tip.css({opacity:0}); } tip.show().animate(params, conf.slideInSpeed, done); }, // hide effect function(done) { // variables var conf = this.getConf(), offset = conf.slideOffset, params = conf.slideFade ? {opacity: 0} : {}, dir = dirs[conf.direction] || dirs.up; // direction var sign = "" + dir[0]; if (conf.bounce) { sign = sign == '+' ? '-' : '+'; } params[dir[1]] = sign +'='+ offset; // perform animation this.getTip().animate(params, conf.slideOutSpeed, function() { $(this).hide(); done.call(); }); } ); })(jQuery); /** * @license * jQuery Tools Validator @VERSION - HTML5 is here. Now use it. * * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. * * http://flowplayer.org/tools/form/validator/ * * Since: Mar 2010 * Date: @DATE */ /*jslint evil: true */ (function($) { $.tools = $.tools || {version: '@VERSION'}; // globals var typeRe = /\[type=([a-z]+)\]/, numRe = /^-?[0-9]*(\.[0-9]+)?$/, dateInput = $.tools.dateinput, // http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/ emailRe = /^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i, urlRe = /^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i, v; v = $.tools.validator = { conf: { grouped: false, // show all error messages at once inside the container effect: 'default', // show/hide effect for error message. only 'default' is built-in errorClass: 'invalid', // input field class name in case of validation error // when to check for validity? inputEvent: null, // change, blur, keyup, null errorInputEvent: 'keyup', // change, blur, keyup, null formEvent: 'submit', // submit, null lang: 'en', // default language for error messages message: '<div/>', messageAttr: 'data-message', // name of the attribute for overridden error message messageClass: 'error', // error message element's class name offset: [0, 0], position: 'center right', singleError: false, // validate all inputs at once speed: 'normal' // message's fade-in speed }, /* The Error Messages */ 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); }, /** * Adds a new validator */ fn: function(matcher, msg, fn) { // no message supplied if ($.isFunction(msg)) { fn = msg; // message(s) on second argument } else { if (typeof msg == 'string') { msg = {en: msg}; } this.messages[matcher.key || matcher] = msg; } // check for "[type=xxx]" (not supported by jQuery) var test = typeRe.exec(matcher); if (test) { matcher = isType(test[1]); } // add validator to the arsenal fns.push([matcher, fn]); }, /* Add new show/hide effect */ addEffect: function(name, showFn, closeFn) { effects[name] = [showFn, closeFn]; } }; /* calculate error message position relative to the input */ function getPosition(trigger, el, conf) { // Get the first element in the selector set el = $(el).first() || el; // get origin top/left position 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 position fix if (/iPad/i.test(navigator.userAgent)) { top -= $(window).scrollTop(); } // adjust Y var height = el.outerHeight() + trigger.outerHeight(); if (y == 'center') { top += height / 2; } if (y == 'bottom') { top += height; } // adjust X var width = trigger.outerWidth(); if (x == 'center') { left -= (width + el.outerWidth()) / 2; } if (x == 'left') { left -= width; } return {top: top, left: left}; } // $.is("[type=xxx]") or $.filter("[type=xxx]") not working in jQuery 1.3.2 or 1.4.2 function isType(type) { function fn() { return this.getAttribute("type") == type; } fn.key = "[type=\"" + type + "\"]"; return fn; } var fns = [], effects = { 'default' : [ // show errors function function(errs) { var conf = this.getConf(); // loop errors $.each(errs, function(i, err) { // add error class var input = err.input; input.addClass(conf.errorClass); // get handle to the error container var msg = input.data("msg.el"); // create it if not present if (!msg) { msg = $(conf.message).addClass(conf.messageClass).appendTo(document.body); input.data("msg.el", msg); } // clear the container msg.css({visibility: 'hidden'}).find("p").remove(); // populate messages $.each(err.messages, function(i, m) { $("<p/>").html(m).appendTo(msg); }); // make sure the width is not full body width so it can be positioned correctly if (msg.outerWidth() == msg.parent().width()) { msg.add(msg.find("p")).css({display: 'inline'}); } // insert into correct position (relative to the field) var pos = getPosition(input, msg, conf); msg.css({ visibility: 'visible', position: 'absolute', top: pos.top, left: pos.left }) .fadeIn(conf.speed); }); // hide errors function }, function(inputs) { var conf = this.getConf(); inputs.removeClass(conf.errorClass).each(function() { var msg = $(this).data("msg.el"); if (msg) { msg.css({visibility: 'hidden'}); } }); } ] }; /* sperial selectors */ $.each("email,url,number".split(","), function(i, key) { $.expr[':'][key] = function(el) { return el.getAttribute("type") === key; }; }); /* oninvalid() jQuery plugin. Usage: $("input:eq(2)").oninvalid(function() { ... }); */ $.fn.oninvalid = function( fn ){ return this[fn ? "on" : "trigger"]("OI", fn); }; /******* built-in HTML5 standard validators *********/ 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) { // skip empty values and dateinputs if (v === '' || dateInput && el.is(":date")) { return true; } var max = el.attr("max"); return parseFloat(v) <= parseFloat(max) ? true : [max]; }); v.fn("[min]", "Please enter a value of at least $1", function(el, v) { // skip empty values and dateinputs if (v === '' || dateInput && el.is(":date")) { return true; } var min = el.attr("min"); return parseFloat(v) >= parseFloat(min) ? true : [min]; }); v.fn("[required]", "Please complete this mandatory field.", function(el, v) { if (el.is(":checkbox")) { return el.is(":checked"); } return !!v; }); v.fn("[pattern]", function(el, v) { return v === '' || new RegExp("^" + el.attr("pattern") + "$").test(v); }); v.fn(":radio", "Please select an option.", function(el) { var checked = false; var els = $("[name='" + el.attr("name") + "']").each(function(i, el) { if ($(el).is(":checked")) { checked = true; } }); return (checked) ? true : false; }); function Validator(inputs, form, conf) { // private variables var self = this, fire = form.add(self); // make sure there are input fields available inputs = inputs.not(":button, :image, :reset, :submit"); // Prevent default Firefox validation form.attr("novalidate", "novalidate"); // utility function function pushMessage(to, matcher, returnValue) { // only one message allowed if (!conf.grouped && to.length) { return; } // the error message var msg; // substitutions are returned if (returnValue === false || $.isArray(returnValue)) { msg = v.messages[matcher.key || matcher] || v.messages["*"]; msg = msg[conf.lang] || v.messages["*"].en; // substitution var matches = msg.match(/\$\d/g); if (matches && $.isArray(returnValue)) { $.each(matches, function(i) { msg = msg.replace(this, returnValue[i]); }); } // error message is returned directly } else { msg = returnValue[conf.lang] || returnValue; } to.push(msg); } // API methods $.extend(self, { getConf: function() { return conf; }, getForm: function() { return form; }, getInputs: function() { return inputs; }, reflow: function() { 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 }); } }); return self; }, /* @param e - for internal use only */ invalidate: function(errs, e) { // errors are given manually: { fieldName1: 'message1', fieldName2: 'message2' } if (!e) { var errors = []; $.each(errs, function(key, val) { var input = inputs.filter("[name='" + key + "']"); if (input.length) { // trigger HTML5 ininvalid event input.trigger("OI", [val]); errors.push({ input: input, messages: [val]}); } }); errs = errors; e = $.Event(); } // onFail callback e.type = "onFail"; fire.trigger(e, [errs]); // call the effect if (!e.isDefaultPrevented()) { effects[conf.effect][0].call(self, errs, e); } return self; }, reset: function(els) { els = els || inputs; els.removeClass(conf.errorClass).each(function() { var msg = $(this).data("msg.el"); if (msg) { msg.remove(); $(this).data("msg.el", null); } }).off(conf.errorInputEvent + '.v' || ''); return self; }, destroy: function() { form.off(conf.formEvent + ".V reset.V"); inputs.off(conf.inputEvent + ".V change.V"); return self.reset(); }, //{{{ checkValidity() - flesh and bone of this tool /* @returns boolean */ checkValidity: function(els, e) { els = els || inputs; els = els.not(":disabled"); // filter duplicate elements by name var names = {}; els = els.filter(function(){ var name = $(this).attr("name"); if (!names[name]) { names[name] = true; return $(this); } }); if (!els.length) { return true; } e = e || $.Event(); // onBeforeValidate e.type = "onBeforeValidate"; fire.trigger(e, [els]); if (e.isDefaultPrevented()) { return e.result; } // container for errors var errs = []; // loop trough the inputs els.each(function() { // field and it's error message container var msgs = [], el = $(this).data("messages", msgs), event = dateInput && el.is(":date") ? "onHide.v" : conf.errorInputEvent + ".v"; // cleanup previous validation event el.off(event); // loop all validator functions $.each(fns, function() { var fn = this, match = fn[0]; // match found if (el.filter(match).length) { // execute a validator function var returnValue = fn[1].call(self, el, el.val()); // validation failed. multiple substitutions can be returned with an array if (returnValue !== true) { // onBeforeFail e.type = "onBeforeFail"; fire.trigger(e, [el, match]); if (e.isDefaultPrevented()) { return false; } // overridden custom message var msg = el.attr(conf.messageAttr); if (msg) { msgs = [msg]; return false; } else { pushMessage(msgs, match, returnValue); } } } }); if (msgs.length) { errs.push({input: el, messages: msgs}); // trigger HTML5 ininvalid event el.trigger("OI", [msgs]); // begin validating upon error event type (such as keyup) if (conf.errorInputEvent) { el.on(event, function(e) { self.checkValidity(el, e); }); } } if (conf.singleError && errs.length) { return false; } }); // validation done. now check that we have a proper effect at hand var eff = effects[conf.effect]; if (!eff) { throw "Validator: cannot find effect \"" + conf.effect + "\""; } // errors found if (errs.length) { self.invalidate(errs, e); return false; // no errors } else { // call the effect eff[1].call(self, els, e); // onSuccess callback e.type = "onSuccess"; fire.trigger(e, [els]); els.off(conf.errorInputEvent + ".v"); } return true; } //}}} }); // callbacks $.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).on(name, conf[name]); } // API methods self[name] = function(fn) { if (fn) { $(self).on(name, fn); } return self; }; }); // form validation if (conf.formEvent) { form.on(conf.formEvent + ".V", function(e) { if (!self.checkValidity(null, e)) { return e.preventDefault(); } // Reset event type and target e.target = form; e.type = conf.formEvent; }); } // form reset form.on("reset.V", function() { self.reset(); }); // disable browser's default validation mechanism if (inputs[0] && inputs[0].validity) { inputs.each(function() { this.oninvalid = function() { return false; }; }); } // Web Forms 2.0 compatibility if (form[0]) { form[0].checkValidity = self.checkValidity; } // input validation if (conf.inputEvent) { inputs.on(conf.inputEvent + ".V", function(e) { self.checkValidity($(this), e); }); } // checkboxes and selects are checked separately inputs.filter(":checkbox, select").filter("[required]").on("change.V", function(e) { var el = $(this); if (this.checked || (el.is("select") && $(this).val())) { effects[conf.effect][1].call(self, el, e); } }); // get radio groups by name inputs.filter(":radio[required]").on("change.V", function(e) { var els = $("[name='" + $(e.srcElement).attr("name") + "']"); if ((els != null) && (els.length != 0)) { self.checkValidity(els, e); } }); // reposition tooltips when window is resized $(window).resize(function() { self.reflow(); }); } // jQuery plugin initialization $.fn.validator = function(conf) { var instance = this.data("validator"); // destroy existing instance if (instance) { instance.destroy(); this.removeData("validator"); } // configuration conf = $.extend(true, {}, v.conf, conf); // selector is a form if (this.is("form")) { return this.each(function() { var form = $(this); instance = new Validator(form.find(":input"), form, conf); form.data("validator", instance); }); } else { instance = new Validator(this, this.eq(0).closest("form"), conf); return this.data("validator", instance); } }; })(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-tools-1.2.7.js
jquery-tools-1.2.7.js
* getStyleProperty by kangax * http://perfectionkills.com/feature-testing-css-properties/ */ /*jshint browser: true, strict: true, undef: true */ /*globals define: false */ ( function( window ) { 'use strict'; var prefixes = 'Webkit Moz ms Ms O'.split(' '); var docElemStyle = document.documentElement.style; function getStyleProperty( propName ) { if ( !propName ) { return; } // test standard property first if ( typeof docElemStyle[ propName ] === 'string' ) { return propName; } // capitalize propName = propName.charAt(0).toUpperCase() + propName.slice(1); // test vendor specific properties var prefixed; for ( var i=0, len = prefixes.length; i < len; i++ ) { prefixed = prefixes[i] + propName; if ( typeof docElemStyle[ prefixed ] === 'string' ) { return prefixed; } } } // transport if ( typeof define === 'function' && define.amd ) { // AMD define( function() { return getStyleProperty; }); } else { // browser global window.getStyleProperty = getStyleProperty; } })( window ); /** * getSize v1.1.3 * measure size of elements */ /*jshint browser: true, strict: true, undef: true, unused: true */ /*global define: false */ ( function( window, undefined ) { 'use strict'; // -------------------------- helpers -------------------------- // var defView = document.defaultView; var getStyle = defView && defView.getComputedStyle ? function( elem ) { return defView.getComputedStyle( elem, null ); } : function( elem ) { return elem.currentStyle; }; // get a number from a string, not a percentage function getStyleSize( value ) { var num = parseFloat( value ); // not a percent like '100%', and a number var isValid = value.indexOf('%') === -1 && !isNaN( num ); return isValid && num; } // -------------------------- measurements -------------------------- // var measurements = [ 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth', 'borderBottomWidth' ]; function getZeroSize() { var size = { width: 0, height: 0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0 }; for ( var i=0, len = measurements.length; i < len; i++ ) { var measurement = measurements[i]; size[ measurement ] = 0; } return size; } function defineGetSize( getStyleProperty ) { // -------------------------- box sizing -------------------------- // var boxSizingProp = getStyleProperty('boxSizing'); var isBoxSizeOuter; /** * WebKit measures the outer-width on style.width on border-box elems * IE & Firefox measures the inner-width */ ( function() { if ( !boxSizingProp ) { return; } var div = document.createElement('div'); div.style.width = '200px'; div.style.padding = '1px 2px 3px 4px'; div.style.borderStyle = 'solid'; div.style.borderWidth = '1px 2px 3px 4px'; div.style[ boxSizingProp ] = 'border-box'; var body = document.body || document.documentElement; body.appendChild( div ); var style = getStyle( div ); isBoxSizeOuter = getStyleSize( style.width ) === 200; body.removeChild( div ); })(); // -------------------------- getSize -------------------------- // function getSize( elem ) { // use querySeletor if elem is string if ( typeof elem === 'string' ) { elem = document.querySelector( elem ); } // do not proceed on non-objects if ( !elem || typeof elem !== 'object' || !elem.nodeType ) { return; } var style = getStyle( elem ); // if hidden, everything is 0 if ( style.display === 'none' ) { return getZeroSize(); } var size = {}; size.width = elem.offsetWidth; size.height = elem.offsetHeight; var isBorderBox = size.isBorderBox = !!( boxSizingProp && style[ boxSizingProp ] && style[ boxSizingProp ] === 'border-box' ); // get all measurements for ( var i=0, len = measurements.length; i < len; i++ ) { var measurement = measurements[i]; var value = style[ measurement ]; var num = parseFloat( value ); // any 'auto', 'medium' value will be 0 size[ measurement ] = !isNaN( num ) ? num : 0; } var paddingWidth = size.paddingLeft + size.paddingRight; var paddingHeight = size.paddingTop + size.paddingBottom; var marginWidth = size.marginLeft + size.marginRight; var marginHeight = size.marginTop + size.marginBottom; var borderWidth = size.borderLeftWidth + size.borderRightWidth; var borderHeight = size.borderTopWidth + size.borderBottomWidth; var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; // overwrite width and height if we can get it from style var styleWidth = getStyleSize( style.width ); if ( styleWidth !== false ) { size.width = styleWidth + // add padding and border unless it's already including it ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); } var styleHeight = getStyleSize( style.height ); if ( styleHeight !== false ) { size.height = styleHeight + // add padding and border unless it's already including it ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); } size.innerWidth = size.width - ( paddingWidth + borderWidth ); size.innerHeight = size.height - ( paddingHeight + borderHeight ); size.outerWidth = size.width + marginWidth; size.outerHeight = size.height + marginHeight; return size; } return getSize; } // transport if ( typeof define === 'function' && define.amd ) { // AMD define( [ 'get-style-property' ], defineGetSize ); } else { // browser global window.getSize = defineGetSize( window.getStyleProperty ); } })( window ); /*! * eventie v1.0.3 * event binding helper * eventie.bind( elem, 'click', myFn ) * eventie.unbind( elem, 'click', myFn ) */ /*jshint browser: true, undef: true, unused: true */ /*global define: false */ ( function( window ) { 'use strict'; var docElem = document.documentElement; var bind = function() {}; if ( docElem.addEventListener ) { bind = function( obj, type, fn ) { obj.addEventListener( type, fn, false ); }; } else if ( docElem.attachEvent ) { bind = function( obj, type, fn ) { obj[ type + fn ] = fn.handleEvent ? function() { var event = window.event; // add event.target event.target = event.target || event.srcElement; fn.handleEvent.call( fn, event ); } : function() { var event = window.event; // add event.target event.target = event.target || event.srcElement; fn.call( obj, event ); }; obj.attachEvent( "on" + type, obj[ type + fn ] ); }; } var unbind = function() {}; if ( docElem.removeEventListener ) { unbind = function( obj, type, fn ) { obj.removeEventListener( type, fn, false ); }; } else if ( docElem.detachEvent ) { unbind = function( obj, type, fn ) { obj.detachEvent( "on" + type, obj[ type + fn ] ); try { delete obj[ type + fn ]; } catch ( err ) { // can't delete window object properties obj[ type + fn ] = undefined; } }; } var eventie = { bind: bind, unbind: unbind }; // transport if ( typeof define === 'function' && define.amd ) { // AMD define( eventie ); } else { // browser global window.eventie = eventie; } })( this ); /*! * docReady * Cross browser DOMContentLoaded event emitter */ /*jshint browser: true, strict: true, undef: true, unused: true*/ /*global define: false */ ( function( window ) { 'use strict'; var document = window.document; // collection of functions to be triggered on ready var queue = []; function docReady( fn ) { // throw out non-functions if ( typeof fn !== 'function' ) { return; } if ( docReady.isReady ) { // ready now, hit it fn(); } else { // queue function when ready queue.push( fn ); } } docReady.isReady = false; // triggered on various doc ready events function init( event ) { // bail if IE8 document is not ready just yet var isIE8NotReady = event.type === 'readystatechange' && document.readyState !== 'complete'; if ( docReady.isReady || isIE8NotReady ) { return; } docReady.isReady = true; // process queue for ( var i=0, len = queue.length; i < len; i++ ) { var fn = queue[i]; fn(); } } function defineDocReady( eventie ) { eventie.bind( document, 'DOMContentLoaded', init ); eventie.bind( document, 'readystatechange', init ); eventie.bind( window, 'load', init ); return docReady; } // transport if ( typeof define === 'function' && define.amd ) { // AMD define( [ 'eventie' ], defineDocReady ); } else { // browser global window.docReady = defineDocReady( window.eventie ); } })( this ); /*! * EventEmitter v4.1.0 - git.io/ee * Oliver Caldwell * MIT license * @preserve */ (function (exports) { // Place the script in strict mode 'use strict'; /** * Class for managing events. * Can be extended to provide event functionality in other classes. * * @class Manages event registering and emitting. */ function EventEmitter() {} // Shortcuts to improve speed and size // Easy access to the prototype var proto = EventEmitter.prototype, nativeIndexOf = Array.prototype.indexOf ? true : false; /** * Finds the index of the listener for the event in it's storage array. * * @param {Function} listener Method to look for. * @param {Function[]} listeners Array of listeners to search through. * @return {Number} Index of the specified listener, -1 if not found * @api private */ function indexOfListener(listener, listeners) { // Return the index via the native method if possible if (nativeIndexOf) { return listeners.indexOf(listener); } // There is no native method // Use a manual loop to find the index var i = listeners.length; while (i--) { // If the listener matches, return it's index if (listeners[i] === listener) { return i; } } // Default to returning -1 return -1; } /** * Fetches the events object and creates one if required. * * @return {Object} The events storage object. * @api private */ proto._getEvents = function () { return this._events || (this._events = {}); }; /** * Returns the listener array for the specified event. * Will initialise the event object and listener arrays if required. * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them. * Each property in the object response is an array of listener functions. * * @param {String|RegExp} evt Name of the event to return the listeners from. * @return {Function[]|Object} All listener functions for the event. */ proto.getListeners = function (evt) { // Create a shortcut to the storage object // Initialise it if it does not exists yet var events = this._getEvents(), response, key; // Return a concatenated array of all matching events if // the selector is a regular expression. if (typeof evt === 'object') { response = {}; for (key in events) { if (events.hasOwnProperty(key) && evt.test(key)) { response[key] = events[key]; } } } else { response = events[evt] || (events[evt] = []); } return response; }; /** * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful. * * @param {String|RegExp} evt Name of the event to return the listeners from. * @return {Object} All listener functions for an event in an object. */ proto.getListenersAsObject = function (evt) { var listeners = this.getListeners(evt), response; if (listeners instanceof Array) { response = {}; response[evt] = listeners; } return response || listeners; }; /** * Adds a listener function to the specified event. * The listener will not be added if it is a duplicate. * If the listener returns true then it will be removed after it is called. * If you pass a regular expression as the event name then the listener will be added to all events that match it. * * @param {String|RegExp} evt Name of the event to attach the listener to. * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. * @return {Object} Current instance of EventEmitter for chaining. */ proto.addListener = function (evt, listener) { var listeners = this.getListenersAsObject(evt), key; for (key in listeners) { if (listeners.hasOwnProperty(key) && indexOfListener(listener, listeners[key]) === -1) { listeners[key].push(listener); } } // Return the instance of EventEmitter to allow chaining return this; }; /** * Alias of addListener */ proto.on = proto.addListener; /** * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad. * You need to tell it what event names should be matched by a regex. * * @param {String} evt Name of the event to create. * @return {Object} Current instance of EventEmitter for chaining. */ proto.defineEvent = function (evt) { this.getListeners(evt); return this; }; /** * Uses defineEvent to define multiple events. * * @param {String[]} evts An array of event names to define. * @return {Object} Current instance of EventEmitter for chaining. */ proto.defineEvents = function (evts) { for (var i = 0; i < evts.length; i += 1) { this.defineEvent(evts[i]); } return this; }; /** * Removes a listener function from the specified event. * When passed a regular expression as the event name, it will remove the listener from all events that match it. * * @param {String|RegExp} evt Name of the event to remove the listener from. * @param {Function} listener Method to remove from the event. * @return {Object} Current instance of EventEmitter for chaining. */ proto.removeListener = function (evt, listener) { var listeners = this.getListenersAsObject(evt), index, key; for (key in listeners) { if (listeners.hasOwnProperty(key)) { index = indexOfListener(listener, listeners[key]); if (index !== -1) { listeners[key].splice(index, 1); } } } // Return the instance of EventEmitter to allow chaining return this; }; /** * Alias of removeListener */ proto.off = proto.removeListener; /** * Adds listeners in bulk using the manipulateListeners method. * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added. * You can also pass it a regular expression to add the array of listeners to all events that match it. * Yeah, this function does quite a bit. That's probably a bad thing. * * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once. * @param {Function[]} [listeners] An optional array of listener functions to add. * @return {Object} Current instance of EventEmitter for chaining. */ proto.addListeners = function (evt, listeners) { // Pass through to manipulateListeners return this.manipulateListeners(false, evt, listeners); }; /** * Removes listeners in bulk using the manipulateListeners method. * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. * You can also pass it an event name and an array of listeners to be removed. * You can also pass it a regular expression to remove the listeners from all events that match it. * * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once. * @param {Function[]} [listeners] An optional array of listener functions to remove. * @return {Object} Current instance of EventEmitter for chaining. */ proto.removeListeners = function (evt, listeners) { // Pass through to manipulateListeners return this.manipulateListeners(true, evt, listeners); }; /** * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level. * The first argument will determine if the listeners are removed (true) or added (false). * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. * You can also pass it an event name and an array of listeners to be added/removed. * You can also pass it a regular expression to manipulate the listeners of all events that match it. * * @param {Boolean} remove True if you want to remove listeners, false if you want to add. * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once. * @param {Function[]} [listeners] An optional array of listener functions to add/remove. * @return {Object} Current instance of EventEmitter for chaining. */ proto.manipulateListeners = function (remove, evt, listeners) { // Initialise any required variables var i, value, single = remove ? this.removeListener : this.addListener, multiple = remove ? this.removeListeners : this.addListeners; // If evt is an object then pass each of it's properties to this method if (typeof evt === 'object' && !(evt instanceof RegExp)) { for (i in evt) { if (evt.hasOwnProperty(i) && (value = evt[i])) { // Pass the single listener straight through to the singular method if (typeof value === 'function') { single.call(this, i, value); } else { // Otherwise pass back to the multiple function multiple.call(this, i, value); } } } } else { // So evt must be a string // And listeners must be an array of listeners // Loop over it and pass each one to the multiple method i = listeners.length; while (i--) { single.call(this, evt, listeners[i]); } } // Return the instance of EventEmitter to allow chaining return this; }; /** * Removes all listeners from a specified event. * If you do not specify an event then all listeners will be removed. * That means every event will be emptied. * You can also pass a regex to remove all events that match it. * * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. * @return {Object} Current instance of EventEmitter for chaining. */ proto.removeEvent = function (evt) { var type = typeof evt, events = this._getEvents(), key; // Remove different things depending on the state of evt if (type === 'string') { // Remove all listeners for the specified event delete events[evt]; } else if (type === 'object') { // Remove all events matching the regex. for (key in events) { if (events.hasOwnProperty(key) && evt.test(key)) { delete events[key]; } } } else { // Remove all listeners in all events delete this._events; } // Return the instance of EventEmitter to allow chaining return this; }; /** * Emits an event of your choice. * When emitted, every listener attached to that event will be executed. * If you pass the optional argument array then those arguments will be passed to every listener upon execution. * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. * So they will not arrive within the array on the other side, they will be separate. * You can also pass a regular expression to emit to all events that match it. * * @param {String|RegExp} evt Name of the event to emit and execute listeners for. * @param {Array} [args] Optional array of arguments to be passed to each listener. * @return {Object} Current instance of EventEmitter for chaining. */ proto.emitEvent = function (evt, args) { var listeners = this.getListenersAsObject(evt), i, key, response; for (key in listeners) { if (listeners.hasOwnProperty(key)) { i = listeners[key].length; while (i--) { // If the listener returns true then it shall be removed from the event // The function is executed either with a basic call or an apply if there is an args array response = args ? listeners[key][i].apply(null, args) : listeners[key][i](); if (response === true) { this.removeListener(evt, listeners[key][i]); } } } } // Return the instance of EventEmitter to allow chaining return this; }; /** * Alias of emitEvent */ proto.trigger = proto.emitEvent; /** * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on. * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. * * @param {String|RegExp} evt Name of the event to emit and execute listeners for. * @param {...*} Optional additional arguments to be passed to each listener. * @return {Object} Current instance of EventEmitter for chaining. */ proto.emit = function (evt) { var args = Array.prototype.slice.call(arguments, 1); return this.emitEvent(evt, args); }; // Expose the class either via AMD or the global object if (typeof define === 'function' && define.amd) { define(function () { return EventEmitter; }); } else { exports.EventEmitter = EventEmitter; } }(this)); /** * Bridget makes jQuery widgets * v1.0.0 */ ( function( window ) { 'use strict'; // -------------------------- utils -------------------------- // var slice = Array.prototype.slice; function noop() {} // -------------------------- definition -------------------------- // function defineBridget( $ ) { // bail if no jQuery if ( !$ ) { return; } // -------------------------- addOptionMethod -------------------------- // /** * adds option method -> $().plugin('option', {...}) * @param {Function} PluginClass - constructor class */ function addOptionMethod( PluginClass ) { // don't overwrite original option method if ( PluginClass.prototype.option ) { return; } // option setter PluginClass.prototype.option = function( opts ) { // bail out if not an object if ( !$.isPlainObject( opts ) ){ return; } this.options = $.extend( true, this.options, opts ); }; } // -------------------------- plugin bridge -------------------------- // // helper function for logging errors // $.error breaks jQuery chaining var logError = typeof console === 'undefined' ? noop : function( message ) { console.error( message ); }; /** * jQuery plugin bridge, access methods like $elem.plugin('method') * @param {String} namespace - plugin name * @param {Function} PluginClass - constructor class */ function bridge( namespace, PluginClass ) { // add to jQuery fn namespace $.fn[ namespace ] = function( options ) { if ( typeof options === 'string' ) { // call plugin method when first argument is a string // get arguments for method var args = slice.call( arguments, 1 ); for ( var i=0, len = this.length; i < len; i++ ) { var elem = this[i]; var instance = $.data( elem, namespace ); if ( !instance ) { logError( "cannot call methods on " + namespace + " prior to initialization; " + "attempted to call '" + options + "'" ); continue; } if ( !$.isFunction( instance[options] ) || options.charAt(0) === '_' ) { logError( "no such method '" + options + "' for " + namespace + " instance" ); continue; } // trigger method with arguments var returnValue = instance[ options ].apply( instance, args ); // break look and return first value if provided if ( returnValue !== undefined ) { return returnValue; } } // return this if no return value return this; } else { return this.each( function() { var instance = $.data( this, namespace ); if ( instance ) { // apply options & init instance.option( options ); instance._init(); } else { // initialize new instance instance = new PluginClass( this, options ); $.data( this, namespace, instance ); } }); } }; } // -------------------------- bridget -------------------------- // /** * converts a Prototypical class into a proper jQuery plugin * the class must have a ._init method * @param {String} namespace - plugin name, used in $().pluginName * @param {Function} PluginClass - constructor class */ $.bridget = function( namespace, PluginClass ) { addOptionMethod( PluginClass ); bridge( namespace, PluginClass ); }; } // transport if ( typeof define === 'function' && define.amd ) { // AMD define( [ 'jquery' ], defineBridget ); } else { // get jquery from browser global defineBridget( window.jQuery ); } })( window ); /** * matchesSelector helper v1.0.1 * * @name matchesSelector * @param {Element} elem * @param {String} selector */ /*jshint browser: true, strict: true, undef: true, unused: true */ /*global define: false */ ( function( global, ElemProto ) { 'use strict'; var matchesMethod = ( function() { // check un-prefixed if ( ElemProto.matchesSelector ) { return 'matchesSelector'; } // check vendor prefixes var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; for ( var i=0, len = prefixes.length; i < len; i++ ) { var prefix = prefixes[i]; var method = prefix + 'MatchesSelector'; if ( ElemProto[ method ] ) { return method; } } })(); // ----- match ----- // function match( elem, selector ) { return elem[ matchesMethod ]( selector ); } // ----- appendToFragment ----- // function checkParent( elem ) { // not needed if already has parent if ( elem.parentNode ) { return; } var fragment = document.createDocumentFragment(); fragment.appendChild( elem ); } // ----- query ----- // // fall back to using QSA // thx @jonathantneal https://gist.github.com/3062955 function query( elem, selector ) { // append to fragment if no parent checkParent( elem ); // match elem with all selected elems of parent var elems = elem.parentNode.querySelectorAll( selector ); for ( var i=0, len = elems.length; i < len; i++ ) { // return true if match if ( elems[i] === elem ) { return true; } } // otherwise return false return false; } // ----- matchChild ----- // function matchChild( elem, selector ) { checkParent( elem ); return match( elem, selector ); } // ----- matchesSelector ----- // var matchesSelector; if ( matchesMethod ) { // IE9 supports matchesSelector, but doesn't work on orphaned elems // check for that var div = document.createElement('div'); var supportsOrphans = match( div, 'div' ); matchesSelector = supportsOrphans ? match : matchChild; } else { matchesSelector = query; } // transport if ( typeof define === 'function' && define.amd ) { // AMD define( function() { return matchesSelector; }); } else { // browser global window.matchesSelector = matchesSelector; } })( this, Element.prototype ); /** * Outlayer Item **/ ( function( window ) { 'use strict'; // dependencies var getSize = window.getSize; var getStyleProperty = window.getStyleProperty; var EventEmitter = window.EventEmitter; // ----- get style ----- // var defView = document.defaultView; var getStyle = defView && defView.getComputedStyle ? function( elem ) { return defView.getComputedStyle( elem, null ); } : function( elem ) { return elem.currentStyle; }; // extend objects function extend( a, b ) { for ( var prop in b ) { a[ prop ] = b[ prop ]; } return a; } // -------------------------- CSS3 support -------------------------- // var transitionProperty = getStyleProperty('transition'); var transformProperty = getStyleProperty('transform'); var supportsCSS3 = transitionProperty && transformProperty; var is3d = !!getStyleProperty('perspective'); var transitionEndEvent = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'otransitionend', transition: 'transitionend' }[ transitionProperty ]; // properties that could have vendor prefix var prefixableProperties = [ 'transform', 'transition', 'transitionDuration', 'transitionProperty' ]; // cache all vendor properties var vendorProperties = ( function() { var cache = {}; for ( var i=0, len = prefixableProperties.length; i < len; i++ ) { var prop = prefixableProperties[i]; var supportedProp = getStyleProperty( prop ); if ( supportedProp && supportedProp !== prop ) { cache[ prop ] = supportedProp; } } return cache; })(); // -------------------------- Item -------------------------- // function Item( element, layout ) { if ( !element ) { return; } this.element = element; // parent layout class, i.e. Masonry, Isotope, or Packery this.layout = layout; this.position = { x: 0, y: 0 }; this._create(); } // inherit EventEmitter extend( Item.prototype, EventEmitter.prototype ); Item.prototype._create = function() { this.css({ position: 'absolute' }); }; // trigger specified handler for event type Item.prototype.handleEvent = function( event ) { var method = 'on' + event.type; if ( this[ method ] ) { this[ method ]( event ); } }; Item.prototype.getSize = function() { this.size = getSize( this.element ); }; /** * apply CSS styles to element * @param {Object} style */ Item.prototype.css = function( style ) { var elemStyle = this.element.style; for ( var prop in style ) { // use vendor property if available var supportedProp = vendorProperties[ prop ] || prop; elemStyle[ supportedProp ] = style[ prop ]; } }; // measure position, and sets it Item.prototype.getPosition = function() { var style = getStyle( this.element ); var layoutOptions = this.layout.options; var isOriginLeft = layoutOptions.isOriginLeft; var isOriginTop = layoutOptions.isOriginTop; var x = parseInt( style[ isOriginLeft ? 'left' : 'right' ], 10 ); var y = parseInt( style[ isOriginTop ? 'top' : 'bottom' ], 10 ); // clean up 'auto' or other non-integer values x = isNaN( x ) ? 0 : x; y = isNaN( y ) ? 0 : y; // remove padding from measurement var layoutSize = this.layout.size; x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; this.position.x = x; this.position.y = y; }; // set settled position, apply padding Item.prototype.layoutPosition = function() { var layoutSize = this.layout.size; var layoutOptions = this.layout.options; var style = {}; if ( layoutOptions.isOriginLeft ) { style.left = ( this.position.x + layoutSize.paddingLeft ) + 'px'; // reset other property style.right = ''; } else { style.right = ( this.position.x + layoutSize.paddingRight ) + 'px'; style.left = ''; } if ( layoutOptions.isOriginTop ) { style.top = ( this.position.y + layoutSize.paddingTop ) + 'px'; style.bottom = ''; } else { style.bottom = ( this.position.y + layoutSize.paddingBottom ) + 'px'; style.top = ''; } this.css( style ); this.emitEvent( 'layout', [ this ] ); }; // transform translate function var translate = is3d ? function( x, y ) { return 'translate3d(' + x + 'px, ' + y + 'px, 0)'; } : function( x, y ) { return 'translate(' + x + 'px, ' + y + 'px)'; }; Item.prototype._transitionTo = function( x, y ) { this.getPosition(); // get current x & y from top/left var curX = this.position.x; var curY = this.position.y; var compareX = parseInt( x, 10 ); var compareY = parseInt( y, 10 ); var didNotMove = compareX === this.position.x && compareY === this.position.y; // save end position this.setPosition( x, y ); // if did not move and not transitioning, just go to layout if ( didNotMove && !this.isTransitioning ) { this.layoutPosition(); return; } var transX = x - curX; var transY = y - curY; var transitionStyle = {}; // flip cooridinates if origin on right or bottom var layoutOptions = this.layout.options; transX = layoutOptions.isOriginLeft ? transX : -transX; transY = layoutOptions.isOriginTop ? transY : -transY; transitionStyle.transform = translate( transX, transY ); this.transition({ to: transitionStyle, onTransitionEnd: this.layoutPosition, isCleaning: true }); }; // non transition + transform support Item.prototype.goTo = function( x, y ) { this.setPosition( x, y ); this.layoutPosition(); }; // use transition and transforms if supported Item.prototype.moveTo = supportsCSS3 ? Item.prototype._transitionTo : Item.prototype.goTo; Item.prototype.setPosition = function( x, y ) { this.position.x = parseInt( x, 10 ); this.position.y = parseInt( y, 10 ); }; // ----- transition ----- // /** * @param {Object} style - CSS * @param {Function} onTransitionEnd */ // non transition, just trigger callback Item.prototype._nonTransition = function( args ) { this.css( args.to ); if ( args.isCleaning ) { this._removeStyles( args.to ); } if ( args.onTransitionEnd ) { args.onTransitionEnd.call( this ); } }; /** * proper transition * @param {Object} args - arguments * @param {Object} to - style to transition to * @param {Object} from - style to start transition from * @param {Boolean} isCleaning - removes transition styles after transition * @param {Function} onTransitionEnd - callback */ Item.prototype._transition = function( args ) { // redirect to nonTransition if no transition duration var transitionDuration = this.layout.options.transitionDuration; if ( !parseFloat( transitionDuration ) ) { this._nonTransition( args ); return; } var style = args.to; // make transition: foo, bar, baz from style object var transitionValue = []; for ( var prop in style ) { transitionValue.push( prop ); } // enable transition var transitionStyle = {}; transitionStyle.transitionProperty = transitionValue.join(','); transitionStyle.transitionDuration = transitionDuration; this.element.addEventListener( transitionEndEvent, this, false ); // if there's stuff to do after the transition if ( args.isCleaning || args.onTransitionEnd ) { this.on( 'transitionEnd', function( _this ) { // remove transition styles after transition if ( args.isCleaning ) { _this._removeStyles( style ); } // trigger callback now that transition has ended if ( args.onTransitionEnd ) { args.onTransitionEnd.call( _this ); } return true; // bind once }); } // set from styles if ( args.from ) { this.css( args.from ); // force redraw. http://blog.alexmaccaw.com/css-transitions var h = this.element.offsetHeight; // hack for JSHint to hush about unused var h = null; } // set transition styles, to enable transition this.css( transitionStyle ); // set styles that are transitioning this.css( style ); this.isTransitioning = true; }; Item.prototype.transition = Item.prototype[ transitionProperty ? '_transition' : '_nonTransition' ]; // ----- events ----- // Item.prototype.onwebkitTransitionEnd = function( event ) { this.ontransitionend( event ); }; Item.prototype.onotransitionend = function( event ) { this.ontransitionend( event ); }; Item.prototype.ontransitionend = function( event ) { // console.log('transition end'); // disregard bubbled events from children if ( event.target !== this.element ) { return; } this.removeTransitionStyles(); this.element.removeEventListener( transitionEndEvent, this, false ); this.isTransitioning = false; this.emitEvent( 'transitionEnd', [ this ] ); }; /** * removes style property from element * @param {Object} style **/ Item.prototype._removeStyles = function( style ) { // clean up transition styles var cleanStyle = {}; for ( var prop in style ) { cleanStyle[ prop ] = ''; } this.css( cleanStyle ); }; var cleanTransitionStyle = { transitionProperty: '', transitionDuration: '' }; Item.prototype.removeTransitionStyles = function() { // remove transition this.css( cleanTransitionStyle ); }; // ----- show/hide/remove ----- // // remove element from DOM Item.prototype.removeElem = function() { this.element.parentNode.removeChild( this.element ); this.emitEvent( 'remove', [ this ] ); }; Item.prototype.remove = transitionProperty ? function() { // start transition var _this = this; this.on( 'transitionEnd', function() { _this.removeElem(); return true; // bind once }); this.hide(); // if no transition just remove element } : Item.prototype.removeElem; Item.prototype.reveal = function() { // remove display: none this.css({ display: '' }); var options = this.layout.options; this.transition({ from: options.hiddenStyle, to: options.visibleStyle, isCleaning: true }); }; Item.prototype.hide = function() { // remove display: none this.css({ display: '' }); var options = this.layout.options; this.transition({ from: options.visibleStyle, to: options.hiddenStyle, // keep hidden stuff hidden isCleaning: true, onTransitionEnd: function() { this.css({ display: 'none' }); } }); }; Item.prototype.destroy = function() { this.css({ position: '', left: '', right: '', top: '', bottom: '', transition: '', transform: '' }); }; // -------------------------- -------------------------- // // publicize window.Outlayer = { Item: Item }; })( window ); /*! * Outlayer v1.0.0 * the brains and guts of a layout library */ ( function( window ) { 'use strict'; // Outlayer classes var _Outlayer = window.Outlayer; var Item = _Outlayer.Item; // dependencies var docReady = window.docReady; var EventEmitter = window.EventEmitter; var eventie = window.eventie; var getSize = window.getSize; var matchesSelector = window.matchesSelector; // ----- vars ----- // var document = window.document; var console = window.console; var jQuery = window.jQuery; var noop = function() {}; // -------------------------- helpers -------------------------- // // extend objects function extend( a, b ) { for ( var prop in b ) { a[ prop ] = b[ prop ]; } return a; } var objToString = Object.prototype.toString; function isArray( obj ) { return objToString.call( obj ) === '[object Array]'; } // turn element or nodeList into an array function makeArray( obj ) { var ary = []; if ( isArray( obj ) ) { // use object if already an array ary = obj; } else if ( typeof obj.length === 'number' ) { // convert nodeList to array for ( var i=0, len = obj.length; i < len; i++ ) { ary.push( obj[i] ); } } else { // array of single index ary.push( obj ); } return ary; } // http://stackoverflow.com/a/384380/182183 var isElement = ( typeof HTMLElement === 'object' ) ? function isElementDOM2( obj ) { return obj instanceof HTMLElement; } : function isElementQuirky( obj ) { return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string'; }; // index of helper cause IE8 var indexOf = Array.prototype.indexOf ? function( ary, obj ) { return ary.indexOf( obj ); } : function( ary, obj ) { for ( var i=0, len = ary.length; i < len; i++ ) { if ( ary[i] === obj ) { return i; } } return -1; }; // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ function toDashed( str ) { return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { return $1 + '-' + $2; }).toLowerCase(); } // -------------------------- Outlayer -------------------------- // // globally unique identifiers var GUID = 0; // internal store of all Outlayer intances var instances = {}; /** * @param {Element, String} element * @param {Object} options * @constructor */ function Outlayer( element, options ) { // use element as selector string if ( typeof element === 'string' ) { element = document.querySelector( element ); } // bail out if not proper element if ( !element || !isElement( element ) ) { if ( console ) { console.error( 'Bad ' + this.settings.namespace + ' element: ' + element ); } return; } this.element = element; // options this.options = extend( {}, this.options ); extend( this.options, options ); // add id for Outlayer.getFromElement var id = ++GUID; this.element.outlayerGUID = id; // expando instances[ id ] = this; // associate via id // kick it off this._create(); if ( this.options.isInitLayout ) { this.layout(); } } // settings are for internal use only Outlayer.prototype.settings = { namespace: 'outlayer', item: _Outlayer.Item }; // default options Outlayer.prototype.options = { containerStyle: { position: 'relative' }, isInitLayout: true, isOriginLeft: true, isOriginTop: true, isResizeBound: true, // item options transitionDuration: '0.4s', hiddenStyle: { opacity: 0, transform: 'scale(0.001)' }, visibleStyle: { opacity: 1, transform: 'scale(1)' } }; // inherit EventEmitter extend( Outlayer.prototype, EventEmitter.prototype ); Outlayer.prototype._create = function() { // get items from children this.reloadItems(); // elements that affect layout, but are not laid out this.stamps = []; this.stamp( this.options.stamp ); // set container style extend( this.element.style, this.options.containerStyle ); // bind resize method if ( this.options.isResizeBound ) { this.bindResize(); } }; // goes through all children again and gets bricks in proper order Outlayer.prototype.reloadItems = function() { // collection of item elements this.items = this._getItems( this.element.children ); }; /** * get item elements to be used in layout * @param {Array or NodeList or HTMLElement} elems * @returns {Array} items - collection of new Outlayer Items */ Outlayer.prototype._getItems = function( elems ) { var itemElems = this._filterFindItemElements( elems ); var Item = this.settings.item; // create new Outlayer Items for collection var items = []; for ( var i=0, len = itemElems.length; i < len; i++ ) { var elem = itemElems[i]; var item = new Item( elem, this, this.options.itemOptions ); items.push( item ); } return items; }; /** * get item elements to be used in layout * @param {Array or NodeList or HTMLElement} elems * @returns {Array} items - item elements */ Outlayer.prototype._filterFindItemElements = function( elems ) { // make array of elems elems = makeArray( elems ); var itemSelector = this.options.itemSelector; if ( !itemSelector ) { return elems; } var itemElems = []; // filter & find items if we have an item selector for ( var i=0, len = elems.length; i < len; i++ ) { var elem = elems[i]; // filter siblings if ( matchesSelector( elem, itemSelector ) ) { itemElems.push( elem ); } // find children var childElems = elem.querySelectorAll( itemSelector ); // concat childElems to filterFound array for ( var j=0, jLen = childElems.length; j < jLen; j++ ) { itemElems.push( childElems[j] ); } } return itemElems; }; /** * getter method for getting item elements * @returns {Array} elems - collection of item elements */ Outlayer.prototype.getItemElements = function() { var elems = []; for ( var i=0, len = this.items.length; i < len; i++ ) { elems.push( this.items[i].element ); } return elems; }; // ----- init & layout ----- // /** * lays out all items */ Outlayer.prototype.layout = function() { this._resetLayout(); this._manageStamps(); // don't animate first layout var isInstant = this.options.isLayoutInstant !== undefined ? this.options.isLayoutInstant : !this._isLayoutInited; this.layoutItems( this.items, isInstant ); // flag for initalized this._isLayoutInited = true; }; // _init is alias for layout Outlayer.prototype._init = Outlayer.prototype.layout; /** * logic before any new layout */ Outlayer.prototype._resetLayout = function() { this.getSize(); }; Outlayer.prototype.getSize = function() { this.size = getSize( this.element ); }; /** * get measurement from option, for columnWidth, rowHeight, gutter * if option is String -> get element from selector string, & get size of element * if option is Element -> get size of element * else use option as a number * * @param {String} measurement * @param {String} size - width or height * @private */ Outlayer.prototype._getMeasurement = function( measurement, size ) { var option = this.options[ measurement ]; var elem; if ( !option ) { // default to 0 this[ measurement ] = 0; } else { if ( typeof option === 'string' ) { elem = this.element.querySelector( option ); } else if ( isElement( option ) ) { elem = option; } // use size of element, if element this[ measurement ] = elem ? getSize( elem )[ size ] : option; } }; /** * layout a collection of item elements * @api public */ Outlayer.prototype.layoutItems = function( items, isInstant ) { items = this._getItemsForLayout( items ); this._layoutItems( items, isInstant ); this._postLayout(); }; /** * get the items to be laid out * you may want to skip over some items * @param {Array} items * @returns {Array} items */ Outlayer.prototype._getItemsForLayout = function( items ) { var layoutItems = []; for ( var i=0, len = items.length; i < len; i++ ) { var item = items[i]; if ( !item.isIgnored ) { layoutItems.push( item ); } } return layoutItems; }; /** * layout items * @param {Array} items * @param {Boolean} isInstant */ Outlayer.prototype._layoutItems = function( items, isInstant ) { if ( !items || !items.length ) { // no items, emit event with empty array this.emitEvent( 'layoutComplete', [ this, items ] ); return; } // emit layoutComplete when done this._itemsOn( items, 'layout', function onItemsLayout() { this.emitEvent( 'layoutComplete', [ this, items ] ); }); var queue = []; for ( var i=0, len = items.length; i < len; i++ ) { var item = items[i]; // get x/y object from method var position = this._getItemLayoutPosition( item ); // enqueue position.item = item; position.isInstant = isInstant; queue.push( position ); } this._processLayoutQueue( queue ); }; /** * get item layout position * @param {Outlayer.Item} item * @returns {Object} x and y position */ Outlayer.prototype._getItemLayoutPosition = function( /* item */ ) { return { x: 0, y: 0 }; }; /** * iterate over array and position each item * Reason being - separating this logic prevents 'layout invalidation' * thx @paul_irish * @param {Array} queue */ Outlayer.prototype._processLayoutQueue = function( queue ) { for ( var i=0, len = queue.length; i < len; i++ ) { var obj = queue[i]; this._positionItem( obj.item, obj.x, obj.y, obj.isInstant ); } }; /** * Sets position of item in DOM * @param {Outlayer.Item} item * @param {Number} x - horizontal position * @param {Number} y - vertical position * @param {Boolean} isInstant - disables transitions */ Outlayer.prototype._positionItem = function( item, x, y, isInstant ) { if ( isInstant ) { // if not transition, just set CSS item.goTo( x, y ); } else { item.moveTo( x, y ); } }; /** * Any logic you want to do after each layout, * i.e. size the container */ Outlayer.prototype._postLayout = function() { var size = this._getContainerSize(); if ( size ) { this._setContainerMeasure( size.width, true ); this._setContainerMeasure( size.height, false ); } }; /** * @returns {Object} size * @param {Number} width * @param {Number} height */ Outlayer.prototype._getContainerSize = noop; /** * @param {Number} measure - size of width or height * @param {Boolean} isWidth */ Outlayer.prototype._setContainerMeasure = function( measure, isWidth ) { if ( measure === undefined ) { return; } var elemSize = this.size; // add padding and border width if border box if ( elemSize.isBorderBox ) { measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + elemSize.borderLeftWidth + elemSize.borderRightWidth : elemSize.paddingBottom + elemSize.paddingTop + elemSize.borderTopWidth + elemSize.borderBottomWidth; } measure = Math.max( measure, 0 ); this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px'; }; /** * trigger a callback for a collection of items events * @param {Array} items - Outlayer.Items * @param {String} eventName * @param {Function} callback */ Outlayer.prototype._itemsOn = function( items, eventName, callback ) { var doneCount = 0; var count = items.length; // event callback var _this = this; function tick() { doneCount++; if ( doneCount === count ) { callback.call( _this ); } return true; // bind once } // bind callback for ( var i=0, len = items.length; i < len; i++ ) { var item = items[i]; item.on( eventName, tick ); } }; // -------------------------- ignore & stamps -------------------------- // /** * keep item in collection, but do not lay it out * ignored items do not get skipped in layout * @param {Element} elem */ Outlayer.prototype.ignore = function( elem ) { var item = this.getItem( elem ); if ( item ) { item.isIgnored = true; } }; /** * return item to layout collection * @param {Element} elem */ Outlayer.prototype.unignore = function( elem ) { var item = this.getItem( elem ); if ( item ) { delete item.isIgnored; } }; /** * adds elements to stamps * @param {NodeList, Array, Element, or String} elems */ Outlayer.prototype.stamp = function( elems ) { elems = this._find( elems ); if ( !elems ) { return; } this.stamps = this.stamps.concat( elems ); // ignore for ( var i=0, len = elems.length; i < len; i++ ) { var elem = elems[i]; this.ignore( elem ); } }; /** * removes elements to stamps * @param {NodeList, Array, or Element} elems */ Outlayer.prototype.unstamp = function( elems ) { elems = this._find( elems ); if ( !elems ){ return; } for ( var i=0, len = elems.length; i < len; i++ ) { var elem = elems[i]; // filter out removed stamp elements var index = indexOf( this.stamps, elem ); if ( index !== -1 ) { this.stamps.splice( index, 1 ); } this.unignore( elem ); } }; /** * finds child elements * @param {NodeList, Array, Element, or String} elems * @returns {Array} elems */ Outlayer.prototype._find = function( elems ) { if ( !elems ) { return; } // if string, use argument as selector string if ( typeof elems === 'string' ) { elems = this.element.querySelectorAll( elems ); } elems = makeArray( elems ); return elems; }; Outlayer.prototype._manageStamps = function() { if ( !this.stamps || !this.stamps.length ) { return; } this._getBoundingRect(); for ( var i=0, len = this.stamps.length; i < len; i++ ) { var stamp = this.stamps[i]; this._manageStamp( stamp ); } }; // update boundingLeft / Top Outlayer.prototype._getBoundingRect = function() { // get bounding rect for container element var boundingRect = this.element.getBoundingClientRect(); var size = this.size; this._boundingRect = { left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, top: boundingRect.top + size.paddingTop + size.borderTopWidth, right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ), bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth ) }; }; /** * @param {Element} stamp **/ Outlayer.prototype._manageStamp = noop; /** * get x/y position of element relative to container element * @param {Element} elem * @returns {Object} offset - has left, top, right, bottom */ Outlayer.prototype._getElementOffset = function( elem ) { var boundingRect = elem.getBoundingClientRect(); var thisRect = this._boundingRect; var size = getSize( elem ); var offset = { left: boundingRect.left - thisRect.left - size.marginLeft, top: boundingRect.top - thisRect.top - size.marginTop, right: thisRect.right - boundingRect.right - size.marginRight, bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom }; return offset; }; // -------------------------- resize -------------------------- // // enable event handlers for listeners // i.e. resize -> onresize Outlayer.prototype.handleEvent = function( event ) { var method = 'on' + event.type; if ( this[ method ] ) { this[ method ]( event ); } }; /** * Bind layout to window resizing */ Outlayer.prototype.bindResize = function() { // bind just one listener if ( this.isResizeBound ) { return; } eventie.bind( window, 'resize', this ); this.isResizeBound = true; }; /** * Unbind layout to window resizing */ Outlayer.prototype.unbindResize = function() { eventie.unbind( window, 'resize', this ); this.isResizeBound = false; }; // original debounce by John Hann // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ // this fires every resize Outlayer.prototype.onresize = function() { if ( this.resizeTimeout ) { clearTimeout( this.resizeTimeout ); } var _this = this; function delayed() { _this.resize(); } this.resizeTimeout = setTimeout( delayed, 100 ); }; // debounced, layout on resize Outlayer.prototype.resize = function() { // don't trigger if size did not change var size = getSize( this.element ); // check that this.size and size are there // IE8 triggers resize on body size change, so they might not be var hasSizes = this.size && size; if ( hasSizes && size.innerWidth === this.size.innerWidth ) { return; } this.layout(); delete this.resizeTimeout; }; // -------------------------- methods -------------------------- // /** * add items to Outlayer instance * @param {Array or NodeList or Element} elems * @returns {Array} items - Outlayer.Items **/ Outlayer.prototype.addItems = function( elems ) { var items = this._getItems( elems ); if ( !items.length ) { return; } // add items to collection this.items = this.items.concat( items ); return items; }; /** * Layout newly-appended item elements * @param {Array or NodeList or Element} elems */ Outlayer.prototype.appended = function( elems ) { var items = this.addItems( elems ); if ( !items.length ) { return; } // layout and reveal just the new items this.layoutItems( items, true ); this.reveal( items ); }; /** * Layout prepended elements * @param {Array or NodeList or Element} elems */ Outlayer.prototype.prepended = function( elems ) { var items = this._getItems( elems ); if ( !items.length ) { return; } // add items to beginning of collection var previousItems = this.items.slice(0); this.items = items.concat( previousItems ); // start new layout this._resetLayout(); // layout new stuff without transition this.layoutItems( items, true ); this.reveal( items ); // layout previous items this.layoutItems( previousItems ); }; /** * reveal a collection of items * @param {Array of Outlayer.Items} items */ Outlayer.prototype.reveal = function( items ) { if ( !items || !items.length ) { return; } for ( var i=0, len = items.length; i < len; i++ ) { var item = items[i]; item.reveal(); } }; /** * hide a collection of items * @param {Array of Outlayer.Items} items */ Outlayer.prototype.hide = function( items ) { if ( !items || !items.length ) { return; } for ( var i=0, len = items.length; i < len; i++ ) { var item = items[i]; item.hide(); } }; /** * get Outlayer.Item, given an Element * @param {Element} elem * @param {Function} callback * @returns {Outlayer.Item} item */ Outlayer.prototype.getItem = function( elem ) { // loop through items to get the one that matches for ( var i=0, len = this.items.length; i < len; i++ ) { var item = this.items[i]; if ( item.element === elem ) { // return item return item; } } }; /** * get collection of Outlayer.Items, given Elements * @param {Array} elems * @returns {Array} items - Outlayer.Items */ Outlayer.prototype.getItems = function( elems ) { if ( !elems || !elems.length ) { return; } var items = []; for ( var i=0, len = elems.length; i < len; i++ ) { var elem = elems[i]; var item = this.getItem( elem ); if ( item ) { items.push( item ); } } return items; }; /** * remove element(s) from instance and DOM * @param {Array or NodeList or Element} elems */ Outlayer.prototype.remove = function( elems ) { elems = makeArray( elems ); var removeItems = this.getItems( elems ); this._itemsOn( removeItems, 'remove', function() { this.emitEvent( 'removeComplete', [ this, removeItems ] ); }); for ( var i=0, len = removeItems.length; i < len; i++ ) { var item = removeItems[i]; item.remove(); // remove item from collection var index = indexOf( this.items, item ); this.items.splice( index, 1 ); } }; // ----- destroy ----- // // remove and disable Outlayer instance Outlayer.prototype.destroy = function() { // clean up dynamic styles var style = this.element.style; style.height = ''; style.position = ''; style.width = ''; // destroy items for ( var i=0, len = this.items.length; i < len; i++ ) { var item = this.items[i]; item.destroy(); } this.unbindResize(); delete this.element.outlayerGUID; }; // -------------------------- data -------------------------- // /** * get Outlayer instance from element * @param {Element} elem * @returns {Outlayer} */ Outlayer.data = function( elem ) { var id = elem && elem.outlayerGUID; return id && instances[ id ]; }; // -------------------------- -------------------------- // // copy an object on the Outlayer prototype // used in options and settings function copyOutlayerProto( obj, property ) { obj.prototype[ property ] = extend( {}, Outlayer.prototype[ property ] ); } // -------------------------- create Outlayer class -------------------------- // /** * create a layout class * @param {String} namespace */ Outlayer.create = function( namespace, options ) { // sub-class Outlayer function Layout() { Outlayer.apply( this, arguments ); } extend( Layout.prototype, Outlayer.prototype ); copyOutlayerProto( Layout, 'options' ); copyOutlayerProto( Layout, 'settings' ); extend( Layout.prototype.options, options ); Layout.prototype.settings.namespace = namespace; Layout.data = Outlayer.data; // sub-class Item Layout.Item = function LayoutItem() { Item.apply( this, arguments ); }; Layout.Item.prototype = new Outlayer.Item(); Layout.prototype.settings.item = Layout.Item; // -------------------------- declarative -------------------------- // /** * allow user to initialize Outlayer via .js-namespace class * options are parsed from data-namespace-option attribute */ docReady( function() { var dashedNamespace = toDashed( namespace ); var elems = document.querySelectorAll( '.js-' + dashedNamespace ); var dataAttr = 'data-' + dashedNamespace + '-options'; for ( var i=0, len = elems.length; i < len; i++ ) { var elem = elems[i]; var attr = elem.getAttribute( dataAttr ); var options; try { options = attr && JSON.parse( attr ); } catch ( error ) { // log error, do not initialize if ( console ) { console.error( 'Error parsing ' + dataAttr + ' on ' + elem.nodeName.toLowerCase() + ( elem.id ? '#' + elem.id : '' ) + ': ' + error ); } continue; } // initialize var instance = new Layout( elem, options ); // make available via $().data('layoutname') if ( jQuery ) { jQuery.data( elem, namespace, instance ); } } }); // -------------------------- jQuery bridge -------------------------- // // make into jQuery plugin if ( jQuery && jQuery.bridget ) { jQuery.bridget( namespace, Layout ); } return Layout; }; // -------------------------- transport -------------------------- // // back in global Outlayer.Item = Item; window.Outlayer = Outlayer; })( window ); /*! * Masonry v3.0.0 * Cascading grid layout library * http://masonry.desandro.com * MIT License * by David DeSandro */ ( function( window ) { 'use strict'; // vars // var document = window.document; // -------------------------- helpers -------------------------- // var indexOf = Array.prototype.indexOf ? function( items, value ) { return items.indexOf( value ); } : function ( items, value ) { for ( var i=0, len = items.length; i < len; i++ ) { var item = items[i]; if ( item === value ) { return i; } } return -1; }; // -------------------------- masonryDefinition -------------------------- // // used for AMD definition and requires function masonryDefinition( Outlayer, getSize ) { // create an Outlayer layout class var Masonry = Outlayer.create('masonry'); Masonry.prototype._resetLayout = function() { this.getSize(); this._getMeasurement( 'columnWidth', 'outerWidth' ); this._getMeasurement( 'gutter', 'outerWidth' ); this.measureColumns(); // reset column Y var i = this.cols; this.colYs = []; while (i--) { this.colYs.push( 0 ); } this.maxY = 0; }; Masonry.prototype.measureColumns = function() { // if columnWidth is 0, default to outerWidth of first item var firstItemElem = this.items[0].element; this.columnWidth = this.columnWidth || getSize( firstItemElem ).outerWidth; this.columnWidth += this.gutter; this.cols = Math.floor( ( this.size.innerWidth + this.gutter ) / this.columnWidth ); this.cols = Math.max( this.cols, 1 ); }; Masonry.prototype._getItemLayoutPosition = function( item ) { item.getSize(); // how many columns does this brick span var colSpan = Math.ceil( item.size.outerWidth / this.columnWidth ); colSpan = Math.min( colSpan, this.cols ); var colGroup = this._getColGroup( colSpan ); // get the minimum Y value from the columns var minimumY = Math.min.apply( Math, colGroup ); var shortColIndex = indexOf( colGroup, minimumY ); // position the brick var position = { x: this.columnWidth * shortColIndex, y: minimumY }; // apply setHeight to necessary columns var setHeight = minimumY + item.size.outerHeight; var setSpan = this.cols + 1 - colGroup.length; for ( var i = 0; i < setSpan; i++ ) { this.colYs[ shortColIndex + i ] = setHeight; } return position; }; /** * @param {Number} colSpan - number of columns the element spans * @returns {Array} colGroup */ Masonry.prototype._getColGroup = function( colSpan ) { if ( colSpan === 1 ) { // if brick spans only one column, use all the column Ys return this.colYs; } var colGroup = []; // how many different places could this brick fit horizontally var groupCount = this.cols + 1 - colSpan; // for each group potential horizontal position for ( var i = 0; i < groupCount; i++ ) { // make an array of colY values for that one group var groupColYs = this.colYs.slice( i, i + colSpan ); // and get the max value of the array colGroup[i] = Math.max.apply( Math, groupColYs ); } return colGroup; }; Masonry.prototype._manageStamp = function( stamp ) { var stampSize = getSize( stamp ); var offset = this._getElementOffset( stamp ); // get the columns that this stamp affects var firstX = this.options.isOriginLeft ? offset.left : offset.right; var lastX = firstX + stampSize.outerWidth; var firstCol = Math.floor( firstX / this.columnWidth ); firstCol = Math.max( 0, firstCol ); var lastCol = Math.floor( lastX / this.columnWidth ); lastCol = Math.min( this.cols - 1, lastCol ); // set colYs to bottom of the stamp var stampMaxY = ( this.options.isOriginTop ? offset.top : offset.bottom ) + stampSize.outerHeight; for ( var i = firstCol; i <= lastCol; i++ ) { this.colYs[i] = Math.max( stampMaxY, this.colYs[i] ); } }; Masonry.prototype._getContainerSize = function() { this.maxY = Math.max.apply( Math, this.colYs ); return { height: this.maxY }; }; return Masonry; } // -------------------------- transport -------------------------- // if ( typeof define === 'function' && define.amd ) { // AMD define( [ 'outlayer', 'get-size' ], masonryDefinition ); } else { // browser global window.Masonry = masonryDefinition( window.Outlayer, window.getSize ); } })( window );
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-masonry.js
jquery-masonry.js
(function($,window,undefined){ $.fn.jScrollPane = function(settings) { // JScrollPane "class" - public methods are available through $('selector').data('jsp') function JScrollPane(elem, s) { var settings, jsp = this, pane, paneWidth, paneHeight, container, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableV, isScrollableH, verticalDrag, dragMaxY, verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition, verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown, horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight, reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth, wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false, originalElement = elem.clone(false, false).empty(), mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp'; originalPadding = elem.css('paddingTop') + ' ' + elem.css('paddingRight') + ' ' + elem.css('paddingBottom') + ' ' + elem.css('paddingLeft'); originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft'), 10) || 0) + (parseInt(elem.css('paddingRight'), 10) || 0); function initialise(s) { var /*firstChild, lastChild, */isMaintainingPositon, lastContentX, lastContentY, hasContainingSpaceChanged, originalScrollTop, originalScrollLeft, maintainAtBottom = false, maintainAtRight = false; settings = s; if (pane === undefined) { originalScrollTop = elem.scrollTop(); originalScrollLeft = elem.scrollLeft(); elem.css( { overflow: 'hidden', padding: 0 } ); // TODO: Deal with where width/ height is 0 as it probably means the element is hidden and we should // come back to it later and check once it is unhidden... paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); elem.width(paneWidth); pane = $('<div class="jspPane" />').css('padding', originalPadding).append(elem.children()); container = $('<div class="jspContainer" />') .css({ 'width': paneWidth + 'px', 'height': paneHeight + 'px' } ).append(pane).appendTo(elem); /* // Move any margins from the first and last children up to the container so they can still // collapse with neighbouring elements as they would before jScrollPane firstChild = pane.find(':first-child'); lastChild = pane.find(':last-child'); elem.css( { 'margin-top': firstChild.css('margin-top'), 'margin-bottom': lastChild.css('margin-bottom') } ); firstChild.css('margin-top', 0); lastChild.css('margin-bottom', 0); */ } else { elem.css('width', ''); maintainAtBottom = settings.stickToBottom && isCloseToBottom(); maintainAtRight = settings.stickToRight && isCloseToRight(); hasContainingSpaceChanged = elem.innerWidth() + originalPaddingTotalWidth != paneWidth || elem.outerHeight() != paneHeight; if (hasContainingSpaceChanged) { paneWidth = elem.innerWidth() + originalPaddingTotalWidth; paneHeight = elem.innerHeight(); container.css({ width: paneWidth + 'px', height: paneHeight + 'px' }); } // If nothing changed since last check... if (!hasContainingSpaceChanged && previousContentWidth == contentWidth && pane.outerHeight() == contentHeight) { elem.width(paneWidth); return; } previousContentWidth = contentWidth; pane.css('width', ''); elem.width(paneWidth); container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end(); } pane.css('overflow', 'auto'); if (s.contentWidth) { contentWidth = s.contentWidth; } else { contentWidth = pane[0].scrollWidth; } contentHeight = pane[0].scrollHeight; pane.css('overflow', ''); percentInViewH = contentWidth / paneWidth; percentInViewV = contentHeight / paneHeight; isScrollableV = percentInViewV > 1; isScrollableH = percentInViewH > 1; //console.log(paneWidth, paneHeight, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableH, isScrollableV); if (!(isScrollableH || isScrollableV)) { elem.removeClass('jspScrollable'); pane.css({ top: 0, width: container.width() - originalPaddingTotalWidth }); removeMousewheel(); removeFocusHandler(); removeKeyboardNav(); removeClickOnTrack(); } else { elem.addClass('jspScrollable'); isMaintainingPositon = settings.maintainPosition && (verticalDragPosition || horizontalDragPosition); if (isMaintainingPositon) { lastContentX = contentPositionX(); lastContentY = contentPositionY(); } initialiseVerticalScroll(); initialiseHorizontalScroll(); resizeScrollbars(); if (isMaintainingPositon) { scrollToX(maintainAtRight ? (contentWidth - paneWidth ) : lastContentX, false); scrollToY(maintainAtBottom ? (contentHeight - paneHeight) : lastContentY, false); } initFocusHandler(); initMousewheel(); initTouch(); if (settings.enableKeyboardNavigation) { initKeyboardNav(); } if (settings.clickOnTrack) { initClickOnTrack(); } observeHash(); if (settings.hijackInternalLinks) { hijackInternalLinks(); } } if (settings.autoReinitialise && !reinitialiseInterval) { reinitialiseInterval = setInterval( function() { initialise(settings); }, settings.autoReinitialiseDelay ); } else if (!settings.autoReinitialise && reinitialiseInterval) { clearInterval(reinitialiseInterval); } originalScrollTop && elem.scrollTop(0) && scrollToY(originalScrollTop, false); originalScrollLeft && elem.scrollLeft(0) && scrollToX(originalScrollLeft, false); elem.trigger('jsp-initialised', [isScrollableH || isScrollableV]); } function initialiseVerticalScroll() { if (isScrollableV) { container.append( $('<div class="jspVerticalBar" />').append( $('<div class="jspCap jspCapTop" />'), $('<div class="jspTrack" />').append( $('<div class="jspDrag" />').append( $('<div class="jspDragTop" />'), $('<div class="jspDragBottom" />') ) ), $('<div class="jspCap jspCapBottom" />') ) ); verticalBar = container.find('>.jspVerticalBar'); verticalTrack = verticalBar.find('>.jspTrack'); verticalDrag = verticalTrack.find('>.jspDrag'); if (settings.showArrows) { arrowUp = $('<a class="jspArrow jspArrowUp" />').bind( 'mousedown.jsp', getArrowScroll(0, -1) ).bind('click.jsp', nil); arrowDown = $('<a class="jspArrow jspArrowDown" />').bind( 'mousedown.jsp', getArrowScroll(0, 1) ).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp)); arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown)); } appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown); } verticalTrackHeight = paneHeight; container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each( function() { verticalTrackHeight -= $(this).outerHeight(); } ); verticalDrag.hover( function() { verticalDrag.addClass('jspHover'); }, function() { verticalDrag.removeClass('jspHover'); } ).bind( 'mousedown.jsp', function(e) { // Stop IE from allowing text selection $('html').bind('dragstart.jsp selectstart.jsp', nil); verticalDrag.addClass('jspActive'); var startY = e.pageY - verticalDrag.position().top; $('html').bind( 'mousemove.jsp', function(e) { positionDragY(e.pageY - startY, false); } ).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false; } ); sizeVerticalScrollbar(); } } function sizeVerticalScrollbar() { verticalTrack.height(verticalTrackHeight + 'px'); verticalDragPosition = 0; scrollbarWidth = settings.verticalGutter + verticalTrack.outerWidth(); // Make the pane thinner to allow for the vertical scrollbar pane.width(paneWidth - scrollbarWidth - originalPaddingTotalWidth); // Add margin to the left of the pane if scrollbars are on that side (to position // the scrollbar on the left or right set it's left or right property in CSS) try { if (verticalBar.position().left === 0) { pane.css('margin-left', scrollbarWidth + 'px'); } } catch (err) { } } function initialiseHorizontalScroll() { if (isScrollableH) { container.append( $('<div class="jspHorizontalBar" />').append( $('<div class="jspCap jspCapLeft" />'), $('<div class="jspTrack" />').append( $('<div class="jspDrag" />').append( $('<div class="jspDragLeft" />'), $('<div class="jspDragRight" />') ) ), $('<div class="jspCap jspCapRight" />') ) ); horizontalBar = container.find('>.jspHorizontalBar'); horizontalTrack = horizontalBar.find('>.jspTrack'); horizontalDrag = horizontalTrack.find('>.jspDrag'); if (settings.showArrows) { arrowLeft = $('<a class="jspArrow jspArrowLeft" />').bind( 'mousedown.jsp', getArrowScroll(-1, 0) ).bind('click.jsp', nil); arrowRight = $('<a class="jspArrow jspArrowRight" />').bind( 'mousedown.jsp', getArrowScroll(1, 0) ).bind('click.jsp', nil); if (settings.arrowScrollOnHover) { arrowLeft.bind('mouseover.jsp', getArrowScroll(-1, 0, arrowLeft)); arrowRight.bind('mouseover.jsp', getArrowScroll(1, 0, arrowRight)); } appendArrows(horizontalTrack, settings.horizontalArrowPositions, arrowLeft, arrowRight); } horizontalDrag.hover( function() { horizontalDrag.addClass('jspHover'); }, function() { horizontalDrag.removeClass('jspHover'); } ).bind( 'mousedown.jsp', function(e) { // Stop IE from allowing text selection $('html').bind('dragstart.jsp selectstart.jsp', nil); horizontalDrag.addClass('jspActive'); var startX = e.pageX - horizontalDrag.position().left; $('html').bind( 'mousemove.jsp', function(e) { positionDragX(e.pageX - startX, false); } ).bind('mouseup.jsp mouseleave.jsp', cancelDrag); return false; } ); horizontalTrackWidth = container.innerWidth(); sizeHorizontalScrollbar(); } } function sizeHorizontalScrollbar() { container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each( function() { horizontalTrackWidth -= $(this).outerWidth(); } ); horizontalTrack.width(horizontalTrackWidth + 'px'); horizontalDragPosition = 0; } function resizeScrollbars() { if (isScrollableH && isScrollableV) { var horizontalTrackHeight = horizontalTrack.outerHeight(), verticalTrackWidth = verticalTrack.outerWidth(); verticalTrackHeight -= horizontalTrackHeight; $(horizontalBar).find('>.jspCap:visible,>.jspArrow').each( function() { horizontalTrackWidth += $(this).outerWidth(); } ); horizontalTrackWidth -= verticalTrackWidth; paneHeight -= verticalTrackWidth; paneWidth -= horizontalTrackHeight; horizontalTrack.parent().append( $('<div class="jspCorner" />').css('width', horizontalTrackHeight + 'px') ); sizeVerticalScrollbar(); sizeHorizontalScrollbar(); } // reflow content if (isScrollableH) { pane.width((container.outerWidth() - originalPaddingTotalWidth) + 'px'); } contentHeight = pane.outerHeight(); percentInViewV = contentHeight / paneHeight; if (isScrollableH) { horizontalDragWidth = Math.ceil(1 / percentInViewH * horizontalTrackWidth); if (horizontalDragWidth > settings.horizontalDragMaxWidth) { horizontalDragWidth = settings.horizontalDragMaxWidth; } else if (horizontalDragWidth < settings.horizontalDragMinWidth) { horizontalDragWidth = settings.horizontalDragMinWidth; } horizontalDrag.width(horizontalDragWidth + 'px'); dragMaxX = horizontalTrackWidth - horizontalDragWidth; _positionDragX(horizontalDragPosition); // To update the state for the arrow buttons } if (isScrollableV) { verticalDragHeight = Math.ceil(1 / percentInViewV * verticalTrackHeight); if (verticalDragHeight > settings.verticalDragMaxHeight) { verticalDragHeight = settings.verticalDragMaxHeight; } else if (verticalDragHeight < settings.verticalDragMinHeight) { verticalDragHeight = settings.verticalDragMinHeight; } verticalDrag.height(verticalDragHeight + 'px'); dragMaxY = verticalTrackHeight - verticalDragHeight; _positionDragY(verticalDragPosition); // To update the state for the arrow buttons } } function appendArrows(ele, p, a1, a2) { var p1 = "before", p2 = "after", aTemp; // Sniff for mac... Is there a better way to determine whether the arrows would naturally appear // at the top or the bottom of the bar? if (p == "os") { p = /Mac/.test(navigator.platform) ? "after" : "split"; } if (p == p1) { p2 = p; } else if (p == p2) { p1 = p; aTemp = a1; a1 = a2; a2 = aTemp; } ele[p1](a1)[p2](a2); } function getArrowScroll(dirX, dirY, ele) { return function() { arrowScroll(dirX, dirY, this, ele); this.blur(); return false; }; } function arrowScroll(dirX, dirY, arrow, ele) { arrow = $(arrow).addClass('jspActive'); var eve, scrollTimeout, isFirst = true, doScroll = function() { if (dirX !== 0) { jsp.scrollByX(dirX * settings.arrowButtonSpeed); } if (dirY !== 0) { jsp.scrollByY(dirY * settings.arrowButtonSpeed); } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.arrowRepeatFreq); isFirst = false; }; doScroll(); eve = ele ? 'mouseout.jsp' : 'mouseup.jsp'; ele = ele || $('html'); ele.bind( eve, function() { arrow.removeClass('jspActive'); scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; ele.unbind(eve); } ); } function initClickOnTrack() { removeClickOnTrack(); if (isScrollableV) { verticalTrack.bind( 'mousedown.jsp', function(e) { if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) { var clickedTrack = $(this), offset = clickedTrack.offset(), direction = e.pageY - offset.top - verticalDragPosition, scrollTimeout, isFirst = true, doScroll = function() { var offset = clickedTrack.offset(), pos = e.pageY - offset.top - verticalDragHeight / 2, contentDragY = paneHeight * settings.scrollPagePercent, dragY = dragMaxY * contentDragY / (contentHeight - paneHeight); if (direction < 0) { if (verticalDragPosition - dragY > pos) { jsp.scrollByY(-contentDragY); } else { positionDragY(pos); } } else if (direction > 0) { if (verticalDragPosition + dragY < pos) { jsp.scrollByY(contentDragY); } else { positionDragY(pos); } } else { cancelClick(); return; } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq); isFirst = false; }, cancelClick = function() { scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; $(document).unbind('mouseup.jsp', cancelClick); }; doScroll(); $(document).bind('mouseup.jsp', cancelClick); return false; } } ); } if (isScrollableH) { horizontalTrack.bind( 'mousedown.jsp', function(e) { if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) { var clickedTrack = $(this), offset = clickedTrack.offset(), direction = e.pageX - offset.left - horizontalDragPosition, scrollTimeout, isFirst = true, doScroll = function() { var offset = clickedTrack.offset(), pos = e.pageX - offset.left - horizontalDragWidth / 2, contentDragX = paneWidth * settings.scrollPagePercent, dragX = dragMaxX * contentDragX / (contentWidth - paneWidth); if (direction < 0) { if (horizontalDragPosition - dragX > pos) { jsp.scrollByX(-contentDragX); } else { positionDragX(pos); } } else if (direction > 0) { if (horizontalDragPosition + dragX < pos) { jsp.scrollByX(contentDragX); } else { positionDragX(pos); } } else { cancelClick(); return; } scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq); isFirst = false; }, cancelClick = function() { scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; $(document).unbind('mouseup.jsp', cancelClick); }; doScroll(); $(document).bind('mouseup.jsp', cancelClick); return false; } } ); } } function removeClickOnTrack() { if (horizontalTrack) { horizontalTrack.unbind('mousedown.jsp'); } if (verticalTrack) { verticalTrack.unbind('mousedown.jsp'); } } function cancelDrag() { $('html').unbind('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp'); if (verticalDrag) { verticalDrag.removeClass('jspActive'); } if (horizontalDrag) { horizontalDrag.removeClass('jspActive'); } } function positionDragY(destY, animate) { if (!isScrollableV) { return; } if (destY < 0) { destY = 0; } else if (destY > dragMaxY) { destY = dragMaxY; } // can't just check if(animate) because false is a valid value that could be passed in... if (animate === undefined) { animate = settings.animateScroll; } if (animate) { jsp.animate(verticalDrag, 'top', destY, _positionDragY); } else { verticalDrag.css('top', destY); _positionDragY(destY); } } function _positionDragY(destY) { if (destY === undefined) { destY = verticalDrag.position().top; } container.scrollTop(0); verticalDragPosition = destY; var isAtTop = verticalDragPosition === 0, isAtBottom = verticalDragPosition == dragMaxY, percentScrolled = destY/ dragMaxY, destTop = -percentScrolled * (contentHeight - paneHeight); if (wasAtTop != isAtTop || wasAtBottom != isAtBottom) { wasAtTop = isAtTop; wasAtBottom = isAtBottom; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); } updateVerticalArrows(isAtTop, isAtBottom); pane.css('top', destTop); elem.trigger('jsp-scroll-y', [-destTop, isAtTop, isAtBottom]).trigger('scroll'); } function positionDragX(destX, animate) { if (!isScrollableH) { return; } if (destX < 0) { destX = 0; } else if (destX > dragMaxX) { destX = dragMaxX; } if (animate === undefined) { animate = settings.animateScroll; } if (animate) { jsp.animate(horizontalDrag, 'left', destX, _positionDragX); } else { horizontalDrag.css('left', destX); _positionDragX(destX); } } function _positionDragX(destX) { if (destX === undefined) { destX = horizontalDrag.position().left; } container.scrollTop(0); horizontalDragPosition = destX; var isAtLeft = horizontalDragPosition === 0, isAtRight = horizontalDragPosition == dragMaxX, percentScrolled = destX / dragMaxX, destLeft = -percentScrolled * (contentWidth - paneWidth); if (wasAtLeft != isAtLeft || wasAtRight != isAtRight) { wasAtLeft = isAtLeft; wasAtRight = isAtRight; elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]); } updateHorizontalArrows(isAtLeft, isAtRight); pane.css('left', destLeft); elem.trigger('jsp-scroll-x', [-destLeft, isAtLeft, isAtRight]).trigger('scroll'); } function updateVerticalArrows(isAtTop, isAtBottom) { if (settings.showArrows) { arrowUp[isAtTop ? 'addClass' : 'removeClass']('jspDisabled'); arrowDown[isAtBottom ? 'addClass' : 'removeClass']('jspDisabled'); } } function updateHorizontalArrows(isAtLeft, isAtRight) { if (settings.showArrows) { arrowLeft[isAtLeft ? 'addClass' : 'removeClass']('jspDisabled'); arrowRight[isAtRight ? 'addClass' : 'removeClass']('jspDisabled'); } } function scrollToY(destY, animate) { var percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); } function scrollToX(destX, animate) { var percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); } function scrollToElement(ele, stickToTop, animate) { var e, eleHeight, eleWidth, eleTop = 0, eleLeft = 0, viewportTop, viewportLeft, maxVisibleEleTop, maxVisibleEleLeft, destY, destX; // Legal hash values aren't necessarily legal jQuery selectors so we need to catch any // errors from the lookup... try { e = $(ele); } catch (err) { return; } eleHeight = e.outerHeight(); eleWidth= e.outerWidth(); container.scrollTop(0); container.scrollLeft(0); // loop through parents adding the offset top of any elements that are relatively positioned between // the focused element and the jspPane so we can get the true distance from the top // of the focused element to the top of the scrollpane... while (!e.is('.jspPane')) { eleTop += e.position().top; eleLeft += e.position().left; e = e.offsetParent(); if (/^body|html$/i.test(e[0].nodeName)) { // we ended up too high in the document structure. Quit! return; } } viewportTop = contentPositionY(); maxVisibleEleTop = viewportTop + paneHeight; if (eleTop < viewportTop || stickToTop) { // element is above viewport destY = eleTop - settings.verticalGutter; } else if (eleTop + eleHeight > maxVisibleEleTop) { // element is below viewport destY = eleTop - paneHeight + eleHeight + settings.verticalGutter; } if (destY) { scrollToY(destY, animate); } viewportLeft = contentPositionX(); maxVisibleEleLeft = viewportLeft + paneWidth; if (eleLeft < viewportLeft || stickToTop) { // element is to the left of viewport destX = eleLeft - settings.horizontalGutter; } else if (eleLeft + eleWidth > maxVisibleEleLeft) { // element is to the right viewport destX = eleLeft - paneWidth + eleWidth + settings.horizontalGutter; } if (destX) { scrollToX(destX, animate); } } function contentPositionX() { return -pane.position().left; } function contentPositionY() { return -pane.position().top; } function isCloseToBottom() { var scrollableHeight = contentHeight - paneHeight; return (scrollableHeight > 20) && (scrollableHeight - contentPositionY() < 10); } function isCloseToRight() { var scrollableWidth = contentWidth - paneWidth; return (scrollableWidth > 20) && (scrollableWidth - contentPositionX() < 10); } function initMousewheel() { container.unbind(mwEvent).bind( mwEvent, function (event, delta, deltaX, deltaY) { var dX = horizontalDragPosition, dY = verticalDragPosition; jsp.scrollBy(deltaX * settings.mouseWheelSpeed, -deltaY * settings.mouseWheelSpeed, false); // return true if there was no movement so rest of screen can scroll return dX == horizontalDragPosition && dY == verticalDragPosition; } ); } function removeMousewheel() { container.unbind(mwEvent); } function nil() { return false; } function initFocusHandler() { pane.find(':input,a').unbind('focus.jsp').bind( 'focus.jsp', function(e) { scrollToElement(e.target, false); } ); } function removeFocusHandler() { pane.find(':input,a').unbind('focus.jsp'); } function initKeyboardNav() { var keyDown, elementHasScrolled, validParents = []; isScrollableH && validParents.push(horizontalBar[0]); isScrollableV && validParents.push(verticalBar[0]); // IE also focuses elements that don't have tabindex set. pane.focus( function() { elem.focus(); } ); elem.attr('tabindex', 0) .unbind('keydown.jsp keypress.jsp') .bind( 'keydown.jsp', function(e) { if (e.target !== this && !(validParents.length && $(e.target).closest(validParents).length)){ return; } var dX = horizontalDragPosition, dY = verticalDragPosition; switch(e.keyCode) { case 40: // down case 38: // up case 34: // page down case 32: // space case 33: // page up case 39: // right case 37: // left keyDown = e.keyCode; keyDownHandler(); break; case 35: // end scrollToY(contentHeight - paneHeight); keyDown = null; break; case 36: // home scrollToY(0); keyDown = null; break; } elementHasScrolled = e.keyCode == keyDown && dX != horizontalDragPosition || dY != verticalDragPosition; return !elementHasScrolled; } ).bind( 'keypress.jsp', // For FF/ OSX so that we can cancel the repeat key presses if the JSP scrolls... function(e) { if (e.keyCode == keyDown) { keyDownHandler(); } return !elementHasScrolled; } ); if (settings.hideFocus) { elem.css('outline', 'none'); if ('hideFocus' in container[0]){ elem.attr('hideFocus', true); } } else { elem.css('outline', ''); if ('hideFocus' in container[0]){ elem.attr('hideFocus', false); } } function keyDownHandler() { var dX = horizontalDragPosition, dY = verticalDragPosition; switch(keyDown) { case 40: // down jsp.scrollByY(settings.keyboardSpeed, false); break; case 38: // up jsp.scrollByY(-settings.keyboardSpeed, false); break; case 34: // page down case 32: // space jsp.scrollByY(paneHeight * settings.scrollPagePercent, false); break; case 33: // page up jsp.scrollByY(-paneHeight * settings.scrollPagePercent, false); break; case 39: // right jsp.scrollByX(settings.keyboardSpeed, false); break; case 37: // left jsp.scrollByX(-settings.keyboardSpeed, false); break; } elementHasScrolled = dX != horizontalDragPosition || dY != verticalDragPosition; return elementHasScrolled; } } function removeKeyboardNav() { elem.attr('tabindex', '-1') .removeAttr('tabindex') .unbind('keydown.jsp keypress.jsp'); } function observeHash() { if (location.hash && location.hash.length > 1) { var e, retryInt, hash = escape(location.hash.substr(1)) // hash must be escaped to prevent XSS ; try { e = $('#' + hash + ', a[name="' + hash + '"]'); } catch (err) { return; } if (e.length && pane.find(hash)) { // nasty workaround but it appears to take a little while before the hash has done its thing // to the rendered page so we just wait until the container's scrollTop has been messed up. if (container.scrollTop() === 0) { retryInt = setInterval( function() { if (container.scrollTop() > 0) { scrollToElement(e, true); $(document).scrollTop(container.position().top); clearInterval(retryInt); } }, 50 ); } else { scrollToElement(e, true); $(document).scrollTop(container.position().top); } } } } function hijackInternalLinks() { // only register the link handler once if ($(document.body).data('jspHijack')) { return; } // remember that the handler was bound $(document.body).data('jspHijack', true); // use live handler to also capture newly created links $(document.body).delegate('a[href*=#]', 'click', function(event) { // does the link point to the same page? // this also takes care of cases with a <base>-Tag or Links not starting with the hash # // e.g. <a href="index.html#test"> when the current url already is index.html var href = this.href.substr(0, this.href.indexOf('#')), locationHref = location.href, hash, element, container, jsp, scrollTop, elementTop; if (location.href.indexOf('#') !== -1) { locationHref = location.href.substr(0, location.href.indexOf('#')); } if (href !== locationHref) { // the link points to another page return; } // check if jScrollPane should handle this click event hash = escape(this.href.substr(this.href.indexOf('#') + 1)); // find the element on the page element; try { element = $('#' + hash + ', a[name="' + hash + '"]'); } catch (e) { // hash is not a valid jQuery identifier return; } if (!element.length) { // this link does not point to an element on this page return; } container = element.closest('.jspScrollable'); jsp = container.data('jsp'); // jsp might be another jsp instance than the one, that bound this event // remember: this event is only bound once for all instances. jsp.scrollToElement(element, true); if (container[0].scrollIntoView) { // also scroll to the top of the container (if it is not visible) scrollTop = $(window).scrollTop(); elementTop = element.offset().top; if (elementTop < scrollTop || elementTop > scrollTop + $(window).height()) { container[0].scrollIntoView(); } } // jsp handled this event, prevent the browser default (scrolling :P) event.preventDefault(); }); } // Init touch on iPad, iPhone, iPod, Android function initTouch() { var startX, startY, touchStartX, touchStartY, moved, moving = false; container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind( 'touchstart.jsp', function(e) { var touch = e.originalEvent.touches[0]; startX = contentPositionX(); startY = contentPositionY(); touchStartX = touch.pageX; touchStartY = touch.pageY; moved = false; moving = true; } ).bind( 'touchmove.jsp', function(ev) { if(!moving) { return; } var touchPos = ev.originalEvent.touches[0], dX = horizontalDragPosition, dY = verticalDragPosition; jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY); moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5; // return true if there was no movement so rest of screen can scroll return dX == horizontalDragPosition && dY == verticalDragPosition; } ).bind( 'touchend.jsp', function(e) { moving = false; /*if(moved) { return false; }*/ } ).bind( 'click.jsp-touchclick', function(e) { if(moved) { moved = false; return false; } } ); } function destroy(){ var currentY = contentPositionY(), currentX = contentPositionX(); elem.removeClass('jspScrollable').unbind('.jsp'); elem.replaceWith(originalElement.append(pane.children())); originalElement.scrollTop(currentY); originalElement.scrollLeft(currentX); // clear reinitialize timer if active if (reinitialiseInterval) { clearInterval(reinitialiseInterval); } } // Public API $.extend( jsp, { // Reinitialises the scroll pane (if it's internal dimensions have changed since the last time it // was initialised). The settings object which is passed in will override any settings from the // previous time it was initialised - if you don't pass any settings then the ones from the previous // initialisation will be used. reinitialise: function(s) { s = $.extend({}, settings, s); initialise(s); }, // Scrolls the specified element (a jQuery object, DOM node or jQuery selector string) into view so // that it can be seen within the viewport. If stickToTop is true then the element will appear at // the top of the viewport, if it is false then the viewport will scroll as little as possible to // show the element. You can also specify if you want animation to occur. If you don't provide this // argument then the animateScroll value from the settings object is used instead. scrollToElement: function(ele, stickToTop, animate) { scrollToElement(ele, stickToTop, animate); }, // Scrolls the pane so that the specified co-ordinates within the content are at the top left // of the viewport. animate is optional and if not passed then the value of animateScroll from // the settings object this jScrollPane was initialised with is used. scrollTo: function(destX, destY, animate) { scrollToX(destX, animate); scrollToY(destY, animate); }, // Scrolls the pane so that the specified co-ordinate within the content is at the left of the // viewport. animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. scrollToX: function(destX, animate) { scrollToX(destX, animate); }, // Scrolls the pane so that the specified co-ordinate within the content is at the top of the // viewport. animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. scrollToY: function(destY, animate) { scrollToY(destY, animate); }, // Scrolls the pane to the specified percentage of its maximum horizontal scroll position. animate // is optional and if not passed then the value of animateScroll from the settings object this // jScrollPane was initialised with is used. scrollToPercentX: function(destPercentX, animate) { scrollToX(destPercentX * (contentWidth - paneWidth), animate); }, // Scrolls the pane to the specified percentage of its maximum vertical scroll position. animate // is optional and if not passed then the value of animateScroll from the settings object this // jScrollPane was initialised with is used. scrollToPercentY: function(destPercentY, animate) { scrollToY(destPercentY * (contentHeight - paneHeight), animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollBy: function(deltaX, deltaY, animate) { jsp.scrollByX(deltaX, animate); jsp.scrollByY(deltaY, animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollByX: function(deltaX, animate) { var destX = contentPositionX() + Math[deltaX<0 ? 'floor' : 'ceil'](deltaX), percentScrolled = destX / (contentWidth - paneWidth); positionDragX(percentScrolled * dragMaxX, animate); }, // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then // the value of animateScroll from the settings object this jScrollPane was initialised with is used. scrollByY: function(deltaY, animate) { var destY = contentPositionY() + Math[deltaY<0 ? 'floor' : 'ceil'](deltaY), percentScrolled = destY / (contentHeight - paneHeight); positionDragY(percentScrolled * dragMaxY, animate); }, // Positions the horizontal drag at the specified x position (and updates the viewport to reflect // this). animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. positionDragX: function(x, animate) { positionDragX(x, animate); }, // Positions the vertical drag at the specified y position (and updates the viewport to reflect // this). animate is optional and if not passed then the value of animateScroll from the settings // object this jScrollPane was initialised with is used. positionDragY: function(y, animate) { positionDragY(y, animate); }, // This method is called when jScrollPane is trying to animate to a new position. You can override // it if you want to provide advanced animation functionality. It is passed the following arguments: // * ele - the element whose position is being animated // * prop - the property that is being animated // * value - the value it's being animated to // * stepCallback - a function that you must execute each time you update the value of the property // You can use the default implementation (below) as a starting point for your own implementation. animate: function(ele, prop, value, stepCallback) { var params = {}; params[prop] = value; ele.animate( params, { 'duration' : settings.animateDuration, 'easing' : settings.animateEase, 'queue' : false, 'step' : stepCallback } ); }, // Returns the current x position of the viewport with regards to the content pane. getContentPositionX: function() { return contentPositionX(); }, // Returns the current y position of the viewport with regards to the content pane. getContentPositionY: function() { return contentPositionY(); }, // Returns the width of the content within the scroll pane. getContentWidth: function() { return contentWidth; }, // Returns the height of the content within the scroll pane. getContentHeight: function() { return contentHeight; }, // Returns the horizontal position of the viewport within the pane content. getPercentScrolledX: function() { return contentPositionX() / (contentWidth - paneWidth); }, // Returns the vertical position of the viewport within the pane content. getPercentScrolledY: function() { return contentPositionY() / (contentHeight - paneHeight); }, // Returns whether or not this scrollpane has a horizontal scrollbar. getIsScrollableH: function() { return isScrollableH; }, // Returns whether or not this scrollpane has a vertical scrollbar. getIsScrollableV: function() { return isScrollableV; }, // Gets a reference to the content pane. It is important that you use this method if you want to // edit the content of your jScrollPane as if you access the element directly then you may have some // problems (as your original element has had additional elements for the scrollbars etc added into // it). getContentPane: function() { return pane; }, // Scrolls this jScrollPane down as far as it can currently scroll. If animate isn't passed then the // animateScroll value from settings is used instead. scrollToBottom: function(animate) { positionDragY(dragMaxY, animate); }, // Hijacks the links on the page which link to content inside the scrollpane. If you have changed // the content of your page (e.g. via AJAX) and want to make sure any new anchor links to the // contents of your scroll pane will work then call this function. hijackInternalLinks: $.noop, // Removes the jScrollPane and returns the page to the state it was in before jScrollPane was // initialised. destroy: function() { destroy(); } } ); initialise(s); } // Pluginifying code... settings = $.extend({}, $.fn.jScrollPane.defaults, settings); // Apply default speed $.each(['mouseWheelSpeed', 'arrowButtonSpeed', 'trackClickSpeed', 'keyboardSpeed'], function() { settings[this] = settings[this] || settings.speed; }); return this.each( function() { var elem = $(this), jspApi = elem.data('jsp'); if (jspApi) { jspApi.reinitialise(settings); } else { $("script",elem).filter('[type="text/javascript"],:not([type])').remove(); jspApi = new JScrollPane(elem, settings); elem.data('jsp', jspApi); } } ); }; $.fn.jScrollPane.defaults = { showArrows : false, maintainPosition : true, stickToBottom : false, stickToRight : false, clickOnTrack : true, autoReinitialise : false, autoReinitialiseDelay : 500, verticalDragMinHeight : 0, verticalDragMaxHeight : 99999, horizontalDragMinWidth : 0, horizontalDragMaxWidth : 99999, contentWidth : undefined, animateScroll : false, animateDuration : 300, animateEase : 'linear', hijackInternalLinks : false, verticalGutter : 4, horizontalGutter : 4, mouseWheelSpeed : 0, arrowButtonSpeed : 0, arrowRepeatFreq : 50, arrowScrollOnHover : false, trackClickSpeed : 0, trackClickRepeatFreq : 70, verticalArrowPositions : 'split', horizontalArrowPositions : 'split', enableKeyboardNavigation : true, hideFocus : false, keyboardSpeed : 0, initialDelay : 300, // Delay before starting repeating speed : 30, // Default speed when others falsey scrollPagePercent : .8 // Percent of visible area scrolled when pageUp/Down or track area pressed }; })(jQuery,this);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-jscrollpane.js
jquery-jscrollpane.js
(function() { (function($) { var KEY; KEY = { BACKSPACE: 8, TAB: 9, RETURN: 13, ESCAPE: 27, SPACE: 32, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, COLON: 188, DOT: 190 }; $.MultiSelect = (function() { MultiSelect.prototype.addLabel = "Add "; function MultiSelect(element, options) { this.options = { readonly: false, input_type: "input", input_class: null, separator: ",", completions: [], input_references: null, min_query_length: 0, on_search: null, on_search_timeout: 250, max_complete_results: 5, max_selection_length: null, enable_new_options: true, complex_search: true, highlight: false, backspace_removes_last: true }; $.extend(this.options, options || {}); this.values = []; this.input = $(element); this.initialize_elements(); this.initialize_events(); this.parse_value(); } MultiSelect.prototype.initialize_elements = function() { this.hidden = $(document.createElement("input")); this.hidden.attr("name", this.input.attr("name")); this.hidden.attr("type", "hidden"); this.input.removeAttr("name"); if (this.options.input_class) { this.input.addClass(this.options.input_class); } this.container = $(document.createElement("div")); this.container.addClass("jquery-multiselect"); this.input_wrapper = $(document.createElement("a")); this.input_wrapper.addClass("bit-input"); this.input.replaceWith(this.container); this.container.append(this.input_wrapper); this.input_wrapper.append(this.input); return this.container.before(this.hidden); }; MultiSelect.prototype.initialize_events = function() { var _this = this; this.selection = new $.MultiSelect.Selection(this.input); this.resizable = new $.MultiSelect.ResizableInput(this.input); this.observer = new $.MultiSelect.InputObserver(this.input); this.autocomplete = new $.MultiSelect.AutoComplete(this, this.options.completions); this.input.click(function(e) { return e.stopPropagation(); }); this.input.keyup(function() { return _this.parse_value(1); }); this.container.click(function() { _this.input.focus(); return _this.selection.set_caret_at_end(); }); this.observer.bind([KEY.TAB, KEY.RETURN], function(e) { if (_this.autocomplete.val()) { e.preventDefault(); return _this.add_and_reset(); } }); this.observer.bind([KEY.BACKSPACE], function(e) { var caret; if (_this.values.length <= 0) { return; } caret = _this.selection.get_caret(); if ((_this.options.backspace_removes_last || e.ctrlKey) && caret[0] === 0 && caret[1] === 0) { e.preventDefault(); return _this.remove(_this.values[_this.values.length - 1]); } }); this.input.blur(function() { return setTimeout(function() { return _this.autocomplete.hide_complete_box(); }, 200); }); return this.observer.bind([KEY.ESCAPE], function(e) { return _this.autocomplete.hide_complete_box(); }); }; MultiSelect.prototype.values_real = function() { return $.map(this.values, function(v) { return v[1]; }); }; MultiSelect.prototype.parse_value = function(min) { var caption, refs, value, values, _i, _len; if (min == null) { min = 0; } if (this.options.input_type === "input") { values = this.input.val().split(this.options.separator); } else { values = this.options.input_values; } if (values.length > min) { for (_i = 0, _len = values.length; _i < _len; _i++) { value = values[_i]; if (value.present()) { if (this.options.input_references) { refs = this.options.input_references; if (typeof refs === 'function') { refs = refs(); } caption = refs[value] || value; this.add([caption, value]); } else { this.add([value, value]); } } } this.input.val(""); this.autocomplete.search(); } if (this.options.readonly) { return this.input.hide(); } }; MultiSelect.prototype.add_and_reset = function() { if (this.autocomplete.val()) { this.add(this.autocomplete.val()); this.input.val(""); return this.autocomplete.search(); } }; MultiSelect.prototype.add = function(value) { var a, close, _this = this; if ($.inArray(value[1], this.values_real()) > -1) { return; } if (value[0].blank()) { return; } value[1] = value[1].trim(); this.values.push(value); a = $(document.createElement("a")); a.addClass("bit bit-box"); a.mouseover(function() { return $(this).addClass("bit-hover"); }); a.mouseout(function() { return $(this).removeClass("bit-hover"); }); a.data("value", value); a.html(value[0].entitizeHTML()); if (!this.options.readonly) { close = $(document.createElement("a")); close.addClass("closebutton"); close.click(function() { return _this.remove(a.data("value")); }); a.append(close); } this.input_wrapper.before(a); if (this.options.readonly || (this.options.max_selection_length && (this.values.length >= this.options.max_selection_length))) { this.input.hide(); } return this.refresh_hidden(); }; MultiSelect.prototype.remove = function(value) { this.values = $.grep(this.values, function(v) { return v[1] !== value[1]; }); this.container.find("a.bit-box").each(function() { if ($(this).data("value")[1] === value[1]) { return $(this).remove(); } }); this.input.show(); return this.refresh_hidden(); }; MultiSelect.prototype.refresh_hidden = function() { return this.hidden.val(this.values_real().join(this.options.separator)); }; return MultiSelect; })(); $.MultiSelect.InputObserver = (function() { function InputObserver(element) { var _this = this; this.input = $(element); this.input.keydown(function(e) { return _this.handle_keydown(e); }); this.events = []; } InputObserver.prototype.bind = function(key, callback) { return this.events.push([key, callback]); }; InputObserver.prototype.handle_keydown = function(e) { var callback, event, keys, _i, _len, _ref, _results; _ref = this.events; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; keys = event[0], callback = event[1]; if (!keys.push) { keys = [keys]; } if ($.inArray(e.keyCode, keys) > -1) { _results.push(callback(e)); } else { _results.push(void 0); } } return _results; }; return InputObserver; })(); $.MultiSelect.Selection = (function() { function Selection(element) { this.input = $(element)[0]; } Selection.prototype.get_caret = function() { var r; if (document.selection) { r = document.selection.createRange().duplicate(); r.moveEnd('character', this.input.value.length); if (r.text === '') { return [this.input.value.length, this.input.value.length]; } else { return [this.input.value.lastIndexOf(r.text), this.input.value.lastIndexOf(r.text)]; } } else { return [this.input.selectionStart, this.input.selectionEnd]; } }; Selection.prototype.set_caret = function(begin, end) { if (end == null) { end = begin; } this.input.selectionStart = begin; return this.input.selectionEnd = end; }; Selection.prototype.set_caret_at_end = function() { return this.set_caret(this.input.value.length); }; return Selection; })(); $.MultiSelect.ResizableInput = (function() { function ResizableInput(element) { var _this = this; this.input = $(element); this.create_measurer(); this.input.keypress(function(e) { return _this.set_width(e); }); this.input.keyup(function(e) { return _this.set_width(e); }); this.input.change(function(e) { return _this.set_width(e); }); } ResizableInput.prototype.create_measurer = function() { var measurer; if ($("#__jquery_multiselect_measurer")[0] === void 0) { measurer = $(document.createElement("div")); measurer.attr("id", "__jquery_multiselect_measurer"); measurer.css({ position: "absolute", left: "-1000px", top: "-1000px" }); $(document.body).append(measurer); } this.measurer = $("#__jquery_multiselect_measurer:first"); return this.measurer.css({ fontSize: this.input.css('font-size'), fontFamily: this.input.css('font-family') }); }; ResizableInput.prototype.calculate_width = function() { this.measurer.html(this.input.val().entitizeHTML() + 'MM'); return this.measurer.innerWidth(); }; ResizableInput.prototype.set_width = function() { return this.input.css("width", this.calculate_width() + "px"); }; return ResizableInput; })(); $.MultiSelect.AutoComplete = (function() { function AutoComplete(multiselect, completions) { this.timer = null; this.busy = 0; this.multiselect = multiselect; this.input = this.multiselect.input; this.completions = this.parse_completions(completions); this.matches = []; this.create_elements(); this.bind_events(); } AutoComplete.prototype.parse_completions = function(completions) { return $.map(completions, function(value) { if (typeof value === "string") { return [[value, value]]; } else if (value instanceof Array && value.length === 2) { return [value]; } else if (value.value && value.caption) { return [[value.caption, value.value]]; } else { if (console) { return console.error("Invalid option " + value); } } }); }; AutoComplete.prototype.create_elements = function() { var width; this.container = $(document.createElement("div")); this.container.addClass("jquery-multiselect-autocomplete"); width = $(this.multiselect.container).outerWidth(); if (width < 400) { width = 400; } this.container.css("width", width); this.container.css("display", "none"); this.container.append(this.def); this.list = $(document.createElement("ul")); this.list.addClass("feed"); this.container.append(this.list); return this.multiselect.container.after(this.container); }; AutoComplete.prototype.bind_events = function() { var _this = this; this.input.keypress(function(e) { return _this.search(e); }); this.input.keyup(function(e) { return _this.search(e); }); this.input.change(function(e) { return _this.search(e); }); this.multiselect.observer.bind(KEY.UP, function(e) { e.preventDefault(); return _this.navigate_up(); }); return this.multiselect.observer.bind(KEY.DOWN, function(e) { e.preventDefault(); return _this.navigate_down(); }); }; AutoComplete.prototype._setBusy = function(state) { if (state) { ++this.busy; } else { --this.busy; } return this.busy = Math.max(this.busy, 0); }; AutoComplete.prototype.search = function() { var callback, that; if (this.multiselect.options.on_search_timeout) { if (this.timer) { clearTimeout(this.timer); } callback = function(obj) { return obj._search(); }; that = this; this.timer = setTimeout((function() { return callback(that); }), this.multiselect.options.on_search_timeout); } else { this._search(); } }; AutoComplete.prototype._search = function() { var def, i, item, label, option, x, _i, _len, _ref, _this = this; if (this.busy) { return; } if (this.input.val().trim() === this.query) { return; } this.query = this.input.val().trim(); this.list.html(""); this.current = 0; if (this.query.present() && this.query.length >= this.multiselect.options.min_query_length) { this.container.fadeIn("fast"); if (this.multiselect.options.on_search) { this._initSearch(); } this.matches = this.matching_completions(this.query); if (this.multiselect.options.enable_new_options) { if (this.multiselect.options.highlight) { label = " <em>" + this.query + "</em>"; } else { label = " " + this.query; } def = this.create_item($.MultiSelect.addLabel + label); def.mouseover(function(e) { return _this.select_index(0); }); } _ref = this.matches; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { option = _ref[i]; x = this.multiselect.options.enable_new_options ? i + 1 : i; item = this.create_item(this.highlight(option[0], this.query)); $(item).attr('multiselect:index', x); item.mouseover(function(e) { var target; target = window.event ? window.event.srcElement : e.target; return _this.select_index($(target).attr('multiselect:index')); }); } if (this.multiselect.options.enable_new_options) { this.matches.unshift([this.query, this.query]); } return this.select_index(0); } else { this.matches = []; this.hide_complete_box(); return this.query = null; } }; AutoComplete.prototype._initSearch = function() { var callback; if (this.busy) { callback = function(obj) { return obj._initSearch(); }; return setTimeout(callback, 100, this); } else { return this._doSearch(); } }; AutoComplete.prototype._doSearch = function() { var completions; if (this.busy) { return; } this._setBusy(true); try { completions = this.multiselect.options.on_search(this.query); return this.completions = this.parse_completions(completions); } finally { this._setBusy(false); } }; AutoComplete.prototype.hide_complete_box = function() { return this.container.fadeOut("fast"); }; AutoComplete.prototype.select_index = function(index) { var items; items = this.list.find("li"); items.removeClass("auto-focus"); items.filter(":eq(" + index + ")").addClass("auto-focus"); return this.current = index; }; AutoComplete.prototype.navigate_down = function() { var next; next = this.current + 1; if (next >= this.matches.length) { next = 0; } return this.select_index(next); }; AutoComplete.prototype.navigate_up = function() { var next; next = this.current - 1; if (next < 0) { next = this.matches.length - 1; } return this.select_index(next); }; AutoComplete.prototype.create_item = function(text, highlight) { var item, _this = this; item = $(document.createElement("li")); item.click(function() { _this.multiselect.add_and_reset(); _this.search(); return _this.input.focus(); }); item.html(text); this.list.append(item); return item; }; AutoComplete.prototype.val = function() { return this.matches[this.current]; }; AutoComplete.prototype.highlight = function(text, highlight) { var char, current, highlighted, i, reg, _i, _len; if (!this.multiselect.options.highlight) { return text; } if (this.multiselect.options.complex_search) { highlighted = ""; current = 0; for (i = _i = 0, _len = text.length; _i < _len; i = ++_i) { char = text[i]; char = text.charAt(i); if (current < highlight.length && char.toLowerCase() === highlight.charAt(current).toLowerCase()) { highlighted += "<em>" + char + "</em>"; current++; } else { highlighted += char; } } return highlighted; } else { reg = "(" + (RegExp.escape(highlight)) + ")"; return text.replace(new RegExp(reg, "gi"), '<em>$1</em>'); } }; AutoComplete.prototype.matching_completions = function(text) { var char, count, i, reg, _i, _len, _this = this; if (this.multiselect.options.on_search) { reg = new RegExp(".*", "i"); } else if (this.multiselect.options.complex_search) { reg = ""; for (i = _i = 0, _len = text.length; _i < _len; i = ++_i) { char = text[i]; char = text.charAt(i); reg += RegExp.escape(char) + ".*"; } reg = new RegExp(reg, "i"); } else { reg = new RegExp(RegExp.escape(text), "i"); } count = 0; return $.grep(this.completions, function(c) { if (count >= _this.multiselect.options.max_complete_results) { return false; } if ($.inArray(c[1], _this.multiselect.values_real()) > -1) { return false; } if (c[0].match(reg)) { count++; return true; } else { return false; } }); }; return AutoComplete; })(); $.fn.multiselect = function(options) { if (options == null) { options = {}; } return $(this).each(function() { var completions, input, ms, option, select_options, values, _i, _len, _ref; ms = $(this).data('multiselect'); if (ms) { return ms; } if (this.tagName.toLowerCase() === "select") { input = $(document.createElement("input")); input.attr("type", "text"); input.attr("name", this.name); input.attr("id", this.id); completions = []; values = []; _ref = this.options; for (_i = 0, _len = _ref.length; _i < _len; _i++) { option = _ref[_i]; completions.push([option.innerHTML, option.value]); if (option.selected) { values.push(option.value); } } select_options = { completions: completions, input_type: "select", input_values: values, enable_new_options: false }; $.extend(select_options, options); $(this).replaceWith(input); ms = new $.MultiSelect(input, select_options); } else if (this.tagName.toLowerCase() === "input" && this.type === "text") { ms = new $.MultiSelect(this, options); } $(this).data('multiselect', ms); return ms; }); }; return $(document).ready(function() { var lang, options; lang = $('HTML').attr('lang') || $('HTML').attr('xml:lang'); if (lang && (lang !== 'en')) { options = { dataType: 'script', cache: true, url: '/--static--/ztfy.jqueryui/js/i18n/' + lang + '.js', success: function() { $.i18n.setDictionary(I18n_multiselect); return $.MultiSelect.addLabel = $.i18n._('addLabel'); } }; return $.ajax(options); } }); })(jQuery); $.extend(String.prototype, { trim: function() { return this.replace(/^[\r\n\s]/g, '').replace(/[\r\n\s]$/g, ''); }, entitizeHTML: function() { return this.replace(/</g, '&lt;').replace(/>/g, '&gt;'); }, unentitizeHTML: function() { return this.replace(/&lt;/g, '<').replace(/&gt;/g, '>'); }, blank: function() { return this.trim().length === 0; }, present: function() { return !this.blank(); } }); RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; }).call(this);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-multiselect.js
jquery-multiselect.js
$(document).ready(JT_init); function JT_init() { $("a.jTip").hover(function() { JT_show(this.href, this.id, this.name) }, function() { $('#JT').remove() }).click(function() { return false }); } function JT_show(url, linkId, title) { if (title == false) title = "&nbsp;"; var de = document.documentElement; var w = self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; var hasArea = w - getAbsoluteLeft(linkId); var clickElementy = getAbsoluteTop(linkId) - 3; // set y position var queryString = url.replace(/^[^\?]+\??/, ''); var params = parseQuery(queryString); if (params['width'] === undefined) { params['width'] = 250 } ; if (params['link'] !== undefined) { $('#' + linkId).bind('click', function() { window.location = params['link'] }); $('#' + linkId).css('cursor', 'pointer'); } if (url) { var loader = "<div id='JT_copy'><div class='JT_loader'></div></div>"; } else { var loader = ""; } if (hasArea > ((params['width'] * 1) + 75)) { $("body").append("<div id='JT' style='width:" + params['width'] * 1 + "px'><div id='JT_arrow_left'></div><div id='JT_close_left'>" + title + "</div>" + loader + "</div>");// right side var arrowOffset = getElementWidth(linkId) + 11; var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; // set x position } else { $("body").append("<div id='JT' style='width:" + params['width'] * 1 + "px'><div id='JT_arrow_right' style='left:" + ((params['width'] * 1) + 1) + "px'></div><div id='JT_close_right'>" + title + "</div>" + loader + "</div>");// left side var clickElementx = getAbsoluteLeft(linkId) - ((params['width'] * 1) + 15); // set x position } $('#JT').css( { left : clickElementx + "px", top : clickElementy + "px" }); $('#JT').show(); if (url) { $('#JT_copy').load(url); } } function getElementWidth(objectId) { x = document.getElementById(objectId); return x.offsetWidth; } function getAbsoluteLeft(objectId) { // Get an object left position from the upper left viewport corner o = document.getElementById(objectId) oLeft = o.offsetLeft // Get left position from the parent object while (o.offsetParent != null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oLeft += oParent.offsetLeft // Add parent left position o = oParent } return oLeft } function getAbsoluteTop(objectId) { // Get an object top position from the upper left viewport corner o = document.getElementById(objectId) oTop = o.offsetTop // Get top position from the parent object while (o.offsetParent != null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oTop += oParent.offsetTop // Add parent top position o = oParent } return oTop } function parseQuery(query) { var Params = new Object(); if (!query) return Params; // return empty object var Pairs = query.split(/[;&]/); for (var i = 0; i < Pairs.length; i++) { var KeyVal = Pairs[i].split('='); if (!KeyVal || KeyVal.length != 2) continue; var key = unescape(KeyVal[0]); var val = unescape(KeyVal[1]); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function blockEvents(evt) { if (evt.target) { evt.preventDefault(); } else { evt.returnValue = false; } }
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-jtip.js
jquery-jtip.js
(function(e){var b=Math.abs,a=Math.max,d=Math.min,c=Math.round;function f(){return e("<div/>")}e.imgAreaSelect=function(Q,ad){var M=e(Q),u,B=f(),E=f(),ap=f().add(f()).add(f()).add(f()),v=f().add(f()).add(f()).add(f()),ax=e([]),aj,T,ao,ay,S,aA,p,V,g=0,ak="absolute",an,am,ab,aa,az=10,t,q,al,k,x,aE,ah,D,n,C,l,aC={x1:0,y1:0,x2:0,y2:0,width:0,height:0},F=document.documentElement,Z,R,O,N,K,P,I;function Y(h){return h+ay.left-V.left}function X(h){return h+ay.top-V.top}function au(h){return h-ay.left+V.left}function at(h){return h-ay.top+V.top}function A(h){return h.pageX-V.left}function z(h){return h.pageY-V.top}function ar(h){var o=h||ab,i=h||aa;return{x1:c(aC.x1*o),y1:c(aC.y1*i),x2:c(aC.x2*o),y2:c(aC.y2*i),width:c(aC.x2*o)-c(aC.x1*o),height:c(aC.y2*i)-c(aC.y1*i)}}function aq(i,w,h,o,aF){var aH=aF||ab,aG=aF||aa;aC={x1:c(i/aH),y1:c(w/aG),x2:c(h/aH),y2:c(o/aG)};aC.width=aC.x2-aC.x1;aC.height=aC.y2-aC.y1}function m(){if(!M.width()){return}ay={left:c(M.offset().left),top:c(M.offset().top)};S=M.width();aA=M.height();q=ad.minWidth||0;al=ad.minHeight||0;k=d(ad.maxWidth||1<<24,S);x=d(ad.maxHeight||1<<24,aA);if(e().jquery=="1.3.2"&&ak=="fixed"&&!F.getBoundingClientRect){ay.top+=a(document.body.scrollTop,F.scrollTop);ay.left+=a(document.body.scrollLeft,F.scrollLeft)}V=e.inArray(p.css("position"),["absolute","relative"])+1?{left:c(p.offset().left)-p.scrollLeft(),top:c(p.offset().top)-p.scrollTop()}:ak=="fixed"?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0};T=Y(0);ao=X(0);if(aC.x2>S||aC.y2>aA){aB()}}function J(h){if(!ah){return}B.css({left:Y(aC.x1),top:X(aC.y1)}).add(E).width(K=aC.width).height(P=aC.height);E.add(ap).add(ax).css({left:0,top:0});ap.width(a(K-ap.outerWidth()+ap.innerWidth(),0)).height(a(P-ap.outerHeight()+ap.innerHeight(),0));e(v[0]).css({left:T,top:ao,width:aC.x1,height:aA});e(v[1]).css({left:T+aC.x1,top:ao,width:K,height:aC.y1});e(v[2]).css({left:T+aC.x2,top:ao,width:S-aC.x2,height:aA});e(v[3]).css({left:T+aC.x1,top:ao+aC.y2,width:K,height:aA-aC.y2});K-=ax.outerWidth();P-=ax.outerHeight();switch(ax.length){case 8:e(ax[4]).css({left:K/2});e(ax[5]).css({left:K,top:P/2});e(ax[6]).css({left:K/2,top:P});e(ax[7]).css({top:P/2});case 4:ax.slice(1,3).css({left:K});ax.slice(2,4).css({top:P})}if(h!==false){if(e.imgAreaSelect.keyPress!=av){e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress)}if(ad.keys){e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=av)}}if(e.browser.msie&&ap.outerWidth()-ap.innerWidth()==2){ap.css("margin",0);setTimeout(function(){ap.css("margin","auto")},0)}}function y(h){m();J(h);D=Y(aC.x1);n=X(aC.y1);C=Y(aC.x2);l=X(aC.y2)}function ag(h,i){ad.fadeSpeed?h.fadeOut(ad.fadeSpeed,i):h.hide()}function H(i){var h=au(A(i))-aC.x1,o=at(z(i))-aC.y1;if(!I){m();I=true;B.one("mouseout",function(){I=false})}t="";if(ad.resizable){if(o<=az){t="n"}else{if(o>=aC.height-az){t="s"}}if(h<=az){t+="w"}else{if(h>=aC.width-az){t+="e"}}}B.css("cursor",t?t+"-resize":ad.movable?"move":"");if(aj){aj.toggle()}}function j(h){e("body").css("cursor","");if(ad.autoHide||aC.width*aC.height==0){ag(B.add(v),function(){e(this).hide()})}ad.onSelectEnd(Q,ar());e(document).unbind("mousemove",ae);B.mousemove(H)}function aw(h){if(h.which!=1){return false}m();if(t){e("body").css("cursor",t+"-resize");D=Y(aC[/w/.test(t)?"x2":"x1"]);n=X(aC[/n/.test(t)?"y2":"y1"]);e(document).mousemove(ae).one("mouseup",j);B.unbind("mousemove",H)}else{if(ad.movable){an=T+aC.x1-A(h);am=ao+aC.y1-z(h);B.unbind("mousemove",H);e(document).mousemove(ac).one("mouseup",function(){ad.onSelectEnd(Q,ar());e(document).unbind("mousemove",ac);B.mousemove(H)})}else{M.mousedown(h)}}return false}function L(h){if(aE){if(h){C=a(T,d(T+S,D+b(l-n)*aE*(C>D||-1)));l=c(a(ao,d(ao+aA,n+b(C-D)/aE*(l>n||-1))));C=c(C)}else{l=a(ao,d(ao+aA,n+b(C-D)/aE*(l>n||-1)));C=c(a(T,d(T+S,D+b(l-n)*aE*(C>D||-1))));l=c(l)}}}function aB(){D=d(D,T+S);n=d(n,ao+aA);if(b(C-D)<q){C=D-q*(C<D||-1);if(C<T){D=T+q}else{if(C>T+S){D=T+S-q}}}if(b(l-n)<al){l=n-al*(l<n||-1);if(l<ao){n=ao+al}else{if(l>ao+aA){n=ao+aA-al}}}C=a(T,d(C,T+S));l=a(ao,d(l,ao+aA));L(b(C-D)<b(l-n)*aE);if(b(C-D)>k){C=D-k*(C<D||-1);L()}if(b(l-n)>x){l=n-x*(l<n||-1);L(true)}aC={x1:au(d(D,C)),x2:au(a(D,C)),y1:at(d(n,l)),y2:at(a(n,l)),width:b(C-D),height:b(l-n)};J();ad.onSelectChange(Q,ar())}function ae(h){C=t==""||/w|e/.test(t)||aE?A(h):Y(aC.x2);l=t==""||/n|s/.test(t)||aE?z(h):X(aC.y2);aB();return false}function U(h,i){C=(D=h)+aC.width;l=(n=i)+aC.height;e.extend(aC,{x1:au(D),y1:at(n),x2:au(C),y2:at(l)});J();ad.onSelectChange(Q,ar())}function ac(h){D=a(T,d(an+A(h),T+S-aC.width));n=a(ao,d(am+z(h),ao+aA-aC.height));U(D,n);h.preventDefault();return false}function r(){m();C=D;l=n;aB();t="";if(v.is(":not(:visible)")){B.add(v).hide().fadeIn(ad.fadeSpeed||0)}ah=true;e(document).unbind("mouseup",W).mousemove(ae).one("mouseup",j);B.unbind("mousemove",H);ad.onSelectStart(Q,ar())}function W(){e(document).unbind("mousemove",r);ag(B.add(v));aC={x1:au(D),y1:at(n),x2:au(D),y2:at(n),width:0,height:0};ad.onSelectChange(Q,ar());ad.onSelectEnd(Q,ar())}function aD(h){if(h.which!=1||v.is(":animated")){return false}m();an=D=A(h);am=n=z(h);e(document).one("mousemove",r).one("mouseup",W);return false}function ai(){y(false)}function s(){u=true;af(ad=e.extend({classPrefix:"imgareaselect",movable:true,resizable:true,parent:"body",onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},ad));B.add(v).css({visibility:""});if(ad.show){ah=true;m();J();B.add(v).hide().fadeIn(ad.fadeSpeed||0)}setTimeout(function(){ad.onInit(Q,ar())},0)}var av=function(w){var h=ad.keys,aF,o,i=w.keyCode;aF=!isNaN(h.alt)&&(w.altKey||w.originalEvent.altKey)?h.alt:!isNaN(h.ctrl)&&w.ctrlKey?h.ctrl:!isNaN(h.shift)&&w.shiftKey?h.shift:!isNaN(h.arrows)?h.arrows:10;if(h.arrows=="resize"||(h.shift=="resize"&&w.shiftKey)||(h.ctrl=="resize"&&w.ctrlKey)||(h.alt=="resize"&&(w.altKey||w.originalEvent.altKey))){switch(i){case 37:aF=-aF;case 39:o=a(D,C);D=d(D,C);C=a(o+aF,D);L();break;case 38:aF=-aF;case 40:o=a(n,l);n=d(n,l);l=a(o+aF,n);L(true);break;default:return}aB()}else{D=d(D,C);n=d(n,l);switch(i){case 37:U(a(D-aF,T),n);break;case 38:U(D,a(n-aF,ao));break;case 39:U(D+d(aF,S-au(C)),n);break;case 40:U(D,n+d(aF,aA-at(l)));break;default:return}}return false};function G(h,i){for(option in i){if(ad[option]!==undefined){h.css(i[option],ad[option])}}}function af(h){if(h.parent){(p=e(h.parent)).append(B.add(v))}e.extend(ad,h);m();if(h.handles!=null){ax.remove();ax=e([]);O=h.handles?h.handles=="corners"?4:8:0;while(O--){ax=ax.add(f())}ax.addClass(ad.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:g+1||1});if(!parseInt(ax.css("width"))){ax.width(5).height(5)}if(N=ad.borderWidth){ax.css({borderWidth:N,borderStyle:"solid"})}G(ax,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}ab=ad.imageWidth/S||1;aa=ad.imageHeight/aA||1;if(h.x1!=null){aq(h.x1,h.y1,h.x2,h.y2);h.show=!h.hide}if(h.keys){ad.keys=e.extend({shift:1,ctrl:"resize"},h.keys)}v.addClass(ad.classPrefix+"-outer");E.addClass(ad.classPrefix+"-selection");for(O=0;O++<4;){e(ap[O-1]).addClass(ad.classPrefix+"-border"+O)}G(E,{selectionColor:"background-color",selectionOpacity:"opacity"});G(ap,{borderOpacity:"opacity",borderWidth:"border-width"});G(v,{outerColor:"background-color",outerOpacity:"opacity"});if(N=ad.borderColor1){e(ap[0]).css({borderStyle:"solid",borderColor:N})}if(N=ad.borderColor2){e(ap[1]).css({borderStyle:"dashed",borderColor:N})}B.append(E.add(ap).add(ax).add(aj));if(e.browser.msie){if(N=v.css("filter").match(/opacity=([0-9]+)/)){v.css("opacity",N[1]/100)}if(N=ap.css("filter").match(/opacity=([0-9]+)/)){ap.css("opacity",N[1]/100)}}if(h.hide){ag(B.add(v))}else{if(h.show&&u){ah=true;B.add(v).fadeIn(ad.fadeSpeed||0);y()}}aE=(R=(ad.aspectRatio||"").split(/:/))[0]/R[1];if(ad.disable||ad.enable===false){B.unbind("mousemove",H).unbind("mousedown",aw);M.add(v).unbind("mousedown",aD);e(window).unbind("resize",ai)}else{if(ad.enable||ad.disable===false){if(ad.resizable||ad.movable){B.mousemove(H).mousedown(aw)}if(!ad.persistent){M.add(v).mousedown(aD)}e(window).resize(ai)}}ad.enable=ad.disable=undefined}this.remove=function(){M.unbind("mousedown",aD);B.add(v).remove()};this.getOptions=function(){return ad};this.setOptions=af;this.getSelection=ar;this.setSelection=aq;this.update=y;Z=M;while(Z.length){g=a(g,!isNaN(Z.css("z-index"))?Z.css("z-index"):g);if(Z.css("position")=="fixed"){ak="fixed"}Z=Z.parent(":not(body)")}g=ad.zIndex||g;if(e.browser.msie){M.attr("unselectable","on")}e.imgAreaSelect.keyPress=e.browser.msie||e.browser.safari?"keydown":"keypress";if(e.browser.opera){aj=f().css({width:"100%",height:"100%",position:"absolute",zIndex:g+2||2})}B.add(v).css({visibility:"hidden",position:ak,overflow:"hidden",zIndex:g||"0"});B.css({zIndex:g+2||2});E.add(ap).css({position:"absolute",fontSize:0});Q.complete||Q.readyState=="complete"||!M.is("img")?s():M.one("load",s)};e.fn.imgAreaSelect=function(g){g=g||{};this.each(function(){if(e(this).data("imgAreaSelect")){if(g.remove){e(this).data("imgAreaSelect").remove();e(this).removeData("imgAreaSelect")}else{e(this).data("imgAreaSelect").setOptions(g)}}else{if(!g.remove){if(g.enable===undefined&&g.disable===undefined){g.enable=true}e(this).data("imgAreaSelect",new e.imgAreaSelect(this,g))}}});if(g.instance){return e(this).data("imgAreaSelect")}return this}})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-imgareaselect.min.js
jquery-imgareaselect.min.js
(function(a){a.alerts={verticalOffset:-75,horizontalOffset:0,repositionOnResize:true,overlayOpacity:0.01,overlayColor:"#FFF",draggable:true,okButton:"&nbsp;OK&nbsp;",cancelButton:"&nbsp;Cancel&nbsp;",dialogClass:null,alert:function(b,c,d){if(c==null){c="Alert"}a.alerts._show(c,b,null,"alert",function(e){if(d){d(e)}})},confirm:function(b,c,d){if(c==null){c="Confirm"}a.alerts._show(c,b,null,"confirm",function(e){if(d){d(e)}})},prompt:function(b,c,d,e){if(d==null){d="Prompt"}a.alerts._show(d,b,c,"prompt",function(f){if(e){e(f)}})},_show:function(g,f,c,b,i){a.alerts._hide();a.alerts._overlay("show");a("BODY").append('<div id="popup_container"><h1 id="popup_title"></h1><div id="popup_content"><div id="popup_message"></div></div></div>');if(a.alerts.dialogClass){a("#popup_container").addClass(a.alerts.dialogClass)}var h=(a.browser.msie&&parseInt(a.browser.version)<=6)?"absolute":"fixed";a("#popup_container").css({position:h,zIndex:99999,padding:0,margin:0});a("#popup_title").text(g);a("#popup_content").addClass(b);a("#popup_message").text(f);a("#popup_message").html(a("#popup_message").text().replace(/\n/g,"<br />"));a("#popup_container").css({minWidth:a("#popup_container").outerWidth(),maxWidth:a("#popup_container").outerWidth()});a.alerts._reposition();a.alerts._maintainPosition(true);switch(b){case"alert":a("#popup_message").after('<div id="popup_panel"><input type="button" value="'+a.alerts.okButton+'" id="popup_ok" /></div>');a("#popup_ok").click(function(){a.alerts._hide();i(true)});a("#popup_ok").focus().keypress(function(j){if(j.keyCode==13||j.keyCode==27){a("#popup_ok").trigger("click")}});break;case"confirm":a("#popup_message").after('<div id="popup_panel"><input type="button" value="'+a.alerts.okButton+'" id="popup_ok" /> <input type="button" value="'+a.alerts.cancelButton+'" id="popup_cancel" /></div>');a("#popup_ok").click(function(){a.alerts._hide();if(i){i(true)}});a("#popup_cancel").click(function(){a.alerts._hide();if(i){i(false)}});a("#popup_ok").focus();a("#popup_ok, #popup_cancel").keypress(function(j){if(j.keyCode==13){a("#popup_ok").trigger("click")}if(j.keyCode==27){a("#popup_cancel").trigger("click")}});break;case"prompt":a("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="'+a.alerts.okButton+'" id="popup_ok" /> <input type="button" value="'+a.alerts.cancelButton+'" id="popup_cancel" /></div>');a("#popup_prompt").width(a("#popup_message").width());a("#popup_ok").click(function(){var e=a("#popup_prompt").val();a.alerts._hide();if(i){i(e)}});a("#popup_cancel").click(function(){a.alerts._hide();if(i){i(null)}});a("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(j){if(j.keyCode==13){a("#popup_ok").trigger("click")}if(j.keyCode==27){a("#popup_cancel").trigger("click")}});if(c){a("#popup_prompt").val(c)}a("#popup_prompt").focus().select();break}if(a.alerts.draggable){try{a("#popup_container").draggable({handle:a("#popup_title")});a("#popup_title").css({cursor:"move"})}catch(d){}}},_hide:function(){a("#popup_container").remove();a.alerts._overlay("hide");a.alerts._maintainPosition(false)},_overlay:function(b){switch(b){case"show":a.alerts._overlay("hide");a("BODY").append('<div id="popup_overlay"></div>');a("#popup_overlay").css({position:"absolute",zIndex:99998,top:"0px",left:"0px",width:"100%",height:a(document).height(),background:a.alerts.overlayColor,opacity:a.alerts.overlayOpacity});break;case"hide":a("#popup_overlay").remove();break}},_reposition:function(){var c=((a(window).height()/2)-(a("#popup_container").outerHeight()/2))+a.alerts.verticalOffset;var b=((a(window).width()/2)-(a("#popup_container").outerWidth()/2))+a.alerts.horizontalOffset;if(c<0){c=0}if(b<0){b=0}if(a.browser.msie&&parseInt(a.browser.version)<=6){c=c+a(window).scrollTop()}a("#popup_container").css({top:c+"px",left:b+"px"});a("#popup_overlay").height(a(document).height())},_maintainPosition:function(b){if(a.alerts.repositionOnResize){switch(b){case true:a(window).bind("resize",a.alerts._reposition);break;case false:a(window).unbind("resize",a.alerts._reposition);break}}}};jAlert=function(b,c,d){a.alerts.alert(b,c,d)};jConfirm=function(b,c,d){a.alerts.confirm(b,c,d)};jPrompt=function(b,c,d,e){a.alerts.prompt(b,c,d,e)};a(document).ready(function(){var b=a("HTML").attr("lang")||a("HTML").attr("xml:lang");if(b&&(b!="en")){a.ajax({dataType:"script",cache:true,url:"/--static--/ztfy.jqueryui/js/i18n/"+b+".js",success:function(){a.i18n.setDictionary(I18n_alerts);a.alerts.okButton=a.i18n._("okButton");a.alerts.cancelButton=a.i18n._("cancelButton")}})}})})(jQuery);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-alerts.min.js
jquery-alerts.min.js
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16", keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d= this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this, "overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart": "mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight, outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a, "tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&& a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&& c.ui.isOverAxis(b,e,i)}})}})(jQuery); ;/*! * jQuery UI Widget 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Widget */ (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]= function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)): d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options= b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+ "-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled", c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); ;/*! * jQuery UI Mouse 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Mouse * * Depends: * jquery.ui.widget.js */ (function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+ this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted= this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&& !(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); ;/* * jQuery UI Position 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Position */ (function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); ;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-ui-core-1.8.16.min.js
jquery-ui-core-1.8.16.min.js
jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.3",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(j,k){return this.each(function(){if(!k){if(!j||c.filter(j,[this]).length){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")})}}return i.call(c(this),j,k)})},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/jquery-ui-core-1.7.3.min.js
jquery-ui-core-1.7.3.min.js
/* Arabic Translation for jQuery UI date picker plugin. */ /* Khaled Al Horani -- [email protected] */ /* خالد الحوراني -- [email protected] */ /* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */ jQuery(function($){ $.datepicker.regional['ar'] = { clearText: 'مسح', clearStatus: 'امسح التاريخ الحالي', closeText: 'إغلاق', closeStatus: 'إغلاق بدون حفظ', prevText: '&#x3c;السابق', prevStatus: 'عرض الشهر السابق', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'التالي&#x3e;', nextStatus: 'عرض الشهر القادم', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'اليوم', currentStatus: 'عرض الشهر الحالي', monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], monthStatus: 'عرض شهر آخر', yearStatus: 'عرض سنة آخرى', weekHeader: 'أسبوع', weekStatus: 'أسبوع السنة', dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'], dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], dayNamesMin: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'], dayStatus: 'اختر DD لليوم الأول من الأسبوع', dateStatus: 'اختر D, M d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: 'اختر يوم', isRTL: true}; $.datepicker.setDefaults($.datepicker.regional['ar']); });/* Bulgarian initialisation for the jQuery UI date picker plugin. */ /* Written by Stoyan Kyosev (http://svest.org). */ jQuery(function($){ $.datepicker.regional['bg'] = { clearText: 'изчисти', clearStatus: 'изчисти актуалната дата', closeText: 'затвори', closeStatus: 'затвори без промени', prevText: '&#x3c;назад', prevStatus: 'покажи последния месец', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'напред&#x3e;', nextStatus: 'покажи следващия месец', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'днес', currentStatus: '', monthNames: ['Януари','Февруари','Март','Април','Май','Юни', 'Юли','Август','Септември','Октомври','Ноември','Декември'], monthNamesShort: ['Яну','Фев','Мар','Апр','Май','Юни', 'Юли','Авг','Сеп','Окт','Нов','Дек'], monthStatus: 'покажи друг месец', yearStatus: 'покажи друга година', weekHeader: 'Wk', weekStatus: 'седмица от месеца', dayNames: ['Неделя','Понеделник','Вторник','Сряда','Четвъртък','Петък','Събота'], dayNamesShort: ['Нед','Пон','Вто','Сря','Чет','Пет','Съб'], dayNamesMin: ['Не','По','Вт','Ср','Че','Пе','Съ'], dayStatus: 'Сложи DD като първи ден от седмицата', dateStatus: 'Избери D, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: 'Избери дата', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['bg']); }); /* Inicialitzaci� en catal� per a l'extenci� 'calendar' per jQuery. */ /* Writers: ([email protected]). */ jQuery(function($){ $.datepicker.regional['ca'] = { clearText: 'Netejar', clearStatus: '', closeText: 'Tancar', closeStatus: '', prevText: '&#x3c;Ant', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Seg&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Avui', currentStatus: '', monthNames: ['Gener','Febrer','Mar&ccedil;','Abril','Maig','Juny', 'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'], monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun', 'Jul','Ago','Set','Oct','Nov','Des'], monthStatus: '', yearStatus: '', weekHeader: 'Sm', weekStatus: '', dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'], dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'], dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'mm/dd/yy', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['ca']); });/* Czech initialisation for the jQuery UI date picker plugin. */ /* Written by Tomas Muller ([email protected]). */ jQuery(function($){ $.datepicker.regional['cs'] = { clearText: 'Vymazat', clearStatus: 'Vymaže zadané datum', closeText: 'Zavřít', closeStatus: 'Zavře kalendář beze změny', prevText: '&#x3c;Dříve', prevStatus: 'Přejít na předchozí měsí', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Později&#x3e;', nextStatus: 'Přejít na další měsíc', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Nyní', currentStatus: 'Přejde na aktuální měsíc', monthNames: ['leden','únor','březen','duben','květen','červen', 'červenec','srpen','září','říjen','listopad','prosinec'], monthNamesShort: ['led','úno','bře','dub','kvě','čer', 'čvc','srp','zář','říj','lis','pro'], monthStatus: 'Přejít na jiný měsíc', yearStatus: 'Přejít na jiný rok', weekHeader: 'Týd', weekStatus: 'Týden v roce', dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], dayNamesMin: ['ne','po','út','st','čt','pá','so'], dayStatus: 'Nastavit DD jako první den v týdnu', dateStatus: '\'Vyber\' DD, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: 'Vyberte datum', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['cs']); }); /* Danish initialisation for the jQuery UI date picker plugin. */ /* Written by Jan Christensen ( [email protected]). */ jQuery(function($){ $.datepicker.regional['da'] = { clearText: 'Nulstil', clearStatus: 'Nulstil den aktuelle dato', closeText: 'Luk', closeStatus: 'Luk uden ændringer', prevText: '&#x3c;Forrige', prevStatus: 'Vis forrige måned', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Næste&#x3e;', nextStatus: 'Vis næste måned', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Idag', currentStatus: 'Vis aktuel måned', monthNames: ['Januar','Februar','Marts','April','Maj','Juni', 'Juli','August','September','Oktober','November','December'], monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', 'Jul','Aug','Sep','Okt','Nov','Dec'], monthStatus: 'Vis en anden måned', yearStatus: 'Vis et andet år', weekHeader: 'Uge', weekStatus: 'Årets uge', dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], dayStatus: 'Sæt DD som første ugedag', dateStatus: 'Vælg D, M d', dateFormat: 'dd-mm-yy', firstDay: 0, initStatus: 'Vælg en dato', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['da']); }); /* German initialisation for the jQuery UI date picker plugin. */ /* Written by Milian Wolff ([email protected]). */ jQuery(function($){ $.datepicker.regional['de'] = { clearText: 'löschen', clearStatus: 'aktuelles Datum löschen', closeText: 'schließen', closeStatus: 'ohne Änderungen schließen', prevText: '&#x3c;zurück', prevStatus: 'letzten Monat zeigen', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Vor&#x3e;', nextStatus: 'nächsten Monat zeigen', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'heute', currentStatus: '', monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'], monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Dez'], monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen', weekHeader: 'Wo', weekStatus: 'Woche des Monats', dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'], dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: 'Wähle ein Datum', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['de']); }); /* Esperanto initialisation for the jQuery UI date picker plugin. */ /* Written by Olivier M. ([email protected]). */ jQuery(function($){ $.datepicker.regional['eo'] = { clearText: 'Vakigi', clearStatus: '', closeText: 'Fermi', closeStatus: 'Fermi sen modifi', prevText: '&lt;Anta', prevStatus: 'Vidi la antaŭan monaton', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Sekv&gt;', nextStatus: 'Vidi la sekvan monaton', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Nuna', currentStatus: 'Vidi la nunan monaton', monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio', 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'], monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', 'Jul','Aŭg','Sep','Okt','Nov','Dec'], monthStatus: 'Vidi alian monaton', yearStatus: 'Vidi alian jaron', weekHeader: 'Sb', weekStatus: '', dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'], dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'], dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'], dayStatus: 'Uzi DD kiel unua tago de la semajno', dateStatus: 'Elekti DD, MM d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: 'Elekti la daton', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['eo']); }); /* Inicializaci�n en espa�ol para la extensi�n 'UI date picker' para jQuery. */ /* Traducido por Vester ([email protected]). */ jQuery(function($){ $.datepicker.regional['es'] = { clearText: 'Limpiar', clearStatus: '', closeText: 'Cerrar', closeStatus: '', prevText: '&#x3c;Ant', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Sig&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Hoy', currentStatus: '', monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', 'Jul','Ago','Sep','Oct','Nov','Dic'], monthStatus: '', yearStatus: '', weekHeader: 'Sm', weekStatus: '', dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'], dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'], dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','S&aacute;'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['es']); });/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */ /* Javad Mowlanezhad -- [email protected] */ /* Jalali calendar should supported soon! (Its implemented but I have to test it) */ jQuery(function($) { $.datepicker.regional['fa'] = { clearText: 'حذف تاريخ', clearStatus: 'پاک کردن تاريخ جاري', closeText: 'بستن', closeStatus: 'بستن بدون اعمال تغييرات', prevText: '&#x3c;قبلي', prevStatus: 'نمايش ماه قبل', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'بعدي&#x3e;', nextStatus: 'نمايش ماه بعد', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'امروز', currentStatus: 'نمايش ماه جاري', monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور', 'مهر','آبان','آذر','دي','بهمن','اسفند'], monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], monthStatus: 'نمايش ماه متفاوت', yearStatus: 'نمايش سال متفاوت', weekHeader: 'هف', weekStatus: 'هفتهِ سال', dayNames: ['يکشنبه','دوشنبه','سه‌شنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'], dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'], dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'], dayStatus: 'قبول DD بعنوان اولين روز هفته', dateStatus: 'انتخاب D, M d', dateFormat: 'yy/mm/dd', firstDay: 6, initStatus: 'انتخاب تاريخ', isRTL: true}; $.datepicker.setDefaults($.datepicker.regional['fa']); });/* Finnish initialisation for the jQuery UI date picker plugin. */ /* Written by Harri Kilpi� ([email protected]). */ jQuery(function($){ $.datepicker.regional['fi'] = { clearText: 'Tyhjenn&auml;', clearStatus: '', closeText: 'Sulje', closeStatus: '', prevText: '&laquo;Edellinen', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Seuraava&raquo;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'T&auml;n&auml;&auml;n', currentStatus: '', monthNames: ['Tammikuu','Helmikuu','Maaliskuu','Huhtikuu','Toukokuu','Kes&auml;kuu', 'Hein&auml;kuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'], monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kes&auml;', 'Hein&auml;','Elo','Syys','Loka','Marras','Joulu'], monthStatus: '', yearStatus: '', weekHeader: 'Vk', weekStatus: '', dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'], dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'], dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['fi']); }); /* French initialisation for the jQuery UI date picker plugin. */ /* Written by Keith Wood ([email protected]) and Stéphane Nahmani ([email protected]). */ jQuery(function($){ $.datepicker.regional['fr'] = { clearText: 'Effacer', clearStatus: 'Effacer la date sélectionnée', closeText: 'Fermer', closeStatus: 'Fermer sans modifier', prevText: '&#x3c;Préc', prevStatus: 'Voir le mois précédent', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Suiv&#x3e;', nextStatus: 'Voir le mois suivant', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Courant', currentStatus: 'Voir le mois courant', monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', 'Jul','Aoû','Sep','Oct','Nov','Déc'], monthStatus: 'Voir un autre mois', yearStatus: 'Voir une autre année', weekHeader: 'Sm', weekStatus: '', dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: '\'Choisir\' le DD d MM', dateFormat: 'dd/mm/yy', firstDay: 1, initStatus: 'Choisir la date', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['fr']); });/* Hebrew initialisation for the UI Datepicker extension. */ /* Written by Amir Hardon (ahardon at gmail dot com). */ jQuery(function($){ $.datepicker.regional['he'] = { clearText: 'נקה', clearStatus: '', closeText: 'סגור', closeStatus: '', prevText: '&#x3c;הקודם', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'הבא&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'היום', currentStatus: '', monthNames: ['ינואר','פברואר','מרץ','אפריל','מאי','יוני', 'יולי','אוגוסט','ספטמבר','אוקטובר','נובמבר','דצמבר'], monthNamesShort: ['1','2','3','4','5','6', '7','8','9','10','11','12'], monthStatus: '', yearStatus: '', weekHeader: 'Sm', weekStatus: '', dayNames: ['ראשון','שני','שלישי','רביעי','חמישי','שישי','שבת'], dayNamesShort: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], dayNamesMin: ['א\'','ב\'','ג\'','ד\'','ה\'','ו\'','שבת'], dayStatus: 'DD', dateStatus: 'DD, M d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: '', isRTL: true}; $.datepicker.setDefaults($.datepicker.regional['he']); }); /* Croatian i18n for the jQuery UI date picker plugin. */ /* Written by Vjekoslav Nesek. */ jQuery(function($){ $.datepicker.regional['hr'] = { clearText: 'izbriši', clearStatus: 'Izbriši trenutni datum', closeText: 'Zatvori', closeStatus: 'Zatvori kalendar', prevText: '&#x3c;', prevStatus: 'Prikaži prethodni mjesec', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: '&#x3e;', nextStatus: 'Prikaži slijedeći mjesec', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Danas', currentStatus: 'Današnji datum', monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipani', 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'], monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip', 'Srp','Kol','Ruj','Lis','Stu','Pro'], monthStatus: 'Prikaži mjesece', yearStatus: 'Prikaži godine', weekHeader: 'Tje', weekStatus: 'Tjedan', dayNames: ['Nedjalja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], dayStatus: 'Odaber DD za prvi dan tjedna', dateStatus: '\'Datum\' D, M d', dateFormat: 'dd.mm.yy.', firstDay: 1, initStatus: 'Odaberi datum', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['hr']); });/* Hungarian initialisation for the jQuery UI date picker plugin. */ /* Written by Istvan Karaszi ([email protected]). */ jQuery(function($){ $.datepicker.regional['hu'] = { clearText: 'törlés', clearStatus: '', closeText: 'bezárás', closeStatus: '', prevText: '&laquo;&nbsp;vissza', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'előre&nbsp;&raquo;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'ma', currentStatus: '', monthNames: ['Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December'], monthNamesShort: ['Jan', 'Feb', 'Már', 'Ápr', 'Máj', 'Jún', 'Júl', 'Aug', 'Szep', 'Okt', 'Nov', 'Dec'], monthStatus: '', yearStatus: '', weekHeader: 'Hé', weekStatus: '', dayNames: ['Vasámap', 'Hétfö', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat'], dayNamesShort: ['Vas', 'Hét', 'Ked', 'Sze', 'Csü', 'Pén', 'Szo'], dayNamesMin: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'yy-mm-dd', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['hu']); }); /* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ /* Written by Levon Zakaryan ([email protected])*/ jQuery(function($){ $.datepicker.regional['hy'] = { clearText: 'Մաքրել', clearStatus: '', closeText: 'Փակել', closeStatus: '', prevText: '&#x3c;Նախ.', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Հաջ.&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Այսօր', currentStatus: '', monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս', 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'], monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս', 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'], monthStatus: '', yearStatus: '', weekHeader: 'ՇԲՏ', weekStatus: '', dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'], dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['hy']); });/* Indonesian initialisation for the jQuery UI date picker plugin. */ /* Written by Deden Fathurahman ([email protected]). */ jQuery(function($){ $.datepicker.regional['id'] = { clearText: 'kosongkan', clearStatus: 'bersihkan tanggal yang sekarang', closeText: 'Tutup', closeStatus: 'Tutup tanpa mengubah', prevText: '&#x3c;mundur', prevStatus: 'Tampilkan bulan sebelumnya', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'maju&#x3e;', nextStatus: 'Tampilkan bulan berikutnya', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'hari ini', currentStatus: 'Tampilkan bulan sekarang', monthNames: ['Januari','Februari','Maret','April','Mei','Juni', 'Juli','Agustus','September','Oktober','Nopember','Desember'], monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun', 'Jul','Agus','Sep','Okt','Nop','Des'], monthStatus: 'Tampilkan bulan yang berbeda', yearStatus: 'Tampilkan tahun yang berbeda', weekHeader: 'Mg', weekStatus: 'Minggu dalam tahun', dayNames: ['Minggu','Senin','Selasa','Rabu','Kamis','Jumat','Sabtu'], dayNamesShort: ['Min','Sen','Sel','Rab','kam','Jum','Sab'], dayNamesMin: ['Mg','Sn','Sl','Rb','Km','jm','Sb'], dayStatus: 'gunakan DD sebagai awal hari dalam minggu', dateStatus: 'pilih le DD, MM d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: 'Pilih Tanggal', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['id']); });/* Icelandic initialisation for the jQuery UI date picker plugin. */ /* Written by Haukur H. Thorsson ([email protected]). */ jQuery(function($){ $.datepicker.regional['is'] = { clearText: 'Hreinsa', clearStatus: '', closeText: 'Loka', closeStatus: '', prevText: '&#x3c; Fyrri', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'N&aelig;sti &#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: '&Iacute; dag', currentStatus: '', monthNames: ['Jan&uacute;ar','Febr&uacute;ar','Mars','Apr&iacute;l','Ma&iacute','J&uacute;n&iacute;', 'J&uacute;l&iacute;','&Aacute;g&uacute;st','September','Okt&oacute;ber','N&oacute;vember','Desember'], monthNamesShort: ['Jan','Feb','Mar','Apr','Ma&iacute;','J&uacute;n', 'J&uacute;l','&Aacute;g&uacute;','Sep','Okt','N&oacute;v','Des'], monthStatus: '', yearStatus: '', weekHeader: 'Vika', weekStatus: '', dayNames: ['Sunnudagur','M&aacute;nudagur','&THORN;ri&eth;judagur','Mi&eth;vikudagur','Fimmtudagur','F&ouml;studagur','Laugardagur'], dayNamesShort: ['Sun','M&aacute;n','&THORN;ri','Mi&eth;','Fim','F&ouml;s','Lau'], dayNamesMin: ['Su','M&aacute;','&THORN;r','Mi','Fi','F&ouml;','La'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['is']); });/* Italian initialisation for the jQuery UI date picker plugin. */ /* Written by Apaella ([email protected]). */ jQuery(function($){ $.datepicker.regional['it'] = { clearText: 'Svuota', clearStatus: 'Annulla', closeText: 'Chiudi', closeStatus: 'Chiudere senza modificare', prevText: '&#x3c;Prec', prevStatus: 'Mese precedente', prevBigText: '&#x3c;&#x3c;', prevBigStatus: 'Mostra l\'anno precedente', nextText: 'Succ&#x3e;', nextStatus: 'Mese successivo', nextBigText: '&#x3e;&#x3e;', nextBigStatus: 'Mostra l\'anno successivo', currentText: 'Oggi', currentStatus: 'Mese corrente', monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu', 'Lug','Ago','Set','Ott','Nov','Dic'], monthStatus: 'Seleziona un altro mese', yearStatus: 'Seleziona un altro anno', weekHeader: 'Sm', weekStatus: 'Settimana dell\'anno', dayNames: ['Domenica','Luned&#236','Marted&#236','Mercoled&#236','Gioved&#236','Venerd&#236','Sabato'], dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa'], dayStatus: 'Usa DD come primo giorno della settimana', dateStatus: '\'Seleziona\' D, M d', dateFormat: 'dd/mm/yy', firstDay: 1, initStatus: 'Scegliere una data', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['it']); }); /* Japanese initialisation for the jQuery UI date picker plugin. */ /* Written by Kentaro SATO ([email protected]). */ jQuery(function($){ $.datepicker.regional['ja'] = { clearText: 'クリア', clearStatus: '日付をクリアします', closeText: '閉じる', closeStatus: '変更せずに閉じます', prevText: '&#x3c;前', prevStatus: '前月を表示します', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '前年を表示します', nextText: '次&#x3e;', nextStatus: '翌月を表示します', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '翌年を表示します', currentText: '今日', currentStatus: '今月を表示します', monthNames: ['1月','2月','3月','4月','5月','6月', '7月','8月','9月','10月','11月','12月'], monthNamesShort: ['1月','2月','3月','4月','5月','6月', '7月','8月','9月','10月','11月','12月'], monthStatus: '表示する月を変更します', yearStatus: '表示する年を変更します', weekHeader: '週', weekStatus: '暦週で第何週目かを表します', dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'], dayNamesShort: ['日','月','火','水','木','金','土'], dayNamesMin: ['日','月','火','水','木','金','土'], dayStatus: '週の始まりをDDにします', dateStatus: 'Md日(D)', dateFormat: 'yy/mm/dd', firstDay: 0, initStatus: '日付を選択します', isRTL: false, showMonthAfterYear: true}; $.datepicker.setDefaults($.datepicker.regional['ja']); });/* Korean initialisation for the jQuery calendar extension. */ /* Written by DaeKwon Kang ([email protected]). */ jQuery(function($){ $.datepicker.regional['ko'] = { clearText: '지우기', clearStatus: '', closeText: '닫기', closeStatus: '', prevText: '이전달', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: '다음달', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: '오늘', currentStatus: '', monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], monthNamesShort: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)', '7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'], monthStatus: '', yearStatus: '', weekHeader: 'Wk', weekStatus: '', dayNames: ['일','월','화','수','목','금','토'], dayNamesShort: ['일','월','화','수','목','금','토'], dayNamesMin: ['일','월','화','수','목','금','토'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'yy-mm-dd', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['ko']); });/* Lithuanian (UTF-8) initialisation for the jQuery UI date picker plugin. */ /* @author Arturas Paleicikas <[email protected]> */ jQuery(function($){ $.datepicker.regional['lt'] = { clearText: 'Išvalyti', clearStatus: '', closeText: 'Uždaryti', closeStatus: '', prevText: '&#x3c;Atgal', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Pirmyn&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Šiandien', currentStatus: '', monthNames: ['Sausis','Vasaris','Kovas','Balandis','Gegužė','Birželis', 'Liepa','Rugpjūtis','Rugsėjis','Spalis','Lapkritis','Gruodis'], monthNamesShort: ['Sau','Vas','Kov','Bal','Geg','Bir', 'Lie','Rugp','Rugs','Spa','Lap','Gru'], monthStatus: '', yearStatus: '', weekHeader: '', weekStatus: '', dayNames: ['sekmadienis','pirmadienis','antradienis','trečiadienis','ketvirtadienis','penktadienis','šeštadienis'], dayNamesShort: ['sek','pir','ant','tre','ket','pen','šeš'], dayNamesMin: ['Se','Pr','An','Tr','Ke','Pe','Še'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'yy-mm-dd', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['lt']); });/* Latvian (UTF-8) initialisation for the jQuery UI date picker plugin. */ /* @author Arturas Paleicikas <[email protected]> */ jQuery(function($){ $.datepicker.regional['lv'] = { clearText: 'Notīrīt', clearStatus: '', closeText: 'Aizvērt', closeStatus: '', prevText: 'Iepr', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Nāka', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Šodien', currentStatus: '', monthNames: ['Janvāris','Februāris','Marts','Aprīlis','Maijs','Jūnijs', 'Jūlijs','Augusts','Septembris','Oktobris','Novembris','Decembris'], monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jūn', 'Jūl','Aug','Sep','Okt','Nov','Dec'], monthStatus: '', yearStatus: '', weekHeader: 'Nav', weekStatus: '', dayNames: ['svētdiena','pirmdiena','otrdiena','trešdiena','ceturtdiena','piektdiena','sestdiena'], dayNamesShort: ['svt','prm','otr','tre','ctr','pkt','sst'], dayNamesMin: ['Sv','Pr','Ot','Tr','Ct','Pk','Ss'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd-mm-yy', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['lv']); });/* Dutch (UTF-8) initialisation for the jQuery UI date picker plugin. */ /* Written by Mathias Bynens <http://mathiasbynens.be/> */ jQuery(function($){ $.datepicker.regional.nl = { clearText: 'Wissen', clearStatus: 'Wis de huidige datum', closeText: 'Sluiten', closeStatus: 'Sluit zonder verandering', prevText: '←', prevStatus: 'Bekijk de vorige maand', prevBigText: '«', nextBigStatus: 'Bekijk het vorige jaar', nextText: '→', nextStatus: 'Bekijk de volgende maand', nextBigText: '»', nextBigStatus: 'Bekijk het volgende jaar', currentText: 'Vandaag', currentStatus: 'Bekijk de huidige maand', monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], monthStatus: 'Bekijk een andere maand', yearStatus: 'Bekijk een ander jaar', weekHeader: 'Wk', weekStatus: 'Week van het jaar', dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'], dayNamesMin: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], dayStatus: 'Stel DD in als eerste dag van de week', dateStatus: 'dd/mm/yy', dateFormat: 'dd/mm/yy', firstDay: 1, initStatus: 'Kies een datum', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional.nl); });/* Norwegian initialisation for the jQuery UI date picker plugin. */ /* Written by Naimdjon Takhirov ([email protected]). */ jQuery(function($){ $.datepicker.regional['no'] = { clearText: 'Tøm', clearStatus: '', closeText: 'Lukk', closeStatus: '', prevText: '&laquo;Forrige', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Neste&raquo;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'I dag', currentStatus: '', monthNames: ['Januar','Februar','Mars','April','Mai','Juni', 'Juli','August','September','Oktober','November','Desember'], monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', 'Jul','Aug','Sep','Okt','Nov','Des'], monthStatus: '', yearStatus: '', weekHeader: 'Uke', weekStatus: '', dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'yy-mm-dd', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['no']); }); /* Polish initialisation for the jQuery UI date picker plugin. */ /* Written by Jacek Wysocki ([email protected]). */ jQuery(function($){ $.datepicker.regional['pl'] = { clearText: 'Wyczyść', clearStatus: 'Wyczyść obecną datę', closeText: 'Zamknij', closeStatus: 'Zamknij bez zapisywania', prevText: '&#x3c;Poprzedni', prevStatus: 'Pokaż poprzedni miesiąc', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Następny&#x3e;', nextStatus: 'Pokaż następny miesiąc', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Dziś', currentStatus: 'Pokaż aktualny miesiąc', monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze', 'Lip','Sie','Wrz','Pa','Lis','Gru'], monthStatus: 'Pokaż inny miesiąc', yearStatus: 'Pokaż inny rok', weekHeader: 'Tydz', weekStatus: 'Tydzień roku', dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'], dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'], dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'], dayStatus: 'Ustaw DD jako pierwszy dzień tygodnia', dateStatus: '\'Wybierz\' D, M d', dateFormat: 'yy-mm-dd', firstDay: 1, initStatus: 'Wybierz datę', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['pl']); }); /* Brazilian initialisation for the jQuery UI date picker plugin. */ /* Written by Leonildo Costa Silva ([email protected]). */ jQuery(function($){ $.datepicker.regional['pt-BR'] = { clearText: 'Limpar', clearStatus: '', closeText: 'Fechar', closeStatus: '', prevText: '&#x3c;Anterior', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Pr&oacute;ximo&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Hoje', currentStatus: '', monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho', 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', 'Jul','Ago','Set','Out','Nov','Dez'], monthStatus: '', yearStatus: '', weekHeader: 'Sm', weekStatus: '', dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'], dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['pt-BR']); });/* Romanian initialisation for the jQuery UI date picker plugin. */ /* Written by Edmond L. ([email protected]). */ jQuery(function($){ $.datepicker.regional['ro'] = { clearText: 'Curat', clearStatus: 'Sterge data curenta', closeText: 'Inchide', closeStatus: 'Inchide fara schimbare', prevText: '&#x3c;Anterior', prevStatus: 'Arata luna trecuta', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Urmator&#x3e;', nextStatus: 'Arata luna urmatoare', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Azi', currentStatus: 'Arata luna curenta', monthNames: ['Ianuarie','Februarie','Martie','Aprilie','Mai','Junie', 'Julie','August','Septembrie','Octobrie','Noiembrie','Decembrie'], monthNamesShort: ['Ian', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Noi', 'Dec'], monthStatus: 'Arata o luna diferita', yearStatus: 'Arat un an diferit', weekHeader: 'Sapt', weekStatus: 'Saptamana anului', dayNames: ['Duminica', 'Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata'], dayNamesShort: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam'], dayNamesMin: ['Du','Lu','Ma','Mi','Jo','Vi','Sa'], dayStatus: 'Seteaza DD ca prima saptamana zi', dateStatus: 'Selecteaza D, M d', dateFormat: 'mm/dd/yy', firstDay: 0, initStatus: 'Selecteaza o data', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['ro']); }); /* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ /* Written by Andrew Stromnov ([email protected]). */ jQuery(function($){ $.datepicker.regional['ru'] = { clearText: 'Очистить', clearStatus: '', closeText: 'Закрыть', closeStatus: '', prevText: '&#x3c;Пред', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'След&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Сегодня', currentStatus: '', monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', 'Июл','Авг','Сен','Окт','Ноя','Дек'], monthStatus: '', yearStatus: '', weekHeader: 'Не', weekStatus: '', dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['ru']); });/* Slovak initialisation for the jQuery UI date picker plugin. */ /* Written by Vojtech Rinik ([email protected]). */ jQuery(function($){ $.datepicker.regional['sk'] = { clearText: 'Zmazať', clearStatus: '', closeText: 'Zavrieť', closeStatus: '', prevText: '&#x3c;Predchádzajúci', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Nasledujúci&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Dnes', currentStatus: '', monthNames: ['Január','Február','Marec','Apríl','Máj','Jún', 'Júl','August','September','Október','November','December'], monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún', 'Júl','Aug','Sep','Okt','Nov','Dec'], monthStatus: '', yearStatus: '', weekHeader: 'Ty', weekStatus: '', dayNames: ['Nedel\'a','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'], dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'], dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd.mm.yy', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['sk']); }); /* Slovenian initialisation for the jQuery UI date picker plugin. */ /* Written by Jaka Jancar ([email protected]). */ /* c = &#x10D;, s = &#x161; z = &#x17E; C = &#x10C; S = &#x160; Z = &#x17D; */ jQuery(function($){ $.datepicker.regional['sl'] = { clearText: 'Izbri&#x161;i', clearStatus: 'Izbri&#x161;i trenutni datum', closeText: 'Zapri', closeStatus: 'Zapri brez spreminjanja', prevText: '&lt;Prej&#x161;nji', prevStatus: 'Prika&#x17E;i prej&#x161;nji mesec', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Naslednji&gt;', nextStatus: 'Prika&#x17E;i naslednji mesec', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Trenutni', currentStatus: 'Prika&#x17E;i trenutni mesec', monthNames: ['Januar','Februar','Marec','April','Maj','Junij', 'Julij','Avgust','September','Oktober','November','December'], monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', 'Jul','Avg','Sep','Okt','Nov','Dec'], monthStatus: 'Prika&#x17E;i drug mesec', yearStatus: 'Prika&#x17E;i drugo leto', weekHeader: 'Teden', weekStatus: 'Teden v letu', dayNames: ['Nedelja','Ponedeljek','Torek','Sreda','&#x10C;etrtek','Petek','Sobota'], dayNamesShort: ['Ned','Pon','Tor','Sre','&#x10C;et','Pet','Sob'], dayNamesMin: ['Ne','Po','To','Sr','&#x10C;e','Pe','So'], dayStatus: 'Nastavi DD za prvi dan v tednu', dateStatus: 'Izberi DD, d MM yy', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: 'Izbira datuma', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['sl']); }); /* Albanian initialisation for the jQuery UI date picker plugin. */ /* Written by Flakron Bytyqi ([email protected]). */ jQuery(function($){ $.datepicker.regional['sq'] = { clearText: 'fshije', clearStatus: 'fshije datën aktuale', closeText: 'mbylle', closeStatus: 'mbylle pa ndryshime', prevText: '&#x3c;mbrapa', prevStatus: 'trego muajin e fundit', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Përpara&#x3e;', nextStatus: 'trego muajin tjetër', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'sot', currentStatus: '', monthNames: ['Janar','Shkurt','Mars','Pril','Maj','Qershor', 'Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'], monthNamesShort: ['Jan','Shk','Mar','Pri','Maj','Qer', 'Kor','Gus','Sht','Tet','Nën','Dhj'], monthStatus: 'trego muajin tjetër', yearStatus: 'trego tjetër vit', weekHeader: 'Ja', weekStatus: 'Java e muajit', dayNames: ['E Diel','E Hënë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'], dayNamesShort: ['Di','Hë','Ma','Më','En','Pr','Sh'], dayNamesMin: ['Di','Hë','Ma','Më','En','Pr','Sh'], dayStatus: 'Vendose DD si ditë të parë të javës', dateStatus: '\'Zgjedh\' D, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: 'Zgjedhe një datë', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['sq']); }); /* Swedish initialisation for the jQuery UI date picker plugin. */ /* Written by Anders Ekdahl ( [email protected]). */ jQuery(function($){ $.datepicker.regional['sv'] = { clearText: 'Rensa', clearStatus: '', closeText: 'Stäng', closeStatus: '', prevText: '&laquo;Förra', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'Nästa&raquo;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Idag', currentStatus: '', monthNames: ['Januari','Februari','Mars','April','Maj','Juni', 'Juli','Augusti','September','Oktober','November','December'], monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', 'Jul','Aug','Sep','Okt','Nov','Dec'], monthStatus: '', yearStatus: '', weekHeader: 'Ve', weekStatus: '', dayNamesShort: ['Sön','Mån','Tis','Ons','Tor','Fre','Lör'], dayNames: ['Söndag','Måndag','Tisdag','Onsdag','Torsdag','Fredag','Lördag'], dayNamesMin: ['Sö','Må','Ti','On','To','Fr','Lö'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'yy-mm-dd', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['sv']); }); /* Thai initialisation for the jQuery UI date picker plugin. */ /* Written by pipo ([email protected]). */ jQuery(function($){ $.datepicker.regional['th'] = { clearText: 'ลบ', clearStatus: '', closeText: 'ปิด', closeStatus: '', prevText: '&laquo;&nbsp;ย้อน', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'ถัดไป&nbsp;&raquo;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'วันนี้', currentStatus: '', monthNames: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน', 'กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], monthNamesShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.', 'ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], monthStatus: '', yearStatus: '', weekHeader: 'Sm', weekStatus: '', dayNames: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], dayNamesShort: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], dayNamesMin: ['อา.','จ.','อ.','พ.','พฤ.','ศ.','ส.'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd/mm/yy', firstDay: 0, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['th']); });/* Turkish initialisation for the jQuery UI date picker plugin. */ /* Written by Izzet Emre Erkan ([email protected]). */ jQuery(function($){ $.datepicker.regional['tr'] = { clearText: 'temizle', clearStatus: 'geçerli tarihi temizler', closeText: 'kapat', closeStatus: 'sadece göstergeyi kapat', prevText: '&#x3c;geri', prevStatus: 'önceki ayı göster', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: 'ileri&#x3e', nextStatus: 'sonraki ayı göster', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'bugün', currentStatus: '', monthNames: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'], monthNamesShort: ['Oca','Şub','Mar','Nis','May','Haz', 'Tem','Ağu','Eyl','Eki','Kas','Ara'], monthStatus: 'başka ay', yearStatus: 'başka yıl', weekHeader: 'Hf', weekStatus: 'Ayın haftaları', dayNames: ['Pazar','Pazartesi','Salı','Çarşamba','Perşembe','Cuma','Cumartesi'], dayNamesShort: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], dayNamesMin: ['Pz','Pt','Sa','Ça','Pe','Cu','Ct'], dayStatus: 'Haftanın ilk gününü belirleyin', dateStatus: 'D, M d seçiniz', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: 'Bir tarih seçiniz', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['tr']); });/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ /* Written by Maxim Drogobitskiy ([email protected]). */ jQuery(function($){ $.datepicker.regional['uk'] = { clearText: 'Очистити', clearStatus: '', closeText: 'Закрити', closeStatus: '', prevText: '&#x3c;', prevStatus: '', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '', nextText: '&#x3e;', nextStatus: '', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '', currentText: 'Сьогодні', currentStatus: '', monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', 'Лип','Сер','Вер','Жов','Лис','Гру'], monthStatus: '', yearStatus: '', weekHeader: 'Не', weekStatus: '', dayNames: ['неділя','понеділок','вівторок','середа','четвер','пятниця','суббота'], dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], dayStatus: 'DD', dateStatus: 'D, M d', dateFormat: 'dd.mm.yy', firstDay: 1, initStatus: '', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['uk']); });/* Chinese initialisation for the jQuery UI date picker plugin. */ /* Written by Cloudream ([email protected]). */ jQuery(function($){ $.datepicker.regional['zh-CN'] = { clearText: '清除', clearStatus: '清除已选日期', closeText: '关闭', closeStatus: '不改变当前选择', prevText: '&#x3c;上月', prevStatus: '显示上月', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '显示上一年', nextText: '下月&#x3e;', nextStatus: '显示下月', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '显示下一年', currentText: '今天', currentStatus: '显示本月', monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], monthNamesShort: ['一','二','三','四','五','六', '七','八','九','十','十一','十二'], monthStatus: '选择月份', yearStatus: '选择年份', weekHeader: '周', weekStatus: '年内周次', dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], dayNamesMin: ['日','一','二','三','四','五','六'], dayStatus: '设置 DD 为一周起始', dateStatus: '选择 m月 d日, DD', dateFormat: 'yy-mm-dd', firstDay: 1, initStatus: '请选择日期', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['zh-CN']); }); /* Chinese initialisation for the jQuery UI date picker plugin. */ /* Written by Ressol ([email protected]). */ jQuery(function($){ $.datepicker.regional['zh-TW'] = { clearText: '清除', clearStatus: '清除已選日期', closeText: '關閉', closeStatus: '不改變目前的選擇', prevText: '&#x3c;上月', prevStatus: '顯示上月', prevBigText: '&#x3c;&#x3c;', prevBigStatus: '顯示上一年', nextText: '下月&#x3e;', nextStatus: '顯示下月', nextBigText: '&#x3e;&#x3e;', nextBigStatus: '顯示下一年', currentText: '今天', currentStatus: '顯示本月', monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], monthNamesShort: ['一','二','三','四','五','六', '七','八','九','十','十一','十二'], monthStatus: '選擇月份', yearStatus: '選擇年份', weekHeader: '周', weekStatus: '年內周次', dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], dayNamesMin: ['日','一','二','三','四','五','六'], dayStatus: '設定 DD 為一周起始', dateStatus: '選擇 m月 d日, DD', dateFormat: 'yy/mm/dd', firstDay: 1, initStatus: '請選擇日期', isRTL: false}; $.datepicker.setDefaults($.datepicker.regional['zh-TW']); });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/ui/i18n/jquery.ui.i18n.all.js
jquery.ui.i18n.all.js
var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var e=this,g,a=document.body,c=e.dom.getViewPort(window),d,f;d=e.getWindowArg("mce_width")-c.w;f=e.getWindowArg("mce_height")-c.h;if(e.isWindow){window.resizeBy(d,f)}else{e.editor.windowManager.resizeBy(d,f,e.id)}},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/tiny_mce_popup.js
tiny_mce_popup.js
(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c<e;c++){g=l[c].split("=");b=g[0].replace(/\s/,"");h=g[1];if(h){h=h.replace(/^\s+/,"").replace(/\s+$/,"");j=h.match(/^["'](.*)["']$/);if(j){h=j[1]}}else{h=b}d.dom.setAttrib(d.getBody(),"style",h)}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true})},_setContent:function(d,b){var h=this,a,j,f=b.content,g,i="";if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);h.head=f.substring(0,a+1);j=f.indexOf("</body",a);if(j==-1){j=f.indexOf("</body",j)}b.content=f.substring(a+1,j);h.foot=f.substring(j);function e(c){return c.replace(/<\/?[A-Z]+/g,function(k){return k.toLowerCase()})}h.head=e(h.head);h.foot=e(h.foot)}else{h.head="";if(d.getParam("fullpage_default_xml_pi")){h.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}h.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.head+="\n<html>\n<head>\n<title>"+d.getParam("fullpage_default_title","Untitled document")+"</title>\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='<meta http-equiv="Content-Type" content="'+g+'" />\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n";h.foot="\n</body>\n</html>"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})();
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/editor_plugin.js
editor_plugin.js
tinyMCE.addI18n('ko.fullpage_dlg',{ title:"\uD398\uC774\uC9C0\uC758 \uC18D\uC131", meta_tab:"\uC77C\uBC18", appearance_tab:"\uD45C\uC2DC", advanced_tab:"\uACE0\uAE09", meta_props:"\uBA54\uD0C0 \uC815\uBCF4", langprops:"\uC5B8\uC5B4\uC640 \uC778\uCF54\uB529", meta_title:"Title", meta_keywords:"Keywords", meta_description:"Description", meta_robots:"Robots", doctypes:"Doctype", langcode:"\uC5B8\uC5B4 \uCF54\uB4DC", langdir:"\uBB38\uC790 \uBC29\uD5A5", ltr:"\uC67C\uCABD\uC5D0\uC11C \uC624\uB978\uCABD", rtl:"\uC624\uB978\uCABD\uC5D0\uC11C \uC67C\uCABD", xml_pi:"XML\uC120\uC5B8", encoding:"\uBB38\uC790 \uC778\uCF54\uB529", appearance_bgprops:"\uBC30\uACBD \uC124\uC815", appearance_marginprops:"Body \uB9C8\uC9C4", appearance_linkprops:"\uB9C1\uD06C\uC0C9", appearance_textprops:"\uD14D\uC2A4\uD2B8 \uC124\uC815", bgcolor:"\uBC30\uACBD\uC0C9", bgimage:"\uBC30\uACBD \uC774\uBBF8\uC9C0", left_margin:"\uC67C\uCABD \uB9C8\uC9C4", right_margin:"\uC624\uB978\uCABD \uB9C8\uC9C4", top_margin:"\uC704 \uB9C8\uC9C4", bottom_margin:"\uC544\uB798 \uB9C8\uC9C4", text_color:"\uBB38\uC790\uC0C9", font_size:"\uBB38\uC790 \uD06C\uAE30", font_face:"\uAE00\uAF34", link_color:"\uB9C1\uD06C\uC0C9", hover_color:"\uB9C1\uD06C\uC0C9(hover)", visited_color:"\uB9C1\uD06C\uC0C9(visited)", active_color:"\uB9C1\uD06C\uC0C9(active)", textcolor:"\uC0C9", fontsize:"\uBB38\uC790 \uD06C\uAE30", fontface:"\uD3F0\uD2B8", meta_index_follow:"\uBAA8\uB450 \uD5C8\uAC00", meta_index_nofollow:"\uD398\uC774\uC9C0\uB97C \uD5C8\uAC00\uD558\uC9C0\uB9CC \uB9C1\uD06C \uAE08\uC9C0", meta_noindex_follow:"\uD398\uC774\uC9C0\uB97C \uAE08\uC9C0\uD558\uACE0 \uB9C1\uD06C \uD5C8\uAC00", meta_noindex_nofollow:"\uBAA8\uB450 \uAE08\uC9C0", appearance_style:"\uC2A4\uD0C0\uC77C\uC2DC\uD2B8 \uC124\uC815", stylesheet:"\uC2A4\uD0C0\uC77C\uC2DC\uD2B8", style:"\uC2A4\uD0C0\uC77C", author:"\uD544\uC790", copyright:"Copyright", add:"\uC694\uC18C \uCD94\uAC00", remove:"\uC120\uD0DD \uC694\uC18C\uB97C \uC0AD\uC81C", moveup:"\uC120\uD0DD \uC694\uC18C\uB97C \uC704\uC5D0 \uC774\uB3D9", movedown:"\uC120\uD0DD \uC694\uC18C\uB97C \uC544\uB798\uC5D0 \uC774\uB3D9", head_elements:"Head elements", info:"Information", add_title:"Title element", add_meta:"Meta element", add_script:"Script element", add_style:"Style element", add_link:"Link element", add_base:"Base element", add_comment:"Comment node", title_element:"Title element", script_element:"Script element", style_element:"Style element", base_element:"Base element", link_element:"Link element", meta_element:"Meta element", comment_element:"Comment", src:"Src", language:"Language", href:"Href", target:"Target", type:"Type", charset:"Charset", defer:"Defer", media:"Media", properties:"Properties", name:"Name", value:"Value", content:"Content", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"General", advanced_props:"Advanced" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/ko_dlg.js
ko_dlg.js
tinyMCE.addI18n('es.fullpage_dlg',{ title:"Propiedades del documento", meta_tab:"General", appearance_tab:"Apariencia", advanced_tab:"Avanzado", meta_props:"Informaci\u00F3n Meta", langprops:"Lenguaje y codificaci\u00F3n", meta_title:"T\u00EDtulo", meta_keywords:"Palabras clave", meta_description:"Descripci\u00F3n", meta_robots:"Robots", doctypes:"Tipo de doc.", langcode:"C\u00F3digo del lenguaje", langdir:"Direcci\u00F3n del lenguaje", ltr:"Izquierda a derecha", rtl:"Derecha a izquierda", xml_pi:"Declaraci\u00F3n XML", encoding:"Codificaci\u00F3n de caracteres", appearance_bgprops:"Propiedades del fondo", appearance_marginprops:"M\u00E1rgenes", appearance_linkprops:"Colores del v\u00EDnculo", appearance_textprops:"Propiedades de texto", bgcolor:"Color de fondo", bgimage:"Imagen de fondo", left_margin:"Margen izquierdo", right_margin:"Margen derecho", top_margin:"Margen superior", bottom_margin:"Margen inferior", text_color:"Color del texto", font_size:"Tama\u00F1o de fuente", font_face:"Fuente", link_color:"Color de v\u00EDnculo", hover_color:"Color rat\u00F3n encima", visited_color:"Color visitado", active_color:"Color activo", textcolor:"Color", fontsize:"Tama\u00F1o de fuente", fontface:"Fuente", meta_index_follow:"Indexar y seguir los v\u00EDnculos", meta_index_nofollow:"Indexar y no seguir los v\u00EDnculos", meta_noindex_follow:"No indexar pero seguir v\u00EDnculos", meta_noindex_nofollow:"No indexar y no seguir v\u00EDnculos", appearance_style:"Propiedades de hoja de estilos y estilo", stylesheet:"Hoja de estilo", style:"Estilo", author:"Autor", copyright:"Copyright", add:"Agregar nuevo elemento", remove:"Eliminar elemento seleccionado", moveup:"Mover elemento seleccionado hacia arriba", movedown:"Mover elemento seleccionado hacia abajo", head_elements:"Elemento Head", info:"Informaci\u00F3n", add_title:"Elemento Title", add_meta:"Elemento Meta", add_script:"Elemento Script", add_style:"Elemento Style", add_link:"Elemento Link", add_base:"Elemento Base", add_comment:"Nodo Comment", title_element:"Elemento Title", script_element:"Elemento Script", style_element:"Elemento Style", base_element:"Elemento Base", link_element:"Elemento Link", meta_element:"Elemento Meta", comment_element:"Comentario", src:"Src", language:"Lenguaje", href:"Href", target:"Target", type:"Tipo", charset:"Charset", defer:"Defer", media:"Medio", properties:"Propiedades", name:"Nombre", value:"Valor", content:"Contenido", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"General", advanced_props:"Avanzado" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/es_dlg.js
es_dlg.js
tinyMCE.addI18n('fr.fullpage_dlg',{ title:"Propri\u00E9t\u00E9s du document", meta_tab:"G\u00E9n\u00E9ral", appearance_tab:"Apparence", advanced_tab:"Avanc\u00E9", meta_props:"Informations Meta", langprops:"Langue et encodage", meta_title:"Titre", meta_keywords:"Mots-cl\u00E9s", meta_description:"Description", meta_robots:"Robots", doctypes:"Doctype", langcode:"Code de la langue", langdir:"Sens de lecture", ltr:"De gauche \u00E0 droite", rtl:"De droite \u00E0 gauche", xml_pi:"D\u00E9claration XML", encoding:"Encodage des caract\u00E8res", appearance_bgprops:"Propri\u00E9t\u00E9s du fond", appearance_marginprops:"Marge du corps de la page", appearance_linkprops:"Couleurs des liens", appearance_textprops:"Propri\u00E9t\u00E9s du texte", bgcolor:"Couleur de fond", bgimage:"Image de fond", left_margin:"Marge de gauche", right_margin:"Marge de droite", top_margin:"Marge du haut", bottom_margin:"Marge du bas", text_color:"Couleur du texte", font_size:"Taille de la police", font_face:"Nom de la police", link_color:"Couleur des liens", hover_color:"Couleur au survol", visited_color:"Couleur des liens visit\u00E9s", active_color:"Couleur du lien actif", textcolor:"Couleur", fontsize:"Taille de police", fontface:"Nom de la police", meta_index_follow:"Indexer et suivre les liens", meta_index_nofollow:"Indexer et ne pas suivre les liens", meta_noindex_follow:"Ne pas indexer et suivre les liens", meta_noindex_nofollow:"Ne pas indexer et ne pas suivre les liens", appearance_style:"Propri\u00E9t\u00E9s de la feuille de style et du style", stylesheet:"Feuille de style", style:"Style", author:"Auteur", copyright:"Copyright", add:"Ajouter un nouvel \u00E9l\u00E9ment", remove:"Retirer l'\u00E9l\u00E9ment s\u00E9lectionn\u00E9", moveup:"D\u00E9placer l'\u00E9l\u00E9ment s\u00E9lectionn\u00E9 vers le haut", movedown:"D\u00E9placer l'\u00E9l\u00E9ment s\u00E9lectionn\u00E9 vers le bas", head_elements:"\u00C9l\u00E9ments d'en-t\u00EAte", info:"Information", add_title:"\u00C9l\u00E9ment de titre", add_meta:"\u00C9l\u00E9ment Meta", add_script:"\u00C9l\u00E9ment de script", add_style:"\u00C9l\u00E9ment de style", add_link:"\u00C9l\u00E9ment de lien", add_base:"\u00C9l\u00E9ment de base", add_comment:"Commentaire", title_element:"\u00C9l\u00E9ment de titre", script_element:"\u00C9l\u00E9ment de script", style_element:"\u00C9l\u00E9ment de style", base_element:"\u00C9l\u00E9ment de base", link_element:"\u00C9l\u00E9ment de lien", meta_element:"\u00C9l\u00E9ment Meta", comment_element:"Commentaire", src:"Source", language:"Langue", href:"Href", target:"Cible", type:"Type", charset:"Charset", defer:"D\u00E9f\u00E9rer", media:"M\u00E9dia", properties:"Propri\u00E9t\u00E9s", name:"Nom", value:"Valeur", content:"Contenu", rel:"Rel", rev:"Rev", hreflang:"langue Href", general_props:"G\u00E9n\u00E9ral", advanced_props:"Avanc\u00E9" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/fr_dlg.js
fr_dlg.js
tinyMCE.addI18n('de.fullpage_dlg',{ title:"Dokument-Eigenschaften", meta_tab:"Allgemein", appearance_tab:"Aussehen", advanced_tab:"Erweitert", meta_props:"Meta-Information", langprops:"Sprache und Codierung", meta_title:"Titel", meta_keywords:"Keywords", meta_description:"Beschreibung", meta_robots:"Robots", doctypes:"DocType", langcode:"Sprachcode", langdir:"Sprachrichtung", ltr:"Links nach Rechts", rtl:"Rechts nach Links", xml_pi:"XML Deklaration", encoding:"Zeichencodierung", appearance_bgprops:"Hintergrund-Eigenschaften", appearance_marginprops:"Abst\u00E4nde des Body", appearance_linkprops:"Linkfarben", appearance_textprops:"Text-Eigenschaften", bgcolor:"Hintergrundfarbe", bgimage:"Hintergrundbild", left_margin:"Linker Abstand", right_margin:"Rechter Abstand", top_margin:"Oberer Abstand", bottom_margin:"Unterer Abstand", text_color:"Textfarbe", font_size:"Schriftgr\u00F6\u00DFe", font_face:"Schriftart", link_color:"Linkfarbe", hover_color:"Hover-Farbe", visited_color:"Visited-Farbe", active_color:"Active-Farbe", textcolor:"Farbe", fontsize:"Schriftgr\u00F6\u00DFe", fontface:"Schriftart", meta_index_follow:"Indizieren und den Links folgen", meta_index_nofollow:"Indizieren, aber den Links nicht folgen", meta_noindex_follow:"Nicht indizieren, aber den Links folgen", meta_noindex_nofollow:"Nicht indizieren und auch nicht den Links folgen", appearance_style:"CSS-Stylesheet und Stileigenschaften", stylesheet:"CSS-Stylesheet", style:"CSS-Stil", author:"Autor", copyright:"Copyright", add:"Neues Element hinzuf\u00FCgen", remove:"Ausgew\u00E4hltes Element entfernen", moveup:"Ausgew\u00E4hltes Element nach oben bewegen", movedown:"Ausgew\u00E4hltes Element nach unten bewegen", head_elements:"\u00DCberschriftenelemente", info:"Information", add_title:"Titel-Element", add_meta:"Meta-Element", add_script:"Script-Element", add_style:"Style-Element", add_link:"Link-Element", add_base:"Base-Element", add_comment:"HTML-Kommentar", title_element:"Titel-Element", script_element:"Script-Element", style_element:"Style-Element", base_element:"Base-Element", link_element:"Link-Element", meta_element:"Meta_Element", comment_element:"Kommentar", src:"Src", language:"Sprache", href:"Href", target:"Ziel", type:"Typ", charset:"Zeichensatz", defer:"Defer", media:"Media", properties:"Eigenschaften", name:"Name", value:"Wert", content:"Inhalt", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"Allgemein", advanced_props:"Erweitert" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/de_dlg.js
de_dlg.js
tinyMCE.addI18n('ia.fullpage_dlg',{ title:"\u6863\u6848\u5C5E\u6027", meta_tab:"\u57FA\u672C", appearance_tab:"\u5916\u89C2", advanced_tab:"\u9AD8\u7EA7", meta_props:"\u4E2D\u7EE7\u6570\u636E\u5377\u6807\u5C5E\u6027", langprops:"\u8BED\u8A00", meta_title:"\u6807\u9898", meta_keywords:"\u5173\u952E\u8BCD", meta_description:"\u5185\u5BB9\u8BF4\u660E", meta_robots:"\u673A\u5668\u4EBA", doctypes:"DocType", langcode:"\u8BED\u8A00\u7F16\u7801", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", ltr:"\u4ECE\u5DE6\u5230\u53F3", rtl:"\u4ECE\u53F3\u5230\u5DE6", xml_pi:"XML \u58F0\u660E", encoding:"\u5B57\u7B26\u7F16\u7801", appearance_bgprops:"\u80CC\u666F\u5C5E\u6027", appearance_marginprops:"\u8FB9\u8DDD", appearance_linkprops:"\u8FDE\u7ED3\u989C\u8272", appearance_textprops:"\u6587\u5B57\u5C5E\u6027", bgcolor:"\u80CC\u666F\u989C\u8272", bgimage:"\u80CC\u666F\u56FE\u7247", left_margin:"\u5DE6\u8FB9\u8DDD", right_margin:"\u53F3\u8FB9\u8DDD", top_margin:"\u4E0A\u8FB9\u8DDD", bottom_margin:"\u4E0B\u8FB9\u8DDD", text_color:"\u6587\u5B57\u989C\u8272", font_size:"\u6587\u5B57\u5927\u5C0F", font_face:"\u5B57\u4F53", link_color:"\u8FDE\u7ED3\u989C\u8272", hover_color:"Hover \u989C\u8272", visited_color:"Visited \u989C\u8272", active_color:"Active \u989C\u8272", textcolor:"\u989C\u8272", fontsize:"\u6587\u5B57\u5927\u5C0F", fontface:"\u5B57\u4F53", meta_index_follow:"Index and follow the links", meta_index_nofollow:"Index and don't follow the links", meta_noindex_follow:"Do not index but follow the links", meta_noindex_nofollow:"Do not index and don\'t follow the links", appearance_style:"\u6837\u5F0F\u8868\u5C5E\u6027", stylesheet:"\u6837\u5F0F\u8868", style:"\u6837\u5F0F", author:"\u4F5C\u8005", copyright:"\u7248\u6743", add:"\u6DFB\u52A0\u65B0\u5BF9\u8C61", remove:"\u5220\u9664\u9009\u62E9\u7684\u5BF9\u8C61", moveup:"\u5411\u4E0A\u79FB\u52A8\u9009\u62E9\u7684\u5BF9\u8C61", movedown:"\u5411\u4E0B\u79FB\u52A8\u9009\u62E9\u7684\u5BF9\u8C61", head_elements:"\u5934\u5BF9\u8C61", info:"\u4FE1\u606F", add_title:"\u67E5\u627E\u5BF9\u8C61", add_meta:"\u5143\u5BF9\u8C61", add_script:"\u811A\u672C\u5BF9\u8C61", add_style:"\u6837\u5F0F\u5BF9\u8C61", add_link:"\u8FDE\u7ED3\u5316\u5BF9\u8C61", add_base:"Base\u5BF9\u8C61", add_comment:"\u6CE8\u91CA\u5BF9\u8C61", title_element:"\u67E5\u627E\u5BF9\u8C61", script_element:"\u811A\u672C\u5BF9\u8C61", style_element:"\u6837\u5F0F\u5BF9\u8C61", base_element:"Base\u5BF9\u8C61", link_element:"\u8FDE\u7ED3\u5316\u5BF9\u8C61", meta_element:"\u5143\u5BF9\u8C61", comment_element:"\u6CE8\u91CA\u5BF9\u8C61", src:"Src", language:"\u8BED\u8A00", href:"Href", target:"\u76EE\u6807", type:"\u7C7B\u578B", charset:"\u5B57\u7B26\u96C6", defer:"Defer", media:"\u5A92\u4F53", properties:"\u5C5E\u6027", name:"\u540D", value:"\u503C", content:"\u5185\u5BB9", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"\u57FA\u672C", advanced_props:"\u9AD8\u7EA7" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/ia_dlg.js
ia_dlg.js
tinyMCE.addI18n('zh.fullpage_dlg',{ title:"\u5C6C\u6027", meta_tab:"\u4E00\u822C", appearance_tab:"\u5916\u89C0", advanced_tab:"\u9AD8\u7D1A", meta_props:"\u6A19\u7C64( Meta )\u4FE1\u606F", langprops:"\u8A9E\u8A00\u8207\u7DE8\u78BC", meta_title:"\u6A19\u984C", meta_keywords:"\u95DC\u9375\u8A5E", meta_description:"\u5167\u5BB9\u8AAA\u660E", meta_robots:"Robots", doctypes:"Doctype", langcode:"\u8A9E\u8A00\u7DE8\u78BC", langdir:"\u66F8\u5BEB\u65B9\u5411", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", xml_pi:"XML\u5BA3\u544A", encoding:"\u5B57\u7B26\u7DE8\u78BC", appearance_bgprops:"\u80CC\u666F\u5C6C\u6027", appearance_marginprops:"\u9801\u9762\u908A\u754C", appearance_linkprops:"\u9023\u7D50\u984F\u8272", appearance_textprops:"\u6587\u672C\u5C6C\u6027", bgcolor:"\u80CC\u666F\u984F\u8272", bgimage:"\u80CC\u666F\u5716\u7247", left_margin:"\u5DE6\u908A\u754C", right_margin:"\u53F3\u908A\u754C", top_margin:"\u4E0A\u908A\u754C", bottom_margin:"\u4E0B\u908A\u754C", text_color:"\u6587\u5B57\u984F\u8272", font_size:"\u5B57\u9AD4\u5927\u5C0F", font_face:"\u5B57\u9AD4", link_color:"\u9023\u7D50\u984F\u8272", hover_color:"\u8B8A\u63DB\u984F\u8272", visited_color:"\u67E5\u95B1\u904E\u984F\u8272", active_color:"\u4F5C\u7528\u4E2D\u984F\u8272", textcolor:"\u984F\u8272", fontsize:"\u5B57\u9AD4\u5927\u5C0F", fontface:"\u5B57\u578B\u9AD4\u7CFB", meta_index_follow:"Index and follow the links", meta_index_nofollow:"Index and don't follow the links", meta_noindex_follow:"Do not index but follow the links", meta_noindex_nofollow:"Do not index and don\'t follow the links", appearance_style:"\u6A23\u5F0F\u8868\u55AE\u53CA\u6A23\u5F0F\u5C6C\u6027", stylesheet:"\u6A23\u5F0F\u8868\u55AE", style:"\u6A23\u5F0F", author:"\u4F5C\u8005", copyright:"\u7248\u6B0A", add:"\u6DFB\u52A0\u65B0\u5143\u7D20", remove:"\u79FB\u9664\u9078\u5B9A\u5143\u7D20", moveup:"\u4E0A\u79FB\u9078\u5B9A\u5143\u7D20", movedown:"\u4E0B\u79FB\u9078\u5B9A\u5143\u7D20", head_elements:"Head\u5143\u7D20", info:"\u4FE1\u606F", add_title:"\u5C0B\u627E\u5143\u7D20", add_meta:"Meta\u5143\u7D20", add_script:"Script\u5143\u7D20", add_style:"Style\u5143\u7D20", add_link:"Link\u5143\u7D20", add_base:"Base\u5143\u7D20", add_comment:"Comment node", title_element:"\u5C0B\u627E\u5143\u7D20", script_element:"Script element", style_element:"Style element", base_element:"Base element", link_element:"Link element", meta_element:"Meta element", comment_element:"Comment", src:"Src", language:"\u8A9E\u8A00", href:"Href", target:"\u76EE\u6A19", type:"\u985E\u578B", charset:"\u5B57\u7B26\u96C6", defer:"\u5EF6\u7DE9", media:"\u5A92\u9AD4", properties:"\u5C6C\u6027", name:"\u540D\u7A31", value:"\u503C", content:"\u5167\u5BB9", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"\u4E00\u822C", advanced_props:"\u9AD8\u7D1A" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/zh_dlg.js
zh_dlg.js
tinyMCE.addI18n('en.fullpage_dlg',{ title:"Document properties", meta_tab:"General", appearance_tab:"Appearance", advanced_tab:"Advanced", meta_props:"Meta information", langprops:"Language and encoding", meta_title:"Title", meta_keywords:"Keywords", meta_description:"Description", meta_robots:"Robots", doctypes:"Doctype", langcode:"Language code", langdir:"Language direction", ltr:"Left to right", rtl:"Right to left", xml_pi:"XML declaration", encoding:"Character encoding", appearance_bgprops:"Background properties", appearance_marginprops:"Body margins", appearance_linkprops:"Link colors", appearance_textprops:"Text properties", bgcolor:"Background color", bgimage:"Background image", left_margin:"Left margin", right_margin:"Right margin", top_margin:"Top margin", bottom_margin:"Bottom margin", text_color:"Text color", font_size:"Font size", font_face:"Font face", link_color:"Link color", hover_color:"Hover color", visited_color:"Visited color", active_color:"Active color", textcolor:"Color", fontsize:"Font size", fontface:"Font family", meta_index_follow:"Index and follow the links", meta_index_nofollow:"Index and don't follow the links", meta_noindex_follow:"Do not index but follow the links", meta_noindex_nofollow:"Do not index and don\'t follow the links", appearance_style:"Stylesheet and style properties", stylesheet:"Stylesheet", style:"Style", author:"Author", copyright:"Copyright", add:"Add new element", remove:"Remove selected element", moveup:"Move selected element up", movedown:"Move selected element down", head_elements:"Head elements", info:"Information", add_title:"Title element", add_meta:"Meta element", add_script:"Script element", add_style:"Style element", add_link:"Link element", add_base:"Base element", add_comment:"Comment node", title_element:"Title element", script_element:"Script element", style_element:"Style element", base_element:"Base element", link_element:"Link element", meta_element:"Meta element", comment_element:"Comment", src:"Src", language:"Language", href:"Href", target:"Target", type:"Type", charset:"Charset", defer:"Defer", media:"Media", properties:"Properties", name:"Name", value:"Value", content:"Content", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"General", advanced_props:"Advanced" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/en_dlg.js
en_dlg.js
tinyMCE.addI18n('ca.fullpage_dlg',{ title:"Propietats del document", meta_tab:"General", appearance_tab:"Aparen\u00E7a", advanced_tab:"Avan\u00E7at", meta_props:"Metainformaci\u00F3", langprops:"Idioma i codificaci\u00F3", meta_title:"T\u00EDtol", meta_keywords:"Paraules clau", meta_description:"Descripci\u00F3", meta_robots:"Robots", doctypes:"Doctype", langcode:"Codi d\'idioma", langdir:"Direcci\u00F3 de l\'idioma", ltr:"D\'esquerra a dreta", rtl:"De dreta a esquerra", xml_pi:"Declaraci\u00F3 XML", encoding:"Codificaci\u00F3 dels car\u00E0cters", appearance_bgprops:"Propietats del fons", appearance_marginprops:"Marges del cos", appearance_linkprops:"Colors d\'enlla\u00E7", appearance_textprops:"Propietats del text", bgcolor:"Color del fons", bgimage:"Imatge del fons", left_margin:"Marge esquerre", right_margin:"Marge dret", top_margin:"Marge superior", bottom_margin:"Marge inferior", text_color:"Color del text", font_size:"Mida de la font", font_face:"Font", link_color:"Color d\'enlla\u00E7", hover_color:"Color quan es passi per sobre", visited_color:"Color quan ja \u00E9s visitat", active_color:"Color quan \u00E9s actiu", textcolor:"Color", fontsize:"Mida de la font", fontface:"Fam\u00EDlia de la font", meta_index_follow:"Indexa i segueix els enlla\u00E7os", meta_index_nofollow:"Indexa i no segueixis els enlla\u00E7os", meta_noindex_follow:"No indexis per\u00F2 segueix els enlla\u00E7os", meta_noindex_nofollow:"No indexis i no segueixis els enlla\u00E7os", appearance_style:"Full d\'estils i propietats dels estils", stylesheet:"Full d\'estils", style:"Estil", author:"Autor", copyright:"Copyright", add:"Afegeix un nou element", remove:"Elimina l\'element seleccionat", moveup:"Mou amunt l\'element seleccionat", movedown:"Mou avall l\'element seleccionat", head_elements:"Elements d\'encap\u00E7alament", info:"Informaci\u00F3", add_title:"Element t\u00EDtol", add_meta:"Element meta", add_script:"Element script", add_style:"Element estil", add_link:"Element enlla\u00E7", add_base:"Element base", add_comment:"Node comentari", title_element:"Element t\u00EDtol", script_element:"Element script", style_element:"Element estil", base_element:"Element base", link_element:"Element enlla\u00E7", meta_element:"Element meta", comment_element:"Comentari", src:"Src", language:"Idioma", href:"Href", target:"Dest\u00ED", type:"Type", charset:"Charset", defer:"Defer", media:"Media", properties:"Propietats", name:"Nom", value:"Valor", content:"Contingut", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"General", advanced_props:"Avan\u00E7at" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/ca_dlg.js
ca_dlg.js
tinyMCE.addI18n('ru.fullpage_dlg',{ title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", meta_tab:"\u041E\u0431\u0449\u0435\u0435", appearance_tab:"\u0412\u0438\u0434", advanced_tab:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E", meta_props:"\u0426\u0435\u043B\u044C \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438", langprops:"\u042F\u0437\u044B\u043A \u0438 \u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F", meta_title:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", meta_keywords:"\u041A\u043B\u044E\u0447\u0435\u0432\u044B\u0435 \u0441\u043B\u043E\u0432\u0430", meta_description:"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435", meta_robots:"\u0420\u0430\u0431\u043E\u0442\u044B", doctypes:"Doctype", langcode:"\u041A\u043E\u0434 \u044F\u0437\u044B\u043A\u0430", langdir:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u044F\u0437\u044B\u043A\u0430", ltr:"\u0421\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043E", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u043E", xml_pi:"XML declaration", encoding:"\u041A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430", appearance_bgprops:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0444\u043E\u043D\u0430", appearance_marginprops:"\u041E\u0442\u0441\u0442\u0443\u043F\u044B", appearance_linkprops:"\u0426\u0432\u0435\u0442 \u0441\u0441\u044B\u043B\u043E\u043A", appearance_textprops:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0442\u0435\u043A\u0441\u0442\u0430", bgcolor:"\u0426\u0432\u0435\u0442 \u0444\u043E\u043D\u0430", bgimage:"\u0424\u043E\u043D\u043E\u0432\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", left_margin:"\u041E\u0442\u0441\u0442\u0443\u043F \u0441\u043B\u0435\u0432\u0430", right_margin:"\u041E\u0442\u0441\u0442\u0443\u043F \u0441\u043F\u0440\u0430\u0432\u0430", top_margin:"\u041E\u0442\u0441\u0442\u0443\u043F \u0441\u0432\u0435\u0440\u0445\u0443", bottom_margin:"\u041E\u0442\u0441\u0442\u0443\u043F \u0441\u043D\u0438\u0437\u0443", text_color:"\u0426\u0432\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430", font_size:"\u0420\u0430\u0437\u043C\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430", font_face:"\u0428\u0440\u0438\u0444\u0442", link_color:"\u0426\u0432\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0438", hover_color:"\u0426\u0432\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0438 \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438", visited_color:"\u0426\u0432\u0435\u0442 \u043D\u0430\u0436\u0430\u0442\u043E\u0439 \u0441\u0441\u044B\u043B\u043A\u0438", active_color:"\u0426\u0432\u0435\u0442 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0439 \u0441\u0441\u044B\u043B\u043A\u0438", textcolor:"\u0426\u0432\u0435\u0442", fontsize:"\u0420\u0430\u0437\u043C\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430", fontface:"\u0421\u0435\u043C\u0435\u0439\u0441\u0442\u0432\u043E \u0448\u0440\u0438\u0444\u0442\u0430", meta_index_follow:"Index and follow the links", meta_index_nofollow:"Index and don't follow the links", meta_noindex_follow:"Do not index but follow the links", meta_noindex_nofollow:"Do not index and don \ 't follow the links", appearance_style:"Stylesheet and style properties", stylesheet:"Stylesheet", style:"\u0421\u0442\u0438\u043B\u044C", author:"\u0410\u0432\u0442\u043E\u0440", copyright:"\u041A\u043E\u043F\u0438\u0440\u0430\u0439\u0442", add:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442", remove:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442", moveup:"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u0432\u0435\u0440\u0445", movedown:"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0432\u043D\u0438\u0437", head_elements:"Head elements", info:"\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F", add_title:"Title element", add_meta:"Meta element", add_script:"Script element", add_style:"Style element", add_link:"Link element", add_base:"Base element", add_comment:"Comment node", title_element:"Title element", script_element:"Script element", style_element:"Style element", base_element:"Base element", link_element:"Link element", meta_element:"Meta \u044D\u043B\u0435\u043C\u0435\u043D\u0442", comment_element:"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439", src:"Src", language:"\u042F\u0437\u044B\u043A", href:"Href", target:"Target", type:"Type", charset:"Charset", defer:"Defer", media:"Media", properties:"Properties", name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435", value:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435", content:"\u0421\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"\u041E\u0431\u0449\u0435\u0435", advanced_props:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/ru_dlg.js
ru_dlg.js
tinyMCE.addI18n('ja.fullpage_dlg',{ title:"\u30DA\u30FC\u30B8\u8A2D\u5B9A", meta_tab:"\u4E00\u822C", appearance_tab:"\u8868\u793A", advanced_tab:"\u4E0A\u7D1A\u8005\u5411\u3051", meta_props:"\u30E1\u30BF\u60C5\u5831", langprops:"\u8A00\u8A9E\u3068\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0", meta_title:"\u30BF\u30A4\u30C8\u30EB", meta_keywords:"\u30AD\u30FC\u30EF\u30FC\u30C9", meta_description:"\u8AAC\u660E", meta_robots:"\u691C\u7D22\u30ED\u30DC\u30C3\u30C8\u5236\u5FA1", doctypes:"DOCTYPE", langcode:"\u8A00\u8A9E\u30B3\u30FC\u30C9", langdir:"\u6587\u7AE0\u306E\u65B9\u5411", ltr:"\u5DE6\u304B\u3089\u53F3", rtl:"\u53F3\u304B\u3089\u5DE6", xml_pi:"XML\u5BA3\u8A00", encoding:"\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0", appearance_bgprops:"\u80CC\u666F\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", appearance_marginprops:"\u4F59\u767D", appearance_linkprops:"\u30EA\u30F3\u30AF\u8272", appearance_textprops:"\u6587\u5B57\u3082\u30D7\u30ED\u30D1\u30C6\u30A3", bgcolor:"\u80CC\u666F\u8272", bgimage:"\u80CC\u666F\u753B\u50CF", left_margin:"\u5DE6\u4F59\u767D", right_margin:"\u53F3\u4F59\u767D", top_margin:"\u4E0A\u4F59\u767D", bottom_margin:"\u4E0B\u4F59\u767D", text_color:"\u6587\u5B57\u8272", font_size:"\u6587\u5B57\u30B5\u30A4\u30BA", font_face:"\u30D5\u30A9\u30F3\u30C8", link_color:"\u30EA\u30F3\u30AF\u8272", hover_color:"\u30EA\u30F3\u30AF\u8272(hover)", visited_color:"\u30EA\u30F3\u30AF\u8272(visited)", active_color:"\u30EA\u30F3\u30AF\u8272(active)", textcolor:"\u8272", fontsize:"\u6587\u5B57\u30B5\u30A4\u30BA", fontface:"\u30D5\u30A9\u30F3\u30C8", meta_index_follow:"\u3053\u306E\u30DA\u30FC\u30B8\u3068\u30EA\u30F3\u30AF\u5148\u306E\u5DE1\u56DE\u3092\u8A31\u53EF", meta_index_nofollow:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u5DE1\u56DE\u3092\u8A31\u53EF\u3001\u30EA\u30F3\u30AF\u5148\u306E\u5DE1\u56DE\u3092\u7981\u6B62", meta_noindex_follow:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u5DE1\u56DE\u3092\u7981\u6B62\u3001\u30EA\u30F3\u30AF\u5148\u306E\u5DE1\u56DE\u3092\u8A31\u53EF", meta_noindex_nofollow:"\u3053\u306E\u30DA\u30FC\u30B8\u3068\u30EA\u30F3\u30AF\u5148\u306E\u5DE1\u56DE\u3092\u7981\u6B62", appearance_style:"\u30B9\u30BF\u30A4\u30EB\u8A2D\u5B9A", stylesheet:"\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8", style:"\u30B9\u30BF\u30A4\u30EB", author:"\u4F5C\u8005", copyright:"\u30B3\u30D4\u30FC\u30E9\u30A4\u30C8", add:"\u30A8\u30EC\u30E1\u30F3\u30C8\u8FFD\u52A0", remove:"\u9078\u629E\u8981\u7D20\u306E\u524A\u9664", moveup:"\u9078\u629E\u8981\u7D20\u3092\u4E0A\u3078\u79FB\u52D5", movedown:"\u9078\u629E\u8981\u7D20\u3092\u4E0B\u3078\u79FB\u52D5", head_elements:"Head\u8981\u7D20", info:"\u30A4\u30F3\u30D5\u30A9\u30E1\u30FC\u30B7\u30E7\u30F3", add_title:"Title\u8981\u7D20", add_meta:"Meta\u8981\u7D20", add_script:"Script\u8981\u7D20", add_style:"Style\u8981\u7D20", add_link:"Link\u8981\u7D20", add_base:"Base\u8981\u7D20", add_comment:"Comment\u30CE\u30FC\u30C9", title_element:"Title\u8981\u7D20", script_element:"Script\u8981\u7D20", style_element:"Style\u8981\u7D20", base_element:"Base\u8981\u7D20", link_element:"Link\u8981\u7D20", meta_element:"Meta\u8981\u7D20", comment_element:"Comment", src:"src", language:"Language", href:"Href", target:"Target", type:"Type", charset:"Charset", defer:"Defer", media:"Media", properties:"Properties", name:"Name", value:"Value", content:"Content", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"\u4E00\u822C", advanced_props:"\u4E0A\u7D1A\u8005\u5411\u3051" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/ja_dlg.js
ja_dlg.js
tinyMCE.addI18n('it.fullpage_dlg',{ title:"Propriet\u00E0 Documento", meta_tab:"Generale", appearance_tab:"Aspetto", advanced_tab:"Avanzate", meta_props:"Informazioni Metatag", langprops:"Lingua e codifica", meta_title:"Titolo", meta_keywords:"Parole chiave", meta_description:"Descrizione", meta_robots:"Robots", doctypes:"Doctype", langcode:"Codice lingua", langdir:"Direzione testo", ltr:"Sinistra verso destra", rtl:"Destra verso sinistra", xml_pi:"Dichiarazione XML", encoding:"Codifica carattere", appearance_bgprops:"Propriet\u00E0 sfondo", appearance_marginprops:"Margini body", appearance_linkprops:"Colori collegamenti", appearance_textprops:"Propriet\u00E0 testo", bgcolor:"Colore sfondo", bgimage:"Immagine sfondo", left_margin:"Margine sinistro", right_margin:"Margine destro", top_margin:"Margine superiore", bottom_margin:"Margine inferiore", text_color:"Colore testo", font_size:"Dimensione carattere", font_face:"Tipo carattere", link_color:"Colore collegamento", hover_color:"Colore \'Hover\'", visited_color:"Colore \'Visited\'", active_color:"Colore \'Active\'", textcolor:"Colore", fontsize:"Dimensione carattere", fontface:"Famiglia carattere", meta_index_follow:"Indicizzare e seguire collegamenti", meta_index_nofollow:"Indicizzare e non segure collegamenti", meta_noindex_follow:"Non indicizzare ma seguire collegamenti", meta_noindex_nofollow:"Non indicizzare e non seguire collegamenti", appearance_style:"Propriet\u00E0 stili e fogli di stile", stylesheet:"Fogli di stile", style:"Stile", author:"Autore", copyright:"Copyright", add:"Aggiungi nuovo elemento", remove:"Rimuovi elemento selezionato", moveup:"Sposta elemento selezionato in alto", movedown:"Sposta elemento selezionato in basso", head_elements:"Elementi Head", info:"Informazioni", add_title:"Elemento Titolo", add_meta:"Elemento Meta", add_script:"Elemento Script", add_style:"Elemento Style", add_link:"Elemento Link", add_base:"Elemento Base", add_comment:"Nodo Commento", title_element:"Elemento Titolo", script_element:"Elemento Script", style_element:"Elemento Style", base_element:"Elemento Base", link_element:"Elemento Link", meta_element:"Elemento Meta", comment_element:"Commento", src:"Sorgente", language:"Linguaggio", href:"Href", target:"Target", type:"Tipo", charset:"Set caratteri", defer:"Defer", media:"Media", properties:"Propriet\u00E0", name:"Nome", value:"Valore", content:"Contenuto", rel:"Rel", rev:"Rev", hreflang:"Href lang", general_props:"Generale", advanced_props:"Avanzate" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/langs/it_dlg.js
it_dlg.js
tinyMCEPopup.requireLangPack(); var doc; var defaultDocTypes = 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' + 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' + 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' + 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' + 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' + 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' + 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'; var defaultEncodings = 'Western european (iso-8859-1)=iso-8859-1,' + 'Central European (iso-8859-2)=iso-8859-2,' + 'Unicode (UTF-8)=utf-8,' + 'Chinese traditional (Big5)=big5,' + 'Cyrillic (iso-8859-5)=iso-8859-5,' + 'Japanese (iso-2022-jp)=iso-2022-jp,' + 'Greek (iso-8859-7)=iso-8859-7,' + 'Korean (iso-2022-kr)=iso-2022-kr,' + 'ASCII (us-ascii)=us-ascii'; var defaultMediaTypes = 'all=all,' + 'screen=screen,' + 'print=print,' + 'tty=tty,' + 'tv=tv,' + 'projection=projection,' + 'handheld=handheld,' + 'braille=braille,' + 'aural=aural'; var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; function init() { var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; // Setup doctype select box doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); for (i=0; i<doctypes.length; i++) { p = doctypes[i].split('='); if (p.length > 1) addSelectValue(f, 'doctypes', p[0], p[1]); } // Setup fonts select box fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); for (i=0; i<fonts.length; i++) { p = fonts[i].split('='); if (p.length > 1) addSelectValue(f, 'fontface', p[0], p[1]); } // Setup fontsize select box fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); for (i=0; i<fonts.length; i++) addSelectValue(f, 'fontsize', fonts[i], fonts[i]); // Setup mediatype select boxs mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(','); for (i=0; i<mediaTypes.length; i++) { p = mediaTypes[i].split('='); if (p.length > 1) { addSelectValue(f, 'element_style_media', p[0], p[1]); addSelectValue(f, 'element_link_media', p[0], p[1]); } } // Setup encodings select box encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); for (i=0; i<encodings.length; i++) { p = encodings[i].split('='); if (p.length > 1) { addSelectValue(f, 'docencoding', p[0], p[1]); addSelectValue(f, 'element_script_charset', p[0], p[1]); addSelectValue(f, 'element_link_charset', p[0], p[1]); } } document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); // Resize some elements if (isVisible('stylesheetbrowser')) document.getElementById('stylesheet').style.width = '220px'; if (isVisible('link_href_browser')) document.getElementById('element_link_href').style.width = '230px'; if (isVisible('bgimage_browser')) document.getElementById('bgimage').style.width = '210px'; // Add iframe dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); doc = dom.get('documentIframe').contentWindow.document; h = tinyMCEPopup.getWindowArg('head_html'); // Preprocess the HTML disable scripts and urls h = h.replace(/<script>/gi, '<script type="text/javascript">'); h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-'); h = h.replace(/(src=|href=)/g, 'mce_$1'); // Write in the content in the iframe doc.write(h + '</body></html>'); doc.close(); // Parse xml and doctype xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1); xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1); docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' '); f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1); // Parse title if (e = doc.getElementsByTagName('title')[0]) el.metatitle.value = e.textContent || e.text; // Parse meta tinymce.each(doc.getElementsByTagName('meta'), function(n) { var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || ''; e = el['meta' + na]; if (na == 'robots') { selectByValue(f, 'metarobots', tinymce.trim(va), true, true); return; } switch (eq.toLowerCase()) { case "content-type": tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1); // Override XML encoding if (tmp != "") xmlEnc = tmp; return; } if (e) e.value = va; }); selectByValue(f, 'doctypes', docType, true, true); selectByValue(f, 'docencoding', xmlEnc, true, true); selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true); if (xmlVer != '') el.xml_pi.checked = true; // Parse appearance // Parse primary stylesheet tinymce.each(doc.getElementsByTagName("link"), function(l) { var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || ''; if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") { f.stylesheet.value = l.getAttribute('mce_href', 2) || ''; return false; } }); // Get from style elements tinymce.each(doc.getElementsByTagName("style"), function(st) { var tmp = parseStyleElement(st); for (x=0; x<tmp.length; x++) { if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color']) f.visited_color.value = tmp[x].data['color']; if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color']) f.link_color.value = tmp[x].data['color']; if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color']) f.active_color.value = tmp[x].data['color']; } }); f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text"); f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink"); f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link"); f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink"); f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor"); f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background"); // Get from style info style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style')); if (style['font-family']) selectByValue(f, 'fontface', style['font-family'], true, true); else selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true); if (style['font-size']) selectByValue(f, 'fontsize', style['font-size'], true, true); else selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true); if (style['color']) f.textcolor.value = convertRGBToHex(style['color']); if (style['background-image']) f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); if (style['background-color']) f.bgcolor.value = style['background-color']; if (style['margin']) { tmp = style['margin'].replace(/[^0-9 ]/g, ''); tmp = tmp.split(/ +/); f.topmargin.value = tmp.length > 0 ? tmp[0] : ''; f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0]; f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0]; f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0]; } if (style['margin-left']) f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, ''); if (style['margin-right']) f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, ''); if (style['margin-top']) f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, ''); if (style['margin-bottom']) f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, ''); f.style.value = tinyMCEPopup.dom.serializeStyle(style); // Update colors updateColor('textcolor_pick', 'textcolor'); updateColor('bgcolor_pick', 'bgcolor'); updateColor('visited_color_pick', 'visited_color'); updateColor('active_color_pick', 'active_color'); updateColor('link_color_pick', 'link_color'); } function getReItem(r, s, i) { var c = r.exec(s); if (c && c.length > i) return c[i]; return ''; } function updateAction() { var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser; head = doc.getElementsByTagName('head')[0]; // Fix scripts without a type nl = doc.getElementsByTagName('script'); for (i=0; i<nl.length; i++) { if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '') nl[i].setAttribute('mce_type', 'text/javascript'); } // Get primary stylesheet nl = doc.getElementsByTagName("link"); for (i=0; i<nl.length; i++) { l = nl[i]; tmp = tinyMCEPopup.dom.getAttrib(l, 'media'); if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") { addlink = false; if (f.stylesheet.value == '') l.parentNode.removeChild(l); else l.setAttribute('mce_href', f.stylesheet.value); break; } } // Add new link if (f.stylesheet.value != '') { l = doc.createElement('link'); l.setAttribute('type', 'text/css'); l.setAttribute('mce_href', f.stylesheet.value); l.setAttribute('rel', 'stylesheet'); head.appendChild(l); } setMeta(head, 'keywords', f.metakeywords.value); setMeta(head, 'description', f.metadescription.value); setMeta(head, 'author', f.metaauthor.value); setMeta(head, 'copyright', f.metacopyright.value); setMeta(head, 'robots', getSelectValue(f, 'metarobots')); setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding')); doc.body.dir = getSelectValue(f, 'langdir'); doc.body.style.cssText = f.style.value; doc.body.setAttribute('vLink', f.visited_color.value); doc.body.setAttribute('link', f.link_color.value); doc.body.setAttribute('text', f.textcolor.value); doc.body.setAttribute('aLink', f.active_color.value); doc.body.style.fontFamily = getSelectValue(f, 'fontface'); doc.body.style.fontSize = getSelectValue(f, 'fontsize'); doc.body.style.backgroundColor = f.bgcolor.value; if (f.leftmargin.value != '') doc.body.style.marginLeft = f.leftmargin.value + 'px'; if (f.rightmargin.value != '') doc.body.style.marginRight = f.rightmargin.value + 'px'; if (f.bottommargin.value != '') doc.body.style.marginBottom = f.bottommargin.value + 'px'; if (f.topmargin.value != '') doc.body.style.marginTop = f.topmargin.value + 'px'; html = doc.getElementsByTagName('html')[0]; html.setAttribute('lang', f.langcode.value); html.setAttribute('xml:lang', f.langcode.value); if (f.bgimage.value != '') doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')"; else doc.body.style.backgroundImage = ''; ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer(); ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head'); h = ser.serialize(doc.documentElement); h = h.substring(0, h.lastIndexOf('</body>')); if (h.indexOf('<title>') == -1) h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>'); else h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>'); if ((v = getSelectValue(f, 'doctypes')) != '') h = v + '\n' + h; if (f.xml_pi.checked) { s = '<?xml version="1.0"'; if ((v = getSelectValue(f, 'docencoding')) != '') s += ' encoding="' + v + '"'; s += '?>\n'; h = s + h; } h = h.replace(/type=\"\-mce\-/gi, 'type="'); tinyMCEPopup.editor.plugins.fullpage.head = h; tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {}); tinyMCEPopup.close(); } function changedStyleField(field) { } function setMeta(he, k, v) { var nl, i, m; nl = he.getElementsByTagName('meta'); for (i=0; i<nl.length; i++) { if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) { if (v == '') nl[i].parentNode.removeChild(nl[i]); else nl[i].setAttribute('content', "text/html; charset=" + v); return; } if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) { if (v == '') nl[i].parentNode.removeChild(nl[i]); else nl[i].setAttribute('content', v); return; } } if (v == '') return; m = doc.createElement('meta'); if (k == 'Content-Type') m.httpEquiv = k; else m.setAttribute('name', k); m.setAttribute('content', v); he.appendChild(m); } function parseStyleElement(e) { var v = e.innerHTML; var p, i, r; v = v.replace(/<!--/gi, ''); v = v.replace(/-->/gi, ''); v = v.replace(/[\n\r]/gi, ''); v = v.replace(/\s+/gi, ' '); r = []; p = v.split(/{|}/); for (i=0; i<p.length; i+=2) { if (p[i] != "") r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])}; } return r; } function serializeStyleElement(d) { var i, s, st; s = '<!--\n'; for (i=0; i<d.length; i++) { s += d[i].rule + ' {\n'; st = tinyMCE.serializeStyle(d[i].data); if (st != '') st += ';'; s += st.replace(/;/g, ';\n'); s += '}\n'; if (i != d.length - 1) s += '\n'; } s += '\n-->'; return s; } tinyMCEPopup.onInit.add(init);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullpage/js/fullpage.js
fullpage.js
tinyMCE.addI18n('ru.style_dlg',{ title:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 CSS \u0441\u0442\u0438\u043B\u044F", apply:"\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C", text_tab:"\u0422\u0435\u043A\u0441\u0442", background_tab:"\u0424\u043E\u043D", block_tab:"\u0411\u043B\u043E\u043A", box_tab:"Box", border_tab:"\u0413\u0440\u0430\u043D\u0438\u0446\u0430", list_tab:"\u0421\u043F\u0438\u0441\u043E\u043A", positioning_tab:"\u041F\u043E\u0437\u0438\u0446\u0438\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435", text_props:"\u0422\u0435\u043A\u0441\u0442", text_font:"\u0428\u0440\u0438\u0444\u0442", text_size:"\u0420\u0430\u0437\u043C\u0435\u0440", text_weight:"\u0422\u043E\u043B\u0449\u0438\u043D\u0430", text_style:"\u0421\u0442\u0438\u043B\u044C", text_variant:"Variant", text_lineheight:"\u0412\u044B\u0441\u043E\u0442\u0430 \u0441\u0442\u0440\u043E\u043A\u0438", text_case:"Case", text_color:"\u0426\u0432\u0435\u0442", text_decoration:"\u041E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435", text_overline:"\u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0447\u0435\u0440\u0442\u0430", text_underline:"\u043D\u0438\u0436\u043D\u044F\u044F \u0447\u0435\u0440\u0442\u0430", text_striketrough:"\u0437\u0430\u0447\u0435\u0440\u043A\u043D\u0443\u0442\u044B\u0439", text_blink:"\u043C\u0435\u0440\u0446\u0430\u043D\u0438\u044F", text_none:"\u043D\u0438\u0447\u0435\u0433\u043E", background_color:"\u0426\u0432\u0435\u0442 \u0444\u043E\u043D\u0430", background_image:"\u0424\u043E\u043D\u043E\u0432\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", background_repeat:"\u041F\u043E\u0432\u0442\u043E\u0440", background_attachment:"Attachment", background_hpos:"\u0413\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430\u044F \u043F\u043E\u0437\u0438\u0446\u0438\u044F", background_vpos:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u0430\u044F \u043F\u043E\u0437\u0438\u0446\u0438\u044F", block_wordspacing:"\u041E\u0442\u0441\u0442\u0443\u043F\u044B \u043C\u0435\u0436\u0434\u0443 \u0441\u043B\u043E\u0432\u0430\u043C\u0438", block_letterspacing:"\u041E\u0442\u0441\u0442\u0443\u043F\u044B \u043C\u0435\u0436\u0434\u0443 \u0431\u0443\u043A\u0432\u0430\u043C\u0438", block_vertical_alignment:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435 \u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", block_text_align:"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435 \u0442\u0435\u043A\u0441\u0442\u0430", block_text_indent:"Text indent", block_whitespace:"Whitespace", block_display:"Display", box_width:"\u0428\u0438\u0440\u0438\u043D\u0430", box_height:"\u0412\u044B\u0441\u043E\u0442\u0430", box_float:"Float", box_clear:"Clear", padding:"Padding", same:"\u041E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u0434\u043B\u044F \u0432\u0441\u0435\u0445", top:"\u0412\u0432\u0435\u0440\u0445", right:"\u0421\u043F\u0440\u0430\u0432\u0430", bottom:"\u0421\u043D\u0438\u0437\u0443", left:"\u0421\u043B\u0435\u0432\u0430", margin:"Margin", style:"\u0421\u0442\u0438\u043B\u044C", width:"\u0428\u0438\u0440\u0438\u043D\u0430", height:"\u0412\u044B\u0441\u043E\u0442\u0430", color:"\u0426\u0432\u0435\u0442", list_type:"\u0422\u0438\u043F", bullet_image:"Bullet image", position:"\u041F\u043E\u0437\u0438\u0446\u0438\u044F", positioning_type:"\u0422\u0438\u043F", visibility:"\u0412\u0438\u0434\u0438\u043C\u043E\u0441\u0442\u044C", zindex:"Z-index", overflow:"Overflow", placement:"Placement", clip:"Clip" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/style/langs/ru_dlg.js
ru_dlg.js
tinyMCE.addI18n('ja.style_dlg',{ title:"CSS\u7DE8\u96C6", apply:"\u9069\u7528", text_tab:"\u6587\u5B57", background_tab:"\u80CC\u666F", block_tab:"\u30D6\u30ED\u30C3\u30AF", box_tab:"\u30DC\u30C3\u30AF\u30B9", border_tab:"\u67A0\u7DDA", list_tab:"\u30EA\u30B9\u30C8", positioning_tab:"\u30DD\u30B8\u30B7\u30E7\u30F3", text_props:"Text", text_font:"\u30D5\u30A9\u30F3\u30C8", text_size:"\u30B5\u30A4\u30BA", text_weight:"\u592A\u3055", text_style:"\u30B9\u30BF\u30A4\u30EB", text_variant:"\u5909\u5F62", text_lineheight:"\u884C\u9AD8\u3055", text_case:"\u5927\u6587\u5B57/\u5C0F\u6587\u5B57", text_color:"\u8272", text_decoration:"\u88C5\u98FE", text_overline:"\u4E0A\u7DDA", text_underline:"\u4E0B\u7DDA", text_striketrough:"\u6253\u6D88\u3057\u7DDA", text_blink:"\u70B9\u6EC5", text_none:"\u306A\u3057", background_color:"\u80CC\u666F\u8272", background_image:"\u80CC\u666F\u753B\u50CF", background_repeat:"\u7E70\u308A\u8FD4\u3057", background_attachment:"Attachment", background_hpos:"\u6C34\u5E73\u4F4D\u7F6E", background_vpos:"\u5782\u76F4\u4F4D\u7F6E", block_wordspacing:"\u5358\u8A9E\u611F\u899A", block_letterspacing:"\u6587\u5B57\u9593\u9694", block_vertical_alignment:"\u5782\u76F4\u914D\u7F6E", block_text_align:"\u6C34\u5E73\u914D\u7F6E", block_text_indent:"\u30A4\u30F3\u30C7\u30F3\u30C8", block_whitespace:"\u7A7A\u767D\u6587\u5B57", block_display:"\u30C7\u30A3\u30B9\u30D7\u30EC\u30A4", box_width:"\u5E45", box_height:"\u9AD8\u3055", box_float:"\u56DE\u308A\u8FBC\u307F", box_clear:"\u56DE\u308A\u8FBC\u307F\u89E3\u9664", padding:"\u30D1\u30C7\u30A3\u30F3\u30B0", same:"\u5168\u3066\u540C\u3058\u306B\u3059\u308B", top:"\u4E0A", right:"\u53F3", bottom:"\u4E0B", left:"\u5DE6", margin:"\u30DE\u30FC\u30B8\u30F3", style:"\u30B9\u30BF\u30A4\u30EB", width:"\u5E45", height:"\u9AD8\u3055", color:"\u8272", list_type:"\u30DE\u30FC\u30AB\u30FC\u7A2E\u985E", bullet_image:"\u30DE\u30FC\u30AB\u30FC\u753B\u50CF", position:"\u30DE\u30FC\u30AB\u30FC\u8868\u793A\u4F4D\u7F6E", positioning_type:"\u914D\u7F6E\u65B9\u6CD5", visibility:"\u8868\u793A", zindex:"Z-Index", overflow:"\u30AA\u30FC\u30D0\u30FC\u30D5\u30ED\u30FC", placement:"\u4F4D\u7F6E", clip:"\u5207\u308A\u629C\u304D" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/style/langs/ja_dlg.js
ja_dlg.js
tinyMCEPopup.requireLangPack(); var defaultFonts = "" + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + "Courier New, Courier, mono=Courier New, Courier, mono;" + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; var defaultTextStyle = "normal;italic;oblique"; var defaultVariant = "normal;small-caps"; var defaultLineHeight = "normal"; var defaultAttachment = "fixed;scroll"; var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; var defaultPosH = "left;center;right"; var defaultPosV = "top;center;bottom"; var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; var defaultBorderWidth = "thin;medium;thick"; var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; function init() { var ce = document.getElementById('container'), h; ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); h = getBrowserHTML('background_image_browser','background_image','image','advimage'); document.getElementById("background_image_browser").innerHTML = h; document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); TinyMCE_EditableSelects.init(); setupFormData(); showDisabledControls(); } function setupFormData() { var ce = document.getElementById('container'), f = document.forms[0], s, b, i; // Setup text fields selectByValue(f, 'text_font', ce.style.fontFamily, true, true); selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); selectByValue(f, 'text_style', ce.style.fontStyle, true, true); selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); selectByValue(f, 'text_case', ce.style.textTransform, true, true); selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); updateColor('text_color_pick', 'text_color'); f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); // Setup background fields f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); updateColor('background_color_pick', 'background_color'); f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); // Setup block fields selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); f.block_text_indent.value = getNum(ce.style.textIndent); selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); selectByValue(f, 'block_display', ce.style.display, true, true); // Setup box fields f.box_width.value = getNum(ce.style.width); selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); f.box_height.value = getNum(ce.style.height); selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); if (tinymce.isGecko) selectByValue(f, 'box_float', ce.style.cssFloat, true, true); else selectByValue(f, 'box_float', ce.style.styleFloat, true, true); selectByValue(f, 'box_clear', ce.style.clear, true, true); setupBox(f, ce, 'box_padding', 'padding', ''); setupBox(f, ce, 'box_margin', 'margin', ''); // Setup border fields setupBox(f, ce, 'border_style', 'border', 'Style'); setupBox(f, ce, 'border_width', 'border', 'Width'); setupBox(f, ce, 'border_color', 'border', 'Color'); updateColor('border_color_top_pick', 'border_color_top'); updateColor('border_color_right_pick', 'border_color_right'); updateColor('border_color_bottom_pick', 'border_color_bottom'); updateColor('border_color_left_pick', 'border_color_left'); f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); // Setup list fields selectByValue(f, 'list_type', ce.style.listStyleType, true, true); selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); // Setup box fields selectByValue(f, 'positioning_type', ce.style.position, true, true); selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; f.positioning_width.value = getNum(ce.style.width); selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); f.positioning_height.value = getNum(ce.style.height); selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); s = s.replace(/,/g, ' '); if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { f.positioning_clip_top.value = getNum(getVal(s, 0)); selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); f.positioning_clip_right.value = getNum(getVal(s, 1)); selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); f.positioning_clip_bottom.value = getNum(getVal(s, 2)); selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); f.positioning_clip_left.value = getNum(getVal(s, 3)); selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); } else { f.positioning_clip_top.value = getNum(getVal(s, 0)); selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; } // setupBox(f, ce, '', 'border', 'Color'); } function getMeasurement(s) { return s.replace(/^([0-9.]+)(.*)$/, "$2"); } function getNum(s) { if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) return s.replace(/[^0-9.]/g, ''); return s; } function inStr(s, n) { return new RegExp(n, 'gi').test(s); } function getVal(s, i) { var a = s.split(' '); if (a.length > 1) return a[i]; return ""; } function setValue(f, n, v) { if (f.elements[n].type == "text") f.elements[n].value = v; else selectByValue(f, n, v, true, true); } function setupBox(f, ce, fp, pr, sf, b) { if (typeof(b) == "undefined") b = ['Top', 'Right', 'Bottom', 'Left']; if (isSame(ce, pr, sf, b)) { f.elements[fp + "_same"].checked = true; setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); f.elements[fp + "_top"].disabled = false; f.elements[fp + "_right"].value = ""; f.elements[fp + "_right"].disabled = true; f.elements[fp + "_bottom"].value = ""; f.elements[fp + "_bottom"].disabled = true; f.elements[fp + "_left"].value = ""; f.elements[fp + "_left"].disabled = true; if (f.elements[fp + "_top_measurement"]) { selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); f.elements[fp + "_left_measurement"].disabled = true; f.elements[fp + "_bottom_measurement"].disabled = true; f.elements[fp + "_right_measurement"].disabled = true; } } else { f.elements[fp + "_same"].checked = false; setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); f.elements[fp + "_top"].disabled = false; setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); f.elements[fp + "_right"].disabled = false; setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); f.elements[fp + "_bottom"].disabled = false; setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); f.elements[fp + "_left"].disabled = false; if (f.elements[fp + "_top_measurement"]) { selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); f.elements[fp + "_left_measurement"].disabled = false; f.elements[fp + "_bottom_measurement"].disabled = false; f.elements[fp + "_right_measurement"].disabled = false; } } } function isSame(e, pr, sf, b) { var a = [], i, x; if (typeof(b) == "undefined") b = ['Top', 'Right', 'Bottom', 'Left']; if (typeof(sf) == "undefined" || sf == null) sf = ""; a[0] = e.style[pr + b[0] + sf]; a[1] = e.style[pr + b[1] + sf]; a[2] = e.style[pr + b[2] + sf]; a[3] = e.style[pr + b[3] + sf]; for (i=0; i<a.length; i++) { if (a[i] == null) return false; for (x=0; x<a.length; x++) { if (a[x] != a[i]) return false; } } return true; }; function hasEqualValues(a) { var i, x; for (i=0; i<a.length; i++) { if (a[i] == null) return false; for (x=0; x<a.length; x++) { if (a[x] != a[i]) return false; } } return true; } function applyAction() { var ce = document.getElementById('container'), ed = tinyMCEPopup.editor; generateCSS(); tinyMCEPopup.restoreSelection(); ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText))); } function updateAction() { applyAction(); tinyMCEPopup.close(); } function generateCSS() { var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t; ce.style.cssText = ""; // Build text styles ce.style.fontFamily = f.text_font.value; ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : ""); ce.style.fontStyle = f.text_style.value; ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : ""); ce.style.textTransform = f.text_case.value; ce.style.fontWeight = f.text_weight.value; ce.style.fontVariant = f.text_variant.value; ce.style.color = f.text_color.value; s = ""; s += f.text_underline.checked ? " underline" : ""; s += f.text_overline.checked ? " overline" : ""; s += f.text_linethrough.checked ? " line-through" : ""; s += f.text_blink.checked ? " blink" : ""; s = s.length > 0 ? s.substring(1) : s; if (f.text_none.checked) s = "none"; ce.style.textDecoration = s; // Build background styles ce.style.backgroundColor = f.background_color.value; ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; ce.style.backgroundRepeat = f.background_repeat.value; ce.style.backgroundAttachment = f.background_attachment.value; if (f.background_hpos.value != "") { s = ""; s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); ce.style.backgroundPosition = s; } // Build block styles ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); ce.style.verticalAlign = f.block_vertical_alignment.value; ce.style.textAlign = f.block_text_align.value; ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); ce.style.whiteSpace = f.block_whitespace.value; ce.style.display = f.block_display.value; // Build box styles ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); ce.style.styleFloat = f.box_float.value; if (tinymce.isGecko) ce.style.cssFloat = f.box_float.value; ce.style.clear = f.box_clear.value; if (!f.box_padding_same.checked) { ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); } else ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); if (!f.box_margin_same.checked) { ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); } else ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); // Build border styles if (!f.border_style_same.checked) { ce.style.borderTopStyle = f.border_style_top.value; ce.style.borderRightStyle = f.border_style_right.value; ce.style.borderBottomStyle = f.border_style_bottom.value; ce.style.borderLeftStyle = f.border_style_left.value; } else ce.style.borderStyle = f.border_style_top.value; if (!f.border_width_same.checked) { ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); } else ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); if (!f.border_color_same.checked) { ce.style.borderTopColor = f.border_color_top.value; ce.style.borderRightColor = f.border_color_right.value; ce.style.borderBottomColor = f.border_color_bottom.value; ce.style.borderLeftColor = f.border_color_left.value; } else ce.style.borderColor = f.border_color_top.value; // Build list styles ce.style.listStyleType = f.list_type.value; ce.style.listStylePosition = f.list_position.value; ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; // Build positioning styles ce.style.position = f.positioning_type.value; ce.style.visibility = f.positioning_visibility.value; if (ce.style.width == "") ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); if (ce.style.height == "") ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); ce.style.zIndex = f.positioning_zindex.value; ce.style.overflow = f.positioning_overflow.value; if (!f.positioning_placement_same.checked) { ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); } else { s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); ce.style.top = s; ce.style.right = s; ce.style.bottom = s; ce.style.left = s; } if (!f.positioning_clip_same.checked) { s = "rect("; s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); s += ")"; if (s != "rect(auto auto auto auto)") ce.style.clip = s; } else { s = "rect("; t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; s += t + " "; s += t + " "; s += t + " "; s += t + ")"; if (s != "rect(auto auto auto auto)") ce.style.clip = s; } ce.style.cssText = ce.style.cssText; } function isNum(s) { return new RegExp('[0-9]+', 'g').test(s); } function showDisabledControls() { var f = document.forms, i, a; for (i=0; i<f.length; i++) { for (a=0; a<f[i].elements.length; a++) { if (f[i].elements[a].disabled) tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled"); else tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled"); } } } function fillSelect(f, s, param, dval, sep, em) { var i, ar, p, se; f = document.forms[f]; sep = typeof(sep) == "undefined" ? ";" : sep; if (em) addSelectValue(f, s, "", ""); ar = tinyMCEPopup.getParam(param, dval).split(sep); for (i=0; i<ar.length; i++) { se = false; if (ar[i].charAt(0) == '+') { ar[i] = ar[i].substring(1); se = true; } p = ar[i].split('='); if (p.length > 1) { addSelectValue(f, s, p[0], p[1]); if (se) selectByValue(f, s, p[1]); } else { addSelectValue(f, s, p[0], p[0]); if (se) selectByValue(f, s, p[0]); } } } function toggleSame(ce, pre) { var el = document.forms[0].elements, i; if (ce.checked) { el[pre + "_top"].disabled = false; el[pre + "_right"].disabled = true; el[pre + "_bottom"].disabled = true; el[pre + "_left"].disabled = true; if (el[pre + "_top_measurement"]) { el[pre + "_top_measurement"].disabled = false; el[pre + "_right_measurement"].disabled = true; el[pre + "_bottom_measurement"].disabled = true; el[pre + "_left_measurement"].disabled = true; } } else { el[pre + "_top"].disabled = false; el[pre + "_right"].disabled = false; el[pre + "_bottom"].disabled = false; el[pre + "_left"].disabled = false; if (el[pre + "_top_measurement"]) { el[pre + "_top_measurement"].disabled = false; el[pre + "_right_measurement"].disabled = false; el[pre + "_bottom_measurement"].disabled = false; el[pre + "_left_measurement"].disabled = false; } } showDisabledControls(); } function synch(fr, to) { var f = document.forms[0]; f.elements[to].value = f.elements[fr].value; if (f.elements[fr + "_measurement"]) selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); } tinyMCEPopup.onInit.add(init);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/style/js/props.js
props.js
tinyMCE.addI18n('ko.advlink_dlg',{ title:"\uB9C1\uD06C\uC758 \uC0BD\uC785/\uD3B8\uC9D1", url:"\uB9C1\uD06C URL", target:"Target", titlefield:"\uC81C\uBAA9", is_email:"\uBA54\uC77C\uC8FC\uC18C\uAC00 \uC785\uB825\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBA54\uC77C\uC8FC\uC18C\uC758 \uC55E\uC5D0 mailto:\uB97C \uBD99\uC785\uB2C8\uAE4C?", is_external:"\uC678\uBD80URL\uC774 \uC785\uB825\uB418\uC5C8\uC2B5\uB2C8\uB2E4.URL\uC758 \uC55E\uC5D0http://\uB97C \uBD99\uC785\uB2C8\uAE4C?", list:"\uB9C1\uD06C \uBAA9\uB85D", general_tab:"\uC77C\uBC18", popup_tab:"\uD31D\uC5C5", events_tab:"\uC774\uBCA4\uD2B8", advanced_tab:"\uACE0\uAE09", general_props:"\uC77C\uBC18 \uC124\uC815", popup_props:"\uD31D\uC5C5 \uC124\uC815", event_props:"\uC774\uBCA4\uD2B8", advanced_props:"\uACE0\uAE09\uC758 \uC124\uC815", popup_opts:"\uC635\uC158", anchor_names:"\uC5E5\uCEE4", target_same:"\uC774 \uCC3D/\uD504\uB808\uC784\uC73C\uB85C \uC5F4\uB9B0\uB2E4", target_parent:"\uBD80\uBAA8\uCC3D/\uD504\uB808\uC784\uC73C\uB85C \uC5F4\uB9B0\uB2E4", target_top:"\uCD5C\uC0C1\uC704 \uD504\uB808\uC784\uC73C\uB85C \uC5F4\uB9B0\uB2E4 (\uBAA8\uB4E0 \uD504\uB808\uC784 \uBCC0\uACBD)", target_blank:"\uC0C8\uCC3D\uC73C\uB85C \uC5F4\uB9B0\uB2E4", popup:"Javascript \uD31D\uC5C5", popup_url:"\uD31D\uC5C5 URL", popup_name:"Window \uC774\uB984", popup_return:"'return false'\uB97C \uC0BD\uC785", popup_scrollbars:"\uC2A4\uD06C\uB864\uBC14\uB97C \uD45C\uC2DC", popup_statusbar:"\uC0C1\uD0DC\uC904\uC744 \uD45C\uC2DC", popup_toolbar:"\uD234\uBC14\uB97C \uD45C\uC2DC", popup_menubar:"\uBA54\uB274\uB97C \uD45C\uC2DC", popup_location:"\uC8FC\uC18C\uBC14\uB97C \uD45C\uC2DC", popup_resizable:"\uD06C\uAE30\uBCC0\uACBD \uAC00\uB2A5", popup_dependent:"\uC5F0\uB3D9 (Mozilla/Firefox\uB9CC)", popup_size:"\uD06C\uAE30", popup_position:"\uC704\uCE58(X/Y)", id:"Id", style:"\uC2A4\uD0C0\uC77C", classes:"\uD074\uB798\uC2A4", target_name:"Target \uC774\uB984", langdir:"\uD398\uC774\uC9C0 \uBB38\uC790 \uBC29\uD5A5", target_langcode:"\uD398\uC774\uC9C0 \uC5B8\uC5B4", langcode:"\uC5B8\uC5B4 \uCF54\uB4DC", encoding:"\uBB38\uC790 \uC778\uCF54\uB529", mime:"MIME\uD0C0\uC785", rel:"\uB9C1\uD06C\uC5D0 \uAD00\uACC4", rev:"\uB9C1\uD06C\uB85C\uBD80\uD130\uC758 \uAD00\uACC4", tabindex:"\uD0ED \uC778\uB371\uC2A4", accesskey:"\uC561\uC138\uC2A4 \uD0A4", ltr:"\uC67C\uCABD\uC5D0\uC11C \uC624\uB978\uCABD", rtl:"\uC624\uB978\uCABD\uC5D0\uC11C \uC67C\uCABD", link_list:"\uB9C1\uD06C \uBAA9\uB85D" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/langs/ko_dlg.js
ko_dlg.js
tinyMCE.addI18n('fr.advlink_dlg',{ title:"Ins\u00E9rer / \u00E9diter un lien", url:"URL du lien", target:"Cible", titlefield:"Titre", is_email:"L'URL que vous avez saisie semble \u00EAtre une adresse e-mail, souhaitez-vous ajouter le pr\u00E9fixe \u00AB mailto: \u00BB ?", is_external:"L'URL que vous avez saisie semble \u00EAtre une adresse web externe. Souhaitez-vous ajouter le pr\u00E9fixe \u00AB http:// \u00BB ?", list:"Liste de liens", general_tab:"G\u00E9n\u00E9ral", popup_tab:"Popup", events_tab:"\u00C9v\u00E8nements", advanced_tab:"Avanc\u00E9", general_props:"Propri\u00E9t\u00E9s g\u00E9n\u00E9rales", popup_props:"Propri\u00E9t\u00E9s de la popup", event_props:"\u00C9v\u00E8nements", advanced_props:"Propri\u00E9t\u00E9s avanc\u00E9es", popup_opts:"Options", anchor_names:"Ancres", target_same:"Ouvrir dans cette fen\u00EAtre / dans ce cadre", target_parent:"Ouvrir dans la fen\u00EAtre / le cadre parent", target_top:"Ouvrir dans le cadre principal (remplace tous les cadres)", target_blank:"Ouvrir dans une nouvelle fen\u00EAtre", popup:"Popup Javascript", popup_url:"URL de la popup", popup_name:"Nom de la fen\u00EAtre", popup_return:"Ins\u00E9rer 'return false'", popup_scrollbars:"Afficher les ascenseurs", popup_statusbar:"Afficher la barre d'\u00E9tat", popup_toolbar:"Afficher la barre d'outils", popup_menubar:"Afficher la barre de menu", popup_location:"Afficher la barre d'adresse", popup_resizable:"Autoriser le redimensionnement de la fen\u00EAtre", popup_dependent:"D\u00E9pendante (seulement sous Mozilla/Firefox)", popup_size:"Taille", popup_position:"Position (X/Y)", id:"Id", style:"Style", classes:"Classes", target_name:"Nom de la cible", langdir:"Sens de lecture", target_langcode:"Langue de la cible", langcode:"Code de la langue", encoding:"Encodage de la cible", mime:"Type MIME de la cible", rel:"Relation de la page \u00E0 la cible", rev:"Relation de la cible \u00E0 la page", tabindex:"Tabindex", accesskey:"Touche d'acc\u00E8s rapide", ltr:"Gauche \u00E0 droite", rtl:"Droite \u00E0 gauche", link_list:"Liste des liens" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/langs/fr_dlg.js
fr_dlg.js
tinyMCE.addI18n('ia.advlink_dlg',{ title:"\u63D2\u5165/\u7F16\u8F91 \u8FDE\u7ED3", url:"\u8FDE\u7ED3\u5730\u5740", target:"\u76EE\u6807", titlefield:"\u67E5\u627E", is_email:"\u60A8\u8F93\u5165\u7684\u5E94\u8BE5\u662F\u4E00\u4E2A\u7535\u5B50\u90AE\u5BC4\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u52A0\u4E0A mailto: ? ", is_external:"\u60A8\u8F93\u5165\u7684\u7F51\u5740\u5E94\u8BE5\u662F\u4E00\u4E2A\u5916\u90E8\u8FDE\u7ED3\uFF0C\u662F\u5426\u9700\u8981\u5728\u7F51\u5740\u524D\u52A0\u4E0A http:// ?", list:"\u8FDE\u7ED3\u6E05\u5355", general_tab:"\u57FA\u672C", popup_tab:"\u5FEB\u663E\u7A97\u53E3", events_tab:"\u4E8B\u4EF6", advanced_tab:"\u9AD8\u7EA7", general_props:"\u57FA\u672C\u5C5E\u6027", popup_props:"\u5FEB\u663E\u7A97\u53E3\u5C5E\u6027", event_props:"\u4E8B\u4EF6", advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", popup_opts:"\u9009\u9879", anchor_names:"\u951A\u70B9", target_same:"\u5728\u5F53\u524D\u7A97\u53E3\u6253\u5F00", target_parent:"\u5728\u7236\u7A97\u53E3\u6253\u5F00", target_top:"\u5728\u9876\u5C42\u7A97\u53E3\u6253\u5F00", target_blank:"\u5728\u65B0\u7A97\u53E3\u6253\u5F00", popup:"Javascript \u5FEB\u663E\u7A97\u53E3", popup_url:"\u5F39\u51FA\u7A97\u53E3\u5730\u5740", popup_name:"\u7A97\u53E3\u540D\u79F0", popup_return:"\u63D2\u5165 'return false'", popup_scrollbars:"\u663E\u793A\u6EDA\u52A8\u6761", popup_statusbar:"\u663E\u793A\u72B6\u6001\u5217", popup_toolbar:"\u663E\u793A\u5DE5\u5177\u5217", popup_menubar:"\u663E\u793A\u83DC\u5355\u5217", popup_location:"\u663E\u793A\u5730\u5740\u680F", popup_resizable:"\u53EF\u8C03\u6574\u7A97\u53E3\u5927\u5C0F", popup_dependent:"\u4ECE\u5C5E\u4E8E ( \u4EC5 Mozilla/Firefox \u6709\u6548 )", popup_size:"\u5927\u5C0F", popup_position:"\u5750\u6807 (X/Y)", id:"Id", style:"\u6837\u5F0F", classes:"\u6837\u5F0F\u7C7B", target_name:"\u76EE\u6807\u540D\u79F0", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", target_langcode:"\u76EE\u6807\u8BED\u8A00", langcode:"\u8BED\u8A00\u7F16\u7801", encoding:"\u76EE\u6807\u8BED\u8A00\u7F16\u7801", mime:"\u76EE\u6807 MIME \u7C7B\u578B", rel:"rel", rev:"rev", tabindex:"Tab\u7D22\u5F15", accesskey:"\u5FEB\u901F\u952E", ltr:"\u4ECE\u5DE6\u5230\u53F3", rtl:"\u4ECE\u53F3\u5230\u5DE6", link_list:"\u8FDE\u7ED3\u6E05\u5355" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/langs/ia_dlg.js
ia_dlg.js
tinyMCE.addI18n('zh.advlink_dlg',{ title:"\u63D2\u5165/\u7DE8\u8F2F\u9023\u7D50", url:"\u93C8\u63A5\u5730\u5740", target:"\u76EE\u6A19", titlefield:"\u5C0B\u627E", is_email:"\u60A8\u8F38\u5165\u7684\u7DB2\u5740\u61C9\u8A72\u662F\u4E00\u500B\u96FB\u5B50\u90F5\u4EF6\u5730\u5740\uFF0C\u662F\u5426\u9700\u8981\u5728\u5730\u5740\u524D\u65B9\u52A0\u5165mailto:\uFF1F", is_external:"\u60A8\u8F38\u5165\u7684\u7DB2\u5740\u61C9\u8A72\u662F\u4E00\u500B\u5916\u90E8\u9023\u7D50\uFF0C\u662F\u5426\u9700\u8981\u5728\u7DB2\u5740\u524D\u65B9\u52A0\u5165http://\uFF1F", list:"\u93C8\u63A5\u6E05\u55AE", general_tab:"\u4E00\u822C", popup_tab:"\u5F48\u51FA\u7A97\u53E3", events_tab:"\u4E8B\u4EF6", advanced_tab:"\u9AD8\u7D1A", general_props:"\u4E00\u822C\u5C6C\u6027", popup_props:"\u5F48\u51FA\u7A97\u53E3\u5C6C\u6027", event_props:"\u4E8B\u4EF6", advanced_props:"\u9AD8\u7D1A\u5C6C\u6027", popup_opts:"\u9078\u9805", anchor_names:"\u9328\u9EDE", target_same:"\u958B\u555F\u65BC\u65B0\u7A97\u53E3/\u6846\u67B6", target_parent:"\u958B\u555F\u65BC\u7236\u7A97\u53E3/\u6846\u67B6", target_top:"\u958B\u555F\u65BC\u6700\u4E0A\u5C64\u7684\u6846\u67B6(\u53D6\u4EE3\u6240\u6709\u6846\u67B6)", target_blank:"\u958B\u555F\u65BC\u65B0\u7A97\u53E3", popup:"Javascript\u5F48\u51FA\u7A97\u53E3", popup_url:"\u5F48\u51FA\u7A97\u53E3\u7DB2\u5740", popup_name:"\u7A97\u53E3\u540D\u7A31", popup_return:"\u63D2\u5165'return false'", popup_scrollbars:"\u986F\u793A\u6EFE\u52D5\u689D", popup_statusbar:"\u986F\u793A\u72C0\u614B\u6B04", popup_toolbar:"\u986F\u793A\u5DE5\u5177\u6B04", popup_menubar:"\u986F\u793A\u83DC\u55AE", popup_location:"\u986F\u793A\u7DB2\u5740\u5217", popup_resizable:"\u53EF\u8ABF\u6574\u7A97\u53E3\u5C3A\u5BF8", popup_dependent:"\u5F9E\u5C6C(\u53EA\u6709Mozilla/Firefox\u6709\u6548)", popup_size:"\u5C3A\u5BF8", popup_position:"\u5750\u6A19(X/Y)", id:"Id", style:"\u6A23\u5F0F", classes:"\u985E\u578B", target_name:"\u76EE\u6A19\u540D\u7A31", langdir:"\u66F8\u5BEB\u65B9\u5411", target_langcode:"\u76EE\u6A19\u8A9E\u8A00", langcode:"\u8A9E\u8A00\u7DE8\u78BC", encoding:"\u7DE8\u78BC", mime:"\u76EE\u6A19MIME\u985E\u578B", rel:"\u9801\u5230\u76EE\u6A19\u7684\u95DC\u4FC2", rev:"\u76EE\u6A19\u5230\u9801\u7684\u95DC\u4FC2", tabindex:"Tab\u7D22\u5F15", accesskey:"\u5FEB\u6377\u9375", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", link_list:"\u93C8\u63A5\u6E05\u55AE" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/langs/zh_dlg.js
zh_dlg.js
tinyMCE.addI18n('ca.advlink_dlg',{ title:"Insereix/edita enlla\u00E7", url:"URL de l\'enlla\u00E7", target:"Objectiu", titlefield:"T\u00EDtol", is_email:"L\'URL que heu introdu\u00EFt sembla ser una adre\u00E7a de correu electr\u00F2nic, voleu afegir-hi el prefix requerit mailto: ?", is_external:"L\'URL que heu introdu\u00EFt sembla ser un enlla\u00E7 extern, voleu afegir-hi el prefix requerit http:// ?", list:"Llista d\'enlla\u00E7os", general_tab:"General", popup_tab:"Finestra emergent", events_tab:"Esdeveniments", advanced_tab:"Avan\u00E7at", general_props:"Propietats generals", popup_props:"Propietats de la finestra emergent", event_props:"Esdeveniments", advanced_props:"Propietats avan\u00E7ades", popup_opts:"Opcions", anchor_names:"\u00C0ncores", target_same:"Obre en aquesta finestra / marc", target_parent:"Obre en la finestra / marc pare", target_top:"Obre en el marc superior (reempla\u00E7a tots els marcs)", target_blank:"Obre en una nova finestra", popup:"Finestra emergent javascript", popup_url:"URL de la finestra emergent", popup_name:"Nom de la finestra", popup_return:"Insereix \'return false\'", popup_scrollbars:"Mostra les barres de despla\u00E7ament", popup_statusbar:"Mostra la barra d\'estat", popup_toolbar:"Mostra la barra d\'eines", popup_menubar:"Mostra la barra de men\u00FA", popup_location:"Mostra la barra d\'ubicaci\u00F3", popup_resizable:"Fes la finestra redimensionable", popup_dependent:"Dependent (nom\u00E9s Mozilla/Firefox)", popup_size:"Mida", popup_position:"Posici\u00F3 (X/Y)", id:"Id", style:"Estil", classes:"Classes", target_name:"Nom del dest\u00ED", langdir:"Direcci\u00F3 de l\'idioma", target_langcode:"Idioma del dest\u00ED", langcode:"Codi de l\'idioma", encoding:"Codificaci\u00F3 de car\u00E0cters del dest\u00ED", mime:"Tipus MIME del dest\u00ED", rel:"Relaci\u00F3 de p\u00E0gina a dest\u00ED", rev:"Relaci\u00F3 de dest\u00ED a p\u00E0gina", tabindex:"Tabindex", accesskey:"Accesskey", ltr:"D\'esquerra a dreta", rtl:"De dreta a esquerra", link_list:"Llista d\'enlla\u00E7os" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/langs/ca_dlg.js
ca_dlg.js
tinyMCE.addI18n('ru.advlink_dlg',{ title:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443", url:"\u0410\u0434\u0440\u0435\u0441", target:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 ...", titlefield:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", is_email:"\u0412\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0439 URL \u043F\u043E\u0445\u043E\u0436 \u043D\u0430 email \u0430\u0434\u0440\u0435\u0441, \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0439 \u043F\u0440\u0435\u0444\u0438\u043A\u0441 mailto?", is_external:"\u0412\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0439 URL \u043F\u043E\u0445\u043E\u0436 \u043D\u0430 \u0432\u043D\u0435\u0448\u043D\u044E\u044E \u0441\u0441\u044B\u043B\u043A\u0443, \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0439 \u043F\u0440\u0435\u0444\u0438\u043A\u0441 http://?", list:"\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0441\u044B\u043B\u043E\u043A", general_tab:"\u041E\u0431\u0449\u0435\u0435", popup_tab:"Popup", events_tab:"\u0421\u043E\u0431\u044B\u0442\u0438\u044F", advanced_tab:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E", general_props:"\u041E\u0431\u0449\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", popup_props:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 Popup", event_props:"\u0421\u043E\u0431\u044B\u0442\u0438\u044F", advanced_props:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", popup_opts:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430", anchor_names:"\u042F\u043A\u043E\u0440\u044F", target_same:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 \u044D\u0442\u043E\u043C \u0436\u0435 \u043E\u043A\u043D\u0435 / \u0444\u0440\u0435\u0439\u043C\u0435", target_parent:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 \u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u043C \u043E\u043A\u043D\u0435 / \u0444\u0440\u0435\u0439\u043C\u0435", target_top:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u043C \u0444\u0440\u0435\u0439\u043C\u0435 (\u0437\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435 \u0444\u0440\u0435\u0439\u043C\u044B)", target_blank:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 \u043D\u043E\u0432\u043E\u043C \u043E\u043A\u043D\u0435", popup:"Javascript popup", popup_url:"Popup URL", popup_name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u043A\u043D\u0430", popup_return:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C 'return false'", popup_scrollbars:"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0441\u043A\u0440\u043E\u043B\u043B\u0435\u0440\u044B", popup_statusbar:"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441", popup_toolbar:"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0430\u043D\u0435\u043B\u0438 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432", popup_menubar:"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043C\u0435\u043D\u044E", popup_location:"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0430\u043D\u0435\u043B\u044C location", popup_resizable:"\u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0442\u044C \u0438\u0437\u043C\u0435\u043D\u044F\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0440", popup_dependent:"Dependent (\u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F Mozilla / Firefox)", popup_size:"\u0420\u0430\u0437\u043C\u0435\u0440", popup_position:"\u041F\u043E\u0437\u0438\u0446\u0438\u044F (X / Y)", id:"Id", style:"\u0421\u0442\u0438\u043B\u044C", classes:"\u041A\u043B\u0430\u0441\u0441\u044B", target_name:"Target name", langdir:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u044F\u0437\u044B\u043A\u0430", target_langcode:"Target language", langcode:"\u041A\u043E\u0434 \u044F\u0437\u044B\u043A\u0430", encoding:"Target character encoding", mime:"Target MIME type", rel:"Relationship page to target", rev:"Relationship target to page", tabindex:"Tabindex", accesskey:"Accesskey", ltr:"\u0421\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043E", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u043E", link_list:"\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0441\u044B\u043B\u043E\u043A" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/langs/ru_dlg.js
ru_dlg.js
tinyMCE.addI18n('ja.advlink_dlg',{ title:"\u30EA\u30F3\u30AF\u306E\u633F\u5165/\u7DE8\u96C6", url:"\u30EA\u30F3\u30AFURL", target:"\u30BF\u30FC\u30B2\u30C3\u30C8", titlefield:"\u30BF\u30A4\u30C8\u30EB", is_email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F\u3002\u30EA\u30F3\u30AF\u306Bmailto:\u3092\u4ED8\u52A0\u3057\u307E\u3059\u304B\uFF1F", is_external:"\u30EA\u30F3\u30AF\u306Bhttp://\u3092\u4ED8\u52A0\u3057\u307E\u3059\u304B\uFF1F", list:"\u4E00\u89A7\u304B\u3089\u9078\u3076", general_tab:"\u4E00\u822C", popup_tab:"\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7", events_tab:"\u30A4\u30D9\u30F3\u30C8", advanced_tab:"\u4E0A\u7D1A\u8005\u5411\u3051", general_props:"\u4E00\u822C", popup_props:"\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7", event_props:"\u30A4\u30D9\u30F3\u30C8", advanced_props:"\u4E0A\u7D1A\u8005\u5411\u3051", popup_opts:"\u30AA\u30D7\u30B7\u30E7\u30F3", anchor_names:"\u30A2\u30F3\u30AB\u30FC", target_same:"\u3053\u306E\u30A6\u30A4\u30F3\u30C9\u30A6/\u30D5\u30EC\u30FC\u30E0\u3067\u958B\u304F", target_parent:"\u89AA\u30A6\u30A4\u30F3\u30C9\u30A6/\u89AA\u30D5\u30EC\u30FC\u30E0\u3067\u958B\u304F", target_top:"\u30C8\u30C3\u30D7\u306E\u30D5\u30EC\u30FC\u30E0\u3067\u958B\u304F", target_blank:"\u65B0\u3057\u3044\u30A6\u30A4\u30F3\u30C9\u30A6\u3067\u958B\u304F", popup:"Javascript\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7", popup_url:"\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7URL", popup_name:"\u30A6\u30A4\u30F3\u30C9\u30A6\u540D", popup_return:"'return false'\u3092\u633F\u5165\u3059\u308B", popup_scrollbars:"\u30B9\u30AF\u30ED\u30FC\u30EB\u30D0\u30FC\u3092\u8868\u793A", popup_statusbar:"\u30B9\u30C6\u30FC\u30BF\u30B9\u30D0\u30FC\u3092\u8868\u793A", popup_toolbar:"\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u8868\u793A", popup_menubar:"\u30E1\u30CB\u30E5\u30FC\u30D0\u30FC\u3092\u8868\u793A", popup_location:"\u30A2\u30C9\u30EC\u30B9\u30D0\u30FC\u3092\u8868\u793A", popup_resizable:"\u30A6\u30A4\u30F3\u30C9\u30A6\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u3092\u8A31\u53EF\u3059\u308B", popup_dependent:"Dependent (Mozilla/Firefox\u306E\u307F)", popup_size:"\u30B5\u30A4\u30BA", popup_position:"\u4F4D\u7F6E (X/Y)", id:"ID", style:"\u30B9\u30BF\u30A4\u30EB", classes:"\u30AF\u30E9\u30B9", target_name:"\u30BF\u30FC\u30B2\u30C3\u30C8\u540D", langdir:"\u6587\u7AE0\u306E\u65B9\u5411", target_langcode:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u8A00\u8A9E", langcode:"\u8A00\u8A9E\u30B3\u30FC\u30C9", encoding:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0", mime:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306EMIME\u30BF\u30A4\u30D7", rel:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u30BF\u30FC\u30B2\u30C3\u30C8\u306B\u5BFE\u3059\u308B\u95A2\u4FC2", rev:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306E\u3053\u306E\u30DA\u30FC\u30B8\u306B\u5BFE\u3059\u308B\u95A2\u4FC2", tabindex:"\u30BF\u30D6\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9", accesskey:"\u30A2\u30AF\u30BB\u30B9\u30AD\u30FC", ltr:"\u5DE6\u304B\u3089\u53F3", rtl:"\u53F3\u304B\u3089\u5DE6", link_list:"\u4E00\u89A7\u304B\u3089\u9078\u3076" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/langs/ja_dlg.js
ja_dlg.js
tinyMCEPopup.requireLangPack(); var templates = { "window.open" : "window.open('${url}','${target}','${options}')" }; function preinit() { var url; if (url = tinyMCEPopup.getParam("external_link_list_url")) document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); } function changeClass() { var f = document.forms[0]; f.classes.value = getSelectValue(f, 'classlist'); } function init() { tinyMCEPopup.resizeToInnerSize(); var formObj = document.forms[0]; var inst = tinyMCEPopup.editor; var elm = inst.selection.getNode(); var action = "insert"; var html; document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); // Link list html = getLinkListHTML('linklisthref','href'); if (html == "") document.getElementById("linklisthrefrow").style.display = 'none'; else document.getElementById("linklisthrefcontainer").innerHTML = html; // Resize some elements if (isVisible('hrefbrowser')) document.getElementById('href').style.width = '260px'; if (isVisible('popupurlbrowser')) document.getElementById('popupurl').style.width = '180px'; elm = inst.dom.getParent(elm, "A"); if (elm != null && elm.nodeName == "A") action = "update"; formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); setPopupControlsDisabled(true); if (action == "update") { var href = inst.dom.getAttrib(elm, 'href'); var onclick = inst.dom.getAttrib(elm, 'onclick'); // Setup form data setFormValue('href', href); setFormValue('title', inst.dom.getAttrib(elm, 'title')); setFormValue('id', inst.dom.getAttrib(elm, 'id')); setFormValue('style', inst.dom.getAttrib(elm, "style")); setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); setFormValue('type', inst.dom.getAttrib(elm, 'type')); setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); setFormValue('onclick', onclick); setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); setFormValue('target', inst.dom.getAttrib(elm, 'target')); setFormValue('classes', inst.dom.getAttrib(elm, 'class')); // Parse onclick data if (onclick != null && onclick.indexOf('window.open') != -1) parseWindowOpen(onclick); else parseFunction(onclick); // Select by the values selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); selectByValue(formObj, 'linklisthref', href); if (href.charAt(0) == '#') selectByValue(formObj, 'anchorlist', href); addClassesToList('classlist', 'advlink_styles'); selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); } else addClassesToList('classlist', 'advlink_styles'); } function checkPrefix(n) { if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) n.value = 'mailto:' + n.value; if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) n.value = 'http://' + n.value; } function setFormValue(name, value) { document.forms[0].elements[name].value = value; } function parseWindowOpen(onclick) { var formObj = document.forms[0]; // Preprocess center code if (onclick.indexOf('return false;') != -1) { formObj.popupreturn.checked = true; onclick = onclick.replace('return false;', ''); } else formObj.popupreturn.checked = false; var onClickData = parseLink(onclick); if (onClickData != null) { formObj.ispopup.checked = true; setPopupControlsDisabled(false); var onClickWindowOptions = parseOptions(onClickData['options']); var url = onClickData['url']; formObj.popupname.value = onClickData['target']; formObj.popupurl.value = url; formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); if (formObj.popupleft.value.indexOf('screen') != -1) formObj.popupleft.value = "c"; if (formObj.popuptop.value.indexOf('screen') != -1) formObj.popuptop.value = "c"; formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; buildOnClick(); } } function parseFunction(onclick) { var formObj = document.forms[0]; var onClickData = parseLink(onclick); // TODO: Add stuff here } function getOption(opts, name) { return typeof(opts[name]) == "undefined" ? "" : opts[name]; } function setPopupControlsDisabled(state) { var formObj = document.forms[0]; formObj.popupname.disabled = state; formObj.popupurl.disabled = state; formObj.popupwidth.disabled = state; formObj.popupheight.disabled = state; formObj.popupleft.disabled = state; formObj.popuptop.disabled = state; formObj.popuplocation.disabled = state; formObj.popupscrollbars.disabled = state; formObj.popupmenubar.disabled = state; formObj.popupresizable.disabled = state; formObj.popuptoolbar.disabled = state; formObj.popupstatus.disabled = state; formObj.popupreturn.disabled = state; formObj.popupdependent.disabled = state; setBrowserDisabled('popupurlbrowser', state); } function parseLink(link) { link = link.replace(new RegExp('&#39;', 'g'), "'"); var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); // Is function name a template function var template = templates[fnName]; if (template) { // Build regexp var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; var replaceStr = ""; for (var i=0; i<variableNames.length; i++) { // Is string value if (variableNames[i].indexOf("'${") != -1) regExp += "'(.*)'"; else // Number value regExp += "([0-9]*)"; replaceStr += "$" + (i+1); // Cleanup variable name variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), ""); if (i != variableNames.length-1) { regExp += "\\s*,\\s*"; replaceStr += "<delim>"; } else regExp += ".*"; } regExp += "\\);?"; // Build variable array var variables = []; variables["_function"] = fnName; var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>'); for (var i=0; i<variableNames.length; i++) variables[variableNames[i]] = variableValues[i]; return variables; } return null; } function parseOptions(opts) { if (opts == null || opts == "") return []; // Cleanup the options opts = opts.toLowerCase(); opts = opts.replace(/;/g, ","); opts = opts.replace(/[^0-9a-z=,]/g, ""); var optionChunks = opts.split(','); var options = []; for (var i=0; i<optionChunks.length; i++) { var parts = optionChunks[i].split('='); if (parts.length == 2) options[parts[0]] = parts[1]; } return options; } function buildOnClick() { var formObj = document.forms[0]; if (!formObj.ispopup.checked) { formObj.onclick.value = ""; return; } var onclick = "window.open('"; var url = formObj.popupurl.value; onclick += url + "','"; onclick += formObj.popupname.value + "','"; if (formObj.popuplocation.checked) onclick += "location=yes,"; if (formObj.popupscrollbars.checked) onclick += "scrollbars=yes,"; if (formObj.popupmenubar.checked) onclick += "menubar=yes,"; if (formObj.popupresizable.checked) onclick += "resizable=yes,"; if (formObj.popuptoolbar.checked) onclick += "toolbar=yes,"; if (formObj.popupstatus.checked) onclick += "status=yes,"; if (formObj.popupdependent.checked) onclick += "dependent=yes,"; if (formObj.popupwidth.value != "") onclick += "width=" + formObj.popupwidth.value + ","; if (formObj.popupheight.value != "") onclick += "height=" + formObj.popupheight.value + ","; if (formObj.popupleft.value != "") { if (formObj.popupleft.value != "c") onclick += "left=" + formObj.popupleft.value + ","; else onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',"; } if (formObj.popuptop.value != "") { if (formObj.popuptop.value != "c") onclick += "top=" + formObj.popuptop.value + ","; else onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',"; } if (onclick.charAt(onclick.length-1) == ',') onclick = onclick.substring(0, onclick.length-1); onclick += "');"; if (formObj.popupreturn.checked) onclick += "return false;"; // tinyMCE.debug(onclick); formObj.onclick.value = onclick; if (formObj.href.value == "") formObj.href.value = url; } function setAttrib(elm, attrib, value) { var formObj = document.forms[0]; var valueElm = formObj.elements[attrib.toLowerCase()]; var dom = tinyMCEPopup.editor.dom; if (typeof(value) == "undefined" || value == null) { value = ""; if (valueElm) value = valueElm.value; } // Clean up the style if (attrib == 'style') value = dom.serializeStyle(dom.parseStyle(value)); dom.setAttrib(elm, attrib, value); } function getAnchorListHTML(id, target) { var inst = tinyMCEPopup.editor; var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i; var html = ""; html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value='; html += 'this.options[this.selectedIndex].value;">'; html += '<option value="">---</option>'; for (i=0; i<nodes.length; i++) { if ((name = inst.dom.getAttrib(nodes[i], "name")) != "") html += '<option value="#' + name + '">' + name + '</option>'; } html += '</select>'; return html; } function insertAction() { var inst = tinyMCEPopup.editor; var elm, elementArray, i; elm = inst.selection.getNode(); checkPrefix(document.forms[0].href); elm = inst.dom.getParent(elm, "A"); // Remove element if there is no href if (!document.forms[0].href.value) { tinyMCEPopup.execCommand("mceBeginUndoLevel"); i = inst.selection.getBookmark(); inst.dom.remove(elm, 1); inst.selection.moveToBookmark(i); tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); return; } tinyMCEPopup.execCommand("mceBeginUndoLevel"); // Create new anchor elements if (elm == null) { inst.getDoc().execCommand("unlink", false, null); tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); for (i=0; i<elementArray.length; i++) setAllAttribs(elm = elementArray[i]); } else setAllAttribs(elm); // Don't move caret if selection was image if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') { inst.focus(); inst.selection.select(elm); inst.selection.collapse(0); tinyMCEPopup.storeSelection(); } tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); } function setAllAttribs(elm) { var formObj = document.forms[0]; var href = formObj.href.value; var target = getSelectValue(formObj, 'targetlist'); setAttrib(elm, 'href', href); setAttrib(elm, 'title'); setAttrib(elm, 'target', target == '_self' ? '' : target); setAttrib(elm, 'id'); setAttrib(elm, 'style'); setAttrib(elm, 'class', getSelectValue(formObj, 'classlist')); setAttrib(elm, 'rel'); setAttrib(elm, 'rev'); setAttrib(elm, 'charset'); setAttrib(elm, 'hreflang'); setAttrib(elm, 'dir'); setAttrib(elm, 'lang'); setAttrib(elm, 'tabindex'); setAttrib(elm, 'accesskey'); setAttrib(elm, 'type'); setAttrib(elm, 'onfocus'); setAttrib(elm, 'onblur'); setAttrib(elm, 'onclick'); setAttrib(elm, 'ondblclick'); setAttrib(elm, 'onmousedown'); setAttrib(elm, 'onmouseup'); setAttrib(elm, 'onmouseover'); setAttrib(elm, 'onmousemove'); setAttrib(elm, 'onmouseout'); setAttrib(elm, 'onkeypress'); setAttrib(elm, 'onkeydown'); setAttrib(elm, 'onkeyup'); // Refresh in old MSIE if (tinyMCE.isMSIE5) elm.outerHTML = elm.outerHTML; } function getSelectValue(form_obj, field_name) { var elm = form_obj.elements[field_name]; if (!elm || elm.options == null || elm.selectedIndex == -1) return ""; return elm.options[elm.selectedIndex].value; } function getLinkListHTML(elm_id, target_form_element, onchange_func) { if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0) return ""; var html = ""; html += '<select id="' + elm_id + '" name="' + elm_id + '"'; html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value='; html += 'this.options[this.selectedIndex].value;'; if (typeof(onchange_func) != "undefined") html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);'; html += '"><option value="">---</option>'; for (var i=0; i<tinyMCELinkList.length; i++) html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>'; html += '</select>'; return html; // tinyMCE.debug('-- image list start --', html, '-- image list end --'); } function getTargetListHTML(elm_id, target_form_element) { var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); var html = ''; html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value='; html += 'this.options[this.selectedIndex].value;">'; html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>'; html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>'; html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>'; html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>'; for (var i=0; i<targets.length; i++) { var key, value; if (targets[i] == "") continue; key = targets[i].split('=')[0]; value = targets[i].split('=')[1]; html += '<option value="' + key + '">' + value + ' (' + key + ')</option>'; } html += '</select>'; return html; } // While loading preinit(); tinyMCEPopup.onInit.add(init);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advlink/js/advlink.js
advlink.js
tinyMCE.addI18n('ru.advimage_dlg',{ tab_general:"\u041E\u0431\u0449\u0435\u0435", tab_appearance:"\u0412\u0438\u0434", tab_advanced:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E", general:"\u041E\u0431\u0449\u0435\u0435", title:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", preview:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440", constrain_proportions:"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0442\u044C \u043F\u0440\u043E\u043F\u043E\u0440\u0446\u0438\u0438", langdir:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u044F\u0437\u044B\u043A\u0430", langcode:"\u041A\u043E\u0434 \u044F\u0437\u044B\u043A\u0430", long_desc:"Long description link", style:"\u0421\u0442\u0438\u043B\u044C", classes:"\u041A\u043B\u0430\u0441\u0441\u044B", ltr:"\u0421\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043E", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u043E", id:"Id", map:"Image map", swap_image:"Swap image", alt_image:"\u0410\u043B\u044C\u0442\u0435\u0440\u043D\u0430\u0442\u0438\u0432\u043D\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", mouseover:"\u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438", mouseout:"\u043F\u0440\u0438 \u043E\u0442\u0432\u043E\u0434\u0435", misc:"\u0414\u0440\u0443\u0433\u043E\u0435", example_img:"\u0412\u0438\u0434 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F", missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off", dialog_title:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C / \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", src:"\u0410\u0434\u0440\u0435\u0441 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F", alt:"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435", list:"\u0421\u043F\u0438\u0441\u043E\u043A \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439", border:"\u0413\u0440\u0430\u043D\u0438\u0446\u0430", dimensions:"\u0420\u0430\u0437\u043C\u0435\u0440\u044B", vspace:"\u0412\u0435\u0440\u0442. \u043E\u0442\u0441\u0442\u0443\u043F", hspace:"\u0413\u043E\u0440\u0438\u0437. \u043E\u0442\u0441\u0442\u0443\u043F", align:"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_baseline:"\u041F\u043E \u0431\u0430\u0437\u043E\u0432\u043E\u0439 \u043B\u0438\u043D\u0438\u0438", align_top:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", align_middle:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", align_bottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", align_texttop:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E \u0442\u0435\u043A\u0441\u0442\u0430", align_textbottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E \u0442\u0435\u043A\u0441\u0442\u0430", align_left:"\u041F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", image_list:"\u0421\u043F\u0438\u0441\u043E\u043A \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advimage/langs/ru_dlg.js
ru_dlg.js
var ImageDialog = { preInit : function() { var url; tinyMCEPopup.requireLangPack(); if (url = tinyMCEPopup.getParam("external_image_list_url")) document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); }, init : function(ed) { var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); tinyMCEPopup.resizeToInnerSize(); this.fillClassList('class_list'); this.fillFileList('src_list', 'tinyMCEImageList'); this.fillFileList('over_list', 'tinyMCEImageList'); this.fillFileList('out_list', 'tinyMCEImageList'); TinyMCE_EditableSelects.init(); if (n.nodeName == 'IMG') { nl.src.value = dom.getAttrib(n, 'src'); nl.width.value = dom.getAttrib(n, 'width'); nl.height.value = dom.getAttrib(n, 'height'); nl.alt.value = dom.getAttrib(n, 'alt'); nl.title.value = dom.getAttrib(n, 'title'); nl.vspace.value = this.getAttrib(n, 'vspace'); nl.hspace.value = this.getAttrib(n, 'hspace'); nl.border.value = this.getAttrib(n, 'border'); selectByValue(f, 'align', this.getAttrib(n, 'align')); selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); nl.style.value = dom.getAttrib(n, 'style'); nl.id.value = dom.getAttrib(n, 'id'); nl.dir.value = dom.getAttrib(n, 'dir'); nl.lang.value = dom.getAttrib(n, 'lang'); nl.usemap.value = dom.getAttrib(n, 'usemap'); nl.longdesc.value = dom.getAttrib(n, 'longdesc'); nl.insert.value = ed.getLang('update'); if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); if (ed.settings.inline_styles) { // Move attribs to styles if (dom.getAttrib(n, 'align')) this.updateStyle('align'); if (dom.getAttrib(n, 'hspace')) this.updateStyle('hspace'); if (dom.getAttrib(n, 'border')) this.updateStyle('border'); if (dom.getAttrib(n, 'vspace')) this.updateStyle('vspace'); } } // Setup browse button document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); if (isVisible('srcbrowser')) document.getElementById('src').style.width = '260px'; // Setup browse button document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); if (isVisible('overbrowser')) document.getElementById('onmouseoversrc').style.width = '260px'; // Setup browse button document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); if (isVisible('outbrowser')) document.getElementById('onmouseoutsrc').style.width = '260px'; // If option enabled default contrain proportions to checked if (ed.getParam("advimage_constrain_proportions", true)) f.constrain.checked = true; // Check swap image if valid data if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) this.setSwapImage(true); else this.setSwapImage(false); this.changeAppearance(); this.showPreviewImage(nl.src.value, 1); }, insert : function(file, title) { var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; if (f.src.value === '') { if (ed.selection.getNode().nodeName == 'IMG') { ed.dom.remove(ed.selection.getNode()); ed.execCommand('mceRepaint'); } tinyMCEPopup.close(); return; } if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { if (!f.alt.value) { tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { if (s) t.insertAndClose(); }); return; } } t.insertAndClose(); }, insertAndClose : function() { var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; tinyMCEPopup.restoreSelection(); // Fixes crash in Safari if (tinymce.isWebKit) ed.getWin().focus(); if (!ed.settings.inline_styles) { args = { vspace : nl.vspace.value, hspace : nl.hspace.value, border : nl.border.value, align : getSelectValue(f, 'align') }; } else { // Remove deprecated values args = { vspace : '', hspace : '', border : '', align : '' }; } tinymce.extend(args, { src : nl.src.value, width : nl.width.value, height : nl.height.value, alt : nl.alt.value, title : nl.title.value, 'class' : getSelectValue(f, 'class_list'), style : nl.style.value, id : nl.id.value, dir : nl.dir.value, lang : nl.lang.value, usemap : nl.usemap.value, longdesc : nl.longdesc.value }); args.onmouseover = args.onmouseout = ''; if (f.onmousemovecheck.checked) { if (nl.onmouseoversrc.value) args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; if (nl.onmouseoutsrc.value) args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; } el = ed.selection.getNode(); if (el && el.nodeName == 'IMG') { ed.dom.setAttribs(el, args); } else { ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1}); ed.dom.setAttribs('__mce_tmp', args); ed.dom.setAttrib('__mce_tmp', 'id', ''); ed.undoManager.add(); } tinyMCEPopup.close(); }, getAttrib : function(e, at) { var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; if (ed.settings.inline_styles) { switch (at) { case 'align': if (v = dom.getStyle(e, 'float')) return v; if (v = dom.getStyle(e, 'vertical-align')) return v; break; case 'hspace': v = dom.getStyle(e, 'margin-left') v2 = dom.getStyle(e, 'margin-right'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'vspace': v = dom.getStyle(e, 'margin-top') v2 = dom.getStyle(e, 'margin-bottom'); if (v && v == v2) return parseInt(v.replace(/[^0-9]/g, '')); break; case 'border': v = 0; tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { sv = dom.getStyle(e, 'border-' + sv + '-width'); // False or not the same as prev if (!sv || (sv != v && v !== 0)) { v = 0; return false; } if (sv) v = sv; }); if (v) return parseInt(v.replace(/[^0-9]/g, '')); break; } } if (v = dom.getAttrib(e, at)) return v; return ''; }, setSwapImage : function(st) { var f = document.forms[0]; f.onmousemovecheck.checked = st; setBrowserDisabled('overbrowser', !st); setBrowserDisabled('outbrowser', !st); if (f.over_list) f.over_list.disabled = !st; if (f.out_list) f.out_list.disabled = !st; f.onmouseoversrc.disabled = !st; f.onmouseoutsrc.disabled = !st; }, fillClassList : function(id) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { cl = []; tinymce.each(v.split(';'), function(v) { var p = v.split('='); cl.push({'title' : p[0], 'class' : p[1]}); }); } else cl = tinyMCEPopup.editor.dom.getClasses(); if (cl.length > 0) { lst.options.length = 0; lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); tinymce.each(cl, function(o) { lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); }); } else dom.remove(dom.getParent(id, 'tr')); }, fillFileList : function(id, l) { var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; l = window[l]; lst.options.length = 0; if (l && l.length > 0) { lst.options[lst.options.length] = new Option('', ''); tinymce.each(l, function(o) { lst.options[lst.options.length] = new Option(o[0], o[1]); }); } else dom.remove(dom.getParent(id, 'tr')); }, resetImageData : function() { var f = document.forms[0]; f.elements.width.value = f.elements.height.value = ''; }, updateImageData : function(img, st) { var f = document.forms[0]; if (!st) { f.elements.width.value = img.width; f.elements.height.value = img.height; } this.preloadImg = img; }, changeAppearance : function() { var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); if (img) { if (ed.getParam('inline_styles')) { ed.dom.setAttrib(img, 'style', f.style.value); } else { img.align = f.align.value; img.border = f.border.value; img.hspace = f.hspace.value; img.vspace = f.vspace.value; } } }, changeHeight : function() { var f = document.forms[0], tp, t = this; if (!f.constrain.checked || !t.preloadImg) { return; } if (f.width.value == "" || f.height.value == "") return; tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; f.height.value = tp.toFixed(0); }, changeWidth : function() { var f = document.forms[0], tp, t = this; if (!f.constrain.checked || !t.preloadImg) { return; } if (f.width.value == "" || f.height.value == "") return; tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; f.width.value = tp.toFixed(0); }, updateStyle : function(ty) { var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); if (tinyMCEPopup.editor.settings.inline_styles) { // Handle align if (ty == 'align') { dom.setStyle(img, 'float', ''); dom.setStyle(img, 'vertical-align', ''); v = getSelectValue(f, 'align'); if (v) { if (v == 'left' || v == 'right') dom.setStyle(img, 'float', v); else img.style.verticalAlign = v; } } // Handle border if (ty == 'border') { dom.setStyle(img, 'border', ''); v = f.border.value; if (v || v == '0') { if (v == '0') img.style.border = '0'; else img.style.border = v + 'px solid black'; } } // Handle hspace if (ty == 'hspace') { dom.setStyle(img, 'marginLeft', ''); dom.setStyle(img, 'marginRight', ''); v = f.hspace.value; if (v) { img.style.marginLeft = v + 'px'; img.style.marginRight = v + 'px'; } } // Handle vspace if (ty == 'vspace') { dom.setStyle(img, 'marginTop', ''); dom.setStyle(img, 'marginBottom', ''); v = f.vspace.value; if (v) { img.style.marginTop = v + 'px'; img.style.marginBottom = v + 'px'; } } // Merge dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); } }, changeMouseMove : function() { }, showPreviewImage : function(u, st) { if (!u) { tinyMCEPopup.dom.setHTML('prev', ''); return; } if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) this.resetImageData(); u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); if (!st) tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />'); else tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />'); } }; ImageDialog.preInit(); tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/advimage/js/image.js
image.js
(function(){var b=tinymce.each;function a(d,e){var f=e.ownerDocument,c=f.createRange(),g;c.setStartBefore(e);c.setEnd(d.endContainer,d.endOffset);g=f.createElement("body");g.appendChild(c.cloneContents());return g.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}tinymce.create("tinymce.plugins.TablePlugin",{init:function(c,d){var e=this;e.editor=c;e.url=d;b([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(f){c.addButton(f[0],{title:f[1],cmd:f[2],ui:f[3]})});if(c.getParam("inline_styles")){c.onPreProcess.add(function(f,h){var g=f.dom;b(g.select("table",h.node),function(j){var i;if(i=g.getAttrib(j,"width")){g.setStyle(j,"width",i);g.setAttrib(j,"width")}if(i=g.getAttrib(j,"height")){g.setStyle(j,"height",i);g.setAttrib(j,"height")}})})}c.onInit.add(function(){if(!tinymce.isIE&&c.getParam("forced_root_block")){function f(){var g=c.getBody().lastChild;if(g&&g.nodeName=="TABLE"){c.dom.add(c.getBody(),"p",null,'<br mce_bogus="1" />')}}if(tinymce.isGecko){c.onKeyDown.add(function(h,j){var g,i,k=h.dom;if(j.keyCode==37||j.keyCode==38){g=h.selection.getRng();i=k.getParent(g.startContainer,"table");if(i&&h.getBody().firstChild==i){if(a(g,i)){g=k.createRng();g.setStartBefore(i);g.setEndBefore(i);h.selection.setRng(g);j.preventDefault()}}}})}c.onKeyUp.add(f);c.onSetContent.add(f);c.onVisualAid.add(f);c.onPreProcess.add(function(g,i){var h=i.node.lastChild;if(h&&h.childNodes.length==1&&h.firstChild.nodeName=="BR"){g.dom.remove(h)}});f()}if(c&&c.plugins.contextmenu){c.plugins.contextmenu.onContextMenu.add(function(i,g,k){var l,j=c.selection,h=j.getNode()||c.getBody();if(c.dom.getParent(k,"td")||c.dom.getParent(k,"th")){g.removeAll();if(h.nodeName=="A"&&!c.dom.getAttrib(h,"name")){g.add({title:"advanced.link_desc",icon:"link",cmd:c.plugins.advlink?"mceAdvLink":"mceLink",ui:true});g.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});g.addSeparator()}if(h.nodeName=="IMG"&&h.className.indexOf("mceItem")==-1){g.add({title:"advanced.image_desc",icon:"image",cmd:c.plugins.advimage?"mceAdvImage":"mceImage",ui:true});g.addSeparator()}g.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true,value:{action:"insert"}});g.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable",ui:true});g.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete",ui:true});g.addSeparator();l=g.addMenu({title:"table.cell"});l.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps",ui:true});l.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells",ui:true});l.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells",ui:true});l=g.addMenu({title:"table.row"});l.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps",ui:true});l.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});l.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});l.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});l.addSeparator();l.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});l.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});l.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"});l.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"});l=g.addMenu({title:"table.col"});l.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});l.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});l.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{g.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true})}})}});c.onKeyDown.add(function(f,g){if(g.keyCode==9&&f.dom.getParent(f.selection.getNode(),"TABLE")){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(f.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(g)}f.undoManager.add()}});if(!tinymce.isIE){if(c.getParam("table_selection",true)){c.onClick.add(function(f,g){g=g.target;if(g.nodeName==="TABLE"){f.selection.select(g)}})}}c.onNodeChange.add(function(g,f,i){var h=g.dom.getParent(i,"td,th,caption");f.setActive("table",i.nodeName==="TABLE"||!!h);if(h&&h.nodeName==="CAPTION"){h=null}f.setDisabled("delete_table",!h);f.setDisabled("delete_col",!h);f.setDisabled("delete_table",!h);f.setDisabled("delete_row",!h);f.setDisabled("col_after",!h);f.setDisabled("col_before",!h);f.setDisabled("row_after",!h);f.setDisabled("row_before",!h);f.setDisabled("row_props",!h);f.setDisabled("cell_props",!h);f.setDisabled("split_cells",!h||(parseInt(g.dom.getAttrib(h,"colspan","1"))<2&&parseInt(g.dom.getAttrib(h,"rowspan","1"))<2));f.setDisabled("merge_cells",!h)});if(!tinymce.isIE){c.onBeforeSetContent.add(function(f,g){if(g.initial){g.content=g.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?"<$1$2>&nbsp;</$1>":'<$1$2><br mce_bogus="1" /></$1>')}})}},execCommand:function(f,e,g){var d=this.editor,c;switch(f){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":d.execCommand("mceBeginUndoLevel");this._doExecCommand(f,e,g);d.execCommand("mceEndUndoLevel");return true}return false},getInfo:function(){return{longname:"Tables",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_doExecCommand:function(s,aa,af){var W=this.editor,av=W,h=this.url;var o=W.selection.getNode();var X=W.dom.getParent(o,"tr");var ar=W.dom.getParent(o,"td,th");var G=W.dom.getParent(o,"table");var l=W.contentWindow.document;var aw=G?G.getAttribute("border"):"";if(X&&ar==null){ar=X.cells[0]}function aq(y,x){for(var ay=0;ay<y.length;ay++){if(y[ay].length>0&&aq(y[ay],x)){return true}if(y[ay]==x){return true}}return false}function ak(x,i){var y;ae=f(G);x=x||0;i=i||0;x=Math.max(p.cellindex+x,0);i=Math.max(p.rowindex+i,0);W.execCommand("mceRepaint");y=e(ae,i,x);if(y){W.selection.select(y.firstChild||y);W.selection.collapse(1)}}function ai(){var i=l.createElement("td");if(!tinymce.isIE){i.innerHTML='<br mce_bogus="1"/>'}}function k(y){var x=W.dom.getAttrib(y,"colspan");var i=W.dom.getAttrib(y,"rowspan");x=x==""?1:parseInt(x);i=i==""?1:parseInt(i);return{colspan:x,rowspan:i}}function am(ay,aA){var i,az;for(az=0;az<ay.length;az++){for(i=0;i<ay[az].length;i++){if(ay[az][i]==aA){return{cellindex:i,rowindex:az}}}}return null}function e(x,y,i){if(x[y]&&x[y][i]){return x[y][i]}return null}function B(aD,ay){var aA=[],y=0,aB,az,ay,aC;for(aB=0;aB<aD.rows.length;aB++){for(az=0;az<aD.rows[aB].cells.length;az++,y++){aA[y]=aD.rows[aB].cells[az]}}for(aB=0;aB<aA.length;aB++){if(aA[aB]==ay){if(aC=aA[aB+1]){return aC}}}}function f(aF){var i=[],aG=aF.rows,aD,aC,az,aA,aE,ay,aB;for(aC=0;aC<aG.length;aC++){for(aD=0;aD<aG[aC].cells.length;aD++){az=aG[aC].cells[aD];aA=k(az);for(aE=aD;i[aC]&&i[aC][aE];aE++){}for(aB=aC;aB<aC+aA.rowspan;aB++){if(!i[aB]){i[aB]=[]}for(ay=aE;ay<aE+aA.colspan;ay++){i[aB][ay]=az}}}}return i}function n(aH,aE,az,ay){var y=f(aH),aG=am(y,az);var aI,aD;if(ay.cells.length!=aE.childNodes.length){aI=aE.childNodes;aD=null;for(var aF=0;az=e(y,aG.rowindex,aF);aF++){var aB=true;var aC=k(az);if(aq(aI,az)){ay.childNodes[aF]._delete=true}else{if((aD==null||az!=aD)&&aC.colspan>1){for(var aA=aF;aA<aF+az.colSpan;aA++){ay.childNodes[aA]._delete=true}}}if((aD==null||az!=aD)&&aC.rowspan>1){az.rowSpan=aC.rowspan+1}aD=az}C(G)}}function P(x,i){while((x=x.previousSibling)!=null){if(x.nodeName==i){return x}}return null}function ag(ay,az){var x=az.split(",");while((ay=ay.nextSibling)!=null){for(var y=0;y<x.length;y++){if(ay.nodeName.toLowerCase()==x[y].toLowerCase()){return ay}}}return null}function C(ay){if(ay.rows==0){return}var y=ay.rows[0];do{var x=ag(y,"TR");if(y._delete){y.parentNode.removeChild(y);continue}var az=y.cells[0];if(az.cells>1){do{var i=ag(az,"TD,TH");if(az._delete){az.parentNode.removeChild(az)}}while((az=i)!=null)}}while((y=x)!=null)}function q(ay,aB,aA){ay.rowSpan=1;var x=ag(aB,"TR");for(var az=1;az<aA&&x;az++){var y=l.createElement("td");if(!tinymce.isIE){y.innerHTML='<br mce_bogus="1"/>'}if(tinymce.isIE){x.insertBefore(y,x.cells(ay.cellIndex))}else{x.insertBefore(y,x.cells[ay.cellIndex])}x=ag(x,"TR")}}function T(aG,aI,aC){var y=f(aI);var ay=aC.cloneNode(false);var aH=am(y,aC.cells[0]);var aD=null;var aB=W.dom.getAttrib(aI,"border");var aA=null;for(var aF=0;aA=e(y,aH.rowindex,aF);aF++){var aE=null;if(aD!=aA){for(var az=0;az<aC.cells.length;az++){if(aA==aC.cells[az]){aE=aA.cloneNode(true);break}}}if(aE==null){aE=aG.createElement("td");if(!tinymce.isIE){aE.innerHTML='<br mce_bogus="1"/>'}}aE.colSpan=1;aE.rowSpan=1;ay.appendChild(aE);aD=aA}return ay}switch(s){case"mceTableMoveToNextRow":var M=B(G,ar);if(!M){W.execCommand("mceTableInsertRowAfter",ar);M=B(G,ar)}W.selection.select(M);W.selection.collapse(true);return true;case"mceTableRowProps":if(X==null){return true}if(aa){W.windowManager.open({url:h+"/row.htm",width:400+parseInt(W.getLang("table.rowprops_delta_width",0)),height:295+parseInt(W.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})}return true;case"mceTableCellProps":if(ar==null){return true}if(aa){W.windowManager.open({url:h+"/cell.htm",width:400+parseInt(W.getLang("table.cellprops_delta_width",0)),height:295+parseInt(W.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}return true;case"mceInsertTable":if(aa){W.windowManager.open({url:h+"/table.htm",width:400+parseInt(W.getLang("table.table_delta_width",0)),height:320+parseInt(W.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:af?af.action:0})}return true;case"mceTableDelete":var H=W.dom.getParent(W.selection.getNode(),"table");if(H){H.parentNode.removeChild(H);W.execCommand("mceRepaint")}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!G){return true}if(X&&G!=X.parentNode){G=X.parentNode}if(G&&X){switch(s){case"mceTableCutRow":if(!X||!ar){return true}W.tableRowClipboard=T(l,G,X);W.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!X||!ar){return true}W.tableRowClipboard=T(l,G,X);break;case"mceTablePasteRowBefore":if(!X||!ar){return true}var w=W.tableRowClipboard.cloneNode(true);var j=P(X,"TR");if(j!=null){n(G,j,j.cells[0],w)}X.parentNode.insertBefore(w,X);break;case"mceTablePasteRowAfter":if(!X||!ar){return true}var Y=ag(X,"TR");var w=W.tableRowClipboard.cloneNode(true);n(G,X,ar,w);if(Y==null){X.parentNode.appendChild(w)}else{Y.parentNode.insertBefore(w,Y)}break;case"mceTableInsertRowBefore":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);var w=l.createElement("tr");var v=null;p.rowindex--;if(p.rowindex<0){p.rowindex=0}for(var ad=0;ar=e(ae,p.rowindex,ad);ad++){if(ar!=v){var F=k(ar);if(F.rowspan==1){var K=l.createElement("td");if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.colSpan=ar.colSpan;w.appendChild(K)}else{ar.rowSpan=F.rowspan+1}v=ar}}X.parentNode.insertBefore(w,X);ak(0,1);break;case"mceTableInsertRowAfter":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);var w=l.createElement("tr");var v=null;for(var ad=0;ar=e(ae,p.rowindex,ad);ad++){if(ar!=v){var F=k(ar);if(F.rowspan==1){var K=l.createElement("td");if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.colSpan=ar.colSpan;w.appendChild(K)}else{ar.rowSpan=F.rowspan+1}v=ar}}if(w.hasChildNodes()){var Y=ag(X,"TR");if(Y){Y.parentNode.insertBefore(w,Y)}else{G.appendChild(w)}}ak(0,1);break;case"mceTableDeleteRow":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);if(ae.length==1&&G.nodeName=="TBODY"){W.dom.remove(W.dom.getParent(G,"table"));return true}var E=X.cells;var Y=ag(X,"TR");for(var ad=0;ad<E.length;ad++){if(E[ad].rowSpan>1){var K=E[ad].cloneNode(true);var F=k(E[ad]);K.rowSpan=F.rowspan-1;var al=Y.cells[ad];if(al==null){Y.appendChild(K)}else{Y.insertBefore(K,al)}}}var v=null;for(var ad=0;ar=e(ae,p.rowindex,ad);ad++){if(ar!=v){var F=k(ar);if(F.rowspan>1){ar.rowSpan=F.rowspan-1}else{X=ar.parentNode;if(X.parentNode){X._delete=true}}v=ar}}C(G);ak(0,-1);break;case"mceTableInsertColBefore":if(!X||!ar){return true}var ae=f(W.dom.getParent(G,"table"));var p=am(ae,ar);var v=null;for(var ab=0;ar=e(ae,ab,p.cellindex);ab++){if(ar!=v){var F=k(ar);if(F.colspan==1){var K=l.createElement(ar.nodeName);if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.rowSpan=ar.rowSpan;ar.parentNode.insertBefore(K,ar)}else{ar.colSpan++}v=ar}}ak();break;case"mceTableInsertColAfter":if(!X||!ar){return true}var ae=f(W.dom.getParent(G,"table"));var p=am(ae,ar);var v=null;for(var ab=0;ar=e(ae,ab,p.cellindex);ab++){if(ar!=v){var F=k(ar);if(F.colspan==1){var K=l.createElement(ar.nodeName);if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.rowSpan=ar.rowSpan;var al=ag(ar,"TD,TH");if(al==null){ar.parentNode.appendChild(K)}else{al.parentNode.insertBefore(K,al)}}else{ar.colSpan++}v=ar}}ak(1);break;case"mceTableDeleteCol":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);var v=null;if((ae.length>1&&ae[0].length<=1)&&G.nodeName=="TBODY"){W.dom.remove(W.dom.getParent(G,"table"));return true}for(var ab=0;ar=e(ae,ab,p.cellindex);ab++){if(ar!=v){var F=k(ar);if(F.colspan>1){ar.colSpan=F.colspan-1}else{if(ar.parentNode){ar.parentNode.removeChild(ar)}}v=ar}}ak(-1);break;case"mceTableSplitCells":if(!X||!ar){return true}var m=k(ar);var D=m.colspan;var I=m.rowspan;if(D>1||I>1){ar.colSpan=1;for(var an=1;an<D;an++){var K=l.createElement("td");if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}X.insertBefore(K,ag(ar,"TD,TH"));if(I>1){q(K,X,I)}}q(ar,X,I)}G=W.dom.getParent(W.selection.getNode(),"table");break;case"mceTableMergeCells":var ap=[];var S=W.selection.getSel();var ae=f(G);if(tinymce.isIE||S.rangeCount==1){if(aa){var u=k(ar);W.windowManager.open({url:h+"/merge_cells.htm",width:240+parseInt(W.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(W.getLang("table.merge_cells_delta_height",0)),inline:1},{action:"update",numcols:u.colspan,numrows:u.rowspan,plugin_url:h});return true}else{var V=parseInt(af.numrows);var d=parseInt(af.numcols);var p=am(ae,ar);if((""+V)=="NaN"){V=1}if((""+d)=="NaN"){d=1}var c=G.rows;for(var ab=p.rowindex;ab<ae.length;ab++){var ah=[];for(var ad=p.cellindex;ad<ae[ab].length;ad++){var g=e(ae,ab,ad);if(g&&!aq(ap,g)&&!aq(ah,g)){var O=am(ae,g);if(O.cellindex<p.cellindex+d&&O.rowindex<p.rowindex+V){ah[ah.length]=g}}}if(ah.length>0){ap[ap.length]=ah}var g=e(ae,p.rowindex,p.cellindex);b(av.dom.select("br",g),function(y,x){if(x>0&&av.dom.getAttrib("mce_bogus")){av.dom.remove(y)}})}}}else{var E=[];var S=W.selection.getSel();var Z=null;var ao=null;var A=-1,ax=-1,z,au;if(S.rangeCount<2){return true}for(var an=0;an<S.rangeCount;an++){var aj=S.getRangeAt(an);var ar=aj.startContainer.childNodes[aj.startOffset];if(!ar){break}if(ar.nodeName=="TD"||ar.nodeName=="TH"){E[E.length]=ar}}var c=G.rows;for(var ab=0;ab<c.length;ab++){var ah=[];for(var ad=0;ad<c[ab].cells.length;ad++){var g=c[ab].cells[ad];for(var an=0;an<E.length;an++){if(g==E[an]){ah[ah.length]=g}}}if(ah.length>0){ap[ap.length]=ah}}var ao=[];var Z=null;for(var ab=0;ab<ae.length;ab++){for(var ad=0;ad<ae[ab].length;ad++){ae[ab][ad]._selected=false;for(var an=0;an<E.length;an++){if(ae[ab][ad]==E[an]){if(A==-1){A=ad;ax=ab}z=ad;au=ab;ae[ab][ad]._selected=true}}}}for(var ab=ax;ab<=au;ab++){for(var ad=A;ad<=z;ad++){if(!ae[ab][ad]._selected){alert("Invalid selection for merge.");return true}}}}var t=1,r=1;var U=-1;for(var ab=0;ab<ap.length;ab++){var J=0;for(var ad=0;ad<ap[ab].length;ad++){var F=k(ap[ab][ad]);J+=F.colspan;if(U!=-1&&F.rowspan!=U){alert("Invalid selection for merge.");return true}U=F.rowspan}if(J>r){r=J}U=-1}var R=-1;for(var ad=0;ad<ap[0].length;ad++){var N=0;for(var ab=0;ab<ap.length;ab++){var F=k(ap[ab][ad]);N+=F.rowspan;if(R!=-1&&F.colspan!=R){alert("Invalid selection for merge.");return true}R=F.colspan}if(N>t){t=N}R=-1}ar=ap[0][0];ar.rowSpan=t;ar.colSpan=r;for(var ab=0;ab<ap.length;ab++){for(var ad=0;ad<ap[ab].length;ad++){var Q=ap[ab][ad].innerHTML;var L=Q.replace(/[ \t\r\n]/g,"");if(L!="<br/>"&&L!="<br>"&&L!='<br mce_bogus="1"/>'&&(ad+ab>0)){ar.innerHTML+=Q}if(ap[ab][ad]!=ar&&!ap[ab][ad]._deleted){var p=am(ae,ap[ab][ad]);var at=ap[ab][ad].parentNode;at.removeChild(ap[ab][ad]);ap[ab][ad]._deleted=true;if(!at.hasChildNodes()){at.parentNode.removeChild(at);var ac=null;for(var ad=0;cellElm=e(ae,p.rowindex,ad);ad++){if(cellElm!=ac&&cellElm.rowSpan>1){cellElm.rowSpan--}ac=cellElm}if(ar.rowSpan>1){ar.rowSpan--}}}}}b(av.dom.select("br",ar),function(y,x){if(x>0&&av.dom.getAttrib(y,"mce_bogus")){av.dom.remove(y)}});break}G=W.dom.getParent(W.selection.getNode(),"table");W.addVisual(G);W.nodeChanged()}return true}return false}});tinymce.PluginManager.add("table",tinymce.plugins.TablePlugin)})();
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/editor_plugin.js
editor_plugin.js
tinyMCE.addI18n('ko.table_dlg',{ general_tab:"\uC77C\uBC18", advanced_tab:"\uACE0\uAE09", general_props:"\uC77C\uBC18 \uC124\uC815", advanced_props:"\uACE0\uAE09 \uC124\uC815", rowtype:"\uD589", title:"\uD14C\uC774\uBE14\uC758 \uC0BD\uC785/\uD3B8\uC9D1", width:"\uD3ED", height:"\uB192\uC774", cols:"\uB82C", rows:"\uD589", cellspacing:"\uC140 \uAC04\uACA9", cellpadding:"\uC140\uB0B4 \uC5EC\uBC31", border:"\uD14C\uB450\uB9AC\uC120", align:"\uC815\uB82C", align_default:"\uAE30\uBCF8\uAC12", align_left:"\uC67C\uCABD \uB9DE\uCDA4", align_right:"\uC624\uB978\uCABD \uB9DE\uCDA4", align_middle:"\uAC00\uC6B4\uB370 \uB9DE\uCDA4", row_title:"\uD589 \uC124\uC815", cell_title:"\uC140 \uC124\uC815", cell_type:"\uC140 \uC885\uB958", valign:"\uC218\uC9C1 \uC704\uCE58", align_top:"\uC0C1", align_bottom:"\uD558", bordercolor:"\uD14C\uB450\uB9AC\uC120\uC0C9", bgcolor:"\uBC30\uACBD\uC0C9", merge_cells_title:"\uC140 \uACB0\uD569", id:"Id", style:"\uC2A4\uD0C0\uC77C", langdir:"\uBB38\uC790 \uBC29\uD5A5", langcode:"\uC5B8\uC5B4 \uCF54\uB4DC", mime:"Target MIME \uD0C0\uC785", ltr:"\uC67C\uCABD\uC5D0\uC11C \uC624\uB978\uCABD", rtl:"\uC624\uB978\uCABD\uC5D0\uC11C \uC67C\uCABD", bgimage:"\uBC30\uACBD \uC774\uBBF8\uC9C0", summary:"\uC694\uC57D", td:"Data", th:"Header", cell_cell:"\uD604\uC7AC\uC758 \uC140\uC744 \uAC31\uC2E0", cell_row:"\uD589\uC758 \uC804\uC140\uC744 \uAC31\uC2E0", cell_all:"\uD14C\uC774\uBE14\uC758 \uBAA8\uB4E0 \uC140\uC744 \uAC31\uC2E0", row_row:"\uD604\uC7AC\uC758 \uD589\uC744 \uAC31\uC2E0", row_odd:"\uD640\uC218\uD589\uC744 \uAC31\uC2E0", row_even:"\uC9DD\uC218\uD589\uC744 \uAC31\uC2E0", row_all:"\uC804\uD589\uC744 \uAC31\uC2E0", thead:"Table Head", tbody:"Table Body", tfoot:"\uD14C\uC774\uBE14 \uD48B\uD130", scope:"Scope", rowgroup:"\uD589\uADF8\uB8F9", colgroup:"\uC5F4\uADF8\uB8F9", col_limit:"\uB82C\uC218\uC758 \uC0C1\uD55C{$cols}\uB97C \uB118\uC5C8\uC2B5\uB2C8\uB2E4.", row_limit:"\uD589\uC218\uC758 \uC0C1\uD55C{$rows}\uB97C \uB118\uC5C8\uC2B5\uB2C8\uB2E4.", cell_limit:"\uC140\uC218\uC758 \uC0C1\uD55C{$cells}\uB97C \uB118\uC5C8\uC2B5\uB2C8\uB2E4.", missing_scope:"\uC774 \uD45C \uD5E4\uB354\uC140\uC5D0 scope\uC18D\uC131\uC744 \uC9C0\uC815\uD558\uC9C0\uC54A\uC544\uB3C4 \uAD1C\uCC2E\uC2B5\uB2C8\uAE4C? \uC9C0\uC815\uD558\uC9C0 \uC54A\uB294 \uACBD\uC6B0, \uC2DC\uAC04\uC801\uC73C\uB85C \uD14C\uC774\uBE14\uC758 \uAD6C\uC870\uB97C \uD30C\uC545\uD558\uB294 \uAC83\uC774 \uC5B4\uB824\uC6B4 \uBD84\uC758 \uC811\uADFC\uC131\uC774 \uC800\uD558\uD569\uB2C8\uB2E4.", caption:"\uD45C\uC81C", frame:"Frame", frame_none:"\uC5C6\uC74C", frame_groups:"\uADF8\uB8F9", frame_rows:"\uD589", frame_cols:"\uC5F4", frame_all:"\uBAA8\uB450", rules:"Rules", rules_void:"Void", rules_above:"\uC704", rules_below:"\uC544\uB798", rules_hsides:"\uC0C1\uD558\uBC94\uC704\uB9CC", rules_lhs:"\uC88C\uCE21 \uBC94\uC704\uB9CC", rules_rhs:"\uC6B0\uCE21 \uBC94\uC704\uB9CC", rules_vsides:"\uC88C\uC6B0\uBC94\uC704\uB9CC", rules_box:"box", rules_border:"border" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/ko_dlg.js
ko_dlg.js
tinyMCE.addI18n('es.table_dlg',{ general_tab:"General", advanced_tab:"Avanzado", general_props:"Propiedades generales", advanced_props:"Propiedades avanzadas", rowtype:"Tipo de fila", title:"Insertar/Modificar tabla", width:"Ancho", height:"Alto", cols:"Cols", rows:"Filas", cellspacing:"Espaciado de celda", cellpadding:"Relleno de celda", border:"Borde", align:"Alineaci\u00F3n", align_default:"Predet.", align_left:"Izquierda", align_right:"Derecha", align_middle:"Centrado", row_title:"Propiedades de la fila", cell_title:"Propiedades de la celda", cell_type:"Tipo de celda", valign:"Alineaci\u00F3n vertical", align_top:"Arriba", align_bottom:"Debajo", bordercolor:"Color del borde", bgcolor:"Color de fondo", merge_cells_title:"Vincular celdas", id:"Id", style:"Estilo", langdir:"Direcci\u00F3n del lenguaje", langcode:"C\u00F3digo del lenguaje", mime:"Tipo MIME", ltr:"Izquierda a derecha", rtl:"Derecha a izquierda", bgimage:"Imagen de fondo", summary:"Resumen", td:"Datos", th:"Encabezado", cell_cell:"Actualizar celda actual", cell_row:"Actualizar todas las celdas en la fila", cell_all:"Actualizar todas las celdas en la tabla", row_row:"Actualizar fila actual", row_odd:"Actualizar filas impares", row_even:"Actualizar filas pares", row_all:"Actualizar todas las filas", thead:"Encabezado de la tabla", tbody:"Cuerpo de la tabla", tfoot:"Pie de la tabla", scope:"Alcance", rowgroup:"Grupo de filas", colgroup:"Grupo de columnas", col_limit:"Ha superado el n\u00FAmero m\u00E1ximo de columnas: {$cols}.", row_limit:"Ha superado el n\u00FAmero m\u00E1ximo de filas: {$rows}.", cell_limit:"Ha superado el n\u00FAmero m\u00E1ximo de celdas: {$cells}.", missing_scope:" \u00BFEst\u00E1 seguro que desea continuar sin especificar el alcance del encabezado de celda? Sin \u00E9l podr\u00EDa ser dificultoso para algunos usuarios entender el contenido o los datos mostrados en la tabla.", caption:"Subt\u00EDtulo de la tabla", frame:"Recuadro", frame_none:"ninguno", frame_groups:"grupos", frame_rows:"filas", frame_cols:"cols", frame_all:"todos", rules:"Reglas", rules_void:"vac\u00EDo", rules_above:"encima", rules_below:"debajo", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/es_dlg.js
es_dlg.js
tinyMCE.addI18n('fr.table_dlg',{ general_tab:"G\u00E9n\u00E9ral", advanced_tab:"Avanc\u00E9", general_props:"Propri\u00E9t\u00E9s g\u00E9n\u00E9rales", advanced_props:"Propri\u00E9t\u00E9s avanc\u00E9es", rowtype:"Type de ligne", title:"Ins\u00E9rer / modifier un tableau", width:"Largeur", height:"Hauteur", cols:"Colonnes", rows:"Lignes", cellspacing:"Espacement entre les cellules", cellpadding:"Espacement dans les cellules", border:"Bordure", align:"Alignement", align_default:"Par d\u00E9faut", align_left:"Gauche", align_right:"Droite", align_middle:"Centr\u00E9", row_title:"Propri\u00E9t\u00E9s de la ligne", cell_title:"Propri\u00E9t\u00E9s de la cellule", cell_type:"Type de cellule", valign:"Alignement vertical", align_top:"Haut", align_bottom:"Bas", bordercolor:"Couleur de la bordure", bgcolor:"Couleur du fond", merge_cells_title:"Fusionner les cellules", id:"Id", style:"Style", langdir:"Sens de lecture", langcode:"Code de la langue", mime:"Type MIME de la cible", ltr:"De gauche \u00E0 droite", rtl:"de droite \u00E0 gauche", bgimage:"Image de fond", summary:"R\u00E9sum\u00E9", td:"Donn\u00E9es", th:"Titre", cell_cell:"Mettre \u00E0 jour la cellule courante", cell_row:"Mettre \u00E0 jour toutes les cellules de la ligne", cell_all:"Mettre \u00E0 jour toutes les cellules du tableau", row_row:"Mettre \u00E0 jour la ligne courante", row_odd:"Mettre \u00E0 jour les lignes impaires", row_even:"Mettre \u00E0 jour les lignes paires", row_all:"Mettre \u00E0 jour toutes les lignes du tableau", thead:"En-t\u00EAtes de tableau", tbody:"Corps de tableau", tfoot:"Pied de tableau", scope:"Port\u00E9e", rowgroup:"Groupe de lignes", colgroup:"Groupe de colonnes", col_limit:"Vous avez d\u00E9pass\u00E9 le nombre maximum de colonnes ({$cols}).", row_limit:"Vous avez d\u00E9pass\u00E9 le nombre maximum de lignes ({$rows}).", cell_limit:"Vous avez d\u00E9pass\u00E9 le nombre maximum de cellules ({$cells}).", missing_scope:"Souhaitez-vous vraiment continuer sans sp\u00E9cifier de port\u00E9e pour cette cellule de titre ? Sans port\u00E9e, cela peut \u00EAtre difficile pour certains usagers \u00E0 probl\u00E8mes de comprendre le contenu ou les donn\u00E9es affich\u00E9es dans le tableau.", caption:"Afficher la l\u00E9gende du tableau", frame:"Cadre", frame_none:"aucun", frame_groups:"groupe", frame_rows:"lignes", frame_cols:"colonnes", frame_all:"tous", rules:"R\u00E8gles", rules_void:"aucune", rules_above:"au-dessus", rules_below:"au-dessous", rules_hsides:"horizontales", rules_lhs:"\u00E0 gauche", rules_rhs:"\u00E0 droite", rules_vsides:"verticales", rules_box:"bo\u00EEte", rules_border:"bordure" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/fr_dlg.js
fr_dlg.js
tinyMCE.addI18n('de.table_dlg',{ general_tab:"Allgemein", advanced_tab:"Erweitert", general_props:"Allgemeine Einstellungen", advanced_props:"Erweiterte Einstellungen", rowtype:"Gruppierung", title:"Tabelle einf\u00FCgen/bearbeiten", width:"Breite", height:"H\u00F6he", cols:"Spalten", rows:"Zeilen", cellspacing:"Zellenabstand", cellpadding:"Abstand innerhalb der Zellen", border:"Rahmen", align:"Ausrichtung", align_default:"Standard", align_left:"Links", align_right:"Rechts", align_middle:"Mittig", row_title:"Eigenschaften der Zeile", cell_title:"Eigenschaften der Zelle", cell_type:"Zellentyp", valign:"Vertikale Ausrichtung", align_top:"Oben", align_bottom:"Unten", bordercolor:"Rahmenfarbe", bgcolor:"Hintergrundfarbe", merge_cells_title:"Zellen vereinen", id:"ID", style:"Format", langdir:"Schriftrichtung", langcode:"Sprachcode", mime:"MIME-Type des Inhalts", ltr:"Links nach rechts", rtl:"Rechts nach links", bgimage:"Hintergrundbild", summary:"Zusammenfassung", td:"Textzelle", th:"\u00DCberschrift", cell_cell:"Diese Zelle ver\u00E4ndern", cell_row:"Alle Zellen in dieser Zeile ver\u00E4ndern", cell_all:"Alle Zellen der Tabelle ver\u00E4ndern", row_row:"Diese Zeile ver\u00E4ndern", row_odd:"Ungerade Zeilen ver\u00E4ndern", row_even:"Gerade Zeilen ver\u00E4ndern", row_all:"Alle Zeilen ver\u00E4ndern", thead:"Tabellenkopf", tbody:"Tabelleninhalt", tfoot:"Tabellenfu\u00DF", scope:"Bezug", rowgroup:"Vertikal gruppieren", colgroup:"Horizontal gruppieren", col_limit:"Sie haben die maximale Spaltenzahl von {$cols} \u00FCberschritten.", row_limit:"Sie haben die maximale Zeilenzahl von {$rows} \u00FCberschritten.", cell_limit:"Sie haben die maximale Zellenzahl von {$cells} \u00FCberschritten.", missing_scope:"Wollen Sie wirklich keine Beziehung f\u00FCr diese \u00DCberschrift angeben? Benutzer mit k\u00F6rperlichen Einschr\u00E4nkungen k\u00F6nnten Schwierigkeiten haben, den Inhalt der Tabelle zu verstehen.", caption:"Beschriftung der Tabelle", frame:"Rahmen", frame_none:"keine", frame_groups:"zwischen Gruppen", frame_rows:"zwischen Zeilen", frame_cols:"zwischen Spalten", frame_all:"zwischen allen Zellen", rules:"Gitter", rules_void:"keins", rules_above:"nur oben", rules_below:"nur unten", rules_hsides:"oben und unten", rules_lhs:"nur links", rules_rhs:"nur rechts", rules_vsides:"links und rechts", rules_box:"alle 4 Seiten (Box)", rules_border:"alle 4 Seiten (Border)" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/de_dlg.js
de_dlg.js
tinyMCE.addI18n('ia.table_dlg',{ general_tab:"\u57FA\u672C", advanced_tab:"\u9AD8\u7EA7", general_props:"\u57FA\u672C \u5C5E\u6027", advanced_props:"\u9AD8\u7EA7\u5C5E\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7F16\u8F91 \u8868\u683C", width:"\u5BBD\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6570", rows:"\u884C\u6570", cellspacing:"\u50A8\u5B58\u683C\u95F4\u8DDD", cellpadding:"\u50A8\u5B58\u683C\u5185\u8DDD", border:"\u8FB9\u6846", align:"\u5BF9\u9F50\u65B9\u5F0F", align_default:"\u9ED8\u8BA4", align_left:"\u5C45\u5DE6", align_right:"\u5C45\u53F3", align_middle:"\u5C45\u4E2D", row_title:"\u884C \u5C5E\u6027", cell_title:"\u50A8\u5B58\u683C \u5C5E\u6027", cell_type:"\u50A8\u5B58\u683C \u7C7B\u522B", valign:"\u5782\u76F4\u5BF9\u9F50\u65B9\u5F0F", align_top:"\u9876\u90E8", align_bottom:"\u5E95\u90E8", bordercolor:"\u8FB9\u6846\u989C\u8272", bgcolor:"\u80CC\u666F\u989C\u8272", merge_cells_title:"\u5408\u5E76\u50A8\u5B58\u683C", id:"Id", style:"\u6837\u5F0F", langdir:"\u8BED\u8A00\u4E66\u5199\u65B9\u5411", langcode:"\u8BED\u8A00\u7F16\u7801", mime:"\u76EE\u6807 MIME \u7C7B\u578B", ltr:"\u4ECE\u5DE6\u5230\u53F3", rtl:"\u4ECE\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u56FE\u7247", summary:"\u6458\u8981", td:"\u8868\u683C", th:"\u8868\u5934", cell_cell:"\u66F4\u65B0\u76EE\u524D\u7684\u50A8\u5B58\u683C", cell_row:"\u66F4\u65B0\u5F53\u524D\u884C\u7684\u50A8\u5B58\u683C", cell_all:"\u66F4\u65B0\u5168\u90E8\u50A8\u5B58\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u7684\u5947\u6570\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u7684\u5076\u6570\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u7684\u5168\u90E8\u884C", thead:"\u8868\u5934", tbody:"\u8868\u4F53", tfoot:"\u8868\u811A", scope:"\u8303\u56F4", rowgroup:"\u884C\u7EC4", colgroup:"\u5217\u7EC4", col_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A {$cols} \u5217\u3002", row_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A {$rows} \u884C\u3002", cell_limit:"\u5DF2\u8D85\u8FC7\u9650\u5236\uFF0C\u6700\u591A\u4E3A{$cells} \u50A8\u5B58\u683C\u3002", missing_scope:"\u60A8\u786E\u5B9A\u4E0D\u6307\u5B9A\u8868\u5934\u50A8\u5B58\u683C\u7684\u8303\u56F4\u5417\uFF1F\u5982\u679C\u4E0D\u6307\u5B9A\uFF0C\u90E8\u5206\u4F7F\u7528\u8005\u5C06\u5F88\u96BE\u67E5\u770B\u8868\u683C\u5185\u5BB9", caption:"\u8868\u683C\u6807\u9898", frame:"\u8FB9\u6846", frame_none:"\u65E0", frame_groups:"\u7EC4", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u6807\u5C3A", rules_void:"\u7A7A", rules_above:"\u4E4B\u4E0A", rules_below:"\u4E4B\u4E0B", rules_hsides:"\u6C34\u5E73\u5927\u5C0F", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"\u5782\u76F4\u5927\u5C0F", rules_box:"\u76D2", rules_border:"\u8FB9\u6846" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/ia_dlg.js
ia_dlg.js
tinyMCE.addI18n('zh.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u9AD8\u7D1A", general_props:"\u4E00\u822C\u5C6C\u6027", advanced_props:"\u9AD8\u7D1A\u5C6C\u6027", rowtype:"\u884C\u6240\u5728\u7684\u8868\u683C\u4F4D\u7F6E", title:"\u63D2\u5165/\u7DE8\u8F2F\u8868\u683C", width:"\u5BEC\u5EA6", height:"\u9AD8\u5EA6", cols:"\u5217\u6578", rows:"\u884C\u6578", cellspacing:"\u55AE\u5143\u683C\u908A\u8DDD", cellpadding:"\u55AE\u5143\u683C\u9593\u8DDD", border:"\u908A\u6846", align:"\u5C0D\u9F4A\u65B9\u5F0F", align_default:"\u9810\u8A2D", align_left:"\u9760\u5DE6", align_right:"\u9760\u53F3", align_middle:"\u7F6E\u4E2D", row_title:"\u884C\u5C6C\u6027", cell_title:"\u55AE\u5143\u683C\u5C6C\u6027", cell_type:"\u55AE\u5143\u683C\u985E\u578B", valign:"\u6C34\u5E73\u5C0D\u9F4A\u65B9\u5F0F", align_top:"\u9760\u4E0A", align_bottom:"\u9760\u4E0B", bordercolor:"\u908A\u6846\u984F\u8272", bgcolor:"\u80CC\u666F\u984F\u8272", merge_cells_title:"\u5408\u4F75\u55AE\u5143\u683C", id:"Id", style:"\u6A23\u5F0F", langdir:"\u66F8\u5BEB\u65B9\u5411", langcode:"\u8A9E\u8A00\u7DE8\u78BC", mime:"\u76EE\u6A19MIME\u985E\u578B", ltr:"\u7531\u5DE6\u5230\u53F3", rtl:"\u7531\u53F3\u5230\u5DE6", bgimage:"\u80CC\u666F\u5716\u7247", summary:"\u6982\u8981", td:"\u55AE\u5143\u683C", th:"\u8868\u982D", cell_cell:"\u66F4\u65B0\u6240\u5728\u7684\u55AE\u5143\u683C", cell_row:"\u66F4\u65B0\u6240\u5728\u884C\u7684\u5168\u90E8\u55AE\u5143\u683C", cell_all:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5168\u90E8\u55AE\u5143\u683C", row_row:"\u66F4\u65B0\u6240\u5728\u884C", row_odd:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5947\u6578\u884C", row_even:"\u66F4\u65B0\u8868\u683C\u5167\u7684\u5076\u6578\u884C", row_all:"\u66F4\u65B0\u8868\u683C\u5167\u5168\u90E8\u884C", thead:"\u8868\u982D", tbody:"\u8868\u8EAB", tfoot:"\u8868\u5C3E", scope:"\u7BC4\u570D", rowgroup:"\u884C\u7FA4\u7D44", colgroup:"\u5217\u7FA4\u7D44", col_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u5217\u6578\u70BA{$cols}\u5217\u3002", row_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u884C\u6578\u70BA{$rows}\u884C\u3002", cell_limit:"\u5DF2\u8D85\u904E\u9650\u5236\uFF0C\u6700\u9AD8\u7684\u55AE\u5143\u683C\u6578\u70BA{$cells}\u683C\u3002", missing_scope:"\u6A19\u984C\u6B04\u907A\u5931\uFF01", caption:"\u8868\u683C\u6279\u6CE8", frame:"\u908A\u6846", frame_none:"\u7121", frame_groups:"\u7FA4\u7D44", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u90E8", rules:"\u7DDA\u689D", rules_void:"\u7A7A", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u6C34\u5E73\u908A", rules_lhs:"\u5DE6\u908A", rules_rhs:"\u53F3\u908A", rules_vsides:"\u5782\u76F4\u908A", rules_box:"\u65B9\u6846", rules_border:"\u5916\u6846" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/zh_dlg.js
zh_dlg.js
tinyMCE.addI18n('en.table_dlg',{ general_tab:"General", advanced_tab:"Advanced", general_props:"General properties", advanced_props:"Advanced properties", rowtype:"Row in table part", title:"Insert/Modify table", width:"Width", height:"Height", cols:"Cols", rows:"Rows", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"Border", align:"Alignment", align_default:"Default", align_left:"Left", align_right:"Right", align_middle:"Center", row_title:"Table row properties", cell_title:"Table cell properties", cell_type:"Cell type", valign:"Vertical alignment", align_top:"Top", align_bottom:"Bottom", bordercolor:"Border color", bgcolor:"Background color", merge_cells_title:"Merge table cells", id:"Id", style:"Style", langdir:"Language direction", langcode:"Language code", mime:"Target MIME type", ltr:"Left to right", rtl:"Right to left", bgimage:"Background image", summary:"Summary", td:"Data", th:"Header", cell_cell:"Update current cell", cell_row:"Update all cells in row", cell_all:"Update all cells in table", row_row:"Update current row", row_odd:"Update odd rows in table", row_even:"Update even rows in table", row_all:"Update all rows in table", thead:"Table Head", tbody:"Table Body", tfoot:"Table Foot", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of {$cols}.", row_limit:"You've exceeded the maximum number of rows of {$rows}.", cell_limit:"You've exceeded the maximum number of cells of {$cells}.", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", caption:"Table caption", frame:"Frame", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/en_dlg.js
en_dlg.js
tinyMCE.addI18n('ca.table_dlg',{ general_tab:"General", advanced_tab:"Avan\u00E7at", general_props:"Propietats generals", advanced_props:"Propietats avan\u00E7ades", rowtype:"Fila", title:"Insereix/Modifica taula", width:"Amplada", height:"Al\u00E7ada", cols:"Columnes", rows:"Files", cellspacing:"Espaiat de cel\u00B7la", cellpadding:"Separaci\u00F3 de cel\u00B7la", border:"Vora", align:"Alineaci\u00F3", align_default:"Per defecte", align_left:"Esquerra", align_right:"Dreta", align_middle:"Centre", row_title:"Propietats de fila", cell_title:"Propietats de cel\u00B7la", cell_type:"Tipus de cel\u00B7la", valign:"Alineaci\u00F3 vertical", align_top:"A dalt", align_bottom:"A baix", bordercolor:"Color de vora", bgcolor:"Color de fons", merge_cells_title:"Fusiona cel\u00B7les", id:"Id", style:"Estil", langdir:"Direcci\u00F3 de l\'idioma", langcode:"Codi de l\'idioma", mime:"Tipus MIME", ltr:"D\'esquerra a dreta", rtl:"De dreta a esquerra", bgimage:"Imatge de fons", summary:"Resum", td:"Dades", th:"Cap\u00E7alera", cell_cell:"Actualitza la cel\u00B7la", cell_row:"Actualitza totes les cel\u00B7les de la fila", cell_all:"Actualitza totes les cel\u00B7les de la taula", row_row:"Actualitza la fila", row_odd:"Actualitza les files senars", row_even:"Actualitza les files parells", row_all:"Actualitza totes les files", thead:"Cap\u00E7alera de la taula", tbody:"Cos de la taula", tfoot:"Peu de la taula", scope:"Abast", rowgroup:"Grup de files", colgroup:"Grup de columnes", col_limit:"Heu superat el nombre m\u00E0xim de columnes de {$cols}.", row_limit:"Heu superat el nombre m\u00E0xim de files de {$rows}.", cell_limit:"Heu superat el nombre m\u00E0xim de cel\u00B7les de {$cells}..", missing_scope:"Esteu segur que voleu continuar sense indicar un abast per a aquesta cel\u00B7la de cap\u00E7alera. Pot ser dif\u00EDcil per a alguns usuaris amb discapacitats entendre el contingut o les dades mostrades a la taula.", caption:"T\u00EDtol de la taula", frame:"Marc", frame_none:"cap", frame_groups:"grups", frame_rows:"files", frame_cols:"columnes", frame_all:"tot", rules:"Regles", rules_void:"buit", rules_above:"per damunt de", rules_below:"per sota de", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"quadre", rules_border:"vora" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/ca_dlg.js
ca_dlg.js
tinyMCE.addI18n('ru.table_dlg',{ general_tab:"\u041E\u0431\u0449\u0435\u0435", advanced_tab:"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E", general_props:"\u041E\u0431\u0449\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", advanced_props:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430", rowtype:"Row in table part", title:"\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 / \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", width:"\u0428\u0438\u0440\u0438\u043D\u0430", height:"\u0412\u044B\u0441\u043E\u0442\u0430", cols:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B", rows:"\u0421\u0440\u043E\u043A\u0438", cellspacing:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043C\u0435\u0436\u0434\u0443 \u044F\u0447\u0435\u0439\u043A\u0430\u043C\u0438", cellpadding:"\u041E\u0442\u0441\u0442\u0443\u043F\u044B \u0432 \u044F\u0447\u0435\u0439\u043A\u0430\u0445", border:"\u0413\u0440\u0430\u043D\u0438\u0446\u0430", align:"\u0412\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_default:"\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E", align_left:"\u041F\u043E \u043B\u0435\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_right:"\u041F\u043E \u043F\u0440\u0430\u0432\u043E\u043C\u0443 \u043A\u0440\u0430\u044E", align_middle:"\u041F\u043E \u0446\u0435\u043D\u0442\u0440\u0443", row_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043E\u043A\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_title:"\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u044F\u0447\u0435\u0439\u043A\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u044B", cell_type:"\u0422\u0438\u043F \u044F\u0447\u0435\u0439\u043A\u0438", valign:"\u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0435 \u0432\u044B\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u043D\u0438\u0435", align_top:"\u041F\u043E \u0432\u0435\u0440\u0445\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", align_bottom:"\u041F\u043E \u043D\u0438\u0436\u043D\u0435\u043C\u0443 \u043A\u0440\u0430\u044E", bordercolor:"\u0446\u0432\u0435\u0442 \u0433\u0440\u0430\u043D\u0438\u0446\u044B", bgcolor:"\u0446\u0432\u0435\u0442 \u0444\u043E\u043D\u0430", merge_cells_title:"\u041E\u0431\u044A\u0435\u0434\u0438\u043D\u0438\u0442\u044C \u044F\u0447\u0435\u0439\u043A\u0438", id:"Id", style:"\u0421\u0442\u0438\u043B\u044C", langdir:"\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u044F\u0437\u044B\u043A\u0430", langcode:"\u041A\u043E\u0434 \u044F\u0437\u044B\u043A\u0430", mime:"Target MIME-\u0442\u0438\u043F", ltr:"\u0421\u043B\u0435\u0432\u0430 \u043D\u0430\u043F\u0440\u0430\u0432\u043E", rtl:"\u0421\u043F\u0440\u0430\u0432\u0430 \u043D\u0430\u043B\u0435\u0432\u043E", bgimage:"\u0424\u043E\u043D\u043E\u0432\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435", summary:"\u041E\u0431\u0449\u0435\u0435", td:"\u0414\u0430\u043D\u043D\u044B\u0435", th:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A", cell_cell:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u044F\u0447\u0435\u0439\u043A\u0443", cell_row:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u044F\u0447\u0435\u0439\u043A\u0438 \u0432 \u0441\u0442\u0440\u043E\u043A\u0435", cell_all:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u044F\u0447\u0435\u0439\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_row:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443", row_odd:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u0447\u0435\u0442\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_even:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0447\u0435\u0442\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", row_all:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0441\u0442\u0440\u043E\u043A\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435", thead:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0442\u0430\u0431\u043B\u0438\u0446\u044B", tbody:"\u0422\u0435\u043B\u043E \u0442\u0430\u0431\u043B\u0438\u0446\u044B", tfoot:"\u041D\u0438\u0436\u043D\u044F\u044F \u0447\u0430\u0441\u0442\u0441\u0438\u043D\u0430", scope:"Scope", rowgroup:"Row Group", colgroup:"Col Group", col_limit:"You've exceeded the maximum number of columns of ($ cols)", row_limit:"You've exceeded the maximum number of rows of ($ rows)", cell_limit:"You've exceeded the maximum number of cells of ($ cells)", missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table", caption:"Table caption", frame:"\u0424\u0440\u0435\u0439\u043C", frame_none:"none", frame_groups:"groups", frame_rows:"rows", frame_cols:"cols", frame_all:"all", rules:"Rules", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/ru_dlg.js
ru_dlg.js
tinyMCE.addI18n('ja.table_dlg',{ general_tab:"\u4E00\u822C", advanced_tab:"\u4E0A\u7D1A\u8005\u5411\u3051", general_props:"\u4E00\u822C", advanced_props:"\u4E0A\u7D1A\u8005\u5411\u3051", rowtype:"\u884C", title:"\u8868\u306E\u633F\u5165/\u7DE8\u96C6", width:"\u5E45", height:"\u9AD8\u3055", cols:"\u5217", rows:"\u884C", cellspacing:"Cellspacing", cellpadding:"Cellpadding", border:"\u67A0\u7DDA", align:"\u914D\u7F6E", align_default:"\u30C7\u30D5\u30A9\u30EB\u30C8", align_left:"\u5DE6\u63C3\u3048", align_right:"\u53F3\u63C3\u3048", align_middle:"\u4E2D\u592E\u63C3\u3048", row_title:"\u884C\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", cell_title:"\u30BB\u30EB\u306E\u30D7\u30ED\u30D1\u30C6\u30A3", cell_type:"\u30BB\u30EB\u7A2E\u5225", valign:"\u5782\u76F4\u65B9\u5411\u306E\u914D\u7F6E", align_top:"\u4E0A\u63C3\u3048", align_bottom:"\u4E0B\u63C3\u3048", bordercolor:"\u67A0\u7DDA\u306E\u8272", bgcolor:"\u80CC\u666F\u8272", merge_cells_title:"\u30BB\u30EB\u306E\u7D50\u5408", id:"ID", style:"\u30B9\u30BF\u30A4\u30EB", langdir:"\u6587\u7AE0\u306E\u65B9\u5411", langcode:"\u8A00\u8A9E\u30B3\u30FC\u30C9", mime:"\u30BF\u30FC\u30B2\u30C3\u30C8\u306EMIME\u30BF\u30A4\u30D7", ltr:"\u5DE6\u304B\u3089\u53F3", rtl:"\u53F3\u304B\u3089\u5DE6", bgimage:"\u80CC\u666F\u753B\u50CF", summary:"\u30B5\u30DE\u30EA\u30FC", td:"\u65E5\u4ED8", th:"\u30D8\u30C3\u30C0", cell_cell:"\u9078\u629E\u30BB\u30EB\u306E\u66F4\u65B0", cell_row:"\u884C\u5185\u306E\u30BB\u30EB\u306E\u66F4\u65B0", cell_all:"\u5168\u3066\u306E\u30BB\u30EB\u306E\u66F4\u65B0", row_row:"\u9078\u629E\u884C\u306E\u66F4\u65B0", row_odd:"\u5947\u6570\u884C\u306E\u66F4\u65B0", row_even:"\u5076\u6570\u884C\u306E\u66F4\u65B0", row_all:"\u5168\u3066\u306E\u884C\u306E\u66F4\u65B0", thead:"\u8868\u30D8\u30C3\u30C0", tbody:"\u8868\u30DC\u30C7\u30A3", tfoot:"\u8868\u30D5\u30C3\u30BF", scope:"\u30B9\u30B3\u30FC\u30D7", rowgroup:"\u884C\u30B0\u30EB\u30FC\u30D7", colgroup:"\u5217\u30B0\u30EB\u30FC\u30D7", col_limit:"\u5217\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002", row_limit:"\u884C\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002", cell_limit:"\u30BB\u30EB\u306E\u6700\u5927\u6570\u3092\u8D85\u3048\u307E\u3057\u305F\u3002", missing_scope:"\u8868\u306E\u30B9\u30B3\u30FC\u30D7\u5C5E\u6027\u3092\u8A2D\u5B9A\u3057\u3066\u3044\u307E\u305B\u3093\u304C\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F", caption:"\u8868\u306B\u898B\u51FA\u3057\u3092\u4ED8\u3051\u308B", frame:"\u30BB\u30EB\u67A0\u7DDA", frame_none:"\u306A\u3057", frame_groups:"\u30B0\u30EB\u30FC\u30D7\u6BCE", frame_rows:"\u884C", frame_cols:"\u5217", frame_all:"\u5168\u3066", rules:"\u8868\u306E\u5916\u67A0", rules_void:"\u306A\u3057", rules_above:"\u4E0A", rules_below:"\u4E0B", rules_hsides:"\u4E0A\u4E0B", rules_lhs:"\u5DE6", rules_rhs:"\u53F3", rules_vsides:"\u5DE6\u53F3", rules_box:"\u4E0A\u4E0B\u5DE6\u53F3(box)", rules_border:"\u4E0A\u4E0B\u5DE6\u53F3(border)" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/ja_dlg.js
ja_dlg.js
tinyMCE.addI18n('it.table_dlg',{ general_tab:"Generale", advanced_tab:"Avanzate", general_props:"Propriet\u00E0 generali", advanced_props:"Propriet\u00E0 avanzate", rowtype:"Riga in una parte di tabella", title:"Inserisci/Modifica tabella", width:"Larghezza", height:"Altezza", cols:"Colonne", rows:"Righe", cellspacing:"Spaziatura celle", cellpadding:"Padding celle", border:"Bordo", align:"Allineamento", align_default:"Predefinito", align_left:"A sinistra", align_right:"A destra", align_middle:"Centra", row_title:"Propriet\u00E0 riga", cell_title:"Propriet\u00E0 cella", cell_type:"Tipo cella", valign:"Allineamento verticale", align_top:"In alto", align_bottom:"In basso", bordercolor:"Colore bordo", bgcolor:"Colore sfondo", merge_cells_title:"Unisci celle", id:"Id", style:"Stile", langdir:"Direzione testo", langcode:"Lingua", mime:"Tipo MIME del target", ltr:"Sinistra verso destra", rtl:"Destra verso sinistra", bgimage:"Immagine sfondo", summary:"Sommario", td:"Data", th:"Intestazione", cell_cell:"Aggiorna cella corrente", cell_row:"Aggiorna tutte le celle della riga", cell_all:"Aggiorna tutte le celle della tabella", row_row:"Aggiorna riga corrente", row_odd:"Aggiorna righe dispari della tabella", row_even:"Aggiorna righe pari della tabella", row_all:"Update tutte le righe della tabella", thead:"Intestazione tabella", tbody:"Corpo tabella", tfoot:"Pedice tabella", scope:"Scope", rowgroup:"Gruppo riga", colgroup:"Gruppo colonna", col_limit:"Superato il numero massimo di colonne di {$cols}.", row_limit:"Superato il numero massimo di righe di {$rows}.", cell_limit:"Superato il numero massimo di celle di {$cells}.", missing_scope:"Sicuro di proseguire senza aver specificato uno scope per l'intestazione di questa tabella? Senza di esso, potrebbe essere difficoltoso per alcuni utenti con disabilit\u00E0 capire il contenuto o i dati mostrati nella tabella.", caption:"Table caption", frame:"Cornice", frame_none:"nessuna", frame_groups:"gruppi", frame_rows:"righe", frame_cols:"colonne", frame_all:"tutte", rules:"Regole", rules_void:"void", rules_above:"above", rules_below:"below", rules_hsides:"hsides", rules_lhs:"lhs", rules_rhs:"rhs", rules_vsides:"vsides", rules_box:"box", rules_border:"border" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/langs/it_dlg.js
it_dlg.js
tinyMCEPopup.requireLangPack(); var ed; function init() { ed = tinyMCEPopup.editor; tinyMCEPopup.resizeToInnerSize(); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') var inst = ed; var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th"); var formObj = document.forms[0]; var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); // Get table cell data var celltype = tdElm.nodeName.toLowerCase(); var align = ed.dom.getAttrib(tdElm, 'align'); var valign = ed.dom.getAttrib(tdElm, 'valign'); var width = trimSize(getStyle(tdElm, 'width', 'width')); var height = trimSize(getStyle(tdElm, 'height', 'height')); var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); var className = ed.dom.getAttrib(tdElm, 'class'); var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; var id = ed.dom.getAttrib(tdElm, 'id'); var lang = ed.dom.getAttrib(tdElm, 'lang'); var dir = ed.dom.getAttrib(tdElm, 'dir'); var scope = ed.dom.getAttrib(tdElm, 'scope'); // Setup form addClassesToList('class', 'table_cell_styles'); TinyMCE_EditableSelects.init(); formObj.bordercolor.value = bordercolor; formObj.bgcolor.value = bgcolor; formObj.backgroundimage.value = backgroundimage; formObj.width.value = width; formObj.height.value = height; formObj.id.value = id; formObj.lang.value = lang; formObj.style.value = ed.dom.serializeStyle(st); selectByValue(formObj, 'align', align); selectByValue(formObj, 'valign', valign); selectByValue(formObj, 'class', className, true, true); selectByValue(formObj, 'celltype', celltype); selectByValue(formObj, 'dir', dir); selectByValue(formObj, 'scope', scope); // Resize some elements if (isVisible('backgroundimagebrowser')) document.getElementById('backgroundimage').style.width = '180px'; updateColor('bordercolor_pick', 'bordercolor'); updateColor('bgcolor_pick', 'bgcolor'); } function updateAction() { var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; tinyMCEPopup.restoreSelection(); el = ed.selection.getNode(); tdElm = ed.dom.getParent(el, "td,th"); trElm = ed.dom.getParent(el, "tr"); tableElm = ed.dom.getParent(el, "table"); ed.execCommand('mceBeginUndoLevel'); switch (getSelectValue(formObj, 'action')) { case "cell": var celltype = getSelectValue(formObj, 'celltype'); var scope = getSelectValue(formObj, 'scope'); function doUpdate(s) { if (s) { updateCell(tdElm); ed.addVisual(); ed.nodeChanged(); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); } }; if (ed.getParam("accessibility_warnings", 1)) { if (celltype == "th" && scope == "") tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); else doUpdate(1); return; } updateCell(tdElm); break; case "row": var cell = trElm.firstChild; if (cell.nodeName != "TD" && cell.nodeName != "TH") cell = nextCell(cell); do { cell = updateCell(cell, true); } while ((cell = nextCell(cell)) != null); break; case "all": var rows = tableElm.getElementsByTagName("tr"); for (var i=0; i<rows.length; i++) { var cell = rows[i].firstChild; if (cell.nodeName != "TD" && cell.nodeName != "TH") cell = nextCell(cell); do { cell = updateCell(cell, true); } while ((cell = nextCell(cell)) != null); } break; } ed.addVisual(); ed.nodeChanged(); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); } function nextCell(elm) { while ((elm = elm.nextSibling) != null) { if (elm.nodeName == "TD" || elm.nodeName == "TH") return elm; } return null; } function updateCell(td, skip_id) { var inst = ed; var formObj = document.forms[0]; var curCellType = td.nodeName.toLowerCase(); var celltype = getSelectValue(formObj, 'celltype'); var doc = inst.getDoc(); var dom = ed.dom; if (!skip_id) td.setAttribute('id', formObj.id.value); td.setAttribute('align', formObj.align.value); td.setAttribute('vAlign', formObj.valign.value); td.setAttribute('lang', formObj.lang.value); td.setAttribute('dir', getSelectValue(formObj, 'dir')); td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value))); td.setAttribute('scope', formObj.scope.value); ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class')); // Clear deprecated attributes ed.dom.setAttrib(td, 'width', ''); ed.dom.setAttrib(td, 'height', ''); ed.dom.setAttrib(td, 'bgColor', ''); ed.dom.setAttrib(td, 'borderColor', ''); ed.dom.setAttrib(td, 'background', ''); // Set styles td.style.width = getCSSSize(formObj.width.value); td.style.height = getCSSSize(formObj.height.value); if (formObj.bordercolor.value != "") { td.style.borderColor = formObj.bordercolor.value; td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle; td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth; } else td.style.borderColor = ''; td.style.backgroundColor = formObj.bgcolor.value; if (formObj.backgroundimage.value != "") td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')"; else td.style.backgroundImage = ''; if (curCellType != celltype) { // changing to a different node type var newCell = doc.createElement(celltype); for (var c=0; c<td.childNodes.length; c++) newCell.appendChild(td.childNodes[c].cloneNode(1)); for (var a=0; a<td.attributes.length; a++) ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name)); td.parentNode.replaceChild(newCell, td); td = newCell; } dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText))); return td; } function changedBackgroundImage() { var formObj = document.forms[0]; var st = ed.dom.parseStyle(formObj.style.value); st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; formObj.style.value = ed.dom.serializeStyle(st); } function changedSize() { var formObj = document.forms[0]; var st = ed.dom.parseStyle(formObj.style.value); var width = formObj.width.value; if (width != "") st['width'] = getCSSSize(width); else st['width'] = ""; var height = formObj.height.value; if (height != "") st['height'] = getCSSSize(height); else st['height'] = ""; formObj.style.value = ed.dom.serializeStyle(st); } function changedColor() { var formObj = document.forms[0]; var st = ed.dom.parseStyle(formObj.style.value); st['background-color'] = formObj.bgcolor.value; st['border-color'] = formObj.bordercolor.value; formObj.style.value = ed.dom.serializeStyle(st); } function changedStyle() { var formObj = document.forms[0]; var st = ed.dom.parseStyle(formObj.style.value); if (st['background-image']) formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); else formObj.backgroundimage.value = ''; if (st['width']) formObj.width.value = trimSize(st['width']); if (st['height']) formObj.height.value = trimSize(st['height']); if (st['background-color']) { formObj.bgcolor.value = st['background-color']; updateColor('bgcolor_pick','bgcolor'); } if (st['border-color']) { formObj.bordercolor.value = st['border-color']; updateColor('bordercolor_pick','bordercolor'); } } tinyMCEPopup.onInit.add(init);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/js/cell.js
cell.js
tinyMCEPopup.requireLangPack(); function init() { tinyMCEPopup.resizeToInnerSize(); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); var inst = tinyMCEPopup.editor; var dom = inst.dom; var trElm = dom.getParent(inst.selection.getNode(), "tr"); var formObj = document.forms[0]; var st = dom.parseStyle(dom.getAttrib(trElm, "style")); // Get table row data var rowtype = trElm.parentNode.nodeName.toLowerCase(); var align = dom.getAttrib(trElm, 'align'); var valign = dom.getAttrib(trElm, 'valign'); var height = trimSize(getStyle(trElm, 'height', 'height')); var className = dom.getAttrib(trElm, 'class'); var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor')); var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; var id = dom.getAttrib(trElm, 'id'); var lang = dom.getAttrib(trElm, 'lang'); var dir = dom.getAttrib(trElm, 'dir'); // Setup form addClassesToList('class', 'table_row_styles'); TinyMCE_EditableSelects.init(); formObj.bgcolor.value = bgcolor; formObj.backgroundimage.value = backgroundimage; formObj.height.value = height; formObj.id.value = id; formObj.lang.value = lang; formObj.style.value = dom.serializeStyle(st); selectByValue(formObj, 'align', align); selectByValue(formObj, 'valign', valign); selectByValue(formObj, 'class', className, true, true); selectByValue(formObj, 'rowtype', rowtype); selectByValue(formObj, 'dir', dir); // Resize some elements if (isVisible('backgroundimagebrowser')) document.getElementById('backgroundimage').style.width = '180px'; updateColor('bgcolor_pick', 'bgcolor'); } function updateAction() { var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0]; var action = getSelectValue(formObj, 'action'); tinyMCEPopup.restoreSelection(); trElm = dom.getParent(inst.selection.getNode(), "tr"); tableElm = dom.getParent(inst.selection.getNode(), "table"); inst.execCommand('mceBeginUndoLevel'); switch (action) { case "row": updateRow(trElm); break; case "all": var rows = tableElm.getElementsByTagName("tr"); for (var i=0; i<rows.length; i++) updateRow(rows[i], true); break; case "odd": case "even": var rows = tableElm.getElementsByTagName("tr"); for (var i=0; i<rows.length; i++) { if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even")) updateRow(rows[i], true, true); } break; } inst.addVisual(); inst.nodeChanged(); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); } function updateRow(tr_elm, skip_id, skip_parent) { var inst = tinyMCEPopup.editor; var formObj = document.forms[0]; var dom = inst.dom; var curRowType = tr_elm.parentNode.nodeName.toLowerCase(); var rowtype = getSelectValue(formObj, 'rowtype'); var doc = inst.getDoc(); // Update row element if (!skip_id) tr_elm.setAttribute('id', formObj.id.value); tr_elm.setAttribute('align', getSelectValue(formObj, 'align')); tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign')); tr_elm.setAttribute('lang', formObj.lang.value); tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir')); tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value))); dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class')); // Clear deprecated attributes tr_elm.setAttribute('background', ''); tr_elm.setAttribute('bgColor', ''); tr_elm.setAttribute('height', ''); // Set styles tr_elm.style.height = getCSSSize(formObj.height.value); tr_elm.style.backgroundColor = formObj.bgcolor.value; if (formObj.backgroundimage.value != "") tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')"; else tr_elm.style.backgroundImage = ''; // Setup new rowtype if (curRowType != rowtype && !skip_parent) { // first, clone the node we are working on var newRow = tr_elm.cloneNode(1); // next, find the parent of its new destination (creating it if necessary) var theTable = dom.getParent(tr_elm, "table"); var dest = rowtype; var newParent = null; for (var i = 0; i < theTable.childNodes.length; i++) { if (theTable.childNodes[i].nodeName.toLowerCase() == dest) newParent = theTable.childNodes[i]; } if (newParent == null) { newParent = doc.createElement(dest); if (dest == "thead") { if (theTable.firstChild.nodeName == 'CAPTION') inst.dom.insertAfter(newParent, theTable.firstChild); else theTable.insertBefore(newParent, theTable.firstChild); } else theTable.appendChild(newParent); } // append the row to the new parent newParent.appendChild(newRow); // remove the original tr_elm.parentNode.removeChild(tr_elm); // set tr_elm to the new node tr_elm = newRow; } dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText))); } function changedBackgroundImage() { var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; var st = dom.parseStyle(formObj.style.value); st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; formObj.style.value = dom.serializeStyle(st); } function changedStyle() { var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; var st = dom.parseStyle(formObj.style.value); if (st['background-image']) formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); else formObj.backgroundimage.value = ''; if (st['height']) formObj.height.value = trimSize(st['height']); if (st['background-color']) { formObj.bgcolor.value = st['background-color']; updateColor('bgcolor_pick','bgcolor'); } } function changedSize() { var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; var st = dom.parseStyle(formObj.style.value); var height = formObj.height.value; if (height != "") st['height'] = getCSSSize(height); else st['height'] = ""; formObj.style.value = dom.serializeStyle(st); } function changedColor() { var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; var st = dom.parseStyle(formObj.style.value); st['background-color'] = formObj.bgcolor.value; formObj.style.value = dom.serializeStyle(st); } tinyMCEPopup.onInit.add(init);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/js/row.js
row.js
tinyMCEPopup.requireLangPack(); var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom; function insertTable() { var formObj = document.forms[0]; var inst = tinyMCEPopup.editor, dom = inst.dom; var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules; var html = '', capEl, elm; var cellLimit, rowLimit, colLimit; tinyMCEPopup.restoreSelection(); if (!AutoValidator.validate(formObj)) { tinyMCEPopup.alert(inst.getLang('invalid_data')); return false; } elm = dom.getParent(inst.selection.getNode(), 'table'); // Get form data cols = formObj.elements['cols'].value; rows = formObj.elements['rows'].value; border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; align = getSelectValue(formObj, "align"); frame = getSelectValue(formObj, "tframe"); rules = getSelectValue(formObj, "rules"); width = formObj.elements['width'].value; height = formObj.elements['height'].value; bordercolor = formObj.elements['bordercolor'].value; bgcolor = formObj.elements['bgcolor'].value; className = getSelectValue(formObj, "class"); id = formObj.elements['id'].value; summary = formObj.elements['summary'].value; style = formObj.elements['style'].value; dir = formObj.elements['dir'].value; lang = formObj.elements['lang'].value; background = formObj.elements['backgroundimage'].value; caption = formObj.elements['caption'].checked; cellLimit = tinyMCEPopup.getParam('table_cell_limit', false); rowLimit = tinyMCEPopup.getParam('table_row_limit', false); colLimit = tinyMCEPopup.getParam('table_col_limit', false); // Validate table size if (colLimit && cols > colLimit) { tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); return false; } else if (rowLimit && rows > rowLimit) { tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); return false; } else if (cellLimit && cols * rows > cellLimit) { tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); return false; } // Update table if (action == "update") { inst.execCommand('mceBeginUndoLevel'); dom.setAttrib(elm, 'cellPadding', cellpadding, true); dom.setAttrib(elm, 'cellSpacing', cellspacing, true); dom.setAttrib(elm, 'border', border); dom.setAttrib(elm, 'align', align); dom.setAttrib(elm, 'frame', frame); dom.setAttrib(elm, 'rules', rules); dom.setAttrib(elm, 'class', className); dom.setAttrib(elm, 'style', style); dom.setAttrib(elm, 'id', id); dom.setAttrib(elm, 'summary', summary); dom.setAttrib(elm, 'dir', dir); dom.setAttrib(elm, 'lang', lang); capEl = inst.dom.select('caption', elm)[0]; if (capEl && !caption) capEl.parentNode.removeChild(capEl); if (!capEl && caption) { capEl = elm.ownerDocument.createElement('caption'); if (!tinymce.isIE) capEl.innerHTML = '<br mce_bogus="1"/>'; elm.insertBefore(capEl, elm.firstChild); } if (width && inst.settings.inline_styles) { dom.setStyle(elm, 'width', width); dom.setAttrib(elm, 'width', ''); } else { dom.setAttrib(elm, 'width', width, true); dom.setStyle(elm, 'width', ''); } // Remove these since they are not valid XHTML dom.setAttrib(elm, 'borderColor', ''); dom.setAttrib(elm, 'bgColor', ''); dom.setAttrib(elm, 'background', ''); if (height && inst.settings.inline_styles) { dom.setStyle(elm, 'height', height); dom.setAttrib(elm, 'height', ''); } else { dom.setAttrib(elm, 'height', height, true); dom.setStyle(elm, 'height', ''); } if (background != '') elm.style.backgroundImage = "url('" + background + "')"; else elm.style.backgroundImage = ''; /* if (tinyMCEPopup.getParam("inline_styles")) { if (width != '') elm.style.width = getCSSSize(width); }*/ if (bordercolor != "") { elm.style.borderColor = bordercolor; elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; elm.style.borderWidth = border == "" ? "1px" : border; } else elm.style.borderColor = ''; elm.style.backgroundColor = bgcolor; elm.style.height = getCSSSize(height); inst.addVisual(); // Fix for stange MSIE align bug //elm.outerHTML = elm.outerHTML; inst.nodeChanged(); inst.execCommand('mceEndUndoLevel'); // Repaint if dimensions changed if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) inst.execCommand('mceRepaint'); tinyMCEPopup.close(); return true; } // Create new table html += '<table'; html += makeAttrib('id', id); html += makeAttrib('border', border); html += makeAttrib('cellpadding', cellpadding); html += makeAttrib('cellspacing', cellspacing); if (width && inst.settings.inline_styles) { if (style) style += '; '; // Force px if (/^[0-9\.]+$/.test(width)) width += 'px'; style += 'width: ' + width; } else html += makeAttrib('width', width); /* if (height) { if (style) style += '; '; style += 'height: ' + height; }*/ //html += makeAttrib('height', height); //html += makeAttrib('bordercolor', bordercolor); //html += makeAttrib('bgcolor', bgcolor); html += makeAttrib('align', align); html += makeAttrib('frame', frame); html += makeAttrib('rules', rules); html += makeAttrib('class', className); html += makeAttrib('style', style); html += makeAttrib('summary', summary); html += makeAttrib('dir', dir); html += makeAttrib('lang', lang); html += '>'; if (caption) { if (!tinymce.isIE) html += '<caption><br mce_bogus="1"/></caption>'; else html += '<caption></caption>'; } for (var y=0; y<rows; y++) { html += "<tr>"; for (var x=0; x<cols; x++) { if (!tinymce.isIE) html += '<td><br mce_bogus="1"/></td>'; else html += '<td></td>'; } html += "</tr>"; } html += "</table>"; inst.execCommand('mceBeginUndoLevel'); // Move table if (inst.settings.fix_table_elements) { var bm = inst.selection.getBookmark(), patt = ''; inst.execCommand('mceInsertContent', false, '<br class="_mce_marker" />'); tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { if (patt) patt += ','; patt += n + ' ._mce_marker'; }); tinymce.each(inst.dom.select(patt), function(n) { inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); }); dom.setOuterHTML(dom.select('._mce_marker')[0], html); inst.selection.moveToBookmark(bm); } else inst.execCommand('mceInsertContent', false, html); inst.addVisual(); inst.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); } function makeAttrib(attrib, value) { var formObj = document.forms[0]; var valueElm = formObj.elements[attrib]; if (typeof(value) == "undefined" || value == null) { value = ""; if (valueElm) value = valueElm.value; } if (value == "") return ""; // XML encode it value = value.replace(/&/g, '&amp;'); value = value.replace(/\"/g, '&quot;'); value = value.replace(/</g, '&lt;'); value = value.replace(/>/g, '&gt;'); return ' ' + attrib + '="' + value + '"'; } function init() { tinyMCEPopup.resizeToInnerSize(); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; var inst = tinyMCEPopup.editor, dom = inst.dom; var formObj = document.forms[0]; var elm = dom.getParent(inst.selection.getNode(), "table"); action = tinyMCEPopup.getWindowArg('action'); if (!action) action = elm ? "update" : "insert"; if (elm && action != "insert") { var rowsAr = elm.rows; var cols = 0; for (var i=0; i<rowsAr.length; i++) if (rowsAr[i].cells.length > cols) cols = rowsAr[i].cells.length; cols = cols; rows = rowsAr.length; st = dom.parseStyle(dom.getAttrib(elm, "style")); border = trimSize(getStyle(elm, 'border', 'borderWidth')); cellpadding = dom.getAttrib(elm, 'cellpadding', ""); cellspacing = dom.getAttrib(elm, 'cellspacing', ""); width = trimSize(getStyle(elm, 'width', 'width')); height = trimSize(getStyle(elm, 'height', 'height')); bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); align = dom.getAttrib(elm, 'align', align); frame = dom.getAttrib(elm, 'frame'); rules = dom.getAttrib(elm, 'rules'); className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); id = dom.getAttrib(elm, 'id'); summary = dom.getAttrib(elm, 'summary'); style = dom.serializeStyle(st); dir = dom.getAttrib(elm, 'dir'); lang = dom.getAttrib(elm, 'lang'); background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; orgTableWidth = width; orgTableHeight = height; action = "update"; formObj.insert.value = inst.getLang('update'); } addClassesToList('class', "table_styles"); TinyMCE_EditableSelects.init(); // Update form selectByValue(formObj, 'align', align); selectByValue(formObj, 'tframe', frame); selectByValue(formObj, 'rules', rules); selectByValue(formObj, 'class', className, true, true); formObj.cols.value = cols; formObj.rows.value = rows; formObj.border.value = border; formObj.cellpadding.value = cellpadding; formObj.cellspacing.value = cellspacing; formObj.width.value = width; formObj.height.value = height; formObj.bordercolor.value = bordercolor; formObj.bgcolor.value = bgcolor; formObj.id.value = id; formObj.summary.value = summary; formObj.style.value = style; formObj.dir.value = dir; formObj.lang.value = lang; formObj.backgroundimage.value = background; updateColor('bordercolor_pick', 'bordercolor'); updateColor('bgcolor_pick', 'bgcolor'); // Resize some elements if (isVisible('backgroundimagebrowser')) document.getElementById('backgroundimage').style.width = '180px'; // Disable some fields in update mode if (action == "update") { formObj.cols.disabled = true; formObj.rows.disabled = true; } } function changedSize() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); /* var width = formObj.width.value; if (width != "") st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; else st['width'] = "";*/ var height = formObj.height.value; if (height != "") st['height'] = getCSSSize(height); else st['height'] = ""; formObj.style.value = dom.serializeStyle(st); } function changedBackgroundImage() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; formObj.style.value = dom.serializeStyle(st); } function changedBorder() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); // Update border width if the element has a color if (formObj.border.value != "" && formObj.bordercolor.value != "") st['border-width'] = formObj.border.value + "px"; formObj.style.value = dom.serializeStyle(st); } function changedColor() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); st['background-color'] = formObj.bgcolor.value; if (formObj.bordercolor.value != "") { st['border-color'] = formObj.bordercolor.value; // Add border-width if it's missing if (!st['border-width']) st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; } formObj.style.value = dom.serializeStyle(st); } function changedStyle() { var formObj = document.forms[0]; var st = dom.parseStyle(formObj.style.value); if (st['background-image']) formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); else formObj.backgroundimage.value = ''; if (st['width']) formObj.width.value = trimSize(st['width']); if (st['height']) formObj.height.value = trimSize(st['height']); if (st['background-color']) { formObj.bgcolor.value = st['background-color']; updateColor('bgcolor_pick','bgcolor'); } if (st['border-color']) { formObj.bordercolor.value = st['border-color']; updateColor('bordercolor_pick','bordercolor'); } } tinyMCEPopup.onInit.add(init);
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/table/js/table.js
table.js
(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();tinyMCE.add(e.fullscreenEditor);e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var j=tinymce.DOM.getViewPort();e.fullscreenEditor.theme.resizeTo(j.w,j.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/fullscreen/editor_plugin.js
editor_plugin.js
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/media/editor_plugin.js
editor_plugin.js
tinyMCE.addI18n('ko.media_dlg',{ title:"\uBBF8\uB514\uC5B4\uC758 \uC0BD\uC785/\uD3B8\uC9D1", general:"\uC77C\uBC18", advanced:"\uACE0\uAE09", file:"\uD30C\uC77C/URL", list:"\uBAA9\uB85D", size:"\uD06C\uAE30", preview:"\uBBF8\uB9AC\uBCF4\uAE30", constrain_proportions:"\uC885\uD6A1\uBE44 \uC720\uC9C0", type:"\uD0C0\uC785", id:"Id", name:"Name", class_name:"Class", vspace:"\uC0C1\uD558 \uC5EC\uBC31", hspace:"\uC88C\uC6B0 \uC5EC\uBC31", play:"\uC790\uB3D9 \uC7AC\uC0DD", loop:"\uC5F0\uC18D \uC7AC\uC0DD", menu:"\uBA54\uB274 \uD45C\uC2DC", quality:"\uD488\uC9C8", scale:"\uC2A4\uCF00\uC77C", align:"Align", salign:"SAlign", wmode:"WMode", bgcolor:"Background", base:"Base", flashvars:"Flashvars", liveconnect:"SWLiveConnect", autohref:"AutoHREF", cache:"Cache", hidden:"Hidden", controller:"Controller", kioskmode:"Kiosk mode", playeveryframe:"Play every frame", targetcache:"Target cache", correction:"No correction", enablejavascript:"JavaScript\uB97C \uD5C8\uAC00", starttime:"Start time", endtime:"End time", href:"Href", qtsrcchokespeed:"Choke speed", target:"Target", volume:"Volume", autostart:"Auto start", enabled:"Enabled", fullscreen:"Fullscreen", invokeurls:"Invoke URLs", mute:"Mute", stretchtofit:"Stretch to fit", windowlessvideo:"Windowless video", balance:"Balance", baseurl:"Base URL", captioningid:"Captioning id", currentmarker:"Current marker", currentposition:"Current position", defaultframe:"Default frame", playcount:"Play count", rate:"Rate", uimode:"UI Mode", flash_options:"Flash options", qt_options:"Quicktime options", wmp_options:"Windows media player options", rmp_options:"Real media player options", shockwave_options:"Shockwave options", autogotourl:"Auto goto URL", center:"Center", imagestatus:"Image status", maintainaspect:"Maintain aspect", nojava:"No java", prefetch:"Prefetch", shuffle:"Shuffle", console:"Console", numloop:"Num loops", controls:"Controls", scriptcallbacks:"Script callbacks", swstretchstyle:"Stretch style", swstretchhalign:"Stretch H-Align", swstretchvalign:"Stretch V-Align", sound:"Sound", progress:"Progress", qtsrc:"QT Src", qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.nYou should also add a non streamed version to the Src field..", align_top:"Top", align_right:"Right", align_bottom:"Bottom", align_left:"Left", align_center:"Center", align_top_left:"Top left", align_top_right:"Top right", align_bottom_left:"Bottom left", align_bottom_right:"Bottom right", flv_options:"Flash video options", flv_scalemode:"Scale mode", flv_buffer:"Buffer", flv_startimage:"Start image", flv_starttime:"Start time", flv_defaultvolume:"Default volumne", flv_hiddengui:"Hidden GUI", flv_autostart:"Auto start", flv_loop:"Loop", flv_showscalemodes:"Show scale modes", flv_smoothvideo:"Smooth video", flv_jscallback:"JS Callback" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/media/langs/ko_dlg.js
ko_dlg.js
tinyMCE.addI18n('es.media_dlg',{ title:"Insertar/editar medio embebido", general:"General", advanced:"Avanzado", file:"Archivo/URL", list:"Lista", size:"Dimensiones", preview:"Vista Previa", constrain_proportions:"Bloquear relaci\u00F3n de aspecto", type:"Tipo", id:"Id", name:"Nombre", class_name:"Clase", vspace:"V-Space", hspace:"H-Space", play:"Comienzo Autom\u00E1tico", loop:"Repetitivo", menu:"Mostrar Men\u00FA", quality:"Calidad", scale:"Scale", align:"Alineaci\u00F3n", salign:"SAlign", wmode:"WMode", bgcolor:"Fondo", base:"Base", flashvars:"Flashvars", liveconnect:"SWLiveConnect", autohref:"AutoHREF", cache:"Cach\u00E9", hidden:"Hidden", controller:"Controller", kioskmode:"Kiosk mode", playeveryframe:"Reproducir todo los frames", targetcache:"Target cache", correction:"Sin correci\u00F3n", enablejavascript:"Habilitar JavaScript", starttime:"Inicio", endtime:"Fin", href:"Href", qtsrcchokespeed:"Vel. de choque", target:"Target", volume:"Volumen", autostart:"Comienzo Autom\u00E1tico", enabled:"Habilitado", fullscreen:"Pantalla Completa", invokeurls:"Invocar URLs", mute:"Silencio", stretchtofit:"Estirar para ajustar", windowlessvideo:"Video sin ventana", balance:"Balance", baseurl:"URL Base", captioningid:"Captioning id", currentmarker:"Marcador actual", currentposition:"Posici\u00F3n actual", defaultframe:"Frame predet.", playcount:"Cuantas reproducciones", rate:"Ratio", uimode:"Modo UI", flash_options:"Opciones Flash", qt_options:"Opciones Quicktime", wmp_options:"Opciones Windows media player", rmp_options:"Opciones Real media player", shockwave_options:"Opciones Shockwave", autogotourl:"Ir a URL autom\u00E1t.", center:"Centrado", imagestatus:"Estado de imagen", maintainaspect:"Mantener aspecto", nojava:"No java", prefetch:"Preb\u00FAsqueda", shuffle:"Aleatorio", console:"Consola", numloop:"N\u00FAm. repeticiones", controls:"Controles", scriptcallbacks:"Script callbacks", swstretchstyle:"Estilo estiramiento", swstretchhalign:"Alin. H. Estiramiento", swstretchvalign:"Alin. V. Estiramiento", sound:"Sonido", progress:"Progreso", qtsrc:"QT Src", qt_stream_warn:"Los recursos rtsp de Streaming deber\u00EDan a\u00F1adirse en el campo QT Src de la pesta\u00F1a avanzada.\nAdem\u00E1s deber\u00EDa a\u00F1adir una versi\u00F3n no Streaming en el campo Src.", align_top:"Arriba", align_right:"Derecha", align_bottom:"Debajo", align_left:"Izquierda", align_center:"Centrado", align_top_left:"Arriba Izda.", align_top_right:"Arriba Dcha.", align_bottom_left:"Debajo Izda.", align_bottom_right:"Debajo Dcha.", flv_options:"Opciones Video Flash", flv_scalemode:"Modo escalado", flv_buffer:"Buffer", flv_startimage:"Imagen inicio", flv_starttime:"Tiempo inicio", flv_defaultvolume:"Volumen predet.", flv_hiddengui:"Ocultar GUI", flv_autostart:"Inicio auto.", flv_loop:"Repetitivo", flv_showscalemodes:"Mostrar modos escala", flv_smoothvideo:"Video suave", flv_jscallback:"JS Callback" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/media/langs/es_dlg.js
es_dlg.js
tinyMCE.addI18n('fr.media_dlg',{ title:"Ins\u00E9rer / \u00E9diter un fichier m\u00E9dia", general:"G\u00E9n\u00E9ral", advanced:"Avanc\u00E9", file:"Fichier / URL", list:"Liste", size:"Dimensions", preview:"Pr\u00E9visualisation", constrain_proportions:"Conserver les proportions", type:"Type", id:"Id", name:"Nom", class_name:"Classe", vspace:"Espacement vertical", hspace:"Espacement horizontal", play:"Lecture automatique", loop:"Lire en boucle", menu:"Afficher le menu", quality:"Qualit\u00E9", scale:"\u00C9chelle", align:"Alignement", salign:"SAlign", wmode:"WMode", bgcolor:"Fond", base:"Base", flashvars:"Variables flash", liveconnect:"SWLiveConnect", autohref:"AutoHREF", cache:"Cache", hidden:"Cach\u00E9", controller:"Contr\u00F4leur", kioskmode:"Mode kiosque", playeveryframe:"Jouer toutes les images", targetcache:"Cache cible", correction:"Pas de correction", enablejavascript:"Activer le JavaScript", starttime:"D\u00E9but", endtime:"Fin", href:"Href", qtsrcchokespeed:"Choke speed", target:"Cible", volume:"Volume", autostart:"Lire automatiquement", enabled:"Activ\u00E9", fullscreen:"Plein \u00E9cran", invokeurls:"Invoquer URLs", mute:"Muet", stretchtofit:"\u00C9tendre pour adapter la taille", windowlessvideo:"Vid\u00E9o sans fen\u00EAtre", balance:"Balance", baseurl:"Adresse de base", captioningid:"Captioning id", currentmarker:"Marqueur actuel", currentposition:"Position actuelle", defaultframe:"Image par d\u00E9faut", playcount:"Compteur", rate:"Taux", uimode:"Mode UI", flash_options:"Options Flash", qt_options:"Options Quicktime", wmp_options:"Windows media player options", rmp_options:"Options Real media player", shockwave_options:"Options Shockwave", autogotourl:"Aller automatiquement \u00E0 l'URL", center:"Centrer", imagestatus:"Statut de l'image", maintainaspect:"Maintenir l'aspect", nojava:"Pas java", prefetch:"Prefetch", shuffle:"Al\u00E9atoire", console:"Console", numloop:"Nombre de tours", controls:"Contr\u00F4les", scriptcallbacks:"Callback de script", swstretchstyle:"Stretch style", swstretchhalign:"Stretch horizontal", swstretchvalign:"Stretch vertical", sound:"Son", progress:"Progression", qtsrc:"Source QT", qt_stream_warn:"Les ressources rtsp en streaming doivent \u00EAtre ajout\u00E9es au champ \u00AB Source QT \u00BB dans l'onglet avanc\u00E9.\nVous devriez aussi ajouter une version n'\u00E9tant pas en streaming au champ \u00AB source QT \u00BB.", align_top:"Haut", align_right:"Droite", align_bottom:"Bas", align_left:"Gauche", align_center:"Centr\u00E9", align_top_left:"En haut \u00E0 gauche", align_top_right:"En haut \u00E0 droite", align_bottom_left:"En bas \u00E0 gauche", align_bottom_right:"En bas \u00E0 droite", flv_options:"Options de la vid\u00E9o Flash", flv_scalemode:"\u00C9chelle", flv_buffer:"Tampon", flv_startimage:"Image de d\u00E9marrage", flv_starttime:"Temps au d\u00E9but", flv_defaultvolume:"Volume par d\u00E9faut", flv_hiddengui:"Interface utilisateur cach\u00E9e", flv_autostart:"D\u00E9marrage automatique", flv_loop:"En boucle", flv_showscalemodes:"Montrer les diff\u00E9rentes \u00E9chelles", flv_smoothvideo:"Vid\u00E9o adoucie", flv_jscallback:"Callback JavaScript" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/media/langs/fr_dlg.js
fr_dlg.js
tinyMCE.addI18n('de.media_dlg',{ title:"Multimedia-Inhalte einf\u00FCgen/bearbeiten", general:"Allgemein", advanced:"Erweitert", file:"Datei/URL", list:"Liste", size:"Abmessungen", preview:"Vorschau", constrain_proportions:"Proportionen erhalten", type:"Typ", id:"Id", name:"Name", class_name:"CSS-Klasse", vspace:"Vertikaler Abstand", hspace:"Horizontaler Abstand", play:"Automatisches Abspielen", loop:"Wiederholung", menu:"Men\u00FC anzeigen", quality:"Qualit\u00E4t", scale:"Skalierung", align:"Ausrichtung", salign:"S-Ausrichtung", wmode:"WMode", bgcolor:"Hintergrund", base:"Base", flashvars:"Flashvariablen", liveconnect:"SWLiveConnect", autohref:"AutoHREF", cache:"Zwischenspeicher", hidden:"Versteckt", controller:"Controller", kioskmode:"Kioskmodus", playeveryframe:"Jeden Frame abspielen", targetcache:"Ziel zwischenspeichern", correction:"Ohne Korrektur", enablejavascript:"JavaScript aktivieren", starttime:"Startzeitpunkt", endtime:"Endzeitpunkt", href:"Href", qtsrcchokespeed:"Choke speed", target:"Ziel", volume:"Lautst\u00E4rke", autostart:"Autostart", enabled:"Aktiviert", fullscreen:"Vollbild", invokeurls:"Invoke URLs", mute:"Stumm", stretchtofit:"Anzeigefl\u00E4che an verf\u00FCgbaren Platz anpassen", windowlessvideo:"Fensterloses Video", balance:"Balance", baseurl:"Base URL", captioningid:"Captioning id", currentmarker:"Aktueller Marker", currentposition:"Aktuelle Position", defaultframe:"Frame-Voreinstellung", playcount:"Z\u00E4hler", rate:"Rate", uimode:"UI Modus", flash_options:"Flash-Optionen", qt_options:"Quicktime-Optionen", wmp_options:"Optionen f\u00FCr Windows Media Player", rmp_options:"Optionen f\u00FCr Real Media Player", shockwave_options:"Shockwave-Optionen", autogotourl:"Auto goto URL", center:"Zentriert", imagestatus:"Bildstatus", maintainaspect:"Bildverh\u00E4ltnis beibehalten", nojava:"Kein Java", prefetch:"Prefetch", shuffle:"Zuf\u00E4llige Wiedergabe", console:"Konsole", numloop:"Anzahl Wiederholungen", controls:"Steuerung", scriptcallbacks:"Script callbacks", swstretchstyle:"Stretch style", swstretchhalign:"Stretch H-Ausrichtung", swstretchvalign:"Stretch V-Ausrichtung", sound:"Ton", progress:"Fortschritt", qtsrc:"QT Src", qt_stream_warn:"In den Erweiterten Einstellungen sollten im Feld 'QT Src' gestreamte RTSP Resourcen hinzugef\u00FCgt werden.\nZus\u00E4tzlich sollten Sie dort auch eine nicht-gestreamte Resource angeben.", align_top:"Oben", align_right:"Rechts", align_bottom:"Unten", align_left:"Links", align_center:"Zentriert", align_top_left:"Oben Links", align_top_right:"Oben Rechts", align_bottom_left:"Unten Links", align_bottom_right:"Unten Rechts", flv_options:"Optionen f\u00FCr Flash Video", flv_scalemode:"Skalierungsmodus", flv_buffer:"Puffer", flv_startimage:"Startbild", flv_starttime:"Startzeitpunkt", flv_defaultvolume:"Standardlautst\u00E4rke", flv_hiddengui:"Versteckte GUI", flv_autostart:"Autostart", flv_loop:"Wiederholung", flv_showscalemodes:"Skalierungsmodi anzeigen", flv_smoothvideo:"Smooth Video", flv_jscallback:"JS Callback" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/media/langs/de_dlg.js
de_dlg.js
tinyMCE.addI18n('ia.media_dlg',{ title:"\u63D2\u5165/\u7F16\u8F91 \u5A92\u4F53", general:"\u57FA\u672C", advanced:"\u9AD8\u7EA7", file:"\u6587\u4EF6/\u5730\u5740", list:"\u5217\u8868", size:"\u5927\u5C0F", preview:"\u9884\u89C8", constrain_proportions:"\u4FDD\u6301\u6BD4\u4F8B", type:"\u7C7B\u578B", id:"Id", name:"\u540D\u79F0", class_name:"\u7C7B\u540D", vspace:"\u5782\u76F4\u95F4\u8DDD", hspace:"\u6C34\u5E73\u95F4\u8DDD", play:"\u81EA\u52A8\u64AD\u653E", loop:"\u5FAA\u73AF", menu:"\u663E\u793A\u83DC\u5355", quality:"\u54C1\u8D28", scale:"\u7F29\u653E", align:"\u5BF9\u9F50", salign:"SAlign", wmode:"WMode", bgcolor:"\u80CC\u666F\u8272", base:"\u57FA\u7EBF", flashvars:"Flash\u53D8\u6570", liveconnect:"SWLiveConnect", autohref:"AutoHREF", cache:"\u7F13\u5B58", hidden:"\u9690\u85CF", controller:"\u63A7\u5236\u53F0", kioskmode:"Kiosk \u6A21\u5F0F", playeveryframe:"\u9010\u5E27\u64AD\u653E", targetcache:"\u76EE\u6807\u7F13\u5B58", correction:"\u4FEE\u6B63", enablejavascript:"\u542F\u7528 JavaScript", starttime:"\u5F00\u59CB\u65F6\u95F4", endtime:"\u7ED3\u675F\u65F6\u95F4", href:"Href", qtsrcchokespeed:"Choke speed", target:"\u76EE\u6807", volume:"\u97F3\u91CF", autostart:"\u81EA\u52A8\u5F00\u59CB", enabled:"\u542F\u7528", fullscreen:"\u5168\u5C4F\u5E55", invokeurls:"\u8C03\u7528\u7684URLs", mute:"\u9759\u97F3", stretchtofit:"\u7F29\u653E\u81F3\u5408\u9002\u5927\u5C0F", windowlessvideo:"\u65E0\u7A97\u53E3\u89C6\u9891", balance:"\u5E73\u8861", baseurl:"Base URL", captioningid:"\u5B57\u5E55 id", currentmarker:"\u5F53\u524D\u6807\u7B7E", currentposition:"\u5F53\u524D\u4F4D\u7F6E", defaultframe:"\u9ED8\u8BA4\u5E27", playcount:"\u64AD\u653E\u6B21\u6570", rate:"\u7801\u7387", uimode:"UI \u6A21\u5F0F", flash_options:"Flash \u9009\u9879", qt_options:"Quicktime \u9009\u9879", wmp_options:"Windows media player \u9009\u9879", rmp_options:"Real media player \u9009\u9879", shockwave_options:"Shockwave \u9009\u9879", autogotourl:"\u81EA\u52A8\u8DF3\u8F6C URL", center:"\u5C45\u4E2D", imagestatus:"\u56FE\u50CF\u72B6\u6001", maintainaspect:"\u7EF4\u62A4\u72B6\u6001", nojava:"No java", prefetch:"\u9884\u8BFB", shuffle:"\u968F\u673A", console:"\u63A7\u5236\u53F0", numloop:"\u5FAA\u73AF\u6B21\u6570", controls:"\u63A7\u5236", scriptcallbacks:"\u811A\u672C\u56DE\u6863", swstretchstyle:"\u7F29\u653E\u6837\u5F0F", swstretchhalign:"\u7F29\u653E\u81F3\u6C34\u5E73\u5BF9\u9F50", swstretchvalign:"\u7F29\u653E\u81F3\u5782\u76F4\u5BF9\u9F50", sound:"\u58F0\u97F3", progress:"\u8FDB\u5EA6", qtsrc:"QT Src", qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..", align_top:"\u9876\u90E8", align_right:"\u5C45\u53F3", align_bottom:"\u5E95\u90E8", align_left:"\u5C45\u5DE6", align_center:"\u5C45\u4E2D", align_top_left:"\u9876\u90E8\u5C45\u5DE6", align_top_right:"\u9876\u90E8\u5C45\u53F3", align_bottom_left:"\u5E95\u90E8\u5C45\u5DE6", align_bottom_right:"\u5E95\u90E8\u5C45\u53F3", flv_options:"Flash \u89C6\u9891\u9009\u9879", flv_scalemode:"\u7F29\u653E\u6A21\u5F0F", flv_buffer:"\u7F13\u51B2", flv_startimage:"\u5F00\u59CB\u56FE\u50CF", flv_starttime:"\u5F00\u59CB\u65F6\u95F4", flv_defaultvolume:"\u9ED8\u8BA4\u58F0\u97F3", flv_hiddengui:"\u9690\u85CFGUI", flv_autostart:"\u81EA\u52A8\u5F00\u59CB", flv_loop:"\u5FAA\u73AF", flv_showscalemodes:"\u663E\u793A\u7F29\u653E\u6A21\u5F0F", flv_smoothvideo:"\u5E73\u6ED1\u89C6\u9891", flv_jscallback:"JS \u56DE\u6A94" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/media/langs/ia_dlg.js
ia_dlg.js
tinyMCE.addI18n('zh.media_dlg',{ title:"\u63D2\u5165/\u7DE8\u8F2F\u5D4C\u5165\u5A92\u9AD4", general:"\u4E00\u822C", advanced:"\u9AD8\u7D1A", file:"\u6587\u4EF6/\u7DB2\u5740", list:"\u5217\u8868", size:"\u5C3A\u5BF8", preview:"\u9810\u89BD", constrain_proportions:"\u9396\u5B9A\u6BD4\u4F8B", type:"\u985E\u578B", id:"Id", name:"\u540D\u7A31", class_name:"\u985E\u578B", vspace:"\u6C34\u5E73\u9593\u8DDD", hspace:"\u5782\u76F4\u9593\u8DDD", play:"\u81EA\u52D5\u64AD\u653E", loop:"\u91CD\u8907\u64AD\u653E", menu:"\u986F\u793A\u83DC\u55AE", quality:"\u54C1\u8CEA", scale:"\u6BD4\u4F8B", align:"\u5C0D\u9F4A", salign:"SAlign", wmode:"\u7A97\u53E3\u6A21\u5F0F", bgcolor:"\u80CC\u666F\u8272", base:"\u57FA\u5E95", flashvars:"\u53C3\u6578", liveconnect:"SWLiveConnect", autohref:"\u81EA\u52D5\u9023\u7D50", cache:"\u66AB\u5B58", hidden:"\u96B1\u85CF", controller:"\u63A7\u5236\u53F0", kioskmode:"Kiosk\u6A21\u5F0F", playeveryframe:"\u64AD\u653E\u6BCF\u4E00\u5F71\u683C", targetcache:"\u76EE\u6A19\u66AB\u5B58", correction:"\u6C92\u6709\u4FEE\u6B63", enablejavascript:"\u555F\u7528JavaScript", starttime:"\u958B\u59CB\u6642\u9593", endtime:"\u7D50\u675F\u6642\u9593", href:"\u9023\u7D50", qtsrcchokespeed:"Choke speed", target:"\u76EE\u6A19", volume:"\u97F3\u91CF", autostart:"\u81EA\u52D5\u958B\u59CB", enabled:"\u555F\u7528", fullscreen:"\u5168\u5C4F\u5E55", invokeurls:"\u76F8\u95DCURLs", mute:"\u975C\u97F3", stretchtofit:"\u62C9\u4F38", windowlessvideo:"\u7121\u908A\u6846", balance:"\u5E73\u8861", baseurl:"\u57FA\u6E96URL", captioningid:"Captioning id", currentmarker:"\u7576\u524D\u6A19\u8A18", currentposition:"\u7576\u524D\u4F4D\u7F6E", defaultframe:"\u9810\u8A2D\u5F71\u683C", playcount:"\u64AD\u653E\u8A08\u6578", rate:"\u64AD\u65B9\u901F\u7387", uimode:"\u5916\u89C0\u6A21\u5F0F", flash_options:"Flash\u9078\u9805", qt_options:"Quicktime\u9078\u9805", wmp_options:"Windows media player\u9078\u9805", rmp_options:"Real media player\u9078\u9805", shockwave_options:"Shockwave\u9078\u9805", autogotourl:"\u81EA\u52D5\u8F49\u5230URL", center:"\u4E2D\u5FC3", imagestatus:"\u5716\u50CF\u72C0\u614B", maintainaspect:"Maintain aspect", nojava:"No java", prefetch:"\u9810\u8B80\u6587\u4EF6", shuffle:"Shuffle", console:"\u63A7\u5236\u53F0", numloop:"\u91CD\u8907\u6B21\u6578", controls:"\u63A7\u5236\u5668", scriptcallbacks:"\u8173\u672C\u56DE\u8ABF", swstretchstyle:"\u62C9\u5347\u6A21\u5F0F", swstretchhalign:"\u6C34\u5E73\u62C9\u5347", swstretchvalign:"\u5782\u76F4\u62C9\u5347", sound:"\u8072\u97F3", progress:"\u9032\u5EA6", qtsrc:"QT Src", qt_stream_warn:"\u4E32\u6D41\u5F0Frtsp\u8CC7\u6E90\u61C9\u8A72\u6DFB\u52A0\u5230\u300C\u9AD8\u7D1A\u300D\u4E2DQT Src\u3002\n\u540C\u6642\u6DFB\u52A0\u975E\u4E32\u6D41\u5F0F\u8CC7\u6E90\u5230Src\u3002", align_top:"\u4E0A\u65B9", align_right:"\u9760\u53F3", align_bottom:"\u4E0B\u65B9", align_left:"\u9760\u5DE6", align_center:"\u4E2D\u9593", align_top_left:"\u5DE6\u4E0A", align_top_right:"\u53F3\u4E0A", align_bottom_left:"\u5DE6\u4E0B", align_bottom_right:"\u53F3\u4E0B", flv_options:"Flash\u8996\u983B\u9078\u9805", flv_scalemode:"Scale mode", flv_buffer:"\u7DE9\u885D", flv_startimage:"\u958B\u59CB\u756B\u9762", flv_starttime:"\u958B\u59CB\u6642\u9593", flv_defaultvolume:"\u9ED8\u8A8D\u97F3\u91CF", flv_hiddengui:"\u96B1\u85CFGUI", flv_autostart:"\u81EA\u52D5\u64AD\u653E", flv_loop:"\u91CD\u8907", flv_showscalemodes:"Show scale modes", flv_smoothvideo:"\u5E73\u6ED1\u5716\u50CF", flv_jscallback:"JS\u56DE\u8ABF" });
ztfy.jqueryui
/ztfy.jqueryui-0.7.12.tar.gz/ztfy.jqueryui-0.7.12/src/ztfy/jqueryui/resources/js/tiny_mce/plugins/media/langs/zh_dlg.js
zh_dlg.js