1691 lines
773 KiB
JavaScript
Executable File
1691 lines
773 KiB
JavaScript
Executable File
/*
|
|
|
|
Web Font Loader v1.5.3 - (c) Adobe Systems, Google.
|
|
License: Apache 2.0
|
|
|
|
jQuery | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
|
|
|
|
jQuery UI
|
|
http://jqueryui.com
|
|
Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.sortable.js, jquery.ui.slider.js, jquery.ui.tabs.js
|
|
Copyright 2013 jQuery Foundation and other contributors Licensed MIT
|
|
|
|
hoverIntent
|
|
http://cherne.net/brian/resources/jquery.hoverIntent.html
|
|
You may use hoverIntent under the terms of the MIT license.
|
|
Copyright 2007, 2013 Brian Cherne
|
|
|
|
CryptoJS
|
|
(c) 2009-2013 by Jeff Mott. All rights reserved.
|
|
code.google.com/p/crypto-js/wiki/License
|
|
|
|
jDataView by Vjeux
|
|
A unique way to read a binary file in the browser
|
|
http://github.com/vjeux/jDataView
|
|
|
|
jQuery Hotkeys Plugin
|
|
Copyright 2010, John Resig
|
|
Dual licensed under the MIT or GPL Version 2 licenses.
|
|
|
|
tipsy, facebook style tooltips for jquery
|
|
(c) 2008-2010 jason frame [jason@onehackoranother.com]
|
|
released under the MIT license
|
|
|
|
Superfish
|
|
Copyright (c) 2013 Joel Birch
|
|
Dual licensed under the MIT and GPL licenses:
|
|
http://www.opensource.org/licenses/mit-license.php
|
|
http://www.gnu.org/licenses/gpl.html
|
|
*/
|
|
(function(b,j){function c(e){return function(){return this[e]}}function a(e,a){var b=e.split("."),c=Y;!(b[0]in c)&&c.execScript&&c.execScript("var "+b[0]);for(var f;b.length&&(f=b.shift());)!b.length&&void 0!==a?c[f]=a:c=c[f]?c[f]:c[f]={}}function h(e,a,b){return e.call.apply(e.bind,arguments)}function f(e,a,b){if(!e)throw Error();if(2<arguments.length){var c=Array.prototype.slice.call(arguments,2);return function(){var b=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(b,c);return e.apply(a,
|
|
b)}}return function(){return e.apply(a,arguments)}}function g(e,a,b){g=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?h:f;return g.apply(E,arguments)}function m(e,a){this.G=e;this.v=a||e;this.z=this.v.document}function k(e,a,b){(e=e.z.getElementsByTagName(a)[0])||(e=j.documentElement);e&&e.lastChild&&e.insertBefore(b,e.lastChild)}function l(a,b,c){b=b||[];c=c||[];for(var f=a.className.split(/\s+/),g=0;g<b.length;g+=1){for(var h=e,j=0;j<f.length;j+=1)if(b[g]===
|
|
f[j]){h=Q;break}h||f.push(b[g])}b=[];for(g=0;g<f.length;g+=1){h=e;for(j=0;j<c.length;j+=1)if(f[g]===c[j]){h=Q;break}h||b.push(f[g])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function s(a,b){for(var c=a.className.split(/\s+/),f=0,g=c.length;f<g;f++)if(c[f]==b)return Q;return e}function p(e){var a=e.v.location.protocol;"about:"==a&&(a=e.G.location.protocol);return"https:"==a?"https:":"http:"}function t(a,b){var c=a.createElement("link",{rel:"stylesheet",href:b}),f=e;c.onload=
|
|
function(){f||(f=Q)};c.onerror=function(){f||(f=Q)};k(a,"head",c)}function r(a,c,f,g){var h=a.z.getElementsByTagName("head")[0];if(h){var j=a.createElement("script",{src:c}),m=e;j.onload=j.onreadystatechange=function(){if(!m&&(!this.readyState||"loaded"==this.readyState||"complete"==this.readyState))m=Q,f&&f(E),j.onload=j.onreadystatechange=E,"HEAD"==j.parentNode.tagName&&h.removeChild(j)};h.appendChild(j);b.setTimeout(function(){m||(m=Q,f&&f(Error("Script load timeout")))},g||5E3);return j}return E}
|
|
function C(e,a,b){this.M=e;this.U=a;this.Aa=b}function q(e,a,b,c){this.d=e!=E?e:E;this.o=a!=E?a:E;this.aa=b!=E?b:E;this.f=c!=E?c:E}function y(e){e=sb.exec(e);var a=E,b=E,c=E,f=E;e&&(e[1]!==E&&e[1]&&(a=parseInt(e[1],10)),e[2]!==E&&e[2]&&(b=parseInt(e[2],10)),e[3]!==E&&e[3]&&(c=parseInt(e[3],10)),e[4]!==E&&e[4]&&(f=/^[0-9]+$/.test(e[4])?parseInt(e[4],10):e[4]));return new q(a,b,c,f)}function z(e,a,b,c,f,g,h,j,m,k,l){this.K=e;this.Ga=a;this.za=b;this.fa=c;this.Ea=f;this.ea=g;this.wa=h;this.Fa=j;this.va=
|
|
m;this.da=k;this.j=l}function A(e,a){this.a=e;this.I=a}function F(e){var a=G(e.a,/(iPod|iPad|iPhone|Android|Windows Phone|BB\d{2}|BlackBerry)/,1);if(""!=a)return/BB\d{2}/.test(a)&&(a="BlackBerry"),a;e=G(e.a,/(Linux|Mac_PowerPC|Macintosh|Windows|CrOS)/,1);return""!=e?("Mac_PowerPC"==e&&(e="Macintosh"),e):"Unknown"}function T(e){var a=G(e.a,/(OS X|Windows NT|Android) ([^;)]+)/,2);if(a||(a=G(e.a,/Windows Phone( OS)? ([^;)]+)/,2))||(a=G(e.a,/(iPhone )?OS ([\d_]+)/,2)))return a;if(a=G(e.a,/(?:Linux|CrOS) ([^;)]+)/,
|
|
1))for(var a=a.split(/\s/),b=0;b<a.length;b+=1)if(/^[\d\._]+$/.test(a[b]))return a[b];return(e=G(e.a,/(BB\d{2}|BlackBerry).*?Version\/([^\s]*)/,2))?e:"Unknown"}function L(a){var b=F(a),c=T(a),f=y(c),g=G(a.a,/AppleWeb(?:K|k)it\/([\d\.\+]+)/,1),h=y(g),j="Unknown",m=new q,k="Unknown",l=e;/OPR\/[\d.]+/.test(a.a)?j="Opera":-1!=a.a.indexOf("Chrome")||-1!=a.a.indexOf("CrMo")||-1!=a.a.indexOf("CriOS")?j="Chrome":/Silk\/\d/.test(a.a)?j="Silk":"BlackBerry"==b||"Android"==b?j="BuiltinBrowser":-1!=a.a.indexOf("PhantomJS")?
|
|
j="PhantomJS":-1!=a.a.indexOf("Safari")?j="Safari":-1!=a.a.indexOf("AdobeAIR")&&(j="AdobeAIR");"BuiltinBrowser"==j?k="Unknown":"Silk"==j?k=G(a.a,/Silk\/([\d\._]+)/,1):"Chrome"==j?k=G(a.a,/(Chrome|CrMo|CriOS)\/([\d\.]+)/,2):-1!=a.a.indexOf("Version/")?k=G(a.a,/Version\/([\d\.\w]+)/,1):"AdobeAIR"==j?k=G(a.a,/AdobeAIR\/([\d\.]+)/,1):"Opera"==j?k=G(a.a,/OPR\/([\d.]+)/,1):"PhantomJS"==j&&(k=G(a.a,/PhantomJS\/([\d.]+)/,1));m=y(k);l="AdobeAIR"==j?2<m.d||2==m.d&&5<=m.o:"BlackBerry"==b?10<=f.d:"Android"==
|
|
b?2<f.d||2==f.d&&1<f.o:526<=h.d||525<=h.d&&13<=h.o;return new z(j,m,k,"AppleWebKit",h,g,b,f,c,O(a.I),new C(l,536>h.d||536==h.d&&11>h.o,"iPhone"==b||"iPad"==b||"iPod"==b||"Macintosh"==b))}function G(e,a,b){return(e=e.match(a))&&e[b]?e[b]:""}function O(e){if(e.documentMode)return e.documentMode}function Z(e){this.ua=e||"-"}function J(e,a){this.K=e;this.V=4;this.L="n";var b=(a||"n4").match(/^([nio])([1-9])$/i);b&&(this.L=b[1],this.V=parseInt(b[2],10))}function P(e){return e.L+e.V}function ma(e){var a=
|
|
4,b="n",c=E;e&&((c=e.match(/(normal|oblique|italic)/i))&&c[1]&&(b=c[1].substr(0,1).toLowerCase()),(c=e.match(/([1-9]00|normal|bold)/i))&&c[1]&&(/bold/i.test(c[1])?a=7:/[1-9]00/.test(c[1])&&(a=parseInt(c[1].substr(0,1),10))));return b+a}function U(e,a,b){this.c=e;this.m=a;this.O=b;this.h="wf";this.g=new Z("-")}function $(e){var a=s(e.m,e.g.f(e.h,"active")),b=[],c=[e.g.f(e.h,"loading")];a||b.push(e.g.f(e.h,"inactive"));l(e.m,b,c);v(e,"inactive")}function v(e,a,b){if(e.O[a])if(b)e.O[a](b.getName(),P(b));
|
|
else e.O[a]()}function x(){this.w={}}function w(e,a){this.c=e;this.C=a;this.s=this.c.createElement("span",{"aria-hidden":"true"},this.C)}function u(e,a){var b;b=[];for(var c=a.K.split(/,\s*/),f=0;f<c.length;f++){var g=c[f].replace(/['"]/g,"");-1==g.indexOf(" ")?b.push(g):b.push("'"+g+"'")}b=b.join(",");c="normal";f=a.V+"00";"o"===a.L?c="oblique":"i"===a.L&&(c="italic");e.s.style.cssText="display:block;position:absolute;top:-999px;left:-999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+
|
|
b+";"+("font-style:"+c+";font-weight:"+f+";")}function qa(e){k(e.c,"body",e.s)}function Qa(e,a,b,c,f,g,h,j){this.W=e;this.sa=a;this.c=b;this.q=c;this.C=j||"BESbswy";this.j=f;this.F={};this.T=g||5E3;this.Z=h||E;this.B=this.A=E;e=new w(this.c,this.C);qa(e);for(var m in ca)ca.hasOwnProperty(m)&&(u(e,new J(ca[m],P(this.q))),this.F[ca[m]]=e.s.offsetWidth);e.remove()}function va(a,b,c){for(var f in ca)if(ca.hasOwnProperty(f)&&b===a.F[ca[f]]&&c===a.F[ca[f]])return Q;return e}function Ra(e){var a=e.A.s.offsetWidth,
|
|
b=e.B.s.offsetWidth;a===e.F.serif&&b===e.F["sans-serif"]||e.j.U&&va(e,a,b)?aa()-e.xa>=e.T?e.j.U&&va(e,a,b)&&(e.Z===E||e.Z.hasOwnProperty(e.q.getName()))?W(e,e.W):W(e,e.sa):setTimeout(g(function(){Ra(this)},e),25):W(e,e.W)}function W(e,a){e.A.remove();e.B.remove();a(e.q)}function B(a,b,c,f){this.c=b;this.t=c;this.P=0;this.ba=this.Y=e;this.T=f;this.j=a.j}function ab(e,a,b,c,f){if(0===a.length&&f)$(e.t);else{e.P+=a.length;f&&(e.Y=f);for(f=0;f<a.length;f++){var h=a[f],j=b[h.getName()],m=e.t,k=h;l(m.m,
|
|
[m.g.f(m.h,k.getName(),P(k).toString(),"loading")]);v(m,"fontloading",k);(new Qa(g(e.ga,e),g(e.ha,e),e.c,h,e.j,e.T,c,j)).start()}}}function bb(e){0==--e.P&&e.Y&&(e.ba?(e=e.t,l(e.m,[e.g.f(e.h,"active")],[e.g.f(e.h,"loading"),e.g.f(e.h,"inactive")]),v(e,"active")):$(e.t))}function Sa(e){this.G=e;this.u=new x;this.ya=new A(e.navigator.userAgent,e.document);this.a=this.ya.parse();this.Q=this.R=0}function na(e,a){this.c=e;this.e=a;this.k=[]}function da(e,a){this.c=e;this.e=a;this.k=[]}function Ea(e,a){this.c=
|
|
e;this.e=a}function Fa(e,a,b){this.N=e?e:a+tb;this.p=[];this.S=[];this.ca=b||""}function ga(e){this.p=e;this.$=[];this.J={}}function wa(e,a){this.a=(new A(navigator.userAgent,j)).parse();this.c=e;this.e=a}function Ga(e,a){this.c=e;this.e=a;this.k=[]}var Q=!0,E=null,e=!1,Y=this,aa=Date.now||function(){return+new Date};m.prototype.createElement=function(e,a,b){e=this.z.createElement(e);if(a)for(var c in a)a.hasOwnProperty(c)&&("style"==c?e.style.cssText=a[c]:e.setAttribute(c,a[c]));b&&e.appendChild(this.z.createTextNode(b));
|
|
return e};a("webfont.BrowserInfo",C);C.prototype.pa=c("M");C.prototype.hasWebFontSupport=C.prototype.pa;C.prototype.qa=c("U");C.prototype.hasWebKitFallbackBug=C.prototype.qa;C.prototype.ra=c("Aa");C.prototype.hasWebKitMetricsBug=C.prototype.ra;var sb=/^([0-9]+)(?:[\._-]([0-9]+))?(?:[\._-]([0-9]+))?(?:[\._+-]?(.*))?$/;q.prototype.toString=function(){return[this.d,this.o||"",this.aa||"",this.f||""].join("")};a("webfont.UserAgent",z);z.prototype.getName=c("K");z.prototype.getName=z.prototype.getName;
|
|
z.prototype.oa=c("za");z.prototype.getVersion=z.prototype.oa;z.prototype.ka=c("fa");z.prototype.getEngine=z.prototype.ka;z.prototype.la=c("ea");z.prototype.getEngineVersion=z.prototype.la;z.prototype.ma=c("wa");z.prototype.getPlatform=z.prototype.ma;z.prototype.na=c("va");z.prototype.getPlatformVersion=z.prototype.na;z.prototype.ja=c("da");z.prototype.getDocumentMode=z.prototype.ja;z.prototype.ia=c("j");z.prototype.getBrowserInfo=z.prototype.ia;var ub=new z("Unknown",new q,"Unknown","Unknown",new q,
|
|
"Unknown","Unknown",new q,"Unknown",void 0,new C(e,e,e));A.prototype.parse=function(){var a;if(-1!=this.a.indexOf("MSIE")||-1!=this.a.indexOf("Trident/")){a=F(this);var b=T(this),c=y(b),f=E,g=E,h=E,j=E,m=G(this.a,/Trident\/([\d\w\.]+)/,1),k=O(this.I),f=-1!=this.a.indexOf("MSIE")?G(this.a,/MSIE ([\d\w\.]+)/,1):G(this.a,/rv:([\d\w\.]+)/,1),g=y(f);""!=m?(h="Trident",j=y(m)):(h="Unknown",j=new q,m="Unknown");a=new z("MSIE",g,f,h,j,m,a,c,b,k,new C("Windows"==a&&6<=g.d||"Windows Phone"==a&&8<=c.d,e,e))}else-1!=
|
|
this.a.indexOf("Opera")?(a="Unknown",b=G(this.a,/Presto\/([\d\w\.]+)/,1),c=y(b),f=T(this),g=y(f),h=O(this.I),c.d!==E?a="Presto":(-1!=this.a.indexOf("Gecko")&&(a="Gecko"),b=G(this.a,/rv:([^\)]+)/,1),c=y(b)),-1!=this.a.indexOf("Opera Mini/"))?(j=G(this.a,/Opera Mini\/([\d\.]+)/,1),m=y(j),a=new z("OperaMini",m,j,a,c,b,F(this),g,f,h,new C(e,e,e))):-1!=this.a.indexOf("Version/")&&(j=G(this.a,/Version\/([\d\.]+)/,1),m=y(j),m.d!==E)?a=new z("Opera",m,j,a,c,b,F(this),g,f,h,new C(10<=m.d,e,e)):(j=G(this.a,
|
|
/Opera[\/ ]([\d\.]+)/,1),m=y(j),a=m.d!==E?new z("Opera",m,j,a,c,b,F(this),g,f,h,new C(10<=m.d,e,e)):new z("Opera",new q,"Unknown",a,c,b,F(this),g,f,h,new C(e,e,e))):/OPR\/[\d.]+/.test(this.a)?a=L(this):/AppleWeb(K|k)it/.test(this.a)?a=L(this):-1!=this.a.indexOf("Gecko")?(a="Unknown",b=new q,c="Unknown",f=T(this),g=y(f),h=e,-1!=this.a.indexOf("Firefox")?(a="Firefox",c=G(this.a,/Firefox\/([\d\w\.]+)/,1),b=y(c),h=3<=b.d&&5<=b.o):-1!=this.a.indexOf("Mozilla")&&(a="Mozilla"),j=G(this.a,/rv:([^\)]+)/,1),
|
|
m=y(j),h||(h=1<m.d||1==m.d&&9<m.o||1==m.d&&9==m.o&&2<=m.aa||j.match(/1\.9\.1b[123]/)!=E||j.match(/1\.9\.1\.[\d\.]+/)!=E),a=new z(a,b,c,"Gecko",m,j,F(this),g,f,O(this.I),new C(h,e,e))):a=ub;return a};Z.prototype.f=function(e){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b].replace(/[\W_]+/g,"").toLowerCase());return a.join(this.ua)};J.prototype.getName=c("K");w.prototype.remove=function(){var e=this.s;e.parentNode&&e.parentNode.removeChild(e)};var ca={Da:"serif",Ca:"sans-serif",Ba:"monospace"};
|
|
Qa.prototype.start=function(){this.A=new w(this.c,this.C);qa(this.A);this.B=new w(this.c,this.C);qa(this.B);this.xa=aa();u(this.A,new J(this.q.getName()+",serif",P(this.q)));u(this.B,new J(this.q.getName()+",sans-serif",P(this.q)));Ra(this)};B.prototype.ga=function(e){var a=this.t;l(a.m,[a.g.f(a.h,e.getName(),P(e).toString(),"active")],[a.g.f(a.h,e.getName(),P(e).toString(),"loading"),a.g.f(a.h,e.getName(),P(e).toString(),"inactive")]);v(a,"fontactive",e);this.ba=Q;bb(this)};B.prototype.ha=function(e){var a=
|
|
this.t,b=s(a.m,a.g.f(a.h,e.getName(),P(e).toString(),"active")),c=[],f=[a.g.f(a.h,e.getName(),P(e).toString(),"loading")];b||c.push(a.g.f(a.h,e.getName(),P(e).toString(),"inactive"));l(a.m,c,f);v(a,"fontinactive",e);bb(this)};Sa.prototype.load=function(e){var a=e.context||this.G;this.c=new m(this.G,a);var a=new U(this.c,a.document.documentElement,e),b=[],c=e.timeout;l(a.m,[a.g.f(a.h,"loading")]);v(a,"loading");var b=this.u,f=this.c,h=[],j;for(j in e)if(e.hasOwnProperty(j)){var k=b.w[j];k&&h.push(k(e[j],
|
|
f))}b=h;this.Q=this.R=b.length;e=new B(this.a,this.c,a,c);j=0;for(c=b.length;j<c;j++)f=b[j],f.H(this.a,g(this.ta,this,f,a,e))};Sa.prototype.ta=function(e,a,b,c){var f=this;c?e.load(function(e,a,c){var g=0==--f.R;setTimeout(function(){ab(b,e,a||{},c||E,g)},0)}):(e=0==--this.R,this.Q--,e&&0==this.Q&&$(a),ab(b,[],{},E,e))};na.prototype.D=function(e){return p(this.c)+(this.e.api||"//f.fontdeck.com/s/css/js/")+(this.c.v.location.hostname||this.c.G.location.hostname)+"/"+e+".js"};na.prototype.H=function(a,
|
|
b){var c=this.e.id,f=this.c.v,g=this;c?(f.__webfontfontdeckmodule__||(f.__webfontfontdeckmodule__={}),f.__webfontfontdeckmodule__[c]=function(e,a){for(var c=0,f=a.fonts.length;c<f;++c){var h=a.fonts[c];g.k.push(new J(h.name,ma("font-weight:"+h.weight+";font-style:"+h.style)))}b(e)},r(this.c,this.D(c),function(a){a&&b(e)})):b(e)};na.prototype.load=function(e){e(this.k)};da.prototype.D=function(e){var a=p(this.c);return(this.e.api||a+"//use.typekit.net")+"/"+e+".js"};da.prototype.H=function(a,b){var c=
|
|
this.e.id,f=this.e,g=this.c.v,h=this;c?(g.__webfonttypekitmodule__||(g.__webfonttypekitmodule__={}),g.__webfonttypekitmodule__[c]=function(e){e(a,f,function(e,a,c){for(var f=0;f<a.length;f+=1){var g=c[a[f]];if(g)for(var j=0;j<g.length;j+=1)h.k.push(new J(a[f],g[j]));else h.k.push(new J(a[f]))}b(e)})},r(this.c,this.D(c),function(a){a&&b(e)},2E3)):b(e)};da.prototype.load=function(e){e(this.k)};Ea.prototype.load=function(e){var a,b,c=this.e.urls||[],f=this.e.families||[],g=this.e.testStrings||{};a=0;
|
|
for(b=c.length;a<b;a++)t(this.c,c[a]);c=[];a=0;for(b=f.length;a<b;a++){var h=f[a].split(":");if(h[1])for(var j=h[1].split(","),m=0;m<j.length;m+=1)c.push(new J(h[0],j[m]));else c.push(new J(h[0]))}e(c,g)};Ea.prototype.H=function(e,a){return a(e.j.M)};var tb="//fonts.googleapis.com/css";Fa.prototype.f=function(){if(0==this.p.length)throw Error("No fonts to load!");if(-1!=this.N.indexOf("kit="))return this.N;for(var e=this.p.length,a=[],b=0;b<e;b++)a.push(this.p[b].replace(/ /g,"+"));e=this.N+"?family="+
|
|
a.join("%7C");0<this.S.length&&(e+="&subset="+this.S.join(","));0<this.ca.length&&(e+="&text="+encodeURIComponent(this.ca));return e};var db={latin:"BESbswy",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},wb={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8",
|
|
"ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},xb={i:"i",italic:"i",n:"n",normal:"n"},yb=RegExp("^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$");ga.prototype.parse=function(){for(var e=this.p.length,a=0;a<e;a++){var b=this.p[a].split(":"),c=b[0].replace(/\+/g," "),f=["n4"];if(2<=b.length){var g,h=b[1];g=[];if(h)for(var h=h.split(","),j=h.length,m=0;m<j;m++){var k;k=h[m];if(k.match(/^[\w-]+$/)){k=
|
|
yb.exec(k.toLowerCase());var l=void 0;if(k==E)l="";else{l=k[1];if(l==E||""==l)l="4";else var r=wb[l],l=r?r:isNaN(l)?"4":l.substr(0,1);l=[k[2]==E||""==k[2]?"n":xb[k[2]],l].join("")}k=l}else k="";k&&g.push(k)}0<g.length&&(f=g);3==b.length&&(b=b[2],g=[],b=!b?g:b.split(","),0<b.length&&(b=db[b[0]])&&(this.J[c]=b))}this.J[c]||(b=db[c])&&(this.J[c]=b);for(b=0;b<f.length;b+=1)this.$.push(new J(c,f[b]))}};var zb={Arimo:Q,Cousine:Q,Tinos:Q};wa.prototype.H=function(e,a){a(e.j.M)};wa.prototype.load=function(e){var a=
|
|
this.c;if("MSIE"==this.a.getName()&&this.e.blocking!=Q){var b=g(this.X,this,e),c=function(){a.z.body?b():setTimeout(c,0)};c()}else this.X(e)};wa.prototype.X=function(e){for(var a=this.c,b=new Fa(this.e.api,p(a),this.e.text),c=this.e.families,f=c.length,g=0;g<f;g++){var h=c[g].split(":");3==h.length&&b.S.push(h.pop());var j="";2==h.length&&""!=h[1]&&(j=":");b.p.push(h.join(j))}c=new ga(c);c.parse();t(a,b.f());e(c.$,c.J,zb)};Ga.prototype.H=function(a,b){var c=this,f=c.e.projectId,g=c.e.version;if(f){var h=
|
|
c.c.v;r(this.c,c.D(f,g),function(g){if(g)b(e);else{if(h["__mti_fntLst"+f]&&(g=h["__mti_fntLst"+f]()))for(var j=0;j<g.length;j++)c.k.push(new J(g[j].fontfamily));b(a.j.M)}}).id="__MonotypeAPIScript__"+f}else b(e)};Ga.prototype.D=function(e,a){var b=p(this.c),c=(this.e.api||"fast.fonts.net/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return b+"//"+c+"/"+e+".js"+(a?"?v="+a:"")};Ga.prototype.load=function(e){e(this.k)};var ha=new Sa(Y);ha.u.w.custom=function(e,a){return new Ea(a,e)};ha.u.w.fontdeck=function(e,
|
|
a){return new na(a,e)};ha.u.w.monotype=function(e,a){return new Ga(a,e)};ha.u.w.typekit=function(e,a){return new da(a,e)};ha.u.w.google=function(e,a){return new wa(a,e)};Y.WebFont||(Y.WebFont={},Y.WebFont.load=g(ha.load,ha),Y.WebFontConfig&&ha.load(Y.WebFontConfig))})(this,document);
|
|
(function(b,j){function c(d){var n=d.length,a=e.type(d);return e.isWindow(d)?!1:1===d.nodeType&&n?!0:"array"===a||"function"!==a&&(0===n||"number"==typeof n&&0<n&&n-1 in d)}function a(d,n,a,b){if(e.acceptData(d)){var c,f,g=e.expando,h="string"==typeof n,m=d.nodeType,k=m?e.cache:d,l=m?d[g]:d[g]&&g;if(l&&k[l]&&(b||k[l].data)||!h||a!==j)return l||(m?d[g]=l=da.pop()||e.guid++:l=g),k[l]||(k[l]={},m||(k[l].toJSON=e.noop)),("object"==typeof n||"function"==typeof n)&&(b?k[l]=e.extend(k[l],n):k[l].data=e.extend(k[l].data,
|
|
n)),c=k[l],b||(c.data||(c.data={}),c=c.data),a!==j&&(c[e.camelCase(n)]=a),h?(f=c[n],null==f&&(f=c[e.camelCase(n)])):f=c,f}}function h(d,n,a){if(e.acceptData(d)){var b,c,f,h=d.nodeType,j=h?e.cache:d,m=h?d[e.expando]:e.expando;if(j[m]){if(n&&(f=a?j[m]:j[m].data)){e.isArray(n)?n=n.concat(e.map(n,e.camelCase)):n in f?n=[n]:(n=e.camelCase(n),n=n in f?[n]:n.split(" "));b=0;for(c=n.length;c>b;b++)delete f[n[b]];if(!(a?g:e.isEmptyObject)(f))return}(a||(delete j[m].data,g(j[m])))&&(h?e.cleanData([d],!0):e.support.deleteExpando||
|
|
j!=j.window?delete j[m]:j[m]=null)}}}function f(d,n,a){if(a===j&&1===d.nodeType){var b="data-"+n.replace(Ic,"-$1").toLowerCase();if(a=d.getAttribute(b),"string"==typeof a){try{a="true"===a?!0:"false"===a?!1:"null"===a?null:+a+""===a?+a:Jc.test(a)?e.parseJSON(a):a}catch(c){}e.data(d,n,a)}else a=j}return a}function g(d){for(var n in d)if(("data"!==n||!e.isEmptyObject(d[n]))&&"toJSON"!==n)return!1;return!0}function m(){return!0}function k(){return!1}function l(d,n){do d=d[n];while(d&&1!==d.nodeType);
|
|
return d}function s(d,n,a){if(n=n||0,e.isFunction(n))return e.grep(d,function(d,e){return!!n.call(d,e,d)===a});if(n.nodeType)return e.grep(d,function(d){return d===n===a});if("string"==typeof n){var b=e.grep(d,function(d){return 1===d.nodeType});if(Kc.test(n))return e.filter(n,b,!a);n=e.filter(n,b)}return e.grep(d,function(d){return 0<=e.inArray(d,n)===a})}function p(d){var n=bc.split("|");d=d.createDocumentFragment();if(d.createElement)for(;n.length;)d.createElement(n.pop());return d}function t(d){var n=
|
|
d.getAttributeNode("type");return d.type=(n&&n.specified)+"/"+d.type,d}function r(d){var n=Lc.exec(d.type);return n?d.type=n[1]:d.removeAttribute("type"),d}function C(d,n){for(var a,b=0;null!=(a=d[b]);b++)e._data(a,"globalEval",!n||e._data(n[b],"globalEval"))}function q(d,n){if(1===n.nodeType&&e.hasData(d)){var a,b,c;b=e._data(d);var f=e._data(n,b),g=b.events;if(g)for(a in delete f.handle,f.events={},g){b=0;for(c=g[a].length;c>b;b++)e.event.add(n,a,g[a][b])}f.data&&(f.data=e.extend({},f.data))}}function y(d,
|
|
n){var a,b,c=0,f=typeof d.getElementsByTagName!==W?d.getElementsByTagName(n||"*"):typeof d.querySelectorAll!==W?d.querySelectorAll(n||"*"):j;if(!f){f=[];for(a=d.childNodes||d;null!=(b=a[c]);c++)!n||e.nodeName(b,n)?f.push(b):e.merge(f,y(b,n))}return n===j||n&&e.nodeName(d,n)?e.merge([d],f):f}function z(d){Ab.test(d.type)&&(d.defaultChecked=d.checked)}function A(d,n){if(n in d)return n;for(var e=n.charAt(0).toUpperCase()+n.slice(1),a=n,b=cc.length;b--;)if(n=cc[b]+e,n in d)return n;return a}function F(d,
|
|
n){return d=n||d,"none"===e.css(d,"display")||!e.contains(d.ownerDocument,d)}function T(d,n){for(var a,b,c,f=[],g=0,h=d.length;h>g;g++)b=d[g],b.style&&(f[g]=e._data(b,"olddisplay"),a=b.style.display,n?(f[g]||"none"!==a||(b.style.display=""),""===b.style.display&&F(b)&&(f[g]=e._data(b,"olddisplay",Z(b.nodeName)))):f[g]||(c=F(b),(a&&"none"!==a||!c)&&e._data(b,"olddisplay",c?a:e.css(b,"display"))));for(g=0;h>g;g++)b=d[g],b.style&&(n&&"none"!==b.style.display&&""!==b.style.display||(b.style.display=n?
|
|
f[g]||"":"none"));return d}function L(d,n,e){return(d=Mc.exec(n))?Math.max(0,d[1]-(e||0))+(d[2]||"px"):n}function G(d,n,a,b,c){n=a===(b?"border":"content")?4:"width"===n?1:0;for(var f=0;4>n;n+=2)"margin"===a&&(f+=e.css(d,a+xa[n],!0,c)),b?("content"===a&&(f-=e.css(d,"padding"+xa[n],!0,c)),"margin"!==a&&(f-=e.css(d,"border"+xa[n]+"Width",!0,c))):(f+=e.css(d,"padding"+xa[n],!0,c),"padding"!==a&&(f+=e.css(d,"border"+xa[n]+"Width",!0,c)));return f}function O(d,n,a){var b=!0,c="width"===n?d.offsetWidth:
|
|
d.offsetHeight,f=ya(d),g=e.support.boxSizing&&"border-box"===e.css(d,"boxSizing",!1,f);if(0>=c||null==c){if(c=za(d,n,f),(0>c||null==c)&&(c=d.style[n]),eb.test(c))return c;b=g&&(e.support.boxSizingReliable||c===d.style[n]);c=parseFloat(c)||0}return c+G(d,n,a||(g?"border":"content"),b,f)+"px"}function Z(d){var n=B,a=dc[d];return a||(a=J(d,n),"none"!==a&&a||(Ua=(Ua||e("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(n.documentElement),n=(Ua[0].contentWindow||
|
|
Ua[0].contentDocument).document,n.write("<!doctype html><html><body>"),n.close(),a=J(d,n),Ua.detach()),dc[d]=a),a}function J(d,n){var a=e(n.createElement(d)).appendTo(n.body),b=e.css(a[0],"display");return a.remove(),b}function P(d,n,a,b){var c;if(e.isArray(n))e.each(n,function(n,e){a||Nc.test(d)?b(d,e):P(d+"["+("object"==typeof e?n:"")+"]",e,a,b)});else if(a||"object"!==e.type(n))b(d,n);else for(c in n)P(d+"["+c+"]",n[c],a,b)}function ma(d){return function(n,a){"string"!=typeof n&&(a=n,n="*");var b,
|
|
c=0,f=n.toLowerCase().match(aa)||[];if(e.isFunction(a))for(;b=f[c++];)"+"===b[0]?(b=b.slice(1)||"*",(d[b]=d[b]||[]).unshift(a)):(d[b]=d[b]||[]).push(a)}}function U(d,n,a,b){function c(h){var m;return f[h]=!0,e.each(d[h]||[],function(d,e){var h=e(n,a,b);return"string"!=typeof h||g||f[h]?g?!(m=h):j:(n.dataTypes.unshift(h),c(h),!1)}),m}var f={},g=d===Bb;return c(n.dataTypes[0])||!f["*"]&&c("*")}function $(d,n){var a,b,c=e.ajaxSettings.flatOptions||{};for(b in n)n[b]!==j&&((c[b]?d:a||(a={}))[b]=n[b]);
|
|
return a&&e.extend(!0,d,a),d}function v(){try{return new b.XMLHttpRequest}catch(d){}}function x(){return setTimeout(function(){Ha=j}),Ha=e.now()}function w(d,n,a){var b,c,f=0,g=fb.length,h=e.Deferred().always(function(){delete j.elem}),j=function(){if(c)return!1;for(var n=Ha||x(),n=Math.max(0,m.startTime+m.duration-n),e=1-(n/m.duration||0),a=0,b=m.tweens.length;b>a;a++)m.tweens[a].run(e);return h.notifyWith(d,[m,e,n]),1>e&&b?n:(h.resolveWith(d,[m]),!1)},m=h.promise({elem:d,props:e.extend({},n),opts:e.extend(!0,
|
|
{specialEasing:{}},a),originalProperties:n,originalOptions:a,startTime:Ha||x(),duration:a.duration,tweens:[],createTween:function(n,a){var b=e.Tween(d,m.opts,n,a,m.opts.specialEasing[n]||m.opts.easing);return m.tweens.push(b),b},stop:function(n){var e=0,a=n?m.tweens.length:0;if(c)return this;for(c=!0;a>e;e++)m.tweens[e].run(1);return n?h.resolveWith(d,[m,n]):h.rejectWith(d,[m,n]),this}});n=m.props;a=m.opts.specialEasing;var k,l,r,q;for(l in n)if(k=e.camelCase(l),r=a[k],b=n[l],e.isArray(b)&&(r=b[1],
|
|
b=n[l]=b[0]),l!==k&&(n[k]=b,delete n[l]),q=e.cssHooks[k],q&&"expand"in q)for(l in b=q.expand(b),delete n[k],b)l in n||(n[l]=b[l],a[l]=r);else a[k]=r;for(;g>f;f++)if(b=fb[f].call(m,d,n,m.opts))return b;var p=m;e.each(n,function(d,n){for(var e=(Va[d]||[]).concat(Va["*"]),a=0,b=e.length;b>a&&!e[a].call(p,d,n);a++);});return e.isFunction(m.opts.start)&&m.opts.start.call(d,m),e.fx.timer(e.extend(j,{elem:d,anim:m,queue:m.opts.queue})),m.progress(m.opts.progress).done(m.opts.done,m.opts.complete).fail(m.opts.fail).always(m.opts.always)}
|
|
function u(d,n,e,a,b){return new u.prototype.init(d,n,e,a,b)}function qa(d,n){var e,a={height:d},b=0;for(n=n?1:0;4>b;b+=2-n)e=xa[b],a["margin"+e]=a["padding"+e]=d;return n&&(a.opacity=a.width=d),a}function Qa(d){return e.isWindow(d)?d:9===d.nodeType?d.defaultView||d.parentWindow:!1}var va,Ra,W=typeof j,B=b.document,ab=b.location,bb=b.jQuery,Sa=b.$,na={},da=[],Ea=da.concat,Fa=da.push,ga=da.slice,wa=da.indexOf,Ga=na.toString,Q=na.hasOwnProperty,E="1.9.1".trim,e=function(d,n){return new e.fn.init(d,
|
|
n,Ra)},Y=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,aa=/\S+/g,sb=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ub=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,ca=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,tb=/^[\],:{}\s]*$/,db=/(?:^|:|,)(?:\s*\[)+/g,wb=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,xb=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yb=/^-ms-/,zb=/-([\da-z])/gi,ha=function(d,n){return n.toUpperCase()},oa=function(d){(B.addEventListener||"load"===d.type||"complete"===B.readyState)&&($b(),e.ready())},$b=function(){B.addEventListener?
|
|
(B.removeEventListener("DOMContentLoaded",oa,!1),b.removeEventListener("load",oa,!1)):(B.detachEvent("onreadystatechange",oa),b.detachEvent("onload",oa))};e.fn=e.prototype={jquery:"1.9.1",constructor:e,init:function(d,n,a){var b,c;if(!d)return this;if("string"==typeof d){if(b="<"===d.charAt(0)&&">"===d.charAt(d.length-1)&&3<=d.length?[null,d,null]:ub.exec(d),!b||!b[1]&&n)return!n||n.jquery?(n||a).find(d):this.constructor(n).find(d);if(b[1]){if(n=n instanceof e?n[0]:n,e.merge(this,e.parseHTML(b[1],
|
|
n&&n.nodeType?n.ownerDocument||n:B,!0)),ca.test(b[1])&&e.isPlainObject(n))for(b in n)e.isFunction(this[b])?this[b](n[b]):this.attr(b,n[b]);return this}if(c=B.getElementById(b[2]),c&&c.parentNode){if(c.id!==b[2])return a.find(d);this.length=1;this[0]=c}return this.context=B,this.selector=d,this}return d.nodeType?(this.context=this[0]=d,this.length=1,this):e.isFunction(d)?a.ready(d):(d.selector!==j&&(this.selector=d.selector,this.context=d.context),e.makeArray(d,this))},selector:"",length:0,size:function(){return this.length},
|
|
toArray:function(){return ga.call(this)},get:function(d){return null==d?this.toArray():0>d?this[this.length+d]:this[d]},pushStack:function(d){d=e.merge(this.constructor(),d);return d.prevObject=this,d.context=this.context,d},each:function(d,n){return e.each(this,d,n)},ready:function(d){return e.ready.promise().done(d),this},slice:function(){return this.pushStack(ga.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(d){var n=this.length;d=+d+
|
|
(0>d?n:0);return this.pushStack(0<=d&&n>d?[this[d]]:[])},map:function(d){return this.pushStack(e.map(this,function(n,e){return d.call(n,e,n)}))},end:function(){return this.prevObject||this.constructor(null)},push:Fa,sort:[].sort,splice:[].splice};e.fn.init.prototype=e.fn;e.extend=e.fn.extend=function(){var d,n,a,b,c,f,g=arguments[0]||{},h=1,m=arguments.length,k=!1;"boolean"==typeof g&&(k=g,g=arguments[1]||{},h=2);"object"==typeof g||e.isFunction(g)||(g={});for(m===h&&(g=this,--h);m>h;h++)if(null!=
|
|
(c=arguments[h]))for(b in c)d=g[b],a=c[b],g!==a&&(k&&a&&(e.isPlainObject(a)||(n=e.isArray(a)))?(n?(n=!1,f=d&&e.isArray(d)?d:[]):f=d&&e.isPlainObject(d)?d:{},g[b]=e.extend(k,f,a)):a!==j&&(g[b]=a));return g};e.extend({noConflict:function(d){return b.$===e&&(b.$=Sa),d&&b.jQuery===e&&(b.jQuery=bb),e},isReady:!1,readyWait:1,holdReady:function(d){d?e.readyWait++:e.ready(!0)},ready:function(d){if(!0===d?!--e.readyWait:!e.isReady){if(!B.body)return setTimeout(e.ready);e.isReady=!0;!0!==d&&0<--e.readyWait||
|
|
(va.resolveWith(B,[e]),e.fn.trigger&&e(B).trigger("ready").off("ready"))}},isFunction:function(d){return"function"===e.type(d)},isArray:Array.isArray||function(d){return"array"===e.type(d)},isWindow:function(d){return null!=d&&d==d.window},isNumeric:function(d){return!isNaN(parseFloat(d))&&isFinite(d)},type:function(d){return null==d?d+"":"object"==typeof d||"function"==typeof d?na[Ga.call(d)]||"object":typeof d},isPlainObject:function(d){if(!d||"object"!==e.type(d)||d.nodeType||e.isWindow(d))return!1;
|
|
try{if(d.constructor&&!Q.call(d,"constructor")&&!Q.call(d.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}for(var a in d);return a===j||Q.call(d,a)},isEmptyObject:function(d){for(var n in d)return!1;return!0},error:function(d){throw Error(d);},parseHTML:function(d,n,a){if(!d||"string"!=typeof d)return null;"boolean"==typeof n&&(a=n,n=!1);n=n||B;var b=ca.exec(d);a=!a&&[];return b?[n.createElement(b[1])]:(b=e.buildFragment([d],n,a),a&&e(a).remove(),e.merge([],b.childNodes))},parseJSON:function(d){return b.JSON&&
|
|
b.JSON.parse?b.JSON.parse(d):null===d?d:"string"==typeof d&&(d=e.trim(d),d&&tb.test(d.replace(wb,"@").replace(xb,"]").replace(db,"")))?Function("return "+d)():(e.error("Invalid JSON: "+d),j)},parseXML:function(d){var n,a;if(!d||"string"!=typeof d)return null;try{b.DOMParser?(a=new DOMParser,n=a.parseFromString(d,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(d))}catch(c){n=j}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||e.error("Invalid XML: "+
|
|
d),n},noop:function(){},globalEval:function(d){d&&e.trim(d)&&(b.execScript||function(d){b.eval.call(b,d)})(d)},camelCase:function(d){return d.replace(yb,"ms-").replace(zb,ha)},nodeName:function(d,n){return d.nodeName&&d.nodeName.toLowerCase()===n.toLowerCase()},each:function(d,n,e){var a,b=0,f=d.length,g=c(d);if(e)if(g)for(;f>b&&!(a=n.apply(d[b],e),!1===a);b++);else for(b in d){if(a=n.apply(d[b],e),!1===a)break}else if(g)for(;f>b&&!(a=n.call(d[b],b,d[b]),!1===a);b++);else for(b in d)if(a=n.call(d[b],
|
|
b,d[b]),!1===a)break;return d},trim:E&&!E.call("\ufeff\u00a0")?function(d){return null==d?"":E.call(d)}:function(d){return null==d?"":(d+"").replace(sb,"")},makeArray:function(d,n){var a=n||[];return null!=d&&(c(Object(d))?e.merge(a,"string"==typeof d?[d]:d):Fa.call(a,d)),a},inArray:function(d,n,e){var a;if(n){if(wa)return wa.call(n,d,e);a=n.length;for(e=e?0>e?Math.max(0,a+e):e:0;a>e;e++)if(e in n&&n[e]===d)return e}return-1},merge:function(d,n){var e=n.length,a=d.length,b=0;if("number"==typeof e)for(;e>
|
|
b;b++)d[a++]=n[b];else for(;n[b]!==j;)d[a++]=n[b++];return d.length=a,d},grep:function(d,n,e){var a,b=[],c=0,f=d.length;for(e=!!e;f>c;c++)a=!!n(d[c],c),e!==a&&b.push(d[c]);return b},map:function(d,e,a){var b,f=0,g=d.length,h=[];if(c(d))for(;g>f;f++)b=e(d[f],f,a),null!=b&&(h[h.length]=b);else for(f in d)b=e(d[f],f,a),null!=b&&(h[h.length]=b);return Ea.apply([],h)},guid:1,proxy:function(d,n){var a,b,c;return"string"==typeof n&&(c=d[n],n=d,d=c),e.isFunction(d)?(a=ga.call(arguments,2),b=function(){return d.apply(n||
|
|
this,a.concat(ga.call(arguments)))},b.guid=d.guid=d.guid||e.guid++,b):j},access:function(d,n,a,b,c,f,g){var h=0,m=d.length,k=null==a;if("object"===e.type(a))for(h in c=!0,a)e.access(d,n,h,a[h],!0,f,g);else if(b!==j&&(c=!0,e.isFunction(b)||(g=!0),k&&(g?(n.call(d,b),n=null):(k=n,n=function(d,n,a){return k.call(e(d),a)})),n))for(;m>h;h++)n(d[h],a,g?b:b.call(d[h],h,n(d[h],a)));return c?d:k?n.call(d):m?n(d[0],a):f},now:function(){return(new Date).getTime()}});e.ready.promise=function(d){if(!va)if(va=e.Deferred(),
|
|
"complete"===B.readyState)setTimeout(e.ready);else if(B.addEventListener)B.addEventListener("DOMContentLoaded",oa,!1),b.addEventListener("load",oa,!1);else{B.attachEvent("onreadystatechange",oa);b.attachEvent("onload",oa);var n=!1;try{n=null==b.frameElement&&B.documentElement}catch(a){}n&&n.doScroll&&function ja(){if(!e.isReady){try{n.doScroll("left")}catch(d){return setTimeout(ja,50)}$b();e.ready()}}()}return va.promise(d)};e.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),
|
|
function(d,e){na["[object "+e+"]"]=e.toLowerCase()});Ra=e(B);var ac={};e.Callbacks=function(d){var n;if("string"==typeof d){if(!(n=ac[d])){n=d;var a=ac[n]={};n=(e.each(n.match(aa)||[],function(d,e){a[e]=!0}),a)}}else n=e.extend({},d);d=n;var b,c,f,g,h,m,k=[],l=!d.once&&[],r=function(e){c=d.memory&&e;f=!0;h=m||0;m=0;g=k.length;for(b=!0;k&&g>h;h++)if(!1===k[h].apply(e[0],e[1])&&d.stopOnFalse){c=!1;break}b=!1;k&&(l?l.length&&r(l.shift()):c?k=[]:q.disable())},q={add:function(){if(k){var a=k.length;(function Oc(a){e.each(a,
|
|
function(a,n){var b=e.type(n);"function"===b?d.unique&&q.has(n)||k.push(n):n&&n.length&&"string"!==b&&Oc(n)})})(arguments);b?g=k.length:c&&(m=a,r(c))}return this},remove:function(){return k&&e.each(arguments,function(d,n){for(var a;-1<(a=e.inArray(n,k,a));)k.splice(a,1),b&&(g>=a&&g--,h>=a&&h--)}),this},has:function(d){return d?-1<e.inArray(d,k):!(!k||!k.length)},empty:function(){return k=[],this},disable:function(){return k=l=c=j,this},disabled:function(){return!k},lock:function(){return l=j,c||q.disable(),
|
|
this},locked:function(){return!l},fireWith:function(d,e){return e=e||[],e=[d,e.slice?e.slice():e],!k||f&&!l||(b?l.push(e):r(e)),this},fire:function(){return q.fireWith(this,arguments),this},fired:function(){return!!f}};return q};e.extend({Deferred:function(d){var a=[["resolve","done",e.Callbacks("once memory"),"resolved"],["reject","fail",e.Callbacks("once memory"),"rejected"],["notify","progress",e.Callbacks("memory")]],b="pending",c={state:function(){return b},always:function(){return f.done(arguments).fail(arguments),
|
|
this},then:function(){var d=arguments;return e.Deferred(function(b){e.each(a,function(a,n){var I=n[0],g=e.isFunction(d[a])&&d[a];f[n[1]](function(){var d=g&&g.apply(this,arguments);d&&e.isFunction(d.promise)?d.promise().done(b.resolve).fail(b.reject).progress(b.notify):b[I+"With"](this===c?b.promise():this,g?[d]:arguments)})});d=null}).promise()},promise:function(d){return null!=d?e.extend(d,c):c}},f={};return c.pipe=c.then,e.each(a,function(d,e){var g=e[2],h=e[3];c[e[1]]=g.add;h&&g.add(function(){b=
|
|
h},a[1^d][2].disable,a[2][2].lock);f[e[0]]=function(){return f[e[0]+"With"](this===f?c:this,arguments),this};f[e[0]+"With"]=g.fireWith}),c.promise(f),d&&d.call(f,f),f},when:function(d){var a=0,b=ga.call(arguments),c=b.length,f=1!==c||d&&e.isFunction(d.promise)?c:0,g=1===f?d:e.Deferred(),h=function(d,e,a){return function(n){e[d]=this;a[d]=1<arguments.length?ga.call(arguments):n;a===j?g.notifyWith(e,a):--f||g.resolveWith(e,a)}},j,m,k;if(1<c){j=Array(c);m=Array(c);for(k=Array(c);c>a;a++)b[a]&&e.isFunction(b[a].promise)?
|
|
b[a].promise().done(h(a,k,b)).fail(g.reject).progress(h(a,m,j)):--f}return f||g.resolveWith(k,b),g.promise()}});var Hc=e,rb;var N,Ya,pa,S,Za,$a,cb,vb,ec,Cb,D=B.createElement("div");if(D.setAttribute("className","t"),D.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",Ya=D.getElementsByTagName("*"),pa=D.getElementsByTagName("a")[0],!Ya||!pa||!Ya.length)rb={};else{Za=B.createElement("select");cb=Za.appendChild(B.createElement("option"));S=D.getElementsByTagName("input")[0];
|
|
pa.style.cssText="top:1px;float:left;opacity:.5";N={getSetAttribute:"t"!==D.className,leadingWhitespace:3===D.firstChild.nodeType,tbody:!D.getElementsByTagName("tbody").length,htmlSerialize:!!D.getElementsByTagName("link").length,style:/top/.test(pa.getAttribute("style")),hrefNormalized:"/a"===pa.getAttribute("href"),opacity:/^0.5/.test(pa.style.opacity),cssFloat:!!pa.style.cssFloat,checkOn:!!S.value,optSelected:cb.selected,enctype:!!B.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==B.createElement("nav").cloneNode(!0).outerHTML,
|
|
boxModel:"CSS1Compat"===B.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1};S.checked=!0;N.noCloneChecked=S.cloneNode(!0).checked;Za.disabled=!0;N.optDisabled=!cb.disabled;try{delete D.test}catch(Ed){N.deleteExpando=!1}S=B.createElement("input");S.setAttribute("value","");N.input=""===S.getAttribute("value");S.value="t";S.setAttribute("type","radio");N.radioValue="t"===S.value;S.setAttribute("checked",
|
|
"t");S.setAttribute("name","t");$a=B.createDocumentFragment();$a.appendChild(S);N.appendChecked=S.checked;N.checkClone=$a.cloneNode(!0).cloneNode(!0).lastChild.checked;D.attachEvent&&(D.attachEvent("onclick",function(){N.noCloneEvent=!1}),D.cloneNode(!0).click());for(Cb in{submit:!0,change:!0,focusin:!0})D.setAttribute(vb="on"+Cb,"t"),N[Cb+"Bubbles"]=vb in b||!1===D.attributes[vb].expando;rb=(D.style.backgroundClip="content-box",D.cloneNode(!0).style.backgroundClip="",N.clearCloneStyle="content-box"===
|
|
D.style.backgroundClip,e(function(){var d,e,a,c=B.getElementsByTagName("body")[0];c&&(d=B.createElement("div"),d.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",c.appendChild(d).appendChild(D),D.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=D.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",ec=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",N.reliableHiddenOffsets=ec&&0===a[0].offsetHeight,
|
|
D.innerHTML="",D.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",N.boxSizing=4===D.offsetWidth,N.doesNotIncludeMarginInBodyOffset=1!==c.offsetTop,b.getComputedStyle&&(N.pixelPosition="1%"!==(b.getComputedStyle(D,null)||{}).top,N.boxSizingReliable="4px"===(b.getComputedStyle(D,null)||{width:"4px"}).width,e=D.appendChild(B.createElement("div")),e.style.cssText=D.style.cssText=
|
|
"padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",e.style.marginRight=e.style.width="0",D.style.width="1px",N.reliableMarginRight=!parseFloat((b.getComputedStyle(e,null)||{}).marginRight)),typeof D.style.zoom!==W&&(D.innerHTML="",D.style.cssText="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;width:1px;padding:1px;display:inline;zoom:1",N.inlineBlockNeedsLayout=
|
|
3===D.offsetWidth,D.style.display="block",D.innerHTML="<div></div>",D.firstChild.style.width="5px",N.shrinkWrapBlocks=3!==D.offsetWidth,N.inlineBlockNeedsLayout&&(c.style.zoom=1)),c.removeChild(d),D=null)}),Ya=Za=$a=cb=pa=S=null,N)}Hc.support=rb;var Jc=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Ic=/([A-Z])/g;e.extend({cache:{},expando:"jQuery"+("1.9.1"+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(d){return d=d.nodeType?e.cache[d[e.expando]]:
|
|
d[e.expando],!!d&&!g(d)},data:function(d,e,b){return a(d,e,b)},removeData:function(d,e){return h(d,e)},_data:function(d,e,b){return a(d,e,b,!0)},_removeData:function(d,e){return h(d,e,!0)},acceptData:function(d){if(d.nodeType&&1!==d.nodeType&&9!==d.nodeType)return!1;var a=d.nodeName&&e.noData[d.nodeName.toLowerCase()];return!a||!0!==a&&d.getAttribute("classid")===a}});e.fn.extend({data:function(d,a){var b,c,g=this[0],h=0,m=null;if(d===j){if(this.length&&(m=e.data(g),1===g.nodeType&&!e._data(g,"parsedAttrs"))){for(b=
|
|
g.attributes;b.length>h;h++)c=b[h].name,c.indexOf("data-")||(c=e.camelCase(c.slice(5)),f(g,c,m[c]));e._data(g,"parsedAttrs",!0)}return m}return"object"==typeof d?this.each(function(){e.data(this,d)}):e.access(this,function(a){return a===j?g?f(g,d,e.data(g,d)):null:(this.each(function(){e.data(this,d,a)}),j)},null,a,1<arguments.length,null,!0)},removeData:function(d){return this.each(function(){e.removeData(this,d)})}});e.extend({queue:function(d,a,b){var c;return d?(a=(a||"fx")+"queue",c=e._data(d,
|
|
a),b&&(!c||e.isArray(b)?c=e._data(d,a,e.makeArray(b)):c.push(b)),c||[]):j},dequeue:function(d,a){a=a||"fx";var b=e.queue(d,a),c=b.length,f=b.shift(),g=e._queueHooks(d,a),h=function(){e.dequeue(d,a)};"inprogress"===f&&(f=b.shift(),c--);(g.cur=f)&&("fx"===a&&b.unshift("inprogress"),delete g.stop,f.call(d,h,g));!c&&g&&g.empty.fire()},_queueHooks:function(d,a){var b=a+"queueHooks";return e._data(d,b)||e._data(d,b,{empty:e.Callbacks("once memory").add(function(){e._removeData(d,a+"queue");e._removeData(d,
|
|
b)})})}});e.fn.extend({queue:function(d,a){var b=2;return"string"!=typeof d&&(a=d,d="fx",b--),b>arguments.length?e.queue(this[0],d):a===j?this:this.each(function(){var b=e.queue(this,d,a);e._queueHooks(this,d);"fx"===d&&"inprogress"!==b[0]&&e.dequeue(this,d)})},dequeue:function(d){return this.each(function(){e.dequeue(this,d)})},delay:function(d,a){return d=e.fx?e.fx.speeds[d]||d:d,a=a||"fx",this.queue(a,function(a,e){var n=setTimeout(a,d);e.stop=function(){clearTimeout(n)}})},clearQueue:function(d){return this.queue(d||
|
|
"fx",[])},promise:function(d,a){var b,c=1,f=e.Deferred(),g=this,h=this.length,m=function(){--c||f.resolveWith(g,[g])};"string"!=typeof d&&(a=d,d=j);for(d=d||"fx";h--;)(b=e._data(g[h],d+"queueHooks"))&&b.empty&&(c++,b.empty.add(m));return m(),f.promise(a)}});var Ia,fc,Db=/[\t\r\n]/g,Pc=/\r/g,Qc=/^(?:input|select|textarea|button|object)$/i,Rc=/^(?:a|area)$/i,gc=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Eb=/^(?:checked|selected)$/i,
|
|
Aa=e.support.getSetAttribute,Fb=e.support.input;e.fn.extend({attr:function(d,a){return e.access(this,e.attr,d,a,1<arguments.length)},removeAttr:function(d){return this.each(function(){e.removeAttr(this,d)})},prop:function(d,a){return e.access(this,e.prop,d,a,1<arguments.length)},removeProp:function(d){return d=e.propFix[d]||d,this.each(function(){try{this[d]=j,delete this[d]}catch(a){}})},addClass:function(d){var a,b,c,f,g,h=0,j=this.length;a="string"==typeof d&&d;if(e.isFunction(d))return this.each(function(a){e(this).addClass(d.call(this,
|
|
a,this.className))});if(a)for(a=(d||"").match(aa)||[];j>h;h++)if(b=this[h],c=1===b.nodeType&&(b.className?(" "+b.className+" ").replace(Db," "):" ")){for(g=0;f=a[g++];)0>c.indexOf(" "+f+" ")&&(c+=f+" ");b.className=e.trim(c)}return this},removeClass:function(d){var a,b,c,f,g,h=0,j=this.length;a=0===arguments.length||"string"==typeof d&&d;if(e.isFunction(d))return this.each(function(a){e(this).removeClass(d.call(this,a,this.className))});if(a)for(a=(d||"").match(aa)||[];j>h;h++)if(b=this[h],c=1===
|
|
b.nodeType&&(b.className?(" "+b.className+" ").replace(Db," "):"")){for(g=0;f=a[g++];)for(;0<=c.indexOf(" "+f+" ");)c=c.replace(" "+f+" "," ");b.className=d?e.trim(c):""}return this},toggleClass:function(d,a){var b=typeof d,c="boolean"==typeof a;return e.isFunction(d)?this.each(function(b){e(this).toggleClass(d.call(this,b,this.className,a),a)}):this.each(function(){if("string"===b)for(var f,g=0,h=e(this),j=a,m=d.match(aa)||[];f=m[g++];)j=c?j:!h.hasClass(f),h[j?"addClass":"removeClass"](f);else(b===
|
|
W||"boolean"===b)&&(this.className&&e._data(this,"__className__",this.className),this.className=this.className||!1===d?"":e._data(this,"__className__")||"")})},hasClass:function(d){d=" "+d+" ";for(var a=0,e=this.length;e>a;a++)if(1===this[a].nodeType&&0<=(" "+this[a].className+" ").replace(Db," ").indexOf(d))return!0;return!1},val:function(d){var a,b,c,f=this[0];if(arguments.length)return c=e.isFunction(d),this.each(function(a){var n,f=e(this);1===this.nodeType&&(n=c?d.call(this,a,f.val()):d,null==
|
|
n?n="":"number"==typeof n?n+="":e.isArray(n)&&(n=e.map(n,function(d){return null==d?"":d+""})),b=e.valHooks[this.type]||e.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&b.set(this,n,"value")!==j||(this.value=n))});if(f)return b=e.valHooks[f.type]||e.valHooks[f.nodeName.toLowerCase()],b&&"get"in b&&(a=b.get(f,"value"))!==j?a:(a=f.value,"string"==typeof a?a.replace(Pc,""):null==a?"":a)}});e.extend({valHooks:{option:{get:function(d){var a=d.attributes.value;return!a||a.specified?d.value:d.text}},
|
|
select:{get:function(d){for(var a,b=d.options,c=d.selectedIndex,f="select-one"===d.type||0>c,g=f?null:[],h=f?c+1:b.length,j=0>c?h:f?c:0;h>j;j++)if(a=b[j],!(!a.selected&&j!==c||(e.support.optDisabled?a.disabled:null!==a.getAttribute("disabled"))||a.parentNode.disabled&&e.nodeName(a.parentNode,"optgroup"))){if(d=e(a).val(),f)return d;g.push(d)}return g},set:function(d,a){var b=e.makeArray(a);return e(d).find("option").each(function(){this.selected=0<=e.inArray(e(this).val(),b)}),b.length||(d.selectedIndex=
|
|
-1),b}}},attr:function(d,a,b){var c,f,g,h=d.nodeType;if(d&&3!==h&&8!==h&&2!==h)return typeof d.getAttribute===W?e.prop(d,a,b):(f=1!==h||!e.isXMLDoc(d),f&&(a=a.toLowerCase(),c=e.attrHooks[a]||(gc.test(a)?fc:Ia)),b===j?c&&f&&"get"in c&&null!==(g=c.get(d,a))?g:(typeof d.getAttribute!==W&&(g=d.getAttribute(a)),null==g?j:g):null!==b?c&&f&&"set"in c&&(g=c.set(d,b,a))!==j?g:(d.setAttribute(a,b+""),b):(e.removeAttr(d,a),j))},removeAttr:function(d,a){var b,c,f=0,g=a&&a.match(aa);if(g&&1===d.nodeType)for(;b=
|
|
g[f++];)c=e.propFix[b]||b,gc.test(b)?!Aa&&Eb.test(b)?d[e.camelCase("default-"+b)]=d[c]=!1:d[c]=!1:e.attr(d,b,""),d.removeAttribute(Aa?b:c)},attrHooks:{type:{set:function(d,a){if(!e.support.radioValue&&"radio"===a&&e.nodeName(d,"input")){var b=d.value;return d.setAttribute("type",a),b&&(d.value=b),a}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",
|
|
frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(d,a,b){var c,f,g,h=d.nodeType;if(d&&3!==h&&8!==h&&2!==h)return g=1!==h||!e.isXMLDoc(d),g&&(a=e.propFix[a]||a,f=e.propHooks[a]),b!==j?f&&"set"in f&&(c=f.set(d,b,a))!==j?c:d[a]=b:f&&"get"in f&&null!==(c=f.get(d,a))?c:d[a]},propHooks:{tabIndex:{get:function(d){var a=d.getAttributeNode("tabindex");return a&&a.specified?parseInt(a.value,10):Qc.test(d.nodeName)||Rc.test(d.nodeName)&&d.href?0:j}}}});fc={get:function(d,a){var b=e.prop(d,
|
|
a),c="boolean"==typeof b&&d.getAttribute(a);return(b="boolean"==typeof b?Fb&&Aa?null!=c:Eb.test(a)?d[e.camelCase("default-"+a)]:!!c:d.getAttributeNode(a))&&!1!==b.value?a.toLowerCase():j},set:function(d,a,b){return!1===a?e.removeAttr(d,b):Fb&&Aa||!Eb.test(b)?d.setAttribute(!Aa&&e.propFix[b]||b,b):d[e.camelCase("default-"+b)]=d[b]=!0,b}};Fb&&Aa||(e.attrHooks.value={get:function(d,a){var b=d.getAttributeNode(a);return e.nodeName(d,"input")?d.defaultValue:b&&b.specified?b.value:j},set:function(d,a,b){return e.nodeName(d,
|
|
"input")?(d.defaultValue=a,j):Ia&&Ia.set(d,a,b)}});Aa||(Ia=e.valHooks.button={get:function(d,a){var e=d.getAttributeNode(a);return e&&("id"===a||"name"===a||"coords"===a?""!==e.value:e.specified)?e.value:j},set:function(d,a,e){var b=d.getAttributeNode(e);return b||d.setAttributeNode(b=d.ownerDocument.createAttribute(e)),b.value=a+="","value"===e||a===d.getAttribute(e)?a:j}},e.attrHooks.contenteditable={get:Ia.get,set:function(d,a,e){Ia.set(d,""===a?!1:a,e)}},e.each(["width","height"],function(d,a){e.attrHooks[a]=
|
|
e.extend(e.attrHooks[a],{set:function(d,e){return""===e?(d.setAttribute(a,"auto"),e):j}})}));e.support.hrefNormalized||(e.each(["href","src","width","height"],function(d,a){e.attrHooks[a]=e.extend(e.attrHooks[a],{get:function(d){d=d.getAttribute(a,2);return null==d?j:d}})}),e.each(["href","src"],function(d,a){e.propHooks[a]={get:function(d){return d.getAttribute(a,4)}}}));e.support.style||(e.attrHooks.style={get:function(d){return d.style.cssText||j},set:function(d,a){return d.style.cssText=a+""}});
|
|
e.support.optSelected||(e.propHooks.selected=e.extend(e.propHooks.selected,{get:function(d){d=d.parentNode;return d&&(d.selectedIndex,d.parentNode&&d.parentNode.selectedIndex),null}}));e.support.enctype||(e.propFix.enctype="encoding");e.support.checkOn||e.each(["radio","checkbox"],function(){e.valHooks[this]={get:function(d){return null===d.getAttribute("value")?"on":d.value}}});e.each(["radio","checkbox"],function(){e.valHooks[this]=e.extend(e.valHooks[this],{set:function(d,a){return e.isArray(a)?
|
|
d.checked=0<=e.inArray(e(d).val(),a):j}})});var Gb=/^(?:input|select|textarea)$/i,Sc=/^key/,Tc=/^(?:mouse|contextmenu)|click/,hc=/^(?:focusinfocus|focusoutblur)$/,ic=/^([^.]*)(?:\.(.+)|)$/;e.event={global:{},add:function(d,a,b,c,f){var g,h,m,k,l,r,q,p,t;if(m=e._data(d)){b.handler&&(k=b,b=k.handler,f=k.selector);b.guid||(b.guid=e.guid++);(h=m.events)||(h=m.events={});(l=m.handle)||(l=m.handle=function(d){return typeof e===W||d&&e.event.triggered===d.type?j:e.event.dispatch.apply(l.elem,arguments)},
|
|
l.elem=d);a=(a||"").match(aa)||[""];for(m=a.length;m--;)g=ic.exec(a[m])||[],p=r=g[1],t=(g[2]||"").split(".").sort(),g=e.event.special[p]||{},p=(f?g.delegateType:g.bindType)||p,g=e.event.special[p]||{},r=e.extend({type:p,origType:r,data:c,handler:b,guid:b.guid,selector:f,needsContext:f&&e.expr.match.needsContext.test(f),namespace:t.join(".")},k),(q=h[p])||(q=h[p]=[],q.delegateCount=0,g.setup&&!1!==g.setup.call(d,c,t,l)||(d.addEventListener?d.addEventListener(p,l,!1):d.attachEvent&&d.attachEvent("on"+
|
|
p,l))),g.add&&(g.add.call(d,r),r.handler.guid||(r.handler.guid=b.guid)),f?q.splice(q.delegateCount++,0,r):q.push(r),e.event.global[p]=!0;d=null}},remove:function(d,a,b,c,f){var g,h,j,m,k,l,r,q,p,t,s,y=e.hasData(d)&&e._data(d);if(y&&(l=y.events)){a=(a||"").match(aa)||[""];for(k=a.length;k--;)if(j=ic.exec(a[k])||[],p=s=j[1],t=(j[2]||"").split(".").sort(),p){r=e.event.special[p]||{};p=(c?r.delegateType:r.bindType)||p;q=l[p]||[];j=j[2]&&RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)");for(m=g=q.length;g--;)h=
|
|
q[g],!f&&s!==h.origType||b&&b.guid!==h.guid||j&&!j.test(h.namespace)||c&&c!==h.selector&&("**"!==c||!h.selector)||(q.splice(g,1),h.selector&&q.delegateCount--,r.remove&&r.remove.call(d,h));m&&!q.length&&(r.teardown&&!1!==r.teardown.call(d,t,y.handle)||e.removeEvent(d,p,y.handle),delete l[p])}else for(p in l)e.event.remove(d,p+a[k],b,c,!0);e.isEmptyObject(l)&&(delete y.handle,e._removeData(d,"events"))}},trigger:function(d,a,c,f){var g,h,m,k,l,r,q=[c||B],p=Q.call(d,"type")?d.type:d;r=Q.call(d,"namespace")?
|
|
d.namespace.split("."):[];if(m=g=c=c||B,3!==c.nodeType&&8!==c.nodeType&&!hc.test(p+e.event.triggered)&&(0<=p.indexOf(".")&&(r=p.split("."),p=r.shift(),r.sort()),h=0>p.indexOf(":")&&"on"+p,d=d[e.expando]?d:new e.Event(p,"object"==typeof d&&d),d.isTrigger=!0,d.namespace=r.join("."),d.namespace_re=d.namespace?RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,d.result=j,d.target||(d.target=c),a=null==a?[d]:e.makeArray(a,[d]),l=e.event.special[p]||{},f||!l.trigger||!1!==l.trigger.apply(c,a))){if(!f&&
|
|
!l.noBubble&&!e.isWindow(c)){k=l.delegateType||p;for(hc.test(k+p)||(m=m.parentNode);m;m=m.parentNode)q.push(m),g=m;g===(c.ownerDocument||B)&&q.push(g.defaultView||g.parentWindow||b)}for(r=0;(m=q[r++])&&!d.isPropagationStopped();)d.type=1<r?k:l.bindType||p,(g=(e._data(m,"events")||{})[d.type]&&e._data(m,"handle"))&&g.apply(m,a),(g=h&&m[h])&&e.acceptData(m)&&g.apply&&!1===g.apply(m,a)&&d.preventDefault();if(d.type=p,!(f||d.isDefaultPrevented()||l._default&&!1!==l._default.apply(c.ownerDocument,a)||
|
|
"click"===p&&e.nodeName(c,"a")||!e.acceptData(c)||!h||!c[p]||e.isWindow(c))){(g=c[h])&&(c[h]=null);e.event.triggered=p;try{c[p]()}catch(t){}e.event.triggered=j;g&&(c[h]=g)}return d.result}},dispatch:function(d){d=e.event.fix(d);var a,b,c,f,g,h=[],m=ga.call(arguments);a=(e._data(this,"events")||{})[d.type]||[];var k=e.event.special[d.type]||{};if(m[0]=d,d.delegateTarget=this,!k.preDispatch||!1!==k.preDispatch.call(this,d)){h=e.event.handlers.call(this,d,a);for(a=0;(f=h[a++])&&!d.isPropagationStopped();){d.currentTarget=
|
|
f.elem;for(g=0;(c=f.handlers[g++])&&!d.isImmediatePropagationStopped();)(!d.namespace_re||d.namespace_re.test(c.namespace))&&(d.handleObj=c,d.data=c.data,b=((e.event.special[c.origType]||{}).handle||c.handler).apply(f.elem,m),b!==j&&!1===(d.result=b)&&(d.preventDefault(),d.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,d),d.result}},handlers:function(d,a){var b,c,f,g,h=[],m=a.delegateCount,k=d.target;if(m&&k.nodeType&&(!d.button||"click"!==d.type))for(;k!=this;k=k.parentNode||
|
|
this)if(1===k.nodeType&&(!0!==k.disabled||"click"!==d.type)){f=[];for(g=0;m>g;g++)c=a[g],b=c.selector+" ",f[b]===j&&(f[b]=c.needsContext?0<=e(b,this).index(k):e.find(b,this,null,[k]).length),f[b]&&f.push(c);f.length&&h.push({elem:k,handlers:f})}return a.length>m&&h.push({elem:this,handlers:a.slice(m)}),h},fix:function(d){if(d[e.expando])return d;var a,b,c;a=d.type;var f=d,g=this.fixHooks[a];g||(this.fixHooks[a]=g=Tc.test(a)?this.mouseHooks:Sc.test(a)?this.keyHooks:{});c=g.props?this.props.concat(g.props):
|
|
this.props;d=new e.Event(f);for(a=c.length;a--;)b=c[a],d[b]=f[b];return d.target||(d.target=f.srcElement||B),3===d.target.nodeType&&(d.target=d.target.parentNode),d.metaKey=!!d.metaKey,g.filter?g.filter(d,f):d},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:["char","charCode","key","keyCode"],filter:function(d,a){return null==d.which&&(d.which=null!=a.charCode?a.charCode:a.keyCode),
|
|
d}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(d,a){var e,b,c,f=a.button,g=a.fromElement;return null==d.pageX&&null!=a.clientX&&(b=d.target.ownerDocument||B,c=b.documentElement,e=b.body,d.pageX=a.clientX+(c&&c.scrollLeft||e&&e.scrollLeft||0)-(c&&c.clientLeft||e&&e.clientLeft||0),d.pageY=a.clientY+(c&&c.scrollTop||e&&e.scrollTop||0)-(c&&c.clientTop||e&&e.clientTop||0)),!d.relatedTarget&&g&&(d.relatedTarget=
|
|
g===d.target?a.toElement:g),d.which||f===j||(d.which=1&f?1:2&f?3:4&f?2:0),d}},special:{load:{noBubble:!0},click:{trigger:function(){return e.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):j}},focus:{trigger:function(){if(this!==B.activeElement&&this.focus)try{return this.focus(),!1}catch(d){}},delegateType:"focusin"},blur:{trigger:function(){return this===B.activeElement&&this.blur?(this.blur(),!1):j},delegateType:"focusout"},beforeunload:{postDispatch:function(d){d.result!==
|
|
j&&(d.originalEvent.returnValue=d.result)}}},simulate:function(d,a,b,c){d=e.extend(new e.Event,b,{type:d,isSimulated:!0,originalEvent:{}});c?e.event.trigger(d,null,a):e.event.dispatch.call(a,d);d.isDefaultPrevented()&&b.preventDefault()}};e.removeEvent=B.removeEventListener?function(d,a,e){d.removeEventListener&&d.removeEventListener(a,e,!1)}:function(d,a,e){a="on"+a;d.detachEvent&&(typeof d[a]===W&&(d[a]=null),d.detachEvent(a,e))};e.Event=function(d,a){return this instanceof e.Event?(d&&d.type?(this.originalEvent=
|
|
d,this.type=d.type,this.isDefaultPrevented=d.defaultPrevented||!1===d.returnValue||d.getPreventDefault&&d.getPreventDefault()?m:k):this.type=d,a&&e.extend(this,a),this.timeStamp=d&&d.timeStamp||e.now(),this[e.expando]=!0,j):new e.Event(d,a)};e.Event.prototype={isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k,preventDefault:function(){var d=this.originalEvent;this.isDefaultPrevented=m;d&&(d.preventDefault?d.preventDefault():d.returnValue=!1)},stopPropagation:function(){var d=
|
|
this.originalEvent;this.isPropagationStopped=m;d&&(d.stopPropagation&&d.stopPropagation(),d.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=m;this.stopPropagation()}};e.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(d,a){e.event.special[d]={delegateType:a,bindType:a,handle:function(d){var b,c=d.relatedTarget,f=d.handleObj;return(!c||c!==this&&!e.contains(this,c))&&(d.type=f.origType,b=f.handler.apply(this,arguments),d.type=a),b}}});e.support.submitBubbles||
|
|
(e.event.special.submit={setup:function(){return e.nodeName(this,"form")?!1:(e.event.add(this,"click._submit keypress._submit",function(d){d=d.target;(d=e.nodeName(d,"input")||e.nodeName(d,"button")?d.form:j)&&!e._data(d,"submitBubbles")&&(e.event.add(d,"submit._submit",function(d){d._submit_bubble=!0}),e._data(d,"submitBubbles",!0))}),j)},postDispatch:function(d){d._submit_bubble&&(delete d._submit_bubble,this.parentNode&&!d.isTrigger&&e.event.simulate("submit",this.parentNode,d,!0))},teardown:function(){return e.nodeName(this,
|
|
"form")?!1:(e.event.remove(this,"._submit"),j)}});e.support.changeBubbles||(e.event.special.change={setup:function(){return Gb.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(e.event.add(this,"propertychange._change",function(d){"checked"===d.originalEvent.propertyName&&(this._just_changed=!0)}),e.event.add(this,"click._change",function(d){this._just_changed&&!d.isTrigger&&(this._just_changed=!1);e.event.simulate("change",this,d,!0)})),!1):(e.event.add(this,"beforeactivate._change",
|
|
function(d){d=d.target;Gb.test(d.nodeName)&&!e._data(d,"changeBubbles")&&(e.event.add(d,"change._change",function(d){!this.parentNode||d.isSimulated||d.isTrigger||e.event.simulate("change",this.parentNode,d,!0)}),e._data(d,"changeBubbles",!0))}),j)},handle:function(d){var a=d.target;return this!==a||d.isSimulated||d.isTrigger||"radio"!==a.type&&"checkbox"!==a.type?d.handleObj.handler.apply(this,arguments):j},teardown:function(){return e.event.remove(this,"._change"),!Gb.test(this.nodeName)}});e.support.focusinBubbles||
|
|
e.each({focus:"focusin",blur:"focusout"},function(d,a){var b=0,c=function(d){e.event.simulate(a,d.target,e.event.fix(d),!0)};e.event.special[a]={setup:function(){0===b++&&B.addEventListener(d,c,!0)},teardown:function(){0===--b&&B.removeEventListener(d,c,!0)}}});e.fn.extend({on:function(d,a,b,c,f){var g,h;if("object"==typeof d){"string"!=typeof a&&(b=b||a,a=j);for(g in d)this.on(g,a,b,d[g],f);return this}if(null==b&&null==c?(c=a,b=a=j):null==c&&("string"==typeof a?(c=b,b=j):(c=b,b=a,a=j)),!1===c)c=
|
|
k;else if(!c)return this;return 1===f&&(h=c,c=function(d){return e().off(d),h.apply(this,arguments)},c.guid=h.guid||(h.guid=e.guid++)),this.each(function(){e.event.add(this,d,c,b,a)})},one:function(d,a,b,e){return this.on(d,a,b,e,1)},off:function(d,a,b){var c,f;if(d&&d.preventDefault&&d.handleObj)return c=d.handleObj,e(d.delegateTarget).off(c.namespace?c.origType+"."+c.namespace:c.origType,c.selector,c.handler),this;if("object"==typeof d){for(f in d)this.off(f,a,d[f]);return this}return(!1===a||"function"==
|
|
typeof a)&&(b=a,a=j),!1===b&&(b=k),this.each(function(){e.event.remove(this,d,b,a)})},bind:function(d,a,b){return this.on(d,null,a,b)},unbind:function(d,a){return this.off(d,null,a)},delegate:function(d,a,b,e){return this.on(a,d,b,e)},undelegate:function(d,a,b){return 1===arguments.length?this.off(d,"**"):this.off(a,d||"**",b)},trigger:function(d,a){return this.each(function(){e.event.trigger(d,a,this)})},triggerHandler:function(d,a){var b=this[0];return b?e.event.trigger(d,a,b,!0):j}});var Hb=b,
|
|
Ib=function(){var d,a=[];return d=function(b,e){return a.push(b+=" ")>H.cacheLength&&delete d[a.shift()],d[b]=e}},ea=function(d){return d[M]=!0,d},ra=function(d){var a=V.createElement("div");try{return d(a)}catch(b){return!1}finally{}},K=function(d,a,b,e){var c,f,g,h,j;if((a?a.ownerDocument||a:Ba)!==V&&Ja(a),a=a||V,b=b||[],!d||"string"!=typeof d)return b;if(1!==(h=a.nodeType)&&9!==h)return[];if(!fa&&!e){if(c=Uc.exec(d))if(g=c[1])if(9===h){if(f=a.getElementById(g),!f||!f.parentNode)return b;if(f.id===
|
|
g)return b.push(f),b}else{if(a.ownerDocument&&(f=a.ownerDocument.getElementById(g))&&Wa(a,f)&&f.id===g)return b.push(f),b}else{if(c[2])return Ka.apply(b,La.call(a.getElementsByTagName(d),0)),b;if((g=c[3])&&R.getByClassName&&a.getElementsByClassName)return Ka.apply(b,La.call(a.getElementsByClassName(g),0)),b}if(R.qsa&&!ka.test(d)){if(c=!0,f=M,g=a,j=9===h&&d,1===h&&"object"!==a.nodeName.toLowerCase()){h=gb(d);(c=a.getAttribute("id"))?f=c.replace(Vc,"\\$&"):a.setAttribute("id",f);f="[id='"+f+"'] ";for(g=
|
|
h.length;g--;)h[g]=f+hb(h[g]);g=Jb.test(d)&&a.parentNode||a;j=h.join(",")}if(j)try{return Ka.apply(b,La.call(g.querySelectorAll(j),0)),b}catch(m){}finally{c||a.removeAttribute("id")}}}var k;a:{d=d.replace(ib,"$1");var l,r;f=gb(d);if(!e&&1===f.length){if(k=f[0]=f[0].slice(0),2<k.length&&"ID"===(l=k[0]).type&&9===a.nodeType&&!fa&&H.relative[k[1].type]){if(a=H.find.ID(l.matches[0].replace(sa,ta),a)[0],!a){k=b;break a}d=d.slice(k.shift().value.length)}for(h=jb.needsContext.test(d)?0:k.length;h--&&!(l=
|
|
k[h],H.relative[c=l.type]);)if((r=H.find[c])&&(e=r(l.matches[0].replace(sa,ta),Jb.test(k[0].type)&&a.parentNode||a))){if(k.splice(h,1),d=e.length&&hb(k),!d){k=(Ka.apply(b,La.call(e,0)),b);break a}break}}k=(Kb(d,f)(e,a,fa,b,Jb.test(d)),b)}return k},kc=function(d,a){var b=a&&d,e=b&&(~a.sourceIndex||jc)-(~d.sourceIndex||jc);if(e)return e;if(b)for(;b=b.nextSibling;)if(b===a)return-1;return d?1:-1},Wc=function(d){return function(a){return"input"===a.nodeName.toLowerCase()&&a.type===d}},Xc=function(d){return function(a){var b=
|
|
a.nodeName.toLowerCase();return("input"===b||"button"===b)&&a.type===d}},Ca=function(d){return ea(function(a){return a=+a,ea(function(b,e){for(var c,f=d([],b.length,a),g=f.length;g--;)b[c=f[g]]&&(b[c]=!(e[c]=b[c]))})})},gb=function(d,a){var b,e,c,f,g,h,j;if(g=lc[d+" "])return a?0:g.slice(0);g=d;h=[];for(j=H.preFilter;g;){(!b||(e=Yc.exec(g)))&&(e&&(g=g.slice(e[0].length)||g),h.push(c=[]));b=!1;(e=Zc.exec(g))&&(b=e.shift(),c.push({value:b,type:e[0].replace(ib," ")}),g=g.slice(b.length));for(f in H.filter)!(e=
|
|
jb[f].exec(g))||j[f]&&!(e=j[f](e))||(b=e.shift(),c.push({value:b,type:f,matches:e}),g=g.slice(b.length));if(!b)break}return a?g.length:g?K.error(d):lc(d,h).slice(0)},hb=function(d){for(var a=0,b=d.length,e="";b>a;a++)e+=d[a].value;return e},Lb=function(d,a,b){var e=a.dir,c=b&&"parentNode"===e,f=$c++;return a.first?function(a,b,f){for(;a=a[e];)if(1===a.nodeType||c)return d(a,b,f)}:function(a,b,g){var n,h,j,m=la+" "+f;if(g)for(;a=a[e];){if((1===a.nodeType||c)&&d(a,b,g))return!0}else for(;a=a[e];)if(1===
|
|
a.nodeType||c)if(j=a[M]||(a[M]={}),(h=j[e])&&h[0]===m){if(!0===(n=h[1])||n===kb)return!0===n}else if(h=j[e]=[m],h[1]=d(a,b,g)||kb,!0===h[1])return!0}},Mb=function(d){return 1<d.length?function(a,b,e){for(var c=d.length;c--;)if(!d[c](a,b,e))return!1;return!0}:d[0]},lb=function(d,a,b,e,c){for(var f,g=[],h=0,j=d.length,m=null!=a;j>h;h++)(f=d[h])&&(!b||b(f,e,c))&&(g.push(f),m&&a.push(h));return g},Nb=function(d,a,b,e,c,f){return e&&!e[M]&&(e=Nb(e)),c&&!c[M]&&(c=Nb(c,f)),ea(function(f,g,h,j){var m,k,l=
|
|
[],r=[],Ta=g.length,q;if(!(q=f)){q=a||"*";for(var p=h.nodeType?[h]:h,t=[],y=0,s=p.length;s>y;y++)K(q,p[y],t);q=t}q=!d||!f&&a?q:lb(q,l,d,h,j);p=b?c||(f?d:Ta||e)?[]:g:q;if(b&&b(q,p,h,j),e){m=lb(p,r);e(m,[],h,j);for(h=m.length;h--;)(k=m[h])&&(p[r[h]]=!(q[r[h]]=k))}if(f){if(c||d){if(c){m=[];for(h=p.length;h--;)(k=p[h])&&m.push(q[h]=k);c(null,p=[],m,j)}for(h=p.length;h--;)(k=p[h])&&-1<(m=c?Ob.call(f,k):l[h])&&(f[m]=!(g[m]=k))}}else p=lb(p===g?p.splice(Ta,p.length):p),c?c(null,g,p,j):Ka.apply(g,p)})},Pb=
|
|
function(d){var a,b,e,c=d.length,f=H.relative[d[0].type];b=f||H.relative[" "];for(var g=f?1:0,h=Lb(function(d){return d===a},b,!0),j=Lb(function(d){return-1<Ob.call(a,d)},b,!0),m=[function(d,b,e){return!f&&(e||b!==mb)||((a=b).nodeType?h(d,b,e):j(d,b,e))}];c>g;g++)if(b=H.relative[d[g].type])m=[Lb(Mb(m),b)];else{if(b=H.filter[d[g].type].apply(null,d[g].matches),b[M]){for(e=++g;c>e&&!H.relative[d[e].type];e++);return Nb(1<g&&Mb(m),1<g&&hb(d.slice(0,g-1)).replace(ib,"$1"),b,e>g&&Pb(d.slice(g,e)),c>e&&
|
|
Pb(d=d.slice(e)),c>e&&hb(d))}m.push(b)}return Mb(m)},mc=function(){},Ma,kb,H,nb,nc,Kb,Na,mb,Ja,V,X,fa,ka,Oa,ob,Wa,Qb,M="sizzle"+-new Date,Ba=Hb.document,R={},la=0,$c=0,oc=Ib(),lc=Ib(),pc=Ib(),jc=-2147483648,pb=[],ad=pb.pop,Ka=pb.push,La=pb.slice,Ob=pb.indexOf||function(d){for(var a=0,b=this.length;b>a;a++)if(this[a]===d)return a;return-1},qc="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w#"),rc="\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+
|
|
qc+")|)|)[\\x20\\t\\r\\n\\f]*\\]",Rb=":((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+rc.replace(3,8)+")*)|.*)\\)|)",ib=RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),Yc=/^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,Zc=/^[\x20\t\r\n\f]*([\x20\t\r\n\f>+~])[\x20\t\r\n\f]*/,bd=RegExp(Rb),cd=RegExp("^"+qc+"$"),jb={ID:/^#((?:\\.|[\w-]|[^\x00-\xa0])+)/,CLASS:/^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/,NAME:/^\[name=['"]?((?:\\.|[\w-]|[^\x00-\xa0])+)['"]?\]/,
|
|
TAG:RegExp("^("+"(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w*")+")"),ATTR:RegExp("^"+rc),PSEUDO:RegExp("^"+Rb),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),needsContext:RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Jb=/[\x20\t\r\n\f]*[+~]/,
|
|
Sb=/^[^{]+\{\s*\[native code/,Uc=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,dd=/^(?:input|select|textarea|button)$/i,ed=/^h\d$/i,Vc=/'|\\/g,fd=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,sa=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,ta=function(d,a){var b="0x"+a-65536;return b!==b?a:0>b?String.fromCharCode(b+65536):String.fromCharCode(55296|b>>10,56320|1023&b)};try{La.call(Ba.documentElement.childNodes,0)[0].nodeType}catch(Fd){La=function(d){for(var a,b=[];a=this[d++];)b.push(a);return b}}nc=K.isXML=function(d){return(d=
|
|
d&&(d.ownerDocument||d).documentElement)?"HTML"!==d.nodeName:!1};Ja=K.setDocument=function(d){var a=d?d.ownerDocument||d:Ba;if(a!==V&&9===a.nodeType&&a.documentElement){V=a;X=a.documentElement;fa=nc(a);R.tagNameNoComments=ra(function(d){return d.appendChild(a.createComment("")),!d.getElementsByTagName("*").length});R.attributes=ra(function(d){d.innerHTML="<select></select>";d=typeof d.lastChild.getAttribute("multiple");return"boolean"!==d&&"string"!==d});R.getByClassName=ra(function(d){return d.innerHTML=
|
|
"<div class='hidden e'></div><div class='hidden'></div>",d.getElementsByClassName&&d.getElementsByClassName("e").length?(d.lastChild.className="e",2===d.getElementsByClassName("e").length):!1});R.getByName=ra(function(d){d.id=M+0;d.innerHTML="<a name='"+M+"'></a><div name='"+M+"'></div>";X.insertBefore(d,X.firstChild);var b=a.getElementsByName&&a.getElementsByName(M).length===2+a.getElementsByName(M+0).length;return R.getIdNotName=!a.getElementById(M),X.removeChild(d),b});H.attrHandle=ra(function(d){return d.innerHTML=
|
|
"<a href='#'></a>",d.firstChild&&"undefined"!==typeof d.firstChild.getAttribute&&"#"===d.firstChild.getAttribute("href")})?{}:{href:function(d){return d.getAttribute("href",2)},type:function(d){return d.getAttribute("type")}};R.getIdNotName?(H.find.ID=function(d,a){if("undefined"!==typeof a.getElementById&&!fa){var b=a.getElementById(d);return b&&b.parentNode?[b]:[]}},H.filter.ID=function(d){var a=d.replace(sa,ta);return function(d){return d.getAttribute("id")===a}}):(H.find.ID=function(d,a){if("undefined"!==
|
|
typeof a.getElementById&&!fa){var b=a.getElementById(d);return b?b.id===d||"undefined"!==typeof b.getAttributeNode&&b.getAttributeNode("id").value===d?[b]:void 0:[]}},H.filter.ID=function(d){var a=d.replace(sa,ta);return function(d){return(d="undefined"!==typeof d.getAttributeNode&&d.getAttributeNode("id"))&&d.value===a}});H.find.TAG=R.tagNameNoComments?function(d,a){return"undefined"!==typeof a.getElementsByTagName?a.getElementsByTagName(d):void 0}:function(d,a){var b,e=[],c=0,f=a.getElementsByTagName(d);
|
|
if("*"===d){for(;b=f[c++];)1===b.nodeType&&e.push(b);return e}return f};H.find.NAME=R.getByName&&function(d,a){return"undefined"!==typeof a.getElementsByName?a.getElementsByName(name):void 0};H.find.CLASS=R.getByClassName&&function(d,a){return"undefined"===typeof a.getElementsByClassName||fa?void 0:a.getElementsByClassName(d)};Oa=[];ka=[":focus"];(R.qsa=Sb.test(a.querySelectorAll+""))&&(ra(function(d){d.innerHTML="<select><option selected=''></option></select>";d.querySelectorAll("[selected]").length||
|
|
ka.push("\\[[\\x20\\t\\r\\n\\f]*(?:checked|disabled|ismap|multiple|readonly|selected|value)");d.querySelectorAll(":checked").length||ka.push(":checked")}),ra(function(d){d.innerHTML="<input type='hidden' i=''/>";d.querySelectorAll("[i^='']").length&&ka.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:\"\"|'')");d.querySelectorAll(":enabled").length||ka.push(":enabled",":disabled");d.querySelectorAll("*,:x");ka.push(",.*:")}));d=R;var b;b=ob=X.matchesSelector||X.mozMatchesSelector||X.webkitMatchesSelector||X.oMatchesSelector||
|
|
X.msMatchesSelector;b=Sb.test(b+"");d=((d.matchesSelector=b)&&ra(function(d){R.disconnectedMatch=ob.call(d,"div");ob.call(d,"[s!='']:x");Oa.push("!=",Rb)}),ka=RegExp(ka.join("|")),Oa=RegExp(Oa.join("|")),Wa=Sb.test(X.contains+"")||X.compareDocumentPosition?function(d,a){var b=9===d.nodeType?d.documentElement:d,e=a&&a.parentNode;return d===e||!(!e||1!==e.nodeType||!(b.contains?b.contains(e):d.compareDocumentPosition&&16&d.compareDocumentPosition(e)))}:function(d,a){if(a)for(;a=a.parentNode;)if(a===
|
|
d)return!0;return!1},Qb=X.compareDocumentPosition?function(d,b){var e;return d===b?(Na=!0,0):(e=b.compareDocumentPosition&&d.compareDocumentPosition&&d.compareDocumentPosition(b))?1&e||d.parentNode&&11===d.parentNode.nodeType?d===a||Wa(Ba,d)?-1:b===a||Wa(Ba,b)?1:0:4&e?-1:1:d.compareDocumentPosition?-1:1}:function(d,b){var e,c=0;e=d.parentNode;var f=b.parentNode,g=[d],h=[b];if(d===b)return Na=!0,0;if(!e||!f)return d===a?-1:b===a?1:e?-1:f?1:0;if(e===f)return kc(d,b);for(e=d;e=e.parentNode;)g.unshift(e);
|
|
for(e=b;e=e.parentNode;)h.unshift(e);for(;g[c]===h[c];)c++;return c?kc(g[c],h[c]):g[c]===Ba?-1:h[c]===Ba?1:0},Na=!1,[0,0].sort(Qb),R.detectDuplicates=Na,V)}else d=V;return d};K.matches=function(d,a){return K(d,null,null,a)};K.matchesSelector=function(d,a){if((d.ownerDocument||d)!==V&&Ja(d),a=a.replace(fd,"='$1']"),!(!R.matchesSelector||fa||Oa&&Oa.test(a)||ka.test(a)))try{var b=ob.call(d,a);if(b||R.disconnectedMatch||d.document&&11!==d.document.nodeType)return b}catch(e){}return 0<K(a,V,null,[d]).length};
|
|
K.contains=function(d,a){return(d.ownerDocument||d)!==V&&Ja(d),Wa(d,a)};K.attr=function(d,a){var b;return(d.ownerDocument||d)!==V&&Ja(d),fa||(a=a.toLowerCase()),(b=H.attrHandle[a])?b(d):fa||R.attributes?d.getAttribute(a):((b=d.getAttributeNode(a))||d.getAttribute(a))&&!0===d[a]?a:b&&b.specified?b.value:null};K.error=function(d){throw Error("Syntax error, unrecognized expression: "+d);};K.uniqueSort=function(d){var a,b=[],e=1,c=0;if(Na=!R.detectDuplicates,d.sort(Qb),Na){for(;a=d[e];e++)a===d[e-1]&&
|
|
(c=b.push(e));for(;c--;)d.splice(b[c],1)}return d};nb=K.getText=function(d){var a,b="",e=0;if(a=d.nodeType)if(1===a||9===a||11===a){if("string"==typeof d.textContent)return d.textContent;for(d=d.firstChild;d;d=d.nextSibling)b+=nb(d)}else{if(3===a||4===a)return d.nodeValue}else for(;a=d[e];e++)b+=nb(a);return b};H=K.selectors={cacheLength:50,createPseudo:ea,match:jb,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},
|
|
preFilter:{ATTR:function(d){return d[1]=d[1].replace(sa,ta),d[3]=(d[4]||d[5]||"").replace(sa,ta),"~="===d[2]&&(d[3]=" "+d[3]+" "),d.slice(0,4)},CHILD:function(d){return d[1]=d[1].toLowerCase(),"nth"===d[1].slice(0,3)?(d[3]||K.error(d[0]),d[4]=+(d[4]?d[5]+(d[6]||1):2*("even"===d[3]||"odd"===d[3])),d[5]=+(d[7]+d[8]||"odd"===d[3])):d[3]&&K.error(d[0]),d},PSEUDO:function(d){var a,b=!d[5]&&d[2];return jb.CHILD.test(d[0])?null:(d[4]?d[2]=d[4]:b&&bd.test(b)&&(a=gb(b,!0))&&(a=b.indexOf(")",b.length-a)-b.length)&&
|
|
(d[0]=d[0].slice(0,a),d[2]=b.slice(0,a)),d.slice(0,3))}},filter:{TAG:function(d){return"*"===d?function(){return!0}:(d=d.replace(sa,ta).toLowerCase(),function(a){return a.nodeName&&a.nodeName.toLowerCase()===d})},CLASS:function(d){var a=oc[d+" "];return a||(a=RegExp("(^|[\\x20\\t\\r\\n\\f])"+d+"([\\x20\\t\\r\\n\\f]|$)"))&&oc(d,function(d){return a.test(d.className||"undefined"!==typeof d.getAttribute&&d.getAttribute("class")||"")})},ATTR:function(d,a,b){return function(e){e=K.attr(e,d);return null==
|
|
e?"!="===a:a?(e+="","="===a?e===b:"!="===a?e!==b:"^="===a?b&&0===e.indexOf(b):"*="===a?b&&-1<e.indexOf(b):"$="===a?b&&e.slice(-b.length)===b:"~="===a?-1<(" "+e+" ").indexOf(b):"|="===a?e===b||e.slice(0,b.length+1)===b+"-":!1):!0}},CHILD:function(d,a,b,e,c){var f="nth"!==d.slice(0,3),g="last"!==d.slice(-4),h="of-type"===a;return 1===e&&0===c?function(d){return!!d.parentNode}:function(a,b,n){var j,m,k,l,r;b=f!==g?"nextSibling":"previousSibling";var I=a.parentNode,p=h&&a.nodeName.toLowerCase();n=!n&&
|
|
!h;if(I){if(f){for(;b;){for(m=a;m=m[b];)if(h?m.nodeName.toLowerCase()===p:1===m.nodeType)return!1;r=b="only"===d&&!r&&"nextSibling"}return!0}if(r=[g?I.firstChild:I.lastChild],g&&n){n=I[M]||(I[M]={});j=n[d]||[];l=j[0]===la&&j[1];k=j[0]===la&&j[2];for(m=l&&I.childNodes[l];m=++l&&m&&m[b]||(k=l=0)||r.pop();)if(1===m.nodeType&&++k&&m===a){n[d]=[la,l,k];break}}else if(n&&(j=(a[M]||(a[M]={}))[d])&&j[0]===la)k=j[1];else for(;(m=++l&&m&&m[b]||(k=l=0)||r.pop())&&(!(h?m.nodeName.toLowerCase()===p:1===m.nodeType)||
|
|
!++k||!(n&&((m[M]||(m[M]={}))[d]=[la,k]),m===a)););return k-=c,k===e||0===k%e&&0<=k/e}}},PSEUDO:function(d,a){var b,e=H.pseudos[d]||H.setFilters[d.toLowerCase()]||K.error("unsupported pseudo: "+d);return e[M]?e(a):1<e.length?(b=[d,d,"",a],H.setFilters.hasOwnProperty(d.toLowerCase())?ea(function(d,b){for(var c,f=e(d,a),g=f.length;g--;)c=Ob.call(d,f[g]),d[c]=!(b[c]=f[g])}):function(d){return e(d,0,b)}):e}},pseudos:{not:ea(function(d){var a=[],b=[],e=Kb(d.replace(ib,"$1"));return e[M]?ea(function(d,
|
|
a,b,c){var f;b=e(d,null,c,[]);for(c=d.length;c--;)(f=b[c])&&(d[c]=!(a[c]=f))}):function(d,c,f){return a[0]=d,e(a,null,f,b),!b.pop()}}),has:ea(function(d){return function(a){return 0<K(d,a).length}}),contains:ea(function(d){return function(a){return-1<(a.textContent||a.innerText||nb(a)).indexOf(d)}}),lang:ea(function(d){return cd.test(d||"")||K.error("unsupported lang: "+d),d=d.replace(sa,ta).toLowerCase(),function(a){var b;do if(b=fa?a.getAttribute("xml:lang")||a.getAttribute("lang"):a.lang)return b=
|
|
b.toLowerCase(),b===d||0===b.indexOf(d+"-");while((a=a.parentNode)&&1===a.nodeType);return!1}}),target:function(d){var a=Hb.location&&Hb.location.hash;return a&&a.slice(1)===d.id},root:function(d){return d===X},focus:function(d){return d===V.activeElement&&(!V.hasFocus||V.hasFocus())&&!(!d.type&&!d.href&&!~d.tabIndex)},enabled:function(d){return!1===d.disabled},disabled:function(d){return!0===d.disabled},checked:function(d){var a=d.nodeName.toLowerCase();return"input"===a&&!!d.checked||"option"===
|
|
a&&!!d.selected},selected:function(d){return d.parentNode&&d.parentNode.selectedIndex,!0===d.selected},empty:function(d){for(d=d.firstChild;d;d=d.nextSibling)if("@"<d.nodeName||3===d.nodeType||4===d.nodeType)return!1;return!0},parent:function(d){return!H.pseudos.empty(d)},header:function(d){return ed.test(d.nodeName)},input:function(d){return dd.test(d.nodeName)},button:function(d){var a=d.nodeName.toLowerCase();return"input"===a&&"button"===d.type||"button"===a},text:function(d){var a;return"input"===
|
|
d.nodeName.toLowerCase()&&"text"===d.type&&(null==(a=d.getAttribute("type"))||a.toLowerCase()===d.type)},first:Ca(function(){return[0]}),last:Ca(function(d,a){return[a-1]}),eq:Ca(function(d,a,b){return[0>b?b+a:b]}),even:Ca(function(d,a){for(var b=0;a>b;b+=2)d.push(b);return d}),odd:Ca(function(d,a){for(var b=1;a>b;b+=2)d.push(b);return d}),lt:Ca(function(d,a,b){for(a=0>b?b+a:b;0<=--a;)d.push(a);return d}),gt:Ca(function(d,a,b){for(b=0>b?b+a:b;a>++b;)d.push(b);return d})}};for(Ma in{radio:!0,checkbox:!0,
|
|
file:!0,password:!0,image:!0})H.pseudos[Ma]=Wc(Ma);for(Ma in{submit:!0,reset:!0})H.pseudos[Ma]=Xc(Ma);Kb=K.compile=function(d,a){var b,e=[],c=[],f=pc[d+" "];if(!f){a||(a=gb(d));for(b=a.length;b--;)f=Pb(a[b]),f[M]?e.push(f):c.push(f);var g=0,h=0<e.length,j=0<c.length;b=function(d,a,b,f,n){var m,k,l=[],r=0,I="0",p=d&&[],q=null!=n,t=mb,y=d||j&&H.find.TAG("*",n&&a.parentNode||a),Ta=la+=null==t?1:Math.random()||0.1;for(q&&(mb=a!==V&&a,kb=g);null!=(n=y[I]);I++){if(j&&n){for(m=0;k=c[m++];)if(k(n,a,b)){f.push(n);
|
|
break}q&&(la=Ta,kb=++g)}h&&((n=!k&&n)&&r--,d&&p.push(n))}if(r+=I,h&&I!==r){for(m=0;k=e[m++];)k(p,l,a,b);if(d){if(0<r)for(;I--;)p[I]||l[I]||(l[I]=ad.call(f));l=lb(l)}Ka.apply(f,l);q&&!d&&0<l.length&&1<r+e.length&&K.uniqueSort(f)}return q&&(la=Ta,mb=t),p};b=h?ea(b):b;f=pc(d,b)}return f};H.pseudos.nth=H.pseudos.eq;H.filters=mc.prototype=H.pseudos;H.setFilters=new mc;Ja();K.attr=e.attr;e.find=K;e.expr=K.selectors;e.expr[":"]=e.expr.pseudos;e.unique=K.uniqueSort;e.text=K.getText;e.isXMLDoc=K.isXML;e.contains=
|
|
K.contains;var gd=/Until$/,hd=/^(?:parents|prev(?:Until|All))/,Kc=/^.[^:#\[\.,]*$/,sc=e.expr.match.needsContext,id={children:!0,contents:!0,next:!0,prev:!0};e.fn.extend({find:function(d){var a,b,c,f=this.length;if("string"!=typeof d)return c=this,this.pushStack(e(d).filter(function(){for(a=0;f>a;a++)if(e.contains(c[a],this))return!0}));b=[];for(a=0;f>a;a++)e.find(d,this[a],b);return b=this.pushStack(1<f?e.unique(b):b),b.selector=(this.selector?this.selector+" ":"")+d,b},has:function(d){var a,b=e(d,
|
|
this),c=b.length;return this.filter(function(){for(a=0;c>a;a++)if(e.contains(this,b[a]))return!0})},not:function(d){return this.pushStack(s(this,d,!1))},filter:function(d){return this.pushStack(s(this,d,!0))},is:function(d){return!!d&&("string"==typeof d?sc.test(d)?0<=e(d,this.context).index(this[0]):0<e.filter(d,this).length:0<this.filter(d).length)},closest:function(d,a){for(var b,c=0,f=this.length,g=[],h=sc.test(d)||"string"!=typeof d?e(d,a||this.context):0;f>c;c++)for(b=this[c];b&&b.ownerDocument&&
|
|
b!==a&&11!==b.nodeType;){if(h?-1<h.index(b):e.find.matchesSelector(b,d)){g.push(b);break}b=b.parentNode}return this.pushStack(1<g.length?e.unique(g):g)},index:function(d){return d?"string"==typeof d?e.inArray(this[0],e(d)):e.inArray(d.jquery?d[0]:d,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(d,a){var b="string"==typeof d?e(d,a):e.makeArray(d&&d.nodeType?[d]:d),b=e.merge(this.get(),b);return this.pushStack(e.unique(b))},addBack:function(d){return this.add(null==
|
|
d?this.prevObject:this.prevObject.filter(d))}});e.fn.andSelf=e.fn.addBack;e.each({parent:function(d){return(d=d.parentNode)&&11!==d.nodeType?d:null},parents:function(d){return e.dir(d,"parentNode")},parentsUntil:function(d,a,b){return e.dir(d,"parentNode",b)},next:function(d){return l(d,"nextSibling")},prev:function(d){return l(d,"previousSibling")},nextAll:function(d){return e.dir(d,"nextSibling")},prevAll:function(d){return e.dir(d,"previousSibling")},nextUntil:function(d,a,b){return e.dir(d,"nextSibling",
|
|
b)},prevUntil:function(d,a,b){return e.dir(d,"previousSibling",b)},siblings:function(d){return e.sibling((d.parentNode||{}).firstChild,d)},children:function(d){return e.sibling(d.firstChild)},contents:function(d){return e.nodeName(d,"iframe")?d.contentDocument||d.contentWindow.document:e.merge([],d.childNodes)}},function(d,a){e.fn[d]=function(b,c){var f=e.map(this,a,b);return gd.test(d)||(c=b),c&&"string"==typeof c&&(f=e.filter(c,f)),f=1<this.length&&!id[d]?e.unique(f):f,1<this.length&&hd.test(d)&&
|
|
(f=f.reverse()),this.pushStack(f)}});e.extend({filter:function(d,a,b){return b&&(d=":not("+d+")"),1===a.length?e.find.matchesSelector(a[0],d)?[a[0]]:[]:e.find.matches(d,a)},dir:function(d,a,b){var c=[];for(d=d[a];d&&9!==d.nodeType&&(b===j||1!==d.nodeType||!e(d).is(b));)1===d.nodeType&&c.push(d),d=d[a];return c},sibling:function(d,a){for(var b=[];d;d=d.nextSibling)1===d.nodeType&&d!==a&&b.push(d);return b}});var bc="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
|
|
jd=/ jQuery\d+="(?:null|\d+)"/g,tc=RegExp("<(?:"+bc+")[\\s/>]","i"),Tb=/^\s+/,uc=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vc=/<([\w:]+)/,wc=/<tbody/i,kd=/<|&#?\w+;/,ld=/<(?:script|style|link)/i,Ab=/^(?:checkbox|radio)$/i,md=/checked\s*(?:[^=]|=\s*.checked.)/i,xc=/^$|\/(?:java|ecma)script/i,Lc=/^true\/(.*)/,nd=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ba={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],
|
|
param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:e.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Ub=p(B).appendChild(B.createElement("div"));ba.optgroup=ba.option;ba.tbody=ba.tfoot=ba.colgroup=ba.caption=ba.thead;ba.th=ba.td;e.fn.extend({text:function(d){return e.access(this,function(d){return d===j?e.text(this):
|
|
this.empty().append((this[0]&&this[0].ownerDocument||B).createTextNode(d))},null,d,arguments.length)},wrapAll:function(d){if(e.isFunction(d))return this.each(function(a){e(this).wrapAll(d.call(this,a))});if(this[0]){var a=e(d,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&a.insertBefore(this[0]);a.map(function(){for(var d=this;d.firstChild&&1===d.firstChild.nodeType;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(d){return e.isFunction(d)?this.each(function(a){e(this).wrapInner(d.call(this,
|
|
a))}):this.each(function(){var a=e(this),b=a.contents();b.length?b.wrapAll(d):a.append(d)})},wrap:function(d){var a=e.isFunction(d);return this.each(function(b){e(this).wrapAll(a?d.call(this,b):d)})},unwrap:function(){return this.parent().each(function(){e.nodeName(this,"body")||e(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(d){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(d)})},prepend:function(){return this.domManip(arguments,
|
|
!0,function(d){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(d,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(d){this.parentNode&&this.parentNode.insertBefore(d,this)})},after:function(){return this.domManip(arguments,!1,function(d){this.parentNode&&this.parentNode.insertBefore(d,this.nextSibling)})},remove:function(d,a){for(var b,c=0;null!=(b=this[c]);c++)(!d||0<e.filter(d,[b]).length)&&(a||1!==b.nodeType||e.cleanData(y(b)),b.parentNode&&
|
|
(a&&e.contains(b.ownerDocument,b)&&C(y(b,"script")),b.parentNode.removeChild(b)));return this},empty:function(){for(var d,a=0;null!=(d=this[a]);a++){for(1===d.nodeType&&e.cleanData(y(d,!1));d.firstChild;)d.removeChild(d.firstChild);d.options&&e.nodeName(d,"select")&&(d.options.length=0)}return this},clone:function(d,a){return d=null==d?!1:d,a=null==a?d:a,this.map(function(){return e.clone(this,d,a)})},html:function(d){return e.access(this,function(d){var a=this[0]||{},b=0,c=this.length;if(d===j)return 1===
|
|
a.nodeType?a.innerHTML.replace(jd,""):j;if(!("string"!=typeof d||ld.test(d)||!e.support.htmlSerialize&&tc.test(d)||!e.support.leadingWhitespace&&Tb.test(d)||ba[(vc.exec(d)||["",""])[1].toLowerCase()])){d=d.replace(uc,"<$1></$2>");try{for(;c>b;b++)a=this[b]||{},1===a.nodeType&&(e.cleanData(y(a,!1)),a.innerHTML=d);a=0}catch(f){}}a&&this.empty().append(d)},null,d,arguments.length)},replaceWith:function(d){return e.isFunction(d)||"string"==typeof d||(d=e(d).not(this).detach()),this.domManip([d],!0,function(d){var a=
|
|
this.nextSibling,b=this.parentNode;b&&(e(this).remove(),b.insertBefore(d,a))})},detach:function(d){return this.remove(d,!0)},domManip:function(d,a,b){d=Ea.apply([],d);var c,f,g,h,m=0,k=this.length,l=this,p=k-1,q=d[0],s=e.isFunction(q);if(s||!(1>=k||"string"!=typeof q||e.support.checkClone)&&md.test(q))return this.each(function(e){var c=l.eq(e);s&&(d[0]=q.call(this,e,a?c.html():j));c.domManip(d,a,b)});if(k&&(h=e.buildFragment(d,this[0].ownerDocument,!1,this),c=h.firstChild,1===h.childNodes.length&&
|
|
(h=c),c)){a=a&&e.nodeName(c,"tr");g=e.map(y(h,"script"),t);for(f=g.length;k>m;m++)c=h,m!==p&&(c=e.clone(c,!0,!0),f&&e.merge(g,y(c,"script"))),b.call(a&&e.nodeName(this[m],"table")?this[m].getElementsByTagName("tbody")[0]||this[m].appendChild(this[m].ownerDocument.createElement("tbody")):this[m],c,m);if(f){h=g[g.length-1].ownerDocument;e.map(g,r);for(m=0;f>m;m++)c=g[m],xc.test(c.type||"")&&!e._data(c,"globalEval")&&e.contains(h,c)&&(c.src?e.ajax({url:c.src,type:"GET",dataType:"script",async:!1,global:!1,
|
|
"throws":!0}):e.globalEval((c.text||c.textContent||c.innerHTML||"").replace(nd,"")))}h=c=null}return this}});e.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(d,a){e.fn[d]=function(d){for(var b=0,c=[],f=e(d),g=f.length-1;g>=b;b++)d=b===g?this:this.clone(!0),e(f[b])[a](d),Fa.apply(c,d.get());return this.pushStack(c)}});e.extend({clone:function(d,a,b){var c,f,g,h,m,j=e.contains(d.ownerDocument,d);if(e.support.html5Clone||e.isXMLDoc(d)||
|
|
!tc.test("<"+d.nodeName+">")?g=d.cloneNode(!0):(Ub.innerHTML=d.outerHTML,Ub.removeChild(g=Ub.firstChild)),!(e.support.noCloneEvent&&e.support.noCloneChecked||1!==d.nodeType&&11!==d.nodeType||e.isXMLDoc(d))){c=y(g);m=y(d);for(h=0;null!=(f=m[h]);++h)if(c[h]){var k=c[h],l=void 0,p=void 0,s=void 0;if(1===k.nodeType){if(l=k.nodeName.toLowerCase(),!e.support.noCloneEvent&&k[e.expando]){s=e._data(k);for(p in s.events)e.removeEvent(k,p,s.handle);k.removeAttribute(e.expando)}"script"===l&&k.text!==f.text?
|
|
(t(k).text=f.text,r(k)):"object"===l?(k.parentNode&&(k.outerHTML=f.outerHTML),e.support.html5Clone&&f.innerHTML&&!e.trim(k.innerHTML)&&(k.innerHTML=f.innerHTML)):"input"===l&&Ab.test(f.type)?(k.defaultChecked=k.checked=f.checked,k.value!==f.value&&(k.value=f.value)):"option"===l?k.defaultSelected=k.selected=f.defaultSelected:("input"===l||"textarea"===l)&&(k.defaultValue=f.defaultValue)}}}if(a)if(b){m=m||y(d);c=c||y(g);for(h=0;null!=(f=m[h]);h++)q(f,c[h])}else q(d,g);return c=y(g,"script"),0<c.length&&
|
|
C(c,!j&&y(d,"script")),g},buildFragment:function(d,a,b,c){for(var f,g,h,m,j,k,l,r=d.length,q=p(a),t=[],s=0;r>s;s++)if(g=d[s],g||0===g)if("object"===e.type(g))e.merge(t,g.nodeType?[g]:g);else if(kd.test(g)){m=m||q.appendChild(a.createElement("div"));j=(vc.exec(g)||["",""])[1].toLowerCase();l=ba[j]||ba._default;m.innerHTML=l[1]+g.replace(uc,"<$1></$2>")+l[2];for(f=l[0];f--;)m=m.lastChild;if(!e.support.leadingWhitespace&&Tb.test(g)&&t.push(a.createTextNode(Tb.exec(g)[0])),!e.support.tbody)for(f=(g="table"!==
|
|
j||wc.test(g)?"<table>"!==l[1]||wc.test(g)?0:m:m.firstChild)&&g.childNodes.length;f--;)e.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k);e.merge(t,m.childNodes);for(m.textContent="";m.firstChild;)m.removeChild(m.firstChild);m=q.lastChild}else t.push(a.createTextNode(g));m&&q.removeChild(m);e.support.appendChecked||e.grep(y(t,"input"),z);for(s=0;g=t[s++];)if((!c||-1===e.inArray(g,c))&&(h=e.contains(g.ownerDocument,g),m=y(q.appendChild(g),"script"),h&&C(m),b))for(f=0;g=m[f++];)xc.test(g.type||
|
|
"")&&b.push(g);return q},cleanData:function(d,a){for(var b,c,f,g,h=0,m=e.expando,j=e.cache,k=e.support.deleteExpando,l=e.event.special;null!=(b=d[h]);h++)if((a||e.acceptData(b))&&(f=b[m],g=f&&j[f])){if(g.events)for(c in g.events)l[c]?e.event.remove(b,c):e.removeEvent(b,c,g.handle);j[f]&&(delete j[f],k?delete b[m]:typeof b.removeAttribute!==W?b.removeAttribute(m):b[m]=null,da.push(f))}}});var Ua,ya,za,Vb=/alpha\([^)]*\)/i,od=/opacity\s*=\s*([^)]*)/,pd=/^(top|right|bottom|left)$/,qd=/^(none|table(?!-c[ea]).+)/,
|
|
yc=/^margin/,Mc=RegExp("^("+Y+")(.*)$","i"),eb=RegExp("^("+Y+")(?!px)[a-z%]+$","i"),rd=RegExp("^([+-])=("+Y+")","i"),dc={BODY:"block"},sd={position:"absolute",visibility:"hidden",display:"block"},zc={letterSpacing:0,fontWeight:400},xa=["Top","Right","Bottom","Left"],cc=["Webkit","O","Moz","ms"];e.fn.extend({css:function(d,a){return e.access(this,function(d,a,b){var c,f={},g=0;if(e.isArray(a)){c=ya(d);for(b=a.length;b>g;g++)f[a[g]]=e.css(d,a[g],!1,c);return f}return b!==j?e.style(d,a,b):e.css(d,a)},
|
|
d,a,1<arguments.length)},show:function(){return T(this,!0)},hide:function(){return T(this)},toggle:function(d){var a="boolean"==typeof d;return this.each(function(){(a?d:F(this))?e(this).show():e(this).hide()})}});e.extend({cssHooks:{opacity:{get:function(d,a){if(a){var b=za(d,"opacity");return""===b?"1":b}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":e.support.cssFloat?"cssFloat":"styleFloat"},style:function(d,
|
|
a,b,c){if(d&&3!==d.nodeType&&8!==d.nodeType&&d.style){var f,g,h,m=e.camelCase(a),k=d.style;if(a=e.cssProps[m]||(e.cssProps[m]=A(k,m)),h=e.cssHooks[a]||e.cssHooks[m],b===j)return h&&"get"in h&&(f=h.get(d,!1,c))!==j?f:k[a];if(g=typeof b,"string"===g&&(f=rd.exec(b))&&(b=(f[1]+1)*f[2]+parseFloat(e.css(d,a)),g="number"),!(null==b||"number"===g&&isNaN(b)||("number"!==g||e.cssNumber[m]||(b+="px"),e.support.clearCloneStyle||""!==b||0!==a.indexOf("background")||(k[a]="inherit"),h&&"set"in h&&(b=h.set(d,b,
|
|
c))===j)))try{k[a]=b}catch(l){}}},css:function(d,a,b,c){var f,g,h,m=e.camelCase(a);return a=e.cssProps[m]||(e.cssProps[m]=A(d.style,m)),h=e.cssHooks[a]||e.cssHooks[m],h&&"get"in h&&(g=h.get(d,!0,b)),g===j&&(g=za(d,a,c)),"normal"===g&&a in zc&&(g=zc[a]),""===b||b?(f=parseFloat(g),!0===b||e.isNumeric(f)?f||0:g):g},swap:function(a,b,e,c){var f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=e.apply(a,c||[]);for(f in b)a.style[f]=g[f];return e}});b.getComputedStyle?(ya=function(a){return b.getComputedStyle(a,
|
|
null)},za=function(a,b,c){var f,g,h,m=(c=c||ya(a))?c.getPropertyValue(b)||c[b]:j,k=a.style;return c&&(""!==m||e.contains(a.ownerDocument,a)||(m=e.style(a,b)),eb.test(m)&&yc.test(b)&&(f=k.width,g=k.minWidth,h=k.maxWidth,k.minWidth=k.maxWidth=k.width=m,m=c.width,k.width=f,k.minWidth=g,k.maxWidth=h)),m}):B.documentElement.currentStyle&&(ya=function(a){return a.currentStyle},za=function(a,b,e){var c,f,g;e=(e=e||ya(a))?e[b]:j;var h=a.style;return null==e&&h&&h[b]&&(e=h[b]),eb.test(e)&&!pd.test(b)&&(c=
|
|
h.left,f=a.runtimeStyle,g=f&&f.left,g&&(f.left=a.currentStyle.left),h.left="fontSize"===b?"1em":e,e=h.pixelLeft+"px",h.left=c,g&&(f.left=g)),""===e?"auto":e});e.each(["height","width"],function(a,b){e.cssHooks[b]={get:function(a,d,c){return d?0===a.offsetWidth&&qd.test(e.css(a,"display"))?e.swap(a,sd,function(){return O(a,b,c)}):O(a,b,c):j},set:function(a,d,c){var f=c&&ya(a);return L(a,d,c?G(a,b,c,e.support.boxSizing&&"border-box"===e.css(a,"boxSizing",!1,f),f):0)}}});e.support.opacity||(e.cssHooks.opacity=
|
|
{get:function(a,b){return od.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?0.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,f=a.currentStyle,g=e.isNumeric(b)?"alpha(opacity="+100*b+")":"",h=f&&f.filter||c.filter||"";c.zoom=1;(1<=b||""===b)&&""===e.trim(h.replace(Vb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||f&&!f.filter)||(c.filter=Vb.test(h)?h.replace(Vb,g):h+" "+g)}});e(function(){e.support.reliableMarginRight||(e.cssHooks.marginRight=
|
|
{get:function(a,b){return b?e.swap(a,{display:"inline-block"},za,[a,"marginRight"]):j}});!e.support.pixelPosition&&e.fn.position&&e.each(["top","left"],function(a,b){e.cssHooks[b]={get:function(a,d){return d?(d=za(a,b),eb.test(d)?e(a).position()[b]+"px":d):j}}})});e.expr&&e.expr.filters&&(e.expr.filters.hidden=function(a){return 0>=a.offsetWidth&&0>=a.offsetHeight||!e.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||e.css(a,"display"))},e.expr.filters.visible=function(a){return!e.expr.filters.hidden(a)});
|
|
e.each({margin:"",padding:"",border:"Width"},function(a,b){e.cssHooks[a+b]={expand:function(e){var c=0,f={};for(e="string"==typeof e?e.split(" "):[e];4>c;c++)f[a+xa[c]+b]=e[c]||e[c-2]||e[0];return f}};yc.test(a)||(e.cssHooks[a+b].set=L)});var td=/%20/g,Nc=/\[\]$/,Ac=/\r?\n/g,ud=/^(?:submit|button|image|reset|file)$/i,vd=/^(?:input|select|textarea|keygen)/i;e.fn.extend({serialize:function(){return e.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=e.prop(this,
|
|
"elements");return a?e.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!e(this).is(":disabled")&&vd.test(this.nodeName)&&!ud.test(a)&&(this.checked||!Ab.test(a))}).map(function(a,b){var c=e(this).val();return null==c?null:e.isArray(c)?e.map(c,function(a){return{name:b.name,value:a.replace(Ac,"\r\n")}}):{name:b.name,value:c.replace(Ac,"\r\n")}}).get()}});e.param=function(a,b){var c,f=[],g=function(a,d){d=e.isFunction(d)?d():null==d?"":d;f[f.length]=encodeURIComponent(a)+"="+
|
|
encodeURIComponent(d)};if(b===j&&(b=e.ajaxSettings&&e.ajaxSettings.traditional),e.isArray(a)||a.jquery&&!e.isPlainObject(a))e.each(a,function(){g(this.name,this.value)});else for(c in a)P(c,a[c],b,g);return f.join("&").replace(td,"+")};e.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 contextmenu".split(" "),function(a,b){e.fn[b]=function(a,d){return 0<
|
|
arguments.length?this.on(b,null,a,d):this.trigger(b)}});e.fn.hover=function(a,b){return this.mouseenter(a).mouseleave(b||a)};var Da,ua,Wb=e.now(),Xb=/\?/,wd=/#.*$/,Bc=/([?&])_=[^&]*/,xd=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,yd=/^(?:GET|HEAD)$/,zd=/^\/\//,Cc=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Dc=e.fn.load,Ec={},Bb={},Fc="*/".concat("*");try{ua=ab.href}catch(Gd){ua=B.createElement("a"),ua.href="",ua=ua.href}Da=Cc.exec(ua.toLowerCase())||[];e.fn.load=function(a,b,c){if("string"!=typeof a&&Dc)return Dc.apply(this,
|
|
arguments);var f,g,h,m=this,k=a.indexOf(" ");return 0<=k&&(f=a.slice(k,a.length),a=a.slice(0,k)),e.isFunction(b)?(c=b,b=j):b&&"object"==typeof b&&(h="POST"),0<m.length&&e.ajax({url:a,type:h,dataType:"html",data:b}).done(function(a){g=arguments;m.html(f?e("<div>").append(e.parseHTML(a)).find(f):a)}).complete(c&&function(a,d){m.each(c,g||[a.responseText,d,a])}),this};e.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){e.fn[b]=function(a){return this.on(b,
|
|
a)}});e.each(["get","post"],function(a,b){e[b]=function(a,d,c,f){return e.isFunction(d)&&(f=f||c,c=d,d=j),e.ajax({url:a,type:b,dataType:f,data:d,success:c})}});e.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ua,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Da[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Fc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},
|
|
contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":b.String,"text html":!0,"text json":e.parseJSON,"text xml":e.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?$($(a,e.ajaxSettings),b):$(e.ajaxSettings,a)},ajaxPrefilter:ma(Ec),ajaxTransport:ma(Bb),ajax:function(a,b){function c(a,d,b,f){var g,n,p,u,v,I=d;if(2!==w){w=2;k&&clearTimeout(k);r=j;m=f||"";A.readyState=0<a?4:0;if(b){u=q;f=A;var ia,x,ja,F,B=u.contents,
|
|
J=u.dataTypes,E=u.responseFields;for(F in E)F in b&&(f[E[F]]=b[F]);for(;"*"===J[0];)J.shift(),x===j&&(x=u.mimeType||f.getResponseHeader("Content-Type"));if(x)for(F in B)if(B[F]&&B[F].test(x)){J.unshift(F);break}if(J[0]in b)ja=J[0];else{for(F in b){if(!J[0]||u.converters[F+" "+J[0]]){ja=F;break}ia||(ia=F)}ja=ja||ia}u=ja?(ja!==J[0]&&J.unshift(ja),b[ja]):j}if(200<=a&&300>a||304===a)if(q.ifModified&&(v=A.getResponseHeader("Last-Modified"),v&&(e.lastModified[h]=v),v=A.getResponseHeader("etag"),v&&(e.etag[h]=
|
|
v)),204===a)g=!0,I="nocontent";else if(304===a)g=!0,I="notmodified";else{var O;a:{b=q;g=u;var D,U;p={};v=0;I=b.dataTypes.slice();ia=I[0];if(b.dataFilter&&(g=b.dataFilter(g,b.dataType)),I[1])for(D in b.converters)p[D.toLowerCase()]=b.converters[D];for(;n=I[++v];)if("*"!==n){if("*"!==ia&&ia!==n){if(D=p[ia+" "+n]||p["* "+n],!D)for(O in p)if(U=O.split(" "),U[1]===n&&(D=p[ia+" "+U[0]]||p["* "+U[0]])){!0===D?D=p[O]:!0!==p[O]&&(n=U[0],I.splice(v--,0,n));break}if(!0!==D)if(D&&b["throws"])g=D(g);else try{g=
|
|
D(g)}catch(Z){O={state:"parsererror",error:D?Z:"No conversion from "+ia+" to "+n};break a}}ia=n}O={state:"success",data:g}}g=O;I=g.state;n=g.data;p=g.error;g=!p}else p=I,(a||!I)&&(I="error",0>a&&(a=0));A.status=a;A.statusText=(d||I)+"";g?y.resolveWith(t,[n,I,A]):y.rejectWith(t,[A,I,p]);A.statusCode(z);z=j;l&&s.trigger(g?"ajaxSuccess":"ajaxError",[A,q,g?n:p]);C.fireWith(t,[A,I]);l&&(s.trigger("ajaxComplete",[A,q]),--e.active||e.event.trigger("ajaxStop"))}}"object"==typeof a&&(b=a,a=j);b=b||{};var f,
|
|
g,h,m,k,l,r,p,q=e.ajaxSetup({},b),t=q.context||q,s=q.context&&(t.nodeType||t.jquery)?e(t):e.event,y=e.Deferred(),C=e.Callbacks("once memory"),z=q.statusCode||{},u={},v={},w=0,x="canceled",A={readyState:0,getResponseHeader:function(a){var d;if(2===w){if(!p)for(p={};d=xd.exec(m);)p[d[1].toLowerCase()]=d[2];d=p[a.toLowerCase()]}return null==d?null:d},getAllResponseHeaders:function(){return 2===w?m:null},setRequestHeader:function(a,d){var b=a.toLowerCase();return w||(a=v[b]=v[b]||a,u[a]=d),this},overrideMimeType:function(a){return w||
|
|
(q.mimeType=a),this},statusCode:function(a){var d;if(a)if(2>w)for(d in a)z[d]=[z[d],a[d]];else A.always(a[A.status]);return this},abort:function(a){a=a||x;return r&&r.abort(a),c(0,a),this}};if(y.promise(A).complete=C.add,A.success=A.done,A.error=A.fail,q.url=((a||q.url||ua)+"").replace(wd,"").replace(zd,Da[1]+"//"),q.type=b.method||b.type||q.method||q.type,q.dataTypes=e.trim(q.dataType||"*").toLowerCase().match(aa)||[""],null==q.crossDomain&&(f=Cc.exec(q.url.toLowerCase()),q.crossDomain=!(!f||f[1]===
|
|
Da[1]&&f[2]===Da[2]&&(f[3]||("http:"===f[1]?80:443))==(Da[3]||("http:"===Da[1]?80:443)))),q.data&&q.processData&&"string"!=typeof q.data&&(q.data=e.param(q.data,q.traditional)),U(Ec,q,b,A),2===w)return A;(l=q.global)&&0===e.active++&&e.event.trigger("ajaxStart");q.type=q.type.toUpperCase();q.hasContent=!yd.test(q.type);h=q.url;q.hasContent||(q.data&&(h=q.url+=(Xb.test(h)?"&":"?")+q.data,delete q.data),!1===q.cache&&(q.url=Bc.test(h)?h.replace(Bc,"$1_="+Wb++):h+(Xb.test(h)?"&":"?")+"_="+Wb++));q.ifModified&&
|
|
(e.lastModified[h]&&A.setRequestHeader("If-Modified-Since",e.lastModified[h]),e.etag[h]&&A.setRequestHeader("If-None-Match",e.etag[h]));(q.data&&q.hasContent&&!1!==q.contentType||b.contentType)&&A.setRequestHeader("Content-Type",q.contentType);A.setRequestHeader("Accept",q.dataTypes[0]&&q.accepts[q.dataTypes[0]]?q.accepts[q.dataTypes[0]]+("*"!==q.dataTypes[0]?", "+Fc+"; q=0.01":""):q.accepts["*"]);for(g in q.headers)A.setRequestHeader(g,q.headers[g]);if(q.beforeSend&&(!1===q.beforeSend.call(t,A,q)||
|
|
2===w))return A.abort();x="abort";for(g in{success:1,error:1,complete:1})A[g](q[g]);if(r=U(Bb,q,b,A)){A.readyState=1;l&&s.trigger("ajaxSend",[A,q]);q.async&&0<q.timeout&&(k=setTimeout(function(){A.abort("timeout")},q.timeout));try{w=1,r.send(u,c)}catch(F){if(!(2>w))throw F;c(-1,F)}}else c(-1,"No Transport");return A},getScript:function(a,b){return e.get(a,j,b,"script")},getJSON:function(a,b,c){return e.get(a,b,c,"json")}});e.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
|
|
contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return e.globalEval(a),a}}});e.ajaxPrefilter("script",function(a){a.cache===j&&(a.cache=!1);a.crossDomain&&(a.type="GET",a.global=!1)});e.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=B.head||e("head")[0]||B.documentElement;return{send:function(e,f){b=B.createElement("script");b.async=!0;a.scriptCharset&&(b.charset=a.scriptCharset);b.src=a.url;b.onload=b.onreadystatechange=function(a,d){(d||!b.readyState||
|
|
/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,d||f(200,"success"))};c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(j,!0)}}}});var Gc=[],Yb=/(=)\?(?=&|$)|\?\?/;e.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||e.expando+"_"+Wb++;return this[a]=!0,a}});e.ajaxPrefilter("json jsonp",function(a,c,f){var g,h,m,k=!1!==a.jsonp&&(Yb.test(a.url)?"url":"string"==typeof a.data&&!(a.contentType||"").indexOf("application/x-www-form-urlencoded")&&
|
|
Yb.test(a.data)&&"data");return k||"jsonp"===a.dataTypes[0]?(g=a.jsonpCallback=e.isFunction(a.jsonpCallback)?a.jsonpCallback():a.jsonpCallback,k?a[k]=a[k].replace(Yb,"$1"+g):!1!==a.jsonp&&(a.url+=(Xb.test(a.url)?"&":"?")+a.jsonp+"="+g),a.converters["script json"]=function(){return m||e.error(g+" was not called"),m[0]},a.dataTypes[0]="json",h=b[g],b[g]=function(){m=arguments},f.always(function(){b[g]=h;a[g]&&(a.jsonpCallback=c.jsonpCallback,Gc.push(g));m&&e.isFunction(h)&&h(m[0]);m=h=j}),"script"):
|
|
j});var Pa,Xa,Ad=0,Zb=b.ActiveXObject&&function(){for(var a in Pa)Pa[a](j,!0)};e.ajaxSettings.xhr=b.ActiveXObject?function(){var a;if(!(a=!this.isLocal&&v()))a:{try{a=new b.ActiveXObject("Microsoft.XMLHTTP");break a}catch(e){}a=void 0}return a}:v;Xa=e.ajaxSettings.xhr();e.support.cors=!!Xa&&"withCredentials"in Xa;(Xa=e.support.ajax=!!Xa)&&e.ajaxTransport(function(a){if(!a.crossDomain||e.support.cors){var c;return{send:function(f,g){var h,m,k=a.xhr();if(a.username?k.open(a.type,a.url,a.async,a.username,
|
|
a.password):k.open(a.type,a.url,a.async),a.xhrFields)for(m in a.xhrFields)k[m]=a.xhrFields[m];a.mimeType&&k.overrideMimeType&&k.overrideMimeType(a.mimeType);a.crossDomain||f["X-Requested-With"]||(f["X-Requested-With"]="XMLHttpRequest");try{for(m in f)k.setRequestHeader(m,f[m])}catch(l){}k.send(a.hasContent&&a.data||null);c=function(b,f){var m,l,r,q;try{if(c&&(f||4===k.readyState))if(c=j,h&&(k.onreadystatechange=e.noop,Zb&&delete Pa[h]),f)4!==k.readyState&&k.abort();else{q={};m=k.status;l=k.getAllResponseHeaders();
|
|
"string"==typeof k.responseText&&(q.text=k.responseText);try{r=k.statusText}catch(p){r=""}m||!a.isLocal||a.crossDomain?1223===m&&(m=204):m=q.text?200:404}}catch(t){f||g(-1,t)}q&&g(m,r,q,l)};a.async?4===k.readyState?setTimeout(c):(h=++Ad,Zb&&(Pa||(Pa={},e(b).unload(Zb)),Pa[h]=c),k.onreadystatechange=c):c()},abort:function(){c&&c(j,!0)}}}});var Ha,qb,Bd=/^(?:toggle|show|hide)$/,Cd=RegExp("^(?:([+-])=|)("+Y+")([a-z%]*)$","i"),Dd=/queueHooks$/,fb=[function(a,b,c){var f,g,h,m,k,j,l=this,r=a.style,q={},
|
|
p=[],t=a.nodeType&&F(a);c.queue||(k=e._queueHooks(a,"fx"),null==k.unqueued&&(k.unqueued=0,j=k.empty.fire,k.empty.fire=function(){k.unqueued||j()}),k.unqueued++,l.always(function(){l.always(function(){k.unqueued--;e.queue(a,"fx").length||k.empty.fire()})}));1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[r.overflow,r.overflowX,r.overflowY],"inline"===e.css(a,"display")&&"none"===e.css(a,"float")&&(e.support.inlineBlockNeedsLayout&&"inline"!==Z(a.nodeName)?r.zoom=1:r.display="inline-block"));
|
|
c.overflow&&(r.overflow="hidden",e.support.shrinkWrapBlocks||l.always(function(){r.overflow=c.overflow[0];r.overflowX=c.overflow[1];r.overflowY=c.overflow[2]}));for(g in b)if(h=b[g],Bd.exec(h))(delete b[g],f=f||"toggle"===h,h===(t?"hide":"show"))||p.push(g);if(b=p.length){h=e._data(a,"fxshow")||e._data(a,"fxshow",{});"hidden"in h&&(t=h.hidden);f&&(h.hidden=!t);t?e(a).show():l.done(function(){e(a).hide()});l.done(function(){var b;e._removeData(a,"fxshow");for(b in q)e.style(a,b,q[b])});for(g=0;b>g;g++)f=
|
|
p[g],m=l.createTween(f,t?h[f]:0),q[f]=h[f]||e.style(a,f),f in h||(h[f]=m.start,t&&(m.end=m.start,m.start="width"===f||"height"===f?1:0))}}],Va={"*":[function(a,b){var c,f,g=this.createTween(a,b),h=Cd.exec(b),m=g.cur(),k=+m||0,j=1,l=20;if(h){if(c=+h[2],f=h[3]||(e.cssNumber[a]?"":"px"),"px"!==f&&k){k=e.css(g.elem,a,!0)||c||1;do j=j||".5",k/=j,e.style(g.elem,a,k+f);while(j!==(j=g.cur()/m)&&1!==j&&--l)}g.unit=f;g.start=k;g.end=h[1]?k+(h[1]+1)*c:c}return g}]};e.Animation=e.extend(w,{tweener:function(a,
|
|
b){e.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,f=0,g=a.length;g>f;f++)c=a[f],Va[c]=Va[c]||[],Va[c].unshift(b)},prefilter:function(a,b){b?fb.unshift(a):fb.push(a)}});e.Tween=u;u.prototype={constructor:u,init:function(a,b,c,f,g,h){this.elem=a;this.prop=c;this.easing=g||"swing";this.options=b;this.start=this.now=this.cur();this.end=f;this.unit=h||(e.cssNumber[c]?"":"px")},cur:function(){var a=u.propHooks[this.prop];return a&&a.get?a.get(this):u.propHooks._default.get(this)},run:function(a){var b,
|
|
c=u.propHooks[this.prop];return this.pos=b=this.options.duration?e.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):u.propHooks._default.set(this),this}};u.prototype.init.prototype=u.prototype;u.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=e.css(a.elem,a.prop,""),b&&"auto"!==
|
|
b?b:0):a.elem[a.prop]},set:function(a){e.fx.step[a.prop]?e.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[e.cssProps[a.prop]]||e.cssHooks[a.prop])?e.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}};u.propHooks.scrollTop=u.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}};e.each(["toggle","show","hide"],function(a,b){var c=e.fn[b];e.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(qa(b,!0),
|
|
a,d,e)}});e.fn.extend({fadeTo:function(a,b,e,c){return this.filter(F).css("opacity",0).show().end().animate({opacity:b},a,e,c)},animate:function(a,b,c,f){var g=e.isEmptyObject(a),h=e.speed(b,c,f),m=function(){var b=w(this,e.extend({},a),h);m.finish=function(){b.stop(!0)};(g||e._data(this,"finish"))&&b.stop(!0)};return m.finish=m,g||!1===h.queue?this.each(m):this.queue(h.queue,m)},stop:function(a,b,c){var f=function(a){var b=a.stop;delete a.stop;b(c)};return"string"!=typeof a&&(c=b,b=a,a=j),b&&!1!==
|
|
a&&this.queue(a||"fx",[]),this.each(function(){var b=!0,g=null!=a&&a+"queueHooks",h=e.timers,m=e._data(this);if(g)m[g]&&m[g].stop&&f(m[g]);else for(g in m)m[g]&&m[g].stop&&Dd.test(g)&&f(m[g]);for(g=h.length;g--;)h[g].elem!==this||null!=a&&h[g].queue!==a||(h[g].anim.stop(c),b=!1,h.splice(g,1));(b||!c)&&e.dequeue(this,a)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var b,c=e._data(this),f=c[a+"queue"];b=c[a+"queueHooks"];var g=e.timers,h=f?f.length:0;c.finish=!0;e.queue(this,
|
|
a,[]);b&&b.cur&&b.cur.finish&&b.cur.finish.call(this);for(b=g.length;b--;)g[b].elem===this&&g[b].queue===a&&(g[b].anim.stop(!0),g.splice(b,1));for(b=0;h>b;b++)f[b]&&f[b].finish&&f[b].finish.call(this);delete c.finish})}});e.each({slideDown:qa("show"),slideUp:qa("hide"),slideToggle:qa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){e.fn[a]=function(a,d,e){return this.animate(b,a,d,e)}});e.speed=function(a,b,c){var f=a&&"object"==typeof a?e.extend({},
|
|
a):{complete:c||!c&&b||e.isFunction(a)&&a,duration:a,easing:c&&b||b&&!e.isFunction(b)&&b};return f.duration=e.fx.off?0:"number"==typeof f.duration?f.duration:f.duration in e.fx.speeds?e.fx.speeds[f.duration]:e.fx.speeds._default,(null==f.queue||!0===f.queue)&&(f.queue="fx"),f.old=f.complete,f.complete=function(){e.isFunction(f.old)&&f.old.call(this);f.queue&&e.dequeue(this,f.queue)},f};e.easing={linear:function(a){return a},swing:function(a){return 0.5-Math.cos(a*Math.PI)/2}};e.timers=[];e.fx=u.prototype.init;
|
|
e.fx.tick=function(){var a,b=e.timers,c=0;for(Ha=e.now();b.length>c;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||e.fx.stop();Ha=j};e.fx.timer=function(a){a()&&e.timers.push(a)&&e.fx.start()};e.fx.interval=13;e.fx.start=function(){qb||(qb=setInterval(e.fx.tick,e.fx.interval))};e.fx.stop=function(){clearInterval(qb);qb=null};e.fx.speeds={slow:600,fast:200,_default:400};e.fx.step={};e.expr&&e.expr.filters&&(e.expr.filters.animated=function(a){return e.grep(e.timers,function(b){return a===b.elem}).length});
|
|
e.fn.offset=function(a){if(arguments.length)return a===j?this:this.each(function(b){e.offset.setOffset(this,a,b)});var b,c,f={top:0,left:0},g=this[0],h=g&&g.ownerDocument;if(h)return b=h.documentElement,e.contains(b,g)?(typeof g.getBoundingClientRect!==W&&(f=g.getBoundingClientRect()),c=Qa(h),{top:f.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:f.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):f};e.offset={setOffset:function(a,b,c){var f=e.css(a,"position");"static"===f&&(a.style.position=
|
|
"relative");var g=e(a),h=g.offset(),m=e.css(a,"top"),k=e.css(a,"left"),j={},l={},r,q;("absolute"===f||"fixed"===f)&&-1<e.inArray("auto",[m,k])?(l=g.position(),r=l.top,q=l.left):(r=parseFloat(m)||0,q=parseFloat(k)||0);e.isFunction(b)&&(b=b.call(a,c,h));null!=b.top&&(j.top=b.top-h.top+r);null!=b.left&&(j.left=b.left-h.left+q);"using"in b?b.using.call(a,j):g.css(j)}};e.fn.extend({position:function(){if(this[0]){var a,b,c={top:0,left:0},f=this[0];return"fixed"===e.css(f,"position")?b=f.getBoundingClientRect():
|
|
(a=this.offsetParent(),b=this.offset(),e.nodeName(a[0],"html")||(c=a.offset()),c.top+=e.css(a[0],"borderTopWidth",!0),c.left+=e.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-e.css(f,"marginTop",!0),left:b.left-c.left-e.css(f,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||B.documentElement;a&&!e.nodeName(a,"html")&&"static"===e.css(a,"position");)a=a.offsetParent;return a||B.documentElement})}});e.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},
|
|
function(a,b){var c=/Y/.test(b);e.fn[a]=function(f){return e.access(this,function(a,d,f){var g=Qa(a);return f===j?g?b in g?g[b]:g.document.documentElement[d]:a[d]:(g?g.scrollTo(c?e(g).scrollLeft():f,c?f:e(g).scrollTop()):a[d]=f,j)},a,f,arguments.length,null)}});e.each({Height:"height",Width:"width"},function(a,b){e.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,f){e.fn[f]=function(f,g){var h=arguments.length&&(c||"boolean"!=typeof f),m=c||(!0===f||!0===g?"margin":"border");return e.access(this,
|
|
function(b,c,f){var g;return e.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(g=b.documentElement,Math.max(b.body["scroll"+a],g["scroll"+a],b.body["offset"+a],g["offset"+a],g["client"+a])):f===j?e.css(b,c,m):e.style(b,c,f,m)},b,h?f:j,h,null)}})});b.jQuery=b.$=e;"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return e})})(window);
|
|
(function(b,j){function c(c,f){var g,h,j,t=c.nodeName.toLowerCase();return"area"===t?(g=c.parentNode,h=g.name,c.href&&h&&"map"===g.nodeName.toLowerCase()?(j=b("img[usemap=#"+h+"]")[0],!!j&&a(j)):!1):(/input|select|textarea|button|object/.test(t)?!c.disabled:"a"===t?c.href||f:f)&&a(c)}function a(a){return b.expr.filters.visible(a)&&!b(a).parents().addBack().filter(function(){return"hidden"===b.css(this,"visibility")}).length}var h=0,f=/^ui-id-\d+$/;b.ui=b.ui||{};b.extend(b.ui,{version:"1.10.2",keyCode:{BACKSPACE:8,
|
|
COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,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,SPACE:32,TAB:9,UP:38}});b.fn.extend({focus:function(a){return function(c,f){return"number"==typeof c?this.each(function(){var a=this;setTimeout(function(){b(a).focus();f&&f.call(a)},c)}):a.apply(this,arguments)}}(b.fn.focus),scrollParent:function(){var a;return a=b.ui.ie&&/(static|relative)/.test(this.css("position"))||
|
|
/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(b.css(this,"position"))&&/(auto|scroll)/.test(b.css(this,"overflow")+b.css(this,"overflow-y")+b.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(b.css(this,"overflow")+b.css(this,"overflow-y")+b.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!a.length?b(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){var c,
|
|
f;for(a=b(this[0]);a.length&&a[0]!==document;){if(c=a.css("position"),("absolute"===c||"relative"===c||"fixed"===c)&&(f=parseInt(a.css("zIndex"),10),!isNaN(f)&&0!==f))return f;a=a.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++h)})},removeUniqueId:function(){return this.each(function(){f.test(this.id)&&b(this).removeAttr("id")})}});b.extend(b.expr[":"],{data:b.expr.createPseudo?b.expr.createPseudo(function(a){return function(c){return!!b.data(c,a)}}):
|
|
function(a,c,f){return!!b.data(a,f[3])},focusable:function(a){return c(a,!isNaN(b.attr(a,"tabindex")))},tabbable:function(a){var f=b.attr(a,"tabindex"),g=isNaN(f);return(g||0<=f)&&c(a,!g)}});b("<a>").outerWidth(1).jquery||b.each(["Width","Height"],function(a,c){function f(a,c,h,m){return b.each(g,function(){c-=parseFloat(b.css(a,"padding"+this))||0;h&&(c-=parseFloat(b.css(a,"border"+this+"Width"))||0);m&&(c-=parseFloat(b.css(a,"margin"+this))||0)}),c}var g="Width"===c?["Left","Right"]:["Top","Bottom"],
|
|
h=c.toLowerCase(),t={innerWidth:b.fn.innerWidth,innerHeight:b.fn.innerHeight,outerWidth:b.fn.outerWidth,outerHeight:b.fn.outerHeight};b.fn["inner"+c]=function(a){return a===j?t["inner"+c].call(this):this.each(function(){b(this).css(h,f(this,a)+"px")})};b.fn["outer"+c]=function(a,g){return"number"!=typeof a?t["outer"+c].call(this,a):this.each(function(){b(this).css(h,f(this,a,!0,g)+"px")})}});b.fn.addBack||(b.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))});
|
|
if(b("<a>").data("a-b","a").removeData("a-b").data("a-b")){var g=b.fn.removeData;b.fn.removeData=function(a){return arguments.length?g.call(this,b.camelCase(a)):g.call(this)}}b.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());b.support.selectstart="onselectstart"in document.createElement("div");b.fn.extend({disableSelection:function(){return this.bind((b.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});
|
|
b.extend(b.ui,{plugin:{add:function(a,c,f){var g;a=b.ui[a].prototype;for(g in f)a.plugins[g]=a.plugins[g]||[],a.plugins[g].push([c,f[g]])},call:function(a,b,c){var f=a.plugins[b];if(f&&a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType)for(b=0;f.length>b;b++)a.options[f[b][0]]&&f[b][1].apply(a.element,c)}},hasScroll:function(a,c){if("hidden"===b(a).css("overflow"))return!1;var f=c&&"left"===c?"scrollLeft":"scrollTop";return 0<a[f]?!0:(a[f]=1,a[f]=0,!1)}})})(jQuery);
|
|
(function(b,j){var c=0,a=Array.prototype.slice,h=b.cleanData;b.cleanData=function(a){for(var c,m=0;null!=(c=a[m]);m++)try{b(c).triggerHandler("remove")}catch(j){}h(a)};b.widget=function(a,c,h){var k,l,s,p,t={},r=a.split(".")[0];a=a.split(".")[1];k=r+"-"+a;h||(h=c,c=b.Widget);b.expr[":"][k.toLowerCase()]=function(a){return!!b.data(a,k)};b[r]=b[r]||{};l=b[r][a];s=b[r][a]=function(a,b){return this._createWidget?(arguments.length&&this._createWidget(a,b),j):new s(a,b)};b.extend(s,l,{version:h.version,
|
|
_proto:b.extend({},h),_childConstructors:[]});p=new c;p.options=b.widget.extend({},p.options);b.each(h,function(a,f){var h;if(b.isFunction(f)){var m=function(){return c.prototype[a].apply(this,arguments)},k=function(b){return c.prototype[a].apply(this,b)};h=(t[a]=function(){var a,b=this._super,c=this._superApply;return this._super=m,this._superApply=k,a=f.apply(this,arguments),this._super=b,this._superApply=c,a},j)}else h=(t[a]=f,j);return h});s.prototype=b.widget.extend(p,{widgetEventPrefix:l?p.widgetEventPrefix:
|
|
a},t,{constructor:s,namespace:r,widgetName:a,widgetFullName:k});l?(b.each(l._childConstructors,function(a,c){var f=c.prototype;b.widget(f.namespace+"."+f.widgetName,s,c._proto)}),delete l._childConstructors):c._childConstructors.push(s);b.widget.bridge(a,s)};b.widget.extend=function(c){for(var g,h,k=a.call(arguments,1),l=0,s=k.length;s>l;l++)for(g in k[l])h=k[l][g],k[l].hasOwnProperty(g)&&h!==j&&(c[g]=b.isPlainObject(h)?b.isPlainObject(c[g])?b.widget.extend({},c[g],h):b.widget.extend({},h):h);return c};
|
|
b.widget.bridge=function(c,g){var h=g.prototype.widgetFullName||c;b.fn[c]=function(k){var l="string"==typeof k,s=a.call(arguments,1),p=this;return k=!l&&s.length?b.widget.extend.apply(null,[k].concat(s)):k,l?this.each(function(){var a,g=b.data(this,h);return g?b.isFunction(g[k])&&"_"!==k.charAt(0)?(a=g[k].apply(g,s),a!==g&&a!==j?(p=a&&a.jquery?p.pushStack(a.get()):a,!1):j):b.error("no such method '"+k+"' for "+c+" widget instance"):b.error("cannot call methods on "+c+" prior to initialization; attempted to call method '"+
|
|
k+"'")}):this.each(function(){var a=b.data(this,h);a?a.option(k||{})._init():b.data(this,h,new g(k,this))}),p}};b.Widget=function(){};b.Widget._childConstructors=[];b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(a,g){g=b(g||this.defaultElement||this)[0];this.element=b(g);this.uuid=c++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=b.widget.extend({},this.options,this._getCreateOptions(),a);
|
|
this.bindings=b();this.hoverable=b();this.focusable=b();g!==this&&(b.data(g,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===g&&this.destroy()}}),this.document=b(g.style?g.ownerDocument:g.document||g),this.window=b(this.document[0].defaultView||this.document[0].parentWindow));this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:b.noop,_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){this._destroy();
|
|
this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(b.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:b.noop,widget:function(){return this.element},option:function(a,c){var h,k,l,s=a;
|
|
if(0===arguments.length)return b.widget.extend({},this.options);if("string"==typeof a)if(s={},h=a.split("."),a=h.shift(),h.length){k=s[a]=b.widget.extend({},this.options[a]);for(l=0;h.length-1>l;l++)k[h[l]]=k[h[l]]||{},k=k[h[l]];if(a=h.pop(),c===j)return k[a]===j?null:k[a];k[a]=c}else{if(c===j)return this.options[a]===j?null:this.options[a];s[a]=c}return this._setOptions(s),this},_setOptions:function(a){for(var b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=
|
|
b,"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!b).attr("aria-disabled",b),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(a,c,h){var k,l=this;"boolean"!=typeof a&&(h=c,c=a,a=!1);h?(c=k=b(c),this.bindings=this.bindings.add(c)):(h=c,c=this.element,k=this.widget());b.each(h,function(h,
|
|
m){function t(){return a||!0!==l.options.disabled&&!b(this).hasClass("ui-state-disabled")?("string"==typeof m?l[m]:m).apply(l,arguments):j}"string"!=typeof m&&(t.guid=m.guid=m.guid||t.guid||b.guid++);var r=h.match(/^(\w+)\s*(.*)$/),C=r[1]+l.eventNamespace;(r=r[2])?k.delegate(r,C,t):c.bind(C,t)})},_off:function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;a.unbind(b).undelegate(b)},_delay:function(a,b){var c=this;return setTimeout(function(){return("string"==typeof a?
|
|
c[a]:a).apply(c,arguments)},b||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._on(a,{mouseenter:function(a){b(a.currentTarget).addClass("ui-state-hover")},mouseleave:function(a){b(a.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._on(a,{focusin:function(a){b(a.currentTarget).addClass("ui-state-focus")},focusout:function(a){b(a.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(a,c,h){var j,l=this.options[a];
|
|
if(h=h||{},c=b.Event(c),c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase(),c.target=this.element[0],a=c.originalEvent)for(j in a)j in c||(c[j]=a[j]);return this.element.trigger(c,h),!(b.isFunction(l)&&!1===l.apply(this.element[0],[c].concat(h))||c.isDefaultPrevented())}};b.each({show:"fadeIn",hide:"fadeOut"},function(a,c){b.Widget.prototype["_"+a]=function(h,j,l){"string"==typeof j&&(j={effect:j});var s,p=j?!0===j||"number"==typeof j?c:j.effect||c:a;j=j||{};"number"==typeof j&&
|
|
(j={duration:j});s=!b.isEmptyObject(j);j.complete=l;j.delay&&h.delay(j.delay);s&&b.effects&&b.effects.effect[p]?h[a](j):p!==a&&h[p]?h[p](j.duration,j.easing,l):h.queue(function(c){b(this)[a]();l&&l.call(h[0]);c()})}})})(jQuery);
|
|
(function(b){var j=!1;b(document).mouseup(function(){j=!1});b.widget("ui.mouse",{version:"1.10.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(a){return c._mouseDown(a)}).bind("click."+this.widgetName,function(a){return!0===b.data(a.target,c.widgetName+".preventClickEvent")?(b.removeData(a.target,c.widgetName+".preventClickEvent"),a.stopImmediatePropagation(),!1):void 0});this.started=
|
|
!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);this._mouseMoveDelegate&&b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(c){if(!j){this._mouseStarted&&this._mouseUp(c);this._mouseDownEvent=c;var a=this,h=1===c.which,f="string"==typeof this.options.cancel&&c.target.nodeName?b(c.target).closest(this.options.cancel).length:!1;return h&&!f&&this._mouseCapture(c)?(this.mouseDelayMet=
|
|
!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){a.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=!1!==this._mouseStart(c),!this._mouseStarted)?(c.preventDefault(),!0):(!0===b.data(c.target,this.widgetName+".preventClickEvent")&&b.removeData(c.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(b){return a._mouseMove(b)},this._mouseUpDelegate=function(b){return a._mouseUp(b)},
|
|
b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),c.preventDefault(),j=!0,!0)):!0}},_mouseMove:function(c){return b.ui.ie&&(!document.documentMode||9>document.documentMode)&&!c.button?this._mouseUp(c):this._mouseStarted?(this._mouseDrag(c),c.preventDefault()):(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,c),this._mouseStarted?this._mouseDrag(c):this._mouseUp(c)),
|
|
!this._mouseStarted)},_mouseUp:function(c){return b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,c.target===this._mouseDownEvent.target&&b.data(c.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(c)),!1},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},
|
|
_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);
|
|
(function(b){b.widget("ui.draggable",b.ui.mouse,{version:"1.10.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||
|
|
/^(?: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(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(j){var c=this.options;return this.helper||c.disabled||0<b(j.target).closest(".ui-resizable-handle").length?
|
|
!1:(this.handle=this._getHandle(j),this.handle?(b(!0===c.iframeFix?"iframe":c.iframeFix).each(function(){b("<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(b(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(j){var c=this.options;return this.helper=this._createHelper(j),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),
|
|
b.ui.ddmanager&&(b.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},b.extend(this.offset,{click:{left:j.pageX-this.offset.left,top:j.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(j),
|
|
this.originalPageX=j.pageX,this.originalPageY=j.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),!1===this._trigger("start",j)?(this._clear(),!1):(this._cacheHelperProportions(),b.ui.ddmanager&&!c.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,j),this._mouseDrag(j,!0),b.ui.ddmanager&&b.ui.ddmanager.dragStart(this,j),!0)},_mouseDrag:function(j,c){if(this.position=this._generatePosition(j),this.positionAbs=this._convertPositionTo("absolute"),!c){var a=
|
|
this._uiHash();if(!1===this._trigger("drag",j,a))return this._mouseUp({}),!1;this.position=a.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),b.ui.ddmanager&&b.ui.ddmanager.drag(this,j),!1},_mouseStop:function(j){var c,a=this,h=!1,f=!1;b.ui.ddmanager&&!this.options.dropBehaviour&&(f=b.ui.ddmanager.drop(this,j));this.dropped&&(f=this.dropped,this.dropped=
|
|
!1);for(c=this.element[0];c&&(c=c.parentNode);)c===document&&(h=!0);return h||"original"!==this.options.helper?("invalid"===this.options.revert&&!f||"valid"===this.options.revert&&f||!0===this.options.revert||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,f)?b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==a._trigger("stop",j)&&a._clear()}):!1!==this._trigger("stop",j)&&this._clear(),!1):!1},_mouseUp:function(j){return b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),
|
|
b.ui.ddmanager&&b.ui.ddmanager.dragStop(this,j),b.ui.mouse.prototype._mouseUp.call(this,j)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(j){return this.options.handle?!!b(j.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(j){var c=this.options;j=b.isFunction(c.helper)?b(c.helper.apply(this.element[0],[j])):"clone"===c.helper?this.element.clone().removeAttr("id"):this.element;return j.parents("body").length||
|
|
j.appendTo("parent"===c.appendTo?this.element[0].parentNode:c.appendTo),j[0]===this.element[0]||/(fixed|absolute)/.test(j.css("position"))||j.css("position","absolute"),j},_adjustOffsetFromHelper:function(j){"string"==typeof j&&(j=j.split(" "));b.isArray(j)&&(j={left:+j[0],top:+j[1]||0});"left"in j&&(this.offset.click.left=j.left+this.margins.left);"right"in j&&(this.offset.click.left=this.helperProportions.width-j.right+this.margins.left);"top"in j&&(this.offset.click.top=j.top+this.margins.top);
|
|
"bottom"in j&&(this.offset.click.top=this.helperProportions.height-j.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var j=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])&&(j.left+=this.scrollParent.scrollLeft(),j.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&
|
|
b.ui.ie)&&(j={top:0,left:0}),{top:j.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:j.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}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 j,c,a;j=this.options;if("parent"===j.containment&&(j.containment=this.helper[0].parentNode),("document"===j.containment||"window"===j.containment)&&(this.containment=["document"===
|
|
j.containment?0:b(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"===j.containment?0:b(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"===j.containment?0:b(window).scrollLeft())+b("document"===j.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"===j.containment?0:b(window).scrollTop())+(b("document"===j.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-
|
|
this.margins.top]),/^(document|window|parent)$/.test(j.containment)||j.containment.constructor===Array)j.containment.constructor===Array&&(this.containment=j.containment);else if(!(c=b(j.containment),a=c[0],!a))j="hidden"!==b(a).css("overflow"),this.containment=[(parseInt(b(a).css("borderLeftWidth"),10)||0)+(parseInt(b(a).css("paddingLeft"),10)||0),(parseInt(b(a).css("borderTopWidth"),10)||0)+(parseInt(b(a).css("paddingTop"),10)||0),(j?Math.max(a.scrollWidth,a.offsetWidth):a.offsetWidth)-(parseInt(b(a).css("borderRightWidth"),
|
|
10)||0)-(parseInt(b(a).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(j?Math.max(a.scrollHeight,a.offsetHeight):a.offsetHeight)-(parseInt(b(a).css("borderBottomWidth"),10)||0)-(parseInt(b(a).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c},_convertPositionTo:function(j,c){c||(c=this.position);var a="absolute"===j?1:-1,h="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&
|
|
b.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,f=/(html|body)/i.test(h[0].tagName);return{top:c.top+this.offset.relative.top*a+this.offset.parent.top*a-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():f?0:h.scrollTop())*a,left:c.left+this.offset.relative.left*a+this.offset.parent.left*a-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():f?0:h.scrollLeft())*a}},_generatePosition:function(j){var c,a,h,f,g=this.options,m="absolute"!==this.cssPosition||
|
|
this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,k=/(html|body)/i.test(m[0].tagName),l=j.pageX,s=j.pageY;return this.originalPosition&&(this.containment&&(this.relative_container?(a=this.relative_container.offset(),c=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]):c=this.containment,j.pageX-this.offset.click.left<c[0]&&(l=c[0]+this.offset.click.left),j.pageY-this.offset.click.top<
|
|
c[1]&&(s=c[1]+this.offset.click.top),j.pageX-this.offset.click.left>c[2]&&(l=c[2]+this.offset.click.left),j.pageY-this.offset.click.top>c[3]&&(s=c[3]+this.offset.click.top)),g.grid&&(h=g.grid[1]?this.originalPageY+Math.round((s-this.originalPageY)/g.grid[1])*g.grid[1]:this.originalPageY,s=c?h-this.offset.click.top>=c[1]||h-this.offset.click.top>c[3]?h:h-this.offset.click.top>=c[1]?h-g.grid[1]:h+g.grid[1]:h,f=g.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/g.grid[0])*g.grid[0]:this.originalPageX,
|
|
l=c?f-this.offset.click.left>=c[0]||f-this.offset.click.left>c[2]?f:f-this.offset.click.left>=c[0]?f-g.grid[0]:f+g.grid[0]:f)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():k?0:m.scrollTop()),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():k?0:m.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=!1},_trigger:function(j,c,a){return a=a||this._uiHash(),b.ui.plugin.call(this,j,[c,a]),"drag"===j&&(this.positionAbs=this._convertPositionTo("absolute")),b.Widget.prototype._trigger.call(this,j,c,a)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});b.ui.plugin.add("draggable","connectToSortable",
|
|
{start:function(j,c){var a=b(this).data("ui-draggable"),h=a.options,f=b.extend({},c,{item:a.element});a.sortables=[];b(h.connectToSortable).each(function(){var c=b.data(this,"ui-sortable");c&&!c.options.disabled&&(a.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",j,f))})},stop:function(j,c){var a=b(this).data("ui-draggable"),h=b.extend({},c,{item:a.element});b.each(a.sortables,function(){this.instance.isOver?(this.instance.isOver=0,a.cancelHelperRemoval=
|
|
!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(j),this.instance.options.helper=this.instance.options._helper,"original"===a.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",j,h))})},drag:function(j,c){var a=b(this).data("ui-draggable"),h=this;b.each(a.sortables,function(){var f=!1,g=this;this.instance.positionAbs=a.positionAbs;
|
|
this.instance.helperProportions=a.helperProportions;this.instance.offset.click=a.offset.click;this.instance._intersectsWith(this.instance.containerCache)&&(f=!0,b.each(a.sortables,function(){return this.instance.positionAbs=a.positionAbs,this.instance.helperProportions=a.helperProportions,this.instance.offset.click=a.offset.click,this!==g&&this.instance._intersectsWith(this.instance.containerCache)&&b.contains(g.instance.element[0],this.instance.element[0])&&(f=!1),f}));f?(this.instance.isOver||(this.instance.isOver=
|
|
1,this.instance.currentItem=b(h).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},j.target=this.instance.currentItem[0],this.instance._mouseCapture(j,!0),this.instance._mouseStart(j,!0,!0),this.instance.offset.click.top=a.offset.click.top,this.instance.offset.click.left=a.offset.click.left,this.instance.offset.parent.left-=a.offset.parent.left-
|
|
this.instance.offset.parent.left,this.instance.offset.parent.top-=a.offset.parent.top-this.instance.offset.parent.top,a._trigger("toSortable",j),a.dropped=this.instance.element,a.currentItem=a.element,this.instance.fromOutside=a),this.instance.currentItem&&this.instance._mouseDrag(j)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",j,this.instance._uiHash(this.instance)),this.instance._mouseStop(j,!0),
|
|
this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),a._trigger("fromSortable",j),a.dropped=!1)})}});b.ui.plugin.add("draggable","cursor",{start:function(){var j=b("body"),c=b(this).data("ui-draggable").options;j.css("cursor")&&(c._cursor=j.css("cursor"));j.css("cursor",c.cursor)},stop:function(){var j=b(this).data("ui-draggable").options;j._cursor&&b("body").css("cursor",j._cursor)}});b.ui.plugin.add("draggable",
|
|
"opacity",{start:function(j,c){var a=b(c.helper),h=b(this).data("ui-draggable").options;a.css("opacity")&&(h._opacity=a.css("opacity"));a.css("opacity",h.opacity)},stop:function(j,c){var a=b(this).data("ui-draggable").options;a._opacity&&b(c.helper).css("opacity",a._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var j=b(this).data("ui-draggable");j.scrollParent[0]!==document&&"HTML"!==j.scrollParent[0].tagName&&(j.overflowOffset=j.scrollParent.offset())},drag:function(j){var c=
|
|
b(this).data("ui-draggable"),a=c.options,h=!1;c.scrollParent[0]!==document&&"HTML"!==c.scrollParent[0].tagName?(a.axis&&"x"===a.axis||(c.overflowOffset.top+c.scrollParent[0].offsetHeight-j.pageY<a.scrollSensitivity?c.scrollParent[0].scrollTop=h=c.scrollParent[0].scrollTop+a.scrollSpeed:j.pageY-c.overflowOffset.top<a.scrollSensitivity&&(c.scrollParent[0].scrollTop=h=c.scrollParent[0].scrollTop-a.scrollSpeed)),a.axis&&"y"===a.axis||(c.overflowOffset.left+c.scrollParent[0].offsetWidth-j.pageX<a.scrollSensitivity?
|
|
c.scrollParent[0].scrollLeft=h=c.scrollParent[0].scrollLeft+a.scrollSpeed:j.pageX-c.overflowOffset.left<a.scrollSensitivity&&(c.scrollParent[0].scrollLeft=h=c.scrollParent[0].scrollLeft-a.scrollSpeed))):(a.axis&&"x"===a.axis||(j.pageY-b(document).scrollTop()<a.scrollSensitivity?h=b(document).scrollTop(b(document).scrollTop()-a.scrollSpeed):b(window).height()-(j.pageY-b(document).scrollTop())<a.scrollSensitivity&&(h=b(document).scrollTop(b(document).scrollTop()+a.scrollSpeed))),a.axis&&"y"===a.axis||
|
|
(j.pageX-b(document).scrollLeft()<a.scrollSensitivity?h=b(document).scrollLeft(b(document).scrollLeft()-a.scrollSpeed):b(window).width()-(j.pageX-b(document).scrollLeft())<a.scrollSensitivity&&(h=b(document).scrollLeft(b(document).scrollLeft()+a.scrollSpeed))));!1!==h&&b.ui.ddmanager&&!a.dropBehaviour&&b.ui.ddmanager.prepareOffsets(c,j)}});b.ui.plugin.add("draggable","snap",{start:function(){var j=b(this).data("ui-draggable"),c=j.options;j.snapElements=[];b(c.snap.constructor!==String?c.snap.items||
|
|
":data(ui-draggable)":c.snap).each(function(){var a=b(this),c=a.offset();this!==j.element[0]&&j.snapElements.push({item:this,width:a.outerWidth(),height:a.outerHeight(),top:c.top,left:c.left})})},drag:function(j,c){var a,h,f,g,m,k,l,s,p,t,r=b(this).data("ui-draggable"),C=r.options,q=C.snapTolerance,y=c.offset.left,z=y+r.helperProportions.width,A=c.offset.top,F=A+r.helperProportions.height;for(p=r.snapElements.length-1;0<=p;p--)m=r.snapElements[p].left,k=m+r.snapElements[p].width,l=r.snapElements[p].top,
|
|
s=l+r.snapElements[p].height,y>m-q&&k+q>y&&A>l-q&&s+q>A||y>m-q&&k+q>y&&F>l-q&&s+q>F||z>m-q&&k+q>z&&A>l-q&&s+q>A||z>m-q&&k+q>z&&F>l-q&&s+q>F?("inner"!==C.snapMode&&(a=q>=Math.abs(l-F),h=q>=Math.abs(s-A),f=q>=Math.abs(m-z),g=q>=Math.abs(k-y),a&&(c.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top-r.margins.top),h&&(c.position.top=r._convertPositionTo("relative",{top:s,left:0}).top-r.margins.top),f&&(c.position.left=r._convertPositionTo("relative",{top:0,left:m-
|
|
r.helperProportions.width}).left-r.margins.left),g&&(c.position.left=r._convertPositionTo("relative",{top:0,left:k}).left-r.margins.left)),t=a||h||f||g,"outer"!==C.snapMode&&(a=q>=Math.abs(l-A),h=q>=Math.abs(s-F),f=q>=Math.abs(m-y),g=q>=Math.abs(k-z),a&&(c.position.top=r._convertPositionTo("relative",{top:l,left:0}).top-r.margins.top),h&&(c.position.top=r._convertPositionTo("relative",{top:s-r.helperProportions.height,left:0}).top-r.margins.top),f&&(c.position.left=r._convertPositionTo("relative",
|
|
{top:0,left:m}).left-r.margins.left),g&&(c.position.left=r._convertPositionTo("relative",{top:0,left:k-r.helperProportions.width}).left-r.margins.left)),!r.snapElements[p].snapping&&(a||h||f||g||t)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,j,b.extend(r._uiHash(),{snapItem:r.snapElements[p].item})),r.snapElements[p].snapping=a||h||f||g||t):(r.snapElements[p].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,j,b.extend(r._uiHash(),{snapItem:r.snapElements[p].item})),
|
|
r.snapElements[p].snapping=!1)}});b.ui.plugin.add("draggable","stack",{start:function(){var j,c=this.data("ui-draggable").options,c=b.makeArray(b(c.stack)).sort(function(a,c){return(parseInt(b(a).css("zIndex"),10)||0)-(parseInt(b(c).css("zIndex"),10)||0)});c.length&&(j=parseInt(b(c[0]).css("zIndex"),10)||0,b(c).each(function(a){b(this).css("zIndex",j+a)}),this.css("zIndex",j+c.length))}});b.ui.plugin.add("draggable","zIndex",{start:function(j,c){var a=b(c.helper),h=b(this).data("ui-draggable").options;
|
|
a.css("zIndex")&&(h._zIndex=a.css("zIndex"));a.css("zIndex",h.zIndex)},stop:function(j,c){var a=b(this).data("ui-draggable").options;a._zIndex&&b(c.helper).css("zIndex",a._zIndex)}})})(jQuery);
|
|
(function(b){function j(a){return parseInt(a,10)||0}function c(a){return!isNaN(parseInt(a,10))}b.widget("ui.resizable",b.ui.mouse,{version:"1.10.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var a,c,f,g,j,k=this,l=this.options;if(this.element.addClass("ui-resizable"),
|
|
b.extend(this,{_aspectRatio:!!l.aspectRatio,aspectRatio:l.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:l.helper||l.ghost||l.animate?l.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(b("<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("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,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=l.handles||(b(".ui-resizable-handle",this.element).length?{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"}:"e,s,se"),
|
|
this.handles.constructor===String){"all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");a=this.handles.split(",");this.handles={};for(c=0;a.length>c;c++)f=b.trim(a[c]),j="ui-resizable-"+f,g=b("<div class='ui-resizable-handle "+j+"'></div>"),g.css({zIndex:l.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(a){var c,f,g,h;a=a||this.element;for(c in this.handles)this.handles[c].constructor===
|
|
String&&(this.handles[c]=b(this.handles[c],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(f=b(this.handles[c],this.element),h=/sw|ne|nw|se|n|s/.test(c)?f.outerHeight():f.outerWidth(),g=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join(""),a.css(g,h),this._proportionallyResize()),b(this.handles[c]).length};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element).disableSelection();
|
|
this._handles.mouseover(function(){k.resizing||(this.className&&(g=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),k.axis=g&&g[1]?g[1]:"se")});l.autoHide&&(this._handles.hide(),b(this.element).addClass("ui-resizable-autohide").mouseenter(function(){l.disabled||(b(this).removeClass("ui-resizable-autohide"),k._handles.show())}).mouseleave(function(){l.disabled||k.resizing||(b(this).addClass("ui-resizable-autohide"),k._handles.hide())}));this._mouseInit()},_destroy:function(){this._mouseDestroy();
|
|
var a,c=function(a){b(a).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(c(this.element),a=this.element,this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")}).insertAfter(a),a.remove()),this.originalElement.css("resize",this.originalResizeStyle),c(this.originalElement),
|
|
this},_mouseCapture:function(a){var c,f,g=!1;for(c in this.handles)f=b(this.handles[c])[0],(f===a.target||b.contains(f,a.target))&&(g=!0);return!this.options.disabled&&g},_mouseStart:function(a){var c,f,g,m=this.options,k=this.element.position(),l=this.element;return this.resizing=!0,/absolute/.test(l.css("position"))?l.css({position:"absolute",top:l.css("top"),left:l.css("left")}):l.is(".ui-draggable")&&l.css({position:"absolute",top:k.top,left:k.left}),this._renderProxy(),c=j(this.helper.css("left")),
|
|
f=j(this.helper.css("top")),m.containment&&(c+=b(m.containment).scrollLeft()||0,f+=b(m.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:c,top:f},this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalPosition={left:c,top:f},this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-
|
|
l.height()},this.originalMousePosition={left:a.pageX,top:a.pageY},this.aspectRatio="number"==typeof m.aspectRatio?m.aspectRatio:this.originalSize.width/this.originalSize.height||1,g=b(".ui-resizable-"+this.axis).css("cursor"),b("body").css("cursor","auto"===g?this.axis+"-resize":g),l.addClass("ui-resizable-resizing"),this._propagate("start",a),!0},_mouseDrag:function(a){var c,f=this.helper,g={},j=this.originalMousePosition,k=this.position.top,l=this.position.left,s=this.size.width,p=this.size.height,
|
|
t=a.pageX-j.left||0,j=a.pageY-j.top||0,r=this._change[this.axis];return r?(c=r.apply(this,[a,t,j]),this._updateVirtualBoundaries(a.shiftKey),(this._aspectRatio||a.shiftKey)&&(c=this._updateRatio(c,a)),c=this._respectSize(c,a),this._updateCache(c),this._propagate("resize",a),this.position.top!==k&&(g.top=this.position.top+"px"),this.position.left!==l&&(g.left=this.position.left+"px"),this.size.width!==s&&(g.width=this.size.width+"px"),this.size.height!==p&&(g.height=this.size.height+"px"),f.css(g),
|
|
!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),b.isEmptyObject(g)||this._trigger("resize",a,this.ui()),!1):!1},_mouseStop:function(a){this.resizing=!1;var c,f,g,j,k,l,s,p=this.options;return this._helper&&(c=this._proportionallyResizeElements,f=c.length&&/textarea/i.test(c[0].nodeName),g=f&&b.ui.hasScroll(c[0],"left")?0:this.sizeDiff.height,j=f?0:this.sizeDiff.width,k={width:this.helper.width()-j,height:this.helper.height()-g},l=parseInt(this.element.css("left"),
|
|
10)+(this.position.left-this.originalPosition.left)||null,s=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null,p.animate||this.element.css(b.extend(k,{top:s,left:l})),this.helper.height(this.size.height),this.helper.width(this.size.width),this._helper&&!p.animate&&this._proportionallyResize()),b("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",a),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b,
|
|
f,g,j,k;k=this.options;k={minWidth:c(k.minWidth)?k.minWidth:0,maxWidth:c(k.maxWidth)?k.maxWidth:1/0,minHeight:c(k.minHeight)?k.minHeight:0,maxHeight:c(k.maxHeight)?k.maxHeight:1/0};(this._aspectRatio||a)&&(b=k.minHeight*this.aspectRatio,g=k.minWidth/this.aspectRatio,f=k.maxHeight*this.aspectRatio,j=k.maxWidth/this.aspectRatio,b>k.minWidth&&(k.minWidth=b),g>k.minHeight&&(k.minHeight=g),k.maxWidth>f&&(k.maxWidth=f),k.maxHeight>j&&(k.maxHeight=j));this._vBoundaries=k},_updateCache:function(a){this.offset=
|
|
this.helper.offset();c(a.left)&&(this.position.left=a.left);c(a.top)&&(this.position.top=a.top);c(a.height)&&(this.size.height=a.height);c(a.width)&&(this.size.width=a.width)},_updateRatio:function(a){var b=this.position,f=this.size,g=this.axis;return c(a.height)?a.width=a.height*this.aspectRatio:c(a.width)&&(a.height=a.width/this.aspectRatio),"sw"===g&&(a.left=b.left+(f.width-a.width),a.top=null),"nw"===g&&(a.top=b.top+(f.height-a.height),a.left=b.left+(f.width-a.width)),a},_respectSize:function(a){var b=
|
|
this._vBoundaries,f=this.axis,g=c(a.width)&&b.maxWidth&&b.maxWidth<a.width,j=c(a.height)&&b.maxHeight&&b.maxHeight<a.height,k=c(a.width)&&b.minWidth&&b.minWidth>a.width,l=c(a.height)&&b.minHeight&&b.minHeight>a.height,s=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height,t=/sw|nw|w/.test(f),f=/nw|ne|n/.test(f);return k&&(a.width=b.minWidth),l&&(a.height=b.minHeight),g&&(a.width=b.maxWidth),j&&(a.height=b.maxHeight),k&&t&&(a.left=s-b.minWidth),g&&t&&(a.left=s-b.maxWidth),
|
|
l&&f&&(a.top=p-b.minHeight),j&&f&&(a.top=p-b.maxHeight),a.width||a.height||a.left||!a.top?a.width||a.height||a.top||!a.left||(a.left=null):a.top=null,a},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var a,b,c,g,j,k=this.helper||this.element;for(a=0;this._proportionallyResizeElements.length>a;a++){if(j=this._proportionallyResizeElements[a],!this.borderDif){this.borderDif=[];c=[j.css("borderTopWidth"),j.css("borderRightWidth"),j.css("borderBottomWidth"),j.css("borderLeftWidth")];
|
|
g=[j.css("paddingTop"),j.css("paddingRight"),j.css("paddingBottom"),j.css("paddingLeft")];for(b=0;c.length>b;b++)this.borderDif[b]=(parseInt(c[b],10)||0)+(parseInt(g[b],10)||0)}j.css({height:k.height()-this.borderDif[0]-this.borderDif[2]||0,width:k.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var a=this.options;this.elementOffset=this.element.offset();this._helper?(this.helper=this.helper||b("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-
|
|
1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++a.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(a,b){return{width:this.originalSize.width+b}},w:function(a,b){return{left:this.originalPosition.left+b,width:this.originalSize.width-b}},n:function(a,b,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(a,b,c){return{height:this.originalSize.height+
|
|
c}},se:function(a,c,f){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[a,c,f]))},sw:function(a,c,f){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[a,c,f]))},ne:function(a,c,f){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[a,c,f]))},nw:function(a,c,f){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[a,c,f]))}},_propagate:function(a,c){b.ui.plugin.call(this,a,[c,this.ui()]);
|
|
"resize"!==a&&this._trigger(a,c,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}}});b.ui.plugin.add("resizable","animate",{stop:function(a){var c=b(this).data("ui-resizable"),f=c.options,g=c._proportionallyResizeElements,j=g.length&&/textarea/i.test(g[0].nodeName),k=j&&b.ui.hasScroll(g[0],"left")?0:c.sizeDiff.height,j=
|
|
{width:c.size.width-(j?0:c.sizeDiff.width),height:c.size.height-k},k=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,l=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;c.element.animate(b.extend(j,l&&k?{top:l,left:k}:{}),{duration:f.animateDuration,easing:f.animateEasing,step:function(){var f={width:parseInt(c.element.css("width"),10),height:parseInt(c.element.css("height"),10),top:parseInt(c.element.css("top"),10),left:parseInt(c.element.css("left"),
|
|
10)};g&&g.length&&b(g[0]).css({width:f.width,height:f.height});c._updateCache(f);c._propagate("resize",a)}})}});b.ui.plugin.add("resizable","containment",{start:function(){var a,c,f,g,m,k,l,s=b(this).data("ui-resizable"),p=s.element,t=s.options.containment;(p=t instanceof b?t.get(0):/parent/.test(t)?p.parent().get(0):t)&&(s.containerElement=b(p),/document/.test(t)||t===document?(s.containerOffset={left:0,top:0},s.containerPosition={left:0,top:0},s.parentData={element:b(document),left:0,top:0,width:b(document).width(),
|
|
height:b(document).height()||document.body.parentNode.scrollHeight}):(a=b(p),c=[],b(["Top","Right","Left","Bottom"]).each(function(b,f){c[b]=j(a.css("padding"+f))}),s.containerOffset=a.offset(),s.containerPosition=a.position(),s.containerSize={height:a.innerHeight()-c[3],width:a.innerWidth()-c[1]},f=s.containerOffset,g=s.containerSize.height,m=s.containerSize.width,k=b.ui.hasScroll(p,"left")?p.scrollWidth:m,l=b.ui.hasScroll(p)?p.scrollHeight:g,s.parentData={element:p,left:f.left,top:f.top,width:k,
|
|
height:l}))},resize:function(a){var c,f,g,j,k=b(this).data("ui-resizable");c=k.options;f=k.containerOffset;g=k.position;a=k._aspectRatio||a.shiftKey;j={top:0,left:0};var l=k.containerElement;l[0]!==document&&/static/.test(l.css("position"))&&(j=f);g.left<(k._helper?f.left:0)&&(k.size.width+=k._helper?k.position.left-f.left:k.position.left-j.left,a&&(k.size.height=k.size.width/k.aspectRatio),k.position.left=c.helper?f.left:0);g.top<(k._helper?f.top:0)&&(k.size.height+=k._helper?k.position.top-f.top:
|
|
k.position.top,a&&(k.size.width=k.size.height*k.aspectRatio),k.position.top=k._helper?f.top:0);k.offset.left=k.parentData.left+k.position.left;k.offset.top=k.parentData.top+k.position.top;c=Math.abs(k.offset.left-j.left+k.sizeDiff.width);f=Math.abs((k._helper?k.offset.top-j.top:k.offset.top-f.top)+k.sizeDiff.height);g=k.containerElement.get(0)===k.element.parent().get(0);j=/relative|absolute/.test(k.containerElement.css("position"));g&&j&&(c-=k.parentData.left);c+k.size.width>=k.parentData.width&&
|
|
(k.size.width=k.parentData.width-c,a&&(k.size.height=k.size.width/k.aspectRatio));f+k.size.height>=k.parentData.height&&(k.size.height=k.parentData.height-f,a&&(k.size.width=k.size.height*k.aspectRatio))},stop:function(){var a=b(this).data("ui-resizable"),c=a.options,f=a.containerOffset,g=a.containerPosition,j=a.containerElement,k=b(a.helper),l=k.offset(),s=k.outerWidth()-a.sizeDiff.width,k=k.outerHeight()-a.sizeDiff.height;a._helper&&!c.animate&&/relative/.test(j.css("position"))&&b(this).css({left:l.left-
|
|
g.left-f.left,width:s,height:k});a._helper&&!c.animate&&/static/.test(j.css("position"))&&b(this).css({left:l.left-g.left-f.left,width:s,height:k})}});b.ui.plugin.add("resizable","alsoResize",{start:function(){var a=b(this).data("ui-resizable").options,c=function(a){b(a).each(function(){var a=b(this);a.data("ui-resizable-alsoresize",{width:parseInt(a.width(),10),height:parseInt(a.height(),10),left:parseInt(a.css("left"),10),top:parseInt(a.css("top"),10)})})};"object"!=typeof a.alsoResize||a.alsoResize.parentNode?
|
|
c(a.alsoResize):a.alsoResize.length?(a.alsoResize=a.alsoResize[0],c(a.alsoResize)):b.each(a.alsoResize,function(a){c(a)})},resize:function(a,c){var f=b(this).data("ui-resizable"),g=f.options,j=f.originalSize,k=f.originalPosition,l={height:f.size.height-j.height||0,width:f.size.width-j.width||0,top:f.position.top-k.top||0,left:f.position.left-k.left||0},s=function(a,f){b(a).each(function(){var a=b(this),g=b(this).data("ui-resizable-alsoresize"),j={},k=f&&f.length?f:a.parents(c.originalElement[0]).length?
|
|
["width","height"]:["width","height","top","left"];b.each(k,function(a,b){var c=(g[b]||0)+(l[b]||0);c&&0<=c&&(j[b]=c||null)});a.css(j)})};"object"!=typeof g.alsoResize||g.alsoResize.nodeType?s(g.alsoResize):b.each(g.alsoResize,function(a,b){s(a,b)})},stop:function(){b(this).removeData("resizable-alsoresize")}});b.ui.plugin.add("resizable","ghost",{start:function(){var a=b(this).data("ui-resizable"),c=a.options,f=a.size;a.ghost=a.originalElement.clone();a.ghost.css({opacity:0.25,display:"block",position:"relative",
|
|
height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof c.ghost?c.ghost:"");a.ghost.appendTo(a.helper)},resize:function(){var a=b(this).data("ui-resizable");a.ghost&&a.ghost.css({position:"relative",height:a.size.height,width:a.size.width})},stop:function(){var a=b(this).data("ui-resizable");a.ghost&&a.helper&&a.helper.get(0).removeChild(a.ghost.get(0))}});b.ui.plugin.add("resizable","grid",{resize:function(){var a=b(this).data("ui-resizable"),
|
|
c=a.options,f=a.size,g=a.originalSize,j=a.originalPosition,k=a.axis,l="number"==typeof c.grid?[c.grid,c.grid]:c.grid,s=l[0]||1,p=l[1]||1,t=Math.round((f.width-g.width)/s)*s,f=Math.round((f.height-g.height)/p)*p,r=g.width+t,g=g.height+f,C=c.maxWidth&&r>c.maxWidth,q=c.maxHeight&&g>c.maxHeight,y=c.minWidth&&c.minWidth>r,z=c.minHeight&&c.minHeight>g;c.grid=l;y&&(r+=s);z&&(g+=p);C&&(r-=s);q&&(g-=p);/^(se|s|e)$/.test(k)?(a.size.width=r,a.size.height=g):/^(ne)$/.test(k)?(a.size.width=r,a.size.height=g,a.position.top=
|
|
j.top-f):/^(sw)$/.test(k)?(a.size.width=r,a.size.height=g,a.position.left=j.left-t):(a.size.width=r,a.size.height=g,a.position.top=j.top-f,a.position.left=j.left-t)}})})(jQuery);
|
|
(function(b){function j(b){return/left|right/.test(b.css("float"))||/inline|table-cell/.test(b.css("display"))}b.widget("ui.sortable",b.ui.mouse,{version:"1.10.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",
|
|
zIndex:1E3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?"x"===b.axis||j(this.items[0].item):!1;this.offset=this.element.offset();this._mouseInit();this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();
|
|
for(var b=this.items.length-1;0<=b;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(c,a){"disabled"===c?(this.options[c]=a,this.widget().toggleClass("ui-sortable-disabled",!!a)):b.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(c,a){var h=null,f=!1,g=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(c),b(c.target).parents().each(function(){return b.data(this,g.widgetName+"-item")===
|
|
g?(h=b(this),!1):void 0}),b.data(c.target,g.widgetName+"-item")===g&&(h=b(c.target)),h?!this.options.handle||a||(b(this.options.handle,h).find("*").addBack().each(function(){this===c.target&&(f=!0)}),f)?(this.currentItem=h,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(c,a,h){var f;a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(c),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},b.extend(this.offset,{click:{left:c.pageX-this.offset.left,top:c.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(c),this.originalPageX=c.pageX,this.originalPageY=c.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),
|
|
this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(f=this.document.find("body"),this.storedCursor=f.css("cursor"),f.css("cursor",a.cursor),this.storedStylesheet=b("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(f)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),
|
|
this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",c,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!h)for(h=this.containers.length-1;0<=h;h--)this.containers[h]._trigger("activate",c,this._uiHash(this));return b.ui.ddmanager&&
|
|
(b.ui.ddmanager.current=this),b.ui.ddmanager&&!a.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(c),!0},_mouseDrag:function(c){var a,h,f,g;a=this.options;var j=!1;this.position=this._generatePosition(c);this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+
|
|
this.scrollParent[0].offsetHeight-c.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=j=this.scrollParent[0].scrollTop+a.scrollSpeed:c.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=j=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-c.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=j=this.scrollParent[0].scrollLeft+a.scrollSpeed:c.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=
|
|
j=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(c.pageY-b(document).scrollTop()<a.scrollSensitivity?j=b(document).scrollTop(b(document).scrollTop()-a.scrollSpeed):b(window).height()-(c.pageY-b(document).scrollTop())<a.scrollSensitivity&&(j=b(document).scrollTop(b(document).scrollTop()+a.scrollSpeed)),c.pageX-b(document).scrollLeft()<a.scrollSensitivity?j=b(document).scrollLeft(b(document).scrollLeft()-a.scrollSpeed):b(window).width()-(c.pageX-b(document).scrollLeft())<a.scrollSensitivity&&(j=b(document).scrollLeft(b(document).scrollLeft()+
|
|
a.scrollSpeed))),!1!==j&&b.ui.ddmanager&&!a.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,c));this.positionAbs=this._convertPositionTo("absolute");this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px");this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(a=this.items.length-1;0<=a;a--)if(h=this.items[a],f=h.item[0],g=this._intersectsWithPointer(h),g&&h.instance===this.currentContainer&&f!==this.currentItem[0]&&
|
|
this.placeholder[1===g?"next":"prev"]()[0]!==f&&!b.contains(this.placeholder[0],f)&&("semi-dynamic"===this.options.type?!b.contains(this.element[0],f):!0)){if(this.direction=1===g?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(h))break;this._rearrange(c,h);this._trigger("change",c,this._uiHash());break}return this._contactContainers(c),b.ui.ddmanager&&b.ui.ddmanager.drag(this,c),this._trigger("sort",c,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(c,
|
|
a){if(c){if(b.ui.ddmanager&&!this.options.dropBehaviour&&b.ui.ddmanager.drop(this,c),this.options.revert){var h=this,f=this.placeholder.offset(),g=this.options.axis,j={};g&&"x"!==g||(j.left=f.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft));g&&"y"!==g||(j.top=f.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop));this.reverting=!0;b(this.helper).animate(j,parseInt(this.options.revert,
|
|
10)||500,function(){h._clear(c)})}else this._clear(c,a);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;0<=c;c--)this.containers[c]._trigger("deactivate",null,this._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,this._uiHash(this)),this.containers[c].containerCache.over=
|
|
0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),b.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?b(this.domPosition.prev).after(this.currentItem):b(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(c){var a=this._getItemsAsjQuery(c&&c.connected),h=[];return c=
|
|
c||{},b(a).each(function(){var a=(b(c.item||this).attr(c.attribute||"id")||"").match(c.expression||/(.+)[\-=_](.+)/);a&&h.push((c.key||a[1]+"[]")+"="+(c.key&&c.expression?a[1]:a[2]))}),!h.length&&c.key&&h.push(c.key+"="),h.join("&")},toArray:function(c){var a=this._getItemsAsjQuery(c&&c.connected),h=[];return c=c||{},a.each(function(){h.push(b(c.item||this).attr(c.attribute||"id")||"")}),h},_intersectsWith:function(b){var a=this.positionAbs.left,h=a+this.helperProportions.width,f=this.positionAbs.top,
|
|
g=f+this.helperProportions.height,j=b.left,k=j+b.width,l=b.top,s=l+b.height,p=this.offset.click.top,t=this.offset.click.left;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>b[this.floating?"width":"height"]?f+p>l&&s>f+p&&a+t>j&&k>a+t:a+this.helperProportions.width/2>j&&k>h-this.helperProportions.width/2&&f+this.helperProportions.height/2>l&&s>g-this.helperProportions.height/
|
|
2},_intersectsWithPointer:function(b){var a="y"===this.options.axis||this.positionAbs.left+this.offset.click.left>b.left&&b.left+b.width>this.positionAbs.left+this.offset.click.left;b=("x"===this.options.axis||this.positionAbs.top+this.offset.click.top>b.top&&b.top+b.height>this.positionAbs.top+this.offset.click.top)&&a;var a=this._getDragVerticalDirection(),h=this._getDragHorizontalDirection();return b?this.floating?h&&"right"===h||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(b){var a=
|
|
this.positionAbs.top+this.offset.click.top>b.top+b.height/2&&b.top+b.height/2+b.height>this.positionAbs.top+this.offset.click.top;b=this.positionAbs.left+this.offset.click.left>b.left+b.width/2&&b.left+b.width/2+b.width>this.positionAbs.left+this.offset.click.left;var h=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?"right"===f&&b||"left"===f&&!b:h&&("down"===h&&a||"up"===h&&!a)},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;
|
|
return 0!==b&&(0<b?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return 0!==b&&(0<b?"right":"left")},refresh:function(b){return this._refreshItems(b),this.refreshPositions(),this},_connectWith:function(){var b=this.options;return b.connectWith.constructor===String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(c){var a,h,f,g=[],j=[],k=this._connectWith();if(k&&c)for(c=k.length-1;0<=c;c--){h=b(k[c]);for(a=h.length-1;0<=a;a--)(f=
|
|
b.data(h[a],this.widgetFullName))&&f!==this&&!f.options.disabled&&j.push([b.isFunction(f.options.items)?f.options.items.call(f.element):b(f.options.items,f.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),f])}j.push([b.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(c=j.length-1;0<=c;c--)j[c][0].each(function(){g.push(this)});
|
|
return b(g)},_removeCurrentsFromItems:function(){var c=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=b.grep(this.items,function(a){for(var b=0;c.length>b;b++)if(c[b]===a.item[0])return!1;return!0})},_refreshItems:function(c){this.items=[];this.containers=[this];var a,h,f,g,j,k=this.items,l=[[b.isFunction(this.options.items)?this.options.items.call(this.element[0],c,{item:this.currentItem}):b(this.options.items,this.element),this]];if((j=this._connectWith())&&this.ready)for(a=
|
|
j.length-1;0<=a;a--){f=b(j[a]);for(h=f.length-1;0<=h;h--)(g=b.data(f[h],this.widgetFullName))&&g!==this&&!g.options.disabled&&(l.push([b.isFunction(g.options.items)?g.options.items.call(g.element[0],c,{item:this.currentItem}):b(g.options.items,g.element),g]),this.containers.push(g))}for(a=l.length-1;0<=a;a--){c=l[a][1];f=l[a][0];h=0;for(j=f.length;j>h;h++)g=b(f[h]),g.data(this.widgetName+"-item",c),k.push({item:g,instance:c,width:0,height:0,left:0,top:0})}},refreshPositions:function(c){this.offsetParent&&
|
|
this.helper&&(this.offset.parent=this._getParentOffset());var a,h,f,g;for(a=this.items.length-1;0<=a;a--)h=this.items[a],h.instance!==this.currentContainer&&this.currentContainer&&h.item[0]!==this.currentItem[0]||(f=this.options.toleranceElement?b(this.options.toleranceElement,h.item):h.item,c||(h.width=f.outerWidth(),h.height=f.outerHeight()),g=f.offset(),h.left=g.left,h.top=g.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(a=
|
|
this.containers.length-1;0<=a;a--)g=this.containers[a].element.offset(),this.containers[a].containerCache.left=g.left,this.containers[a].containerCache.top=g.top,this.containers[a].containerCache.width=this.containers[a].element.outerWidth(),this.containers[a].containerCache.height=this.containers[a].element.outerHeight();return this},_createPlaceholder:function(c){c=c||this;var a,h=c.options;h.placeholder&&h.placeholder.constructor!==String||(a=h.placeholder,h.placeholder={element:function(){var f=
|
|
c.currentItem[0].nodeName.toLowerCase(),g=b(c.document[0].createElement(f)).addClass(a||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===f?g.append("<td colspan='99'> </td>"):"img"===f&&g.attr("src",c.currentItem.attr("src")),a||g.css("visibility","hidden"),g},update:function(b,g){(!a||h.forcePlaceholderSize)&&(g.height()||g.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||
|
|
0,10)),g.width()||g.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10)))}});c.placeholder=b(h.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);h.placeholder.update(c,c.placeholder)},_contactContainers:function(c){var a,h,f,g,m,k,l,s,p,t=h=null;for(a=this.containers.length-1;0<=a;a--)if(!b.contains(this.currentItem[0],this.containers[a].element[0]))if(this._intersectsWith(this.containers[a].containerCache)){if(!h||
|
|
!b.contains(this.containers[a].element[0],h.element[0]))h=this.containers[a],t=a}else this.containers[a].containerCache.over&&(this.containers[a]._trigger("out",c,this._uiHash(this)),this.containers[a].containerCache.over=0);if(h)if(1===this.containers.length)this.containers[t].containerCache.over||(this.containers[t]._trigger("over",c,this._uiHash(this)),this.containers[t].containerCache.over=1);else{a=1E4;f=null;g=(p=h.floating||j(this.currentItem))?"left":"top";m=p?"width":"height";k=this.positionAbs[g]+
|
|
this.offset.click[g];for(h=this.items.length-1;0<=h;h--)b.contains(this.containers[t].element[0],this.items[h].item[0])&&this.items[h].item[0]!==this.currentItem[0]&&(!p||this.positionAbs.top+this.offset.click.top>this.items[h].top&&this.items[h].top+this.items[h].height>this.positionAbs.top+this.offset.click.top)&&(l=this.items[h].item.offset()[g],s=!1,Math.abs(l-k)>Math.abs(l+this.items[h][m]-k)&&(s=!0,l+=this.items[h][m]),a>Math.abs(l-k)&&(a=Math.abs(l-k),f=this.items[h],this.direction=s?"up":
|
|
"down"));if((f||this.options.dropOnEmpty)&&this.currentContainer!==this.containers[t])f?this._rearrange(c,f,null,!0):this._rearrange(c,null,this.containers[t].element,!0),this._trigger("change",c,this._uiHash()),this.containers[t]._trigger("change",c,this._uiHash(this)),this.currentContainer=this.containers[t],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[t]._trigger("over",c,this._uiHash(this)),this.containers[t].containerCache.over=1}},_createHelper:function(c){var a=
|
|
this.options;c=b.isFunction(a.helper)?b(a.helper.apply(this.element[0],[c,this.currentItem])):"clone"===a.helper?this.currentItem.clone():this.currentItem;return c.parents("body").length||b("parent"!==a.appendTo?a.appendTo:this.currentItem[0].parentNode)[0].appendChild(c[0]),c[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")}),
|
|
(!c[0].style.width||a.forceHelperSize)&&c.width(this.currentItem.width()),(!c[0].style.height||a.forceHelperSize)&&c.height(this.currentItem.height()),c},_adjustOffsetFromHelper:function(c){"string"==typeof c&&(c=c.split(" "));b.isArray(c)&&(c={left:+c[0],top:+c[1]||0});"left"in c&&(this.offset.click.left=c.left+this.margins.left);"right"in c&&(this.offset.click.left=this.helperProportions.width-c.right+this.margins.left);"top"in c&&(this.offset.click.top=c.top+this.margins.top);"bottom"in c&&(this.offset.click.top=
|
|
this.helperProportions.height-c.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var c=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])&&(c.left+=this.scrollParent.scrollLeft(),c.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&b.ui.ie)&&(c=
|
|
{top:0,left:0}),{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}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 c,a,h,f=this.options;"parent"===f.containment&&(f.containment=this.helper[0].parentNode);("document"===f.containment||"window"===f.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b("document"===f.containment?
|
|
document:window).width()-this.helperProportions.width-this.margins.left,(b("document"===f.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]);/^(document|window|parent)$/.test(f.containment)||(c=b(f.containment)[0],a=b(f.containment).offset(),h="hidden"!==b(c).css("overflow"),this.containment=[a.left+(parseInt(b(c).css("borderLeftWidth"),10)||0)+(parseInt(b(c).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(b(c).css("borderTopWidth"),
|
|
10)||0)+(parseInt(b(c).css("paddingTop"),10)||0)-this.margins.top,a.left+(h?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(b(c).css("borderLeftWidth"),10)||0)-(parseInt(b(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(h?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(b(c).css("borderTopWidth"),10)||0)-(parseInt(b(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(c,a){a||
|
|
(a=this.position);var h="absolute"===c?1:-1,f="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,g=/(html|body)/i.test(f[0].tagName);return{top:a.top+this.offset.relative.top*h+this.offset.parent.top*h-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():g?0:f.scrollTop())*h,left:a.left+this.offset.relative.left*h+this.offset.parent.left*h-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():
|
|
g?0:f.scrollLeft())*h}},_generatePosition:function(c){var a,h,f=this.options,g=c.pageX,j=c.pageY,k="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&b.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(k[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(c.pageX-
|
|
this.offset.click.left<this.containment[0]&&(g=this.containment[0]+this.offset.click.left),c.pageY-this.offset.click.top<this.containment[1]&&(j=this.containment[1]+this.offset.click.top),c.pageX-this.offset.click.left>this.containment[2]&&(g=this.containment[2]+this.offset.click.left),c.pageY-this.offset.click.top>this.containment[3]&&(j=this.containment[3]+this.offset.click.top)),f.grid&&(a=this.originalPageY+Math.round((j-this.originalPageY)/f.grid[1])*f.grid[1],j=this.containment?a-this.offset.click.top>=
|
|
this.containment[1]&&a-this.offset.click.top<=this.containment[3]?a:a-this.offset.click.top>=this.containment[1]?a-f.grid[1]:a+f.grid[1]:a,h=this.originalPageX+Math.round((g-this.originalPageX)/f.grid[0])*f.grid[0],g=this.containment?h-this.offset.click.left>=this.containment[0]&&h-this.offset.click.left<=this.containment[2]?h:h-this.offset.click.left>=this.containment[0]?h-f.grid[0]:h+f.grid[0]:h)),{top:j-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?
|
|
-this.scrollParent.scrollTop():l?0:k.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:k.scrollLeft())}},_rearrange:function(b,a,h,f){h?h[0].appendChild(this.placeholder[0]):a.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?a.item[0]:a.item[0].nextSibling);var g=this.counter=this.counter?++this.counter:1;this._delay(function(){g===this.counter&&this.refreshPositions(!f)})},
|
|
_clear:function(b,a){this.reverting=!1;var h,f=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(h in this._storedCSS)("auto"===this._storedCSS[h]||"static"===this._storedCSS[h])&&(this._storedCSS[h]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!a&&f.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))});
|
|
!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||a||f.push(function(a){this._trigger("update",a,this._uiHash())});this!==this.currentContainer&&(a||(f.push(function(a){this._trigger("remove",a,this._uiHash())}),f.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.currentContainer)),f.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,
|
|
this.currentContainer))));for(h=this.containers.length-1;0<=h;h--)a||f.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[h])),this.containers[h].containerCache.over&&(f.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[h])),this.containers[h].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&
|
|
this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!a){this._trigger("beforeStop",b,this._uiHash());for(h=0;f.length>h;h++)f[h].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}if(a||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&
|
|
this.helper.remove(),this.helper=null,!a){for(h=0;f.length>h;h++)f[h].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===b.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(c){var a=c||this;return{helper:a.helper,placeholder:a.placeholder||b([]),position:a.position,originalPosition:a.originalPosition,offset:a.positionAbs,item:a.currentItem,sender:c?c.element:null}}})})(jQuery);
|
|
(function(b){b.widget("ui.slider",b.ui.mouse,{version:"1.10.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._mouseSliding=this._keySliding=!1;this._animateOff=!0;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._refresh();
|
|
this._setOption("disabled",this.options.disabled);this._animateOff=!1},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var j,c;j=this.options;var a=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),h=[];c=j.values&&j.values.length||1;a.length>c&&(a.slice(c).remove(),a=a.slice(0,c));for(j=a.length;c>j;j++)h.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
|
|
this.handles=a.add(b(h.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.each(function(a){b(this).data("ui-slider-handle-index",a)})},_createRange:function(){var j=this.options,c="";j.range?(!0===j.range&&(j.values?j.values.length&&2!==j.values.length?j.values=[j.values[0],j.values[0]]:b.isArray(j.values)&&(j.values=j.values.slice(0)):j.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",
|
|
bottom:""}):(this.range=b("<div></div>").appendTo(this.element),c="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(c+("min"===j.range||"max"===j.range?" ui-slider-range-"+j.range:""))):this.range=b([])},_setupEvents:function(){var b=this.handles.add(this.range).filter("a");this._off(b);this._on(b,this._handleEvents);this._hoverable(b);this._focusable(b)},_destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all");
|
|
this._mouseDestroy()},_mouseCapture:function(j){var c,a,h,f,g,m,k,l,s=this,p=this.options;return p.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),c={x:j.pageX,y:j.pageY},a=this._normValueFromMouse(c),h=this._valueMax()-this._valueMin()+1,this.handles.each(function(c){var j=Math.abs(a-s.values(c));(h>j||h===j&&(c===s._lastChangedValue||s.values(c)===p.min))&&(h=j,f=b(this),g=c)}),m=this._start(j,g),!1===m?!1:
|
|
(this._mouseSliding=!0,this._handleIndex=g,f.addClass("ui-state-active").focus(),k=f.offset(),l=!b(j.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:j.pageX-k.left-f.width()/2,top:j.pageY-k.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(j,g,a),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(b){var c=
|
|
this._normValueFromMouse({x:b.pageX,y:b.pageY});return this._slide(b,this._handleIndex,c),!1},_mouseStop:function(b){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(b,this._handleIndex),this._change(b,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(b){var c,a,h,f,g;return"horizontal"===
|
|
this.orientation?(c=this.elementSize.width,a=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(c=this.elementSize.height,a=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),h=a/c,1<h&&(h=1),0>h&&(h=0),"vertical"===this.orientation&&(h=1-h),f=this._valueMax()-this._valueMin(),g=this._valueMin()+h*f,this._trimAlignValue(g)},_start:function(b,c){var a={handle:this.handles[c],value:this.value()};return this.options.values&&this.options.values.length&&(a.value=
|
|
this.values(c),a.values=this.values()),this._trigger("start",b,a)},_slide:function(b,c,a){var h,f,g;this.options.values&&this.options.values.length?(h=this.values(c?0:1),2===this.options.values.length&&!0===this.options.range&&(0===c&&a>h||1===c&&h>a)&&(a=h),a!==this.values(c)&&(f=this.values(),f[c]=a,g=this._trigger("slide",b,{handle:this.handles[c],value:a,values:f}),this.values(c?0:1),!1!==g&&this.values(c,a,!0))):a!==this.value()&&(g=this._trigger("slide",b,{handle:this.handles[c],value:a}),!1!==
|
|
g&&this.value(a))},_stop:function(b,c){var a={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(a.value=this.values(c),a.values=this.values());this._trigger("stop",b,a)},_change:function(b,c){if(!this._keySliding&&!this._mouseSliding){var a={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(a.value=this.values(c),a.values=this.values());this._lastChangedValue=c;this._trigger("change",b,a)}},value:function(b){return arguments.length?
|
|
(this.options.value=this._trimAlignValue(b),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(j,c){var a,h,f;if(1<arguments.length)return this.options.values[j]=this._trimAlignValue(c),this._refreshValue(),this._change(null,j),void 0;if(!arguments.length)return this._values();if(!b.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(j):this.value();a=this.options.values;h=arguments[0];for(f=0;a.length>f;f+=1)a[f]=this._trimAlignValue(h[f]),
|
|
this._change(null,f);this._refreshValue()},_setOption:function(j,c){var a,h=0;switch("range"===j&&!0===this.options.range&&("min"===c?(this.options.value=this._values(0),this.options.values=null):"max"===c&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),b.isArray(this.options.values)&&(h=this.options.values.length),b.Widget.prototype._setOption.apply(this,arguments),j){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=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(a=0;h>a;a+=1)this._change(null,a);this._animateOff=!1;break;case "min":case "max":this._animateOff=!0;this._refreshValue();this._animateOff=!1;break;case "range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){return this._trimAlignValue(this.options.value)},_values:function(b){var c,
|
|
a;if(arguments.length)return c=this.options.values[b],this._trimAlignValue(c);if(this.options.values&&this.options.values.length){c=this.options.values.slice();for(a=0;c.length>a;a+=1)c[a]=this._trimAlignValue(c[a]);return c}return[]},_trimAlignValue:function(b){if(this._valueMin()>=b)return this._valueMin();if(b>=this._valueMax())return this._valueMax();var c=0<this.options.step?this.options.step:1,a=(b-this._valueMin())%c;b-=a;return 2*Math.abs(a)>=c&&(b+=0<a?c:-c),parseFloat(b.toFixed(5))},_valueMin:function(){return this.options.min},
|
|
_valueMax:function(){return this.options.max},_refreshValue:function(){var j,c,a,h,f,g=this.options.range,m=this.options,k=this,l=this._animateOff?!1:m.animate,s={};this.options.values&&this.options.values.length?this.handles.each(function(a){c=100*((k.values(a)-k._valueMin())/(k._valueMax()-k._valueMin()));s["horizontal"===k.orientation?"left":"bottom"]=c+"%";b(this).stop(1,1)[l?"animate":"css"](s,m.animate);!0===k.options.range&&("horizontal"===k.orientation?(0===a&&k.range.stop(1,1)[l?"animate":
|
|
"css"]({left:c+"%"},m.animate),1===a&&k.range[l?"animate":"css"]({width:c-j+"%"},{queue:!1,duration:m.animate})):(0===a&&k.range.stop(1,1)[l?"animate":"css"]({bottom:c+"%"},m.animate),1===a&&k.range[l?"animate":"css"]({height:c-j+"%"},{queue:!1,duration:m.animate})));j=c}):(a=this.value(),h=this._valueMin(),f=this._valueMax(),c=f!==h?100*((a-h)/(f-h)):0,s["horizontal"===this.orientation?"left":"bottom"]=c+"%",this.handle.stop(1,1)[l?"animate":"css"](s,m.animate),"min"===g&&"horizontal"===this.orientation&&
|
|
this.range.stop(1,1)[l?"animate":"css"]({width:c+"%"},m.animate),"max"===g&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-c+"%"},{queue:!1,duration:m.animate}),"min"===g&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:c+"%"},m.animate),"max"===g&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-c+"%"},{queue:!1,duration:m.animate}))},_handleEvents:{keydown:function(j){var c,a,h,f=b(j.target).data("ui-slider-handle-index");
|
|
switch(j.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(j.preventDefault(),!this._keySliding&&(this._keySliding=!0,b(j.target).addClass("ui-state-active"),c=this._start(j,f),!1===c))return}switch(h=this.options.step,c=a=this.options.values&&this.options.values.length?this.values(f):this.value(),j.keyCode){case b.ui.keyCode.HOME:a=this._valueMin();
|
|
break;case b.ui.keyCode.END:a=this._valueMax();break;case b.ui.keyCode.PAGE_UP:a=this._trimAlignValue(c+(this._valueMax()-this._valueMin())/5);break;case b.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(c-(this._valueMax()-this._valueMin())/5);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(c===this._valueMax())return;a=this._trimAlignValue(c+h);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(c===this._valueMin())return;a=this._trimAlignValue(c-h)}this._slide(j,f,a)},click:function(b){b.preventDefault()},
|
|
keyup:function(j){var c=b(j.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(j,c),this._change(j,c),b(j.target).removeClass("ui-state-active"))}}})})(jQuery);
|
|
(function(b,j){function c(a){return 1<a.hash.length&&decodeURIComponent(a.href.replace(h,""))===decodeURIComponent(location.href.replace(h,""))}var a=0,h=/#.*$/;b.widget("ui.tabs",{version:"1.10.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var a=this,c=this.options;this.running=!1;this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",
|
|
c.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(a){b(this).is(".ui-state-disabled")&&a.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){b(this).closest("li").is(".ui-state-disabled")&&this.blur()});this._processTabs();c.active=this._initialActive();b.isArray(c.disabled)&&(c.disabled=b.unique(c.disabled.concat(b.map(this.tabs.filter(".ui-state-disabled"),function(b){return a.tabs.index(b)}))).sort());this.active=!1!==this.options.active&&
|
|
this.anchors.length?this._findActive(c.active):b();this._refresh();this.active.length&&this.load(c.active)},_initialActive:function(){var a=this.options.active,c=this.options.collapsible,h=location.hash.substring(1);return null===a&&(h&&this.tabs.each(function(c,g){return b(g).attr("aria-controls")===h?(a=c,!1):j}),null===a&&(a=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===a||-1===a)&&(a=this.tabs.length?0:!1)),!1!==a&&(a=this.tabs.index(this.tabs.eq(a)),-1===a&&(a=c?!1:0)),!c&&!1===
|
|
a&&this.anchors.length&&(a=0),a},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):b()}},_tabKeydown:function(a){var c=b(this.document[0].activeElement).closest("li"),h=this.tabs.index(c),k=!0;if(!this._handlePageNav(a)){switch(a.keyCode){case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:h++;break;case b.ui.keyCode.UP:case b.ui.keyCode.LEFT:k=!1;h--;break;case b.ui.keyCode.END:h=this.anchors.length-1;break;case b.ui.keyCode.HOME:h=0;break;
|
|
case b.ui.keyCode.SPACE:return a.preventDefault(),clearTimeout(this.activating),this._activate(h),j;case b.ui.keyCode.ENTER:return a.preventDefault(),clearTimeout(this.activating),this._activate(h===this.options.active?!1:h),j;default:return}a.preventDefault();clearTimeout(this.activating);h=this._focusNextTab(h,k);a.ctrlKey||(c.attr("aria-selected","false"),this.tabs.eq(h).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",h)},this.delay))}},_panelKeydown:function(a){this._handlePageNav(a)||
|
|
a.ctrlKey&&a.keyCode===b.ui.keyCode.UP&&(a.preventDefault(),this.active.focus())},_handlePageNav:function(a){return a.altKey&&a.keyCode===b.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):a.altKey&&a.keyCode===b.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):j},_findNextTab:function(a,c){for(var h=this.tabs.length-1;-1!==b.inArray((a>h&&(a=0),0>a&&(a=h),a),this.options.disabled);)a=c?a+1:a-1;return a},_focusNextTab:function(a,
|
|
b){return a=this._findNextTab(a,b),this.tabs.eq(a).focus(),a},_setOption:function(a,b){return"active"===a?(this._activate(b),j):"disabled"===a?(this._setupDisabled(b),j):(this._super(a,b),"collapsible"===a&&(this.element.toggleClass("ui-tabs-collapsible",b),b||!1!==this.options.active||this._activate(0)),"event"===a&&this._setupEvents(b),"heightStyle"===a&&this._setupHeightStyle(b),j)},_tabId:function(b){return b.attr("aria-controls")||"ui-tabs-"+ ++a},_sanitizeSelector:function(a){return a?a.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,
|
|
"\\$&"):""},refresh:function(){var a=this.options,c=this.tablist.children(":has(a[href])");a.disabled=b.map(c.filter(".ui-state-disabled"),function(a){return c.index(a)});this._processTabs();!1!==a.active&&this.anchors.length?this.active.length&&!b.contains(this.tablist[0],this.active[0])?this.tabs.length===a.disabled.length?(a.active=!1,this.active=b()):this._activate(this._findNextTab(Math.max(0,a.active-1),!1)):a.active=this.tabs.index(this.active):(a.active=!1,this.active=b());this._refresh()},
|
|
_refresh:function(){this._setupDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"});this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true",
|
|
"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var a=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist");this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return b("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=
|
|
b();this.anchors.each(function(g,h){var j,l,s,p=b(h).uniqueId().attr("id"),t=b(h).closest("li"),r=t.attr("aria-controls");c(h)?(j=h.hash,l=a.element.find(a._sanitizeSelector(j))):(s=a._tabId(t),j="#"+s,l=a.element.find(j),l.length||(l=a._createPanel(s),l.insertAfter(a.panels[g-1]||a.tablist)),l.attr("aria-live","polite"));l.length&&(a.panels=a.panels.add(l));r&&t.data("ui-tabs-aria-controls",r);t.attr({"aria-controls":j.substring(1),"aria-labelledby":p});l.attr("aria-labelledby",p)});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role",
|
|
"tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(a){return b("<div>").attr("id",a).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(a){b.isArray(a)&&(a.length?a.length===this.anchors.length&&(a=!0):a=!1);for(var c,h=0;c=this.tabs[h];h++)!0===a||-1!==b.inArray(h,a)?b(c).addClass("ui-state-disabled").attr("aria-disabled","true"):b(c).removeClass("ui-state-disabled").removeAttr("aria-disabled");
|
|
this.options.disabled=a},_setupEvents:function(a){var c={click:function(a){a.preventDefault()}};a&&b.each(a.split(" "),function(a,b){c[b]="_eventHandler"});this._off(this.anchors.add(this.tabs).add(this.panels));this._on(this.anchors,c);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},_setupHeightStyle:function(a){var c,h=this.element.parent();"fill"===a?(c=h.height(),c-=this.element.outerHeight()-this.element.height(),
|
|
this.element.siblings(":visible").each(function(){var a=b(this),f=a.css("position");"absolute"!==f&&"fixed"!==f&&(c-=a.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){c-=b(this).outerHeight(!0)}),this.panels.each(function(){b(this).height(Math.max(0,c-b(this).innerHeight()+b(this).height()))}).css("overflow","auto")):"auto"===a&&(c=0,this.panels.each(function(){c=Math.max(c,b(this).height("").height())}).height(c))},_eventHandler:function(a){var c=this.options,h=this.active,
|
|
j=b(a.currentTarget).closest("li"),l=j[0]===h[0],s=l&&c.collapsible,p=s?b():this._getPanelForTab(j),t=h.length?this._getPanelForTab(h):b(),h={oldTab:h,oldPanel:t,newTab:s?b():j,newPanel:p};a.preventDefault();j.hasClass("ui-state-disabled")||j.hasClass("ui-tabs-loading")||this.running||l&&!c.collapsible||!1===this._trigger("beforeActivate",a,h)||(c.active=s?!1:this.tabs.index(j),this.active=l?b():j,this.xhr&&this.xhr.abort(),t.length||p.length||b.error("jQuery UI Tabs: Mismatching fragment identifier."),
|
|
p.length&&this.load(this.tabs.index(j),a),this._toggle(a,h))},_toggle:function(a,c){function h(){l.running=!1;l._trigger("activate",a,c)}function j(){c.newTab.closest("li").addClass("ui-tabs-active ui-state-active");s.length&&l.options.show?l._show(s,l.options.show,h):(s.show(),h())}var l=this,s=c.newPanel,p=c.oldPanel;this.running=!0;p.length&&this.options.hide?this._hide(p,this.options.hide,function(){c.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");j()}):(c.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),
|
|
p.hide(),j());p.attr({"aria-expanded":"false","aria-hidden":"true"});c.oldTab.attr("aria-selected","false");s.length&&p.length?c.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===b(this).attr("tabIndex")}).attr("tabIndex",-1);s.attr({"aria-expanded":"true","aria-hidden":"false"});c.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(a){var c;a=this._findActive(a);a[0]!==this.active[0]&&(a.length||(a=this.active),c=a.find(".ui-tabs-anchor")[0],this._eventHandler({target:c,
|
|
currentTarget:c,preventDefault:b.noop}))},_findActive:function(a){return!1===a?b():this.tabs.eq(a)},_getIndex:function(a){return"string"==typeof a&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},_destroy:function(){this.xhr&&this.xhr.abort();this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible");this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role");this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId();
|
|
this.tabs.add(this.panels).each(function(){b.data(this,"ui-tabs-destroy")?b(this).remove():b(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")});this.tabs.each(function(){var a=b(this),c=a.data("ui-tabs-aria-controls");
|
|
c?a.attr("aria-controls",c).removeData("ui-tabs-aria-controls"):a.removeAttr("aria-controls")});this.panels.show();"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(a){var c=this.options.disabled;!1!==c&&(a===j?c=!1:(a=this._getIndex(a),c=b.isArray(c)?b.map(c,function(b){return b!==a?b:null}):b.map(this.tabs,function(b,c){return c!==a?c:null})),this._setupDisabled(c))},disable:function(a){var c=this.options.disabled;if(!0!==c){if(a===j)c=!0;else{if(a=this._getIndex(a),
|
|
-1!==b.inArray(a,c))return;c=b.isArray(c)?b.merge([a],c).sort():[a]}this._setupDisabled(c)}},load:function(a,g){a=this._getIndex(a);var h=this,j=this.tabs.eq(a),l=j.find(".ui-tabs-anchor"),s=this._getPanelForTab(j),p={tab:j,panel:s};c(l[0])||(this.xhr=b.ajax(this._ajaxSettings(l,g,p)),this.xhr&&"canceled"!==this.xhr.statusText&&(j.addClass("ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.success(function(a){setTimeout(function(){s.html(a);h._trigger("load",g,p)},1)}).complete(function(a,b){setTimeout(function(){"abort"===
|
|
b&&h.panels.stop(!1,!0);j.removeClass("ui-tabs-loading");s.removeAttr("aria-busy");a===h.xhr&&delete h.xhr},1)})))},_ajaxSettings:function(a,c,h){var j=this;return{url:a.attr("href"),beforeSend:function(a,f){return j._trigger("beforeLoad",c,b.extend({jqXHR:a,ajaxSettings:f},h))}}},_getPanelForTab:function(a){a=b(a).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+a))}})})(jQuery);
|
|
(function(b){b.fn.hoverIntent=function(j,c,a){var h={interval:100,sensitivity:7,timeout:0},h="object"===typeof j?b.extend(h,j):b.isFunction(c)?b.extend(h,{over:j,out:c,selector:a}):b.extend(h,{over:j,out:j,selector:c}),f,g,m,k,l=function(a){f=a.pageX;g=a.pageY},s=function(a,c){c.hoverIntent_t=clearTimeout(c.hoverIntent_t);if(Math.abs(m-f)+Math.abs(k-g)<h.sensitivity)return b(c).off("mousemove.hoverIntent",l),c.hoverIntent_s=1,h.over.apply(c,[a]);m=f;k=g;c.hoverIntent_t=setTimeout(function(){s(a,c)},
|
|
h.interval)};j=function(a){var c=jQuery.extend({},a),f=this;f.hoverIntent_t&&(f.hoverIntent_t=clearTimeout(f.hoverIntent_t));"mouseenter"==a.type?(m=c.pageX,k=c.pageY,b(f).on("mousemove.hoverIntent",l),1!=f.hoverIntent_s&&(f.hoverIntent_t=setTimeout(function(){s(c,f)},h.interval))):(b(f).off("mousemove.hoverIntent",l),1==f.hoverIntent_s&&(f.hoverIntent_t=setTimeout(function(){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;h.out.apply(f,[c])},h.timeout)))};return this.on({"mouseenter.hoverIntent":j,
|
|
"mouseleave.hoverIntent":j},h.selector)}})(jQuery);
|
|
var CryptoJS=CryptoJS||function(b,j){var c={},a=c.lib={},h=function(){},f=a.Base={extend:function(a){h.prototype=this;var b=new h;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
|
|
g=a.WordArray=f.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=j?b:4*a.length},toString:function(a){return(a||k).stringify(this)},concat:function(a){var b=this.words,c=a.words,f=this.sigBytes;a=a.sigBytes;this.clamp();if(f%4)for(var g=0;g<a;g++)b[f+g>>>2]|=(c[g>>>2]>>>24-8*(g%4)&255)<<24-8*((f+g)%4);else if(65535<c.length)for(g=0;g<a;g+=4)b[f+g>>>2]=c[g>>>2];else b.push.apply(b,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
|
|
32-8*(c%4);a.length=b.ceil(c/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],f=0;f<a;f+=4)c.push(4294967296*b.random()|0);return new g.init(c,a)}}),m=c.enc={},k=m.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var c=[],f=0;f<a;f++){var g=b[f>>>2]>>>24-8*(f%4)&255;c.push((g>>>4).toString(16));c.push((g&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],f=0;f<b;f+=2)c[f>>>3]|=parseInt(a.substr(f,
|
|
2),16)<<24-4*(f%8);return new g.init(c,b/2)}},l=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var c=[],f=0;f<a;f++)c.push(String.fromCharCode(b[f>>>2]>>>24-8*(f%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],f=0;f<b;f++)c[f>>>2]|=(a.charCodeAt(f)&255)<<24-8*(f%4);return new g.init(c,b)}},s=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(l.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return l.parse(unescape(encodeURIComponent(a)))}},
|
|
p=a.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=s.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,f=c.words,h=c.sigBytes,j=this.blockSize,k=h/(4*j),k=a?b.ceil(k):b.max((k|0)-this._minBufferSize,0);a=k*j;h=b.min(4*a,h);if(a){for(var m=0;m<a;m+=j)this._doProcessBlock(f,m);m=f.splice(0,a);c.sigBytes-=h}return new g.init(m,h)},clone:function(){var a=f.clone.call(this);
|
|
a._data=this._data.clone();return a},_minBufferSize:0});a.Hasher=p.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){p.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,c){return(new a.init(c)).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return(new t.HMAC.init(a,
|
|
c)).finalize(b)}}});var t=c.algo={};return c}(Math);
|
|
(function(){var b=CryptoJS,j=b.lib.WordArray;b.enc.Base64={stringify:function(b){var a=b.words,h=b.sigBytes,f=this._map;b.clamp();b=[];for(var g=0;g<h;g+=3)for(var j=(a[g>>>2]>>>24-8*(g%4)&255)<<16|(a[g+1>>>2]>>>24-8*((g+1)%4)&255)<<8|a[g+2>>>2]>>>24-8*((g+2)%4)&255,k=0;4>k&&g+0.75*k<h;k++)b.push(f.charAt(j>>>6*(3-k)&63));if(a=f.charAt(64))for(;b.length%4;)b.push(a);return b.join("")},parse:function(b){var a=b.length,h=this._map,f=h.charAt(64);f&&(f=b.indexOf(f),-1!=f&&(a=f));for(var f=[],g=0,m=0;m<
|
|
a;m++)if(m%4){var k=h.indexOf(b.charAt(m-1))<<2*(m%4),l=h.indexOf(b.charAt(m))>>>6-2*(m%4);f[g>>>2]|=(k|l)<<24-8*(g%4);g++}return j.create(f,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
|
|
(function(b){function j(a,b,c,f,g,h,j){a=a+(b&c|~b&f)+g+j;return(a<<h|a>>>32-h)+b}function c(a,b,c,f,g,h,j){a=a+(b&f|c&~f)+g+j;return(a<<h|a>>>32-h)+b}function a(a,b,c,f,g,h,j){a=a+(b^c^f)+g+j;return(a<<h|a>>>32-h)+b}function h(a,b,c,f,g,h,j){a=a+(c^(b|~f))+g+j;return(a<<h|a>>>32-h)+b}for(var f=CryptoJS,g=f.lib,m=g.WordArray,k=g.Hasher,g=f.algo,l=[],s=0;64>s;s++)l[s]=4294967296*b.abs(b.sin(s+1))|0;g=g.MD5=k.extend({_doReset:function(){this._hash=new m.init([1732584193,4023233417,2562383102,271733878])},
|
|
_doProcessBlock:function(b,f){for(var g=0;16>g;g++){var k=f+g,m=b[k];b[k]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360}var g=this._hash.words,k=b[f+0],m=b[f+1],s=b[f+2],z=b[f+3],A=b[f+4],F=b[f+5],T=b[f+6],L=b[f+7],G=b[f+8],O=b[f+9],Z=b[f+10],J=b[f+11],P=b[f+12],ma=b[f+13],U=b[f+14],$=b[f+15],v=g[0],x=g[1],w=g[2],u=g[3],v=j(v,x,w,u,k,7,l[0]),u=j(u,v,x,w,m,12,l[1]),w=j(w,u,v,x,s,17,l[2]),x=j(x,w,u,v,z,22,l[3]),v=j(v,x,w,u,A,7,l[4]),u=j(u,v,x,w,F,12,l[5]),w=j(w,u,v,x,T,17,l[6]),x=j(x,w,u,v,L,22,l[7]),
|
|
v=j(v,x,w,u,G,7,l[8]),u=j(u,v,x,w,O,12,l[9]),w=j(w,u,v,x,Z,17,l[10]),x=j(x,w,u,v,J,22,l[11]),v=j(v,x,w,u,P,7,l[12]),u=j(u,v,x,w,ma,12,l[13]),w=j(w,u,v,x,U,17,l[14]),x=j(x,w,u,v,$,22,l[15]),v=c(v,x,w,u,m,5,l[16]),u=c(u,v,x,w,T,9,l[17]),w=c(w,u,v,x,J,14,l[18]),x=c(x,w,u,v,k,20,l[19]),v=c(v,x,w,u,F,5,l[20]),u=c(u,v,x,w,Z,9,l[21]),w=c(w,u,v,x,$,14,l[22]),x=c(x,w,u,v,A,20,l[23]),v=c(v,x,w,u,O,5,l[24]),u=c(u,v,x,w,U,9,l[25]),w=c(w,u,v,x,z,14,l[26]),x=c(x,w,u,v,G,20,l[27]),v=c(v,x,w,u,ma,5,l[28]),u=c(u,
|
|
v,x,w,s,9,l[29]),w=c(w,u,v,x,L,14,l[30]),x=c(x,w,u,v,P,20,l[31]),v=a(v,x,w,u,F,4,l[32]),u=a(u,v,x,w,G,11,l[33]),w=a(w,u,v,x,J,16,l[34]),x=a(x,w,u,v,U,23,l[35]),v=a(v,x,w,u,m,4,l[36]),u=a(u,v,x,w,A,11,l[37]),w=a(w,u,v,x,L,16,l[38]),x=a(x,w,u,v,Z,23,l[39]),v=a(v,x,w,u,ma,4,l[40]),u=a(u,v,x,w,k,11,l[41]),w=a(w,u,v,x,z,16,l[42]),x=a(x,w,u,v,T,23,l[43]),v=a(v,x,w,u,O,4,l[44]),u=a(u,v,x,w,P,11,l[45]),w=a(w,u,v,x,$,16,l[46]),x=a(x,w,u,v,s,23,l[47]),v=h(v,x,w,u,k,6,l[48]),u=h(u,v,x,w,L,10,l[49]),w=h(w,u,
|
|
v,x,U,15,l[50]),x=h(x,w,u,v,F,21,l[51]),v=h(v,x,w,u,P,6,l[52]),u=h(u,v,x,w,z,10,l[53]),w=h(w,u,v,x,Z,15,l[54]),x=h(x,w,u,v,m,21,l[55]),v=h(v,x,w,u,G,6,l[56]),u=h(u,v,x,w,$,10,l[57]),w=h(w,u,v,x,T,15,l[58]),x=h(x,w,u,v,ma,21,l[59]),v=h(v,x,w,u,A,6,l[60]),u=h(u,v,x,w,J,10,l[61]),w=h(w,u,v,x,s,15,l[62]),x=h(x,w,u,v,O,21,l[63]);g[0]=g[0]+v|0;g[1]=g[1]+x|0;g[2]=g[2]+w|0;g[3]=g[3]+u|0},_doFinalize:function(){var a=this._data,c=a.words,f=8*this._nDataBytes,g=8*a.sigBytes;c[g>>>5]|=128<<24-g%32;var h=b.floor(f/
|
|
4294967296);c[(g+64>>>9<<4)+15]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360;c[(g+64>>>9<<4)+14]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360;a.sigBytes=4*(c.length+1);this._process();a=this._hash;c=a.words;for(f=0;4>f;f++)g=c[f],c[f]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360;return a},clone:function(){var a=k.clone.call(this);a._hash=this._hash.clone();return a}});f.MD5=k._createHelper(g);f.HmacMD5=k._createHmacHelper(g)})(Math);
|
|
(function(){var b=CryptoJS,j=b.lib,c=j.Base,a=j.WordArray,j=b.algo,h=j.EvpKDF=c.extend({cfg:c.extend({keySize:4,hasher:j.MD5,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(b,c){for(var h=this.cfg,j=h.hasher.create(),l=a.create(),s=l.words,p=h.keySize,h=h.iterations;s.length<p;){t&&j.update(t);var t=j.update(b).finalize(c);j.reset();for(var r=1;r<h;r++)t=j.finalize(t),j.reset();l.concat(t)}l.sigBytes=4*p;return l}});b.EvpKDF=function(a,b,c){return h.create(c).compute(a,
|
|
b)}})();
|
|
CryptoJS.lib.Cipher||function(b){var j=CryptoJS,c=j.lib,a=c.Base,h=c.WordArray,f=c.BufferedBlockAlgorithm,g=j.enc.Base64,m=j.algo.EvpKDF,k=c.Cipher=f.extend({cfg:a.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=b;this.reset()},reset:function(){f.reset.call(this);this._doReset()},process:function(a){this._append(a);return this._process()},
|
|
finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(a){return{encrypt:function(b,c,f){return("string"==typeof c?C:r).encrypt(a,b,c,f)},decrypt:function(b,c,f){return("string"==typeof c?C:r).decrypt(a,b,c,f)}}}});c.StreamCipher=k.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=j.mode={},s=function(a,c,f){var g=this._iv;g?this._iv=b:g=this._prevBlock;for(var h=0;h<f;h++)a[c+h]^=
|
|
g[h]},p=(c.BlockCipherMode=a.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a;this._iv=b}})).extend();p.Encryptor=p.extend({processBlock:function(a,b){var c=this._cipher,f=c.blockSize;s.call(this,a,b,f);c.encryptBlock(a,b);this._prevBlock=a.slice(b,b+f)}});p.Decryptor=p.extend({processBlock:function(a,b){var c=this._cipher,f=c.blockSize,g=a.slice(b,b+f);c.decryptBlock(a,b);s.call(this,
|
|
a,b,f);this._prevBlock=g}});l=l.CBC=p;p=(j.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,f=c<<24|c<<16|c<<8|c,g=[],j=0;j<c;j+=4)g.push(f);c=h.create(g,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};c.BlockCipher=k.extend({cfg:k.cfg.extend({mode:l,padding:p}),reset:function(){k.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,
|
|
this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var t=c.CipherParams=a.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),l=(j.format={}).OpenSSL={stringify:function(a){var b=a.ciphertext;a=a.salt;return(a?h.create([1398893684,
|
|
1701076831]).concat(a).concat(b):b).toString(g)},parse:function(a){a=g.parse(a);var b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=h.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return t.create({ciphertext:a,salt:c})}},r=c.SerializableCipher=a.extend({cfg:a.extend({format:l}),encrypt:function(a,b,c,f){f=this.cfg.extend(f);var g=a.createEncryptor(c,f);b=g.finalize(b);g=g.cfg;return t.create({ciphertext:b,key:c,iv:g.iv,algorithm:a,mode:g.mode,padding:g.padding,blockSize:a.blockSize,formatter:f.format})},
|
|
decrypt:function(a,b,c,f){f=this.cfg.extend(f);b=this._parse(b,f.format);return a.createDecryptor(c,f).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),j=(j.kdf={}).OpenSSL={execute:function(a,b,c,f){f||(f=h.random(8));a=m.create({keySize:b+c}).compute(a,f);c=h.create(a.words.slice(b),4*c);a.sigBytes=4*b;return t.create({key:a,iv:c,salt:f})}},C=c.PasswordBasedCipher=r.extend({cfg:r.cfg.extend({kdf:j}),encrypt:function(a,b,c,f){f=this.cfg.extend(f);c=f.kdf.execute(c,
|
|
a.keySize,a.ivSize);f.iv=c.iv;a=r.encrypt.call(this,a,b,c.key,f);a.mixIn(c);return a},decrypt:function(a,b,c,f){f=this.cfg.extend(f);b=this._parse(b,f.format);c=f.kdf.execute(c,a.keySize,a.ivSize,b.salt);f.iv=c.iv;return r.decrypt.call(this,a,b,c.key,f)}})}();
|
|
(function(){for(var b=CryptoJS,j=b.lib.BlockCipher,c=b.algo,a=[],h=[],f=[],g=[],m=[],k=[],l=[],s=[],p=[],t=[],r=[],C=0;256>C;C++)r[C]=128>C?C<<1:C<<1^283;for(var q=0,y=0,C=0;256>C;C++){var z=y^y<<1^y<<2^y<<3^y<<4,z=z>>>8^z&255^99;a[q]=z;h[z]=q;var A=r[q],F=r[A],T=r[F],L=257*r[z]^16843008*z;f[q]=L<<24|L>>>8;g[q]=L<<16|L>>>16;m[q]=L<<8|L>>>24;k[q]=L;L=16843009*T^65537*F^257*A^16843008*q;l[z]=L<<24|L>>>8;s[z]=L<<16|L>>>16;p[z]=L<<8|L>>>24;t[z]=L;q?(q=A^r[r[r[T^A]]],y^=r[r[y]]):q=y=1}var G=[0,1,2,4,8,
|
|
16,32,64,128,27,54],c=c.AES=j.extend({_doReset:function(){for(var b=this._key,c=b.words,f=b.sigBytes/4,b=4*((this._nRounds=f+6)+1),g=this._keySchedule=[],h=0;h<b;h++)if(h<f)g[h]=c[h];else{var j=g[h-1];h%f?6<f&&4==h%f&&(j=a[j>>>24]<<24|a[j>>>16&255]<<16|a[j>>>8&255]<<8|a[j&255]):(j=j<<8|j>>>24,j=a[j>>>24]<<24|a[j>>>16&255]<<16|a[j>>>8&255]<<8|a[j&255],j^=G[h/f|0]<<24);g[h]=g[h-f]^j}c=this._invKeySchedule=[];for(f=0;f<b;f++)h=b-f,j=f%4?g[h]:g[h-4],c[f]=4>f||4>=h?j:l[a[j>>>24]]^s[a[j>>>16&255]]^p[a[j>>>
|
|
8&255]]^t[a[j&255]]},encryptBlock:function(b,c){this._doCryptBlock(b,c,this._keySchedule,f,g,m,k,a)},decryptBlock:function(a,b){var c=a[b+1];a[b+1]=a[b+3];a[b+3]=c;this._doCryptBlock(a,b,this._invKeySchedule,l,s,p,t,h);c=a[b+1];a[b+1]=a[b+3];a[b+3]=c},_doCryptBlock:function(a,b,c,f,g,h,j,k){for(var m=this._nRounds,l=a[b]^c[0],r=a[b+1]^c[1],p=a[b+2]^c[2],q=a[b+3]^c[3],s=4,t=1;t<m;t++)var y=f[l>>>24]^g[r>>>16&255]^h[p>>>8&255]^j[q&255]^c[s++],z=f[r>>>24]^g[p>>>16&255]^h[q>>>8&255]^j[l&255]^c[s++],C=
|
|
f[p>>>24]^g[q>>>16&255]^h[l>>>8&255]^j[r&255]^c[s++],q=f[q>>>24]^g[l>>>16&255]^h[r>>>8&255]^j[p&255]^c[s++],l=y,r=z,p=C;y=(k[l>>>24]<<24|k[r>>>16&255]<<16|k[p>>>8&255]<<8|k[q&255])^c[s++];z=(k[r>>>24]<<24|k[p>>>16&255]<<16|k[q>>>8&255]<<8|k[l&255])^c[s++];C=(k[p>>>24]<<24|k[q>>>16&255]<<16|k[l>>>8&255]<<8|k[r&255])^c[s++];q=(k[q>>>24]<<24|k[l>>>16&255]<<16|k[r>>>8&255]<<8|k[p&255])^c[s++];a[b]=y;a[b+1]=z;a[b+2]=C;a[b+3]=q},keySize:8});b.AES=j._createHelper(c)})();
|
|
(function(b){var j={ArrayBuffer:"undefined"!==typeof ArrayBuffer,DataView:"undefined"!==typeof DataView&&("getFloat64"in DataView.prototype||"getFloat64"in new DataView(new ArrayBuffer(1)))},c={Int8:1,Int16:2,Int32:4,Uint8:1,Uint16:2,Uint32:4,Float32:4,Float64:8},a=function(h,f,g,m){if(!(this instanceof a))throw Error("jDataView constructor may not be called as a function");this.buffer=h;if(!(j.ArrayBuffer&&h instanceof ArrayBuffer)&&"string"!==typeof h)throw new TypeError("jDataView buffer has an incompatible type");
|
|
this._isArrayBuffer=j.ArrayBuffer&&h instanceof ArrayBuffer;this._isDataView=j.DataView&&this._isArrayBuffer;this._littleEndian=void 0===m?!1:m;m=this._isArrayBuffer?h.byteLength:h.length;void 0===f&&(f=0);this.byteOffset=f;void 0===g&&(g=m-f);this.byteLength=g;if(!this._isDataView){if("number"!==typeof f)throw new TypeError("jDataView byteOffset is not a number");if("number"!==typeof g)throw new TypeError("jDataView byteLength is not a number");if(0>f)throw Error("jDataView byteOffset is negative");
|
|
if(0>g)throw Error("jDataView byteLength is negative");}this._isDataView&&(this._view=new DataView(h,f,g),this._start=0);this._start=f;if(f+g>m)throw Error("jDataView (byteOffset + byteLength) value is out of bounds");this._offset=0;if(this._isDataView)for(var k in c)c.hasOwnProperty(k)&&function(a,b){var f=c[a];b["get"+a]=function(c,g){void 0===g&&(g=b._littleEndian);void 0===c&&(c=b._offset);b._offset=c+f;return b._view["get"+a](c,g)}}(k,this);else for(k in c)c.hasOwnProperty(k)&&function(a,f){var g=
|
|
c[a];f["get"+a]=function(c,h){void 0===h&&(h=f._littleEndian);void 0===c&&(c=f._offset);f._offset=c+g;if(f._isArrayBuffer&&0===(f._start+c)%g&&(1===g||h))return(new b[a+"Array"](f.buffer,f._start+c,1))[0];if("number"!==typeof c)throw new TypeError("jDataView byteOffset is not a number");if(c+g>f.byteLength)throw Error("jDataView (byteOffset + size) value is out of bounds");return f["_get"+a](f._start+c,h)}}(k,this)};a.createBuffer=j.ArrayBuffer?function(){for(var a=new ArrayBuffer(arguments.length),
|
|
b=new Int8Array(a),c=0;c<arguments.length;++c)b[c]=arguments[c];return a}:function(){return String.fromCharCode.apply(null,arguments)};a.prototype={compatibility:j,getString:function(a,b){var c;void 0===b&&(b=this._offset);if("number"!==typeof b)throw new TypeError("jDataView byteOffset is not a number");if(0>a||b+a>this.byteLength)throw Error("jDataView length or (byteOffset+length) value is out of bounds");c="";for(var j=0;j<a;++j){var k=this.getUint8(b+j);c+=String.fromCharCode(127<k?65533:k)}this._offset=
|
|
b+a;return c},getChar:function(a){return this.getString(1,a)},tell:function(){return this._offset},seek:function(a){if("number"!==typeof a)throw new TypeError("jDataView byteOffset is not a number");if(0>a||a>this.byteLength)throw Error("jDataView byteOffset value is out of bounds");return this._offset=a},_endianness:function(a,b,c,j){return a+(j?c-b-1:b)},_getFloat64:function(a,b){var c=this._getUint8(this._endianness(a,0,8,b)),j=this._getUint8(this._endianness(a,1,8,b)),k=this._getUint8(this._endianness(a,
|
|
2,8,b)),l=this._getUint8(this._endianness(a,3,8,b)),s=this._getUint8(this._endianness(a,4,8,b)),p=this._getUint8(this._endianness(a,5,8,b)),t=this._getUint8(this._endianness(a,6,8,b)),r=this._getUint8(this._endianness(a,7,8,b)),C=1-2*(c>>7),c=((c<<1&255)<<3|j>>4)-(Math.pow(2,10)-1),j=(j&15)*Math.pow(2,48)+k*Math.pow(2,40)+l*Math.pow(2,32)+s*Math.pow(2,24)+p*Math.pow(2,16)+t*Math.pow(2,8)+r;return 1024===c?0!==j?NaN:Infinity*C:-1023===c?C*j*Math.pow(2,-1074):C*(1+j*Math.pow(2,-52))*Math.pow(2,c)},
|
|
_getFloat32:function(a,b){var c=this._getUint8(this._endianness(a,0,4,b)),j=this._getUint8(this._endianness(a,1,4,b)),k=this._getUint8(this._endianness(a,2,4,b)),l=this._getUint8(this._endianness(a,3,4,b)),s=1-2*(c>>7),c=(c<<1&255|j>>7)-127,j=(j&127)<<16|k<<8|l;return 128===c?0!==j?NaN:Infinity*s:-127===c?s*j*Math.pow(2,-149):s*(1+j*Math.pow(2,-23))*Math.pow(2,c)},_getInt32:function(a,b){var c=this._getUint32(a,b);return c>Math.pow(2,31)-1?c-Math.pow(2,32):c},_getUint32:function(a,b){var c=this._getUint8(this._endianness(a,
|
|
0,4,b)),j=this._getUint8(this._endianness(a,1,4,b)),k=this._getUint8(this._endianness(a,2,4,b)),l=this._getUint8(this._endianness(a,3,4,b));return c*Math.pow(2,24)+(j<<16)+(k<<8)+l},_getInt16:function(a,b){var c=this._getUint16(a,b);return c>Math.pow(2,15)-1?c-Math.pow(2,16):c},_getUint16:function(a,b){var c=this._getUint8(this._endianness(a,0,2,b)),j=this._getUint8(this._endianness(a,1,2,b));return(c<<8)+j},_getInt8:function(a){a=this._getUint8(a);return a>Math.pow(2,7)-1?a-Math.pow(2,8):a},_getUint8:function(a){return this._isArrayBuffer?
|
|
(new Uint8Array(this.buffer,a,1))[0]:this.buffer.charCodeAt(a)&255}};"undefined"!==typeof jQuery&&"1.6.2"<=jQuery.fn.jquery&&(jQuery.ajaxSetup({converters:{"* dataview":function(b){return new a(b)}},accepts:{dataview:"text/plain; charset=x-user-defined"},responseHandler:{dataview:function(a,b,c){a.text="mozResponseArrayBuffer"in c?c.mozResponseArrayBuffer:"responseType"in c&&"arraybuffer"===c.responseType&&c.response?c.response:c.responseText}}}),jQuery.ajaxPrefilter("dataview",function(a){jQuery.support.ajaxResponseType&&
|
|
(a.hasOwnProperty("xhrFields")||(a.xhrFields={}),a.xhrFields.responseType="arraybuffer");a.mimeType="text/plain; charset=x-user-defined"}));b.jDataView=(b.module||{}).exports=a;"undefined"!==typeof module&&(module.exports=a)})(this);
|
|
(function(b){function j(c){if("string"===typeof c.data){var a=c.handler,h=c.data.toLowerCase().split(" ");c.handler=function(c){if(!(this!==c.target&&(/textarea|select/i.test(c.target.nodeName)||"text"===c.target.type))){var g="keypress"!==c.type&&b.hotkeys.specialKeys[c.which],j=String.fromCharCode(c.which).toLowerCase(),k="",l={};c.altKey&&"alt"!==g&&(k+="alt+");c.ctrlKey&&"ctrl"!==g&&(k+="ctrl+");c.metaKey&&(!c.ctrlKey&&"meta"!==g)&&(k+="meta+");c.shiftKey&&"shift"!==g&&(k+="shift+");g?l[k+g]=
|
|
!0:(l[k+j]=!0,l[k+b.hotkeys.shiftNums[j]]=!0,"shift+"===k&&(l[b.hotkeys.shiftNums[j]]=!0));g=0;for(j=h.length;g<j;g++)if(l[h[g]])return l=a.apply(this,arguments),c.preventDefault(),l}}}}b.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",
|
|
105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",219:"[",221:"]",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"}};b.each(["keydown","keyup","keypress"],function(){b.event.special[this]={add:j}})})(jQuery);
|
|
(function(b){function j(c,a){this.$element=b(c);this.options=a;this.enabled=!0;this.fixTitle()}j.prototype={show:function(){b.fn.tipsy.revalidate();var c=this.getTitle();if(c&&this.enabled){var a=this.tip();a.find(".pico-tips-inner")[this.options.html?"html":"text"](c);a[0].className="pico-tips";a.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo("body");var c=b.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),h=a[0].offsetWidth,
|
|
f=a[0].offsetHeight,g="function"==typeof this.options.gravity?this.options.gravity.call(this.$element[0]):this.options.gravity,j;switch(g.charAt(0)){case "n":j={top:c.top+c.height+this.options.offset,left:c.left+c.width/2-h/2};break;case "s":j={top:c.top-f-this.options.offset,left:c.left+c.width/2-h/2};break;case "e":j={top:c.top+c.height/2-f/2,left:c.left-h-this.options.offset};break;case "w":j={top:c.top+c.height/2-f/2,left:c.left+c.width+this.options.offset}}2==g.length&&(j.left="w"==g.charAt(1)?
|
|
c.left+c.width/2-15:c.left+c.width/2-h+15);a.css(j).addClass("pico-tips-"+g);a.find(".pico-tips-arrow")[0].className="pico-tips-arrow pico-tips-arrow-"+g.charAt(0);this.options.className&&a.addClass("function"==typeof this.options.className?this.options.className.call(this.$element[0]):this.options.className);this.options.fade?a.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):a.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?
|
|
this.tip().stop().fadeOut(function(){b(this).remove()}):this.tip().remove();b.fn.tipsy.revalidate()},fixTitle:function(){var b=this.$element;if(b.attr("title")||"string"!=typeof b.attr("original-title"))b.attr("original-title",b.attr("title")||"").removeAttr("title")},getTitle:function(){var b,a=this.$element,h=this.options;this.fixTitle();h=this.options;"string"==typeof h.title?b=a.attr("title"==h.title?"original-title":h.title):"function"==typeof h.title&&(b=h.title.call(a[0]));return(b=(""+b).replace(/(^\s*|\s*$)/,
|
|
""))||h.fallback},tip:function(){this.$tip||(this.$tip=b('<div class="pico-tips"></div>').html('<div class="pico-tips-arrow"></div><div class="pico-tips-inner"></div>'),this.$tip.data("pico-tips-pointee",this.$element[0]));return this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.options=this.$element=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}};b.fn.tipsy=function(c){function a(a){var f=
|
|
b.data(a,"tipsy");f||(f=new j(a,b.fn.tipsy.elementOptions(a,c)),b.data(a,"tipsy",f));return f}function h(){var b=a(this);b.hoverState="in";0==c.delayIn?b.show():(b.fixTitle(),setTimeout(function(){"in"==b.hoverState&&b.show()},c.delayIn))}function f(){var b=a(this);b.hoverState="out";0==c.delayOut?b.hide():setTimeout(function(){"out"==b.hoverState&&b.hide()},c.delayOut)}if(!0===c)return this.data("tipsy");if("string"==typeof c){var g=this.data("tipsy");if(g)g[c]();return this}c=b.extend({},b.fn.tipsy.defaults,
|
|
c);c.live||this.each(function(){a(this)});if("manual"!=c.trigger){var g="hover"==c.trigger?"mouseenter.tipsy":"focus.tipsy",m="hover"==c.trigger?"mouseleave.tipsy":"blur.tipsy";if(c.live)b(this.context).on(g,this.selector,h).on(m,this.selector,f);else this.bind(g,h).bind(m,f)}return this};b.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!0,fallback:"",gravity:"n",html:!1,live:!0,offset:0,opacity:0.9,title:"title",trigger:"hover"};b.fn.tipsy.revalidate=function(){b(".pico-tips").each(function(){var c=
|
|
b.data(this,"tipsy-pointee"),a;if(!(a=!c)){a:{for(;c=c.parentNode;)if(c==document){c=!0;break a}c=!1}a=!c}a&&b(this).remove()})};b.fn.tipsy.elementOptions=function(c,a){return b.metadata?b.extend({},a,b(c).metadata()):a};b.fn.tipsy.autoNS=function(){return b(this).offset().top>b(document).scrollTop()+b(window).height()/2?"s":"n"};b.fn.tipsy.autoWE=function(){return b(this).offset().left>b(document).scrollLeft()+b(window).width()/2?"e":"w"};b.fn.tipsy.autoBounds=function(c,a){return function(){var h=
|
|
a[0],f=1<a.length?a[1]:!1,g=b(document).scrollTop()+c,j=b(document).scrollLeft()+c,k=b(this);k.offset().top<g&&(h="n");k.offset().left<j&&(f="w");b(window).width()+b(document).scrollLeft()-k.offset().left<c&&(f="e");b(window).height()+b(document).scrollTop()-k.offset().top<c&&(h="s");return h+(f?f:"")}}})(jQuery);
|
|
(function(b){b.fn.superfish=function(a){var c=b.fn.superfish,f=c.c,g=function(){var a=b(this),c=l(a);clearTimeout(c.sfTimer);a.showSuperfishUl().siblings().hideSuperfishUl()},j=function(a){var f=b(this),g=l(f);"click"===a.type||c.ios?b.proxy(k,f,g)():(clearTimeout(g.sfTimer),g.sfTimer=setTimeout(b.proxy(k,f,g),g.delay))},k=function(a){a.retainPath=-1<b.inArray(this[0],a.$path);this.hideSuperfishUl();this.parents("."+a.hoverClass).length||a.$path.length&&b.proxy(g,a.$path)()},l=function(a){return a.closest("."+
|
|
f.menuClass).data("sf-options")},s=function(a){var c=b(this),f=c.siblings("ul");if(0<f.length&&f.is(":hidden")&&(c.data("follow",!1),"MSPointerDown"===a.type))return c.trigger("focus"),!1},p=function(a){var c=b(this),f=a.data,h=c.siblings("ul"),k=!1===c.data("follow")?!1:!0;if(h.length&&(f.useClick||!k))a.preventDefault(),h.is(":hidden")?b.proxy(g,c.parent("li"))():f.useClick&&k&&b.proxy(j,c.parent("li"),a)()};c.getOptions=l;return this.addClass(f.menuClass).each(function(){var k=b(this),l=b.extend({},
|
|
c.defaults,a),C=k.find("li:has(ul)");l.$path=k.find("li."+l.pathClass).slice(0,l.pathLevels).addClass(l.hoverClass+" "+f.bcClass).filter(function(){return b(this).children("ul").hide().show().length}).removeClass(l.pathClass);k.data("sf-options",l);k.css("ms-touch-action","none");l.useClick||k.hoverIntent(g,j,"li:has(ul)");var q="MSPointerDown";c.ios||(q+=" touchstart");c.wp7&&(q+=" mousedown");k.on("focusin","li",g).on("focusout","li",j).on("click","a",l,p).on(q,"a",s);C.not("."+f.bcClass).hideSuperfishUl(!0)})};
|
|
var j=b.fn.superfish;j.o=[];j.op={};j.c={bcClass:"sf-breadcrumb",menuClass:"normal",anchorClass:"sf-with-ul"};j.defaults={hoverClass:"selected",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"fast",speedOut:"fast",useClick:!1};j.ios=/iPhone|iPad|iPod/i.test(navigator.userAgent);var c;c=document.documentElement.style;c="behavior"in c&&"fill"in c&&/iemobile/i.test(navigator.userAgent);j.wp7=c;b.fn.extend({hideSuperfishUl:function(a){var b=
|
|
this,c=j.getOptions(b),g=!0===c.retainPath?c.$path:"",g=b.find("li."+c.hoverClass).add(this).not(g).removeClass(c.hoverClass).children("ul"),m=c.speedOut;a&&(g.show(),m=0);c.retainPath=!1;g.stop(!0,!0).animate(c.animationOut,m,function(){c.useClick&&b.children("a").data("follow",!1)});return this},showSuperfishUl:function(){var a=j.getOptions(this),b=this.addClass(a.hoverClass);b.children("ul").stop(!0,!0).animate(a.animation,a.speed,function(){b.children("a").data("follow",!0)});return this}});j.ios&&
|
|
(b(window).load(function(){b("body").children().on("click",b.noop)}),b(window).on("pageshow",function(a){a.originalEvent.persisted&&window.location.reload()}))})(jQuery);
|
|
/*
|
|
* Part of Picozu Image Editing application.
|
|
* Visit https://www.picozu.com for more info.
|
|
* The code is copyrighted by Picozu <www.picozu.com>.
|
|
|
|
* @version 1.4.112215
|
|
* @package Core Application Objects
|
|
* @application Picozu <www.picozu.com>
|
|
* @license www.picozu.com/license
|
|
*/(function(){var a={},c={},b=String.toLocale=function(b){if(0<arguments.length&&"number"!==typeof b)if(!1===b)c={};else for(var e in b)if(Object.prototype.hasOwnProperty.call(b,e)){var f=b[e];e=e.toLowerCase();if(!(e in c)||!1===f)c[e]={};if(!1!==f)if("string"===typeof f)e in a||(a[e]=[]),a[e].push(f);else for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(c[e][g]=f[g])}return String.prototype.toLocale.apply(String,arguments)};String.locale||(String.locale="undefined"!==typeof navigator?navigator.language||
|
|
navigator.userLanguage||"":"en-US");String.prototype.toLocale=function(){var d=String.locale.toLowerCase().split("-"),e=d.length,f=this.valueOf();do{var g=d.slice(0,e).join("-");if(g in a){for(var h=g,j=0,k=a[h].length;j<k;j++)b({});delete a[h]}if(g in c&&f in c[g])return c[g][f]}while(e--);return f}})();
|
|
String.toLocale({"en-US":{"%Christmas Lights":"Christmas Lights","%Girly Flowers":"Girly Flowers","%Green Strokes":"Green Strokes","%Heart 2 Heart":"Heart 2 Heart","%Shadow Cracks":"Shadow Cracks","%Picozu":"Picozu","%16x16px":"16x16px","%24x24px":"24x24px","%32x32px":"32x32px","%48x48px":"48x48px","%64x64px":"64x64px","%128x128px":"128x128px","%Sketchtaculous":"Sketchtaculous","%Sketchy":"Sketchy","%Chrome":"Chrome","%Fur":"Fur","%Full Name":"Full Name","%text.apply":"Apply changes and create layer",
|
|
"%text.discard":"Discard the changes","%Welcome to Picozu":"Welcome to Picozu","%Create a new image":"Create a new image","%Connect with Facebook":"Connect with Facebook","%Open a Sample Image":"Open a Sample Image","%Watch a Tutorial":"Watch a Tutorial","%Install Extensions":"Install Extensions","%rename.tab.tip":"The new image name, between 3 and 20 characters long.","%intro.create":"Grab the brush tool, open the clipart gallery, and start your drawing. Do not forget to use layers.","%intro.facebook":"Link your Facebook account with Picozu, retrieve you images and apply our amazing filters.",
|
|
"%intro.sample":"Select one of the sample images provided by Picozu for a quick test. Create a masterpiece. Show it to your friends.","%intro.help":"Browse through our videos to catch a glimpse at what you can do with Picozu.","%intro.extensions":"Install more plugins, filters, themes so you can customize the editor's interface.","%Web":"Web","%Folklore":"Folklore","%Jingle All The Way":"Jingle All The Way","%Shaded":"Shaded","%Ribbon":"Ribbon","%Circles":"Circles","%Stars":"Stars","%Thatched Paper":"Thatched Paper",
|
|
"%Smooth":"Smooth","%Lace":"Lace","%Library":"Library","%iPhone UI":"iPhone UI","%t-Shirts":"t-Shirts","%Raspberry Tints":"Raspberry Tints","%Roses for the Sweet":"Roses for the Sweet","%Artichoke Splash":"Artichoke Splash","%Cobalt":"Cobalt","%Paint Smudge":"Paint Smudge","%Gold Rush":"Gold Rush","%RGB Shift":"RGB Shift","%Tangled":"Tangled","%Diamonds":"Diamonds","%Rounds":"Rounds","%main.library":"Library","%Shadetastic":"Shadetastic","%Grid":"Grid","%Long Fur":"Long Fur","%Squares":"Squares",
|
|
"%String":"String","%Dynamic":"Dynamic","%Curves":"Curves","%Show Grid":"Show Grid","%Flowers":"Flowers","%Palm":"Palm","%Grassy":"Grassy","%main.apply":"Apply","%Watermark":"Watermark","%Kids":"Kids","%Galaxy":"Galaxy","%theme.1.desc":"The default Picozu theme.","%theme.2.desc":"Galaxy, a dark Picozu theme.","%theme.3.desc":"Cartoon-inspired theme for kids.","%filters.1.desc":"The default Picozu filter pack.","%filters.2.desc":"The Digital Effects filter pack.","%Picozu Team":"Picozu Team","%Tutorials":"Tutorials",
|
|
"%library version":"library version","%Kids":"Kids","%Frenzy":"Frenzy","%Vertigo":"Vertigo","%tool.magiceraser":"Magic Eraser Tool","%Image from Layer":"Image from Layer","%Video Tutorial Facebook Import/Export":"Video Tutorial Facebook Import/Export","%Organize Swatches":"Organize Swatches","%Picozu Cloud Import/Export":"Picozu Cloud Import/Export","%Blending Modes":"Blending Modes","%Import Options":"Import Options","%Show Tips":"Show Tips","%Railway":"Railway","%Activate":"Activate","%Country":"Country",
|
|
"%Summer":"Summer","%settings.showtips":"Show tips as notifications.","%settings.showgrid":"Show the background grid on transparent images.","%main.noimages":"There are no images in this folder/album.","%main.noimages.generic":"There are no images here.","%Digital Effects":"Digital Effects","%Next Layer":"Next Layer","%Undo last action":"Undo last action","%Copy selection":"Copy selection","%Cut selection":"Cut selection","%Quit tool":"Quit tool","%Paste selection":"Paste selection","%Select all":"Select all",
|
|
"%Select none":"Select none","%New layer":"New layer","%Duplicate layer":"Duplicate layer","%Delete layer":"Delete layer","%Select next layer":"Select next layer","%Select previous layer":"Select previous layer","%Close image":"Close image","%Toggle dockbar":"Toggle dockbar","%Toggle toolbar":"Toggle toolbar","%Toggle propbar":"Toggle propbar","%Close toolbar, dockbar and propbar":"Close toolbar, dockbar and propbar","%Open debugger":"Open debugger","%Move layer left":"Move layer left","%Move layer right":"Move layer right",
|
|
"%Move layer up":"Move layer up","%Move layer down":"Move layer down","%Toggle fullscreen mode":"Toggle fullscreen mode","%New image":"New image","%Save image":"Save image","%Resize image":"Resize image","%Canvas image":"Canvas image","%Visit our Homepage":"Visit our Homepage","%Follow us on Twitter":"Follow us on Twitter","%Like us on Facebook":"Like us on Facebook","%Image info":"Image info","%Image reset":"Image reset","%Requirements":"Requirements","%main.help.text1":"Picozu Editor is an online drawing and photo retouching application based on HTML5 and CSS3. The app provides you with an easy yet complex way to edit your photos, draw using various brushes, filters, layers and explore various editing tools such as color fill, magic eraser, freehand selection, context menu and more.",
|
|
"%main.help.text2":"We invite you to join our community for free. There are no subscription requirements and you can edit as many or as few images as you want. Picozu Editor stands out not only because it is built entirely on HTML5 but also because of the many editing options it includes, from more than one hundred filters to multiple drawing tools and numerous import/export options.","%main.help.text3":"Picozu is easy to use and only limited by your creativity.","%main.help.text4":"drawing capabilities, multiple tools and brushes",
|
|
"%main.help.text5":"image retouching functions","%main.help.text6":"multiple images opened in the workspace","%main.help.text7":"new and streamlined UI","%main.help.text8":"dynamic color swatches","%main.help.text9":"social media integration","%main.help.text10":"import / export images from / to Facebook, Dropbox, Onedrive, Google Drive, Flickr and many more","%Previous Layer":"Previous Layer","%Browser Addons":"Browser Addons","%Picozu Chrome app page":"Visit Picozu Chrome page","%Picozu Chrome":"Picozu Chrome",
|
|
"%picozu.chrome.text1":"We detected that","%picozu.chrome.text2":"application is not installed.","%picozu.shooter.text1":"We detected that","%picozu.shooter.text2":"is not installed. Shooter is a Mozilla Firefox browser extension that allows you to take a screenshot of a given browser page, or a specific region.","%Mozilla project page":"Mozilla project page","%Picozu it!":"Picozu it!","%Image URL":"Image URL","%Keyboard Shortcuts":"Keyboard Shortcuts","%picozu.shooter.installed":"Picozu Shooter is installed. Thank you!",
|
|
"%Install Picozu Shooter":"Install Picozu Shooter","%main.image.specify":"Please specify an image URL to import into Picozu.","%enter image URL":"enter image URL","%help.search.tip":"Type a search term in the above textbox and press <em>Enter</em>.","%Import from URL":"Import from URL","%picozu.shooter.text1":"Picozu Shooter is a Mozilla Firefox browser extension, which allows you to take a screenshot of a given browser page, or a specific region of it. Basically, it can be used to take screenshots of websites or portions of it, very useful for a web developer or tester/QA.",
|
|
"%picozu.shooter.text2":"Once you make a selection, you can copy it to your clipboard, download it on your computer as a new image or export it to Picozu for processing.","%URL":"URL","%tool.colorfill":"Color Fill Tool","%main.selectfile":"Select File","%General Info":"General Info","%Mozilla Firefox":"Mozilla Firefox","%bookmark.button":"Drag & Drop this button to your browser's bookmarks bar.","%Sign Up for Picozu":"Sign Up for Picozu","%Terms and Conditions":"Terms and Conditions","%Assigned to":"Assigned to",
|
|
"%Report an Issue":"Report an Issue","%main.deletelayer":"Delete the layer","%main.selectlayer.error":"You need to select a layer first.","%main.deletelayer.text":"Are you sure you want to delete this layer? It's not permanent, you can undo the operation by pressing <em>CTRL + Z</em> keys.","%Left":"Left","%main.clearswatches":"Clear Color Swatches","%main.clearswatches.text":"Are you sure you want to clear your custom color swatches?","%main.clearswatches.success":"Custom color swatches reset successfully.",
|
|
"%Top":"Top","%saveimage.text1":"Please select a format for saving your current image; this action will download the image to your computer.","%saveimage.text2":"Select PNG for transparency, JPG for normal or one of the more advanced image formats.","%export.ase":"Adobe Swatch Exchange","%Bring to Front":"Bring to Front","%Pencil / Brush":"Pencil / Brush","%main.create":"Create","%main.resetworkspace":"Reset your Workspace","%main.resetworkspacetext":"Resetting your workspace will close any images you have currently opened. Are you sure you want to continue?",
|
|
"%Close the Editor":"Close the Editor","%Reverse":"Reverse","%Send to Back":"Send to Back","%select folder":"select folder","%export.clr":"Adobe Flash color palette","%export.act":"Adobe Fireworks color table","%Shape":"Shape","%no layers":"no layers","%no albums":"no albums","%no folders":"no folders","%File":"File","%The type of the selected layer":"The type of the selected layer","%Mixed":"Mixed","%Picozu Terms of Service":"Picozu Terms and Conditions","%I agree to":"I agree to ","%register.terms":"You must agree to Picozu Terms and Conditions before signing up for a Picozu account.",
|
|
"%Actions":"Actions","%recover":"Recover","%recover.account":"Recover your Account","%recover.error.empty":"Please fill in the requested information in order to recover your account.","%recover.success":"You should receive an e-mail soon, so please check your e-mail address for the reset confirmation link.","%recover.error":"We were unable to recover your account using the provided information.","%or":"or","%Dependencies":"Dependencies","%export.gmp":"GIMP color palette","%export.aco":"Adobe pre-CS2 color palette",
|
|
"%export.stylesheet.css":"CSS","%export.stylesheet.less":"LESS","%Rounded Rect":"Rounded Rect","%Arrow":"Arrow","%Ellipse":"Ellipse","%Search":"Search","%enter a search term":"enter a search term","%Line":"Line","%Circle":"Circle","%Rectangle":"Rectangle","%Change language":"Change language","%main.file.unknown":"Unknown file format, it will not be loaded into Picozu.","%resize.bigimage":"This image is too large and importing it might crash your browser. Do you want to resize it?","%Class prefix":"Class prefix",
|
|
"%main.psd.done":"Adobe Photoshop PSD image imported successfully.","%main.webp.done":"WEBP image imported successfully.","%main.svg.done":"SVG image imported successfully.","%main.swatches.done":"Adobe ASE swatches imported successfully.","%main.curves.done":"Adobe ACV curves imported successfully.","%main.workspace.done":"Picozu workspace imported successfully.","%main.image.done":"Image imported successfully.","%Stylesheet format":"Stylesheet format","%tips.export.jpegquality":"JPEG image quality, from 1 to 10 where 10 is the best quality.",
|
|
"%tips.export.bg":"Background color if the image has no background layer.","%tips.export.encrypt":"Whether to encrypt or not the image/workspace (it will increase the image size).","%tips.export.classprefix":"The CSS class prefix for sprites.","%tips.export.format":"Export to Cascading Style Sheets (CSS) or dynamic stylesheets (LESS).","%tips.export.embedimage":"Embed the sprite image in the stylesheet as data URI.","%Embed image in CSS":"Embed image in CSS","%preview.color":"Preview the color","%preview.colorhex":"Enter a color code in hex format (000000 is black, FFFFFF is white).",
|
|
"%main.cloud.notloggedin":"You need to be signed into your Picozu account before you can import or save your work from/to the Picozu Cloud.","%main.invalidtabname":"Invalid image name, it must be between 3 and 20 characters long.","%tips.tabname":"Click here to activate this tab. Double click it to change its name.","%tips.cmyk":"The CMYK color model is a subtractive color model used in color printing, and it refers to the four inks used in some color printing: cyan, magenta, yellow, and key (black).",
|
|
"%tips.lab":"A Lab color space is a color-opponent space with dimension L for lightness and a and b for the color-opponent dimensions, based on nonlinearly compressed CIE XYZ color space coordinates.","%tips.hsv":"HSV is a common cylindrical-coordinate representation of points in an RGB color model and stands for hue, saturation, and value, and is also often called HSB (B for brightness).","%tips.xyz":"The XYZ color space is an international standard based on three hypothetical primaries, XYZ, and all visible colors can be represented by using only positive values of X, Y, and Z. The Y primary is intentionally defined to match closely to luminance, while X and Z primaries give color information.",
|
|
"%tips.rgb":"In the RGB model, each color appears as a combination of red, green, and blue. This model is called additive, and the colors are called primary colors.","%window.filters.ok":"Apply the selected filter and close the window.","%window.filters.apply":"Apply the selected filter without closing the window, so that you can apply multiple filters.","%main.selectfiles":"Select Files","%main.saveas":"Save as","%main.openas":"Open as","%Rename Image":"Rename Image","%Color Mode":"Color Mode","%refreshing minimap data":"refreshing minimap data",
|
|
"%Background Color":"Background Color","%loading":"loading","%Foreground Color":"Foreground Color","%Update":"Update","%main.imagesizeerror":"The image size you specified is invalid.","%tool.gradient":"Gradient Fill Tool","%search.errorempty":"Please fill in a search term.","%plugin.depends":"A plugin has missing dependencies and it cannot be started.","%plugin.depends.on":"This plugin cannot be installed because it depends on another plugin, <strong>","%plugin.depends.install":"</strong>, and you need to install that one first.",
|
|
"%Snap to Grid":"Snap to Grid","%Snap to Layers":"Snap to Layers","%settings.snaplayers":"When moving a layer, snap its edges to the other layers' edges.","%Copy of":"Copy of","%Picozu Cloud":"Picozu Cloud","%main.signup3rdparty":"Don't want to remember another password? Use your social network account.","%Camera":"Camera","%Encrypt":"Encrypt","%Nickname":"Nickname","%main.cloudexport.title":"Export to Picozu Cloud","%main.cloudimport.title":"Import from Picozu Cloud","%main.cloud.savesuccess":"Successully saved your image to the Picozu Cloud.",
|
|
"%main.cloud.saveerror":"There was an error while saving your image to the Picozu Cloud.","%panel.shape.radius":"Corner Radius","%Confirm Password":"Confirm Password","%reg.error.email":"Please enter a valid email address.","%reg.error.password":"Passwords must be at least 6 characters long.","%reg.error.password2":"Passwords are not the same.","%reg.error.fullname":"You must fill in your full name.","%reg.error.username":"Username must be 4-50 characters long, it can contain a-z, A-Z, 0-9, -, _ and must begin with either a letter, number or underscore.",
|
|
"%Both fill":"Both fill and stroke","%registration.error":"Unable to create a Picozu account with the provided data.","%registration.success":"Successfully created your Picozu account. Thank you.","%profile.success":"Successfully saved your Picozu account data.","%profile.error":"Unable to save your Picozu account data.","%login.success":"Successfully signed into your Picozu account.","%login.error":"Error signing in to Picozu with the provided user data.","%Snap to Edges":"Snap to Edges","%select album":"select album",
|
|
"%Success":"Success","%main.doneautosave":"Workspace autosaved successfully","%3 mins":"3 mins","%5 mins":"5 mins","%10 mins":"10 mins","%settings.snapgrid":"Snap the layers to a 20x20 pixels grid.","%settings.snapedges":"Snap the layers to the workspace edges.","%settings.autosave":"The interval at which your workspace will be autosaved.","%autosave":"Autosave","%main.filename":"File name","%main.type":"Type","%main.exporter":"Picozu cannot export the data to the specified format.","%main.offline":"You are currently not connected to the Internet, and due to the way browsers work, we're unable to save your file. Sorry!",
|
|
"%window.canvas.size":"Canvas Size","%panel.brushes.symmetry":"Symmetry","%Locate on map":"Locate on map","%Lens Distortion":"Lens Distortion","%export.palette":"Export Color Palette","%Got an account?":"Got an account?","%Yes":"Yes","%No":"No","%main.image.unknown":"Unknown image format. Maybe it's not an image? ntz ntz ntz ...","%E-mail":"E-mail","%Date":"Date","%Default":"Default","%Custom":"Custom","%panel.brushes.tolerance":"Tolerance","%More tools":"More tools","%main.font":"Font","%main.title":"Title",
|
|
"%Max aperture size":"Max aperture size","%ISO equivalent":"ISO equivalent","%Exposure time":"Exposure time","%Exposure bias":"Exposure bias","%Focal Length":"Focal Length","%Flash used":"Flash used","%Metering":"Metering","%EXIF version":"EXIF version","%Latitude":"Latitude","%Latitude ref":"Latitude ref","%Longitude":"Longitude","%Longitude ref":"Longitude ref","%GPS date":"GPS date","%Map data":"Map data","%Register":"Register","%Sign In":"Sign In","%Refraction":"Refraction","%Sine Ripples":"Sine Ripples",
|
|
"%Curves":"Curves","%mode":"mode","%Folder":"Folder","%size":"size","%Kaleidoscope":"Kaleidoscope","%Rotation":"Rotation","%xCenter":"xCenter","%yCenter":"yCenter","%Triangle Ripples":"Triangle Ripples","%Sawtooth Ripples":"Sawtooth Ripples","%xAmplitude":"xAmplitude","%yAmplitude":"yAmplitude","%xWavelength":"xWavelength","%yWavelength":"yWavelength","%Line Smear":"Line Smear","%Circle Smear":"Circle Smear","%Square Smear":"Square Smear","%Cross Smear":"Cross Smear","%Upload .acv file":"Upload .acv file",
|
|
"%main.size":"Size","%main.not_implemented_yet":"Function not implemented yet. Stay tuned!","%panel.brushes.hardness":"Hardness","%panel.brushes.flow":"Flow","%panel.font.family":"Family","%panel.type":"Type","%Fonts":"Fonts","%tips.brush.size":"Size of the currently selected brush.","%Resize Layer":"Resize Layer","%Resize Image":"Resize Image","%Distance":"Distance","%Density":"Density","%Mix":"Mix","%panel.brushes":"Brushes","%Adjustments":"Adjustments","%taskbar":"taskbar","%Hue":"Hue","%Toolbar":"Toolbar",
|
|
"%Dockbar":"Dockbar","%window.toggle":"Toggle this Window","%Toggle":"Toggle","%Minimal":"Minimal","%Full Featured":"Full Featured","%Saturation":"Saturation","%Luminosity":"Luminosity","%Brightness":"Brightness","%Contrast":"Contrast","%Layer":"Layer","%Name":"Name","%Blend Mode":"Blend Mode","%Opacity":"Opacity","%Fill":"Fill","%Layers":"Layers","%panel.size":"Size","%New Layer":"New Layer","%New":"New","%Duplicate Layer":"Duplicate Layer","%Duplicate":"Duplicate","%Merge All Layers":"Merge All Layers",
|
|
"%Merge":"Merge","%Edit Layer":"Edit Layer","%Edit":"Edit","%Delete Layer":"Delete Layer","%Delete":"Delete","%Properties":"Properties","%Shadow":"Shadow","%Pattern fill":"Pattern fill","%Gradient fill":"Gradient fill","%No fill":"No fill","%Shape Fill Mode":"Shape Fill Mode","%Opacity of the layer":"Opacity of the layer","%Width of the layer":"Width of the layer","%Height of the layer":"Height of the layer","%Left position of the layer":"Left position of the layer","%Top position of the layer":"Top position of the layer",
|
|
"%tips.layer.name":"The currently selected layer`s name","%Background color fill":"Background color fill","%Shadow Offset X":"Shadow Offset X","%Shadow Offset Y":"Shadow Offset Y","%Top shadow offset":"Top shadow offset","%settings.blurshadow":"Blur of the shadow, less is more intense","%Left shadow offset":"Left shadow offset","%Shadow Blur":"Shadow Blur","%Help Contents":"Help Contents","%Mode":"Mode","%Size":"Size","%Stroke":"Stroke","%Both":"Both","%Preview":"Preview","%Arabesque":"Arabesque",
|
|
"%Shapes":"Shapes","%Sides":"Sides","%Slope":"Slope","%tool.hand":"Hand Tool","%tool.select":"Selection Tool","%tool.rectselect":"Rectangular Selection Tool","%tool.polyselect":"Polygon Selection Tool","%tool.freeselect":"Freehand Selection Tool","%tool.crop":"Crop Tool","%tool.shape":"Shape Tool","%tool.line":"Line Shape Tool","%tool.arrow":"Arrow Shape Tool","%tool.circle":"Circle Shape Tool","%tool.ellipse":"Ellipse Shape Tool","%tool.rect":"Rectangle Shape Tool","%tool.rrect":"Rounded Rectangle Shape Tool",
|
|
"%tool.polygon":"Polygon Shape Tool","%tool.text":"Text Tool","%tool.brush":"Brush Tool","%tool.pen":"Pen Tool","%tool.pencil":"Pencil Tool","%tool.picker":"Color Picker Tool","%tool.fill":"Color Fill Tool","%tool.eraser":"Eraser Tool","%tool.ruler":"Ruler Measurement Tool","%tool.airbrush":"Airbrush Tool","%Sample images":"Sample images","%Gradient":"Gradient","%Color":"Color","%Debugger":"Debugger","%Extensions":"Extensions","%Plugins":"Plugins","%Themes":"Themes","%Author":"Author","%Description":"Description",
|
|
"%Enable":"Enable","%Disable":"Disable","%Uninstall":"Uninstall","%Install":"Install","%New Image":"New Image","%main.go_fullscreen":"We detected that your browser can run in fullscreen. Do you want Picozu to switch your browser to fullscreen mode?","%main.fullscreen":"Fullscreen Mode","%main.save":"Save","%main.ok":"OK","%window.minimize":"Minimize this Window","%window.close":"Close this Window","%Switch Colors":"Switch Colors","%Close this Tab":"Close this Tab","%Group":"Group","%layer.bg":"Background Layer",
|
|
"%main.unsaved":"Picozu detected that you have unsaved work in your current tab. Are you sure you want to proceed and lose all your work?","%tab.close":"Close current tab","%tab.reset":"Reset current tab","%tab.firstnodestroy":"You cannot close the first tab.","%Error":"Error","%select":"select","%ago":"ago","%Cascade this dockbar":"Cascade this dockbar","%main.select.layer":"You need to select a layer before applying a filter on it.","%main.select.filter":"You need to select a filter to apply.",
|
|
"%main.select.layer.fractal":"You need to select a layer before generating a fractal on it.","%main.select.fractal":"You need to select a fractal to generate.","%layer.visibility":"Toggle Visibility","%layer.lockunlock":"Lock/Unlock Layer","%layer.group":"Layer Group","%Info":"Info","%You":"You","%Filter configuration - ":"Filter configuration - ","%main.image.notloaded":"Specified image could not be loaded.","%window.upload.info":'Select a file to upload into Picozu. Currently you can import <span class="tips" title="Portable Network Graphics">PNG</span>, JPG, <span class="tips" title="Bitmap Image File">BMP</span>, WEBP, <span class="tips" title="Scalable Vector Graphics">SVG</span>, PZI and <span class="tips" title="Adobe Photoshop Document">PSD</span> images as well as PZW workspaces.',
|
|
"%main.file.notloaded":"Specified file could not be loaded.","%main.threadprocesserror":"Error processing thread data","%main.mozillainstall":"Thank you for installing the Picozu app from Mozilla Marketplace.","%Picozu App":"Picozu App","%main.mozilainstall.error":"An error has occured while installing Picozu. Mozilla Marketplace reported:","%Picozu Shooter":"Picozu Shooter","%browser.too.old":"We are really sorry, but unfortunately, your browser is not compatible with Picozu.","%layer.locked":"The current layer is locked. Either unlock it or select/create another layer.",
|
|
"%Account":"Account","%JOIN":"JOIN","%Block":"Block","%unsaved.changes":"You have unsaved changes!","%CREATE":"CREATE","%EDIT":"EDIT","%SHARE":"SHARE","%Clear recent curves":"Clear recent curves","%My Account":"My Account","%Username":"Username","%Password":"Password","%No account yet? ":"No account yet? ","%Create one":"Create one","%Share":"Share","%Share the Love":"Share the Love","%Workspace":"Workspace","%Open":"Open","%Open Image":"Open Image","%Export":"Export","%Reset":"Reset","%Tab":"Tab",
|
|
"%Open from":"Open from","%Locked":"Locked","%Text":"Text","%Close":"Close","%Undo":"Undo","%Cut":"Cut","%Copy":"Copy","%Paste":"Paste","%Select":"Select","%All":"All","%None":"None","%Image":"Image","%menu.resize":"Resize","%Adjust":"Adjust","%Layer via Select":"Layer via Select","%Layer via Image":"Layer via Image","%Layer via Cut":"Layer via Cut","%Layer via Copy":"Layer via Copy","%Fill Layer":"Fill Layer","%Rotate":"Rotate","%Flip Horizontally":"Flip Horizontally","%Flip Vertically":"Flip Vertically",
|
|
"%Rotate 90":"Rotate 90","%Rotate 180":"Rotate 180","%Rotate 270":"Rotate 270","%Arrange":"Arrange","%Bring Forward":"Bring Forward","%Send Backward":"Send Backward","%Flatten":"Flatten","%Tips & Tricks":"Tips & Tricks","%Flatten Layers":"Flatten Layers","%Copy to Clipboard":"Copy to Clipboard","%Add Custom Swatch":"Add Custom Swatch","%Export Swatches":"Export Swatches","%Export Image Swatches":"Export Image Swatches","%Export Custom Swatches":"Export Custom Swatches","%Clear Custom Swatches":"Clear Custom Swatches",
|
|
"%Channels":"Channels","%Red":"Red","%Green":"Green","%Blue":"Blue","%Tools":"Tools","%Connect":"Connect","%Settings":"Settings","%Debug":"Debug","%Toggle Fullscreen":"Toggle Fullscreen","%Filters":"Filters","%Help":"Help","%About":"About","%Contents":"Contents","%Preset":"Preset","%Width":"Width","%here":"here","%bytes":"bytes","%Height":"Height","%Click":"Click","%Resolution":"Resolution","%Background":"Background","%pixels":"pixels","%inches":"inches","%pixels/inch":"pixels/inch","%Black":"Black",
|
|
"%White":"White","%Transparent":"Transparent","%select preset":"select preset","%Save Image":"Save Image","%Keep Ratio":"Keep Ratio","%SERVER":"SERVER","%APP":"APP","%x":"x","%y":"y","%UI":"UI","%Change Language":"Change Language","%button":"button","%destroyed":"destroyed","%button group":"button group","%dockbar":"dockbar","%propbar":"propbar","%layer":"layer","%menu.error.destroyfirst":"main menu cannot be destroyed","%menu":"menu","%contextmenu":"contextmenu","%Color Palette":"Color Palette",
|
|
"%panel":"panel","%installed":"installed","%uninstalled":"uninstalled","%PLUGIN":"PLUGIN","%Import":"Import","%Export":"Export","%enabled":"enabled","%disabled":"disabled","%initialized":"initialized","%destroyed":"destroyed","%main.psdimport.error":"could not read PSD file due to a parsing error.","%ERR":"ERR","%KERNEL":"KERNEL","%created":"created","%tab.toomany":"You cannot create any more tabs.","%tab":"tab","%tab.error.destroyfirst":"first tab cannot be destroyed","%toolbar":"toolbar","%Open the":"Open the",
|
|
"%window":"window","%plugin.notfound":"unable to find requested plugin","%Plugin":"Plugin","%installed successfully":"installed successfully","%uninstalled successfully":"uninstalled successfully","%server.dispatch":"dispatch","%server.receive":"receive","%app initialized in":"app initialized in","%ms":"ms","%tool destroyed":"tool destroyed","%layer.blendonelayer":"You need two layers to blend them together.","%tool":"tool","%ui.system.start":"subsystem initialized.","%refreshed":"refreshed","%preview cache created":"preview cache created",
|
|
"%could not load image":"could not load image","%thread spawned":"thread spawned","%id":"id","%type":"type","%Type":"Type","%thread":"thread","%failed at line":"failed at line","%in":"in","%with the message":"with the message","%thread terminated":"thread terminated","%success.preview.thread":"preview thread data processed successfully","%thread processed":"thread processed","%thread done":"thread done","%time":"time","%info.importurl":"Enter an image URL into the textinput below and after pressing <em>Import</em> it will be imported into your Picozu workspace.",
|
|
"%main.image.errorimport":"unable to import specified image","%main.file.errorimport":"unable to import specified file","%filters.hsl":"HSL","%Lightness":"Lightness","%filters.bc":"Brightness","%filters.curves":"Curves","%filters.exposure":"Exposure","%Normal":"Normal","%Gaussian":"Gaussian","%Strength":"Strength","%Stack":"Stack","%Box":"Box","%Horizontal Radius":"Horizontal Radius","%Vertical Radius":"Vertical Radius","%Quality":"Quality","%filters.sprotanopia":"Sim Protanopia","%filters.sdeuteranopia":"Sim Deuteranopia",
|
|
"%filters.stritanopia":"Sim Tritanopia","%filters.protanopia":"Protanopia","%filters.deuteranopia":"Deuteranopia","%Ambrozia":"Ambrozia","%filters.bump":"Bump","%Absynth":"Absynth","%Amsterdam":"Amsterdam","%Autumn":"Autumn","%Console":"Console","%Build":"Build","%Documentation":"Documentation","%Support":"Support","%Clear":"Clear","%Burlesque":"Burlesque","%California":"California","%Clara":"Clara","%Countryside":"Countryside","%Cross Process":"Cross Process","%Honey":"Honey","%Hollywood":"Hollywood",
|
|
"%Jolene":"Jolene","%Juliette":"Juliette","%Lemonville":"Lemonville","%Lilith":"Lilith","%Myrna":"Myrna","%Marilyn":"Marilyn","%Noir":"Noir","%Neon":"Neon","%Scorseze":"Scorseze","%Theda":"Theda","%Velviaesque":"Velviaesque","%main.done":"Done","%main.cancel":"Cancel","%main.close":"Close","%filters.tritanopia":"Tritanopia","%filters.desaturate":"Desaturate","%filters.desaverage":"Desaturate avg","%Sepia":"Sepia","%Colorlicious":"Colorlicious","%Colorize":"Colorize","%Snow Fuzz":"Snow Fuzz","%Thermal":"Thermal",
|
|
"%Luminance":"Luminance","%filters.cmatrix":"Color Matrix","%filters.ctransform":"Color Transform","%Red Multiplier":"Red Multiplier","%Green Multiplier":"Green Multiplier","%Blue Multiplier":"Blue Multiplier","%Alpha Multiplier":"Alpha Multiplier","%Red Offset":"Red Offset","%Green Offset":"Green Offset","%Blue Offset":"Blue Offset","%Alpha Offset":"Alpha Offset","%Tint":"Tint","%Halftone":"Halftone","%Radius":"Radius","%Duotone":"Duotone","%filters.creplace":"Color Replace","%Source color":"Source color",
|
|
"%New Color":"New Color","%filters.lut":"Apply Color LUT","%X-Ray":"X-Ray","%Effects":"Effects","%Sine":"Sine","%Amount":"Amount","%y Amount":"y Amount","%Grey Level":"Grey Level","%Edge Strength":"Edge Strength","%filters.laplace":"LaPlace Detection","%filters.enrich":"Enrich","%filters.prewitt":"Prewitt operator","%filters.sobel":"Sobel operator","%filters.scharr":"Scharr operator","%filters.convolve":"Convolve","%filters.hconvolve":"Horizontal Convolve","%filters.vconvolve":"Vertical Convolve",
|
|
"%Mask":"Mask","%Bloody":"Bloody","%Sunny":"Sunny","%Electric":"Electric","%Jungle":"Jungle","%Add noise":"Add noise","%Remove noise":"Remove noise","%CRT emulation":"CRT emulation","%Phosphor Bleed":"Phosphor Bleed","%Levels":"Levels","%Dither":"Dither","%Sensitivity":"Sensitivity","%Jitter":"Jitter","%NTSC emulate":"NTSC emulate","%HDTV emulate":"HDTV emulate","%Swirl":"Swirl","%Center X":"Center X","%Center Y":"Center Y","%Angle":"Angle","%Vignette":"Vignette","%Grit":"Grit","%Bilinear Resize":"Bilinear Resize",
|
|
"%Nearest-Neighbour Resize":"Nearest-Neighbour Resize","%Mosaic":"Mosaic","%Block Size":"Block Size","%Vibrance":"Vibrance","%Red Eye removal":"Red Eye removal","%HDR emulation":"HDR emulation","%Interpolate":"Interpolate","%Vivid":"Vivid","%Audrey":"Audrey","%Cartoon":"Cartoon","%Cartoon 2":"Cartoon 2","%Candy":"Candy","%Fresh":"Fresh","%Sky":"Sky","%Tangerine":"Tangerine","%Melt":"Melt","%Hazel":"Hazel","%Nostalgia":"Nostalgia","%Oil":"Oil","%Range":"Range","%Retro":"Retro","%Styles":"Styles","%Painting":"Painting",
|
|
"%The 60s":"The 60s","%Vintage":"Vintage","%Darken":"Darken","%Lighten":"Lighten","%Gamma":"Gamma","%Viewfinder":"Viewfinder","%Sharpen":"Sharpen","%Factor":"Factor","%Disco":"Disco","%Paper":"Paper","%Sunburst":"Sunburst","%Letter":"Letter","%Stone":"Stone","%Forest":"Forest","%Ice":"Ice","%Grunge":"Grunge","%Victorian":"Victorian","%Pink":"Pink","%Invert":"Invert","%Posterize":"Posterize","%Solarize":"Solarize","%Crayon":"Crayon","%Sketch":"Sketch","%Threshold":"Threshold","%Emboss":"Emboss","%Direction":"Direction",
|
|
"%topleft":"topleft","%top":"top","%topright":"topright","%right":"right","%bottomright":"bottomright","%bottom":"bottom","%bottomleft":"bottomleft","%filters.fedges":"Find Edges",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","%Border":"Border","%Visible":"Visible","%Hidden":"Hidden","%Blur":"Blur","%Color Deficiency":"Color Deficiency","%Distortion":"Distortion","%filters.edges":"Edge Detection","%Noise":"Noise","%Others":"Others","%Pixelate":"Pixelate","%Photography":"Photography",
|
|
"%Pop Art":"Pop Art","%Textures":"Textures","%Stylize":"Stylize","%untitled":"untitled","%blend.normal":"Normal","%blend.sourcein":"Source In","%blend.sourceover":"Source Over","%blend.destinationout":"Destination Out","%blend.dissolve":"Dissolve","%blend.average":"Average","%blend.darker":"Darker","%blend.darken":"Darken","%blend.multiply":"Multiply","%blend.colorburn":"Color Burn","%blend.colorburninverse":"Color Burn Inverse","%blend.softburn":"Soft Burn","%blend.linearburn":"Linear Burn","%blend.darkercolor":"Darker Color",
|
|
"%blend.lighter":"Lighter","%blend.lighten":"Lighten","%blend.screen":"Screen","%blend.colordodge":"Color Dodge","%blend.colordodgeinverse":"Color Dodge Inverse","%blend.softdodge":"Soft Dodge","%blend.lineardodge":"Linear Dodge","%blend.lightercolor":"Lighter Color","%blend.overlay":"Overlay","%blend.softlight":"Soft Light","%blend.fuzzylight":"Fuzzy Light","%blend.hardlight":"Hard Light","%blend.vividlight":"Vivid Light","%blend.linearlight":"Linear Light","%blend.pinlight":"Pin Light","%blend.hardmix":"Hard Mix",
|
|
"%blend.grainextract":"Grain Extract","%blend.grainmerge":"Grain Merge","%blend.difference":"Difference","%blend.exclusion":"Exclusion","%blend.negation":"Negation","%blend.invert":"Invert","%blend.hue":"Hue","%blend.saturation":"Saturation","%blend.color":"Color","%blend.luminosity":"Luminosity","%blend.red":"Red","%blend.green":"Green","%blend.blue":"Blue","%blend.tint":"Tint","%blend.reflect":"Reflect","%blend.glow":"Glow","%blend.heat":"Heat","%blend.freeze":"Freeze","%blend.additive":"Additive",
|
|
"%blend.subtractive":"Subtractive","%blend.subtract":"Subtract","%blend.stamp":"Stamp","%blend.interpolation":"Interpolation","%blend.divide":"Divide","%blend.xor":"XOR","%blend.and":"AND","%blend.or":"OR","%export.mergeicons":"Merge all icon sizes","%Icon Size":"Icon Size","%tips.export.mergeicons":"Merge 6 icons at the above sizes into the final icon.","%tips.export.iconsize":"The exported icon size (for favicons, use 16x16) Note: If the source image is not in square format, it will be cropped.",
|
|
"%export.png":"transparent PNG image (.png)","%export.jpg":"JPEG image (.jpg)","%export.tiff":"TIFF image (.tiff)","%export.ico":"ICON/FAVICON image (.ico)","%export.pdf":"PDF image (.pdf)","%export.bmp":"Bitmap image (.bmp)","%export.webp":"WEBP image (.webp)","%export.ps":"Adobe Postscript (.ps)","%export.gif":"GIF image (.gif)","%export.pzw":"Picozu workspace (.pzw)","%export.spritesheet":"PNG sprite + CSS stylesheet","%export.pzi":"Picozu image (.pzi)","%Solid Color":"Solid Color","%Pattern":"Pattern",
|
|
"%Polygon":"Polygon","%Star":"Star","%Gear":"Gear","%Burst":"Burst","%Upload":"Upload","%Upload image":"Upload image","%Frames":"Frames","%Image Info":"Image Info","%Film Strip":"Film Strip","%Advanced":"Advanced","%GPS":"GPS","%White balance":"White balance","%Manufacturer":"Manufacturer","%Model":"Model","%Sensor":"Sensor","%Software":"Software","%From user":"From user","%signout":"Sign Out","%signin":"Sign In","%signup":"Sign Up","%Keyword":"Keyword","%user name":"user name","%enter tag":"enter tag",
|
|
"%Tag":"Tag","%main.reload":"Reload","%Album":"Album","%Brushes":"Brushes","%Extra":"Extra","%Standard":"Standard","%Educational":"Educational","%main.switchworkspace":"Switch Workspace","%main.go_switchworkspace_0":"By going into the 'Minimal' workspace, the dockbar, properties bar and toolbar will be initially hidden, while the unnecessary addons will be uninstalled. Are you sure you want to do that?","%main.go_switchworkspace_1":"By going into the 'Standard' workspace, your workspace will be reset to the standard layout, without changing any of your already installed addons. Are you sure you want to do that?",
|
|
"%main.go_switchworkspace_2":"By going into the 'Educational' workspace, several addons that are marked as educational, will be installed. Are you sure you want to do that?","%main.go_switchworkspace_3":"By going into the 'Kids' workspace, several addons that are marked as kids, will be installed and the default theme will be set as 'Kids'. Are you sure you want to do that?","%main.notavail":'We apologize, but this feature is not available yet. Periodically check out the <a href="https://www.picozu.com" target="_blank">Picozu front page</a> for news.',
|
|
"%Font family":"Font family","%Left aligned":"Left aligned","%Center aligned":"Center aligned","%Right aligned":"Right aligned","%Font size":"Font size","%Bold":"Bold","%Italic":"Italic","%Underlined":"Underlined","%Border width size":"Border width size","%Shape opacity":"Shape opacity","%Layer blend mode":"Layer blend mode","%serializing data.":"serializing data.","%unserializing data.":"unserializing data.","%tip1":"Did you know you can import and edit Adobe Photoshop PSD files?","%tip2":"You might want to enhance this image by applying an Adobe Photoshop curve on it.",
|
|
"%tip3":"Did you know you can change the name of an image loaded in the editor by double clicking tab name?","%tip4":"Did you know you can press F11 key to enter fullscreen mode? Press it again to go back to standard mode.","%tip5":"If you want to browse through help contents press F1.","%tip6":"Did you know that regardless of the tool currently selected, you can press the arrow keys to move your layer?","%tip7":"Did you know that you can import photos from your Facebook page and export them back after editing?",
|
|
"%tip8":"Did you know you can reorder layers by dragging and dropping them in the layers' panel?","%tip9":"Did you know that you can drag and drop any type of files supported by Picozu (including Adobe Swatch exchange (ase) and Adobe curves (acv) right in the workspace?","%tip10":"You can enable autosaving of your workspace from settings.","%tip11":"You can disable these tips from settings.","%tip12":"Did you know you can import and edit images from your camera/webcam?","%tip13":"Did you know Picozu can generate fractals?",
|
|
"%tip14":"You can import images from Google Drive and export them back after editing.","%tip15":"Did you know you can integrate various types of charts into your workspace?","%tip16":"You can duplicate the currently selected layer by pressing the Insert key.","%tip17":"Did you know you can create (de)motivational posters in just a few easy steps?","%tip18":"Did you know Alt + Ctrl + C allows you to resize your image canvas?","%tip19":"Use Ctrl + F to flatten the layers of your currently opened image.",
|
|
"%tip20":"Organize color swatches by adding the ones you like to the custom swatches tab.","%main.switchlocale":"Change Language","%vis.public":"Public","%vis.registered":"Registered users only","%vis.friends":"Only your friends","%vis.private":"Only you","%visibility":"Visibility","%main.switchlocaletext":"Are you sure you want to change the application language? This will force an application reload and you will lose any unsaved changes, so make sure you saved your workspace first. Do you want to continue?",
|
|
"%Golden":"Golden","%Bronze":"Bronze","%Glossy":"Glossy","%Fuzzy":"Fuzzy","%Fuzzy Colors":"Fuzzy Colors","%Gold Leaves":"Gold Leaves","%Christmas":"Christmas","%Polaroid":"Polaroid","%Chic":"Chic","%Photo":"Photo","%Business Card":"Business Card","%Apple iPhone":"Apple iPhone","%Apple iPad":"Apple iPad","%Samsung Galaxy S4":"Samsung Galaxy S4","%Facebook Cover":"Facebook Cover","%Facebook Profile":"Facebook Profile","%Google Plus Cover":"Google Plus Cover","%Google Plus Profile":"Google Plus Profile",
|
|
"%Instagram Cover":"Instagram Cover","%Instagram Profile":"Instagram Profile","%Linkedin Cover":"Linkedin Cover","%Pinterest Profile":"Pinterest Profile","%Twitter Cover":"Twitter Cover","%Twitter Profile":"Twitter Profile","%Youtube Cover":"Youtube Cover"}});function l(a){return a.toLocale()}function getInstance(){return _picozu}var picozu=function(a){this.workspace=null;this.__constructor=function(a){return this.workspace=new picozu.objects.workspace(a)};return this.__constructor(a)};
|
|
"undefined"===typeof picozu.objects&&(picozu.objects={});"undefined"===typeof picozu.events&&(picozu.events={});"undefined"===typeof picozu.tools&&(picozu.tools={});"undefined"===typeof picozu.shapes&&(picozu.shapes={});"undefined"===typeof picozu.extensions&&(picozu.extensions={});"undefined"===typeof picozu.extensions.plugins&&(picozu.extensions.plugins={});picozu.MAIN_DOCKBAR_PANELS=[];picozu.DEBUGGER_PROPBAR=[];picozu.MAIN_PROPBAR_PANELS=[];picozu.WINDOWS=[];picozu.TOOLS=[];picozu.FILTERS=[];
|
|
String.locale=localStorage.getItem("locale")?localStorage.getItem("locale"):"en-US";picozu.DEBUG=!0;picozu.MAJOR_VERSION="1";picozu.MINOR_VERSION="4";picozu.BUILD_VERSION="112218";picozu.VERSION=picozu.MAJOR_VERSION+"."+picozu.MINOR_VERSION+"."+picozu.BUILD_VERSION;picozu.START_WITH_SAMPLE_IMAGE=!1;picozu.API_KEY="LfJnkEVlhlBOmdar";picozu.WARN_IMAGE_DIMENSION=1600;picozu.DEFAULT_WIDTH=800;picozu.DEFAULT_HEIGHT=600;picozu.MAX_TABS=10;picozu.MAX_CHARS_LAYER_NAME=20;picozu.OVERLAY_COLOR_CROP="rgba(224, 91, 213, 0.3)";
|
|
picozu.OVERLAY_COLOR_SELECT="rgba(50, 98, 220, 0.3)";picozu.FLIP_HORIZONTAL=1;picozu.FLIP_VERTICAL=2;picozu.FONT_CASE_NORMAL=0;picozu.FONT_CASE_LOWERCASE=1;picozu.FONT_CASE_UPPERCASE=2;picozu.DRAW_MODE_STROKE=0;picozu.DRAW_MODE_FILL=1;picozu.DRAW_MODE_BOTH=2;picozu.DRAW_MODE_GRADIENT=3;picozu.LAYER_BG_TRANSPARENT=0;picozu.LAYER_BG_SOLID=1;picozu.LAYER_BG_GRADIENT=2;picozu.LAYER_BG_PATTERN=3;picozu.SAMPLE_IMAGES=75;
|
|
picozu.DEFAULT_FILL_MODES=[{name:l("%Transparent"),handle:"transparent"},{name:l("%Solid Color"),handle:"solid color"},{name:l("%Gradient"),handle:"gradient"},{name:l("%Pattern"),handle:"pattern"}];picozu.LAYER_TYPE_BACKGROUND=0;picozu.LAYER_TYPE_NORMAL=1;picozu.LAYER_TYPE_TEXT=2;picozu.LAYER_TYPE_SHAPE=3;picozu.LAYER_TYPE_TEXTSHAPE=4;picozu.LAYER_TYPE_PREVIEW=99;picozu.WORKER_TYPE_FILTER=0;picozu.WORKER_TYPE_FRACTAL=1;picozu.WORKER_TYPE_BLENDMODE=3;picozu.WORKER_TYPE_TEXTURE=4;
|
|
picozu.WORKER_TYPE_OTHER=2;picozu.WORKER_TYPE_PROCESS=5;picozu.ACTION_CHANGE=0;picozu.ACTION_OPEN_YOUTUBE_PLAYER=1;picozu.SWATCH_CHANGE=1;picozu.UNIT_PIXEL=0;picozu.UNIT_INCH=1;
|
|
picozu.NEW_IMAGE_PRESETS={Standard:[{name:l("%Web"),width:640,height:480,unit:picozu.UNIT_PIXEL},{name:l("%Paper"),width:2480,height:3508,unit:picozu.UNIT_PIXEL},{name:l("%Photo"),width:800,height:600,unit:picozu.UNIT_PIXEL}],Devices:[{name:l("%Apple iPhone"),width:640,height:1136,unit:picozu.UNIT_PIXEL},{name:l("%Apple iPad"),width:1536,height:2048,unit:picozu.UNIT_PIXEL},{name:l("%Samsung Galaxy S4"),width:1080,height:1920,unit:picozu.UNIT_PIXEL}],Stationary:[{name:l("%Business Card"),width:1125,
|
|
height:675,unit:picozu.UNIT_PIXEL}],"Social Media":[{name:l("%Facebook Cover"),width:851,height:315,unit:picozu.UNIT_PIXEL},{name:l("%Facebook Profile"),width:180,height:180,unit:picozu.UNIT_PIXEL},{name:l("%Google Plus Cover"),width:2120,height:1192,unit:picozu.UNIT_PIXEL},{name:l("%Google Plus Profile"),width:270,height:270,unit:picozu.UNIT_PIXEL},{name:l("%Instagram Cover"),width:1024,height:410,unit:picozu.UNIT_PIXEL},{name:l("%Instagram Profile"),width:110,height:110,unit:picozu.UNIT_PIXEL},
|
|
{name:l("%Linkedin Cover"),width:646,height:220,unit:picozu.UNIT_PIXEL},{name:l("%Pinterest Profile"),width:160,height:165,unit:picozu.UNIT_PIXEL},{name:l("%Twitter Cover"),width:520,height:260,unit:picozu.UNIT_PIXEL},{name:l("%Twitter Profile"),width:81,height:81,unit:picozu.UNIT_PIXEL},{name:l("%Youtube Cover"),width:2560,height:1440,unit:picozu.UNIT_PIXEL}]};picozu.ENCRYPT_KEY="00216A42E2531FAD913785713F51DAB44F143272-94E5A9C5967A807268BDDF7FAEA0EF9669D1E9BD";
|
|
picozu.AUTOSAVE_INTERVALS=[{name:l("%disabled"),handle:!1},{name:l("%3 mins"),handle:18E4},{name:l("%5 mins"),handle:3E5},{name:l("%10 mins"),handle:6E5}];picozu.SHAPE_CIRCLE=0;picozu.SHAPE_RECTANGLE=1;picozu.SHAPE_LINE=2;picozu.SHAPE_ARROW=3;picozu.SHAPE_ROUNDED_RECTANGLE=4;picozu.SHAPE_ELLIPSE=5;picozu.DEFAULT_VISIBILITY=[{name:l("%vis.public"),handle:0},{name:l("%vis.registered"),handle:2},{name:l("%vis.friends"),handle:4},{name:l("%vis.private"),handle:6}];picozu.WORKSPACE_DEFAULT=1;
|
|
picozu.WORKSPACE_MINIMAL=0;picozu.WORKSPACE_EDUCATION=2;picozu.WORKSPACE_KIDS=3;picozu.SCOPE_APP=1;picozu.SCOPE_BROWSER=2;picozu.WORKSPACES=[{handle:"minimal",name:l("%Minimal")},{handle:"standard",name:l("%Standard")},{handle:"educational",name:l("%Educational")},{handle:"minimal",name:l("%Kids")}];picozu.PLATFORM_GENERIC_DESKTOP=0;picozu.PLATFORM_GENERIC_MOBILE=1;picozu.PLATFORM_ANDROID=2;picozu.PLATFORM_ANDROID_CHROME=3;picozu.PLATFORM_TIZEN=4;picozu.PLATFORM_FIREFOX_OS=5;
|
|
picozu.PLATFORM_FIREFOX=6;picozu.PLATFORM_BLACKBERRY=7;picozu.PLATFORM_IOS=8;picozu.PLATFORM_WINDOWS_PHONE=9;picozu.PLATFORM_CHROME=10;picozu.PLATFORM_SAFARI=11;picozu.PLATFORM_IE_OLD=12;picozu.PLATFORM_IE=13;
|
|
picozu.PLATFORMS=[{name:"Android Chrome",id:picozu.PLATFORM_ANDROID_CHROME,mobile:!0,regex:/Android .* Chrome\/(\d+)[.\d]+/},{name:"Android",id:picozu.PLATFORM_ANDROID,mobile:!0,regex:/Android (\d+)/},{name:"Tizen",id:picozu.PLATFORM_TIZEN,mobile:!0,regex:/Tizen (\d+)/},{name:"Mozilla Firefox OS",id:picozu.PLATFORM_FIREFOX_OS,mobile:!0,regex:/Mobile;.*Firefox\/(\d+)/},{name:"Mozilla Firefox Desktop",id:picozu.PLATFORM_FIREFOX,mobile:!1,regex:/Firefox\/(\d+)/},{name:"Blackberry",id:picozu.PLATFORM_BLACKBERRY,
|
|
mobile:!0,regex:/BB1\d;.*Version\/(\d+\.\d+)/},{name:"Apple iOS",id:picozu.PLATFORM_IOS,mobile:!0,regex:/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/},{name:"Windows Phone",id:picozu.PLATFORM_WINDOWS_PHONE,mobile:!0,regex:/Windows Phone (?:OS )?(\d+)[.\d]+/},{name:"Google Chrome",id:picozu.PLATFORM_CHROME,mobile:!1,regex:/Chrome\/(\d+)[.\d]+/},{name:"Apple Safari",id:picozu.PLATFORM_SAFARI,mobile:!1,regex:/Version\/(\d+)[.\d]+\s+Safari/},{name:"Microsoft Internet Explorer old",id:picozu.PLATFORM_IE_OLD,mobile:!1,
|
|
regex:/MSIE (\d+)/},{name:"Microsoft Internet Explorer",id:picozu.PLATFORM_IE,mobile:!1,regex:/Trident\/.*; rv:(\d+)/}];picozu.BUTTON_YES=1;picozu.BUTTON_NO=0;picozu.CONTROL_SLIDER=0;picozu.CONTROL_SELECT=1;picozu.CONTROL_CHECKBOX=2;picozu.CONTROL_OPTIONBOX=3;picozu.CONTROL_BUTTONGRID=4;picozu.CONTROL_BUTTON=5;picozu.CONTROL_TEXTINPUT=6;picozu.CONTROL_TEXTAREA=7;picozu.CONTROL_COLORSELECT=8;picozu.CONTROL_LEFTRIGHT=9;picozu.CONTROL_HTML=10;picozu.CONTROL_SEPARATOR=11;
|
|
picozu.CONTROL_LEFTRIGHTCOLOR=12;picozu.CONTROL_SLIDER_COMBO=13;picozu.CONTROL_FILE_UPLOAD=14;picozu.CONTROL_BUTTONGRID_TOGGLE=15;picozu.CONTROL_IMAGE=16;picozu.CONTROL_TEXTINPUT_FILE=17;
|
|
picozu.CONTROL_COLORSELECT_HTML='<div class="pico-control-applyval"><div class="color tips" title="'+l("%preview.color")+'" style="background-color: {rgbColor}"></div><input type="text" title="'+l("%preview.colorhex")+'" class="tips pico-textfield" value="{hexColor}" /><input type="button" class="pico-button ok-btn accept-button" value="'+l("%main.apply")+'" /></div><input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.cancel")+'" />';
|
|
picozu.DEFAULT_WINDOW_FOOTER='<input type="button" class="pico-button ok-btn accept-button" value="'+l("%main.ok")+'" /> <input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.cancel")+'" />';picozu.BROWSER_WINDOW_FOOTER='<input type="button" class="pico-button ok-btn reload" value="'+l("%main.reload")+'" /> <input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.close")+'" />';
|
|
picozu.CONNECTOR_OPEN_WINDOW_FOOTER='<input type="button" class="pico-button ok-btn reload" value="'+l("%main.reload")+'" /> <input type="button" class="pico-button ok-btn logout" value="'+l("%signout")+'" /> <input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.close")+'" />';
|
|
picozu.CONNECTOR_SAVE_WINDOW_FOOTER='<input type="button" class="pico-button ok-btn save" value="'+l("%main.save")+'" /> <input type="button" class="pico-button ok-btn logout" value="'+l("%signout")+'" /> <input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.close")+'" />';picozu.DEFAULT_LOCALES=[{locale:"en-US",handle:"gb",name:"English"}];
|
|
picozu.DEFAULT_PLUGINS=[{name:"Swatches",handle:"swatches",enabled:!0},{name:"Histograms",handle:"histograms",enabled:!0},{name:"Demotivator",handle:"demotivator",enabled:!0},{name:"Palett-o-Matic",handle:"palettomatic",enabled:!0},{name:"Collage",handle:"collage",enabled:!0},{name:"Meme Generator",handle:"memes",
|
|
enabled:!0},{name:"Youtube",handle:"youtube",enabled:!0}];picozu.DEFAULT_KIDS_PLUGINS=[{name:"Swatches",handle:"swatches",enabled:!0},{name:"Fractals",handle:"fractals",enabled:!0},{name:"Histograms",handle:"histograms",enabled:!0},{name:"Charts",handle:"charts",enabled:!0},{name:"Collage",handle:"collage",enabled:!0}];
|
|
picozu.DEFAULT_EDUCATIONAL_PLUGINS=[{name:"Swatches",handle:"swatches",enabled:!0},{name:"Fractals",handle:"fractals",enabled:!0},{name:"Histograms",handle:"histograms",enabled:!0},{name:"Charts",handle:"charts",enabled:!0},{name:"Collage",handle:"collage",enabled:!0},{name:"Tag Cloud",handle:"tagcloud",enabled:!0}];
|
|
picozu.AVAILABLE_PLUGINS="camera charts cliparts collage collab demotivator fractals histograms memes notes palettomatic support swatches tagcloud youtube".split(" ");picozu.THEME_DEFAULT="default";picozu.THEME_GALAXY="galaxy";picozu.THEME_KIDS="kids";
|
|
picozu.AVAILABLE_THEMES=[{name:l("%Default"),handle:picozu.THEME_DEFAULT,author:l("%Picozu Team"),version:"1.2",description:l("%theme.1.desc"),url:"www.picozu.com",email:"office@picozu.com"},{name:l("%Galaxy"),handle:picozu.THEME_GALAXY,author:l("%Picozu Team"),version:"1.1",description:l("%theme.2.desc"),url:"www.picozu.com",email:"office@picozu.com"},{name:l("%Kids"),handle:picozu.THEME_KIDS,author:l("%Picozu Team"),version:"1.0",description:l("%theme.3.desc"),url:"www.picozu.com",email:"office@picozu.com"}];
|
|
picozu.AVAILABLE_FILTER_PACKS=[{name:"Basic",handle:"basic",author:l("%Picozu Team"),version:"1.0",description:l("%filters.1.desc"),url:"www.picozu.com",email:"office@picozu.com",filters:[{name:l("%Adjustments"),filters:[{name:l("%filters.bc"),filter:"adjust_bc",settings:[{name:l("%Brightness"),type:picozu.CONTROL_SLIDER,property:"brightness"},{name:l("%Contrast"),type:picozu.CONTROL_SLIDER,property:"contrast"}]},{name:l("%filters.hsl"),filter:"adjust_hsl",settings:[{name:l("%Hue"),type:picozu.CONTROL_SLIDER,
|
|
property:"hue",min:-180,max:180},{name:l("%Saturation"),type:picozu.CONTROL_SLIDER,property:"saturation"},{name:l("%Lightness"),type:picozu.CONTROL_SLIDER,property:"lightness"}]},{name:l("%Darken"),filter:"darken",settings:[{name:l("%Amount"),type:picozu.CONTROL_SLIDER,property:"amount",value:-40,step:10}]},{name:l("%Lighten"),filter:"lighten",settings:[{name:l("%Amount"),type:picozu.CONTROL_SLIDER,property:"amount",value:40,step:10}]},{name:l("%Sharpen"),filter:"sharpen",settings:[{name:l("%Factor"),
|
|
type:picozu.CONTROL_SLIDER,property:"factor",value:3,min:1,max:10,step:0.1}]},{name:l("%filters.curves"),filter:"curves",settings:[{name:l("%File"),type:picozu.CONTROL_FILE_UPLOAD,title:l("%Upload .acv file"),property:"curves"}]}]},{name:l("%Arabesque"),filters:[{name:l("%Christmas Lights"),filter:"christmaslights",queue:[{action:"renderImage",params:{renderImage:"images/frames/christmaslights.jpg"}}]},{name:l("%Disco"),filter:"disco",queue:[{action:"renderImage",params:{renderImage:"images/frames/disco.jpg"}}]},
|
|
{name:l("%Film Strip"),filter:"filmstrip",queue:[{action:"renderImage",params:{renderImage:"images/frames/filmstrip.png"}}]},{name:l("%Forest"),filter:"forest",queue:[{action:"renderImage",params:{renderImage:"images/frames/forest.jpg"}}]},{name:l("%Girly Flowers"),filter:"girlyflowers",queue:[{action:"renderImage",params:{renderImage:"images/frames/girlyflowers.jpg"}}]},{name:l("%Green Strokes"),filter:"greenstrokes",queue:[{action:"renderImage",params:{renderImage:"images/frames/greenstrokes.jpg"}}]},
|
|
{name:l("%Grunge"),filter:"grunge",queue:[{action:"renderImage",params:{renderImage:"images/frames/grunge.jpg"}}]},{name:l("%Heart 2 Heart"),filter:"heart2heart",queue:[{action:"renderImage",params:{renderImage:"images/frames/heart2heart.jpg"}}]},{name:l("%Ice"),filter:"ice",queue:[{action:"renderImage",params:{renderImage:"images/frames/ice.jpg"}}]},{name:l("%Letter"),filter:"letter",queue:[{action:"renderImage",params:{renderImage:"images/frames/letter.jpg"}}]},{name:l("%Paint Smudge"),filter:"paintsmudge",
|
|
queue:[{action:"renderImage",params:{renderImage:"images/frames/paintsmudge.jpg"}}]},{name:l("%Thatched Paper"),filter:"thatchedpaper",queue:[{action:"renderImage",params:{renderImage:"images/frames/paper3.jpg"}}]},{name:l("%Paper"),filter:"paper",queue:[{action:"renderImage",params:{renderImage:"images/frames/paper2.jpg"}},{filter:"sepia"}]},{name:l("%Pink"),filter:"pink",queue:[{action:"renderImage",params:{renderImage:"images/frames/pink.jpg"}}]},{name:l("%Shadow Cracks"),filter:"shadowcracks",
|
|
queue:[{action:"renderImage",params:{renderImage:"images/frames/shadowcracks.jpg"}}]},{name:l("%Stone"),filter:"stone",queue:[{action:"renderImage",params:{renderImage:"images/frames/stone.jpg"}}]},{name:l("%Sunburst"),filter:"sunburst",queue:[{action:"renderImage",params:{renderImage:"images/frames/sunburst.jpg"}}]},{name:l("%Victorian"),filter:"victorian",queue:[{action:"renderImage",params:{renderImage:"images/frames/victorian.jpg"}}]},{name:l("%Viewfinder"),filter:"viewfinder",queue:[{action:"renderImage",
|
|
params:{renderImage:"images/frames/viewfinder.jpg"}}]}]},{name:l("%Blur"),filters:[{name:l("%Box"),filter:"boxblur",settings:[{name:l("%Horizontal Radius"),type:picozu.CONTROL_SLIDER,property:"hRadius",value:3,min:1,max:20},{name:l("%Vertical Radius"),type:picozu.CONTROL_SLIDER,property:"vRadius",value:3,min:1,max:20},{name:l("%Quality"),type:picozu.CONTROL_SLIDER,property:"quality",value:2,min:1,max:10}]},{name:l("%Gaussian"),filter:"gaussian_blur",settings:[{name:l("%Strength"),type:picozu.CONTROL_SLIDER,
|
|
property:"strength",value:2,min:1,max:4}]},{name:l("%Normal"),filter:"blur"},{name:l("%Stack"),filter:"stackblur"}]},{name:l("%Color Deficiency"),filters:[{name:l("%filters.deuteranopia"),filter:"deuteranopia"},{name:l("%filters.protanopia"),filter:"protanopia"},{name:l("%filters.tritanopia"),filter:"tritanopia"},{name:l("%filters.sdeuteranopia"),filter:"deuteranopia_simulate"},{name:l("%filters.sprotanopia"),filter:"protanopia_simulate"},{name:l("%filters.stritanopia"),filter:"tritanopia_simulate"}]},
|
|
{name:l("%Colorlicious"),filters:[{name:l("%filters.lut"),filter:"applylut"},{name:l("%Colorize"),filter:"colorize"},{name:l("%filters.creplace"),filter:"color_replace",settings:[{name:l("%Source color"),type:picozu.CONTROL_COLORSELECT,property:"sColor",value:[0,0,0]},{name:l("%New Color"),type:picozu.CONTROL_COLORSELECT,property:"dColor",value:[219,2,104]}]},{name:l("%filters.ctransform"),filter:"colortransform",settings:[{type:picozu.CONTROL_SLIDER_COMBO,name1:l("%Red Multiplier"),property1:"redMultiplier",
|
|
value1:1,min1:0,max1:5,step1:0.1,property2:"redOffset",min2:-255,max2:255},{name1:l("%Green Multiplier"),type:picozu.CONTROL_SLIDER_COMBO,property1:"greenMultiplier",value1:1,min1:0,max1:5,step1:0.1,property2:"greenOffset",min2:-255,max2:255},{name1:l("%Blue Multiplier"),type:picozu.CONTROL_SLIDER_COMBO,property1:"blueMultiplier",value1:1,min1:0,max1:5,step1:0.1,property2:"blueOffset",min2:-255,max2:255},{name1:l("%Alpha Multiplier"),type:picozu.CONTROL_SLIDER_COMBO,property1:"alphaMultiplier",value1:1,
|
|
min1:0,max1:5,step1:0.1,property2:"alphaOffset",min2:-255,max2:255}]},{name:l("%filters.desaturate"),filter:"desaturate"},{name:l("%filters.desaverage"),filter:"desaturate_average"},{name:l("%Duotone"),filter:"duotone"},{name:l("%Halftone"),filter:"halftone",settings:[{name:l("%Radius"),type:picozu.CONTROL_SLIDER,property:"radius",value:1,min:1,max:5}]},{name:l("%Luminance"),filter:"luminance"},{name:l("%Sepia"),filter:"sepia"},{name:l("%Snow Fuzz"),filter:"snowfuzz"},{name:l("%Thermal"),filter:"thermal"},
|
|
{name:l("%Tint"),filter:"tint",queue:[{filter:"colorize",params:{foregroundColor:[25,65,194]}},{filter:"desaturate"}]},{name:l("%Vivid"),filter:"vivid",queue:[{filter:"adjust_bc",params:{brightness:0,contrast:0}},{filter:"adjust_hsl",params:{hue:180,saturation:0,luminosity:0}}]}]},{name:l("%Distortion"),filters:[{name:l("%Mosaic"),filter:"mosaic",settings:[{name:l("%Block Size"),type:picozu.CONTROL_SLIDER,property:"blockSize",value:8,min:1,max:10}]},{name:l("%Sine"),filter:"distort_sine",settings:[{name:l("%Amount"),
|
|
type:picozu.CONTROL_SLIDER,property:"amount",value:0.5,min:0,max:5,step:0.1},{name:l("%y Amount"),type:picozu.CONTROL_SLIDER,property:"yamount",value:0.5,min:0,max:5,step:0.1}]},{name:l("%Swirl"),filter:"swirl",settings:[{name:l("%Center X"),type:picozu.CONTROL_SLIDER,property:"centerX",value:0.5,min:0,max:1,step:0.1},{name:l("%Center Y"),type:picozu.CONTROL_SLIDER,property:"centerY",value:0.5,min:0,max:1,step:0.1},{name:l("%Radius"),type:picozu.CONTROL_SLIDER,property:"radius",value:100,min:10,max:200},
|
|
{name:l("%Angle"),type:picozu.CONTROL_SLIDER,property:"Angle",value:360,min:-720,max:720}]},{name:l("%Line Smear"),filter:"linesmear",settings:[{name:l("%Distance"),type:picozu.CONTROL_SLIDER,property:"distance",value:8,min:1,max:30,step:0.1},{name:l("%Density"),type:picozu.CONTROL_SLIDER,property:"density",value:0.5,min:0,max:1,step:0.01},{name:l("%Angle"),type:picozu.CONTROL_SLIDER,property:"angle",min:0,max:360},{name:l("%Mix"),type:picozu.CONTROL_SLIDER,property:"mix",value:0.5,min:0,max:1,step:0.01}]},
|
|
{name:l("%Circle Smear"),filter:"circlesmear",settings:[{name:l("%Size"),type:picozu.CONTROL_SLIDER,property:"size",value:4,min:1,max:10,step:0.1},{name:l("%Density"),type:picozu.CONTROL_SLIDER,property:"density",value:0.5,min:0,max:1,step:0.01},{name:l("%Mix"),type:picozu.CONTROL_SLIDER,property:"mix",value:0.5,min:0,max:1,step:0.01}]},{name:l("%Square Smear"),filter:"squaresmear",settings:[{name:l("%Size"),type:picozu.CONTROL_SLIDER,property:"size",value:4,min:1,max:10,step:0.1},{name:l("%Density"),
|
|
type:picozu.CONTROL_SLIDER,property:"density",value:0.5,min:0,max:1,step:0.01},{name:l("%Mix"),type:picozu.CONTROL_SLIDER,property:"mix",value:0.5,min:0,max:1,step:0.01}]},{name:l("%Triangle Ripples"),filter:"triangleripples",settings:[{name:l("%xAmplitude"),type:picozu.CONTROL_SLIDER,property:"xamplitude",value:5,min:0,max:30},{name:l("%yAmplitude"),type:picozu.CONTROL_SLIDER,property:"yamplitude",value:5,min:0,max:30},{name:l("%xWavelength"),type:picozu.CONTROL_SLIDER,property:"xwavelength",value:16,
|
|
min:1,max:50},{name:l("%yWavelength"),type:picozu.CONTROL_SLIDER,property:"ywavelength",value:16,min:1,max:50}]},{name:l("%Sine Ripples"),filter:"sineripples",settings:[{name:l("%xAmplitude"),type:picozu.CONTROL_SLIDER,property:"xamplitude",value:5,min:0,max:30},{name:l("%yAmplitude"),type:picozu.CONTROL_SLIDER,property:"yamplitude",value:5,min:0,max:30},{name:l("%xWavelength"),type:picozu.CONTROL_SLIDER,property:"xwavelength",value:16,min:1,max:50},{name:l("%yWavelength"),type:picozu.CONTROL_SLIDER,
|
|
property:"ywavelength",value:16,min:1,max:50}]},{name:l("%Sawtooth Ripples"),filter:"sawtoothripples",settings:[{name:l("%xAmplitude"),type:picozu.CONTROL_SLIDER,property:"xamplitude",value:5,min:0,max:30},{name:l("%yAmplitude"),type:picozu.CONTROL_SLIDER,property:"yamplitude",value:5,min:0,max:30},{name:l("%xWavelength"),type:picozu.CONTROL_SLIDER,property:"xwavelength",value:16,min:1,max:50},{name:l("%yWavelength"),type:picozu.CONTROL_SLIDER,property:"ywavelength",value:16,min:1,max:50}]},{name:l("%Kaleidoscope"),
|
|
filter:"kaleidoscope",settings:[{name:l("%Angle"),type:picozu.CONTROL_SLIDER,property:"angle",min:0,max:360},{name:l("%Sides"),type:picozu.CONTROL_SLIDER,property:"sides",value:3,min:1,max:30},{name:l("%xCenter"),type:picozu.CONTROL_SLIDER,property:"xcenter",value:0.5,min:0,max:1,step:0.01},{name:l("%yCenter"),type:picozu.CONTROL_SLIDER,property:"ycenter",value:0.5,min:0,max:1,step:0.01}]},{name:l("%Lens Distortion"),filter:"lensdistort",settings:[{name:l("%Refraction"),type:picozu.CONTROL_SLIDER,
|
|
property:"refraction",value:1.5,min:1,max:10,step:0.1},{name:l("%Radius"),type:picozu.CONTROL_SLIDER,property:"radius",value:50,min:1,max:200},{name:l("%xCenter"),type:picozu.CONTROL_SLIDER,property:"xcenter",value:0.5,min:0,max:1,step:0.01},{name:l("%yCenter"),type:picozu.CONTROL_SLIDER,property:"ycenter",value:0.5,min:0,max:1,step:0.01}]}]},{name:l("%filters.edges"),filters:[{name:l("%filters.enrich"),filter:"enrich"},{name:l("%filters.bump"),filter:"bump"},{name:l("%filters.fedges"),filter:"edges",
|
|
params:{opaque:!0}},{name:l("%filters.hconvolve"),filter:"horizontal_convolve"},{name:l("%filters.laplace"),filter:"laplace",params:{invert:!1},settings:[{name:l("%Edge Strength"),type:picozu.CONTROL_SLIDER,property:"edgeStrength",value:0,min:0,max:5,step:0.1},{name:l("%Grey Level"),type:picozu.CONTROL_SLIDER,property:"greyLevel",min:0,max:255}]},{name:l("%filters.prewitt"),filter:"prewitt"},{name:l("%filters.scharr"),filter:"scharr"},{name:l("%filters.sobel"),filter:"sobel"},{name:l("%filters.vconvolve"),
|
|
filter:"vertical_convolve"}]},{name:l("%Effects"),filters:[{name:l("%Bloody"),filter:"bloody",queue:[{filter:"mask_rgb",params:{maskRGB:[250,10,10]}}]},{name:l("%Gamma"),filter:"gamma",settings:[{name:l("%Gamma"),type:picozu.CONTROL_SLIDER,property:"gamma",value:1,min:0,max:3,step:0.1}]},{name:l("%Interpolate"),filter:"interpolate"},{name:l("%Jungle"),filter:"jungle",queue:[{filter:"mask_rgb",params:{maskRGB:[36,135,23]}}]},{name:l("%Electric"),filter:"electric",queue:[{filter:"mask_rgb",params:{maskRGB:[10,
|
|
10,250]}}]},{name:l("%Picozu"),filter:"picozu",queue:[{filter:"duotone",params:{foregroundColor:[219,2,104]}}]},{name:l("%RGB Shift"),filter:"rgbshift"},{name:l("%Sunny"),filter:"sunny",queue:[{filter:"mask_rgb",params:{maskRGB:[255,236,72]}}]},{name:l("%Vibrance"),filter:"vibrance",settings:[{name:l("%Adjust"),type:picozu.CONTROL_SLIDER,property:"adjust",step:0.1}]},{name:l("%HDR emulation"),filter:"hdr",queue:[{filter:"blend",params:{blendMode:"overlay"}},{filter:"interpolate"}]},{name:l("%HDTV emulate"),
|
|
filter:"hdtv"},{name:l("%NTSC emulate"),filter:"ntsc"}]},{name:l("%Frames"),filters:[{name:l("%Bronze"),filter:"bronze",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/old2.png"}}]},{name:l("%Chic"),filter:"chic",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/chic.png"}}]},{name:l("%Christmas"),filter:"christmas",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/christmas.png"}}]},{name:l("%Cobalt"),filter:"cobalt",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/frame2.png"}}]},
|
|
{name:l("%Fuzzy"),filter:"fuzzy",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/fuzzy2.png"}}]},{name:l("%Fuzzy Colors"),filter:"fuzzycolors",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/fuzzy1.png"}}]},{name:l("%Gold Leaves"),filter:"goldleaves",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/gold-leaves.png"}}]},{name:l("%Glossy"),filter:"glossy",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/old3.png"}}]},{name:l("%Gold Rush"),
|
|
filter:"goldrush",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/frame1.png"}}]},{name:l("%Golden"),filter:"golden",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/old.png"}}]},{name:l("%Lace"),filter:"lace",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/frame4.png"}}]},{name:l("%Polaroid"),filter:"polaroid",queue:[{action:"renderFrame",params:{renderFrame:"images/frames/polaroid.png"}}]},{name:l("%Tangled"),filter:"tangled",queue:[{action:"renderFrame",
|
|
params:{renderFrame:"images/frames/frame3.png"}}]}]},{name:l("%Noise"),filters:[{name:l("%Add noise"),filter:"noise",settings:[{name:l("%Amount"),type:picozu.CONTROL_SLIDER,property:"amount",value:0.5,min:0,max:1,step:0.01},{name:l("%Strength"),type:picozu.CONTROL_SLIDER,property:"strength",value:0.5,min:0,max:1,step:0.01}]},{name:l("%CRT emulation"),filter:"crt",settings:[{name:l("%Phosphor Bleed"),type:picozu.CONTROL_SLIDER,property:"phosphorBleed",value:7.8,min:0,max:10,step:0.1}]},{name:l("%Dither"),
|
|
filter:"dither",settings:[{name:l("%Levels"),type:picozu.CONTROL_SLIDER,property:"levels",value:8,min:2,max:20}]},{name:l("%Jitter"),filter:"jitter",settings:[{name:l("%Amount"),type:picozu.CONTROL_SLIDER,property:"amount",value:5,min:1,max:10}]},{name:l("%Remove noise"),filter:"removenoise"}]},{name:l("%Pop Art"),filters:[{name:l("%Audrey"),filter:"audrey",queue:[{filter:"interpolate"},{filter:"adjust_bc",params:{brightness:0,contrast:0.7}},{filter:"adjust_hsl",params:{hue:23,saturation:-50,luminosity:-4}},
|
|
{filter:"posterize",params:{levels:3}}]},{name:l("%Candy"),filter:"candy",queue:[{filter:"colorize",params:{foregroundColor:[243,32,160]}},{filter:"posterize"}]},{name:l("%Cartoon"),filter:"cartoon",queue:[{action:"renderImage",params:{renderImage:"images/frames/dots.jpg"}},{filter:"oil",params:{levels:2}},{filter:"posterize",params:{levels:2}}]},{name:l("%Fresh"),filter:"fresh",queue:[{filter:"colorize",params:{foregroundColor:[36,146,28]}},{filter:"posterize"}]},{name:l("%Painting"),filter:"painting",
|
|
queue:[{filter:"melt"},{filter:"oil",params:{levels:10,range:2}},{filter:"posterize"}]},{name:l("%Sky"),filter:"sky",queue:[{filter:"colorize",params:{foregroundColor:[54,49,201]}},{filter:"posterize"}]},{name:l("%Tangerine"),filter:"tangerine",queue:[{filter:"colorize",params:{foregroundColor:[224,110,26]}},{filter:"posterize"}]}]},{name:l("%Retro"),filters:[{name:l("%Grit"),filter:"grit",queue:[{filter:"adjust_bc",params:{brightness:0,contrast:0.7}},{filter:"adjust_hsl",params:{hue:23,saturation:-50,
|
|
luminosity:-4}}]},{name:l("%Hazel"),filter:"hazel"},{name:l("%Melt"),filter:"melt"},{name:l("%Nostalgia"),filter:"nostalgia"},{name:l("%Oil"),filter:"oil",settings:[{name:l("%Levels"),type:picozu.CONTROL_SLIDER,property:"levels",value:32,min:1,max:100},{name:l("%Range"),type:picozu.CONTROL_SLIDER,property:"range",value:2,min:1,max:5}]},{name:l("%The 60s"),filter:"retro",queue:[{action:"renderImage",params:{renderImage:"images/frames/paper.jpg"}}]},{name:l("%Vignette"),filter:"vignette",settings:[{name:l("%Strength"),
|
|
type:picozu.CONTROL_SLIDER,property:"strength",value:0.6,min:0,max:1,step:0.1},{name:l("%Size"),type:picozu.CONTROL_SLIDER,property:"size",value:30,min:1,max:100}]},{name:l("%Vintage"),filter:"vintage",queue:[{filter:"vignette"},{filter:"desaturate"},{filter:"sepia"}]}]},{name:l("%Sketch"),filters:[{name:l("%Crayon"),filter:"crayon",queue:[{filter:"desaturate"},{filter:"sharpen"},{filter:"invert"},{filter:"edges"}]},{name:l("%Threshold"),filter:"threshold",settings:[{name:l("%Threshold"),type:picozu.CONTROL_SLIDER,
|
|
property:"threshold",value:100,min:0,max:200}]}]},{name:l("%Styles"),filters:[{name:l("%Emboss"),filter:"emboss",settings:[{name:l("%Strength"),type:picozu.CONTROL_SLIDER,property:"strength",value:1,min:1,max:10,step:0.1},{name:l("%Grey Level"),type:picozu.CONTROL_SLIDER,property:"greyLevel",value:180,min:0,max:255},{name:l("%Direction"),type:picozu.CONTROL_SELECT,property:"direction",data:[{name:"Top Left",handle:"0"},{name:"Top",handle:"1"},{name:"Top Right",handle:"2"},{name:"Right",handle:"3"},
|
|
{name:"Bottom Right",handle:"4"},{name:"Bottom",handle:"5"},{name:"Bottom Left",handle:"6"},{name:"Left",handle:"7"}]}]},{name:l("%Invert"),filter:"invert"},{name:l("%Posterize"),filter:"posterize",settings:[{name:l("%Levels"),type:picozu.CONTROL_SLIDER,property:"levels",value:6,min:1,max:15}]},{name:l("%Solarize"),filter:"solarize"},{name:l("%X-Ray"),filter:"xray",queue:[{filter:"invert"},{filter:"duotone",params:{sColor:[255,0,0]}}]}]}],requireAccount:!1,requirePayment:!1},{name:"Digital Effects",
|
|
handle:"digital",author:l("%Picozu Team"),version:"1.1",description:l("%filters.2.desc"),url:"www.picozu.com",email:"office@picozu.com",filters:[{name:l("%Digital Effects"),filters:[{name:l("%Ambrozia"),filter:"ambrozia",queue:[{filter:"curves",params:{curveName:"Ambrozia"}}]},{name:l("%Absynth"),filter:"absynth",queue:[{filter:"curves",params:{curveName:"Absynth"}}]},{name:l("%Amsterdam"),filter:"amsterdam",queue:[{filter:"curves",params:{curveName:"Amsterdam"}}]},{name:l("%Autumn"),filter:"autumn",
|
|
queue:[{filter:"curves",params:{curveName:"Autumn"}}]},{name:l("%Blue"),filter:"blue",queue:[{filter:"curves",params:{curveName:"Blue"}}]},{name:l("%Burlesque"),filter:"burlesque",queue:[{filter:"curves",params:{curveName:"Burlesque"}}]},{name:l("%California"),filter:"california",queue:[{filter:"curves",params:{curveName:"California"}}]},{name:l("%Clara"),filter:"clara",queue:[{filter:"curves",params:{curveName:"Clara"}}]},{name:l("%Country"),filter:"country",queue:[{filter:"curves",params:{curveName:"Country"}}]},
|
|
{name:l("%Countryside"),filter:"countryside",queue:[{filter:"curves",params:{curveName:"Countryside"}}]},{name:l("%Cross Process"),filter:"crossprocess",queue:[{filter:"curves",params:{curveName:"CrossProcess"}}]},{name:l("%Frenzy"),filter:"frenzy",queue:[{filter:"curves",params:{curveName:"Frenzy"}}]},{name:l("%Honey"),filter:"honey",queue:[{filter:"curves",params:{curveName:"Honey"}}]},{name:l("%Hollywood"),filter:"hollywood",queue:[{filter:"curves",params:{curveName:"Hollywood"}}]},{name:l("%Jolene"),
|
|
filter:"jolene",queue:[{filter:"curves",params:{curveName:"Jolene"}}]},{name:l("%Juliette"),filter:"juliette",queue:[{filter:"curves",params:{curveName:"Juliette"}}]},{name:l("%Lemonville"),filter:"lemonville",queue:[{filter:"curves",params:{curveName:"Lemonville"}}]},{name:l("%Lilith"),filter:"lilith",queue:[{filter:"curves",params:{curveName:"Lilith"}}]},{name:l("%Myrna"),filter:"myrna",queue:[{filter:"curves",params:{curveName:"Myrna"}}]},{name:l("%Marilyn"),filter:"marilyn",queue:[{filter:"curves",
|
|
params:{curveName:"Marilyn"}}]},{name:l("%Noir"),filter:"noir",queue:[{filter:"curves",params:{curveName:"Noir"}}]},{name:l("%Neon"),filter:"neon",queue:[{filter:"curves",params:{curveName:"Neon"}}]},{name:l("%Railway"),filter:"railway",queue:[{filter:"curves",params:{curveName:"Railway"}}]},{name:l("%Scorseze"),filter:"scorseze",queue:[{filter:"curves",params:{curveName:"Scorseze"}}]},{name:l("%Summer"),filter:"summer",queue:[{filter:"curves",params:{curveName:"Summer"}}]},{name:l("%Theda"),filter:"theda",
|
|
queue:[{filter:"curves",params:{curveName:"Theda"}}]},{name:l("%Velviaesque"),filter:"velviaesque",queue:[{filter:"curves",params:{curveName:"Velviaesque"}}]},{name:l("%Vertigo"),filter:"vertigo",queue:[{filter:"curves",params:{curveName:"Vertigo"}}]}]}],requireAccount:!1,requirePayment:!1}];picozu.API_ENTRY_POINT="https://www.picozu.com/";picozu.SITE_ENTRY_POINT=window.location.protocol+"//"+window.location.host+"/";picozu.EDITOR_API_ENTRY_POINT=window.location.protocol+"//www.picozu.com/editor/";
|
|
picozu.DEFAULT_PATH=picozu.SITE_ENTRY_POINT+"r/";picozu.DEFAULT_PLUGINS_PATH=picozu.DEFAULT_PATH+"plugins/";picozu.DEFAULT_MODULES_PATH=picozu.DEFAULT_PATH+"modules/";picozu.DEFAULT_WORKER_PATH=picozu.DEFAULT_PATH+"workers/";picozu.API_METHOD="POST";picozu.API_IMAGES=picozu.API_ENTRY_POINT+"api/media/images/";picozu.API_SIGNIN=picozu.API_ENTRY_POINT+"api/user/signin/";picozu.API_SIGNUP=picozu.API_ENTRY_POINT+"api/user/signup/";picozu.API_RECOVER=picozu.API_ENTRY_POINT+"api/user/recover/";
|
|
picozu.API_SOCIAL=picozu.API_ENTRY_POINT+"api/social/";picozu.API_SIGNOUT=picozu.API_ENTRY_POINT+"api/user/signout/";picozu.API_PROFILE=picozu.API_ENTRY_POINT+"api/user/profile/";picozu.API_HEARTBEAT=picozu.API_ENTRY_POINT+"api/user/heartbeat/";picozu.API_HELP=picozu.API_ENTRY_POINT+"api/search/";picozu.API_PROXY=picozu.API_ENTRY_POINT+"api/media/proxy/";picozu.API_SAVE=picozu.API_ENTRY_POINT+"api/media/save/";picozu.API_CONVERT=picozu.API_ENTRY_POINT+"api/media/convert/";
|
|
picozu.API_RETRIEVE=picozu.API_ENTRY_POINT+"api/media/retrieve/";picozu.API_ISAUTH=picozu.API_ENTRY_POINT+"api/user/is_signed_in/";picozu.API_AUTOSAVE=picozu.API_ENTRY_POINT+"api/media/autosave/";picozu.API_MOZILLA_MANIFEST=picozu.API_ENTRY_POINT+"api/others/firefox/";picozu.SHOOTER_PAGE=picozu.SITE_ENTRY_POINT+"shooter/";picozu.SHOOTER_MOZILLA_PAGE="https://addons.mozilla.org/en-US/firefox/addon/shooter/";picozu.CHROME_APP="https://chrome.google.com/webstore/detail/picozu/lajpehananomepaahgohcnmgkgmkhogf";
|
|
picozu.SHOOTER_ICON="chrome://shooter/content/icon.png";picozu.SHOOTER_ICON_URL=picozu.DEFAULT_PATH+"images/logos/icon_32x32.png";picozu.SHOOTER_XPI="https://addons.mozilla.org/firefox/downloads/latest/13485/addon-13485-latest.xpi";picozu.TWITTER_URL="https://www.twitter.com/picozu_editor/";picozu.FACEBOOK_URL="https://www.facebook.com/picozu/";
|
|
picozu.TIPS=[l("%tip1"),l("%tip2"),l("%tip3"),l("%tip4"),l("%tip5"),l("%tip6"),l("%tip7"),l("%tip8"),l("%tip9"),l("%tip10"),l("%tip11"),l("%tip12"),l("%tip13"),l("%tip14"),l("%tip15"),l("%tip16"),l("%tip17"),l("%tip18"),l("%tip19"),l("%tip20")];
|
|
picozu.DEFAULT_FONTS=[{name:"Arial",handle:"Arial"},{name:"Arial Black",handle:"Arial Black"},{name:"Arial Narrow",handle:"Arial Narrow"},{name:"Book Antiqua",handle:"Book Antiqua"},{name:"Bookman Old Style",handle:"Bookman Old Style"},{name:"Comic Sans MS",handle:"Comic Sans MS"},{name:"Consolas",handle:"Consolas"},{name:"Courier New",handle:"Courier New"},{name:"Garamond",handle:"Garamond"},{name:"Georgia",handle:"Georgia"},{name:"Helvetica",handle:"Helvetica"},{name:"Impact",handle:"Impact"},{name:"Lucida Console",
|
|
handle:"Lucida Console"},{name:"Tahoma",handle:"Tahoma"},{name:"Trebuchet MS",handle:"Trebuchet MS"},{name:"Verdana",handle:"Verdana"},{name:"ABeeZee"},{name:"Abel"},{name:"Abril Fatface"},{name:"Aclonica"},{name:"Acme"},{name:"Actor"},{name:"Adamina"},{name:"Advent Pro"},{name:"Aguafina Script"},{name:"Akronim"},{name:"Aladin"},{name:"Aldrich"},{name:"Alef"},{name:"Alegreya"},{name:"Alegreya SC"},{name:"Alegreya Sans"},{name:"Alegreya Sans SC"},{name:"Alex Brush"},{name:"Alfa Slab One"},{name:"Alice"},
|
|
{name:"Alike"},{name:"Alike Angular"},{name:"Allan"},{name:"Allerta"},{name:"Allerta Stencil"},{name:"Allura"},{name:"Almendra"},{name:"Almendra Display"},{name:"Almendra SC"},{name:"Amarante"},{name:"Amaranth"},{name:"Amatic SC"},{name:"Amethysta"},{name:"Anaheim"},{name:"Andada"},{name:"Andika"},{name:"Angkor"},{name:"Annie Use Your Telescope"},{name:"Anonymous Pro"},{name:"Antic"},{name:"Antic Didone"},{name:"Antic Slab"},{name:"Anton"},{name:"Arapey"},{name:"Arbutus"},{name:"Arbutus Slab"},{name:"Architects Daughter"},
|
|
{name:"Archivo Black"},{name:"Archivo Narrow"},{name:"Arimo"},{name:"Arizonia"},{name:"Armata"},{name:"Artifika"},{name:"Arvo"},{name:"Asap"},{name:"Asset"},{name:"Astloch"},{name:"Asul"},{name:"Atomic Age"},{name:"Aubrey"},{name:"Audiowide"},{name:"Autour One"},{name:"Average"},{name:"Average Sans"},{name:"Averia Gruesa Libre"},{name:"Averia Libre"},{name:"Averia Sans Libre"},{name:"Averia Serif Libre"},{name:"Bad Script"},{name:"Balthazar"},{name:"Bangers"},{name:"Basic"},{name:"Battambang"},{name:"Baumans"},
|
|
{name:"Bayon"},{name:"Belgrano"},{name:"Belleza"},{name:"BenchNine"},{name:"Bentham"},{name:"Berkshire Swash"},{name:"Bevan"},{name:"Bigelow Rules"},{name:"Bigshot One"},{name:"Bilbo"},{name:"Bilbo Swash Caps"},{name:"Bitter"},{name:"Black Ops One"},{name:"Bokor"},{name:"Bonbon"},{name:"Boogaloo"},{name:"Bowlby One"},{name:"Bowlby One SC"},{name:"Brawler"},{name:"Bree Serif"},{name:"Bubblegum Sans"},{name:"Bubbler One"},{name:"Buda"},{name:"Buenard"},{name:"Butcherman"},{name:"Butterfly Kids"},{name:"Cabin"},
|
|
{name:"Cabin Condensed"},{name:"Cabin Sketch"},{name:"Caesar Dressing"},{name:"Cagliostro"},{name:"Calligraffitti"},{name:"Cambo"},{name:"Candal"},{name:"Cantarell"},{name:"Cantata One"},{name:"Cantora One"},{name:"Capriola"},{name:"Cardo"},{name:"Carme"},{name:"Carrois Gothic"},{name:"Carrois Gothic SC"},{name:"Carter One"},{name:"Caudex"},{name:"Cedarville Cursive"},{name:"Ceviche One"},{name:"Changa One"},{name:"Chango"},{name:"Chau Philomene One"},{name:"Chela One"},{name:"Chelsea Market"},{name:"Chenla"},
|
|
{name:"Cherry Cream Soda"},{name:"Cherry Swash"},{name:"Chewy"},{name:"Chicle"},{name:"Chivo"},{name:"Cinzel"},{name:"Cinzel Decorative"},{name:"Clicker Script"},{name:"Coda"},{name:"Coda Caption"},{name:"Codystar"},{name:"Combo"},{name:"Comfortaa"},{name:"Coming Soon"},{name:"Concert One"},{name:"Condiment"},{name:"Content"},{name:"Contrail One"},{name:"Convergence"},{name:"Cookie"},{name:"Copse"},{name:"Corben"},{name:"Courgette"},{name:"Cousine"},{name:"Coustard"},{name:"Covered By Your Grace"},
|
|
{name:"Crafty Girls"},{name:"Creepster"},{name:"Crete Round"},{name:"Crimson Text"},{name:"Croissant One"},{name:"Crushed"},{name:"Cuprum"},{name:"Cutive"},{name:"Cutive Mono"},{name:"Damion"},{name:"Dancing Script"},{name:"Dangrek"},{name:"Dawning of a New Day"},{name:"Days One"},{name:"Delius"},{name:"Delius Swash Caps"},{name:"Delius Unicase"},{name:"Della Respira"},{name:"Denk One"},{name:"Devonshire"},{name:"Didact Gothic"},{name:"Diplomata"},{name:"Diplomata SC"},{name:"Domine"},{name:"Donegal One"},
|
|
{name:"Doppio One"},{name:"Dorsa"},{name:"Dosis"},{name:"Dr Sugiyama"},{name:"Droid Sans"},{name:"Droid Sans Mono"},{name:"Droid Serif"},{name:"Duru Sans"},{name:"Dynalight"},{name:"EB Garamond"},{name:"Eagle Lake"},{name:"Eater"},{name:"Economica"},{name:"Electrolize"},{name:"Elsie"},{name:"Elsie Swash Caps"},{name:"Emblema One"},{name:"Emilys Candy"},{name:"Engagement"},{name:"Englebert"},{name:"Enriqueta"},{name:"Erica One"},{name:"Esteban"},{name:"Euphoria Script"},{name:"Ewert"},{name:"Exo"},
|
|
{name:"Exo 2"},{name:"Expletus Sans"},{name:"Fanwood Text"},{name:"Fascinate"},{name:"Fascinate Inline"},{name:"Faster One"},{name:"Fasthand"},{name:"Fauna One"},{name:"Federant"},{name:"Federo"},{name:"Felipa"},{name:"Fenix"},{name:"Finger Paint"},{name:"Fjalla One"},{name:"Fjord One"},{name:"Flamenco"},{name:"Flavors"},{name:"Fondamento"},{name:"Fontdiner Swanky"},{name:"Forum"},{name:"Francois One"},{name:"Freckle Face"},{name:"Fredericka the Great"},{name:"Fredoka One"},{name:"Freehand"},{name:"Fresca"},
|
|
{name:"Frijole"},{name:"Fruktur"},{name:"Fugaz One"},{name:"GFS Didot"},{name:"GFS Neohellenic"},{name:"Gabriela"},{name:"Gafata"},{name:"Galdeano"},{name:"Galindo"},{name:"Gentium Basic"},{name:"Gentium Book Basic"},{name:"Geo"},{name:"Geostar"},{name:"Geostar Fill"},{name:"Germania One"},{name:"Gilda Display"},{name:"Give You Glory"},{name:"Glass Antiqua"},{name:"Glegoo"},{name:"Gloria Hallelujah"},{name:"Goblin One"},{name:"Gochi Hand"},{name:"Gorditas"},{name:"Goudy Bookletter 1911"},{name:"Graduate"},
|
|
{name:"Grand Hotel"},{name:"Gravitas One"},{name:"Great Vibes"},{name:"Griffy"},{name:"Gruppo"},{name:"Gudea"},{name:"Habibi"},{name:"Hammersmith One"},{name:"Hanalei"},{name:"Hanalei Fill"},{name:"Handlee"},{name:"Hanuman"},{name:"Happy Monkey"},{name:"Headland One"},{name:"Henny Penny"},{name:"Herr Von Muellerhoff"},{name:"Holtwood One SC"},{name:"Homemade Apple"},{name:"Homenaje"},{name:"IM Fell DW Pica"},{name:"IM Fell DW Pica SC"},{name:"IM Fell Double Pica"},{name:"IM Fell Double Pica SC"},
|
|
{name:"IM Fell English"},{name:"IM Fell English SC"},{name:"IM Fell French Canon"},{name:"IM Fell French Canon SC"},{name:"IM Fell Great Primer"},{name:"IM Fell Great Primer SC"},{name:"Iceberg"},{name:"Iceland"},{name:"Imprima"},{name:"Inconsolata"},{name:"Inder"},{name:"Indie Flower"},{name:"Inika"},{name:"Irish Grover"},{name:"Istok Web"},{name:"Italiana"},{name:"Italianno"},{name:"Jacques Francois"},{name:"Jacques Francois Shadow"},{name:"Jim Nightshade"},{name:"Jockey One"},{name:"Jolly Lodger"},
|
|
{name:"Josefin Sans"},{name:"Josefin Slab"},{name:"Joti One"},{name:"Judson"},{name:"Julee"},{name:"Julius Sans One"},{name:"Junge"},{name:"Jura"},{name:"Just Another Hand"},{name:"Just Me Again Down Here"},{name:"Kameron"},{name:"Kantumruy"},{name:"Karla"},{name:"Kaushan Script"},{name:"Kavoon"},{name:"Kdam Thmor"},{name:"Keania One"},{name:"Kelly Slab"},{name:"Kenia"},{name:"Khmer"},{name:"Kite One"},{name:"Knewave"},{name:"Kotta One"},{name:"Koulen"},{name:"Kranky"},{name:"Kreon"},{name:"Kristi"},
|
|
{name:"Krona One"},{name:"La Belle Aurore"},{name:"Lancelot"},{name:"Lato"},{name:"League Script"},{name:"Leckerli One"},{name:"Ledger"},{name:"Lekton"},{name:"Lemon"},{name:"Libre Baskerville"},{name:"Life Savers"},{name:"Lilita One"},{name:"Lily Script One"},{name:"Limelight"},{name:"Linden Hill"},{name:"Lobster"},{name:"Lobster Two"},{name:"Londrina Outline"},{name:"Londrina Shadow"},{name:"Londrina Sketch"},{name:"Londrina Solid"},{name:"Lora"},{name:"Love Ya Like A Sister"},{name:"Loved by the King"},
|
|
{name:"Lovers Quarrel"},{name:"Luckiest Guy"},{name:"Lusitana"},{name:"Lustria"},{name:"Macondo"},{name:"Macondo Swash Caps"},{name:"Magra"},{name:"Maiden Orange"},{name:"Mako"},{name:"Marcellus"},{name:"Marcellus SC"},{name:"Marck Script"},{name:"Margarine"},{name:"Marko One"},{name:"Marmelad"},{name:"Marvel"},{name:"Mate"},{name:"Mate SC"},{name:"Maven Pro"},{name:"McLaren"},{name:"Meddon"},{name:"MedievalSharp"},{name:"Medula One"},{name:"Megrim"},{name:"Meie Script"},{name:"Merienda"},{name:"Merienda One"},
|
|
{name:"Merriweather"},{name:"Merriweather Sans"},{name:"Metal"},{name:"Metal Mania"},{name:"Metamorphous"},{name:"Metrophobic"},{name:"Michroma"},{name:"Milonga"},{name:"Miltonian"},{name:"Miltonian Tattoo"},{name:"Miniver"},{name:"Miss Fajardose"},{name:"Modern Antiqua"},{name:"Molengo"},{name:"Molle"},{name:"Monda"},{name:"Monofett"},{name:"Monoton"},{name:"Monsieur La Doulaise"},{name:"Montaga"},{name:"Montez"},{name:"Montserrat"},{name:"Montserrat Alternates"},{name:"Montserrat Subrayada"},{name:"Moul"},
|
|
{name:"Moulpali"},{name:"Mountains of Christmas"},{name:"Mouse Memoirs"},{name:"Mr Bedfort"},{name:"Mr Dafoe"},{name:"Mr De Haviland"},{name:"Mrs Saint Delafield"},{name:"Mrs Sheppards"},{name:"Muli"},{name:"Mystery Quest"},{name:"Neucha"},{name:"Neuton"},{name:"New Rocker"},{name:"News Cycle"},{name:"Niconne"},{name:"Nixie One"},{name:"Nobile"},{name:"Nokora"},{name:"Norican"},{name:"Nosifer"},{name:"Nothing You Could Do"},{name:"Noticia Text"},{name:"Noto Sans"},{name:"Noto Serif"},{name:"Nova Cut"},
|
|
{name:"Nova Flat"},{name:"Nova Mono"},{name:"Nova Oval"},{name:"Nova Round"},{name:"Nova Script"},{name:"Nova Slim"},{name:"Nova Square"},{name:"Numans"},{name:"Nunito"},{name:"Odor Mean Chey"},{name:"Offside"},{name:"Old Standard TT"},{name:"Oldenburg"},{name:"Oleo Script"},{name:"Oleo Script Swash Caps"},{name:"Open Sans"},{name:"Open Sans Condensed"},{name:"Oranienbaum"},{name:"Orbitron"},{name:"Oregano"},{name:"Orienta"},{name:"Original Surfer"},{name:"Oswald"},{name:"Over the Rainbow"},{name:"Overlock"},
|
|
{name:"Overlock SC"},{name:"Ovo"},{name:"Oxygen"},{name:"Oxygen Mono"},{name:"PT Mono"},{name:"PT Sans"},{name:"PT Sans Caption"},{name:"PT Sans Narrow"},{name:"PT Serif"},{name:"PT Serif Caption"},{name:"Pacifico"},{name:"Paprika"},{name:"Parisienne"},{name:"Passero One"},{name:"Passion One"},{name:"Pathway Gothic One"},{name:"Patrick Hand"},{name:"Patrick Hand SC"},{name:"Patua One"},{name:"Paytone One"},{name:"Peralta"},{name:"Permanent Marker"},{name:"Petit Formal Script"},{name:"Petrona"},{name:"Philosopher"},
|
|
{name:"Piedra"},{name:"Pinyon Script"},{name:"Pirata One"},{name:"Plaster"},{name:"Play"},{name:"Playball"},{name:"Playfair Display"},{name:"Playfair Display SC"},{name:"Podkova"},{name:"Poiret One"},{name:"Poller One"},{name:"Poly"},{name:"Pompiere"},{name:"Pontano Sans"},{name:"Port Lligat Sans"},{name:"Port Lligat Slab"},{name:"Prata"},{name:"Preahvihear"},{name:"Press Start 2P"},{name:"Princess Sofia"},{name:"Prociono"},{name:"Prosto One"},{name:"Puritan"},{name:"Purple Purse"},{name:"Quando"},
|
|
{name:"Quantico"},{name:"Quattrocento"},{name:"Quattrocento Sans"},{name:"Questrial"},{name:"Quicksand"},{name:"Quintessential"},{name:"Qwigley"},{name:"Racing Sans One"},{name:"Radley"},{name:"Raleway"},{name:"Raleway Dots"},{name:"Rambla"},{name:"Rammetto One"},{name:"Ranchers"},{name:"Rancho"},{name:"Rationale"},{name:"Redressed"},{name:"Reenie Beanie"},{name:"Revalia"},{name:"Ribeye"},{name:"Ribeye Marrow"},{name:"Righteous"},{name:"Risque"},{name:"Roboto"},{name:"Roboto Condensed"},{name:"Roboto Slab"},
|
|
{name:"Rochester"},{name:"Rock Salt"},{name:"Rokkitt"},{name:"Romanesco"},{name:"Ropa Sans"},{name:"Rosario"},{name:"Rosarivo"},{name:"Rouge Script"},{name:"Rubik Mono One"},{name:"Rubik One"},{name:"Ruda"},{name:"Rufina"},{name:"Ruge Boogie"},{name:"Ruluko"},{name:"Rum Raisin"},{name:"Ruslan Display"},{name:"Russo One"},{name:"Ruthie"},{name:"Rye"},{name:"Sacramento"},{name:"Sail"},{name:"Salsa"},{name:"Sanchez"},{name:"Sancreek"},{name:"Sansita One"},{name:"Sarina"},{name:"Satisfy"},{name:"Scada"},
|
|
{name:"Schoolbell"},{name:"Seaweed Script"},{name:"Sevillana"},{name:"Seymour One"},{name:"Shadows Into Light"},{name:"Shadows Into Light Two"},{name:"Shanti"},{name:"Share"},{name:"Share Tech"},{name:"Share Tech Mono"},{name:"Shojumaru"},{name:"Short Stack"},{name:"Siemreap"},{name:"Sigmar One"},{name:"Signika"},{name:"Signika Negative"},{name:"Simonetta"},{name:"Sintony"},{name:"Sirin Stencil"},{name:"Six Caps"},{name:"Skranji"},{name:"Slackey"},{name:"Smokum"},{name:"Smythe"},{name:"Sniglet"},
|
|
{name:"Snippet"},{name:"Snowburst One"},{name:"Sofadi One"},{name:"Sofia"},{name:"Sonsie One"},{name:"Sorts Mill Goudy"},{name:"Source Code Pro"},{name:"Source Sans Pro"},{name:"Special Elite"},{name:"Spicy Rice"},{name:"Spinnaker"},{name:"Spirax"},{name:"Squada One"},{name:"Stalemate"},{name:"Stalinist One"},{name:"Stardos Stencil"},{name:"Stint Ultra Condensed"},{name:"Stint Ultra Expanded"},{name:"Stoke"},{name:"Strait"},{name:"Sue Ellen Francisco"},{name:"Sunshiney"},{name:"Supermercado One"},
|
|
{name:"Suwannaphum"},{name:"Swanky and Moo Moo"},{name:"Syncopate"},{name:"Tangerine"},{name:"Taprom"},{name:"Tauri"},{name:"Telex"},{name:"Tenor Sans"},{name:"Text Me One"},{name:"The Girl Next Door"},{name:"Tienne"},{name:"Tinos"},{name:"Titan One"},{name:"Titillium Web"},{name:"Trade Winds"},{name:"Trocchi"},{name:"Trochut"},{name:"Trykker"},{name:"Tulpen One"},{name:"Ubuntu"},{name:"Ubuntu Condensed"},{name:"Ubuntu Mono"},{name:"Ultra"},{name:"Uncial Antiqua"},{name:"Underdog"},{name:"Unica One"},
|
|
{name:"UnifrakturCook"},{name:"UnifrakturMaguntia"},{name:"Unkempt"},{name:"Unlock"},{name:"Unna"},{name:"VT323"},{name:"Vampiro One"},{name:"Varela"},{name:"Varela Round"},{name:"Vast Shadow"},{name:"Vibur"},{name:"Vidaloka"},{name:"Viga"},{name:"Voces"},{name:"Volkhov"},{name:"Vollkorn"},{name:"Voltaire"},{name:"Waiting for the Sunrise"},{name:"Wallpoet"},{name:"Walter Turncoat"},{name:"Warnes"},{name:"Wellfleet"},{name:"Wendy One"},{name:"Wire One"},{name:"Yanone Kaffeesatz"},{name:"Yellowtail"},
|
|
{name:"Yeseva One"},{name:"Yesteryear"},{name:"Zeyada"}];picozu.LIBRARY=[{name:l("%iPhone UI"),objects:["iphone-keyboard-1","iphone-keyboard-2","iphone-keyboard-3","iphone-selector"]},{name:l("%t-Shirts"),objects:["2","3","6"]}];
|
|
picozu.DEFAULT_BRUSHES=[{name:l("%Normal"),handle:"pencil_normal"},{name:l("%Dynamic"),handle:"pencil_dynamic"},{name:l("%Sketchtaculous"),handle:"pencil_sketchtaculous"},{name:l("%Sketchy"),handle:"pencil_sketchy"},{name:l("%Chrome"),handle:"pencil_chrome"},{name:l("%Fur"),handle:"pencil_fur"},{name:l("%Web"),handle:"pencil_web"},{name:l("%Shaded"),handle:"pencil_shaded"},{name:l("%Ribbon"),handle:"pencil_ribbon"},{name:l("%Circles"),handle:"pencil_circles"},{name:l("%Stars"),handle:"pencil_stars"},
|
|
{name:l("%Smooth"),handle:"pencil_smooth"},{name:l("%Diamonds"),handle:"pencil_diamonds"},{name:l("%Shadetastic"),handle:"pencil_shadetastic"},{name:l("%Grid"),handle:"pencil_grid"},{name:l("%Long Fur"),handle:"pencil_longfur"},{name:l("%Squares"),handle:"pencil_squares"},{name:l("%String"),handle:"pencil_string"},{name:l("%Curves"),handle:"pencil_curves"},{name:l("%Rounds"),handle:"pencil_rounds"},{name:l("%Flowers"),handle:"pencil_flowers"},{name:l("%Palm"),handle:"pencil_palm"},{name:l("%Grassy"),
|
|
handle:"pencil_grassy"}];
|
|
picozu.DEFAULT_BLEND_MODES=[{name:l("%blend.normal"),handle:"normal"},{name:l("%blend.sourcein"),handle:"sourcein"},{name:l("%blend.sourceover"),handle:"sourceover"},{name:l("%blend.destinationout"),handle:"destinationout"},{name:l("%blend.dissolve"),handle:"dissolve"},{name:l("%blend.average"),handle:"average"},{name:l("%blend.darker"),handle:"darker"},{name:l("%blend.darken"),handle:"darken"},{name:l("%blend.multiply"),handle:"multiply"},{name:l("%blend.colorburn"),handle:"colorburn"},{name:l("%blend.colorburninverse"),
|
|
handle:"colorburninverse"},{name:l("%blend.softburn"),handle:"softburn"},{name:l("%blend.linearburn"),handle:"linearburn"},{name:l("%blend.lighter"),handle:"lighter"},{name:l("%blend.lighten"),handle:"lighten"},{name:l("%blend.screen"),handle:"screen"},{name:l("%blend.colordodge"),handle:"colordodge"},{name:l("%blend.colordodgeinverse"),handle:"colordodgeinverse"},{name:l("%blend.softdodge"),handle:"softdodge"},{name:l("%blend.lineardodge"),handle:"lineardodge"},{name:l("%blend.overlay"),handle:"overlay"},
|
|
{name:l("%blend.softlight"),handle:"softlight"},{name:l("%blend.fuzzylight"),handle:"fuzzylight"},{name:l("%blend.hardlight"),handle:"hardlight"},{name:l("%blend.vividlight"),handle:"vividlight"},{name:l("%blend.linearlight"),handle:"linearlight"},{name:l("%blend.pinlight"),handle:"pinlight"},{name:l("%blend.hardmix"),handle:"hardmix"},{name:l("%blend.grainextract"),handle:"grainextract"},{name:l("%blend.grainmerge"),handle:"grainmerge"},{name:l("%blend.difference"),handle:"difference"},{name:l("%blend.exclusion"),
|
|
handle:"exclusion"},{name:l("%blend.negation"),handle:"negation"},{name:l("%blend.invert"),handle:"invert"},{name:l("%blend.hue"),handle:"hue"},{name:l("%blend.saturation"),handle:"saturation"},{name:l("%blend.color"),handle:"color"},{name:l("%blend.luminosity"),handle:"luminosity"},{name:l("%blend.red"),handle:"red"},{name:l("%blend.green"),handle:"green"},{name:l("%blend.blue"),handle:"blue"},{name:l("%blend.tint"),handle:"tint"},{name:l("%blend.reflect"),handle:"reflect"},{name:l("%blend.glow"),
|
|
handle:"glow"},{name:l("%blend.heat"),handle:"heat"},{name:l("%blend.freeze"),handle:"freeze"},{name:l("%blend.additive"),handle:"additive"},{name:l("%blend.subtractive"),handle:"substractive"},{name:l("%blend.subtract"),handle:"substract"},{name:l("%blend.stamp"),handle:"stamp"},{name:l("%blend.interpolation"),handle:"interpolation"},{name:l("%blend.divide"),handle:"divide"},{name:l("%blend.xor"),handle:"xor"},{name:l("%blend.and"),handle:"and"},{name:l("%blend.or"),handle:"or"}];
|
|
picozu.FILE_HEADER_PZI={v:"1.0.0",t:"PZI",e:!1,d:null};picozu.FILE_HEADER_PZW={v:"1.0.0",t:"PZW",e:!1,d:null};picozu.FILE_FORMAT_ASE=1;picozu.FILE_FORMAT_CLR=2;picozu.FILE_FORMAT_ACT=3;picozu.FILE_FORMAT_GMP=4;picozu.FILE_FORMAT_ACO=5;picozu.FILE_FORMAT_PNG=6;picozu.FILE_FORMAT_JPG=7;picozu.FILE_FORMAT_SVG=8;picozu.FILE_FORMAT_HTMLCSS=9;picozu.FILE_FORMAT_BMP=10;picozu.FILE_FORMAT_PSD=11;picozu.FILE_FORMAT_GIF=12;picozu.FILE_FORMAT_PDF=13;picozu.FILE_FORMAT_PS=14;picozu.FILE_FORMAT_STYLESHEET=15;
|
|
picozu.FILE_FORMAT_TIFF=16;picozu.FILE_FORMAT_ICO=17;picozu.FILE_FORMAT_WEBP=18;picozu.FILE_FORMAT_RAW=19;picozu.FILE_FORMAT_PZI=98;picozu.FILE_FORMAT_PZW=99;picozu.FILE_FORMAT_BINARY=100;picozu.ICON_SIZES=[{name:l("%16x16px"),handle:16},{name:l("%24x24px"),handle:24},{name:l("%32x32px"),handle:32},{name:l("%48x48px"),handle:48},{name:l("%64x64px"),handle:64},{name:l("%128x128px"),handle:128}];
|
|
picozu.objects.logger=function(){this.__destructor=function(){};this.__constructor=function(){return this};this.trigger=function(a){if(!0===picozu.DEBUG){var c="";"undefined"===typeof a.scope&&(a.scope=l("%APP"));var b=new Date;a.scope===l("%ERR")&&(c=' class="error"');a.scope===l("%KERNEL")&&(c=' class="kernel"');a.scope===l("%SERVER")&&(c=' class="server"');$(".pico-debug-list")&&$(".pico-debug-list").prepend("<li"+c+"><em>"+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+"</em>:<strong>"+a.scope+
|
|
"</strong>: "+a.message+"</li>")}return this};this.destroy=function(){this.__destructor()};return this.__constructor()};picozu.IMPORTERS=[{name:l("%Sample images"),handle:"sampleimages"},{name:l("%Image URL"),handle:"importURL"},{name:l("%Upload image"),handle:"uploadfiles"},{separator:!0}];picozu.EXPORTERS=[{name:l("%Color Palette"),handle:"colorpalette"},{separator:!0}];
|
|
picozu.DEFAULT_COLOR_PALETTES=[{name:l("%export.ase"),handle:picozu.FILE_FORMAT_ASE},{name:l("%export.clr"),handle:picozu.FILE_FORMAT_CLR},{name:l("%export.act"),handle:picozu.FILE_FORMAT_ACT},{name:l("%export.gmp"),handle:picozu.FILE_FORMAT_GMP},{name:l("%export.aco"),handle:picozu.FILE_FORMAT_ACO}];picozu.STYLESHEET_EXPORT_FORMATS=[{name:l("%export.stylesheet.css"),handle:1},{name:l("%export.stylesheet.less"),handle:2}];
|
|
picozu.DEFAULT_EXPORTERS=[{name:l("%export.png"),handle:picozu.FILE_FORMAT_PNG,ext:"png"},{name:l("%export.jpg"),handle:picozu.FILE_FORMAT_JPG,ext:"jpg",settings:[{type:picozu.CONTROL_SLIDER,legend:l("%Quality"),handle:"pp-jpegQuality",tips:l("%tips.export.jpegquality"),property:"jpegQuality",value:10,name:"jpegQuality",minValue:1,maxValue:10,step:1},{type:picozu.CONTROL_COLORSELECT,legend:l("%Background Color"),tips:l("%tips.export.bg"),handle:"pz-backgroundColor",name:"backgroundColor",value:[255,
|
|
255,255]}]},{name:l("%export.webp"),handle:picozu.FILE_FORMAT_WEBP,ext:"webp"},{name:l("%export.bmp"),handle:picozu.FILE_FORMAT_BMP,ext:"bmp"},{name:l("%export.webp"),handle:picozu.FILE_FORMAT_WEBP,ext:"png"},{name:l("%export.pdf"),handle:picozu.FILE_FORMAT_PDF,ext:"pdf"},{name:l("%export.ps"),handle:picozu.FILE_FORMAT_PS,ext:"ps"},{name:l("%export.gif"),handle:picozu.FILE_FORMAT_GIF,ext:"gif",settings:[{type:picozu.CONTROL_COLORSELECT,legend:l("%Background Color"),tips:l("%tips.export.bg"),handle:"pz-backgroundColor",
|
|
name:"backgroundColor",value:[255,255,255]}]},{name:l("%export.ico"),handle:picozu.FILE_FORMAT_ICO,ext:"ico",settings:[{type:picozu.CONTROL_SELECT,legend:l("%Icon Size"),tips:l("%tips.export.iconsize"),handle:"pz-icoSize",name:"icoSize",cssClass:"pz-icoSize",data:picozu.ICON_SIZES},{type:picozu.CONTROL_CHECKBOX,legend:l("%export.mergeicons"),tips:l("%tips.export.mergeicons"),handle:"pz-mergeIco",name:"mergeIco"}]},{name:l("%export.tiff"),handle:picozu.FILE_FORMAT_TIFF,ext:"tiff"},{name:l("%export.pzi"),
|
|
handle:picozu.FILE_FORMAT_PZI,ext:"pzi",settings:[{type:picozu.CONTROL_CHECKBOX,legend:l("%Encrypt"),tips:l("%tips.export.encrypt"),handle:"pz-encryptPZ",name:"encryptPZ"}]},{name:l("%export.pzw"),handle:picozu.FILE_FORMAT_PZW,ext:"pzw",settings:[{type:picozu.CONTROL_CHECKBOX,tips:l("%tips.export.encrypt"),legend:l("%Encrypt"),handle:"pz-encryptPZ",name:"encryptPZ"}]},{name:l("%export.spritesheet"),handle:picozu.FILE_FORMAT_STYLESHEET,ext:"css",settings:[{type:picozu.CONTROL_TEXTINPUT,legend:l("%Class prefix"),
|
|
value:"sprite",tips:l("%tips.export.classprefix"),handle:"pz-spriteName",name:"spriteName",cssClass:"pz-spriteName",max:20},{type:picozu.CONTROL_SELECT,legend:l("%Stylesheet format"),tips:l("%tips.export.format"),handle:"pz-cssFormat",name:"cssFormat",cssClass:"pz-cssFormat",data:picozu.STYLESHEET_EXPORT_FORMATS},{type:picozu.CONTROL_CHECKBOX,tips:l("%tips.export.embedimage"),legend:l("%Embed image in CSS"),handle:"pz-embedImage",name:"embedImage"}]}];
|
|
picozu.MAIN_TOOLBAR_DEFS=[{handle:"hand",label:l("%tool.hand")},{handle:"selection",label:l("%tool.select"),group:[{handle:"rectselect",label:l("%tool.rectselect")},{handle:"freeselect",label:l("%tool.freeselect")}]},{handle:"text",label:l("%tool.text")},{handle:"shape",label:l("%tool.shape"),group:[{handle:"line",label:l("%tool.line")},{handle:"arrow",label:l("%tool.arrow")},{handle:"circle",label:l("%tool.circle")},{handle:"ellipse",label:l("%tool.ellipse")},{handle:"rectangle",label:l("%tool.rect")},
|
|
{handle:"roundedRectangle",label:l("%tool.rrect")}]},{handle:"crop",label:l("%tool.crop")},{handle:"brush",label:l("%tool.brush"),group:[{handle:"pencil_normal",label:l("%tool.pencil")},{handle:"brush",label:l("%tool.brush")},{handle:"pen",label:l("%tool.pen")}]},{handle:"colorpicker",label:l("%tool.picker")},{handle:"eraser",label:l("%tool.eraser"),group:[{handle:"eraser",label:l("%tool.eraser")},{handle:"magiceraser",label:l("%tool.magiceraser")}]},{handle:"ruler",label:l("%tool.ruler")},{handle:"colorfill",
|
|
label:l("%tool.colorfill")},{handle:"airbrush",label:l("%tool.airbrush")}];for(var i=0;i<picozu.AVAILABLE_FILTER_PACKS.length;i++)$.merge(picozu.FILTERS,picozu.AVAILABLE_FILTER_PACKS[i].filters);
|
|
picozu.MAIN_MENU_DEFS=[{label:l("%Image"),handle:"tab",submenus:[{label:l("%New"),handle:"new-tab",shortcut:"ctrl+n",callback:function(){this.openWindow("newimage")}},{label:l("%Import"),handle:"import-tab",innerTemplate:'<ul id="menu-importers-list"></ul>'},{label:l("%Export"),handle:"export-tab",innerTemplate:'<ul id="menu-exporters-list"></ul>'},{label:l("%main.save"),handle:"save-tab",shortcut:"ctrl+s",callback:function(){this.openWindow("saveimage")}},{separator:!0},{label:l("%menu.resize"),
|
|
handle:"resize-tab",shortcut:"alt+ctrl+i",callback:function(){this.openWindow("resizeimage")}},{label:l("%Rotate"),handle:"rotate-image",submenus:[{label:l("%Flip Horizontally"),handle:"flip-v-image",callback:function(){this.getSelectedTab().flip(picozu.FLIP_HORIZONTAL)}},{label:l("%Flip Vertically"),handle:"flip-h-image",callback:function(){this.getSelectedTab().flip(picozu.FLIP_VERTICAL)}},{separator:!0},{label:l("%Rotate 90"),handle:"rotate-90-image",callback:function(){this.getSelectedTab().rotate(90)}},
|
|
{label:l("%Rotate 180"),handle:"rotate-180-image",callback:function(){this.getSelectedTab().rotate(180)}},{label:l("%Rotate 270"),handle:"rotate-270-image",callback:function(){this.getSelectedTab().rotate(270)}}]},{label:l("%window.canvas.size"),handle:"canvas-tab",shortcut:"alt+ctrl+c",callback:function(){this.openWindow("canvassizeimage")}},{separator:!0},{label:l("%Info"),handle:"info-tab",shortcut:"ctrl+i",callback:function(){this.openWindow("imageinfo")}},{label:l("%Reset"),handle:"reset-tab",
|
|
shortcut:"ctrl+y",callback:function(){this.getSelectedTab().reset()}},{label:l("%Close"),handle:"close-tab",shortcut:"alt+ctrl+x",callback:function(){this.getSelectedTab().destroy()}},{separator:!0},{label:l("%Workspace"),handle:"workspace",submenus:[{label:l("%Export"),handle:"export-workspace",callback:function(){var a=this;this.exportData(picozu.FILE_FORMAT_PZW,function(c,b,d,e){$(".pico-iframe").remove();$(".picozu").append('<iframe class="pico-iframe" src=""></iframe>');a.doRequest(picozu.API_CONVERT,
|
|
"contents="+c+"&format="+b+("undefined"!==typeof e&&""!=e?"&"+e:""),function(a){$(".pico-iframe").attr("src",picozu.API_RETRIEVE+"?temp=1&file="+a.code+"&format="+a.format+"&title="+d)},null,"json")})}},{label:l("%Reset"),handle:"reset-workspace",callback:function(){this.confirmWindow(l("%main.resetworkspace"),l("%main.resetworkspacetext"),function(){this.reset(!1)})}}]}]},{label:l("%Edit"),handle:"edit",submenus:[{label:l("%Undo"),handle:"undo-history",id:"menu-edit-undo",shortcut:"ctrl+z",cssClass:"disabled",
|
|
callback:function(){this.doUndo()}},{separator:!0},{label:l("%Cut"),handle:"cut-select",shortcut:"ctrl+x",callback:function(){this.cutClipboard()}},{label:l("%Copy"),handle:"copy-select",shortcut:"ctrl+c",callback:function(){this.copyClipboard()}},{label:l("%Paste"),handle:"paste-select",shortcut:"ctrl+v",id:"menu-edit-paste",cssClass:"disabled",callback:function(){this.pasteClipboard(!0)}},{separator:!0},{label:l("%Select"),handle:"select",submenus:[{label:l("%All"),handle:"all-select",shortcut:"ctrl+a",
|
|
callback:function(){this.selectAll()}},{label:l("%None"),handle:"none-select",shortcut:"ctrl+d",callback:function(){this.selectNone()}}]},{separator:!0},{label:l("%Adjustments"),handle:"adjustments",submenus:[{label:l("%Curves"),handle:"adjustments-curves",innerTemplate:'<ul id="menu-curves-list"></ul>'},{separator:!0},{label:l("%Channels"),handle:"channels-layer",submenus:[{label:l("%Red"),handle:"red-channels-layer",callback:function(){this.configFilter({colorMatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,
|
|
0,0,0,0,1,0]}).addToQueue("colormatrix").processQueue()}},{label:l("%Green"),handle:"green-channels-layer",callback:function(){this.configFilter({colorMatrix:[0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0]}).addToQueue("colormatrix").processQueue()}},{label:l("%Blue"),handle:"blue-channels-layer",callback:function(){this.configFilter({colorMatrix:[0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0]}).addToQueue("colormatrix").processQueue()}}]}]}]},{label:l("%Layer"),handle:"layer",submenus:[{label:l("%New"),handle:"new-layer",
|
|
submenus:[{label:l("%Layer"),handle:"new-layer-empty",shortcut:"ctrl+shift+n",callback:function(){this.newLayer()}},{label:l("%Layer via Cut"),handle:"new-layer-cut",callback:function(){!0===this.cutClipboard()&&this.pasteClipboard(!0)}},{label:l("%Layer via Copy"),handle:"new-layer-copy",callback:function(){!0===this.copyClipboard()&&this.pasteClipboard(!0)}}]},{label:l("%Image from Layer"),handle:"image-from-layer",callback:function(){this.imageFromLayer()}},{label:l("%Rotate"),handle:"rotate-layer",
|
|
submenus:[{label:l("%Flip Horizontally"),handle:"flip-v-layer",callback:function(){this.getSelectedLayer().flip(picozu.FLIP_HORIZONTAL)}},{label:l("%Flip Vertically"),handle:"flip-h-layer",callback:function(){this.getSelectedLayer().flip(picozu.FLIP_VERTICAL)}},{separator:!0},{label:l("%Rotate 90"),handle:"rotate-90-layer",callback:function(){this.getSelectedLayer().rotate(90)}},{label:l("%Rotate 180"),handle:"rotate-180-layer",callback:function(){this.getSelectedLayer().rotate(180)}},{label:l("%Rotate 270"),
|
|
handle:"rotate-270-layer",callback:function(){this.getSelectedLayer().rotate(270)}}]},{label:l("%Arrange"),handle:"arrange-image",submenus:[{label:l("%Bring to Front"),shortcut:"ctrl+shift+]",handle:"bring-front-image",callback:function(){this.getSelectedLayer().front()}},{label:l("%Bring Forward"),shortcut:"ctrl+]",handle:"bring-forward-image",callback:function(){this.getSelectedLayer().forward()}},{label:l("%Send Backward"),shortcut:"ctrl+[",handle:"send-backward-image",callback:function(){this.getSelectedLayer().backward()}},
|
|
{label:l("%Send to Back"),shortcut:"ctrl+shift+[",handle:"bring-back-image",callback:function(){this.getSelectedLayer().back()}},{label:l("%Reverse"),handle:"bring-reverse-image",callback:function(){this.getSelectedLayer().reverse()}}]},{label:l("%Duplicate"),shortcut:"insert",handle:"duplicate-layer",callback:function(){this.duplicateLayer()}},{label:l("%Delete"),handle:"delete-layer",shortcut:"del",callback:function(){this.deleteLayer()}},{separator:!0},{label:l("%Next Layer"),handle:"next-layer",
|
|
shortcut:"pageup",callback:function(){this.selectNextLayer()}},{label:l("%Previous Layer"),handle:"prev-layer",shortcut:"pagedown",callback:function(){this.selectPreviousLayer()}},{label:l("%Flatten"),handle:"flatten-layer",shortcut:"ctrl+f",callback:function(){this.flattenLayers()}},{label:l("%menu.resize"),handle:"resize-layer",callback:function(){this.openWindow("resizelayer")}}]},{label:l("%Tools"),handle:"tools",submenus:[{label:l("%Extensions"),handle:"extensions-tool",shortcut:"f2",callback:function(){this.openWindow("extensions")}},
|
|
{label:l("%Settings"),handle:"settings-tool",shortcut:"ctrl+k",callback:function(){this.openWindow("settings")}},{separator:!0},{label:l("%Toggle Fullscreen"),handle:"fullscreen",shortcut:"f11",callback:function(){this.toggleFullscreen()}},{separator:!0},{label:l("%More tools"),handle:"tools-more",innerTemplate:'<ul id="menu-tools-list"></ul>'}]},{label:l("%Filters"),handle:"filters",callback:function(){this.openWindow("filters")}},
|
|
{label:l("%Help"),handle:"help",submenus:[{label:l("%Contents"),handle:"contents-help",shortcut:"f1",callback:function(){this.openWindow("helpcontents")}},{label:l("%Follow us on Twitter"),handle:"twitter-help",callback:function(){document.location.href=picozu.TWITTER_URL}}]}];
|
|
picozu.TAB_CONTEXTMENU_DEFS={newlayer:{label:l("%New Layer"),callback:function(){this.newLayer()}},copylayer:{label:l("%Copy to Clipboard"),callback:function(){this.copyClipboard(!0)}},flattenlayer:{label:l("%Flatten Layers"),callback:function(){this.flattenLayers()}},duplicatelayer:{label:l("%Duplicate Layer"),callback:function(){this.duplicateLayer()}},deletelayer:{label:l("%Delete Layer"),callback:function(){this.deleteLayer()}}};
|
|
picozu.SWATCHES_CONTEXTMENU_DEFS={addswatch:{label:l("%Add Custom Swatch"),callback:function(a,c){"undefined"!==typeof c&&null!==c&&this.addCustomSwatch($(a+'[data-mid="'+c+'"]').data("color"))}},separator:"",exportswatch:{label:l("%Export Swatches"),callback:function(){this.openWindow("colorpalette")}}};
|
|
picozu.IMAGE_SWATCHES_CONTEXTMENU_DEFS={addIswatch:{label:l("%Add Custom Swatch"),callback:function(a,c){"undefined"!==typeof c&&null!==c&&this.addCustomSwatch($(a+'[data-mid="'+c+'"]').data("color"))}},separator:"",exportIswatch:{label:l("%Export Image Swatches"),callback:function(){this.heap.paletteExport="image";this.openWindow("colorpalette")}}};
|
|
picozu.CUSTOM_SWATCHES_CONTEXTMENU_DEFS={exportCswatch:{label:l("%Export Custom Swatches"),callback:function(){this.heap.paletteExport="custom";this.openWindow("colorpalette")}},deleteCswatch:{label:l("%Clear Custom Swatches"),callback:function(){this.clearCustomSwatches()}}};
|
|
picozu.LAYERS_CONTEXTMENU_DEFS={Lnewlayer:{label:l("%New Layer"),callback:function(){this.newLayer()}},Lcopylayer:{label:l("%Copy to Clipboard"),callback:function(){this.copyClipboard(!0)}},Lflattenlayer:{label:l("%Flatten Layers"),callback:function(){this.flattenLayers(!0)}},Lduplicatelayer:{label:l("%Duplicate Layer"),callback:function(a,c){var b=$(a+'[data-mid="'+c+'"]').data("lid");this.duplicateLayer(b)}},Ldeletelayer:{label:l("%Delete Layer"),callback:function(a,c){var b=$(a+'[data-mid="'+c+
|
|
'"]').data("lid");this.deleteLayer(b)}}};
|
|
picozu.MAIN_PROPBAR_PANELS.push({handle:"layer",name:l("%Layer"),onCreate:function(){var a=this.getWorkspace();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="linfo"></div>'}).addElement({type:picozu.CONTROL_HTML,template:'<div class="linfocontainer"><div title="'+l("%The type of the selected layer")+'" class="tipse linfotype"></div></div><span class="linfoabout"></span><input type="text" title="'+l("%tips.layer.name")+'" maxlength="20" id="pz-layer-name" class="tips pico-textinput linfoname" />'},".linfo").addElement({type:picozu.CONTROL_LEFTRIGHT,
|
|
legendClass:"linfolpac",controlClass:"linfolpacvalue",legend:l("%Opacity"),value:10,size:3,minValue:0,tip:l("%Opacity of the layer"),maxValue:10,handle:"pz-layer-opacity",callback:function(a){this.getSelectedLayer().setOpacity(a,!0)}},".linfo").addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_SELECT,legendClass:"linfoblend",controlClass:"linfoblend",legend:l("%Blend Mode"),handle:"pz-layer-blend",tip:l("%Layer blend mode"),data:picozu.DEFAULT_BLEND_MODES,callback:function(a){this.applyBlend(!1,
|
|
{blendMode:a})}}).addElement({type:picozu.CONTROL_HTML,template:'<div class="linfotext"></div>'}).addElement({type:picozu.CONTROL_SEPARATOR},".linfotext").addElement({type:picozu.CONTROL_TEXTINPUT,legend:l("%Text"),cssClass:"linfotextvalue",handle:"pz-layerText",callback:function(a){var b=this.getSelectedLayer();b.getType()===picozu.LAYER_TYPE_TEXT?b.setText(a).drawText():b.getType()===picozu.LAYER_TYPE_TEXTSHAPE&&b.setText(a).drawTextShape()}},".linfotext").addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_HTML,
|
|
template:'<div class="linfopos"></div>'}).addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfoposwlabel",controlClass:"linfoposwvalue",legend:l("%Width"),tip:l("%Width of the layer"),size:4,handle:"pz-layer-width",minValue:1,maxValue:9999,callback:function(a){var b=this.getSelectedLayer();b.resize(a,b.getHeight())}},".linfopos").addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfoposhlabel",controlClass:"linfoposhvalue",legend:l("%Height"),size:4,tip:l("%Height of the layer"),minValue:1,
|
|
maxValue:9999,handle:"pz-layer-height",callback:function(a){var b=this.getSelectedLayer();b.resize(b.getWidth(),a)}},".linfopos").addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfoposxlabel",controlClass:"linfoposxvalue",legend:l("%x"),size:4,minValue:-9999,tip:l("%Left position of the layer"),maxValue:9999,handle:"pz-layer-left",callback:function(a){this.getSelectedLayer().move(a,null,!0)}},".linfopos").addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfoposylabel",controlClass:"linfoposyvalue",
|
|
legend:l("%y"),size:4,minValue:-9999,tip:l("%Top position of the layer"),maxValue:9999,handle:"pz-layer-top",callback:function(a){this.getSelectedLayer().move(null,a,!0)}},".linfopos");$(".pico-panel-layer").on("keyup.picozu","#pz-layer-name",function(c){13===c.keyCode&&(c=$(this).val(),""!==c&&(a.getSelectedLayer().setName(c),a._refreshLayers()))}).on("focusout","#pz-layer-name",function(){var c=$(this).val();""!==c&&(a.getSelectedLayer().setName(c),a._refreshLayers())})}});
|
|
picozu.MAIN_PROPBAR_PANELS.push({handle:"shapes",name:l("%Shapes"),hide:!0,onCreate:function(){var a=this.getWorkspace();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="linfo2"><div class="linfocontainer"><div title="'+l("%Shape Fill Mode")+'" class="tips linfopreview transparent"></div></div><div class="linfopick"><a data-value="transparent" data-id="0" title="'+l("%No fill")+'" class="tips linfopreview transparent"></a><a data-value="normal" data-id="1" title="'+l("%Background color fill")+
|
|
'" class="tips linfopreview bg"></a><a data-value="both" data-id="2" title="'+l("%Both fill")+'" class="tips linfopreview bg"></a></div></div>'}).addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfopac",controlClass:"linfopacvalue",handle:"pz-opacity",property:"opacity",tip:l("%Shape opacity"),legend:l("%Opacity"),value:10,size:3,minValue:0,maxValue:10},".linfo2").addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfoshadowxlabel",controlClass:"linfoshadowxvalue",legend:l("%x"),size:3,
|
|
tip:l("%Left shadow offset"),property:"shadowoX",handle:"pz-shadowoX",minValue:-99,value:0,maxValue:99},".linfo2").addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfoshadowylabel",controlClass:"linfoshadowyvalue",legend:l("%y"),size:3,value:0,tip:l("%Top shadow offset"),property:"shadowoY",handle:"pz-shadowoY",minValue:-99,maxValue:99},".linfo2").addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"linfoblurlabel",controlClass:"linfoblurvalue",legend:l("%Blur"),size:3,minValue:0,value:0,
|
|
tip:l("%settings.blurshadow"),maxValue:99,handle:"pz-shadowBlur",property:"shadowBlur"},".linfo2").addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_HTML,template:'<div class="layerborder"></div>'}).addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"layerborderlabel",controlClass:"layerbordervalue",legend:l("%Border"),value:1,size:3,handle:"pz-border",property:"border",minValue:0,tip:l("%Border width size"),maxValue:100},".layerborder").addElement({type:picozu.CONTROL_SLIDER,
|
|
legend:l("%panel.shape.radius"),handle:"pp-shapeRadius",property:"shapeRadius",value:10,minValue:1,maxValue:100});$(".pico-panel-shapes").on("click",".linfo2 .linfopreview",function(){$(this).parent().parent().children(".linfopick").fadeToggle()}).on("click",".linfo2 .linfopick a",function(){$(this).parent(".linfopick").fadeToggle();var c=parseInt($(this).data("id")),b=$(this).data("value");$(this).parent().parent().children(".linfopreview").addClass(b);3===c?a.openWindow("gradient"):a.setParam("drawMode",
|
|
c)})}});
|
|
picozu.MAIN_PROPBAR_PANELS.push({handle:"font",name:l("%Fonts"),hide:!0,onCreate:function(){this.addElement({type:picozu.CONTROL_HTML,template:'<div class="toolinfo"></div>'}).addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"fontsizelabel",controlClass:"fontsizevalue",legend:l("%panel.size"),property:"fontSize",handle:"pz-fontSize",value:30,tip:l("%Font size"),size:3,minValue:6,maxValue:200,callback:function(a){!1===this.parameters.isCreatingText&&!0===this.getSelectedLayer().isTextLayer()&&this.getSelectedLayer().setParameter("fontSize",
|
|
a)}},".toolinfo").addElement({type:picozu.CONTROL_SELECT,legendClass:"fontfamilylabel",cssClass:"fontfamilyval",legend:l("%panel.font.family"),special:"font",tip:l("%Font family"),handle:"pz-fontFamily",property:"fontFamily",data:picozu.DEFAULT_FONTS,callback:function(a){var c=this;WebFont.load({google:{families:[a]},active:function(){c.getSelectedLayer().setParameter("fontFamily",a)},inactive:function(){}})}},".toolinfo").addElement({type:picozu.CONTROL_BUTTONGRID,controlClass:"textaligninfo",handle:"pz-fontAlign",
|
|
property:"fontAlign",buttons:[{value:"left",selected:!0,tip:l("%Left aligned")},{value:"center",tip:l("%Center aligned")},{value:"right",tip:l("%Right aligned")}],callback:function(a){!1===this.parameters.isCreatingText&&!0===this.getSelectedLayer().isTextLayer()&&this.getSelectedLayer().setParameter("fontAlign",a)}},".toolinfo").addElement({type:picozu.CONTROL_BUTTONGRID_TOGGLE,controlClass:"textstyleinfo",handle:"pz-fontStyle",buttons:[{value:"bold",property:"fontWeight",tip:l("%Bold"),states:["normal",
|
|
"bold"]},{value:"italic",property:"fontStyle",tip:l("%Italic"),states:["normal","italic"]},{value:"underline",property:"fontDecoration",tip:l("%Underlined"),states:["none","underline"]}],callback:function(a,c){!1===this.parameters.isCreatingText&&!0===this.getSelectedLayer().isTextLayer()&&("fontWeight"===c?this.getSelectedLayer().setParameter("fontWeight",a):"fontStyle"===c?this.getSelectedLayer().setParameter("fontStyle",a):"fontDecoration"===c&&this.getSelectedLayer().setParameter("fontDecoration",
|
|
a))}},".toolinfo")}});
|
|
picozu.MAIN_PROPBAR_PANELS.push({name:l("%Pencil / Brush"),hide:!0,handle:"brush",onCreate:function(){var a=this;this.addElement({type:picozu.CONTROL_HTML,template:'<div class="brushinfo"></div>'}).addElement({type:picozu.CONTROL_LEFTRIGHT,legendClass:"brushsizelabel",controlClass:"brushsizevalue",legend:l("%panel.size"),property:"brushSize",handle:"pz-brushSize",value:1,tip:l("%tips.brush.size"),size:3,minValue:1,maxValue:99},".brushinfo").addElement({type:picozu.CONTROL_SELECT,legendClass:"brushtypelabel",
|
|
cssClass:"brushtypeval",legend:l("%panel.type"),handle:"pz-brushType",property:"brushType",data:picozu.DEFAULT_BRUSHES,callback:function(c){a.getWorkspace().doTool(c)}},".brushinfo").addElement({type:picozu.CONTROL_SLIDER,legend:l("%panel.brushes.hardness"),handle:"pp-bhard",property:"brushHardness",value:60,minValue:1,maxValue:100}).addElement({type:picozu.CONTROL_SLIDER,legend:l("%panel.brushes.flow"),property:"brushFlow",handle:"pp-bflow",value:100,minValue:1,maxValue:100}).addElement({type:picozu.CONTROL_SLIDER,
|
|
legend:l("%panel.brushes.tolerance"),property:"fillTolerance",handle:"pp-btolerance",value:30,minValue:10,maxValue:50})}});picozu.MAIN_DOCKBAR_PANELS.push({name:l("%Preview"),handle:"preview",template:'<div class="pico-minimap"><canvas class="canvas"></canvas><div class="selection"></div></div><div id="pico-slider-zoom" class="pico-slider"></div>',onCreate:function(){var a=this;$("#pico-slider-zoom").slider({value:1,min:0.1,max:1.9,step:0.1,slide:function(c,b){a.getWorkspace().getSelectedLayer().setZoom(b.value)}})}});
|
|
picozu.MAIN_DOCKBAR_PANELS.push({name:l("%Layers"),handle:"layers",template:'<ul class="layers-items-list" id="pico-layers-list"></ul>',onCreate:function(){var a=this,c=this.getWorkspace();new picozu.objects.contextmenu({target:".select_layer",parent:c,submenus:picozu.LAYERS_CONTEXTMENU_DEFS});$(".layers-items-list").on("click",".layername",function(){var a=parseInt($(this).data("id"));c.getSelectedTab().layers[a].select();c._refreshLayers()}).on("click",".groupstatus",function(){var b=parseInt($(this).data("id"));
|
|
$(this).toggleClass("hidden").toggleClass("visible");for(var d=1;d<c.getSelectedTab().layers.length;d++)c.getSelectedTab().layers[d].getGroup()===b&&a.getWorkspace().getSelectedTab().layers[d].toggleVisibility()}).on("click",".groupmode",function(){var a=parseInt($(this).data("id"));$(this).toggleClass("locked");for(var d=1;d<c.getSelectedTab().layers.length;d++)c.getSelectedTab().layers[d].getGroup()===a&&c.getSelectedTab().layers[d].toggleLock()}).on("click",".layerstatus",function(){var a=parseInt($(this).data("id"));
|
|
$(this).toggleClass("hidden").toggleClass("visible");c.getSelectedTab().layers[a].toggleVisibility()}).on("click",".layermode",function(){var a=parseInt($(this).data("id"));$(this).toggleClass("locked");c.getSelectedTab().layers[a].toggleLock()});$(".layers-items-list").sortable({axis:"y",items:".select_layer",opacity:0.4,update:function(){var a=$(".layers-items-list").sortable("toArray");c._reorderLayers(a)}})}});
|
|
picozu.MAIN_DOCKBAR_PANELS.push({name:l("%Info"),handle:"info",template:'<div class="panel"><div class="box tips" title="'+l("%tips.rgb")+'"><div>R: <span class="info-red"></span></div><div>G: <span class="info-green"></span></div><div>B: <span class="info-blue"></span></div><div>#: <span class="info-hex"></span></div></div><div class="box tips" title="'+l("%tips.cmyk")+'"><div>C: <span class="info-cyan"></span></div><div>M: <span class="info-magenta"></span></div><div>Y: <span class="info-yellow"></span></div><div>K: <span class="info-black"></span></div></div><div class="box"><div>X: <span class="info-left"></span></div><div>Y: <span class="info-top"></span></div><div>W: <span class="info-width"></span></div><div>H: <span class="info-height"></span></div></div></div><hr /><div class="panel infoPos"><div class="box tips" title="'+
|
|
l("%tips.hsv")+'"><div>H: <span class="info-hue"></span></div><div>S: <span class="info-sat"></span></div><div>V: <span class="info-value"></span></div></div><div class="box tips" title="'+l("%tips.xyz")+'"><div>X: <span class="info-x"></span></div><div>Y: <span class="info-y"></span></div><div>Z: <span class="info-z"></span></div></div><div class="box tips" title="'+l("%tips.lab")+'"><div>L: <span class="info-l"></span></div><div>a: <span class="info-a"></span></div><div>b: <span class="info-b"></span></div></div></div>'});
|
|
picozu.DEBUGGER_PROPBAR.push({handle:"debugger",name:l("%Debugger"),onCreate:function(){this.addElement({type:picozu.CONTROL_HTML,template:'<ul class="pico-debug-list"></ul>'});$(".pico-panel-debugger").on("click",".ticket",function(){self.getWorkspace().openWindow("support");return!1})}});
|
|
picozu.WINDOWS.push({name:l("%Extensions"),handle:"extensions",center:!0,width:650,template:'<div class="tabs"><ul><li><a href="#tab-plugins">'+l("%Plugins")+'</a></li><li><a href="#tab-themes">'+l("%Themes")+'</a></li><li><a href="#tab-filters">'+l("%Filters")+'</a></li></ul><div id="tab-plugins" class="clearfix"><div class="pico-plugins-list"></div><div class="pico-plugins-info"></div></div><div id="tab-themes" class="clearfix"><div class="pico-themes-list"></div><div class="pico-themes-info"></div></div><div id="tab-filters" class="clearfix"><div class="pico-filters-list"></div><div class="pico-filters-info"></div></div></div>',
|
|
onCreate:function(){var a="",c=this.getElementId(),b=this.getWorkspace();this.addFooter("");$(c+" footer").hide();$(c+" .tabs").tabs({activate:function(){$(c+" footer").empty().hide()}});for(var d=0;d<picozu.AVAILABLE_PLUGINS.length;d++){var e=b.getPlugin(picozu.AVAILABLE_PLUGINS[d]);e&&1===b.getCapability(e.parameters.handle,picozu.SCOPE_APP)&&(a+='<div data-handle="'+picozu.AVAILABLE_PLUGINS[d]+'" class="pico-plugin-item"><img src="'+picozu.DEFAULT_PLUGINS_PATH+e.parameters.handle+'/icon.png" /><div class="title">'+
|
|
e.parameters.title+"</div></div>")}$(c+" .pico-plugins-list").append(a);a="";for(d=0;d<picozu.AVAILABLE_THEMES.length;d++)1===b.getCapability(picozu.AVAILABLE_THEMES[d].handle,picozu.SCOPE_APP)&&(a+='<div data-id="'+d+'" data-handle="'+picozu.AVAILABLE_THEMES[d].handle+'" class="pico-theme-item"><img src="'+picozu.DEFAULT_PATH+'images/gui/theme.png" /><div class="title">'+picozu.AVAILABLE_THEMES[d].name+"</div></div>");$(c+" .pico-themes-list").append(a);a="";for(d=0;d<picozu.AVAILABLE_FILTER_PACKS.length;d++)a+=
|
|
'<div data-id="'+d+'" data-handle="'+picozu.AVAILABLE_FILTER_PACKS[d].handle+'" class="pico-filter-item"><img src="'+picozu.DEFAULT_PATH+'images/gui/filterpack.png" /><div class="title">'+picozu.AVAILABLE_FILTER_PACKS[d].name+"</div></div>";$(c+" .pico-filters-list").append(a);$(c).on("click",".pico-theme-item",function(){var a=$(this).data("id"),d=$(this).data("handle");$(".pico-themes-list").addClass("hasinfo");$(".pico-theme-item").removeClass("selected");$(this).addClass("selected");$(".pico-themes-info").empty().append('<div class="clearfix"><div class="title"></div></div><fieldset><legend>'+
|
|
l("%Author")+'</legend><div class="email"></div><div class="url"></div></fieldset><fieldset><legend>'+l("%Description")+'</legend><div class="description"></div></fieldset>');$(".pico-themes-info .title").html(picozu.AVAILABLE_THEMES[a].name);$(".pico-themes-info .email").html('<a href="mailto:'+picozu.AVAILABLE_THEMES[a].email+'" target="_blank">'+picozu.AVAILABLE_THEMES[a].author+"</a>");$(".pico-themes-info .url").html('<a href="http://'+picozu.AVAILABLE_THEMES[a].url+'" target="_blank">'+picozu.AVAILABLE_THEMES[a].url+
|
|
"</a>");$(".pico-themes-info .description").html(picozu.AVAILABLE_THEMES[a].description);$(c+" .pico-themes-info").show();b.getSetting("theme")!==d?$(c+" footer").empty().append('<a href="#" data-handle="'+d+'" class="pico-button pico-theme-activate ok-btn">'+l("%Activate")+"</a>").show():$(c+" footer").empty().hide();return!1}).on("click",".pico-filter-item",function(){var a=$(this).data("id");$(this).data("handle");$(".pico-filters-list").addClass("hasinfo");$(".pico-filter-item").removeClass("selected");
|
|
$(this).addClass("selected");$(".pico-filters-info").empty().append('<div class="clearfix"><div class="title"></div></div><fieldset><legend>'+l("%Author")+'</legend><div class="email"></div><div class="url"></div></fieldset><fieldset><legend>'+l("%Description")+'</legend><div class="description"></div></fieldset>');$(".pico-filters-info .title").html(picozu.AVAILABLE_FILTER_PACKS[a].name);$(".pico-filters-info .email").html('<a href="mailto:'+picozu.AVAILABLE_FILTER_PACKS[a].email+'" target="_blank">'+
|
|
picozu.AVAILABLE_FILTER_PACKS[a].author+"</a>");$(".pico-filters-info .url").html('<a href="http://'+picozu.AVAILABLE_FILTER_PACKS[a].url+'" target="_blank">'+picozu.AVAILABLE_FILTER_PACKS[a].url+"</a>");$(".pico-filters-info .description").html(picozu.AVAILABLE_FILTER_PACKS[a].description);$(c+" .pico-filters-info").show();return!1}).on("click",".pico-plugin-item",function(){$(".pico-plugins-list").addClass("hasinfo");$(".pico-plugins-info").empty();$(".pico-plugin-item").removeClass("selected");
|
|
$(this).addClass("selected");var a=$(this).data("handle"),d=b.getPlugin(a);if(d){$(".pico-plugins-info").append('<div class="clearfix"><div class="title"></div><div class="version"></div></div><fieldset><legend>'+l("%Author")+'</legend><div class="email"></div><div class="url"></div></fieldset><fieldset class="depends"><legend>'+l("%Dependencies")+'</legend><ul></ul></fieldset><fieldset class="requires"><legend>'+l("%Requirements")+"</legend><ul></ul></fieldset><fieldset><legend>"+l("%Description")+
|
|
'</legend><div class="description"></div></fieldset>');$(".pico-plugins-info .title").html(d.parameters.title);$(".pico-plugins-info .version").html(d.parameters.version);$(".pico-plugins-info .email").html('<a href="mailto:'+d.parameters.email+'" target="_blank">'+d.parameters.email+"</a>");$(".pico-plugins-info .url").html('<a href="http://'+d.parameters.url+'" target="_blank">'+d.parameters.url+"</a>");$(".pico-plugins-info .description").html(d.parameters.description);if("undefined"!==typeof d.parameters.depends&&
|
|
null!==d.parameters.depends){for(var e=0;e<d.parameters.depends.length;e++)$(c+" fieldset.depends ul").append("<li>"+d.parameters.depends[e].capitalize()+"</li>");$(c+" fieldset.depends").show()}else $(c+" fieldset.depends").hide();if("undefined"!==typeof d.parameters.requires&&null!==d.parameters.requires){for(e=0;e<d.parameters.requires.length;e++)$(c+" fieldset.requires ul").append("<li>"+d.parameters.requires[e].capitalize()+"</li>");$(c+" fieldset.requires").show()}else $(c+" fieldset.requires").hide();
|
|
!1===b.pluginIsInstalled(a)?$(c+" footer").empty().append('<a href="#" data-handle="'+a+'" class="pico-button pico-plugin-install ok-btn">'+l("%Install")+"</a> ").show():($(c+" footer").empty().append('<a href="#" data-handle="'+a+'" class="pico-button pico-plugin-uninstall gui-btn cancel-btn">'+l("%Uninstall")+"</a> ").show(),!0===b.pluginIsEnabled(a)?$(c+" footer").append('<a href="#" data-handle="'+a+'" class="pico-button pico-plugin-disable ok-btn">'+l("%Disable")+"</a>").show():
|
|
$(c+" footer").append('<a href="#" data-handle="'+a+'" class="pico-button pico-plugin-enable ok-btn">'+l("%Enable")+"</a>").show());$(c+" .pico-plugins-info").show()}return!1}).on("click",".pico-theme-activate",function(){var a=$(this).data("handle");b.loadTheme(a);$(c+" footer").empty().hide();return!1}).on("click",".pico-theme-item",function(){$(".pico-theme-item").removeClass("selected");$(this).addClass("selected");return!1}).on("click",".pico-plugin-install",function(){var a=$(this).data("handle");
|
|
"object"===typeof b.loadPlugin(a)&&$(c+" footer").empty().append('<a href="#" data-handle="'+a+'" class="pico-button pico-plugin-uninstall gui-btn cancel-btn">'+l("%Uninstall")+'</a> <a href="#" data-handle="'+a+'" class="pico-button pico-plugin-enable ok-btn">'+l("%Enable")+"</a>").show();return!1}).on("click",".pico-plugin-uninstall",function(){var a=$(this).data("handle");b.unloadPlugin(a);$(c+" footer").empty().append('<a href="#" data-handle="'+a+'" class="pico-button pico-plugin-install ok-btn">Install</a>').show();
|
|
return!1}).on("click",".pico-plugin-enable",function(){var a=$(this).data("handle");b.getPlugin(a).enable();$(c+" footer").empty().append('<a href="#" data-handle="'+a+'" class="pico-button pico-plugin-uninstall gui-btn cancel-btn">'+l("%Uninstall")+'</a> <a href="#" data-handle="'+a+'" class="pico-button pico-plugin-disable ok-btn">'+l("%Disable")+"</a>").show();return!1}).on("click",".pico-plugin-disable",function(){var a=$(this).data("handle");b.getPlugin(a).disable();$(c+" footer").empty().append('<a href="#" data-handle="'+
|
|
a+'" class="pico-button pico-plugin-uninstall gui-btn cancel-btn">'+l("%Uninstall")+'</a> <a href="#" data-handle="'+a+'" class="pico-button pico-plugin-enable ok-btn">'+l("%Enable")+"</a>").show();return!1})}});
|
|
picozu.WINDOWS.push({name:l("%Save Image"),handle:"saveimage",width:500,modal:!0,onCreate:function(){var a=this,c=this.getElementId();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="column1"></div><div class="column2"><img src="'+picozu.DEFAULT_PATH+'images/windows/save/splash.png" /></div>'}).addElement({type:picozu.CONTROL_HTML,template:"<p>"+l("%saveimage.text1")+"</p><br /><p>"+l("%saveimage.text2")+"</p>"},".column1").addElement({type:picozu.CONTROL_SEPARATOR},".column1").addElement({type:picozu.CONTROL_SELECT,
|
|
legend:l("%main.saveas"),handle:"pico-save-as",legendClass:"legend",data:picozu.DEFAULT_EXPORTERS,callback:function(b){$(c+" .expSettings").empty();b=picozu.DEFAULT_EXPORTERS.findIndexM(parseInt(b));if(!1!==b&&(b=picozu.DEFAULT_EXPORTERS[b],"undefined"!==typeof b.settings))for(var d=0;d<b.settings.length;d++)a.addElement(b.settings[d],".expSettings")}},".column1").addElement({type:picozu.CONTROL_HTML,template:'<form class="expSettings"></form>'},".column1").addFooter(picozu.DEFAULT_WINDOW_FOOTER)},
|
|
onApply:function(){var a=this.getWorkspace();a.getSelectedTab()._refreshPreview();a.exportData(this.getIntValue("#pico-save-as"),function(c,b,d,e){if(!0===a.isOnline())if("object"===typeof c)for(var f=0;f<c.length;f++)a.showLoader(),$("#pico-save-iframe-"+b[f]).remove(),$(".picozu").append('<iframe class="pico-iframe" id="pico-save-iframe-'+b[f]+'" src=""></iframe>'),a.doRequest(picozu.API_CONVERT,"contents="+c[f]+"&format="+b[f]+"&title="+d[f]+("undefined"!==typeof e&&""!=e?"&"+e:""),function(a){$("#pico-save-iframe-"+
|
|
a.format).attr("src",picozu.API_RETRIEVE+"?temp=1&file="+a.code+"&format="+a.format+"&title="+a.title)},null,"json");else $(".pico-iframe").remove(),$(".picozu").append('<iframe class="pico-iframe" src=""></iframe>'),a.doRequest(picozu.API_CONVERT,"contents="+c+"&format="+b+("undefined"!==typeof e&&""!=e?"&"+e:""),function(a){$(".pico-iframe").attr("src",picozu.API_RETRIEVE+"?temp=1&file="+a.code+"&format="+a.format+"&title="+d);parent.postMessage(a,"*")},null,"json");else!1===a.isOnline()&&("png"==
|
|
b||"jpg"==b)?(window.open("about:blank","Picozu Image Editor").document.write("<img src='"+c+"' alt='from canvas'/>"),a.hideLoader()):(a.hideLoader(),a.notify(l("%main.offline"),!0))},$("form.expSettings").serializeArray())}});
|
|
picozu.WINDOWS.push({name:l("%Color"),handle:"color",left:110,top:10,width:320,template:'<div class="pico-color-picker"></div>',onCreate:function(){var a=this,c=this.getWorkspace(),b=c.getParam("foregroundColor"),d=this.getElementId();a.heap.color=b;$(d+" .pico-color-picker").colorPicker({color:b,onColorChange:function(b){a.heap.color=b;$(".pico-window-color footer .color").css({"background-color":Color.color2Exp("rgb",b)});$(d+" footer .pico-textfield").val(Color.rgb2hex(b));c.updateInfoPanel({rgb:b})}});
|
|
this.addFooter(picozu.CONTROL_COLORSELECT_HTML.replace(/{rgbColor}/g,Color.color2Exp("rgb",b)).replace(/{hexColor}/g,Color.rgb2hex("rgb",b)));$(d).on("keyup.picozu","footer .pico-textfield",function(){var c=$(this).val();/(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(c)?(a.heap.color=Color.hex2rgb(c),$(d+" footer .color").css({"background-color":Color.color2Exp("rgb",a.heap.color)}),$(this).removeClass("error")):$(this).addClass("error")})},onApply:function(){this.getWorkspace().setParam("foregroundColor",
|
|
this.heap.color)}});
|
|
picozu.WINDOWS.push({name:l("%Rename Image"),handle:"renameimage",modal:!0,width:270,onCreate:function(){var a=this.getElementId();this.addElement({type:picozu.CONTROL_TEXTINPUT,legend:l("%Name"),handle:"tabname",value:this.getWorkspace().getSelectedTab().getName(),cssClass:"tabname",max:20,tips:l("%rename.tab.tip")}).addFooter(picozu.DEFAULT_WINDOW_FOOTER);$(a).on("keyup.picozu",".tabname",function(c){13===c.keyCode&&($(a+" .accept-button").trigger("click"),$(this).blur());return!1})},onApply:function(){var a=
|
|
this.getStrValue(".tabname").replace(/^\s\s*/,"").replace(/\s\s*$/,""),c=this.getWorkspace();2<a.length&&21>a.length?c.getSelectedTab().setName(a):c.notify(l("%main.invalidtabname"),!0)}});
|
|
picozu.WINDOWS.push({name:l("%main.cloudexport.title"),handle:"exportcloud",width:420,center:!0,onCreate:function(){var a=this,c=this.getWorkspace(),b=this.getElementId();this.addElement({type:picozu.CONTROL_IMAGE,image:picozu.DEFAULT_PATH+"images/windows/exportcloud/splash.png"}).addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_TEXTINPUT,legend:l("%main.title"),handle:"pz-cloudsave-title",legendClass:"legend",cssClass:"title"}).addElement({type:picozu.CONTROL_TEXTAREA,
|
|
legend:l("%Description"),handle:"pz-cloudsave-description",legendClass:"legend",cssClass:"description"}).addElement({type:picozu.CONTROL_SELECT,legend:l("%visibility"),handle:"pz-cloudsave-vis",legendClass:"legend",data:picozu.DEFAULT_VISIBILITY,cssClass:"visibility"}).addElement({type:picozu.CONTROL_SELECT,legend:l("%main.saveas"),handle:"pico-save-as",legendClass:"legend",data:picozu.DEFAULT_EXPORTERS,callback:function(c){$(b+" .expSettings").empty();c=picozu.DEFAULT_EXPORTERS.findIndexM(parseInt(c));
|
|
if(!1!==c&&(c=picozu.DEFAULT_EXPORTERS[c],"undefined"!==typeof c.settings))for(var e=0;e<c.settings.length;e++)a.addElement(c.settings[e],".expSettings")}}).addElement({type:picozu.CONTROL_HTML,template:'<form class="expSettings"></form>'});!0!==c.isLoggedIn()?c.notify(l("%main.cloud.notloggedin"),!0):this.addFooter(picozu.DEFAULT_WINDOW_FOOTER)},onApply:function(){var a=this.getWorkspace();a.getSelectedTab()._refreshPreview();var c=this.getStrValue(".title"),b=this.getStrValue(".description"),d=
|
|
this.getIntValue(".visibility");a.exportData(this.getIntValue("#pico-save-as"),function(e,f,g,h){if(!0===a.isOnline())if(a.showLoader(),"object"===typeof e)for(g=0;g<e.length;g++)a.doRequest(picozu.API_SAVE,"contents="+e[g]+"&format="+f[g]+("undefined"!==typeof h&&""!=h?"&"+h:""),function(){a.notify(l("%main.cloud.savesuccess"))},function(){a.notify(l("%main.cloud.saveerror"),!0)},"json");else a.doRequest(picozu.API_SAVE,"contents="+e+"&format="+f+"&title="+c+"&description="+b+"&visibility="+d+("undefined"!==
|
|
typeof h&&""!=h?"&"+h:""),function(){a.notify(l("%main.cloud.savesuccess"))},function(){a.notify(l("%main.cloud.saveerror"),!0)},"json");else a.hideLoader(),a.notify(l("%main.offline"),!0)},$("form.expSettings").serializeArray())}});
|
|
picozu.WINDOWS.push({name:l("%main.cloudimport.title"),handle:"importcloud",width:545,center:!0,template:'<div class="pico-cloud-list photolist clearfix"><ul class="photolist"><li class="noresults">'+l("%main.noimages")+'</li></ul></div><ul class="pico-cloud-pager pagination"></ul>',onCreate:function(){var a=this,c=this.getElementId(),b=this.getWorkspace();!0!==b.isLoggedIn()&&b.notify(l("%main.cloud.notloggedin"),!0);this.addFooter(picozu.BROWSER_WINDOW_FOOTER);this.helper={page:1,imagesCount:0,
|
|
images:[],results:15,getAll:function(a){var c=this;"prev"===a?this.page--:"next"===a?this.page++:this.page="undefined"===typeof a?1:a;b.doRequest(picozu.API_IMAGES,null,function(a){b.isErrorRequest(a)||(c.images=a.images,c.imagesCount=a.total,c._process())},function(){},"json")},_process:function(){var a="",c=(this.page-1)*this.results,f=this.results*this.page;$(".pico-cloud-list ul.photolist").empty();if(0<this.images.length)for(var g=0;g<this.images.length;g++)a+=this.photoCallback(this.images[g],
|
|
!(g>=c&&g<f));else a+='<li class="noresults">'+l("%main.noimages")+"</li>";b.paginate(Math.ceil(this.images.length/this.results),this.page,".pico-cloud-pager");$(".pico-cloud-list ul.photolist").append(a);b.hideLoader()},photoCallback:function(a,c){var b;c||(b="pzw"===a.ext||"pzi"===a.ext?'<li><a href="'+a.orig+'"><img src="'+picozu.DEFAULT_PATH+'images/logos/icon_128x128.png" /></a><span class="imageName">'+a.title+"</span></li>":'<li><a href="'+a.orig+'"><img src="'+a.thumb+'" /></a><span class="imageName">'+
|
|
a.title+"</span></li>");return b}};this.helper.getAll();$(c).on("click",".pico-cloud-list ul li a",function(){a.hide();var c=$(this).attr("href");(new picozu.objects.tab({parent:b,image:c})).activate();return!1}).on("click",".reload",function(){b.showLoader();a.helper.getAll()}).on("click",".pico-cloud-pager a",function(){$(this).parent("li").hasClass("next")?a.helper.getAll("next"):$(this).parent("li").hasClass("prev")?a.helper.getAll("prev"):a.helper.getAll(parseInt($(this).text()));return!1})}});
|
|
picozu.WINDOWS.push({name:l("%Account"),center:!0,width:460,handle:"account",template:'<div class="account-tab login-panel"><div class="tabs"><ul><li><a href="#tab-login">'+l("%signin")+'</a></li><li><a href="#tab-register">'+l("%signup")+'</a></li><li><a href="#tab-recover">'+l("%recover.account")+'</a></li></ul><div id="tab-login"><fieldset><label>'+l("%Username")+'</label><input type="text" class="pico-textinput log-username" /></fieldset><fieldset><label>'+l("%Password")+'</label><input type="password" class="pico-textinput log-pass" /></fieldset><hr /><input type="button" class="pico-button ok-btn login" value="'+
|
|
l("%signin")+'" /></div><div id="tab-register"><fieldset><label>'+l("%Username")+'</label><input type="text" class="pico-textinput reg-username" /></fieldset><fieldset><label>'+l("%E-mail")+'</label><input type="text" class="pico-textinput reg-email" /></fieldset><fieldset><label>'+l("%Password")+'</label><input type="password" class="pico-textinput reg-pass" /></fieldset><fieldset><label>'+l("%Confirm Password")+'</label><input type="password" class="pico-textinput reg-pass2" /></fieldset><fieldset><label>'+
|
|
l("%Full Name")+'</label><input type="text" class="pico-textinput reg-fullname" /></fieldset><fieldset><label>'+l("%I agree to")+'<a target="_blank" href="'+picozu.API_ENTRY_POINT+'support/terms-and-conditions">'+l("%Picozu Terms of Service")+'</a></label><input type="checkbox" class="pico-checkbox reg-terms" checked="checked" value="true" /></fieldset><hr /><input type="button" class="pico-button ok-btn register" value="'+l("%signup")+'" /></div><div id="tab-recover"><fieldset><label>'+l("%Username")+
|
|
'</label><input type="text" class="pico-textinput rec-username" /></fieldset><hr /><input type="button" class="pico-button ok-btn recover" value="'+l("%recover")+'" /></div></div></div><div class="account-tab profile-panel"><img class="prof-avatar" src="'+picozu.DEFAULT_PATH+'images/gui/avatar.jpg" /><fieldset><label>'+l("%Username")+'</label><input type="text" readonly class="pico-textinput prof-username" /></fieldset><fieldset><label>'+l("%E-mail")+'</label><input type="text" readonly class="pico-textinput prof-email" /></fieldset><fieldset><label>'+
|
|
l("%Full Name")+'</label><input type="text" class="pico-textinput prof-fullname" /></fieldset><hr /><p>Only enter a password if you would like to change your current one.</p><fieldset><label>'+l("%Password")+'</label><input type="password" class="pico-textinput prof-pass" /></fieldset><fieldset><label>'+l("%Confirm Password")+'</label><input type="password" class="pico-textinput prof-pass2" /></fieldset></div>',onShow:function(){var a=this.getWorkspace(),c=this,b=this.getElementId();$(b+" .tabs").tabs();
|
|
!1!==a.getAccount()?(this.setValue(".prof-username",a.account.username).setValue(".prof-email",a.account.email).setValue(".prof-fullname",a.account.nickname).addFooter('<input type="button" class="pico-button ok-btn update" value="'+l("%main.save")+'" /> <input type="button" class="pico-button ok-btn logout" value="'+l("%signout")+'" />'),$(".prof-avatar").attr("src",a.account.avatar),$(".account-tab.profile-panel").show()):(this.addFooter(""),$(b+" footer").hide(),$(".account-tab.login-panel").show());
|
|
$(b).on("click",".login",function(){a.login({username:c.getValue(".log-username"),password:c.getValue(".log-pass")})}).on("click",".recover",function(){a.recover({username:c.getValue(".rec-username")})}).on("click",".update",function(){a.updateProfile({fullname:c.getValue(".prof-fullname"),email:c.getValue(".prof-email"),password:c.getValue(".prof-pass"),password2:c.getValue(".prof-pass2")})}).on("click",".register",function(){!0===c.getBoolValue(".reg-terms")?a.register({username:c.getValue(".reg-username"),
|
|
fullname:c.getValue(".reg-fullname"),email:c.getValue(".reg-email"),password:c.getValue(".reg-pass"),password2:c.getValue(".reg-pass2")}):a.notify(l("%register.terms"),!0)}).on("click",".logout",function(){a.logout()}).on("keyup.picozu",".log-username, .log-pass",function(a){13===a.keyCode&&($(b+" .login").trigger("click"),$(this).blur());return!1}).on("keyup.picozu",".rec-username, .rec-email",function(a){13===a.keyCode&&($(b+" .recover").trigger("click"),$(this).blur());return!1}).on("keyup.picozu",
|
|
".reg-username, .reg-email, .reg-pass, .reg-pass2",function(a){13===a.keyCode&&($(b+" .register").trigger("click"),$(this).blur());return!1})}});
|
|
picozu.WINDOWS.push({name:l("%Filters"),center:!0,handle:"filters",template:'<div class="clearfix"><div class="sidebar"><ul></ul></div><div class="main"><div class="intro"></div><div class="enter"><div class="clearfix"><div class="previewbox nosetup"><canvas id="filter-preview"></canvas></div><div class="filtersetup"></div></div><hr /><div class="preview-filter-list"><ul></ul></div></div></div></div>',onCreate:function(){for(var a=this,c=this.getElementId(),b=this.getWorkspace(),d=0;d<picozu.FILTERS.length;d++)$(c+
|
|
" .sidebar > ul").append('<li><a data-cid="'+d+'" href="#">'+picozu.FILTERS[d].name+"</a></li>");$(c).on("click",".sidebar ul li a",function(){var a=$(this).data("cid"),b="";$(c+" .main .intro").hide();$(c+" .main .enter").show();$(c+" .sidebar ul li").removeClass("selected");$(this).parent("li").addClass("selected");for(var d=0;d<picozu.FILTERS[a].filters.length;d++)if("undefined"===typeof picozu.FILTERS[a].filters[d].hidden||!1===picozu.FILTERS[a].filters[d].hidden)b+='<li><a style="background: #fff url('+
|
|
picozu.DEFAULT_PATH+"images/filter-previews/"+picozu.FILTERS[a].filters[d].filter+'.jpg) no-repeat center center" class="filter" data-filter="'+picozu.FILTERS[a].filters[d].filter+'" href="#"><span>'+picozu.FILTERS[a].filters[d].name+"</span></a></li>";$(c+" .preview-filter-list ul").empty().append(b);$(c+" .filtersetup").empty();return!1}).on("click",".preview-filter-list ul li a",function(){b.clearQueue();var d=$(this).data("filter"),f=b.getFilter(d);b.heap.currentFilter=d;$(c+" .filtersetup").empty();
|
|
if("undefined"!==typeof f.settings){for(var g=0;g<f.settings.length;g++)a.addElement({type:f.settings[g].type,legend:"undefined"!==typeof f.settings[g].name?f.settings[g].name:null,handle:"pico-fc-"+("undefined"!==typeof f.settings[g].name?f.settings[g].name:"").replace(/ /g,"-").toLowerCase(),value:"undefined"!==typeof f.settings[g].value?f.settings[g].value:0,title:"undefined"!==typeof f.settings[g].title?f.settings[g].title:null,data:"undefined"!==typeof f.settings[g].data?f.settings[g].data:null,
|
|
property:"undefined"!==typeof f.settings[g].property?f.settings[g].property:null,options:"undefined"!==typeof f.settings[g].options?f.settings[g].options:null,step:"undefined"!==typeof f.settings[g].step?f.settings[g].step:1,minValue:"undefined"!==typeof f.settings[g].min?f.settings[g].min:-100,maxValue:"undefined"!==typeof f.settings[g].max?f.settings[g].max:100,onStop:function(){b._refreshFilterPreview(d)},callback:function(){b._refreshFilterPreview(d)},legend1:"undefined"!==typeof f.settings[g].name1?
|
|
f.settings[g].name1:null,handle1:"pico-fc-"+("undefined"!==typeof f.settings[g].name1?f.settings[g].name1:"").replace(/ /g,"-").toLowerCase(),value1:"undefined"!==typeof f.settings[g].value1?f.settings[g].value1:0,property1:"undefined"!==typeof f.settings[g].property1?f.settings[g].property1:null,step1:"undefined"!==typeof f.settings[g].step1?f.settings[g].step1:1,minValue1:"undefined"!==typeof f.settings[g].min1?f.settings[g].min1:-100,maxValue1:"undefined"!==typeof f.settings[g].max1?f.settings[g].max1:
|
|
100,handle2:"pico-fc-"+("undefined"!==typeof f.settings[g].property2?f.settings[g].property2:"").replace(/ /g,"-").toLowerCase(),value2:"undefined"!==typeof f.settings[g].value2?f.settings[g].value2:0,property2:"undefined"!==typeof f.settings[g].property2?f.settings[g].property2:null,step2:"undefined"!==typeof f.settings[g].step2?f.settings[g].step2:1,minValue2:"undefined"!==typeof f.settings[g].min2?f.settings[g].min2:null,maxValue2:"undefined"!==typeof f.settings[g].max2?f.settings[g].max2:null},
|
|
".filtersetup");$(c+" .previewbox").removeClass("nosetup");$(c+" .filtersetup").show()}else $(c+" .previewbox").addClass("nosetup"),$(c+" .filtersetup").hide();b._refreshFilterPreview(d);return!1});this.addFooter('<input type="button" title="'+l("%window.filters.ok")+'" class="tips pico-button ok-btn accept-button" value="'+l("%main.ok")+'" /> <input title="'+l("%window.filters.apply")+'" type="button" class="tips pico-button ok-btn apply-button" value="'+l("%main.apply")+'" />')},onShow:function(){var a=
|
|
this.getWorkspace();a.getSelectedTab()._refreshPreview();a._refreshFilterPreview()},onApply:function(){var a=this.getWorkspace(),c=a.heap.currentFilter;if(null!==c&&"undefined"!==typeof c){c=a.getFilter(c);if("undefined"!==typeof c.queue)for(var b=0;b<c.queue.length;b++)"undefined"!==typeof c.queue[b].params&&a.configFilter(c.queue[b].params),"undefined"!==typeof c.queue[b].action&&"string"===typeof c.queue[b].action?a.addToQueue(a[c.queue[b].action],!1,c.queue[b].params):"undefined"!==typeof c.queue[b].action&&
|
|
"function"===typeof c.queue[b].action?a.addToQueue(c.queue[b].action,!1,c.queue[b].params):a.addToQueue(c.queue[b].filter,!1,c.queue[b].params);else"undefined"!==typeof c.params&&a.configFilter(c.params),"undefined"!==typeof c.action&&"string"===typeof c.action?a.addToQueue(a[c.action],!1,c.params):"undefined"!==typeof c.action&&"function"===typeof c.action?a.addToQueue(c.action,!1,c.params):a.addToQueue(c.filter,!1,c.params);a.processQueue();a.heap.currentFilter=null}},onDestroy:function(){this.getWorkspace().heap.currentFilter=
|
|
null}});
|
|
picozu.WINDOWS.push({name:l("%Library"),handle:"library",center:!0,template:'<div class="clearfix"><div class="sidebar"><ul></ul></div><div class="main"><div class="enter"><div class="objects-list"><ul></ul></div></div></div></div>',onCreate:function(){for(var a=this.getElementId(),c="",b=this.getWorkspace(),d=0;d<picozu.LIBRARY.length;d++)c+='<li><a data-cid="'+d+'" href="#">'+picozu.LIBRARY[d].name+"</a></li>";$(a+" .sidebar > ul").append(c);$(a).on("click",".sidebar ul li a",function(){var c=$(this).data("cid"),
|
|
b="";$(a+" .sidebar ul li").removeClass("selected");$(this).parent("li").addClass("selected");for(var d=0;d<picozu.LIBRARY[c].objects.length;d++)b+='<li><a style="background: #fff url('+picozu.DEFAULT_PATH+"images/library/"+picozu.LIBRARY[c].objects[d]+'_tb.png) no-repeat center center" class="object" data-object="'+picozu.LIBRARY[c].objects[d]+'" href="#"><span>'+picozu.LIBRARY[c].objects[d]+"</span></a></li>";$(a+" .objects-list ul").empty().append(b);return!1}).on("click",".objects-list ul li a",
|
|
function(){$(a+" .objects-list ul li a").removeClass("selected");$(this).addClass("selected");b.heap.currentLibraryObject=$(this).data("object");return!1});this.addFooter(picozu.DEFAULT_WINDOW_FOOTER)},onApply:function(){var a=this.getWorkspace(),c=a.heap.currentLibraryObject;a.showLoader();var c=picozu.DEFAULT_PATH+"images/library/"+c+".png",b=new Image;b.onload=function(){a.saveUndo();(new picozu.objects.layer({parent:a.getSelectedTab(),left:0,top:0,width:b.width,height:b.height,name:"Object"})).drawImage(b,
|
|
b.width,b.height).select();a._refreshAll();a.hideLoader()};b.onerror=function(){a.notify(l("%main.image.notloaded"),!0).hideLoader()};b.src=c;this.hide()}});
|
|
picozu.WINDOWS.push({name:l("%Resize Image"),handle:"resizeimage",width:270,modal:!0,template:'<img src="'+picozu.DEFAULT_PATH+'images/windows/resize/splash.png" /><hr /><fieldset><label>'+l("%Width")+'</label><select disabled class="medium right width-unit"><option value="0">'+l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small width" /></fieldset><fieldset><label>'+l("%Height")+'</label><select disabled class="medium right height-unit"><option value="0">'+
|
|
l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small height" /></fieldset><fieldset><label>'+l("%Keep Ratio")+'</label><input type="checkbox" class="pico-checkbox ratio" checked /></fieldset>',onShow:function(){var a=this.getWorkspace().getPreviewLayer();this.setIntValue(".width",a.getWidth());this.setIntValue(".height",a.getHeight())},onCreate:function(){var a=this,c=this.getElementId(),b=this.getWorkspace().getPreviewLayer(),d=
|
|
b.getWidth(),b=b.getHeight(),e=d/b;this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);this.setIntValue(".width",d);this.setIntValue(".height",b);$(c).on("keyup.picozu",".width",function(){if($(c+" .ratio").is(":checked")){var b=parseInt($(this).val())/e+0.5|0;a.setIntValue(".height",b)}}).on("keyup.picozu",".height",function(){if($(c+" .ratio").is(":checked")){var b=parseInt($(this).val())*e+0.5|0;a.setIntValue(".width",b)}}).on("change",".ratio",function(){var c=a.getIntValue(".width")/e+0.5|0;a.setIntValue(".height",
|
|
c)}).on("change",".width-unit, .height-unit",function(){var a=parseInt($(this).val());$(c+" select.width-unit, "+c+" select.height-unit").val(a)})},onApply:function(){var a=this.getWorkspace(),c=this.getIntValue(".width"),b=this.getIntValue(".height");if(a.validateImageSize(c)&&a.validateImageSize(b))a.saveUndo().getSelectedTab().resize(c,b);else return a.notify(l("%main.imagesizeerror"),!0),!1}});
|
|
picozu.WINDOWS.push({name:l("%Resize Layer"),handle:"resizelayer",width:270,modal:!0,template:'<img src="'+picozu.DEFAULT_PATH+'images/windows/resize/splash.png" /><hr /><fieldset><label>'+l("%Width")+'</label><select disabled class="medium right width-unit"><option value="0">'+l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small width" /></fieldset><fieldset><label>'+l("%Height")+'</label><select disabled class="medium right height-unit"><option value="0">'+
|
|
l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small height" /></fieldset><fieldset><label>'+l("%Keep Ratio")+'</label><input type="checkbox" class="pico-checkbox ratio" checked /></fieldset>',onShow:function(){var a=this.getWorkspace().getSelectedLayer();this.setIntValue(".width",a.getWidth());this.setIntValue(".height",a.getHeight())},onCreate:function(){var a=this,c=this.getElementId(),b=this.getWorkspace().getSelectedLayer(),
|
|
d=b.getWidth(),b=b.getHeight(),e=d/b;this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);this.setIntValue(".width",d);this.setIntValue(".height",b);$(c).on("keyup.picozu",".width",function(){if($(c+" .ratio").is(":checked")){var b=parseInt($(this).val())/e+0.5|0;a.setIntValue(".height",b)}}).on("keyup.picozu",".height",function(){if($(c+" .ratio").is(":checked")){var b=parseInt($(this).val())*e+0.5|0;a.setIntValue(".width",b)}}).on("change",".ratio",function(){var c=a.getIntValue(".width")/e+0.5|0;a.setIntValue(".height",
|
|
c)}).on("change",".width-unit, .height-unit",function(){var a=parseInt($(this).val());$(c+" select.width-unit, "+c+" select.height-unit").val(a)})},onApply:function(){var a=this.getWorkspace(),c=this.getIntValue(".width"),b=this.getIntValue(".height");if(a.validateImageSize(c)&&a.validateImageSize(b))a.saveUndo().getSelectedLayer().resize(c,b);else return a.notify(l("%main.imagesizeerror"),!0),!1}});
|
|
picozu.WINDOWS.push({name:l("%Import from URL"),handle:"importURL",center:!0,width:400,template:"<p>"+l("%info.importurl")+"</p><hr /><fieldset><label>"+l("%URL")+'</label><input type="text" class="pico-textinput url" placeholder="'+l("%enter image URL")+'" /></fieldset>',onCreate:function(){var a=this,c=this.getWorkspace(),b=this.getElementId();this.addFooter(this.addButton({cssClass:"import",value:l("%Import")}));$(b).on("click",".import",function(){var b=a.getStrValue(".url");""!==b?(c.parseImageFile(b),
|
|
a.setValue(".url",""),a.hide()):c.notify(l("%main.image.specify"),!0);return!1}).on("keyup.picozu",".url",function(a){13===a.keyCode&&$(b+" .import").trigger("click");return!1})}});
|
|
picozu.WINDOWS.push({name:l("%window.canvas.size"),handle:"canvassizeimage",modal:!0,width:270,template:'<img src="'+picozu.DEFAULT_PATH+'images/windows/resize/splash.png" /><hr /><fieldset><label>'+l("%Width")+'</label><select disabled class="medium right width-unit"><option value="0">'+l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small width" /></fieldset><fieldset><label>'+l("%Height")+'</label><select disabled class="medium right height-unit"><option value="0">'+
|
|
l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small height" /></fieldset><fieldset><label>'+l("%Keep Ratio")+'</label><input type="checkbox" class="pico-checkbox ratio" checked /></fieldset>',onShow:function(){var a=this.getWorkspace().getPreviewLayer();this.setIntValue(".width",a.getWidth());this.setIntValue(".height",a.getHeight())},onCreate:function(){var a=this,c=this.getElementId(),b=this.getWorkspace().getPreviewLayer(),d=
|
|
b.getWidth(),b=b.getHeight(),e=d/b;this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);this.setIntValue(".width",d);this.setIntValue(".height",b);$(c).on("keyup.picozu",".width",function(){if($(c+" .ratio").is(":checked")){var b=parseInt($(this).val())/e+0.5|0;a.setIntValue(".height",b)}}).on("keyup.picozu",".height",function(){if($(c+" .ratio").is(":checked")){var b=parseInt($(this).val())*e+0.5|0;a.setIntValue(".width",b)}}).on("change",".ratio",function(){var c=a.getIntValue(".width")/e+0.5|0;a.setIntValue(".height",
|
|
c)}).on("change",".width-unit, .height-unit",function(){var a=parseInt($(this).val());$(c+" select.width-unit, "+c+" select.height-unit").val(a)})},onApply:function(){var a=this.getWorkspace(),c=a.getSelectedTab(),b=this.getIntValue(".width"),d=this.getIntValue(".height");if(a.validateImageSize(b)&&a.validateImageSize(d)){a.saveUndo();c.resize(b,d,!0);for(var e=1;e<c.layers.length;e++){var f=c.layers[e].getWidth(),g=c.layers[e].getHeight();c.layers[e].move(b/2-f/2,d/2-g/2)}a._refreshAll()}else return a.notify(l("%main.imagesizeerror"),
|
|
!0),!1}});
|
|
picozu.WINDOWS.push({name:l("%Sample images"),handle:"sampleimages",center:!0,width:545,template:'<div class="pico-sample-list photolist clearfix"><ul class="photolist"><li class="noresults">'+l("%main.noimages")+'</li></ul></div><hr /><ul class="pico-sample-pager pagination"></ul>',onCreate:function(){var a=this,c=this.getWorkspace(),b=this.getElementId();this.helper={page:1,results:15,getAll:function(a){"prev"===a?this.page--:"next"===a?this.page++:this.page="undefined"===typeof a?1:a;a="";var b=
|
|
picozu.SAMPLE_IMAGES,f=(this.page-1)*this.results,g=this.results*this.page;$(".pico-sample-list ul.photolist").empty();if(0<b)for(var h=0;h<b;h++)a+=this._photoCallback(h,!(h>=f&&h<g));else a+='<li class="noresults">'+l("%main.noimages")+"</li>";c.paginate(Math.ceil(b/this.results),this.page,".pico-sample-pager");$(".pico-sample-list ul.photolist").append(a);c.hideLoader()},_photoCallback:function(a,c){var b="";c||(b='<li><a href="'+picozu.DEFAULT_PATH+"images/samples/"+a+'.jpg"><img src="'+picozu.DEFAULT_PATH+
|
|
"images/samples/"+a+'_tb.jpg" /></a></li>');return b}};this.helper.getAll();$(b).on("click",".photolist ul li a",function(){var b=$(this).attr("href");c.parseImageFile(b);a.hide();return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?a.helper.getAll("next"):$(this).parent("li").hasClass("prev")?a.helper.getAll("prev"):a.helper.getAll(parseInt($(this).text()));return!1})}});
|
|
picozu.WINDOWS.push({name:l("%Image Info"),handle:"imageinfo",center:!0,width:400,template:'<div class="tabs"><ul><li><a href="#tab-info">'+l("%Image")+'</a></li><li><a href="#tab-cam">'+l("%Camera")+'</a></li><li><a href="#tab-adv">'+l("%Advanced")+'</a></li><li><a href="#tab-gps">'+l("%GPS")+'</a></li></ul><section id="tab-info"><fieldset><label>'+l("%Width")+'</label><input type="text" class="ii-PixelXDimension" /></fieldset><fieldset><label>'+l("%Height")+'</label><input type="text" class="ii-PixelYDimension" /></fieldset><fieldset><label>'+
|
|
l("%Color Mode")+'</label><input type="text" class="ii-ColorMode" /></fieldset><fieldset><label>'+l("%Channels")+'</label><input type="text" class="ii-Channels" /></fieldset><fieldset><label>'+l("%White balance")+'</label><input type="text" class="ii-WhiteBalance" /></fieldset><fieldset><label>'+l("%Contrast")+'</label><input type="text" class="ii-Contrast" /></fieldset><fieldset><label>'+l("%Saturation")+'</label><input type="text" class="ii-Caturation" /></fieldset><fieldset><label>'+l("%Brightness")+
|
|
'</label><input type="text" class="ii-Brightness" /></fieldset></section><section id="tab-cam"><fieldset><label>'+l("%Manufacturer")+'</label><input type="text" class="ii-Make" /></fieldset><fieldset><label>'+l("%Model")+'</label><input type="text" class="ii-Model" /></fieldset><fieldset><label>'+l("%Sensor")+'</label><input type="text" class="ii-SensingMethod" /></fieldset><fieldset><label>'+l("%Software")+'</label><input type="text" class="ii-Software" /></fieldset></section><section id="tab-adv"><fieldset><label>'+
|
|
l("%Date")+'</label><input type="text" class="ii-DateTime" /></fieldset><fieldset><label>'+l("%Max aperture size")+'</label><input type="text" class="ii-ApertureValue" /></fieldset><fieldset><label>'+l("%ISO equivalent")+'</label><input type="text" class="ii-ISOSpeedRatings" /></fieldset><fieldset><label>'+l("%Exposure time")+'</label><input type="text" class="ii-ExposureTime" /></fieldset><fieldset><label>'+l("%Exposure bias")+'</label><input type="text" class="ii-ExposureBias" /></fieldset><fieldset><label>'+
|
|
l("%Focal Length")+'</label><input type="text" class="ii-FocalLength" /></fieldset><fieldset><label>'+l("%Flash used")+'</label><input type="text" class="ii-Flash" /></fieldset><fieldset><label>'+l("%Metering")+'</label><input type="text" class="ii-MeteringMode" /></fieldset><fieldset><label>'+l("%EXIF version")+'</label><input type="text" class="ii-ExifVersion" /></fieldset></section><section id="tab-gps"><fieldset><label>'+l("%Latitude")+'</label><input type="text" class="ii-GPSLatitude" /></fieldset><fieldset><label>'+
|
|
l("%Latitude ref")+'</label><input type="text" class="ii-GPSLatitudeRef" /></fieldset><fieldset><label>'+l("%Longitude")+'</label><input type="text" class="ii-GPSLongitude" /></fieldset><fieldset><label>'+l("%Longitude ref")+'</label><input type="text" class="ii-GPSLongitudeRef" /></fieldset><fieldset><label>'+l("%GPS date")+'</label><input type="text" class="ii-GPSDateStamp" /></fieldset><fieldset><label>'+l("%Map data")+'</label><input type="text" class="ii-GPSMapDatum" /></fieldset></section></div>',
|
|
onCreate:function(){var a=this.getElementId();$(a+" .tabs").tabs();$(a+' input[type="text"]').prop("disabled",!0);this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);$(a+" footer").on("click",".locate",function(){var a=$(".ii-GPSLatitude").val().split(","),b=$(".ii-GPSLongitude").val().split(","),a=Others.dms2dec(a[0],a[1],a[1],b[0],b[1],b[1],$(".ii-GPSLatitudeRef").val(),$(".ii-GPSLongitudeRef").val());$(this).attr("href","https://maps.google.com/maps?f=q&q=loc:"+a.latitude+","+a.longitude+"&t=k&spn=0.5,0.5");
|
|
$(this).attr("target","_blank")})},onShow:function(){this.getWorkspace().fillEXIFInfo()}});
|
|
picozu.WINDOWS.push({name:l("%Welcome to Picozu"),handle:"intro",movable:!1,left:Math.round(window.innerWidth/2-200),top:Math.round(window.innerHeight/2-300),width:420,template:'<div class="create clearfix"><div class="icon"></div><div class="text"><h7>'+l("%Create a new image")+"</h7><span>"+l("%intro.create")+'</span></div></div><div class="sample clearfix"><div class="icon"></div><div class="text"><h7>'+
|
|
l("%Open a Sample Image")+"</h7><span>"+l("%intro.sample")+'</span></div></div><div class="extensions clearfix"><div class="icon"></div><div class="text"><h7>'+l("%Install Extensions")+"</h7><span>"+l("%intro.extensions")+'</span></div></div><div class="help clearfix last"><div class="icon"></div><div class="text"><h7>'+l("%Watch a Tutorial")+"</h7><span>"+l("%intro.help")+"</span></div></div>",onCreate:function(){var a=this,c=this.getWorkspace();$(".pico-window-intro").on("click",".create",function(){a.destroy();
|
|
return!1}).on("click",".facebook",function(){a.destroy();c.openWindow("facebookopen");return!1}).on("click",".sample",function(){a.destroy();c.openWindow("sampleimages");return!1}).on("click",".extensions",function(){a.destroy();c.openWindow("extensions");return!1}).on("click",".help",function(){a.destroy();c.openWindow("helpcontents");return!1})},onShow:function(){$("body").append('<div id="introModal"></div>');$("#introModal").show()},onDestroy:function(){$("#introModal").hide().remove()}});
|
|
picozu.WINDOWS.push({name:l("%Upload"),handle:"uploadfiles",width:280,modal:!0,onCreate:function(){var a=this,c=this.getElementId(),b=this.getWorkspace();this.addElement({type:picozu.CONTROL_IMAGE,image:picozu.DEFAULT_PATH+"images/windows/uploadfiles/splash.png"}).addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_HTML,template:"<p>"+l("%window.upload.info")+'</p><input type="file" class="hidden pico-textinput pico-files-upload" />'}).addFooter(this.addButton({cssClass:"upload",
|
|
value:l("%main.selectfile")})+this.addButton({type:"gui",cssClass:"cancel-button",value:l("%main.cancel")}));$(c).on("click",".upload",function(){$(c+" .pico-files-upload").trigger("click");return!1});$(c).on("change",".pico-files-upload",function(c){a.hide();b.showLoader();c=c||window.event;c.preventDefault();c=c.originalEvent||c;b.loadFile(c.target.files[0]);return!1})}});
|
|
picozu.WINDOWS.push({name:l("%New Image"),handle:"newimage",modal:!0,width:270,template:'<img src="'+picozu.DEFAULT_PATH+'images/windows/newimage/splash.png" /><hr /><fieldset><label>'+l("%Name")+'</label><input type="text" maxlength="20" class="left name pico-textinput" /></fieldset><fieldset><label>'+l("%Preset")+'</label><select class="pico-select preset"><option value="0">-- '+l("%select preset")+" --</option></select></fieldset><fieldset><label>"+l("%Width")+'</label><select disabled class="medium right width-unit"><option value="0">'+
|
|
l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small width" value="'+picozu.DEFAULT_WIDTH+'" /></fieldset><fieldset><label>'+l("%Height")+'</label><select disabled class="medium right height-unit"><option value="0">'+l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small height" value="'+picozu.DEFAULT_HEIGHT+'" /></fieldset><fieldset><label>'+l("%Background")+'</label><select class="pico-select bg"><option value="0">'+
|
|
l("%Transparent")+'</option><option value="1">'+l("%White")+'</option><option value="2">'+l("%Black")+'</option><option value="3">'+l("%Background Color")+'</option><option value="4">'+l("%Foreground Color")+"</option></select></fieldset>",onCreate:function(){var a=this,c=this.getElementId(),b="",d=this.getWorkspace();this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);for(var e in picozu.NEW_IMAGE_PRESETS){for(var b=b+('<optgroup label="'+e+'">'),f=0;f<picozu.NEW_IMAGE_PRESETS[e].length;f++)b+='<option value="'+
|
|
f+"-"+e+'">'+picozu.NEW_IMAGE_PRESETS[e][f].name+"</option>";b+="</optgroup>"}$(c+" .name").val("untitled"+parseInt(d.heap.lastTabIndex+1));$(c+" .preset").append(b);$(c).on("change",".preset",function(){var b=$(c+" select.preset").val(),b=b.split("-");0!==b[0]&&(a.setIntValue(".width",picozu.NEW_IMAGE_PRESETS[b[1]][b[0]].width),a.setIntValue(".height",picozu.NEW_IMAGE_PRESETS[b[1]][b[0]].height))}).on("change",".width-unit, .height-unit",function(){var a=parseInt($(this).val());$(c+" select.width-unit, "+
|
|
c+" select.height-unit").val(a)}).on("click",".library",function(){d.openWindow("library");a.hide()})},onApply:function(){var a,c=this.getWorkspace(),b=this.getStrValue(".name"),d=this.getIntValue(".width"),e=this.getIntValue(".height"),f=this.getIntValue(".bg");if(c.validateImageSize(d)&&c.validateImageSize(e)){switch(f){case 0:a=[0,0,0,0];break;case 1:a=[255,255,255,1];break;case 2:a=[0,0,0,1];break;case 3:a=c.getParam("backgroundColor");break;case 4:a=c.getParam("foregroundColor")}c.newTab({name:b,
|
|
width:d,height:e,hasBackground:0<f?!0:!1,backgroundColor:a})}else return c.notify(l("%main.imagesizeerror"),!0),!1}});
|
|
picozu.WINDOWS.push({name:l("%Settings"),handle:"settings",width:270,modal:!0,onCreate:function(){var a=this.getWorkspace();this.addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%Snap to Grid"),handle:"ptm-snap-grid",tips:l("%settings.snapgrid"),property:"ptmSnapGrid",checked:a.getSetting("snapGrid"),callback:function(c){a.setSetting("snapGrid",c)}}).addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%Show Grid"),handle:"ptm-show-grid",tips:l("%settings.showgrid"),property:"ptmShowGrid",checked:a.getSetting("showGrid"),
|
|
callback:function(c){a.setSetting("showGrid",c);!0==c?$(".pico-tab > section").css({"background-image":'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAOklEQVQ4je3PMQoAMAwCwPz/q+5xCvYLBjq0oOAmBxYgOW2OtStAKiPNsXYBAz4BNkc3+8HlgAH34AGSYSYzwWQ+CQAAAABJRU5ErkJggg==")'}):$(".pico-tab > section").css({"background-image":"none"})}}).addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%Snap to Edges"),handle:"ptm-snap-tab",tips:l("%settings.snapedges"),property:"ptmSnapTab",checked:a.getSetting("snapTab"),
|
|
callback:function(c){a.setSetting("snapTab",c)}}).addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%Snap to Layers"),handle:"ptm-snap-layers",tips:l("%settings.snaplayers"),property:"ptmSnapLayers",checked:a.getSetting("snapLayers"),callback:function(c){a.setSetting("snapLayers",c)}}).addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%Show Tips"),handle:"ptm-show-tips",tips:l("%settings.showtips"),property:"ptmShowTips",checked:a.getSetting("showTips"),callback:function(c){!0===c?a.heap.tipsInterval=
|
|
setInterval(function(){a.showTip()},12E4):clearInterval(a.heap.tipsInterval);a.setSetting("showTips",c)}}).addElement({type:picozu.CONTROL_SELECT,legend:l("%autosave"),handle:"ptm-autosave",tips:l("%settings.autosave"),property:"ptmAutosave",value:a.getSetting("autosave"),data:picozu.AUTOSAVE_INTERVALS,callback:function(c){!0===c&&!0===a.isOnline()?a.heap.autosaveInterval=setInterval(function(){a.autosave()},parseInt(c)):clearInterval(a.heap.autosaveInterval);a.setSetting("autosave",c)}}).addFooter('<input type="button" class="pico-button gui-btn cancel-button" value="'+
|
|
l("%main.close")+'" />')},onDestroy:function(){this.getWorkspace().getSelectedLayer().select()}});
|
|
picozu.WINDOWS.push({name:l("%Help Contents"),handle:"helpcontents",center:!0,width:800,resizable:!0,template:'<div class="tabs"><ul><li><a href="#tab-general">'+l("%General Info")+'</a></li><li><a href="#tab-contents">'+l("%Contents")+'</a></li><li><a href="#tab-tutorials">'+l("%Tutorials")+'</a></li><li><a href="#tab-addons">'+l("%Browser Addons")+'</a></li><li><a href="#tab-shortcuts">'+l("%Keyboard Shortcuts")+'</a></li></ul><div id="tab-general" class="clearfix"><div class="help-general"><img src="'+
|
|
picozu.DEFAULT_PATH+'images/logos/picozu-loader.png" class="logo" /><p>'+l("%main.help.text1")+"</p><br /><ul><li>"+l("%main.help.text4")+"</li><li>"+l("%main.help.text5")+"</li><li>"+l("%main.help.text6")+"</li><li>"+l("%main.help.text7")+"</li><li>"+l("%main.help.text8")+"</li><li>"+l("%main.help.text9")+"</li><li>"+l("%main.help.text10")+"</li></ul><br /><p>"+l("%main.help.text2")+'</p><br /><p class="em">'+l("%main.help.text3")+"</p><hr /><p>"+l("%library version")+" "+picozu.VERSION+' © 2011-2018 Picozu</p></div></div><div id="tab-contents" class="clearfix"><input type="text" class="pico-textinput pico-search-input" placeholder="'+l("%enter a search term")+'" /><hr /><div class="help-contents"><p>'+l("%help.search.tip")+'</p></div></div><div id="tab-tutorials" class="clearfix"><div class="help-general"><ul class="tutorials"><li><a data-id="RnntH97T7fo" href="#">'+l("%Video Tutorial Facebook Import/Export")+'</a></li><li><a data-id="g-iV_6E_jEw" href="#">'+
|
|
l("%Organize Swatches")+'</a></li><li><a data-id="I6XIBfyHtFg" href="#">'+l("%Picozu Cloud Import/Export")+'</a></li><li><a data-id="-IG0stlAa58" href="#">'+l("%Blending Modes")+'</a></li><li><a data-id="4iFXEF1Sfmg" href="#">'+l("%Import Options")+'</a></li></ul></div></div><div id="tab-addons" class="clearfix"><div class="help-general"><p>'+l("%picozu.shooter.text1")+"</p><br /><p>"+l("%picozu.shooter.text2")+'</p><div class="shooter-installed"></div><img src="'+picozu.DEFAULT_PATH+'images/windows/helpcontents/shooter.jpg" /></div></div><div id="tab-shortcuts" class="clearfix"><div class="help-general"><div class="row1"><ul class="keyboard-shortcuts"><li><span>Ctrl + Z</span> '+
|
|
l("%Undo last action")+"</li><li><span>Ctrl + C</span> "+l("%Copy selection")+"</li><li><span>Ctrl + X</span> "+l("%Cut selection")+"</li><li><span>Ctrl + V</span> "+l("%Paste selection")+"</li><li><span>Ctrl + A</span> "+l("%Select all")+"</li><li><span>Ctrl + D</span> "+l("%Select none")+"</li><li><span>Insert</span> "+l("%Duplicate layer")+"</li><li><span>Delete</span> "+l("%Delete layer")+"</li><li><span>Pg Up</span> "+l("%Select next layer")+"</li><li><span>Pg Down</span> "+l("%Select previous layer")+
|
|
"</li><li><span>Ctrl + 1</span> "+l("%Toggle dockbar")+"</li><li><span>Ctrl + 2</span> "+l("%Toggle toolbar")+"</li><li><span>Ctrl + 3</span> "+l("%Toggle propbar")+"</li><li><span>Ctrl + 0</span> "+l("%Close toolbar, dockbar and propbar")+"</li><li><span>Ctrl + Shift + D</span> "+l("%Open debugger")+"</li><li><span>Ctrl + Shift + N</span> "+l("%New layer")+"</li><li><span>Alt + Ctrl + X</span> "+l("%Close image")+"</li><li><span>Esc</span> "+l("%Quit tool")+'</li></ul></div><div class="row2"><ul class="keyboard-shortcuts"><li><span>Left</span> '+
|
|
l("%Move layer left")+"</li><li><span>Right</span> "+l("%Move layer right")+"</li><li><span>Up</span> "+l("%Move layer up")+"</li><li><span>Down</span> "+l("%Move layer down")+"</li><li><span>F1</span> "+l("%Help")+"</li><li><span>F11</span> "+l("%Toggle fullscreen mode")+"</li><li><span>Ctrl + N</span> "+l("%New image")+"</li><li><span>Ctrl + S</span> "+l("%Save image")+"</li><li><span>Alt + Ctrl + I</span> "+l("%Resize image")+"</li><li><span>Alt + Ctrl + C</span> "+l("%Canvas image")+"</li><li><span>Ctrl + I</span> "+
|
|
l("%Image info")+"</li><li><span>Ctrl + Y</span> "+l("%Image reset")+"</li><li><span>Ctrl + Shift + ]</span> "+l("%Bring to Front")+"</li><li><span>Ctrl + ]</span> "+l("%Bring Forward")+"</li><li><span>Ctrl + Shift + [</span> "+l("%Send to Back")+"</li><li><span>Ctrl + [</span> "+l("%Send Backward")+"</li><li><span>Ctrl + K</span> "+l("%Settings")+"</li><li><span>Ctrl + F</span> "+l("%Flatten Layers")+"</li></ul></div></div></div></div>",onCreate:function(){var a=this.getWorkspace(),c=this.getElementId(),
|
|
b=navigator.userAgent.toLowerCase();$(c+" .tabs").tabs();!0===a.isLoggedIn()&&$(c+" .account").hide();-1<b.indexOf("firefox")?!0===a.plugins.shooterFirefox?$(c+" .shooter-installed").empty().append("<blockquote>"+l("%picozu.shooter.installed")+"</blockquote>").show():$(c+" .shooter-installed").empty().append('<a class="pico-button ok-btn install-shooter-fx" href="#">'+l("%Install Picozu Shooter")+"</a>").show():-1<b.indexOf("safari")&&(!0===a.plugins.shooterSafari?$(c+" .shooter-installed").empty().append("<blockquote>"+
|
|
l("%picozu.shooter.installed")+"</blockquote>").show():$(c+" .shooter-installed").empty().append('<a class="pico-button ok-btn install-shooter-safari" href="#">'+l("%Install Picozu Shooter")+"</a>").show());$(c).on("keyup.picozu",".pico-search-input",function(b){13===b.keyCode&&(b=$(".pico-search-input").val(),$(c+" .pico-search-input").val(""),""!=b&&3<b.length?(a.showLoader(),a.doRequest(picozu.API_HELP,"search="+b,function(a){for(var b="",d=0;d<a.posts.length;d++)b+="<div>"+a.posts[d].content+
|
|
"</div>";$(c+" .help-contents").empty().append(b).fadeIn()},null,"json")):a.notify(l("%search.errorempty"),!0));return!1}).on("click",".install-shooter-fx",function(){a.installFirefoxShooter();return!1}).on("click",".install-shooter-safari",function(){a.installSafariShooter();return!1}).on("click",".help-contents a",function(){return!1}).on("click",".bookmark",function(){a.infoWindow(l("%Info"),l("%bookmark.button"));return!1}).on("click",".account",function(){a.openWindow("account");return!1}).on("click",
|
|
".tutorials li a",function(){var c=$(this).data("id");a.dispatchAction(picozu.ACTION_OPEN_YOUTUBE_PLAYER,c)})}});
|
|
picozu.WINDOWS.push({name:l("%export.palette"),handle:"colorpalette",width:300,modal:!0,onCreate:function(){this.addElement({type:picozu.CONTROL_IMAGE,image:picozu.DEFAULT_PATH+"images/windows/colorpalette/splash.png"}).addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_SELECT,legend:l("%main.saveas"),legendClass:"legend",handle:"pico-palette-saveas",data:picozu.DEFAULT_COLOR_PALETTES}).addFooter(picozu.DEFAULT_WINDOW_FOOTER)},onApply:function(){this.getWorkspace().exportColorPalette(this.getIntValue("#pico-palette-saveas"))}});
|
|
var Import={fromPZI:function(a){a=JSON.parse(a);a.d=!0===a.e?JSON.parse(picozu.objects.crypter.decryptString(a.d,picozu.ENCRYPT_KEY)):JSON.parse(picozu.objects.crypter.base64Decode(a.d));return a},fromPZW:function(a){a=JSON.parse(a);a.d=!0===a.e?JSON.parse(picozu.objects.crypter.decryptString(a.d,picozu.ENCRYPT_KEY)):JSON.parse(picozu.objects.crypter.base64Decode(a.d));return a},fromPSD:function(){return!1},fromSVG:function(){return!1},fromASE:function(a){function c(a){var c,b;c=a[0].toString(16);
|
|
2>c.length&&(c="0"+c);b=a[1].toString(16);2>b.length&&(b="0"+b);a=a[2].toString(16);2>a.length&&(a="0"+a);return c+b+a}function b(a){for(var c,b="",d=a.getUint16();0<--d;)c=a.getUint16(),b+=String.fromCharCode(c);a.getUint16();return b}function d(a,f){for(var g,j,r,p,q,u;0<=--e;)switch(g=a.getUint16(),g){default:return!1;case 49153:a.getUint32();g=b(a);f.groups||(f.groups=[]);f.groups.push(g={name:g});if(d(a,g))return!1;continue;case 49154:return a.getUint32(),0;case 2:e++;continue;case 1:switch(a.getUint32(),
|
|
g=b(a),j=a.getString(4),f.colors||(f.colors=[]),f.colors.push(g={name:g,model:j}),j){case "CMYK":r=a.getFloat32();p=a.getFloat32();j=a.getFloat32();q=a.getFloat32();g.cmyk=[r,p,j,q];1<=q?r=q=p=0:(r=r*(1-q)+q,p=p*(1-q)+q,j=j*(1-q)+q,r=1-r,q=1-p,p=1-j,r=Math.min(255,Math.max(0,Math.round(255*r))),q=Math.min(255,Math.max(0,Math.round(255*q))),p=Math.min(255,Math.max(0,Math.round(255*p))));h.push(c(g.rgb=[r,q,p]));break;case "RGB ":r=a.getFloat32();q=a.getFloat32();p=a.getFloat32();g.ase_rgb=[r,q,p];
|
|
r=Math.min(255,Math.max(0,Math.round(255*r)));q=Math.min(255,Math.max(0,Math.round(255*q)));p=Math.min(255,Math.max(0,Math.round(255*p)));h.push(c(g.rgb=[r,q,p]));break;case "LAB ":j=a.getFloat32();r=a.getFloat32();p=a.getFloat32();g.lab=[j,r,p];j=(j+16)/116;u=r/500+j;p=j-p/200;j=0.008856<Math.pow(j,3)?Math.pow(j,3):(j-16/116)/7.787;u=0.008856<Math.pow(u,3)?Math.pow(u,3):(u-16/116)/7.787;p=0.008856<Math.pow(p,3)?Math.pow(p,3):(p-16/116)/7.787;u*=95.047;j*=100;p*=108.883;u/=100;j/=100;p/=100;r=3.2406*
|
|
u+-1.5372*j+-0.4986*p;q=-0.9689*u+1.8758*j+0.0415*p;p=0.0557*u+-0.204*j+1.057*p;r=0.0031308<r?1.055*Math.pow(r,1/2.4)-0.055:12.92*r;q=0.0031308<q?1.055*Math.pow(q,1/2.4)-0.055:12.92*q;p=0.0031308<p?1.055*Math.pow(p,1/2.4)-0.055:12.92*p;r=Math.min(255,Math.max(0,Math.round(255*r)));q=Math.min(255,Math.max(0,Math.round(255*q)));p=Math.min(255,Math.max(0,Math.round(255*p)));h.push(c(g.rgb=[r,q,p]));break;case "GRAY":q=a.getFloat32();g.gray=q;q=Math.min(255,Math.max(0,Math.round(255*q)));h.push(c(g.rgb=
|
|
[q,q,q]));break;default:return!1}}return 0}var e,f,g={},h=[];try{f=new jDataView(a,0,void 0,!1)}catch(j){f=null}if(!f||"ASEF"!==f.getString(4)||1>f.getInt16()||0>f.getInt16()||1>(e=f.getInt32()))return!1;d(f,g);return{palette:g,flattened:h}},_curvesGet:function(a){var c=[],b={},d=0;for(d in a)c.push(Import._curveGet(a[d]));b.a=c[0];b.r=c[1];b.g=c[2];b.b=c[3];for(d in b){a=b[d].getLowestAbove(0)-1;for(c=0;c<=b[d].length;c++)0==b[d][c]&&(b[d][c]=a)}return b},_curveGet:function(a){var c=function(a,c){var b,
|
|
d,e,f,g,p,q,u,t,v,w;q=a.length;e=[];p=[];b=[];d=[];f=[];u=[];g=0;for(t=q-1;0<=t?g<t:g>t;0<=t?g+=1:g-=1)e[g]=(c[g+1]-c[g])/(a[g+1]-a[g]),0<g&&(p[g]=(e[g-1]+e[g])/2);p[0]=e[0];p[q-1]=e[q-2];t=[];g=0;for(v=q-1;0<=v?g<v:g>v;0<=v?g+=1:g-=1)0===e[g]&&t.push(g);v=0;for(w=t.length;v<w;v++)g=t[v],p[g]=p[g+1]=0;g=0;for(t=q-1;0<=t?g<t:g>t;0<=t?g+=1:g-=1)b[g]=p[g]/e[g],d[g]=p[g+1]/e[g],f[g]=Math.pow(b[g],2)+Math.pow(d[g],2),u[g]=3/Math.sqrt(f[g]);t=[];g=0;for(v=q-1;0<=v?g<v:g>v;0<=v?g+=1:g-=1)9<f[g]&&t.push(g);
|
|
f=0;for(v=t.length;f<v;f++)g=t[f],p[g]=u[g]*b[g]*e[g],p[g+1]=u[g]*d[g]*e[g];this.x=a.slice(0,q);this.y=c.slice(0,q);this.m=p};c.prototype.interpolate=function(a){var c,b,d,e;for(b=c=this.x.length-2;(0>=c?0>=b:0<=b)&&!(this.x[b]<=a);0>=c?b+=1:b-=1);c=this.x[b+1]-this.x[b];a=(a-this.x[b])/c;d=Math.pow(a,2);e=Math.pow(a,3);return(2*e-3*d+1)*this.y[b]+(e-2*d+a)*c*this.m[b]+(-2*e+3*d)*this.y[b+1]+(e-d)*c*this.m[b+1]};var b=[],d=[],e=[],f,g;for(g=0;g<a.length;g++)f=a[g],d.push(f[0]),e.push(f[1]);cubicSpline=
|
|
new c(d,e);for(g=0;256>=g;g++)b[g]=Math.round(cubicSpline.interpolate(g))||0;return b},_curvesPhotoshopLoad:function(a){var c={rgb:[],r:[],g:[],b:[]};a=new jDataView(a);a.seek(4);var b=a.getUint16(),d=["r","g","b"],e,f,g,h,j;c.rgb.push([0,a.getUint16()]);a.seek(a.tell()+2);for(h=1;h<b;h++)g=a.getUint16(),f=a.getUint16(),c.rgb.push([f,g]);for(h=0;3>h;h++){b=a.getUint16();e=c[d[h]];for(j=0;j<b;j++)g=a.getUint16(),f=a.getUint16(),e.push([f,g])}return c},fromACV:function(a){a=Import._curvesPhotoshopLoad(a);
|
|
return Import._curvesGet(a)}},Export={_encodeFloat:function(a){var c=[],b=Math.pow(2,7)-1,c=-b+1,d=isNaN(j=parseFloat(a))||-Infinity===j||Infinity===j?j:0,e=0,f=2*b+27,g=Array(f),h=0>(j=0!==d?0:j),j=Math.abs(j),k=Math.floor(j),m=j-k,n;for(a=f;a;g[--a]=0);for(a=b+2;k&&a;g[--a]=k%2,k=Math.floor(k/2));for(a=b+1;0<m&&a;(g[++a]=(1<=(m*=2))-0)&&--m);for(a=-1;++a<f&&!g[a];);if(g[(j=22+(a=(e=b+1-a)>=c&&e<=b?a+1:b+1-(e=c-1)))+1]){if(!(n=g[j]))for(m=j+2;!n&&m<f;n=g[m++]);for(m=j+1;n&&0<=--m;(g[m]=!g[m]-0)&&
|
|
(n=0));}for(a=0>a-2?-1:a-3;++a<f&&!g[a];);(e=b+1-a)>=c&&e<=b?++a:e<c&&(a=b+1-(e=c-1));if(k||0!==d)e=b+1,a=b+2,-Infinity==d?h=1:isNaN(d)&&(g[a]=1);j=Math.abs(e+b);m=9;for(b="";--m;b=j%2+b,j=j>>=1);m=j=0;a=(b=(h?"1":"0")+b+g.slice(a,a+23).join("")).length;for(c=[];a;m=(m+1)%8)j+=(1<<m)*b.charAt(--a),7==m&&(c[c.length]=String.fromCharCode(j),j=0);c[c.length]=j?String.fromCharCode(j):"";return c.reverse().join("")},toASE:function(a){return picozu.objects.crypter.base64Encode("ASEF"+String.fromCharCode(0,
|
|
1,0,0,0,0,0,a.length,0)+Export._convertColors(picozu.FILE_FORMAT_ASE,a)+String.fromCharCode(0,0))},toCLR:function(a){return picozu.objects.crypter.base64Encode(String.fromCharCode(255,255,0,0,10,0,67,67,111,108,111,114,76,105,115,116,a.length%256,Math.floor(a.length/256),255,255,0,0,9,0,67,67,111,108,111,114,68,101,102)+Export._convertColors(picozu.FILE_FORMAT_CLR,a)+String.fromCharCode(0,1,128,0,0))},_convertColors:function(a,c){var b=c.length,d="";switch(a){case picozu.FILE_FORMAT_ASE:for(var e=
|
|
0;e<b;e++){for(var f=c[e],g="#"+Color.rgb2hex(f[0],f[1],f[2]),h=String.fromCharCode(0),j=String.fromCharCode(1,0,0,0),j=j+String.fromCharCode(2*(g.length+1)+20,0),j=j+String.fromCharCode(g.length+1,0),g=g.split(""),k=0;k<g.length;k++)j+=h+g[k];j+=h+"RGB ";j+=Export._encodeFloat(f[0]/255).substring(0,3)+h;j+=Export._encodeFloat(f[1]/255).substring(0,3)+h;j+=Export._encodeFloat(f[2]/255).substring(0,3)+h;e<b-1&&(j+=h+h+h);d+=j}break;case picozu.FILE_FORMAT_CLR:for(e=0;e<b;e++)f="",0<e&&(f+=String.fromCharCode(3,
|
|
128)),f+=String.fromCharCode(3,c[e][0],c[e][1],c[e][2],255,0,0,0,0,0,0,0,0),d+=f;break;case picozu.FILE_FORMAT_ACT:for(e=0;e<b;e++){if(256<=e)return"";d+=String.fromCharCode(c[e][0],c[e][1],c[e][2])}break;case picozu.FILE_FORMAT_GMP:for(e=0;e<b;e++)g="#"+Color.rgb2hex(c[e]),d+=c[e][0]+" "+c[e][1]+" "+c[e][2]+"\t"+g+"\n";break;case picozu.FILE_FORMAT_ACO:for(e=0;e<b;e++){j=String.fromCharCode(0,0,c[e][0],c[e][0],c[e][1],c[e][1],c[e][2],c[e][2],0,0);h=String.fromCharCode(0);j+=String.fromCharCode(0,
|
|
0,0,8);g="#"+Color.rgb2hex(c[e][0],c[e][1],c[e][2]);g=g.split("");for(e=0;e<g.length;e++)j+=h+g[e];d+=j}}return d},toACO:function(a){var c=a.length;return picozu.objects.crypter.base64Encode(String.fromCharCode(0,2,Math.floor(c/256),c%256)+Export._convertColors(picozu.FILE_FORMAT_ACO,a))},toACT:function(a){var c=a.length;for(a=String.fromCharCode(0,2,Math.floor(c/256),c%256)+Export._convertColors(picozu.FILE_FORMAT_ACT,a);256>c;c++)a+=String.fromCharCode(0,0,0);return picozu.objects.crypter.base64Encode(a)},
|
|
toGIMP:function(a){return picozu.objects.crypter.base64Encode("GIMP Palette\nName:Picozu Color Palette\n"+Export._convertColors(picozu.FILE_FORMAT_GMP,a))},toPNG:function(a){return a.toDataURL("image/png")},toBinary:function(a){return a.getContext().getImageData(0,0,a.getWidth(),a.getHeight()).data},toCSS:function(a,c,b){var d="sprite",e=0,f=1,g="",h="",h="";$.each(b,function(a,c){"spriteName"===c.name&&(d=c.value.replace(/ /g,""));"cssFormat"===c.name&&(f=parseInt(c.value));"embedImage"===c.name&&
|
|
(e=parseInt(c.value))});if(1===f){b="."+d+' {\n\tbackground: url("'+(0===e?"sprites.png":c)+'") no-repeat;\n\tdisplay: block;\n}\n\n';var j="."+d+".{classname} {\n{rules}}\n\n";for(c=0;c<a.length;c++)"object"===typeof a[c]&&!0===a[c].visible&&(h="\twidth: "+a[c].coords.width+"px;\n\theight: "+a[c].coords.height+"px;\n\tbackground-position: -"+a[c].coords.left+"px -"+a[c].coords.top+"px;\n",g+=j.replace(/{classname}/g,a[c].name.toLowerCase().replace(/ /g,"")).replace(/{rules}/g,h))}else{b="."+d+' (@x: 0, @y: 0, @width: 0, @height: 0) {\n\tbackground: url("sprites.png") @x @y no-repeat;\n\tdisplay: block;\n\twidth: @width;\n\theight: @height;\n}\n\n';
|
|
j="."+d+".{classname} {\n{rules}}\n\n";for(c=0;c<a.length;c++)"object"===typeof a[c]&&!0===a[c].visible&&(h="\t.sprite(-"+a[c].coords.left+"px, -"+a[c].coords.top+"px, "+a[c].coords.width+"px, "+a[c].coords.height+"px);\n",g+=j.replace(/{classname}/g,a[c].name.toLowerCase().replace(/ /g,"")).replace(/{rules}/g,h))}h=b+g;return picozu.objects.crypter.base64Encode(h)},toPZI:function(a,c,b,d){var e=picozu.FILE_HEADER_PZI;e.e=d;e.d={layers:a,width:c,height:b};e.d=!0===d?picozu.objects.crypter.encryptString(JSON.stringify(e.d),
|
|
picozu.ENCRYPT_KEY):picozu.objects.crypter.base64Encode(JSON.stringify(e.d));return JSON.stringify(e)},toPZW:function(a,c,b,d,e,f,g){var h=picozu.FILE_HEADER_PZW;h.e=g;h.d={tabs:a,parameters:c,settings:b,swatches:d,controls:e,notes:f};h.d=!0===g?picozu.objects.crypter.encryptString(JSON.stringify(h.d),picozu.ENCRYPT_KEY):picozu.objects.crypter.base64Encode(JSON.stringify(h.d));return JSON.stringify(h)}},Color={randomRgb:function(){return Color.hex2rgb(Color.random())},randomRgba:function(a,c,b){return"rgba("+
|
|
Math.round(Others.random(a,c))+","+Math.round(Others.random(a,c))+","+Math.round(Others.random(a,c))+","+b+")"},random:function(){var a=(16777216*Math.random()<<0).toString(16);return"#"+(Array(7-a.length).join("0")+a)},hex2rgb:function(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,d,e){return b+b+d+d+e+e});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:!1},rgb2rgba:function(a,c){a[3]=c;return a},hex2cmyk:function(a){var c=
|
|
0,b=0,d=0,c=parseInt(a.substring(0,2),16),b=parseInt(a.substring(2,4),16);a=parseInt(a.substring(4,6),16);if(0===c&&0===b&&0===a)return[0,0,0,1];c=1-c/255;b=1-b/255;d=1-a/255;a=Math.min(c,Math.min(b,d));return[(c-a)/(1-a),(b-a)/(1-a),(d-a)/(1-a),a]},rgb2cmyk:function(a,c,b){var d=0,e=0,f=0;if(0===a&&0===c&&0===b)return[0,0,0,1];d=1-a/255;e=1-c/255;f=1-b/255;a=Math.min(d,Math.min(e,f));return[(d-a)/(1-a),(e-a)/(1-a),(f-a)/(1-a),a]},isDark:function(a){return 375<a[0]+a[1]+a[2]?!0:!1},color2Exp:function(a,
|
|
c){var b="";switch(a){case "rgb":b="rgb("+c[0]+", "+c[1]+", "+c[2]+")";break;case "hsl":b="hsl("+c[0]+", "+c[1]+", "+c[2]+")";break;case "rgba":b="rgba("+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+")";break;case "hsla":b="hsla("+c[0]+", "+c[1]+", "+c[2]+", "+c[3]+")";break;case "hex":b="#"+Color.rgb2hex(c[0],c[1],c[2])}return b},rgb2hex:function(a,c,b){function d(a){if(null===a)return"00";a=parseInt(a,10);if(0===a||isNaN(a))return"00";a=Math.max(0,a);a=Math.min(a,255);return"0123456789ABCDEF".charAt((a-a%
|
|
16)/16)+"0123456789ABCDEF".charAt(a%16)}return"object"===typeof a?d(a[0])+d(a[1])+d(a[2]):d(a)+d(c)+d(b)},rgb2hsl:function(a,c,b){a/=255;c/=255;b/=255;var d=Math.max(a,c,b),e=Math.min(a,c,b),f,g=(d+e)/2;if(d===e)f=e=0;else{var h=d-e,e=0.5<g?h/(2-d-e):h/(d+e);switch(d){case a:f=(c-b)/h+(c<b?6:0);break;case c:f=(b-a)/h+2;break;case b:f=(a-c)/h+4}f/=6}return[f,e,g]},hsl2rgb:function(a,c,b){if(0===c)b=c=a=b;else{var d=0.5>b?b*(1+c):b+c-b*c,e=2*b-d;b=this.hue_to_rgb(e,d,a+1/3);c=this.hue_to_rgb(e,d,a);
|
|
a=this.hue_to_rgb(e,d,a-1/3)}return[255*b,255*c,255*a]},rgb2hsv:function(a,c,b){var d=0;a/=255;c/=255;b/=255;var e=Math.min(a,Math.min(c,b)),f=Math.max(a,Math.max(c,b));if(e===f)return[0,0,e];d=60*((a===e?3:b===e?1:5)-(a===e?c-b:b===e?a-c:b-a)/(f-e));return[d,(f-e)/f,f]},hsv2rgb:function(a,c,b){var d,e,f,g=Math.floor(6*a),h=6*a-g;a=b*(1-c);var j=b*(1-h*c);c=b*(1-(1-h)*c);switch(g%6){case 0:d=b;e=c;f=a;break;case 1:d=j;e=b;f=a;break;case 2:d=a;e=b;f=c;break;case 3:d=a;e=j;f=b;break;case 4:d=c;e=a;
|
|
f=b;break;case 5:d=b,e=a,f=j}return[255*d,255*e,255*f]},rgb2xyz:function(a,c,b){a/=255;c/=255;b/=255;a=0.04045<a?Math.pow((a+0.055)/1.055,2.4):a/12.92;c=0.04045<c?Math.pow((c+0.055)/1.055,2.4):c/12.92;b=0.04045<b?Math.pow((b+0.055)/1.055,2.4):b/12.92;return[0.4124*a+0.3576*c+0.1805*b,0.2126*a+0.7152*c+0.0722*b,0.0193*a+0.1192*c+0.9505*b]},xyz2rgb:function(a,c,b){a/=100;c/=100;b/=100;var d,e;d=3.2406*a+-1.5372*c+-0.4986*b;e=-0.9689*a+1.8758*c+0.0415*b;a=0.0557*a+-0.204*c+1.057*b;d=0.0031308<d?1.055*
|
|
Math.pow(d,0.4166666667)-0.055:12.92*d;e=0.0031308<e?1.055*Math.pow(e,0.4166666667)-0.055:12.92*e;a=0.0031308<a?1.055*Math.pow(a,0.4166666667)-0.055:12.92*a;return[255*d,255*e,255*a]},xyz2lab:function(a,c,b){a/=95.047;c/=100;b/=108.883;a=0.008856451679<a?Math.pow(a,0.3333333333):7.787037037*a+0.1379310345;c=0.008856451679<c?Math.pow(c,0.3333333333):7.787037037*c+0.1379310345;b=0.008856451679<b?Math.pow(b,0.3333333333):7.787037037*b+0.1379310345;return[116*c-16,500*(a-c),200*(c-b)]}},Others={dms2dec:function(a,
|
|
c,b,d,e,f,g,h){var j=1,k=1;"S"==g&&(j=-1);a=Math.abs(Math.round(1E6*a));c=Math.abs(Math.round(1E6*c));b=Math.abs(Math.round(1E6*b));"W"==h&&(k=-1);d=Math.abs(Math.round(1E6*d));e=Math.abs(Math.round(1E6*e));f=Math.abs(Math.round(1E6*f));j=Math.round(a+c/60+b/3600)*j/1E6;k=Math.round(d+e/60+f/3600)*k/1E6;return{latitude:j,longitude:k}},randomFloat:function(a,c){return Math.random()*(c-a)+a},distBetween:function(a,c){return Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2))},angleBetween:function(a,
|
|
c){return Math.atan2(c.x-a.x,c.y-a.y)},normCoords:function(a,c,b,d){return{startX:a,startY:c,width:b-a,height:d-c,endX:b,endY:d}},translateShape:function(a,c,b){var d=[],e;for(e in a)d.push([a[e][0]+c,a[e][1]+b]);return d},rotateShape:function(a,c){var b=[],d;for(d in a)b.push(Others.rotatePoint(c,a[d][0],a[d][1]));return b},rotatePoint:function(a,c,b){return[c*Math.cos(a)-b*Math.sin(a),c*Math.sin(a)+b*Math.cos(a)]},random:function(a,c){return Math.random()*(c-a)+a},randomInt:function(a,c){return Math.floor(Math.random()*
|
|
(c-a+1))+a}};Array.prototype.findIndex=function(a){for(var c=0;c<this.length;c++)if(this[c]===a)return c;return!1};Array.prototype.findIndexM=function(a){for(var c=0;c<this.length;c++)if(this[c].handle===a)return c;return!1};Array.prototype.getLowestAbove=function(a){return Math.min.apply(0,this.filter(function(a){return a>this},a))||0};
|
|
CanvasRenderingContext2D.prototype.roundRect=function(a,c,b,d,e,f){"undefined"===typeof e&&(e=10);this.beginPath();this.moveTo(a+e,c);this.lineTo(a+b-e,c);this.quadraticCurveTo(a+b,c,a+b,c+e);this.lineTo(a+b,c+d-e);this.quadraticCurveTo(a+b,c+d,a+b-e,c+d);this.lineTo(a+e,c+d);this.quadraticCurveTo(a,c+d,a,c+d-e);this.lineTo(a,c+e);this.quadraticCurveTo(a,c,a+e,c);this.closePath();"undefined"===typeof f||!1===f?this.stroke():this.fill()};
|
|
String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};
|
|
(function(){var a=!1,c=/xyz/.test(function(){xyz})?/\b__super\b/:/.*/;this.Class=function(){};Class.extend=function(b){function d(){!a&&this.__constructor&&this.__constructor.apply(this,arguments)}var e=this.prototype;a=!0;var f=new this;a=!1;for(var g in b)f[g]="function"==typeof b[g]&&"function"==typeof e[g]&&c.test(b[g])?function(a,c){return function(){var b=this.__super;this.__super=e[a];var d=c.apply(this,arguments);this.__super=b;return d}}(g,b[g]):b[g];d.prototype=f;d.prototype.constructor=
|
|
d;d.extend=arguments.callee;return d}})();
|
|
picozu.objects.control=Class.extend({heap:{},parent:null,template:"",getWorkspace:function(){return this.parent},getParent:function(){return this.parent},lock:function(){this.movable=!1;return this},setIntValue:function(a,c){this.setValue(a,parseInt(c));return this},setValue:function(a,c){$(this.getElementId()+" "+a).val(c);return this},getValue:function(a){return $(this.getElementId()+" "+a).val()},getIntValue:function(a){return parseInt(this.getValue(a))},getStrValue:function(a){return this.getValue(a).toString()},
|
|
getBoolValue:function(a){return $(this.getElementId()+" "+a).prop("checked")},createButton:function(a){a.accept=a.accept||!1;a.cssClass=a.cssClass||"";a.label=a.label||l("%main.ok");return'<input type="button" class="pico-button '+(!0===a.accept?"ok-btn":"gui-btn cancel-button")+" "+a.cssClass+'" value="'+a.label+'" />'},unlock:function(){this.movable=!0;return this},isResizeable:function(){return this.resizeable},isCenter:function(){return this.center},isModal:function(){return this.modal},isMovable:function(){return this.movable},
|
|
isSystem:function(){return this.system},empty:function(){$(this.getElementId()+" > section").empty();return this},getName:function(){return this.name},setName:function(a){this.name=a;return this},getControlType:function(){return this.controlType},isVisible:function(){return this.visible},toggle:function(){!0===this.isVisible()?this.hide():this.show();return this},getHandle:function(){return this.handle},getId:function(){return this.id},getElementHandle:function(){return"pico-"+this.getControlType()+
|
|
"-"+this.getId()},getElementId:function(){return"#"+this.getElementHandle()},cleanHeap:function(){this.heap={};return this},addFooter:function(a){$(this.getElementId()).append("<footer>"+a+"</footer>");return this},resize:function(){this.onResize.call(this);return this},move:function(a,c){this.left=a;this.top=c;$(this.getElementId()).css({top:this.top+"px",left:this.left+"px"});return this},injectHtml:function(a){switch(this.getControlType()){case "dockbar":case "toolbar":case "window":$(this.getElementId()+
|
|
" > section").append(a);break;case "buttonGroup":$(this.getElementId()+" > div").append(a);break;case "menu":$(".picozu > header > .header").append(a);break;case "contextmenu":$(".picozu").append(a);break;default:$(this.getElementId()).append(a)}return this},show:function(){if(!1===this.isVisible()){this.visible=!0;if("panel"===this.getControlType()){var a=this.parent.getElementId();"dockbar"===this.parent.getControlType()?$(a+" "+this.getElementId()+" > section").fadeIn():"propbar"===this.parent.getControlType()&&
|
|
($(a+" "+this.getElementId()).fadeIn(),this.parent.show())}else if("buttonGroup"===this.getControlType())$(this.getElementId()+" div").fadeIn(),$(this.getElementId()).css({height:"32px"}).addClass("pressed");else{if("window"===this.getControlType()){var c=$(this.getElementId());!0===this.isModal()&&c.parent(".pico-modal-overlay").fadeIn();c.fadeIn();!0===this.isCenter()&&(this.getWorkspace(),a=$(".picozu > section").width()/2-c.width()/2,c=$(".picozu > section").height()/2-c.height()/2,this.move(a,
|
|
c))}else $(this.getElementId()).fadeIn();$(".pico-taskbar .pico-task."+this.getControlType()+'[data-id="'+this.getId()+'"]').addClass("open")}this.onShow.call(this)}return this},hide:function(){if(!0===this.isVisible()){this.visible=!1;if("panel"===this.getControlType()){var a=this.parent.getElementId();"dockbar"===this.parent.getControlType()?$(a+" "+this.getElementId()+" > section").hide():"propbar"===this.parent.getControlType()&&$(a+" "+this.getElementId()).hide()}else"buttonGroup"===this.getControlType()?
|
|
($(this.getElementId()+" div").fadeOut(),$(this.getElementId()).css({width:"32px","padding-left":"0",height:"32px"}).removeClass("pressed")):("window"===this.getControlType()?(a=$(this.getElementId()),!0===this.isModal()&&a.parent(".pico-modal-overlay").fadeOut(),a.fadeOut()):$(this.getElementId()).fadeOut(),$(".pico-taskbar .pico-task."+this.getControlType()+'[data-id="'+this.getId()+'"]').removeClass("open"));this.onHide.call(this)}return this},onRedraw:function(){},onResize:function(){},onApply:function(){},
|
|
onBuild:function(){},onCreate:function(){},onDestroy:function(){},onShow:function(){},onHide:function(){},onClick:function(){},onDblClick:function(){},destroy:function(){this.__destructor()},addButton:function(a){a.mode="undefined"!==typeof a.mode?a.mode:"input";a.type="undefined"!==typeof a.type?a.type:"ok";a.title="undefined"!==typeof a.title?a.title:!1;var c="";"input"===a.mode?c+='<input type="button"':"a"===a.mode&&(c+='<a href="#"');c+=' class="'+(!1!==a.title?"tips ":"")+"button "+a.type+"-btn "+
|
|
a.cssClass+'"';!1!==a.title&&(c+=' title="'+a.title+'"');if("undefined"!==typeof a.data)for(var b=0;b<a.data.length;b++)c+=" data-"+a.data[b].key+'="'+a.data[b].value+'"';"input"===a.mode?c+=' value="'+a.value+'" />':"a"===a.mode&&(c+=">"+a.value+"</a>");return c},addElement:function(a,c){var b="",d=null,e=this,f=null,g=null,h="",j="";"window"!==this.getControlType()&&(j=this.parent.getElementId());"undefined"!==typeof c&&(h=" "+c);d=j+" "+this.getElementId();f=d+" section"+h;switch(a.type){case picozu.CONTROL_SLIDER_COMBO:a.value1=
|
|
"undefined"!==typeof a.value1?a.value1:0;a.step1="undefined"!==typeof a.step1?a.step1:1;a.minValue1="undefined"!==typeof a.minValue1?a.minValue1:-100;a.maxValue1="undefined"!==typeof a.maxValue1?a.maxValue1:100;d=a.onCreate instanceof Function?a.onCreate:function(){$(this).parent().children(".pico-slider-value").val(a.value1)};g=a.onSlide instanceof Function?a.onSlide:function(c,b){$(this).parent().children(".pico-slider-value").val(b.value);e.getWorkspace().setParam(a.property1,b.value);a.callback instanceof
|
|
Function&&a.callback.call(e.getWorkspace(),b.value)};f=a.onStop instanceof Function?a.onStop:function(){};b='<div class="fieldsetwrap"><fieldset>';!1!==a.legend1&&(b+="<legend>"+a.legend1+"</legend>");b+='<div id="'+a.handle1+'" class="pico-slider"></div><input type="text" class="pico-slider-value" value="'+a.value1+'" /></fieldset></div><div class="offset"><div id="'+a.handle2+'" class="pico-merge"><a class="pico-button gui-btn arrowleft"></a><input type="text" class="pico-textinput char3" value="'+
|
|
a.value2+'"><a class="pico-button gui-btn arrowright"></a></div></div>';$(this.getElementId()+" section"+h).append(b);$("#"+a.handle1).slider({value:a.value1,min:a.minValue1,max:a.maxValue1,step:a.step1,create:d,slide:g,stop:f});$("#"+a.handle1).parent().children(".pico-slider-value").on("keyup.picozu",function(){var c=$(this).val();c<a.maxValue1&&c>a.minValue1&&$(this).parent().find(".pico-slider").slider("option","value",c)}).on("focusout",function(){var c=$(this).val();c<a.maxValue1&&c>a.minValue1&&
|
|
$(this).parent().find(".pico-slider").slider("option","value",c)});$(".picozu").on("click","#"+a.handle2+" .arrowleft",function(){var c=$(this).parent().children(".pico-textinput"),b=parseInt(c.val())-1;b>=a.minValue2&&(c.val(b),"undefined"!==typeof a.property2&&e.getWorkspace().setParam(a.property2,b),a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b))});$(".picozu").on("click","#"+a.handle2+" .arrowright",function(){var c=$(this).parent().children(".pico-textinput"),b=parseInt(c.val())+
|
|
1;b<=a.maxValue2&&(c.val(b),"undefined"!==typeof a.property2&&e.getWorkspace().setParam(a.property2,b),a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b))});$(".picozu").on("change","#"+a.handle2+" .pico-textinput",function(){var c=$(this),b=parseInt(c.val());(b>a.maxValue2||b<a.minValue2)&&c.val(a.value2);"undefined"!==typeof a.property2&&e.getWorkspace().setParam(a.property2,b);a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b)}).on("focusout","#"+a.handle2+" .pico-textinput",
|
|
function(){var c=$(this),b=parseInt(c.val());(b>a.maxValue2||b<a.minValue2)&&c.val(a.value2);"undefined"!==typeof a.property2&&e.getWorkspace().setParam(a.property2,b);a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b)});break;case picozu.CONTROL_SLIDER:a.value="undefined"!==typeof a.value?a.value:0;a.step="undefined"!==typeof a.step?a.step:1;a.min="undefined"!==typeof a.min?a.min:-100;a.max="undefined"!==typeof a.max?a.max:100;d=a.onCreate instanceof Function?a.onCreate:function(){$(this).parent().children(".pico-slider-value").val(a.value)};
|
|
g=a.onSlide instanceof Function?a.onSlide:function(c,b){$(this).parent().children(".pico-slider-value").val(b.value);e.getWorkspace().setParam(a.property,b.value);a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b.value)};f=a.onStop instanceof Function?a.onStop:function(){};b="<fieldset>";!1!==a.legend&&(b+="<legend>"+a.legend+"</legend>");b+='<div id="'+a.handle+'" class="pico-slider"></div><input'+("undefined"!==typeof a.name?' name="'+a.name+'"':"")+' type="text" class="pico-textinput pico-slider-value'+
|
|
("undefined"!==typeof a.cssClass?" "+a.cssClass:"")+'" value="'+a.value+'" /></fieldset>';$(j+" "+this.getElementId()+" section"+h).append(b);$(j+" #"+a.handle).slider({value:a.value,min:a.minValue,max:a.maxValue,step:a.step,create:d,slide:g,stop:f});$(j+" #"+a.handle).parent().children(".pico-slider-value").on("change",function(){var c=$(this).val();c<a.maxValue&&c>a.minValue&&$(this).parent().find(".pico-slider").slider("option","value",c)}).on("focusout",function(){var c=$(this).val();c<a.maxValue&&
|
|
c>a.minValue&&$(this).parent().find(".pico-slider").slider("option","value",c)});break;case picozu.CONTROL_SEPARATOR:$(f).append("<hr />");break;case picozu.CONTROL_LEFTRIGHT:a.step="undefined"!==typeof a.step?a.step:1;b="";!1!==a.legend&&(b+='<span class="'+a.legendClass+'">'+a.legend+"</span>");"undefined"!==typeof a.extra&&(b+=a.extra);b+="<div "+("undefined"!==typeof a.tip?'title="'+a.tip+'" ':" ")+'class="'+("undefined"!==typeof a.tip?"tips ":"")+"pico-mergeForm "+a.controlClass+'"><a class="pico-button gui-btn arrowleft"/></a><input type="text" '+
|
|
("undefined"!==typeof a.handle?'id="'+a.handle+'" ':"")+'value="'+a.value+'" class="pico-textinput char'+a.size+""+("undefined"!==typeof a.cssClass?" "+a.cssClass:"")+'" maxlength="'+a.size+'" /><a class="pico-button gui-btn arrowright"/></a></div>';$(f).append(b);$(d).on("click","."+a.controlClass+" .arrowleft",function(){var c=$(this).parent().children(".pico-textinput"),b=parseFloat(c.val())-a.step;b>=a.minValue&&(c.val(b),"undefined"!==typeof a.property&&e.getWorkspace().setParam(a.property,b),
|
|
a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b))}).on("click","."+a.controlClass+" .arrowright",function(){var c=$(this).parent().children(".pico-textinput"),b=parseFloat(c.val())+a.step;b<=a.maxValue&&(c.val(b),"undefined"!==typeof a.property&&e.getWorkspace().setParam(a.property,b),a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b))}).on("keyup.picozu","."+a.controlClass+" .pico-textinput",function(c){var b=$(this),d=parseFloat(b.val());13===c.keyCode&&(/\D/.test(d)?
|
|
b.addClass("error"):((d>a.maxValue||d<a.minValue)&&b.val(a.value),"undefined"!==typeof a.property&&e.getWorkspace().setParam(a.property,d),a.callback instanceof Function&&a.callback.call(e.getWorkspace(),d),b.removeClass("error")))}).on("focusout","."+a.controlClass+" .pico-textinput",function(){var c=$(this),b=parseFloat(c.val());/\D/.test(b)?c.addClass("error"):((b>a.maxValue||b<a.minValue)&&c.val(a.value),"undefined"!==typeof a.property&&e.getWorkspace().setParam(a.property,b),a.callback instanceof
|
|
Function&&a.callback.call(e.getWorkspace(),b),c.removeClass("error"))});break;case picozu.CONTROL_SELECT:var k=[],b="<fieldset>";"undefined"!==typeof a.legend&&(b+="<label"+("undefined"!==typeof a.legendClass?' class="'+a.legendClass+'"':"")+">"+a.legend+" "+("undefined"!==typeof a.tips?'<span class="pico-help tips" title="'+a.tips+'">?</span>':"")+"</label>");b+="<select"+("undefined"!==typeof a.name?' name="'+a.name+'"':"")+' id="'+a.handle+'" class="pico-select'+("undefined"!==typeof a.cssClass?
|
|
" "+a.cssClass:"")+'"></select></fieldset>';$(f).append(b);if("string"===typeof a.data)$.ajax({url:a.data,dataType:"jsonp",success:function(c){$.each(c,function(c,b){"undefined"!==typeof a.special&&"font"===a.special?k.push('<option style="font-family: '+b.name+'" value="'+b.id+'">'+b.name+"</option>"):k.push('<option value="'+b.id+'">'+b.name+"</option>")});$("select#"+a.handle).append(k.join(""))}});else if("object"===typeof a.data){for(h=0;h<a.data.length;h++)"undefined"!==typeof a.special&&"font"===
|
|
a.special?k.push('<option style="font-family: '+a.data[h].name+'" value="'+a.data[h].name+'">'+a.data[h].name+"</option>"):k.push("<option "+(!0===a.data[h].selected?'selected="selected" ':"")+'value="'+a.data[h].handle+'">'+a.data[h].name+"</option>");$("select#"+a.handle).append(k.join(""))}$(d).on("change","select#"+a.handle,function(){var c=$(this).val();"undefined"!==typeof a.property&&e.getWorkspace().setParam(a.property,c);a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c)});
|
|
break;case picozu.CONTROL_CHECKBOX:b="<fieldset><label>"+a.legend+" "+("undefined"!==typeof a.tips?'<span class="pico-help tips" title="'+a.tips+'">?</span>':"")+"</label><input"+("undefined"!==typeof a.name?' name="'+a.name+'"':"")+' value="'+("undefined"!==typeof a.value?a.value:"true")+'" id="'+a.handle+'" type="checkbox" '+(!0===a.checked?'checked="checked" ':"")+'class="pico-checkbox" /></fieldset>';$(f).append(b);$(d).on("click","#"+a.handle,function(){var c=!0===$(this).prop("checked")?!0:
|
|
!1;e.getWorkspace().setParam(a.property,c);a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c)});break;case picozu.CONTROL_FILE_UPLOAD:b="<fieldset><label>"+a.legend+'</label><a href="#" id="'+a.handle+'_btn" class="pico-button ok-btn right">'+a.title+'</a><input id="'+a.handle+'_upl" type="file" class="pico-file hidden" /></fieldset>';$(f).append(b);$(d).on("change","#"+a.handle+"_upl",function(c){c=c||window.event;c.preventDefault();c=c.originalEvent||c;e.getWorkspace().loadFile(c.target.files[0],
|
|
a.callback)}).on("click","#"+a.handle+"_btn",function(){$("#"+a.handle+"_upl").trigger("click");return!1});break;case picozu.CONTROL_OPTIONBOX:b='<fieldset id="'+a.handle+'"><legend>'+a.legend+"</legend>";if("undefined"!==typeof a.options)for(h=0;h<a.options.length;h++)b+="<label>"+a.options[h].legend+'</label><input name="'+a.handle+'" type="radio" '+(!0===a.options[h].active?'checked="checked" ':"")+'value="'+a.options[h].value+'" class="pico-optionbox" />';$(f).append(b+"</fieldset>");$(d).on("click",
|
|
"#"+a.handle+" .pico-optionbox",function(){var c=$(this).val();e.getWorkspace().setParam(a.property,c);a.callback instanceof Function&&a.callback.call(e.getWorkspace())});break;case picozu.CONTROL_BUTTONGRID_TOGGLE:b='<div class="pico-mergeForm '+a.controlClass+'">';for(h=0;h<a.buttons.length;h++)b+='<a data-id="'+h+'" '+("undefined"!==typeof a.buttons[h].tip?'title="'+a.buttons[h].tip+'" ':" ")+'class="'+("undefined"!==typeof a.buttons[h].tip?"tips ":"")+'pico-button gui-btn" data-value="'+a.buttons[h].states[0]+
|
|
'" /></a>';b+="</div>";$(f).append(b);$(d).on("click","."+a.controlClass+" .pico-button",function(){var c=$(this),b=c.data("id");c.toggleClass("selected");c.hasClass("selected")?c.data("value",a.buttons[b].states[1]):c.data("value",a.buttons[b].states[0]);c=c.data("value");"undefined"!==typeof a.buttons[b].property&&e.getWorkspace().setParam(a.buttons[b].property,c);a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c,a.buttons[b].property)});break;case picozu.CONTROL_BUTTONGRID:b='<div class="pico-mergeForm '+
|
|
a.controlClass+'">';for(h=0;h<a.buttons.length;h++)b+="<a "+("undefined"!==typeof a.buttons[h].tip?'title="'+a.buttons[h].tip+'" ':" ")+'class="'+("undefined"!==typeof a.buttons[h].tip?"tips ":"")+"pico-button gui-btn"+("undefined"!==typeof a.buttons[h].selected&&!0===a.buttons[h].selected?" selected":"")+'" data-value="'+a.buttons[h].value+'" /></a>';b+="</div>";$(f).append(b);$(d).on("click","."+a.controlClass+" .pico-button",function(){$("."+a.controlClass+" > .pico-button").removeClass("selected");
|
|
var c=$(this),b=c.data("value");c.addClass("selected");"undefined"!==typeof a.property&&e.getWorkspace().setParam(a.property,b);a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b)});break;case picozu.CONTROL_BUTTON:b='<fieldset><a href="#" id="'+a.handle+'" class="pico-button ok-btn">'+a.legend+"</a></fieldset>";$(f).append(b);$(d).on("click","#"+a.handle,function(){a.callback.call(e.getWorkspace())});break;case picozu.CONTROL_TEXTINPUT:b="<fieldset><label"+("undefined"!==typeof a.legendClass?
|
|
' class="'+a.legendClass+'"':"")+">"+a.legend+" "+("undefined"!==typeof a.tips?'<span class="pico-help tips" title="'+a.tips+'">?</span>':"")+"</label><input "+("undefined"!==typeof a.cssStyle?'style="'+a.cssStyle+'" ':"")+("undefined"!==typeof a.readonly&&!0===a.readonly?"readonly ":"")+'type="text" id="'+a.handle+'" class="pico-textinput'+("undefined"!==typeof a.cssClass?" "+a.cssClass:"")+'" '+("undefined"!==typeof a.value?'value="'+a.value+'"':"")+" "+("undefined"!==typeof a.placeholder?'placeholder="'+
|
|
a.placeholder+'"':"")+" /></fieldset>";$(f).append(b);$(d).on("keyup.picozu","#"+a.handle,function(c){13===c.keyCode&&(c=$(this).val(),a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c))}).on("focusout","#"+a.handle,function(){var c=$(this).val();a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c)});if("undefined"!==typeof a.autoselect&&!0===a.autoselect)$(d).on("focus","#"+a.handle,function(){var a=$(this);a.select();a.mouseup(function(){a.unbind("mouseup");return!1})});
|
|
break;case picozu.CONTROL_TEXTINPUT_FILE:b="<fieldset><label"+("undefined"!==typeof a.legendClass?' class="'+a.legendClass+'"':"")+">"+a.legend+" "+("undefined"!==typeof a.tips?'<span class="pico-help tips" title="'+a.tips+'">?</span>':"")+'</label><span class="extension-label">.'+a.extension+"</span><input "+("undefined"!==typeof a.readonly&&!0===a.readonly?"readonly ":"")+'type="text" id="'+a.handle+'" class="extension-input pico-textinput'+("undefined"!==typeof a.cssClass?" "+a.cssClass:"")+'" '+
|
|
("undefined"!==typeof a.value?'value="'+a.value+'"':"")+" "+("undefined"!==typeof a.placeholder?'placeholder="'+a.placeholder+'"':"")+" /></fieldset>";$(f).append(b);$(d).on("keyup.picozu","#"+a.handle,function(c){13===c.keyCode&&(c=$(this).val(),a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c))}).on("focusout","#"+a.handle,function(){var c=$(this).val();a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c)});if("undefined"!==typeof a.autoselect&&!0===a.autoselect)$(d).on("focus",
|
|
"#"+a.handle,function(){var a=$(this);a.select();a.mouseup(function(){a.unbind("mouseup");return!1})});break;case picozu.CONTROL_TEXTAREA:b="<fieldset><label"+("undefined"!==typeof a.legendClass?' class="'+a.legendClass+'"':"")+">"+a.legend+" "+("undefined"!==typeof a.tips?'<span class="pico-help tips" title="'+a.tips+'">?</span>':"")+'</label><textarea id="'+a.handle+'" class="pico-textarea'+("undefined"!==typeof a.cssClass?" "+a.cssClass:"")+'" /></fieldset>';$(f).append(b);$(d).on("keyup.picozu",
|
|
"#"+a.handle,function(){var c=$(this).val();a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c)}).on("focusout","#"+a.handle,function(){var c=$(this).val();a.callback instanceof Function&&a.callback.call(e.getWorkspace(),c)});break;case picozu.CONTROL_COLORSELECT:b="<fieldset><label>"+a.legend+" "+("undefined"!==typeof a.tips?'<span class="pico-help tips" title="'+a.tips+'">?</span>':"")+'</label><div id="'+a.handle+'" class="pico-control-colorselect"><input'+("undefined"!==typeof a.name?
|
|
' name="'+a.name+'"':"")+' class="input" value="'+Color.color2Exp("hex",a.value)+'" type="hidden" /><span style="background-color: '+Color.color2Exp("rgb",a.value)+'"></span><b class="caret"></b></div></fieldset>';$(f).append(b);var m=a.value;$(d).on("click","#"+a.handle,function(){var c=this;e.getWorkspace().openWindow("colorpicker",{handle:"colorpicker",name:l("%Color"),left:200,parent:e.getWorkspace(),top:150,width:320,template:'<div id="'+a.handle+'-picker" class="pico-color-picker"></div>',onCreate:function(){var c=
|
|
this;c.heap.color=m;this.addFooter(picozu.CONTROL_COLORSELECT_HTML.replace(/{rgbColor}/g,Color.color2Exp("rgb",a.value)).replace(/{hexColor}/g,Color.rgb2hex("rgb",a.value)));$("#"+a.handle+"-picker").colorPicker({color:m,onColorChange:function(a){c.heap.color=a;$(".pico-window-colorpicker footer .color").css({"background-color":Color.color2Exp("rgb",a)});$(".pico-window-colorpicker footer .pico-textfield").val(Color.rgb2hex(a));e.getWorkspace().updateInfoPanel({rgb:a})}});$(".pico-window-colorpicker footer").on("keyup.picozu",
|
|
".pico-textfield",function(){var a=$(this).val();/(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(a)?(c.heap.color=Color.hex2rgb(a),$(".pico-window-colorpicker footer .color").css({"background-color":Color.color2Exp("rgb",c.heap.color)}),$(this).removeClass("error")):$(this).addClass("error")}).on("focusout",".pico-textfield",function(){var a=$(this).val();/(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(a)?(c.heap.color=Color.hex2rgb(a),$(".pico-window-colorpicker footer .color").css({"background-color":Color.color2Exp("rgb",
|
|
c.heap.color)}),$(this).removeClass("error")):$(this).addClass("error")})},onApply:function(){var b=this.heap.color;e.getWorkspace().setParam(a.property,b);$(c).children("span").css({"background-color":Color.color2Exp("rgb",b)});$(c).children("input.input").val(Color.color2Exp("hex",b));a.callback instanceof Function&&a.callback.call(e.getWorkspace(),b);this.destroy()}})});break;case picozu.CONTROL_GRADIENTSELECT:b="<fieldset><label>"+a.legend+" "+("undefined"!==typeof a.tips?'<span class="pico-help tips" title="'+
|
|
a.tips+'">?</span>':"")+'</label><div id="'+a.handle+'" class="pico-control-gradientselect"><span style="background-color: '+Color.color2Exp("rgb",a.value)+'"></span><b class="caret"></b></div></fieldset>';$(f).append(b);$(d).on("click","#"+a.handle,function(){e.getWorkspace().openWindow("gradient")});break;case picozu.CONTROL_IMAGE:$(f).append('<img src="'+a.image+'"'+("undefined"!==typeof a.alt?' alt="'+a.alt+'"':"")+("undefined"!==typeof a.title?' title="'+a.title+'"':"")+("undefined"!==typeof a.cssClass?
|
|
' class="'+a.cssClass+'"':"")+" />");break;default:$(f).append(a.template)}return this},__destructor:function(){var a=null;switch(this.getControlType()){case "toolbar":for(var c=0;c<this.buttons.length;c++)this.buttons[c].destroy();a="toolbars";break;case "dockbar":for(c=0;c<this.panels.length;c++)this.panels[c].destroy();a="dockbars";break;case "propbar":for(c=0;c<this.panels.length;c++)this.panels[c].destroy();a="propbars";break;case "panel":a="panels";break;case "button":case "buttonGroup":$(this.getElementId()).off("click").off("dblclick").remove();
|
|
a="buttons";break;case "menu":$(this.getElementId()).remove();a="menus";break;case "contextmenu":$(this.getElementId()).remove();a="contextmenus";break;case "window":$.fn.tipsy.revalidate(),!0===this.isModal()?$(this.getElementId()).parent(".pico-modal-overlay").remove():$(this.getElementId()).remove(),$('.pico-taskbar .pico-task.window[data-id="'+this.getId()+'"]').remove(),this.parent.windows[this.getId()]=null,this.parent.windows.splice(this.getId(),1)}null!==a&&(c=this.parent[a].findIndexM(this.getHandle()),
|
|
!1!==c&&this.parent[a].splice(c,1));$(this.getElementId()).remove();this.onDestroy.call(this);this.getWorkspace().log(l("%"+this.getControlType())+" #"+this.getId()+" "+l("%destroyed"),l("%UI"))}});
|
|
picozu.objects.binary=function(a,c,b){var d=a,e=c||0,f=b||d.length;this.getLen=function(){return d.length};this.getByteAt=function(a){return d.charCodeAt(a+e)&255};this.getBytesAt=function(a,c){for(var b=[],f=0;f<c;f++)b[f]=d.charCodeAt(a+f+e)&255;return b};this.getRawData=function(){return d};this.getLength=function(){return f};this.getSByteAt=function(a){a=this.getByteAt(a);return 127<a?a-256:a};this.getShortAt=function(a,c){var b=c?(this.getByteAt(a)<<8)+this.getByteAt(a+1):(this.getByteAt(a+1)<<
|
|
8)+this.getByteAt(a);0>b&&(b+=65536);return b};this.getSShortAt=function(a,c){var b=this.getShortAt(a,c);return 32767<b?b-65536:b};this.getLongAt=function(a,c){var b=this.getByteAt(a),d=this.getByteAt(a+1),e=this.getByteAt(a+2),f=this.getByteAt(a+3),b=c?(((b<<8)+d<<8)+e<<8)+f:(((f<<8)+e<<8)+d<<8)+b;0>b&&(b+=4294967296);return b};this.getSLongAt=function(a,c){var b=this.getLongAt(a,c);return 2147483647<b?b-4294967296:b};this.getStringAt=function(a,c){for(var b=[],d=this.getBytesAt(a,c),e=0;e<c;e++)b[e]=
|
|
String.fromCharCode(d[e]);return b.join("")};this.getCharAt=function(a){return String.fromCharCode(this.getByteAt(a))};this.toBase64=function(){return window.btoa(d)};this.fromBase64=function(a){d=window.atob(a)}};
|
|
(function(a){function c(a,c){this.newImage=!0;this.y=this.x=128;this.z=1;this.hueBar=c;this.image=a;this.ImageData=null;this.paint()}function b(){this.color=[0,0,0]}c.prototype.paint=function(){var a=this.image.width,c=this.image.height,b=Math.round(this.x*a/255),g=Math.round(this.y*c/255);(this.newImage||!this.image)&&this._build(this.z,a,c);a=this.image.getContext("2d");a.putImageData(this.ImageData,0,0);c=this.getColor();this.drawPointer(a,b,g,0.3*c[0]+0.59*c[1]+0.114*c[2])};c.prototype.hsv2rgb=
|
|
function(a,c,b){var g,h,j,k,m,n;if(0===c)j=n=m=b;else switch(g=c/255,c=b/255,h=360===a?0:a/60,a=Math.floor(h),h-=a,k=c*g,g=b-b*g,a){case 0:j=c-k*(1-h);m=Math.round(b);n=Math.round(255*j);j=Math.round(g);break;case 1:m=Math.round(255*(c-k*h));n=Math.round(b);j=Math.round(g);break;case 2:j=c-k*(1-h);m=Math.round(g);n=Math.round(b);j=Math.round(255*j);break;case 3:j=c-k*h;m=Math.round(g);n=Math.round(255*j);j=Math.round(b);break;case 4:m=Math.round(255*(c-k*(1-h)));n=Math.round(g);j=Math.round(b);break;
|
|
case 5:j=c-k*h,m=Math.round(b),n=Math.round(g),j=Math.round(255*j)}return[m,n,j]};c.prototype.drawPointer=function(a,c,b,g){a.beginPath();a.lineWidth=0.5;a.strokeStyle=128>g?"rgb(255, 255, 255)":"rgb(0, 0, 0)";a.moveTo(c-3.5,b+0.5);a.lineTo(c+4.5,b+0.5);a.moveTo(c+0.5,b-3.5);a.lineTo(c+0.5,b+4.5);a.stroke()};c.prototype._build=function(a,c,b){this.image||(this.image=document.createElement("canvas"),this.image.width=c,this.image.height=b);var g=0,h,j,k,m,n=this.image.getContext("2d").getImageData(0,
|
|
0,c,b),s;if(this.hueBar){h=1;for(m=b-1;0<=m;m--){a=m/b;a=360*(a-Math.floor(a));for(k=0;k<c;k++)j=1-k/c,s=this.hsv2rgb(a,255*h,255*j),n.data[g++]=s[0],n.data[g++]=s[1],n.data[g++]=s[2],n.data[g++]=255}}else{a=360*(a-Math.floor(a));for(m=0;m<b;m++){j=1-m/b;for(k=0;k<c;k++)h=k/c,s=this.hsv2rgb(a,255*h,255*j),n.data[g++]=s[0],n.data[g++]=s[1],n.data[g++]=s[2],n.data[g++]=255}}this.newImage=!1;this.image.getContext("2d").putImageData(n,0,0);this.ImageData=n};c.prototype.setPosition=function(a,c){this.x=
|
|
a;this.y=c;this.paint()};c.prototype.setColor=function(a){a=Color.rgb2hsv(a[0],a[1],a[2]);this.hueBar?(this.z=a[1]/255,this.setPosition(255-a[2],255-255*(a[0]/360))):(this.z=a[0]/360,this.setPosition(a[1],255-a[2]));this._redraw()};c.prototype.getColor=function(){var a=this.hueBar?1-this.y/255:this.z,c=this.hueBar?255:this.x,b=this.hueBar?this.x:this.y,a=360*(a-Math.floor(a));return this.hsv2rgb(a,c,255-b)};c.prototype._redraw=function(){this.newImage=!0;this.paint()};b.prototype.init=function(b,
|
|
e){this.onColorChange=e?e:function(){};this._buildUI(b);this.canvasMap=this.element.find("canvas")[0];this.canvasBar=this.element.find("canvas")[1];this.colorMap=new c(this.canvasMap,!1);this.colorBar=new c(this.canvasBar,!0);a(this.canvasMap).data("CM",this.colorMap).data("CB",this.colorBar);a(this.canvasBar).data("CB",this.colorMap).data("CM",this.colorBar);this._registerEvents();return this};b.prototype._registerEvents=function(){var c=this;this.mouseStarted=!1;a(this.canvasBar).add(this.canvasMap).on("mousedown",
|
|
null,function(b){c.mouseStarted=!0;var f=a(this).offset();c._changed(b.pageX-f.left,b.pageY-f.top,this)}).on("mouseup",function(){c.mouseStarted=!1}).on("mouseout",function(){c.mouseStarted=!1}).on("mousemove",function(b){if(c.mouseStarted){var f=a(this).offset();c._changed(b.pageX-f.left,b.pageY-f.top,this)}})};b.prototype._initialColor=function(a){return this.setColor(a)};b.prototype.setColor=function(a){this.color=a;this.colorMap.setColor(this.color);this.colorBar.setColor(this.color);return this};
|
|
b.prototype._changed=function(c,b,f){function g(a,c,b){c=c||0;b=b||255;a<c&&(a=c);a>b&&(a=b);return Math.round(a)}c=g(255*c/f.width,0,255);b=g(255*b/f.height,0,255);a(f).data("CM").setPosition(c,b);b=a(f).data("CM").getColor();a(f).data("CB").setColor(b);b&&this.colorChanged(b)};b.prototype.colorChanged=function(a){this.color=a;if(this.onColorChange)this.onColorChange(a)};b.prototype.getColor=function(){return this.color};b.prototype._buildUI=function(c){var b=this;a(c).append('<canvas width="260" height="260" class="pico-color-map" name="colormap"></canvas>').append('<canvas width="30" height="260" class="pico-color-huebar" name="huebar"></canvas>').each(function(){b.element=
|
|
a(this)})};a.fn.colorPicker=function(c){var e={color:[0,0,0],onColorChange:function(){}};return this.each(function(){c&&a.extend(e,c);if(!a(this).data("canvas-color-picker")){var f=(new b).init(this,e.onColorChange)._initialColor(e.color);f.colorMap._redraw();f.colorBar._redraw();a(this).data("canvas-color-picker",f)}})}})($);
|
|
picozu.objects.tool=Class.extend({prevX:0,points:[],count:0,prevY:0,cached:null,start:function(a,c){this.prevX=a;this.prevY=c},end:function(){},dblclick:function(){},scroll:function(){},move:function(a,c){this.prevX=a;this.prevY=c},_normalizeTempCoords:function(a,c,b,d){var e=$(this.workspace.getSelectedTab().getElementId()+" > section"),f=this.workspace.getSelectedLayer().getCoords();return{x1:a-e.scrollLeft()+f.left,y1:c-e.scrollTop()+f.top,x:b-e.scrollLeft()+f.left,y:d-e.scrollTop()+f.top}},__constructor:function(a,
|
|
c,b,d){this.params=c;this.layer=a;this.workspace=b;this.temp=d;this.points=[];this.count=0},__destructor:function(){var a=this.layer.getHeap();a.b=null;a.x=null;this.workspace.setParam("brushSize",this._brushSize)},_brush:function(a){var c=this.workspace.getParam("brushSize"),b=this.workspace.getParam("foregroundColor"),d=2*c,e=this.layer.getHeap();e.b=document.createElement("canvas");!0===a&&(this.layer.getContext().globalCompositeOperation="destination-out");e.b.width=d;e.b.height=d;e.x=e.b.getContext("2d");
|
|
e.x.globalCompositeOperation="source-over";a=e.x.createRadialGradient(c,c,this.workspace.getParam("brushHardness")/100*c,c,c,c);a.addColorStop(0,"rgba("+b[0]+", "+b[1]+", "+b[2]+", "+0.1*this.workspace.getParam("opacity")+")");a.addColorStop(0.95,"rgba("+b[0]+", "+b[1]+", "+b[2]+", 0)");a.addColorStop(1,"rgba("+b[0]+", "+b[1]+", "+b[2]+", 0)");e.x.fillStyle=a;e.x.fillRect(0,0,d,d);e.x.globalCompositeOperation="source-in";e.x.rect(0,0,d,d)}});
|
|
picozu.objects.brush=Class.extend({workspace:null,layer:null,prevX:0,prevY:0,points:[],count:0,start:function(a,c){this.prevX=a;this.prevY=c},end:function(){},move:function(){},__constructor:function(a,c,b){this.workspace=b;this.layer=a;this.points=[];this.count=0;this._opacity=this.workspace.getParam("opacity");this._brushSize=this.workspace.getParam("brushSize");this._globalCompositeOperation=this.layer.getContext().globalCompositeOperation;/ AppleWebKit\//.test(navigator.userAgent)?this.layer.getContext().globalCompositeOperation=
|
|
"darker":this.layer.getContext().globalCompositeOperation="source-over";this.workspace.setParam("brushSize",1);this.workspace.setParam("opacity",4)},__destructor:function(){this.workspace.setParam("opacity",this._opacity);this.workspace.setParam("brushSize",this._brushSize);this.layer.getContext().globalCompositeOperation=this._globalCompositeOperation},_setStroke:function(a){var c=this.workspace.getParam("foregroundColor");this.layer.getContext().strokeStyle="rgba("+c[0]+", "+c[1]+","+c[2]+", "+
|
|
a*this.workspace.getParam("opacity")+")";return this},_setFill:function(a){var c=this.workspace.getParam("backgroundColor");this.layer.getContext().fillStyle="rgba("+c[0]+", "+c[1]+","+c[2]+", "+a*this.workspace.getParam("opacity")+")";return this},_setStrokeColor:function(a,c){this.layer.getContext().strokeStyle="rgba("+a[0]+", "+a[1]+","+a[2]+", "+c+")";return this},_setFillColor:function(a,c){this.layer.getContext().fillStyle="rgba("+a[0]+", "+a[1]+","+a[2]+", "+c+")";return this},_setLineWidth:function(){this.layer.getContext().lineWidth=
|
|
this.workspace.getParam("brushSize");return this}});
|
|
picozu.objects.modal=function(a){this.template='<div class="pico-modal-overlay opaque"><div class="pico-modal pico-window"><header><span class="name"></span></header><section></section><footer></footer></div></div>';this.settings={background:"black",width:"300px",leftButtons:[l("%Yes")],rightButtons:[l("%No")]};this.__destructor=function(){$(".pico-modal-overlay").remove()};this.__constructor=function(a){var b=this;"undefined"!==typeof a&&(this.settings=a);$(".picozu").append(this.template);$(window).on("resize",
|
|
function(){b._resize()});return this};this.open=function(a){if(this.isOpen())return!1;"undefined"!==typeof a.width&&(this.settings.width=a.width);"undefined"!==typeof a.rightButtons&&(this.settings.rightButtons=a.rightButtons);"undefined"!==typeof a.leftButtons&&(this.settings.leftButtons=a.leftButtons);$(".pico-modal").css({width:this.settings.width});this._resize();$(".pico-modal header span").html(a.title);var b="",d=this.settings.leftButtons,e=this.settings.rightButtons;if(d)for(var f=this.settings.leftButtons.length-
|
|
1;0<=f;f--)b+='<input type="button" class="pico-button ok-btn" data-id="1" value="'+this.settings.leftButtons[f]+'" />';if(e)for(f=this.settings.rightButtons.length-1;0<=f;f--)b+='<input type="button" class="pico-button gui-btn cancel-button" data-id="0" value="'+this.settings.rightButtons[f]+'" />';!d&&!e&&(b+='<input type="button" class="pico-button ok-btn right" value="'+l("%main.ok")+'" />');$(".pico-modal footer").html(b);$(".pico-modal section").html("<p>"+a.text+"</p>");this._listen();$(".pico-modal-overlay").fadeIn();
|
|
$(".pico-modal").show();a.onClick instanceof Function&&(this.onClick=a.onClick);return this};this.isOpen=function(){return"block"===$(".pico-modal").css("display")};this.close=function(){$(".pico-modal-overlay").remove();$(".pico-modal-overlay").fadeOut();$(".picozu").append(this.template);this._resize()};this._listen=function(){var a=this;$(".pico-modal footer input").each(function(){$(this).attr({id:this.value})});$(".pico-modal footer input").click(function(){var b=parseInt($(this).data("id"));
|
|
a._action(b)})};this._action=function(a){1===a&&this.close();this.onClick(a);this.close()};this._resize=function(){var a=$(".pico-modal");a.css({top:($(".picozu > section").height()-a.height())/2+"px",left:($(".picozu > section").width()-a.width())/2+"px"})};this.onClick=function(){};this.destroy=function(){this.__destructor()};return this.__constructor(a)};
|
|
picozu.objects.notifier=function(a){this.content=this.title="";this.timeout=8E3;this.showTime=!0;this.img=picozu.DEFAULT_PATH+"images/logos/icon_32x32.png";this.achievement=this.tip=this.error=this.border=!1;this.click=null;this.container=$(".pico-notifications");this.__constructor=function(){return this};this.__destructor=function(){this.container.remove()};this.trigger=function(a){function b(a){var c=[[2,"One second","1 second from now"],[60,"seconds",1],[120,"One minute","1 minute from now"],[3600,
|
|
"minutes",60],[7200,"One hour","1 hour from now"],[86400,"hours",3600],[172800,"One day","tomorrow"],[604800,"days",86400],[1209600,"One week","next week"],[2419200,"weeks",604800],[4838400,"One month","next month"],[29030400,"months",2419200],[58060800,"One year","next year"],[290304E4,"years",29030400]],b=(new Date-a)/1E3,d=1;0>b&&(b=Math.abs(b),d=1);for(var e=0,f;f=c[e++];)if(b<f[0])return"string"===typeof f[2]?f[d]:Math.floor(b/f[2])+" "+f[1];return a}"undefined"!==typeof a.title&&(this.title=
|
|
a.title);"undefined"!==typeof a.content&&(this.content=a.content);"undefined"!==typeof a.img&&(this.img=a.img);"undefined"!==typeof a.achievement&&(this.achievement=a.achievement);"undefined"!==typeof a.showTime&&(this.showTime=a.showTime);this.error=a.error;this.tip=a.tip;this.timeout=!0===this.error?15E3:!0===this.tip?2E4:8E3;"undefined"!==typeof a.timeout&&(this.timeout=a.timeout);var d=this,e,f,g,h;this.container.length||(this.container=$("<div>",{"class":"pico-notifications"}).appendTo($(".picozu")));
|
|
e=$("<div>");e.addClass("notification animated fadeInLeftMiddle slow");!0===this.error&&e.addClass("error");!0===this.tip&&e.addClass("tip");!0===this.achievement&&e.addClass("achievement");0<$(".pico-notifications .notification").length&&e.addClass("more");f=$("<div>",{click:function(){$(this).parent().is(":last-child")?($(this).parent().remove(),$(".pico-notifications .notification:last-child").removeClass("more")):$(this).parent().remove()}});f.addClass("hide");h=$("<div class='left'>");a=$("<div class='right'>");
|
|
"undefined"!==typeof this.title?(g="<h2>"+this.title+"</h2>",e.addClass("big")):g="";g=$("<div>",{html:g+("undefined"!==typeof this.content?this.content:"")});g.addClass("inner");g.appendTo(a);"undefined"!==typeof this.img?(g=$("<div>",{style:"background-image: url('"+this.img+"')"}),g.addClass("img"),g.appendTo(h),!1===this.border&&g.addClass("border"),!0===this.fill&&g.addClass("fill")):(g="undefined"!==typeof this.icon?this.icon:!0!==this.error?'"':"c",g=$('<div class="icon">').html(g),"undefined"!==
|
|
typeof this.color&&g.css("color",this.color),g.appendTo(h));h.appendTo(e);a.appendTo(e);f.appendTo(e);!1!==this.showTime&&(h=Number(new Date),g=$("<div>",{html:"<strong>"+b(h)+"</strong> "+l("%ago")}),g.addClass("time").attr("title",h),g.appendTo(a),setInterval(function(){$(".time").each(function(){var a=$(this).attr("title");$(this).html("<strong>"+b(a)+"</strong> "+l("%ago"))})},4E3));e.hover(function(){f.show()},function(){f.hide()});e.prependTo(this.container);e.show();this.timeout&&setTimeout(function(){var a=
|
|
e.prev();a.hasClass("more")&&(a.is(":first-child")||e.is(":last-child"))&&a.removeClass("more");e.remove()},d.timeout);"undefined"!==this.click&&null!==this.click&&(e.addClass("click"),e.on("click",null,function(a){$(a.target).is(".hide")||d.click.call(this)}));return this};return this.__constructor(a)};
|
|
picozu.objects.crypter={JsonCryptFormatter:{stringify:function(a){var c={ct:a.ciphertext.toString(CryptoJS.enc.Base64)};a.iv&&(c.iv=a.iv.toString());a.salt&&(c.s=a.salt.toString());return JSON.stringify(c)},parse:function(a){a=JSON.parse(a);var c=CryptoJS.lib.CipherParams.create({ciphertext:CryptoJS.enc.Base64.parse(a.ct)});a.iv&&(c.iv=CryptoJS.enc.Hex.parse(a.iv));a.s&&(c.salt=CryptoJS.enc.Hex.parse(a.s));return c}},encryptString:function(a,c){toReturn=CryptoJS.AES.encrypt(a,c);return toReturn=this.base64Encode(toReturn.toString())},
|
|
decryptString:function(a,c){input=this.base64Decode(a);return CryptoJS.AES.decrypt(input,c).toString(CryptoJS.enc.Utf8)},encryptObject:function(a,c){string=JSON.stringify(a);toReturn=CryptoJS.AES.encrypt(string,c,{format:this.JsonCryptFormatter});return toReturn=this.base64Encode(toReturn.toString())},decryptObject:function(a,c){input=this.base64Decode(a);toReturn=CryptoJS.AES.decrypt(input,c,{format:this.JsonCryptFormatter}).toString(CryptoJS.enc.Utf8);return JSON.parse(toReturn)},base64Encode:function(a){for(var c=
|
|
"",b=0,d=a.length,e,f,g;b<d;){e=a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);c+="==";break}f=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&
|
|
15)<<2);c+="=";break}g=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(f&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&15)<<2|(g&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return c},base64:{_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decodeArrayBuffer:function(a){var c=
|
|
new ArrayBuffer(3*(a.length/4));this.decode(a,c);return c},decode:function(a,c){var b=this._keyStr.indexOf(a.charAt(a.length-1)),d=this._keyStr.indexOf(a.charAt(a.length-2)),e=3*(a.length/4);64==b&&e--;64==d&&e--;var f,g,h,j,k=0,m=0,b=c?new Uint8Array(c):new Uint8Array(e);a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(k=0;k<e;k+=3)f=this._keyStr.indexOf(a.charAt(m++)),g=this._keyStr.indexOf(a.charAt(m++)),d=this._keyStr.indexOf(a.charAt(m++)),j=this._keyStr.indexOf(a.charAt(m++)),f=f<<2|g>>4,g=(g&15)<<
|
|
4|d>>2,h=(d&3)<<6|j,b[k]=f,64!=d&&(b[k+1]=g),64!=j&&(b[k+2]=h);return b}},base64Decode:function(a){var c=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1],b,d,e,f,g;f=a.length;
|
|
e=0;for(g="";e<f;){do b=c[a.charCodeAt(e++)&255];while(e<f&&-1==b);if(-1==b)break;do d=c[a.charCodeAt(e++)&255];while(e<f&&-1==d);if(-1==d)break;g+=String.fromCharCode(b<<2|(d&48)>>4);do{b=a.charCodeAt(e++)&255;if(61==b)return g;b=c[b]}while(e<f&&-1==b);if(-1==b)break;g+=String.fromCharCode((d&15)<<4|(b&60)>>2);do{d=a.charCodeAt(e++)&255;if(61==d)return g;d=c[d]}while(e<f&&-1==d);if(-1==d)break;g+=String.fromCharCode((b&3)<<6|d)}return g},guid:function(a,c,b){for(var d=Array(16),e=function(){for(var a,
|
|
c=0,c=0;16>c;c++)0==(c&3)&&(a=4294967296*Math.random()),d[c]=a>>>((c&3)<<3)&255;return d},f="function"==typeof Buffer?Buffer:Array,g=[],h=0;256>h;h++)g[h]=(h+256).toString(16).substr(1);e();b=c&&b||0;"string"==typeof a&&(c="binary"==a?new f(16):null,a=null);a=a||{};e=a.random||(a.rng||e)();e[6]=e[6]&15|64;e[8]=e[8]&63|128;if(c)for(f=0;16>f;f++)c[b+f]=e[f];if(!(f=c))f=0,f=g[e[f++]]+g[e[f++]]+g[e[f++]]+g[e[f++]]+"-"+g[e[f++]]+g[e[f++]]+"-"+g[e[f++]]+g[e[f++]]+"-"+g[e[f++]]+g[e[f++]]+"-"+g[e[f++]]+g[e[f++]]+
|
|
g[e[f++]]+g[e[f++]]+g[e[f++]]+g[e[f++]];return f}};
|
|
picozu.tools.airbrush=picozu.objects.tool.extend({__constructor:function(a,c,b){this.layer=a;this.workspace=b;a=this.layer.getContext();this.point={};this.timeout=null;this.density=40;this.point={};this.oldCap=a.lineCap;this.oldAlpha=a.globalAlpha;a.lineJoin=a.lineCap="round"},end:function(){var a=this.layer.getContext();clearTimeout(this.timeout);a.lineJoin=a.lineCap=this.oldCap;a.globalAlpha=this.oldAlpha},start:function(){var a=this,c=this.workspace.getParam("foregroundColor");4>c.length&&c.push(0.5*
|
|
this.workspace.getParam("opacity"));var b=this.layer.getContext();b.fillStyle=Color.color2Exp("rgba",c);this.timeout=setTimeout(function e(){for(var c=a.density;c--;){var g=Others._randomFloat(0,2*Math.PI),h=Others._randomFloat(0,30);b.globalAlpha=Math.random();b.fillRect(a.point.x+h*Math.cos(g),a.point.y+h*Math.sin(g),Others.randomFloat(1,2),Others._randomFloat(1,2))}a.timeout&&(a.timeout=setTimeout(e,50))},50)},move:function(a,c){this.point={x:a,y:c}}});
|
|
picozu.tools.brush=picozu.objects.tool.extend({__constructor:function(a,c,b){this.layer=a;this.workspace=b;this.point={};this._brushSize=this.workspace.getParam("brushSize");this.workspace.setParam("brushSize",10)},start:function(a,c){var b=this.workspace.getParam("brushSize"),d=this.layer.getHeap(),e=this.layer.getContext();this._brush();this.point={x:a,y:c};e.drawImage(d.b,0,0,2*b,2*b,a-b,c-b,2*b,2*b)},move:function(a,c){for(var b=this.workspace.getParam("brushSize"),d=this.layer.getHeap(),e=this.layer.getContext(),
|
|
f={x:a,y:c},g=Others.distBetween(this.point,f),h=Others.angleBetween(this.point,f),j=0;j<g;j+=5)a=this.point.x+Math.sin(h)*j,c=this.point.y+Math.cos(h)*j,e.drawImage(d.b,0,0,2*b,2*b,a-b,c-b,2*b,2*b);this.point=f}});
|
|
picozu.tools.eraser=picozu.objects.tool.extend({__constructor:function(a,c,b,d){this.params=c;this.layer=a;this.workspace=b;this.temp=d;this.points=[];this.count=0;this._brushSize=this.workspace.getParam("brushSize");this.workspace.setParam("brushSize",20);this.brushSize=this.workspace.getParam("brushSize");this.brushHardness=this.workspace.getParam("brushHardness")},start:function(a,c){var b=this.workspace.getParam("brushSize"),d=this.layer.getHeap(),e=this.layer.getContext();if(this.brushSize!==
|
|
b||this.brushHardness!==this.workspace.getParam("brushHardness"))this.brushSize=b,this.brushHardness=this.workspace.getParam("brushHardness"),this._brush(!0);e.globalCompositeOperation="destination-out";e.drawImage(d.b,0,0,2*b,2*b,a-b,c-b,2*b,2*b)},move:function(a,c){var b=this.workspace.getParam("brushSize"),d=this.layer.getHeap(),e=this.layer.getContext();e.globalCompositeOperation="destination-out";e.drawImage(d.b,0,0,2*b,2*b,a-b,c-b,2*b,2*b)}});
|
|
picozu.tools.pen=picozu.objects.tool.extend({__constructor:function(a,c,b){this.layer=a;this.workspace=b;this.point={};this.oldCap=this.layer.getContext().lineCap;this.oldSize=this.layer.getContext().lineWidth;this.layer.getContext().lineJoin=this.layer.getContext().lineCap="round";this.layer.getContext().lineWidth=3},start:function(a,c){this.point={x:a,y:c}},__destructor:function(){this.layer.getContext().lineJoin=this.layer.getContext().lineCap=this.oldCap;this.layer.getContext().lineWidth=this.oldSize},
|
|
move:function(a,c){var b=this.layer.getContext(),d={x:a,y:c},e=this.workspace.getParam("foregroundColor");b.strokeStyle="rgba("+e[0]+","+e[1]+","+e[2]+","+0.5*this.workspace.getParam("opacity")+")";b.beginPath();b.moveTo(this.point.x,this.point.y);b.lineTo(d.x,d.y);b.stroke();b.moveTo(this.point.x-4,this.point.y-4);b.lineTo(d.x-4,d.y-4);b.stroke();b.moveTo(this.point.x-2,this.point.y-2);b.lineTo(d.x-2,d.y-2);b.stroke();b.moveTo(this.point.x+2,this.point.y+2);b.lineTo(d.x+2,d.y+2);b.stroke();b.moveTo(this.point.x+
|
|
4,this.point.y+4);b.lineTo(d.x+4,d.y+4);b.stroke();this.point=d}});
|
|
picozu.tools.rectselect=picozu.objects.tool.extend({start:function(a,c){this.prevX=a;this.prevY=c;this.layer.getContext().lineWidth=this.workspace.getParam("brushSize");this.layer.getContext().strokeStyle="rgba("+this.params.foregroundColor[0]+","+this.params.foregroundColor[1]+","+this.params.foregroundColor[2]+","+0.5*this.params.opacity+")"},move:function(a,c,b){b.lineWidth=1;b.fillStyle=picozu.OVERLAY_COLOR_SELECT;var d=this._normalizeTempCoords(this.prevX,this.prevY,a,c);b.fillRect(d.x1,d.y1,
|
|
d.x-d.x1,d.y-d.y1);this.workspace.updateInfoPanel({x:this.prevX,y:this.prevY,w:a-this.prevX,h:c-this.prevY})},dblclick:function(){this.workspace.toggleSelection()},end:function(a,c){var b=Others.normCoords(this.prevX,this.prevY,a,c);0>b.startX&&(b.width+=b.startX,b.startX=0);0>b.startY&&(b.height=b.width+b.startY,b.startY=0);this.workspace.coords.select.left=b.startX;this.workspace.coords.select.top=b.startY;this.workspace.coords.select.width=b.width;this.workspace.coords.select.height=b.height}});
|
|
picozu.tools.freeselect=picozu.objects.tool.extend({start:function(a,c){this.cached=new picozu.objects.layer({parent:this.workspace.getSelectedTab(),width:this.layer.getWidth(),height:this.layer.getHeight()});var b=this.cached.getContext(),d=this.layer.getContext(),e=this.workspace.getParam("foregroundColor");4>e.length&&e.push(0);b.lineWidth=1;this.prevX=a;this.prevY=c;d.lineWidth=this.params.brushSize;b.strokeStyle=d.strokeStyle=Color.color2Exp("rgba",e);d.save();d.beginPath();d.moveTo(a,c);b.beginPath();
|
|
b.moveTo(a,c);this.temp.getContext("2d").beginPath();this.temp.getContext("2d").moveTo(a,c)},move:function(a,c){var b=this.cached.getContext(),d=this.layer.getContext();b.lineTo(a,c);b.stroke();d.lineTo(a,c);d.stroke();this.temp.getContext("2d").lineTo(a,c);this.temp.getContext("2d").stroke()},end:function(){var a=this.cached.getContext(),c=this.layer.getContext();a.closePath();a.clip();c.closePath();c.clip();this.temp.getContext("2d").closePath();this.cached.drawImage(this.layer.getCanvas(),this.cached.getWidth(),
|
|
this.cached.getHeight()).select();this.layer.getContext().restore();this.layer.hide();this.workspace._refreshLayers();this.workspace._clearTempCanvas();this.workspace.doTool("hand");this.cached=null}});picozu.tools.colorpicker=picozu.objects.tool.extend({start:function(a,c){var b=Others.normCoords(a,c,0,0);this.workspace.pickColor(b.startX,b.startY)},move:function(a,c){var b=Others.normCoords(a,c,0,0);this.workspace.pickColor(b.startX,b.startY)}});
|
|
picozu.tools.text=picozu.objects.tool.extend({__constructor:function(a,c,b,d){this.params=c;this.layer=a;this.workspace=b;this.temp=d;this.points=[];this.count=0;this.heap=b.heap;this.workspace.parameters.isCreatingText=!0},start:function(a,c){var b=this,d=b.workspace.getSelectedTab().getElementHandle();this.prevX=a;this.prevY=c;var e=this._normalizeTempCoords(a,c,0,0);if("true"!=$(".pico-textform").data("editing")){var f=this.workspace.getParam("foregroundColor");$("#"+d).append('<div class="pico-textform-helper"><textarea class="pico-textform" placeholder="Type your text here"></textarea><span title="Apply changes and create layer" class="tips button validate"></span><span title="Discard the changes" class="tips button invalidate"></span></div>');
|
|
$("#"+d+" .pico-textform").focus().data("editing","true").css("font-family",this.workspace.getParam("fontFamily")).css("line-height",this.workspace.getParam("fontSize")+"px").css("font-size",this.workspace.getParam("fontSize")).css("font-style",this.workspace.getParam("fontStyle")).css("text-decoration",this.workspace.getParam("fontDecoration")).css("font-weight",this.workspace.getParam("fontWeight")).css("text-align",this.workspace.getParam("fontAlign")).css("color","#"+Color.rgb2hex(f[0],f[1],f[2])).css("opacity",
|
|
this.workspace.getParam("opacity")/10);$("#"+d+" .pico-textform-helper").css("left",e.x1-2).css("top",e.y1-3).show();$(".pico-textform-helper").on("click",".validate",function(){var a=$("#"+d+" .pico-textform").val(),c=$("#"+d+" .pico-textform").width(),f=$("#"+d+" .pico-textform").height();$(".pico-textform-helper").remove();$.fn.tipsy.revalidate();b.workspace.newLayerText(a,{left:e.x1,top:e.y1,width:c,height:f+10});b.workspace.doTool(null);b.workspace.parameters.isCreatingText=!1});$(".pico-textform-helper").on("click",
|
|
".invalidate",function(){$(".pico-textform-helper").remove();$.fn.tipsy.revalidate()})}}});
|
|
picozu.tools.crop=picozu.objects.tool.extend({start:function(a,c){this.prevX=a;this.prevY=c;var b=this.layer.getContext();b.lineWidth=this.workspace.getParam("brushSize");var d=this.workspace.getParam("foregroundColor");4>d.length&&d.push(0.5*this.workspace.getParam("opacity"));b.strokeStyle=Color.color2Exp("rgba",d)},move:function(a,c,b){var d=this._normalizeTempCoords(this.prevX,this.prevY,a,c);b.lineWidth=1;b.fillStyle=picozu.OVERLAY_COLOR_CROP;b.fillRect(d.x1,d.y1,d.x-d.x1,d.y-d.y1);this.workspace.updateInfoPanel({x:this.prevX,
|
|
y:this.prevY,w:a-this.prevX,h:c-this.prevY})},end:function(a,c){var b=Others.normCoords(this.prevX,this.prevY,a,c),d=0<=b.width?b.startX:b.endX,e=0<=b.height?b.startY:b.endY;this.workspace.getSelectedTab().crop(d,e,Math.abs(b.width),Math.abs(b.height));this.workspace.doTool(null)}});
|
|
picozu.tools.pencil=picozu.objects.tool.extend({start:function(a,c){var b=this.layer.getContext(),d=this.workspace.getParam("foregroundColor"),e=this.workspace.getParam("backgroundColor");this.prevX=a;this.prevY=c;b.lineWidth=this.workspace.getParam("brushSize");b.globalCompositeOperation="source-over";b.strokeStyle="rgba("+d[0]+","+d[1]+","+d[2]+","+0.5*this.workspace.getParam("opacity")+")";b.fillStyle="rgba("+e[0]+","+e[1]+","+e[2]+","+0.5*this.workspace.getParam("opacity")+")";b.beginPath();b.moveTo(a,
|
|
c)},end:function(a,c,b,d){a=this.layer.getContext();a.closePath();d&&d.shiftKey&&(a.stroke(),a.fill())},move:function(a,c){var b=this.layer.getContext();b.lineTo(a,c);b.stroke();this.prevX=a;this.prevY=c}});
|
|
picozu.tools.ellipse=picozu.objects.tool.extend({move:function(a,c,b){a=Others.normCoords(this.prevX,this.prevY,a,c);this.workspace.drawEllipse(b,[[a.startX,a.startY],[a.endX,a.endY]]);this.workspace.updateInfoPanel({x:a.startX,y:a.startY,w:a.width,h:a.height})},end:function(a,c){this.workspace.saveUndo();var b=[],d=Others.normCoords(this.prevX,this.prevY,a,c);b.push([0,0]);b.push([Math.abs(d.width),Math.abs(d.height)]);this.workspace.newLayerShape(picozu.SHAPE_ELLIPSE,{left:0<=d.width?d.startX:d.endX,
|
|
top:0<=d.height?d.startY:d.endY,width:Math.abs(d.width),height:Math.abs(d.height)},b)}});
|
|
picozu.tools.circle=picozu.objects.tool.extend({move:function(a,c,b){a=Others.normCoords(this.prevX,this.prevY,a,c);this.workspace.drawCircle(b,[[a.startX,a.startY],[a.endX,a.endY]]);this.workspace.updateInfoPanel({x:a.startX,y:a.startY,w:a.width,h:a.height})},end:function(a,c){this.workspace.saveUndo();var b=[],d=Others.normCoords(this.prevX,this.prevY,a,c);b.push([0,0]);b.push([Math.abs(d.width),Math.abs(d.height)]);this.workspace.newLayerShape(picozu.SHAPE_CIRCLE,{left:0<=d.width?d.startX:d.endX,
|
|
top:0<=d.height?d.startY:d.endY,width:Math.abs(d.width),height:Math.abs(d.height)},b)}});picozu.tools.hand=picozu.objects.tool.extend({__constructor:function(a,c,b){this.workspace=b;this.workspace.enableTransformHelper()},__destructor:function(){this.workspace.disableTransformHelper()}});
|
|
picozu.tools.ruler=picozu.objects.tool.extend({start:function(a,c){this.prevX=a;this.prevY=c;this.layer.getContext().lineWidth=this.params.brushSize;this.layer.getContext().strokeStyle="rgba("+this.params.foregroundColor[0]+","+this.params.foregroundColor[1]+","+this.params.foregroundColor[2]+","+0.5*this.params.opacity+")"},move:function(a,c,b){a=Others.normCoords(this.prevX,this.prevY,a,c);this.workspace.drawLine(b,[[a.startX,a.startY],[a.startX+a.width,a.startY+a.height]]);this.workspace.updateInfoPanel({x:a.startX,
|
|
y:a.startY,w:a.width,h:a.height})},end:function(){this.workspace._clearTempCanvas()}});picozu.tools.colorfill=picozu.objects.tool.extend({start:function(a,c){this.workspace.saveUndo();this.workspace.floodFill(a,c)}});picozu.tools.magiceraser=picozu.objects.tool.extend({start:function(a,c){this.workspace.saveUndo();this.workspace.magicErase(a,c)}});
|
|
picozu.tools.arrow=picozu.objects.tool.extend({move:function(a,c,b){a=Others.normCoords(this.prevX,this.prevY,a,c);this.workspace.drawArrow(b,[[a.startX,a.startY],[a.startX+a.width,a.startY+a.height]]);this.workspace.updateInfoPanel({x:a.startX,y:a.startY,w:a.width,h:a.height})},end:function(a,c){this.workspace.saveUndo();var b=[],d=Others.normCoords(this.prevX,this.prevY,a,c),e=0<=d.width?d.startX:d.endX,f=0<=d.height?d.startY:d.endY;b.push([d.startX-e,d.startY-f]);b.push([d.endX-e,d.endY-f]);this.workspace.newLayerShape(picozu.SHAPE_ARROW,
|
|
{left:0<=d.width?d.startX:d.endX,top:0<=d.height?d.startY:d.endY,width:Math.abs(d.width),height:Math.abs(d.height)},b)}});
|
|
picozu.tools.roundedRectangle=picozu.objects.tool.extend({move:function(a,c,b){a=Others.normCoords(this.prevX,this.prevY,a,c);this.workspace.drawRoundedRectangle(b,[[a.startX,a.startY],[a.width,a.height]]);this.workspace.updateInfoPanel({x:a.startX,y:a.startY,w:a.width,h:a.height})},end:function(a,c){this.workspace.saveUndo();var b=[],d=Others.normCoords(this.prevX,this.prevY,a,c);b.push([0,0]);b.push([Math.abs(d.width),Math.abs(d.height)]);this.workspace.newLayerShape(picozu.SHAPE_ROUNDED_RECTANGLE,
|
|
{left:0<=d.width?d.startX:d.endX,top:0<=d.height?d.startY:d.endY,width:Math.abs(d.width),height:Math.abs(d.height)},b)}});
|
|
picozu.tools.rectangle=picozu.objects.tool.extend({move:function(a,c,b){a=Others.normCoords(this.prevX,this.prevY,a,c);this.workspace.drawRectangle(b,[[a.startX,a.startY],[a.width,a.height]]);this.workspace.updateInfoPanel({x:a.startX,y:a.startY,w:a.width,h:a.height})},end:function(a,c){this.workspace.saveUndo();var b=[],d=Others.normCoords(this.prevX,this.prevY,a,c);b.push([0,0]);b.push([Math.abs(d.width),Math.abs(d.height)]);this.workspace.newLayerShape(picozu.SHAPE_RECTANGLE,{left:0<=d.width?d.startX:
|
|
d.endX,top:0<=d.height?d.startY:d.endY,width:Math.abs(d.width),height:Math.abs(d.height)},b)}});
|
|
picozu.tools.line=picozu.objects.tool.extend({move:function(a,c,b){a=Others.normCoords(this.prevX,this.prevY,a,c);this.workspace.drawLine(b,[[a.startX,a.startY],[a.startX+a.width,a.startY+a.height]]);this.workspace.updateInfoPanel({x:a.startX,y:a.startY,w:a.width,h:a.height})},end:function(a,c){this.workspace.saveUndo();var b=[],d=Others.normCoords(this.prevX,this.prevY,a,c),e=0<=d.width?d.startX:d.endX,f=0<=d.height?d.startY:d.endY;b.push([d.startX-e,d.startY-f]);b.push([d.endX-e,d.endY-f]);this.workspace.newLayerShape(picozu.SHAPE_LINE,
|
|
{left:0<=d.width?d.startX:d.endX,top:0<=d.height?d.startY:d.endY,width:Math.abs(d.width),height:Math.abs(d.height)},b)}});
|
|
picozu.objects.buttonGroup=picozu.objects.control.extend({controlType:"buttonGroup",parent:null,visible:!0,template:'<div title="{name}" id="pico-buttonGroup-{id}" class="tipsw pico-buttonGroup {icon} clearfix"><span></span><div class="pico-wrapGroup"></div></div>',__constructor:function(a){var c=this;this.parent=a.parent;this.id=this.parent.buttons.length;this.name="undefined"!==typeof a.label?a.label:"generic";this.handle="undefined"!==typeof a.handle?a.handle:"";this.template=this.template.replace(/{id}/g,
|
|
this.getId()).replace(/{icon}/g,this.handle).replace(/{name}/g,this.name);this.parent.injectHtml(this.template);this._load(a.buttons);$(".picozu").on("click",this.getElementId(),function(){c.toggle()});this.hide();this.parent.buttons[this.id]=this;this.onCreate.call(this);this.getWorkspace().log(l("%button group")+" #"+this.getId()+" "+l("%created"),l("%UI"));return this},getWorkspace:function(){return this.parent.parent},_load:function(a){for(var c=0;c<a.length;c++)a[c].separator?this.injectHtml("<hr />"):
|
|
this.addButton(a[c]);return this},addButton:function(a){var c=a.click instanceof Function?a.click:null;this.parent.buttons[this.parent.buttons.length]=new picozu.objects.button({parent:this.getParent(),onClick:c,handle:a.handle,label:a.label,group:this});return this},removeButton:function(a){a.destroy();return this},getButton:function(a){if("number"===typeof a)return this.parent.buttons[a];if("object"===typeof a)for(var c=0;c<this.parent.buttons.length;c++)if(this.parent.buttons[c]===a)return this.parent.buttons[c];
|
|
return!1}});
|
|
picozu.objects.minimap=function(a){this.selected=!1;this.width=240;this.height=140;this.ratio=0;this.__constructor=function(a){this.canvas=a.canvas;this.container=$(".pico-minimap")[0];this.selection=$(".pico-minimap .selection")[0];this.mCanvas=$(".pico-minimap .canvas")[0];var b=this;this.canvas.parentNode.onscroll=function(){b._updateMinimapPosition()};var d=this;this.container.onmousemove=function(a){d.onScrollMinimap(a);return!1};var e=this;this.selection.onmousedown=function(a){a.preventDefault();e.selected=
|
|
!0};var f=this;this.selection.onmouseup=function(a){a.preventDefault();f.selected=!1};var g=this;this.mCanvas.onmousedown=function(a){g.selected=!0;g.onScrollMinimap(a)};this._load();return this};this.__destructor=function(){};this.update=function(){var a=this.canvas,b=this.mCanvas.getContext("2d");b.beginPath();b.clearRect(0,0,this.mCanvas.width,this.mCanvas.height);b.closePath();b.stroke();b.save();b.scale(this.ratio/100,this.ratio/100);b.drawImage(a,0,0);b.restore();return this};this._load=function(){var a=
|
|
$(this.container),b=100*this.width/$(this.canvas).width(),d=100*this.height/$(this.canvas).height();this.ratio=b<d?b:d;b=$(this.canvas).width()*this.ratio/100;d=$(this.canvas).height()*this.ratio/100;this.container.style.width=b+"px";this.container.style.height=d+"px";this.mCanvas.width=a.width();this.mCanvas.height=a.height();b=this.ratio*$(this.canvas.parentNode).width()/100;d=this.ratio*$(this.canvas.parentNode).height()/100;b>a.width()&&(b=a.width());d>a.height()&&(d=a.height());this.selection.style.width=
|
|
b+"px";this.selection.style.height=d+"px";return this};this._updateMapPosition=function(){var a=parseInt(this.selection.style.left.replace("px","")),b=parseInt(this.selection.style.top.replace("px",""));this.canvas.parentNode.scrollLeft=100*(a/this.ratio);this.canvas.parentNode.scrollTop=100*(b/this.ratio);return this};this._updateMinimapPosition=function(){var a=parseInt(this.canvas.parentNode.scrollLeft),b=parseInt(this.canvas.parentNode.scrollTop),a=a*this.ratio/100,b=b*this.ratio/100;this.selection.style.left=
|
|
a+"px";this.selection.style.top=b+"px";return this};this.onScrollMinimap=function(a){if(!0===this.selected){a=this._compute(a);var b=this.container.style.width.replace("px",""),d=this.container.style.height.replace("px",""),e=this.selection.style.width.replace("px",""),f=this.selection.style.height.replace("px","");0>a[0]-e/2&&(a[0]=e/2);0>a[1]-f/2&&(a[1]=f/2);a[0]+e/2>b&&(a[0]=b-e/2);a[1]+f/2>d&&(a[1]=d-f/2);"undefined"!==typeof a[0]&&(this.selection.style.left=a[0]-e/2+"px",this.selection.style.top=
|
|
a[1]-f/2+"px");this._updateMapPosition()}else this.selected=!1};this._bounds=function(){var a=0,b=0,d=this.container;do a+=d.offsetLeft,b+=d.offsetTop;while(d=d.offsetParent);var d=a+parseInt(this.container.style.width.replace("px","")),e=b+parseInt(this.container.style.height.replace("px",""));return[a,b,d,e]};this._compute=function(a){var b=[],d=this._bounds();a.pageX>=d[0]&&(a.pageX<=d[2]&&a.pageY>=d[1]&&a.pageY<=d[3])&&(b=[a.pageX-d[0],a.pageY-d[1]+$("#pico-dockbar-0 > section").scrollTop()]);
|
|
return b};return this.__constructor(a)};
|
|
picozu.objects.button=picozu.objects.control.extend({controlType:"button",parent:null,template:'<div title="{name}" data-handle="{handle}" id="pico-button-{id}" class="pico-button tipsw {icon}"><span></span></div>',__constructor:function(a){var c=this;this.parent=a.parent;this.id=this.parent.buttons.length;this.name="undefined"!==typeof a.label?a.label:"generic";this.handle="undefined"!==typeof a.handle?a.handle:"";this.template=this.template.replace(/{id}/g,this.getId()).replace(/{icon}/g,this.handle).replace(/{name}/g,
|
|
this.name).replace(/{handle}/g,this.handle);"undefined"!==typeof a.group?a.group.injectHtml(this.template):this.parent.injectHtml(this.template);$(".picozu").on("click",this.getElementId(),function(){c.onClick.call(c)});this.parent.buttons[this.id]=this;this.onCreate.call(this);this.getWorkspace().log(l("%button")+" #"+this.getId()+" "+l("%created"),l("%UI"));return this},getWorkspace:function(){return this.parent.parent}});
|
|
picozu.objects.dockbar=picozu.objects.control.extend({controlType:"dockbar",panels:[],visible:!0,template:'<aside id="pico-dockbar-{id}" class="pico-dockbar"><section></section></aside>',taskbarTemplate:'<div data-id="{id}" title="'+l("%Toggle")+' {name}" class="tipsw pico-task dockbar open"><span class="name">{name}</span></div>',__constructor:function(a){this.parent=a.parent;this.name="undefined"===typeof a.name?l("%Dockbar"):a.name;this.id=this.parent.dockbars.length;this.handle="undefined"!==
|
|
typeof a.handle?a.handle:this.getElementHandle();this.template=this.template.replace(/{id}/g,this.getId());this.parent.injectHtml(this.template);this._load(a.panels);this.taskbarTemplate=this.taskbarTemplate.replace(/{id}/g,this.getId()).replace(/{name}/g,this.name);this.getWorkspace().taskbar.injectHtml(this.taskbarTemplate);$(this.getElementId()+" > section").sortable({placeholder:"ui-state-highlight",axis:"y",handle:"header",items:".pico-panel",containment:"parent",opacity:0.8,stop:function(){}});
|
|
this.onCreate.call(this);this.parent.dockbars[this.id]=this;this.getWorkspace().log(l("%dockbar")+" #"+this.getId()+" "+l("%created"),l("%UI"));return this},_load:function(a){for(var c=0;c<a.length;c++)new picozu.objects.panel({parent:this,cssClass:a[c].cssClass,template:a[c].template,handle:a[c].handle,name:a[c].name,hide:a[c].hide,onCreate:a[c].onCreate});return this},addPanel:function(a){return new picozu.objects.panel({parent:this,handle:a.handle,cssClass:a.cssClass,template:a.template,name:a.name,
|
|
hide:a.hide,onCreate:a.onCreate})},removePanel:function(a){a.destroy();return this},getPanel:function(a){if("number"===typeof a)return this.panels[a];if("object"===typeof a)for(var c=0;c<this.panels.length;c++){if(this.panels[c]===a)return this.panels[c]}else if("string"===typeof a)for(c=0;c<this.panels.length;c++)if(this.panels[c].getHandle().toLowerCase()===a.toLowerCase())return this.panels[c];return!1}});
|
|
picozu.objects.propbar=picozu.objects.control.extend({controlType:"propbar",panels:[],visible:!1,template:'<div id="pico-propbar-{id}" class="pico-propbar"></div>',taskbarTemplate:'<div data-id="{id}" title="'+l("%Toggle")+' {name}" class="tipsw pico-task propbar"><span class="name">{name}</span></div>',__constructor:function(a){this.parent=a.parent;this.name="undefined"===typeof a.name?l("%Properties"):a.name;this.id=this.parent.propbars.length;this.handle="undefined"!==typeof a.handle?a.handle:
|
|
this.getElementHandle();this.template=this.template.replace(/{id}/g,this.getId());this.parent.injectHtml(this.template);this._load(a);this.onCreate.call(this);this.parent.propbars[this.id]=this;this.getWorkspace().log(l("%propbar")+" #"+this.getId()+" "+l("%created"),l("%UI"));return this},_load:function(a){for(var c=0;c<a.panels.length;c++)new picozu.objects.panel({parent:this,cssClass:a.panels[c].cssClass,template:a.panels[c].template,handle:a.panels[c].handle,name:a.panels[c].name,hide:a.panels[c].hide,
|
|
onCreate:a.panels[c].onCreate});this.taskbarTemplate=this.taskbarTemplate.replace(/{id}/g,this.getId()).replace(/{name}/g,this.name);("undefined"===typeof a.hidden||!1===a.hidden)&&this.getWorkspace().taskbar.injectHtml(this.taskbarTemplate);return this},hideAll:function(){for(var a,c=this.getPanel("layer"),b=0;b<this.panels.length;b++)a=this.getPanel(b),!1!==a&&a!==c&&a.hide();return this},hideAllExcept:function(a){for(var c,b,d=!1,e=0;e<this.panels.length;e++)if(c=this.getPanel(e),"layer"===c.getHandle()||
|
|
"console"===c.getHandle()||"debugger"===c.getHandle())c.show();else if("object"===typeof a){for(var f=0;f<a.length;f++)if(b=this.getPanel(a[f]),!1!==c&&!1!==b&&c===b){d=!0;b.show();break}!1===d&&c.hide()}else b=this.getPanel(a),b===c?c.show():c.hide();return this},showPanel:function(a){a=this.getPanel(a);!1!==a&&a.show();return this},hidePanel:function(a){a=this.getPanel(a);!1!==a&&a.hide();return this},addBox:function(a){return new picozu.objects.panel({parent:this,cssClass:a.cssClass,handle:a.handle,
|
|
template:a.template,name:a.name,hide:a.hide,onCreate:a.onCreate})},removeBox:function(a){a.destroy();return this},getPanel:function(a){if("number"===typeof a)return this.panels[a];if("object"===typeof a)for(var c=0;c<this.panels.length;c++){if(this.panels[c]===a)return this.panels[c]}else if("string"===typeof a)for(c=0;c<this.panels.length;c++)if(this.panels[c].getHandle().toLowerCase()===a.toLowerCase())return this.panels[c];return!1}});
|
|
picozu.objects.layer=function(a){this.properties={controlType:"layer",group:null,type:null,visible:!0,locked:!1,position:0,name:null,blend:null,opacity:10,id:null,color:null,altered:!1,text:null,composed:!1,zoom:1};this.parameters={fontColor:null,fontFamily:null,fontCase:null,fontSize:null,fontStyle:null,fontAlign:null,fontWeight:null,border:null};this.canvas=this.context=null;this.coords={left:0,top:0,width:0,height:0};this.shape={type:null,points:[]};this.heap={};this.parent=null;this.template=
|
|
'<canvas data-name="{name}" data-id="{id}" data-tab="{tid}" class="pico-layer {preview}" id="pico-layer-{tid}-{id}"></canvas>';this.templateHelper='<div id="pico-transform-helper-{id}" data-lid="{id}" class="transform-helper"><span class="tooltip"><span class="left"></span><span class="top"></span></span></div>';this.__destructor=function(a){$(this.getElementId()).remove();$(".transform-helper").remove();if("undefined"===typeof a||!0===a)delete this.parent.layers[this.getId()],this.parent.layers.splice(this.getId(),
|
|
1),this.parent.heap.lastLayerIndex--;this.getWorkspace().log(l("%layer")+" #"+this.getId()+" "+l("%destroyed"))};this.__constructor=function(a){this._setup(a);this.getWorkspace().log(l("%layer")+" #"+this.getId()+" "+l("%created"));return this};this.setGroup=function(a){this.properties.group=a;return this};this.getGroup=function(){return this.properties.group};this.hasGroup=function(){return null===this.properties.group?!1:!0};this.getType=function(){return this.properties.type};this.getCoords=function(){return this.coords};
|
|
this.getText=function(){return this.properties.text};this.getControlType=function(){return this.properties.controlType};this.getHeight=function(){return this.coords.height};this.getWidth=function(){return this.coords.width};this.setHeight=function(a){this.canvas.height=a;this.coords.height=a;return this};this.setWidth=function(a){this.canvas.width=a;this.coords.width=a;return this};this.setText=function(a){this.properties.text=a;return this};this.getWorkspace=function(){return this.parent.parent};
|
|
this.getImageData=function(a,b,d,e){return 4===arguments.length?this.getContext().getImageData(a,b,d,e):2===arguments.length?this.getContext().getImageData(a,b,this.getWidth(),this.getHeight()):this.getContext().getImageData(0,0,this.getWidth(),this.getHeight())};this.drawImageData=function(a,b,d){return!1===this.isLocked()?(3===arguments.length?this.getContext().putImageData(a,b,d):this.getContext().putImageData(a,0,0),this.onResize.call(this),this):!1};this.getParameters=function(){return this.parameters};
|
|
this._parseParameters=function(){var a=this.getWorkspace(),b,d,e,f,g,h;f=null!==this.parameters.fontColor?this.parameters.fontColor:a.getParam("foregroundColor");b=null!==this.parameters.fontStyle?this.parameters.fontStyle:a.getParam("fontStyle");d=null!==this.parameters.fontWeight?this.parameters.fontWeight:a.getParam("fontWeight");e=null!==this.parameters.fontFamily?this.parameters.fontFamily:a.getParam("fontFamily");h=null!==this.parameters.fontAlign?this.parameters.fontAlign:a.getParam("fontAlign");
|
|
g=null!==this.parameters.fontCase?this.parameters.fontCase:a.getParam("fontCase");customStrokeColor=null!==this.parameters.strokeColor?this.parameters.strokeColor:a.getParam("foregroundColor");customFillColor=null!==this.parameters.fillColor?this.parameters.fillColor:a.getParam("backgroundColor");customDrawMode=null!==this.parameters.drawMode?this.parameters.drawMode:a.getParam("drawMode");customShapeBorder=null!==this.parameters.border?this.parameters.border:a.getParam("border");return{fontColor:f,
|
|
fontStyle:b,fontWeight:d,fontFamily:e,fontCase:g,fontAlign:h,strokeColor:customStrokeColor,fillColor:customFillColor,border:customShapeBorder,drawMode:customDrawMode}};this.drawText=function(){this._clear(0,0,this.getWidth(),this.getHeight());var a=this.getWorkspace(),b=this.getContext(),d=this.getParameter("fontSize"),e=this.getText(),f=this._parseParameters();f.fontCase===picozu.FONT_CASE_UPPERCASE?e=e.toUpperCase():f.fontCase===picozu.FONT_CASE_LOWERCASE&&(e=e.toLowerCase());var e=e.split("\n"),
|
|
g=e.length;this.setHeight(g*this.getParameter("fontSize"));a._applyDefaultSettings(b);b.textAlign=f.fontAlign;b.font=("italic"===f.fontStyle?f.fontStyle+" ":"")+("bold"===f.fontWeight?f.fontWeight+" ":"")+" "+d+"px "+f.fontFamily;for(var h=0;h<g;h++)f.drawMode===picozu.DRAW_MODE_STROKE||f.drawMode===picozu.DRAW_MODE_FILL?(b.fillStyle="rgba("+f.fontColor[0]+", "+f.fontColor[1]+","+f.fontColor[2]+", "+0.1*a.getParam("opacity")+")","left"===f.fontAlign?b.fillText(e[h],0,h*d):"right"===f.fontAlign?b.fillText(e[h],
|
|
this.getWidth(),h*d):b.fillText(e[h],this.getWidth()/2,h*d)):f.drawMode===picozu.DRAW_MODE_BOTH&&(b.strokeStyle="rgba("+f.fontColor[0]+", "+f.fontColor[1]+","+f.fontColor[2]+", "+0.1*a.getParam("opacity")+")",b.fillStyle="rgba("+f.fillColor[0]+", "+f.fillColor[1]+","+f.fillColor[2]+", "+0.1*a.getParam("opacity")+")","left"===f.fontAlign?(b.fillText(e[h],0,h*d),b.strokeText(e[h],0,h*d)):"right"===f.fontAlign?(b.fillText(e[h],this.getWidth(),h*d),b.strokeText(e[h],this.getWidth(),h*d)):(b.fillText(e[h],
|
|
this.getWidth()/2,h*d),b.strokeText(e[h],this.getWidth()/2,h*d)));this._adjustHelper();return this};this.drawTextShape=function(){this._clear(0,0,this.getWidth(),this.getHeight());var a=this.getWorkspace(),b=this.getContext(),d=this.getHeight()-40,e=this.getText(),f=this._parseParameters();a._applyDefaultSettings(b);switch(this.shape.type){case picozu.SHAPE_ELLIPSE:a.drawEllipse(b,this._normalizeShapePoints());break;case picozu.SHAPE_CIRCLE:a.drawCircle(b,this._normalizeShapePoints());break;case picozu.SHAPE_RECTANGLE:a.drawRectangle(b,
|
|
this._normalizeShapePoints());break;case picozu.SHAPE_ROUNDED_RECTANGLE:a.drawRoundedRectangle(b,this._normalizeShapePoints())}f.fontCase===picozu.FONT_CASE_UPPERCASE?e=e.toUpperCase():f.fontCase===picozu.FONT_CASE_LOWERCASE&&(e=e.toLowerCase());a._applyDefaultSettings(b);b.font=("italic"===f.fontStyle?f.fontStyle+" ":"")+("bold"===f.fontWeight?f.fontWeight+" ":"")+" "+d+"px "+f.fontFamily;b.fillStyle="rgba("+f.fontColor[0]+", "+f.fontColor[1]+","+f.fontColor[2]+", "+0.1*a.getParam("opacity")+")";
|
|
b.fillText(e,this.getWidth()/2,this.getHeight()/2);return this};this.getParameter=function(a){return this.parameters[a]};this.drawShape=function(){var a=this.getWorkspace(),b=this.getContext(),d=this._parseParameters();switch(this.shape.type){case picozu.SHAPE_ELLIPSE:a.drawEllipse(b,this._normalizeShapePoints(),d);break;case picozu.SHAPE_ARROW:a.drawArrow(b,this._normalizeShapePoints(),d);break;case picozu.SHAPE_LINE:a.drawLine(b,this._normalizeShapePoints(),d);break;case picozu.SHAPE_CIRCLE:a.drawCircle(b,
|
|
this._normalizeShapePoints(),d);break;case picozu.SHAPE_RECTANGLE:a.drawRectangle(b,this._normalizeShapePoints(),d);break;case picozu.SHAPE_ROUNDED_RECTANGLE:a.drawRoundedRectangle(b,this._normalizeShapePoints(),d)}return this};this.getCanvas=function(){return this.canvas};this.getContext=function(){return this.context};this.getParent=function(){return this.parent};this.clear=function(a,b,d,e){return!1===this.isLocked()?(this._clear(a,b,d,e),this.setFlag("altered",!0),this.onResize.call(this),this.getWorkspace()._refreshAll(!1),
|
|
this):!1};this.crop=function(a,b,d,e){if(!1===this.isLocked()){var f=document.createElement("canvas");f.width=d;f.height=e;f.getContext("2d").drawImage(this.getCanvas(),a,b,d,e,0,0,d,e);this.resize(d,e,a,b).clear(0,0,this.getWidth(),this.getHeight())._draw(f,0,0,d,e);this.parent.isActive()&&this._adjustHelper();this.onResize.call(this);this.getWorkspace()._refreshAll(!1);return this}return!1};this.setFlag=function(a,b,d){this.properties[a]=b;d instanceof Function&&(d.call(this,b),this.onResize.call(this));
|
|
return this};this.getFlag=function(a){return this.properties[a]};this.resize=function(a,b){if(!1===this.isLocked()){var d=this._createLayerCopy();this._clear(0,0,this.getWidth(),this.getHeight());"undefined"!==typeof a&&(this.getCanvas().width=this.coords.width=a);"undefined"!==typeof b&&(this.getCanvas().height=this.coords.height=b);switch(this.getType()){case picozu.LAYER_TYPE_SHAPE:this.drawShape();break;case picozu.LAYER_TYPE_TEXTSHAPE:this.drawTextShape();break;case picozu.LAYER_TYPE_TEXT:this.drawText();
|
|
break;case picozu.LAYER_TYPE_BACKGROUND:this._fill(this.properties.background,0,0,this.getWidth(),this.getHeight());break;default:this._drawImage(d,a,b)}this.parent.isActive()&&this._adjustHelper();this.onResize.call(this);return this}return!1};this.move=function(a,b,d){return!1===this.isLocked()?(null!=a&&(a=this._normalizeCoords(a,0),$(this.getElementId()).css("left",a.x),this.coords.left=a.x),null!=b&&(a=this._normalizeCoords(0,b),$(this.getElementId()).css("top",a.y),this.coords.top=a.y),this._adjustHelper(),
|
|
!0===d&&this.getWorkspace()._refreshAll(!1),this.onResize.call(this),this):!1};this.getId=function(){return this.properties.id};this.getElementHandle=function(){return"pico-layer-"+this.parent.getId()+"-"+this.getId()};this.getElementId=function(){return"#"+this.getElementHandle()};this.getName=function(){return this.properties.name};this.setName=function(a){this.properties.name=a.substr(0,picozu.MAX_CHARS_LAYER_NAME);return this};this.setPosition=function(a){return!1===this.isLocked()?(this.properties.position=
|
|
a,$(this.getElementId()).css({"z-index":this.getPosition()}),this):!1};this.setParameter=function(a,b){this.parameters[a]=b;this._redraw();this._adjustHelper();return this};this.getPosition=function(){return this.properties.position};this.setOpacity=function(a,b){if(!1===this.isLocked()){var d=this._createLayerCopy();this.properties.opacity=a;this.getContext().globalAlpha=a/10;!0===b&&this._clear()._draw(d);this.onResize.call(this);return this}return!1};this.getOpacity=function(){return this.properties.opacity};
|
|
this.getColor=function(){return this.properties.color};this._redraw=function(){var a=this._createLayerCopy();switch(this.getType()){case picozu.LAYER_TYPE_SHAPE:this.drawShape();break;case picozu.LAYER_TYPE_TEXTSHAPE:this.drawTextShape();break;case picozu.LAYER_TYPE_TEXT:this.drawText();break;case picozu.LAYER_TYPE_BACKGROUND:this._fill(this.properties.background,0,0,this.getWidth(),this.getHeight());break;default:this._drawImage(a)}return this};this.redraw=function(){var a=this._createLayerCopy();
|
|
this._draw(a);return this};this.drawImage=function(a,b,d,e){return!1===this.isLocked()?("undefined"!==typeof e&&!0===e&&this.resize(b,d),this._draw(a,b,d),this.onResize.call(this),this):!1};this.duplicate=function(){this.getWorkspace().saveUndo();return(new picozu.objects.layer({parent:this.parent,width:this.getWidth(),height:this.getHeight(),left:this.getCoords().left,top:this.getCoords().top,name:l("%Copy of")+" "+this.getName(),type:this.getType(),text:this.getText(),imageData:this.getCanvas(),
|
|
shape:this.getShape()})).select()};this.merge=function(){this.getWorkspace().saveUndo()};this.getShape=function(){return this.shape};this.select=function(){var a=this,b=this.getWorkspace();this._normalizeCoords(this.getCoords().left,this.getCoords().top);var d="";this.parent.activeLayer=this;$(".transform-helper").remove();this.templateHelper=this.templateHelper.replace(/{id}/g,this.getId());$(this.parent.getElementId()+" > section").append(this.templateHelper);!0===b.getSetting("snapTab")&&(d+=" .pico-tab");
|
|
!0===b.getSetting("snapLayers")&&(d+=" .pico-layer");""===d&&(d=!1);$(this.parent.getElementId()+" > section > .transform-helper").resizable({helper:"transform-helper-ghost",grid:!0===b.getSetting("snapGrid")?[20,20]:!1,handles:"n, e, s, w, ne, se, sw, nw",resize:function(a,c){var d=b._normalizeCoords(c.position.left,c.position.top);b.updateInfoPanel({x:d.tx,y:d.ty,w:c.size.width,h:c.size.height})},stop:function(d,f){var g=b._normalizeCoords(f.position.left,f.position.top);a.move(g.tx,g.ty);a.resize(f.size.width,
|
|
f.size.height)}}).draggable({snap:d,scroll:!0,snapTolerance:10,grid:!0===b.getSetting("snapGrid")?[20,20]:!1,drag:function(b,d){a.move(d.position.left,d.position.top);$(".transform-helper .tooltip .left").html(l("%Left")+": "+d.position.left);$(".transform-helper .tooltip .top").html(l("%Top")+": "+d.position.top)},stop:function(){a.parent.isActive()&&b._refreshAll()}});this._adjustHelper();$(this.parent.getElementId()+" > section > .transform-helper").css({"border-color":this.properties.color}).children(".ui-resizable-ne, .ui-resizable-se, .ui-resizable-nw, .ui-resizable-sw").css("background-color",
|
|
this.properties.color);$("#pico-slider-zoom").slider("option","value",this.getZoom());("hand"!==b.getTool()||!0===this.isLocked())&&b.disableTransformHelper();"freeselect"!==b.getTool()&&b.refreshTool();this.onResize.call(this);return this};this.isPreviewLayer=function(){return this.properties.type===picozu.LAYER_TYPE_PREVIEW?!0:!1};this.isBackgroundLayer=function(){return this.properties.type===picozu.LAYER_TYPE_BACKGROUND?!0:!1};this.isTextLayer=function(){return this.properties.type===picozu.LAYER_TYPE_TEXT?
|
|
!0:!1};this.setZoom=function(a){this.properties.zoom=a;$(this.getElementId()).css({transform:"scale("+a+")"});this._adjustHelper();return this};this.getZoom=function(){return this.properties.zoom};this.fill=function(a,b,d,e,f){return!1===this.isLocked()?(this.getWorkspace().saveUndo(),this._fill(a,b,d,e,f),this.setFlag("altered",!0),this.onResize.call(this),this.getWorkspace()._refreshAll(!1),this):!1};this.isSelected=function(){return this.getWorkspace().getSelectedLayer()==this?!0:!1};this.rotate=
|
|
function(a,b){if(!1===this.isLocked()){("undefined"===typeof b||!1===b)&&this.getWorkspace().saveUndo();var d=document.createElement("canvas"),e=this.getWidth(),f=this.getHeight(),g=0,h=0,j=a*Math.PI/180;d.width=e;d.height=f;d.getContext("2d").drawImage(this.getCanvas(),0,0,e,f);switch(a){case 90:e=this.getHeight();f=this.getWidth();h=-1*this.getHeight();break;case 180:g=-1*this.getWidth();h=-1*this.getHeight();break;case 270:e=this.getHeight(),f=this.getWidth(),g=-1*this.getWidth()}this.getCanvas().width=
|
|
e;this.getCanvas().height=f;this.setWidth(e).setHeight(f);this.getContext().save();this.getContext().rotate(j);switch(a){case 90:this._draw(d,g,h,f,e);break;case 180:this._draw(d,g,h,e,f);break;case 270:this._draw(d,g,h,f,e)}this.getContext().restore();this._adjustHelper();this.onResize.call(this);("undefined"===typeof b||!1===b)&&this.getWorkspace()._refreshAll();return this}return!1};this.flip=function(a,b){if(!1===this.isLocked()){("undefined"===typeof b||!1===b)&&this.getWorkspace().saveUndo();
|
|
var d=document.createElement("canvas"),e=this.getWidth(),f=this.getHeight();d.width=e;d.height=f;d.getContext("2d").drawImage(this.getCanvas(),0,0,e,f,0,0,e,f);this._clear(0,0,e,f);this.getContext().save();a===picozu.FLIP_HORIZONTAL?(this.getContext().scale(-1,1),this.getContext().translate(-e,0)):a===picozu.FLIP_VERTICAL&&(this.getContext().scale(1,-1),this.getContext().translate(0,-f));this._draw(d,0,0,e,f);this.getContext().restore();this._adjustHelper();this.onResize.call(this);("undefined"===
|
|
typeof b||!1===b)&&this.getWorkspace()._refreshAll();return this}return!1};this.setBlend=function(a,b){return!1===this.isLocked()?(this.properties.blend=a,!0===b&&this.redraw(),this.onResize.call(this),this):!1};this.getBlend=function(){return this.properties.blend};this.hide=function(){this==this.getWorkspace().getSelectedLayer()&&$(".transform-helper").remove();$(this.getElementId()).hide();this.properties.visible=!1;return this};this.show=function(){$(this.getElementId()).show();this.properties.visible=
|
|
!0;this==this.getWorkspace().getSelectedLayer()&&this._adjustHelper();return this};this.toggleVisibility=function(){!0===this.isVisible()?this.hide():this.show();this.getWorkspace()._refreshAll(!1);this.onResize.call(this);return this};this.toggleLock=function(){!0===this.isLocked()?this.unlock():this.lock();this.onResize.call(this);return this};this.back=function(){this.setPosition(1);for(var a=1;a<this.parent.layers.length-1;a++)this.parent.layers[a]._incPosition();this.getWorkspace().reorderLayers();
|
|
return this};this.front=function(){this.setPosition(this.parent.layers.length);this.getWorkspace().reorderLayers();return this};this.reverse=function(){for(var a=this.parent.layers.length-1,b=1;b<this.parent.layers.length;b++)this.parent.layers[b].setPosition(a),a--;this.getWorkspace().reorderLayers();return this};this.forward=function(){var a=this.getPosition();"undefined"!==typeof this.parent.layers[a+1]&&(this.parent.layers[a+1]._decPosition(),this.setPosition(a+1),this.getWorkspace().reorderLayers());
|
|
return this};this.backward=function(){var a=this.getPosition();1<a&&"undefined"!==typeof this.parent.layers[a-1]&&(this.parent.layers[a-1]._incPosition(),this.setPosition(a-1),this.getWorkspace().reorderLayers());return this};this.lock=function(){this.properties.locked=!0;this.getWorkspace().disableTransformHelper().doTool(null);return this};this.unlock=function(){this.properties.locked=!1;"hand"===this.getWorkspace().getTool()&&this.getWorkspace().enableTransformHelper();return this};this.activatePrevious=
|
|
function(){for(var a=this.getId(),b=this.parent.layers,d=b.length;0<=d;d--)if("undefined"!==typeof b[d]&&d!=a)return b[d].select();return!1};this.isLocked=function(){return this.properties.locked};this.isVisible=function(){return this.properties.visible};this.onDestroy=function(){};this.onResize=function(){var a=this.getCoords();this.getType();$("#pz-layer-width").val(a.width);$("#pz-layer-height").val(a.height);$("#pz-layer-left").val(a.left);$("#pz-layer-top").val(a.top);$("#pz-layer-opacity").val(this.getOpacity());
|
|
$("#pz-layer-name").val(this.getName());$(".linfotext").hide();switch(this.getType()){case picozu.LAYER_TYPE_SHAPE:$(".linfotype").removeClass("normal bg text textshape").addClass("shape");break;case picozu.LAYER_TYPE_TEXT:$(".linfotype").removeClass("normal bg shape textshape").addClass("text");$(".linfotext").show();$("#pz-layerText").val(this.getText());break;case picozu.LAYER_TYPE_TEXTSHAPE:$(".linfotype").removeClass("normal bg text shape").addClass("textshape");$(".linfotext").show();$("#pz-layerText").val(this.getText());
|
|
break;case picozu.LAYER_TYPE_BACKGROUND:$(".linfotype").removeClass("normal shape text textshape").addClass("bg");break;default:$(".linfotype").removeClass("shape bg text textshape").addClass("normal")}$("select#pz-layer-blend").val(this.getBlend());a="";a=!0===this.isVisible()?a+(l("%Visible")+" "):a+(l("%Hidden")+" ");!0===this.isLocked()&&(a+=l("%Locked")+" ");a+=this.getWorkspace().formatLayerName(this.getType())+" "+l("%Layer");$(".linfoabout").html(a);this.getWorkspace()._refreshLayers()};this.getHeap=
|
|
function(){return this.heap};this.setHeap=function(a,b){this.heap[a]=b;return this};this.destroy=function(a){1<this.parent.heap.lastLayerIndex&&(2<this.parent.heap.lastLayerIndex&&this.activatePrevious(),this.onDestroy.call(this),this.__destructor(a))};this._clear=function(a,b,d,e){4===arguments.length?this.getContext().clearRect(a,b,d,e):2===arguments.length?this.getContext().clearRect(a,b,this.getWidth(),this.getHeight()):this.getContext().clearRect(0,0,this.getWidth(),this.getHeight());return this};
|
|
this._setup=function(a){var b=this;this.parent=a.parent;this.properties.id=this.parent.heap.lastLayerIndex++;this.properties.visible="undefined"!==typeof a.visible?a.visible:!0;a.opacity="undefined"!==typeof a.opacity?a.opacity:10;a.last="undefined"!==typeof a.last?a.last:!1;a.blend="undefined"!==typeof a.blend?a.blend:picozu.BLEND_TYPE_NORMAL;this.properties.group="undefined"!==typeof a.group?a.group:null;this.shape="undefined"!==typeof a.shape?a.shape:{type:null,points:[]};this.properties.locked=
|
|
"undefined"!==typeof a.locked?a.locked:!1;this.properties.type="undefined"!==typeof a.type?a.type:picozu.LAYER_TYPE_NORMAL;this.properties.name="undefined"!==typeof a.name?a.name.substr(0,picozu.MAX_CHARS_LAYER_NAME):l("%Layer")+" "+this.getId();this.coords.width="undefined"!==typeof a.width?a.width:picozu.DEFAULT_WIDTH;this.coords.height="undefined"!==typeof a.height?a.height:picozu.DEFAULT_HEIGHT;this.coords.left="undefined"!==typeof a.left?a.left:0;this.coords.top="undefined"!==typeof a.top?a.top:
|
|
0;this.properties.position="undefined"!==typeof a.position?a.position:0;this.properties.composed="undefined"!==typeof a.composed?a.composed:!1;this.properties.background="undefined"!==typeof a.backgroundColor?a.backgroundColor:[255,255,255,0];this.properties.color=Color.random();this.properties.text="undefined"!==typeof a.text?a.text:null;a.image="undefined"!==typeof a.image?a.image:null;a.imageData="undefined"!==typeof a.imageData?a.imageData:null;a.imageRawData="undefined"!==typeof a.imageRawData?
|
|
a.imageRawData:null;this.template=this.template.replace(/{id}/g,this.getId()).replace(/{name}/g,this.getName()).replace(/{tid}/g,this.parent.getId()).replace(/{preview}/g,this.getType()===picozu.LAYER_TYPE_PREVIEW?"preview":"");this.parent.injectHtml(this.template);this.canvas=$(this.getElementId())[0];this.canvas.width=this.getWidth();this.canvas.height=this.getHeight();this.context=this.canvas.getContext("2d");$(this.getElementId()).css({left:this.coords.left,top:this.coords.top,"z-index":this.properties.position});
|
|
a.onResize instanceof Function&&(this.onResize=a.onResize);a.onDestroy instanceof Function&&(this.onDestroy=a.onDestroy);this.parent.layers[this.properties.id]=this;var d=this.parent.getId()+this.getId();a.type!==picozu.LAYER_TYPE_PREVIEW&&this.setFlag("opacity",a.opacity,function(a){!1===this.isLocked()&&(this.getContext().globalAlpha=a/10,this.redraw())}).setFlag("blend",a.blend,function(){!1===this.isLocked()&&this.redraw()});this.setPosition(this.parent.layers.length-1);$(this.getElementId()).css("z-index",
|
|
d);"undefined"!==typeof a.parameters&&(this.parameters=a.parameters);switch(this.getType()){case picozu.LAYER_TYPE_SHAPE:this.drawShape();break;case picozu.LAYER_TYPE_TEXTSHAPE:this.drawTextShape();break;case picozu.LAYER_TYPE_TEXT:this.drawText();break;case picozu.LAYER_TYPE_NORMAL:if(null!==a.image){var e=new Image;e.onload=function(){var d,g;"undefined"!==typeof a.width?(d=a.width,g=a.height):(d=e.width,g=e.height);b.setWidth(d).setHeight(g).drawImage(e,d,g);!1===b.properties.composed&&1===b.getId()?
|
|
(b.parent.setCoords(d,g),b.parent.setReady(!0)):!0===b.properties.composed&&!0===a.last&&b.parent.setReady(!0)};e.onerror=function(){b.getWorkspace().newLayer();b.getWorkspace().error(l("%main.image.notloaded"))};e.src=a.image}else null!==a.imageData?(e=a.imageData,this.setWidth(e.width).setHeight(e.height).drawImage(e,e.width,e.height),!1===b.properties.composed&&1===b.getId()?(this.parent.setCoords(e.width,e.height),this.parent.setReady(!0)):!0===b.properties.composed&&!0===a.last&&b.parent.setReady(!0)):
|
|
null!==a.imageRawData?(e=a.imageRawData,this.setWidth(e.width).setHeight(e.height),this.context.putImageData(e,0,0),!1===b.properties.composed&&1===b.getId()?(this.parent.setCoords(e.width,e.height),this.parent.setReady(!0)):!0===b.properties.composed&&!0===a.last&&b.parent.setReady(!0)):(1===b.getId()&&this.parent.setCoords(a.width,a.height),this.parent.setReady(!0));break;case picozu.LAYER_TYPE_BACKGROUND:this._fill(this.properties.background,0,0,this.getWidth(),this.getHeight()),this.parent.setCoords(a.width,
|
|
a.height)}!1===this.isVisible()&&this.hide();return this};this._incPosition=function(){$(this.getElementId()).css({"z-index":this.properties.position+1});return this.properties.position+=1};this._decPosition=function(){$(this.getElementId()).css({"z-index":this.properties.position-1});return this.properties.position-=1};this._fill=function(a,b,d,e,f){a=3===a.length?Color.color2Exp("rgb",a):Color.color2Exp("rgba",a);this.getContext().fillStyle=a;5===arguments.length?this.getContext().fillRect(b,d,
|
|
e,f):3===arguments.length?this.getContext().fillRect(b,d,this.getWidth(),this.getHeight()):this.getContext().fillRect(0,0,this.getWidth(),this.getHeight());return this};this._normalizeShapePoints=function(){for(var a=this.shape.points,b=0;b<a.length;b++)0<a[b][0]&&(a[b][0]=this.getWidth()),0<a[b][1]&&(a[b][1]=this.getHeight());return a};this._normalizeCoords=function(a,b){return{x:a+$(this.parent.getElementId()).scrollLeft(),y:b+$(this.parent.getElementId()).scrollTop()}};this._draw=function(a,b,
|
|
d,e,f){5===arguments.length?this.getContext().drawImage(a,b,d,e,f):3===arguments.length?this.getContext().drawImage(a,0,0,b,d):this.getContext().drawImage(a,0,0);return this};this._createLayerCopy=function(){var a=document.createElement("canvas"),b=a.getContext("2d");a.width=this.getWidth();a.height=this.getHeight();b.drawImage(this.getCanvas(),0,0);return a};this._adjustHelper=function(){$(".transform-helper").css({left:this.coords.left,top:this.coords.top,width:this.getWidth()-2,height:this.getHeight()-
|
|
2});return this};this._resize=function(a,b){var d=this._createLayerCopy();this._clear(0,0,this.getWidth(),this.getHeight());"undefined"!==typeof a&&(this.getCanvas().width=this.coords.width=a);"undefined"!==typeof b&&(this.getCanvas().height=this.coords.height=b);switch(this.getType()){case picozu.LAYER_TYPE_SHAPE:this.drawShape();break;case picozu.LAYER_TYPE_TEXTSHAPE:this.drawTextShape();break;case picozu.LAYER_TYPE_TEXT:this.drawText();break;case picozu.LAYER_TYPE_BACKGROUND:this._fill(this.properties.background,
|
|
0,0,this.getWidth(),this.getHeight());break;default:this._drawImage(d,a,b)}return this};this._drawImage=function(a,b,d,e,f){"undefined"===typeof e&&(e=0);"undefined"===typeof f&&(f=0);"undefined"===typeof b&&(b=this.getWidth());"undefined"===typeof d&&(d=this.getHeight());this._draw(a,e,f,b,d);return this};this._move=function(a,b,d){if(!1===this.isLocked()){var e=$(this.getElementId()).position();a=e.left+a;b=e.top+b;"undefined"!==typeof d&&!0===d?$(".transform-helper").css({left:a,top:b}):this.move(a,
|
|
b);this.getWorkspace()._refreshAll(!1);this.onResize.call(this);return this}return!1};return this.__constructor(a)};
|
|
picozu.objects.menu=picozu.objects.control.extend({controlType:"menu",cssClass:"",callbacks:[],parent:null,template:'<nav id="pico-menu-{id}" class="pico-menu{cssClass}"></nav>',submenus:[],__constructor:function(a){var c=this;this.parent=a.parent;this.id=this.parent.menus.length;this.name="undefined"===typeof a.name?"main":a.name;this.cssClass="undefined"!==typeof a.cssClass?a.cssClass:"";this.handle="undefined"!==typeof a.handle?a.handle:this.getElementHandle();this.submenus="undefined"===typeof a.submenus?
|
|
picozu.MAIN_MENU_DEFS:a.submenus;this.template=this.template.replace(/{id}/g,this.getId()).replace(/{cssClass}/g,""!=this.cssClass?" "+this.cssClass:"");this.injectHtml(this.template);$(this.getElementId()).html(this._load(this.submenus,!1));a.onBuild instanceof Function&&a.onBuild.call(this.parent);$(this.getElementId()+" > ul").superfish();$(this.getElementId()).on("click","ul li a",function(){if(!$(this).parent().hasClass("submenu")){var a=$(this).data("handle");c.callbacks[a]instanceof Function&&
|
|
c.callbacks[a].call(c.parent)}return!1});0===this.getId()&&(this.getWorkspace().rebuildImporters(),this.getWorkspace().rebuildCurves(),this.getWorkspace().rebuildExporters(),$("#menu-importers-list").on("click","li a",function(){var a=$(this).data("handle");"undefined"!==typeof a&&c.getWorkspace().openWindow(a)}),$("#menu-exporters-list").on("click","li > a",function(){var a=$(this).data("handle");"undefined"!==typeof a&&c.getWorkspace().openWindow(a)}),$("#menu-tools-list").on("click","li > a",function(){var a=
|
|
$(this).data("handle");"undefined"!==typeof a&&c.getWorkspace().openWindow(a)}),$("#menu-curves-list").on("click","li > a:not(.special)",function(){var a=$(this).data("handle"),d=c.getWorkspace().getStorage("curves"),e=d.findIndexM(a);"undefined"!==typeof a&&(c.getWorkspace().setParam("curves",d[e].curves),c.getWorkspace().addToQueue("curves").processQueue())}),$(this.getElementId()).on("click","#clear-recent-curves",function(){c.getWorkspace().delStorage("curves");c.getWorkspace().rebuildCurves();
|
|
return!1}));this.onCreate.call(this);this.parent.menus[this.id]=this;this.getWorkspace().log(l("%menu")+" #"+this.getId()+" "+l("%created"),l("%UI"));return this},_load:function(a,c){var b="";c&&(b=' class="arrows-menu"');for(var b="<ul"+b+">",d=0;d<a.length;d++)if("undefined"!==typeof a[d])if("undefined"!==typeof a[d].template)b+="<li>"+a[d].template+"</li>",a[d].callback instanceof Function&&(this.callbacks[a[d].handle]=a[d].callback);else if("undefined"!==typeof a[d].innerTemplate)b+='<li class="submenu"><a href="#">'+
|
|
a[d].label+"</a>"+a[d].innerTemplate+"</li>",a[d].callback instanceof Function&&(this.callbacks[a[d].handle]=a[d].callback);else{var e="",f="undefined"!==typeof a[d].cssClass?a[d].cssClass+" ":"",g="undefined"!==typeof a[d].id?' id="'+a[d].id+'"':"";a[d].separator?b+='<li class="separator"> </li>':("undefined"!==typeof a[d].submenus&&(f+="submenu"),"undefined"!==typeof a[d].shortcut&&(e='<span class="shortcut">'+a[d].shortcut.toUpperCase()+"</span>",$(document).on("keydown.picozu",null,a[d].shortcut,
|
|
a[d].callback.bind(this.parent))),a[d].callback instanceof Function&&(this.callbacks[a[d].handle]=a[d].callback),b+="<li"+g+(""!=f?' class="'+f+'"':"")+'><a href="#" data-handle="'+a[d].handle+'">'+a[d].label+e+"</a>","undefined"!==typeof a[d].submenus&&(b+=this._load(a[d].submenus,!0)),b+="</li>")}return b+"</ul>"}});
|
|
picozu.objects.panel=picozu.objects.control.extend({controlType:"panel",visible:!0,template:'<div id="pico-panel-{id}" class="pico-control pico-panel {cssClass}"><header><span class="name">{name}</span></header><section>{contents}</section></div>',__constructor:function(a){var c=this;this.parent=a.parent;this.id=this.parent.panels.length;this.name=a.name;this.handle="undefined"!==typeof a.handle?a.handle:this.getElementHandle();a.onCreate instanceof Function&&(this.onCreate=a.onCreate);a.cssClass=
|
|
"pico-panel-"+this.handle;this.parent.injectHtml(this.template.replace(/{id}/g,this.getId()).replace(/{name}/g,this.getName()).replace(/{contents}/g,"undefined"!==typeof a.template?a.template:"").replace(/{cssClass}/g,a.cssClass));this.onCreate.call(this);if("dockbar"===this.parent.getControlType())$(this.parent.getElementId()+" "+this.getElementId()).on("dblclick","header",function(a){c.toggle();a.preventDefault();return!1});!0===a.hide&&this.hide();this.parent.panels[this.id]=this;this.getWorkspace().log(l("%panel")+
|
|
" #"+this.getId()+" "+l("%created"),l("%UI"));return this},getWorkspace:function(){return this.parent.parent}});
|
|
picozu.objects.contextmenu=picozu.objects.control.extend({controlType:"contextmenu",menuID:null,parent:null,template:'<nav class="pico-contextmenu"></nav>',__constructor:function(a){this.parent=a.parent;this.id=this.parent.contextmenus.length;this.target="undefined"!==typeof a.target?a.target:null;this.handle=this.getElementHandle();this._init(a.target,a.submenus);this.onCreate.call(this);this.parent.contextmenus[this.id]=this;this.getWorkspace().log(l("%contextmenu")+" #"+this.getId()+" "+l("%created"),
|
|
l("%UI"));return this},_init:function(a,c){var b=$(this.template);b.css({display:"none",position:"absolute"}).attr({id:this.getElementHandle()}).appendTo(".picozu");$(a).data("pz_id",this.getElementHandle());$(a).data("pz",$.extend(!0,{},c));this._load(a,b,c,!0);this._create(a)},_create:function(a){var c=this;$(document).on("mousedown",a,function(a){$(".pico-contextmenu").hide();a.stopPropagation();2==a.button&&(c.menuID=$(this).data("mid"),$(c.getElementId()).css({top:a.pageY,left:a.pageX}).fadeIn())})},
|
|
_load:function(a,c,b,d){var e=this,f=$("<ul></ul>");!0==("undefined"!==typeof d?d:!0)&&f.show();for(var g in b){d=$("<li></li>");d.attr({id:"menuitem-"+g});switch(typeof b[g]){case "object":if("undefined"!==typeof b[g].label)if(""==b[g].label)d.addClass("separator");else{var h=$('<a href="#"></a>');"string"==typeof b[g].icon?d.append(h.append(' <i class="'+b[g].icon+'"></i> ').append(b[g].label)):(h=$('<a href="#">'+b[g].label+"</a>"),d.append(h));b[g].callback instanceof Function&&h.bind("mousedown",
|
|
{key:g,target:a,callback:b[g].callback},function(a){$(this).parent().hasClass("disabled")||($(".pico-contextmenu").hide(),a.data.callback.call(e.getWorkspace(),a.data.target,e.menuID))});"undefined"!==typeof b[g].disabled&&!0==b[g].disabled&&d.addClass("disabled");"object"==typeof b[g].children&&!d.hasClass("disabled")&&(d.addClass("submenu"),e._load(a,d,b[g].children,!1));d.hasClass("disabled")&&d.children("a").children("i").hide()}break;case "string":d.addClass("separator")}f.append(d)}c.append(f)}});
|
|
picozu.objects.tab=function(a){this.properties={controlType:"tab",name:null,handle:null,active:!1,id:null,dirty:!1,ready:!1};this.coords={width:0,height:0};this.activeLayer=this.parent=null;this.template='<div id="pico-tab-{id}" data-id="{id}" class="pico-tab"><section></section></div>';this.templateHelper='<div data-tid="{id}" class="select-helper"></div>';this.tabButtonTemplate='<div id="pico-tab-header-{id}" data-id="{id}" class="pico-tab-header"><span title="'+l("%tips.tabname")+'" class="tipse name">{name}</span><span title="'+
|
|
l("%Close this Tab")+'" class="tipse close">×</span></div>';this.layers=[];this.groups=[];this.heap={exif:null,lastLayerIndex:0,flatten:null};this.undo=[];this.__destructor=function(){this.onDestroy.call(this);$.fn.tipsy.revalidate();this.parent.getSelectedTab()===this&&this.activatePrevious();this.destroyLayers();$(this.getElementId()+" .name").off("click");$(this.getElementId()).remove();$("#pico-tab-header-"+this.getId()).remove();delete this.parent.tabs[this.getId()];this.parent.tabs.splice(this.getId(),
|
|
1);this.parent.heap.lastTabIndex--;this.getWorkspace().log(l("%tab")+" #"+this.getId()+" "+l("%destroyed"),l("%UI"))};this.__constructor=function(a){var b=this;this.parent=a.parent;this.properties.id=this.parent.heap.lastTabIndex++;this.coords.width="undefined"!==typeof a.width?a.width:picozu.DEFAULT_WIDTH;this.coords.height="undefined"!==typeof a.height?a.height:picozu.DEFAULT_HEIGHT;this.properties.name="undefined"!==typeof a.name?a.name:l("%untitled")+parseInt(this.getId()+1);this.properties.handle=
|
|
"undefined"!==typeof a.handle?a.handle:this.getElementHandle();this.template=this.template.replace(/{id}/g,this.getId()).replace(/{name}/g,this.getName());this.tabButtonTemplate=this.tabButtonTemplate.replace(/{id}/g,this.getId()).replace(/{name}/g,this.getName());a.image="undefined"!==typeof a.image?a.image:null;a.imageData="undefined"!==typeof a.imageData?a.imageData:null;this.parent.injectHtml(this.template);b.getWorkspace().showLoader();$(".picozu > header > .subheader").append(this.tabButtonTemplate);
|
|
this._load(a);$(".subheader").on("click","#pico-tab-header-"+this.getId()+":not(.active)",function(a){b.activate();a.stopPropagation()}).on("click","#pico-tab-header-"+this.getId()+" .close",function(a){b.destroy();a.stopPropagation()}).on("dblclick","#pico-tab-header-"+this.getId(),function(a){b.getWorkspace().openWindow("renameimage");a.stopPropagation()});this.parent.tabs[this.properties.id]=this;this.onCreate.call(this);this.getWorkspace().log(l("%tab")+" #"+this.getId()+" "+l("%created"),l("%UI"));
|
|
new picozu.objects.contextmenu({target:"#pico-temp-canvas",parent:this.getWorkspace(),submenus:picozu.TAB_CONTEXTMENU_DEFS});return this};this.getExif=function(){return this.heap.exif};this.getBackgroundLayer=function(){return!0===this.layers[1].isBackgroundLayer()?this.layers[1]:!1};this.getPreviewLayer=function(){return this.layers[0]};this.getImageData=function(){this._refreshPreview();return this.getPreviewLayer().getContext()};this.countLayers=function(){return this.layers.length-1};this.getElementId=
|
|
function(){return"#"+this.getElementHandle()};this.setCoords=function(a,b){this.coords.width=a;this.coords.height=b;$(this.getElementId()+" > section").css({width:a>=this.parent.coords.width?this.parent.coords.width:a,height:b>=this.parent.coords.height?this.parent.coords.height:b});"undefined"!==typeof this.getPreviewLayer()&&(this.getPreviewLayer().setWidth(a),this.getPreviewLayer().setHeight(b));return this};this.getSelectedLayer=function(){return this.activeLayer};this.getCoords=function(){return this.coords};
|
|
this.getWidth=function(){return this.coords.width};this.getHeight=function(){return this.coords.height};this.flatten=function(a){this.getWorkspace().saveUndo();this._refreshPreview();"undefined"!==typeof a&&!0===a&&(this.destroyLayers(),(new picozu.objects.layer({parent:this,width:this.getPreviewLayer().getWidth(),height:this.getPreviewLayer().getHeight(),imageData:this.getPreviewLayer().getCanvas()})).select());this.getWorkspace()._refreshAll();return this};this.rotate=function(a){this.getWorkspace().saveUndo();
|
|
var b=this.getWidth(),d=this.getHeight();(90===a||270===a)&&this.setCoords(d,b);for(b=1;b<this.layers.length;b++)this.layers[b].rotate(a,!0);this.getWorkspace()._refreshAll();return this};this.flip=function(a){this.getWorkspace().saveUndo();for(var b=1;b<this.layers.length;b++)this.layers[b].flip(a,!0);this.getWorkspace()._refreshAll();return this};this.destroyLayers=function(){for(var a=this.layers.length,b=1;b<=a;b++)"undefined"!==typeof this.layers[b]&&this.layers[b].destroy(!1);this.layers.splice(2);
|
|
$(".transform-helper").remove();this.groups=[];this.heap.lastLayerIndex=1;this.activeLayer=null;this.getWorkspace()._refreshLayers();return this};this.getWorkspace=function(){return this.parent};this.setReady=function(a){this.properties.ready=a;this.onReady.call(this,a);return this};this.isReady=function(){return this.properties.ready};this.activatePrevious=function(a){"undefined"===typeof a&&(a=this.getId());1<this.parent.tabs.length&&(null!==this.parent.tabs[a-1]?this.parent.tabs[a-1].activate():
|
|
this.activatePrevious(this.parent.tabs[a-1]));return this};this.setName=function(a){this.properties.name=a;$("#pico-tab-header-"+this.getId()+" span.name").html(a);return this};this.getName=function(){return this.properties.name};this.getParent=function(){return this.parent};this.getElementHandle=function(){return"pico-tab-"+this.getId()};this.setDirty=function(a){this.properties.dirty=!0===a?!0:!1;return this};this.isDirty=function(){return this.properties.dirty};this.isActive=function(){return this.properties.active};
|
|
this.activate=function(){var a=this.getWorkspace();a.getSelectedTab()!==this&&(a._clearTempCanvas(),$(".transform-helper").remove(),$(".pico-tab-header").removeClass("active"),$(".pico-tab").hide(),$("#pico-tab-header-"+this.getId()).addClass("active"),$(this.getElementId()).show(),this.properties.active=!0,a.heap.activeTab=this,this.activateLastLayer(),this.isActive()&&(a._resizeUI(),a._refreshMinimap()._refreshSwatches()._refreshHistograms()),0<this.undo.length?$("#menu-edit-undo").removeClass("disabled"):
|
|
$("#menu-edit-undo").addClass("disabled"));return this};this.getUndo=function(){return this.undo};this.setUndo=function(){this.undo.push(this.getWorkspace().exportLayers(!0));return this};this.reset=function(){var a=this;if(!0===this.isDirty())this.getWorkspace().confirmWindow(l("%tab.reset"),l("%main.unsaved"),function(){return a._reset()});else return this._reset()};this.selectLastLayer=function(){var a=this.layers.length;null!==this.layers[a-1]&&this.layers[a-1].getType()!==picozu.LAYER_TYPE_PREVIEW&&
|
|
this.layers[a-1].select();return this};this.activateLastLayer=function(){for(var a=this.layers.length;1<=a;a--)if("undefined"!==typeof this.layers[a])return this.layers[a].select();return this};this.resize=function(a,b,d){this.setCoords(a,b)._refreshPreview(!0,a,b);2===this.layers.length&&("undefined"===typeof d||!1===d)&&this.layers[1].resize(a,b);return this};this.crop=function(a,b,d,e){this.setCoords(d,e);this._refreshPreview(!0,d,e);this.getSelectedLayer().crop(a,b,d,e);this.getWorkspace()._clearTempCanvas();
|
|
return this};this.deactivate=function(){this.properties.active=!1;this.onDeactivate.call(this);return this};this.getId=function(){return this.properties.id};this.getControlType=function(){return this.properties.controlType};this.onReady=function(a){!0===a&&(this._refreshPreview(!0),this.activate())};this.onActivate=function(){};this.onDeactivate=function(){};this.onCreate=function(){};this.onDestroy=function(){};this.injectHtml=function(a){$(this.getElementId()+" > section").append(a);return this};
|
|
this.changeBackgroundColor=function(a){!0===this.layers[1].isBackgroundLayer()&&this.layers[1].fill(a,0,0,this.layers[1].getWidth(),this.layers[1].getHeight());return this};this.getHandle=function(){return this.properties.handle};this.destroy=function(){var a=this;0<this.getId()?this.isDirty()?this.getWorkspace().confirmWindow(l("%tab.close"),l("%main.unsaved"),function(){return a.__destructor()}):this.__destructor():this.getWorkspace().error(l("%tab.firstnodestroy"))};this._load=function(a){var b=
|
|
this,d=b.getWorkspace();if(a.imageFormat===picozu.FILE_FORMAT_PSD)d.loadModule("psd",function(){PSD.fromURL(a.image,function(a){try{a.parse()}catch(c){d.log(l("%main.psdimport.error"),l("%ERR"))}b.setCoords(a.header.cols,a.header.rows);var e=a.getLayerStructure();d.fillPSDInfo(a);new picozu.objects.layer({type:picozu.LAYER_TYPE_PREVIEW,parent:b,width:a.header.cols,height:a.header.rows});var f=function(a,c){for(var e,g=a.layers.length-1;0<=g;g--)e=a.layers[g],e.layers?(b.groups.push(e.name),e.name=
|
|
"("+l("%Group")+") "+e.name,null===c?c=0:c++,f(e,c)):e.image&&(0<e.image.width&&0<e.image.height)&&new picozu.objects.layer({group:c,position:g,name:e.name.substr(0,picozu.MAX_CHARS_LAYER_NAME),parent:b,width:e.width,composed:!0,height:e.height,top:e.top,left:e.left,visible:!!e.visible,last:0==g?!0:!1,opacity:(e.blendMode.opacityPercentage/10).toFixed(0),image:null!==e.image?e.image.toImage():"undefined"});d.notify(l("%main.psd.done"))};f(e,null)})});else if(a.imageFormat===picozu.FILE_FORMAT_WEBP)d.loadModule("webp",
|
|
function(){var e=new WebPDecoder,f=a.image,j=[],k=f.length,m;for(m=0;m<k;++m)j.push(f.charCodeAt(m));k=e.WebPDecoderConfig;f=k.j;f.J=4;e.WebPDecode(j,j.length,k);if(e=f.c.RGBA.ma){j=f.height;f=f.width;k=document.createElement("canvas");k.height=j;k.width=f;k=k.getContext("2d").createImageData(k.width,k.height);m=k.data;for(var n=0;n<j;n++)for(var s=0;s<f;s++)m[0+4*s+4*f*n]=e[1+4*s+4*f*n],m[1+4*s+4*f*n]=e[2+4*s+4*f*n],m[2+4*s+4*f*n]=e[3+4*s+4*f*n],m[3+4*s+4*f*n]=e[0+4*s+4*f*n];new picozu.objects.layer({type:picozu.LAYER_TYPE_PREVIEW,
|
|
parent:b,width:f,height:j});new picozu.objects.layer({parent:b,width:f,height:j,imageRawData:k});d.notify(l("%main.webp.done"))}});else if(a.imageFormat===picozu.FILE_FORMAT_SVG)d.loadModule("svg",function(){var e=document.createElement("canvas");canvg(e,a.image,{ignoreMouse:!0,ignoreAnimation:!0,renderCallback:function(){var a=e.width,c=e.height;new picozu.objects.layer({type:picozu.LAYER_TYPE_PREVIEW,parent:b,width:a,height:c});new picozu.objects.layer({parent:b,width:a,height:c,imageData:e});d.notify(l("%main.svg.done"))}})});
|
|
else if(a.imageFormat===picozu.FILE_FORMAT_RAW)new picozu.objects.layer({type:picozu.LAYER_TYPE_PREVIEW,parent:b,width:a.width,height:a.height}),new picozu.objects.layer({parent:b,width:a.width,height:a.height,imageRawData:a.image});else if(a.imageFormat===picozu.FILE_FORMAT_PZI||a.imageFormat===picozu.FILE_FORMAT_PZW){this.setCoords(a.width,a.height);new picozu.objects.layer({type:picozu.LAYER_TYPE_PREVIEW,parent:this,width:a.width,height:a.height});for(var e=0;e<a.layers.length;e++){var f=a.layers[e];
|
|
new picozu.objects.layer({parent:this,id:f.id,composed:!0,name:f.name,visible:f.visible,locked:f.locked,position:e,type:f.type,opacity:f.opacity,width:f.coords.width,height:f.coords.height,left:f.coords.left,top:f.coords.top,image:f.image,text:f.text,parameters:f.parameters,last:e==a.layers.length-1?!0:!1,shape:f.shape})}d.notify(l("%main.image.done"))}else new picozu.objects.layer({type:picozu.LAYER_TYPE_PREVIEW,parent:this,width:"undefined"!==typeof a.width?a.width:picozu.DEFAULT_WIDTH,height:"undefined"!==
|
|
typeof a.height?a.height:picozu.DEFAULT_HEIGHT}),!0===a.hasBackground?(new picozu.objects.layer({type:picozu.LAYER_TYPE_BACKGROUND,name:l("%layer.bg"),parent:this,width:"undefined"!==typeof a.width?a.width:picozu.DEFAULT_WIDTH,height:"undefined"!==typeof a.height?a.height:picozu.DEFAULT_HEIGHT,backgroundColor:a.backgroundColor,last:!0}),new picozu.objects.layer({parent:this,width:"undefined"!==typeof a.width?a.width:picozu.DEFAULT_WIDTH,height:"undefined"!==typeof a.height?a.height:picozu.DEFAULT_HEIGHT})):
|
|
null!==a.image?new picozu.objects.layer({parent:this,width:"undefined"!==typeof a.width?a.width:a.image.width,height:"undefined"!==typeof a.height?a.height:a.image.height,image:a.image}):null!==a.imageData?new picozu.objects.layer({parent:this,imageData:a.imageData}):new picozu.objects.layer({parent:this,width:"undefined"!==typeof a.width?a.width:picozu.DEFAULT_WIDTH,height:"undefined"!==typeof a.height?a.height:picozu.DEFAULT_HEIGHT});d.hideLoader();return this};this._refreshPreview=function(a,b,
|
|
d){if(this.getPreviewLayer()&&"ruler"!==this.getWorkspace().heap.activeBrush&&"colorpicker"!==this.getWorkspace().heap.activebrush){!0===a&&("undefined"!==typeof b&&"undefined"!==typeof d)&&(this.getPreviewLayer().setWidth(b),this.getPreviewLayer().setHeight(d));this.getPreviewLayer().getContext().clearRect(0,0,this.getPreviewLayer().getWidth(),this.getPreviewLayer().getHeight());for(a=1;a<this.layers.length;a++)if(b=this.layers[a],"undefined"!==typeof b&&b.isVisible()){d=b.getCoords().left;var e=
|
|
b.getCoords().top;b.getCanvas()&&(0<b.getWidth()&&0<b.getHeight())&&this.getPreviewLayer().getContext().drawImage(b.getCanvas(),d,e,b.getWidth(),b.getHeight())}this.properties.active=!0;this.getWorkspace().log(l("%preview cache created"))}return this};this._reset=function(){this.getWorkspace().saveUndo();this.destroyLayers();(new picozu.objects.layer({parent:this,width:picozu.DEFAULT_WIDTH,height:picozu.DEFAULT_HEIGHT,image:null,type:picozu.LAYER_TYPE_NORMAL})).select();this.setCoords(picozu.DEFAULT_WIDTH,
|
|
picozu.DEFAULT_HEIGHT).getWorkspace()._refreshAll();return this};return this.__constructor(a)};
|
|
picozu.objects.toolbar=picozu.objects.control.extend({controlType:"toolbar",visible:!0,state:0,buttons:[],template:'<aside id="pico-toolbar-{id}" class="pico-toolbar"><header></header><section></section></aside>',taskbarTemplate:'<div data-id="{id}" title="'+l("%Toggle")+' {name}" class="tipsw pico-task toolbar open"><span class="name">{name}</span></div>',__constructor:function(a){this.parent=a.parent;this.name="undefined"===typeof a.name?l("%Toolbar"):a.name;this.id=this.parent.toolbars.length;
|
|
this.handle="undefined"!==typeof a.handle?a.handle:this.getElementHandle();this.template=this.template.replace(/{id}/g,this.getId());this.parent.injectHtml(this.template);a.onBuild instanceof Function&&(this.onBuild=a.onBuild);this._load(a.buttons);this.taskbarTemplate=this.taskbarTemplate.replace(/{id}/g,this.getId()).replace(/{name}/g,this.name);this.getWorkspace().taskbar.injectHtml(this.taskbarTemplate);this.onCreate.call(this);this.parent.toolbars[this.id]=this;this.getWorkspace().log(l("%toolbar")+
|
|
" #"+this.getId()+" "+l("%created"),l("%UI"));return this},_load:function(a){var c=this,b=c.getWorkspace();if(0===this.id){var d='<hr /><footer class="pico-swatch clearfix"><div class="maincolors"><div class="tipsw bgcolor" title="'+l("%Background Color")+'"></div><div class="tipsw fgcolor" title="'+l("%Foreground Color")+'"></div><div class="tipsw colorswitch" title="'+l("%Switch Colors")+'"></div></div><ul class="swcolors"></ul></footer>';$(this.getElementId()).append(d);$(this.getElementId()).on("click",
|
|
".pico-swatch .colorswitch",function(){var a=b.getParam("backgroundColor");b.setParam("backgroundColor",b.getParam("foregroundColor"));b.setParam("foregroundColor",a)}).on("click",".fgcolor, .bgcolor",function(){b.openWindow("color")}).on("click",".swatchcolor",function(){var a=$(this).data("color"),a=Color.hex2rgb(a);b.setParam("foregroundColor",a);b.updateInfoPanel({rgb:a})}).on("dblclick","header",function(){c.toggleSize()})}$(this.getElementId()).on("click",".pico-button",function(){var a=$(this).data("handle");
|
|
$(c.getElementId()+" .pico-wrapGroup").fadeOut();b.doTool(a)});this.onBuild.call(b);$(this.getElementId()).draggable({opacity:0.8,containment:".picozu > section",handle:"header"});for(d=0;d<a.length;d++)a[d].separator?this.injectHtml("<hr />"):"undefined"!==typeof a[d].group?1===b.getCapability(a[d].handle,picozu.SCOPE_APP)&&this.addButtonGroup(a[d]):1===b.getCapability(a[d].handle,picozu.SCOPE_APP)&&this.addButton(a[d]);return this},addButtonGroup:function(a){this.buttons[this.buttons.length]=new picozu.objects.buttonGroup({parent:this,
|
|
onClick:a.click instanceof Function?a.click:null,buttons:a.group,handle:a.handle,label:a.label});return this},addButton:function(a){this.buttons[this.buttons.length]=new picozu.objects.button({parent:this,onClick:a.click instanceof Function?a.click:null,handle:a.handle,label:a.label});return this},removeButton:function(a){a.destroy();return this},getButton:function(a){if("number"===typeof a)return this.buttons[a];if("string"===typeof a)for(var c=0;c<this.buttons.length;c++){if("undefined"!==typeof this.buttons[c]){var b=
|
|
this.buttons[c].getHandle();if("undefined"!==typeof b&&b.toLowerCase()===a.toLowerCase())return this.buttons[c]}}else if("object"===typeof a)for(c=0;c<this.buttons.length;c++)if(this.buttons[c]===a)return this.buttons[c];return!1},toggleSize:function(){$(this.getElementId()).css({width:0===this.state?"48px":"90px"});this.state=+!this.state}});
|
|
picozu.objects.taskbar=picozu.objects.control.extend({controlType:"taskbar",template:'<div id="pico-taskbar-{id}" class="pico-taskbar"><div class="more"><ul><li><a href="#">'+l("%Workspace")+'</a><ul class="workspaces"></ul></li></ul><ul class="langs"><li title="'+l("%Change language")+'" class="lang"></li></ul></div></div>',__constructor:function(a){var c=this,b="";this.parent=a.parent;this.id=0;this.name="undefined"===typeof a.name?"system-taskbar":a.name;this.template=this.template.replace(/{id}/g,
|
|
this.getId());$(".picozu > footer").append(this.template);this.parent.taskbar=this;for(a=0;a<picozu.DEFAULT_LOCALES.length;a++)b+='<li title="'+picozu.DEFAULT_LOCALES[a].name+'" data-lang="'+picozu.DEFAULT_LOCALES[a].locale+'" style="background: transparent url('+picozu.DEFAULT_PATH+"images/flags/"+picozu.DEFAULT_LOCALES[a].handle+'.png) no-repeat center center" class="flag"></li>';$(this.getElementId()+" .langs").append(b);b="";for(a=0;a<picozu.WORKSPACES.length;a++)b+='<li data-id="'+a+'"><a href="#">'+
|
|
picozu.WORKSPACES[a].name+"</a></li>";$(this.getElementId()+" .workspaces").append(b);$(this.getElementId()).on("click",".langs",function(){$(this).children(".flag").fadeToggle()}).on("click",".flag",function(){var a=$(this).data("lang");c.getWorkspace().confirmWindow(l("%main.switchlocale"),l("%main.switchlocaletext"),function(){this.loadLocales(a);document.location.reload()})}).on("click","ul > li",function(){$(this).children("ul").fadeToggle()}).on("click","ul > li ul li",function(){var a=parseInt($(this).data("id"));
|
|
c.getWorkspace().confirmWindow(l("%main.switchworkspace"),l("%main.go_switchworkspace_"+a),function(){this.switchWorkspace(a)})}).on("click",".pico-task",function(){var a=$(this),b=parseInt(a.data("id"));a.hasClass("window")?c.getWorkspace().windows[b].toggle():a.hasClass("propbar")?c.getWorkspace().propbars[b].toggle():a.hasClass("toolbar")?c.getWorkspace().toolbars[b].toggle():a.hasClass("dockbar")&&c.getWorkspace().dockbars[b].toggle();return!1});this.onCreate.call(this);this.getWorkspace().log(l("%taskbar")+
|
|
" #"+this.getId()+" "+l("%created"),l("%UI"));return this}});
|
|
picozu.objects.window=picozu.objects.control.extend({controlType:"window",movable:!0,modal:!1,visible:!1,resizable:!1,system:!1,minimized:!1,center:!1,left:0,top:0,width:0,height:0,cssClass:null,controls:[],modalTemplate:'<div class="pico-modal-overlay opaque">{contents}</div>',template:'<div id="pico-window-{id}" class="pico-control pico-window {cssClass}"><header><span class="name">{name}</span><span class="buttons"></span></header><section>{contents}</section></div>',templateTaskbar:'<div data-id="{id}" title="'+
|
|
l("%window.toggle")+'" class="tips pico-task window"><span class="name">{name}</span></div>',__constructor:function(a){this.parent=a.parent;a.onCreate instanceof Function&&(this.onCreate=a.onCreate);a.onHide instanceof Function&&(this.onHide=a.onHide);a.onDestroy instanceof Function&&(this.onDestroy=a.onDestroy);a.onBuild instanceof Function&&(this.onBuild=a.onBuild);a.onApply instanceof Function&&(this.onApply=a.onApply);a.onShow instanceof Function&&(this.onShow=a.onShow);a.onRedraw instanceof Function&&
|
|
(this.onRedraw=a.onRedraw);this.id=this.parent.heap.lastWinIndex++;this.name=a.name;this.handle="undefined"!==typeof a.handle?a.handle:this.getElementHandle();this.cssClass="pico-window-"+this.handle;this.width="undefined"!==typeof a.width?a.width:"auto";this.height="undefined"!==typeof a.height?a.height:null;this.left="undefined"!==typeof a.left?a.left:0;this.top="undefined"!==typeof a.top?a.top:0;this.resizable="undefined"!==typeof a.resizable?a.resizable:!1;this.movable="undefined"!==typeof a.movable?
|
|
a.movable:!0;this.modal="undefined"!==typeof a.modal?a.modal:!1;this.minimized="undefined"!==typeof a.minimized?a.minimized:!1;this.system="undefined"!==typeof a.system?a.system:!1;this.visible="undefined"!==typeof a.visible?a.visible:!1;this.center="undefined"!==typeof a.center?a.center:!1;this._load(a);this.onCreate.call(this);this.parent.windows[this.id]=this;this.getWorkspace().log(l("%window")+" #"+this.getId()+" "+l("%created"),l("%UI"));return this},_load:function(a){var c=this,b="#"+this.getElementHandle(),
|
|
d=this.getWorkspace();!0===this.isModal()?(this.template=this.modalTemplate.replace(/{contents}/g,this.template.replace(/{id}/g,this.getId()).replace(/{name}/g,this.getName()).replace(/{contents}/g,"undefined"!==typeof a.template?a.template:"").replace(/{cssClass}/g,this.cssClass)),this.center=!0,$(".picozu").append(this.template)):(this.template=this.template.replace(/{id}/g,this.getId()).replace(/{name}/g,this.getName()).replace(/{contents}/g,"undefined"!==typeof a.template?a.template:"").replace(/{cssClass}/g,
|
|
this.cssClass),$(".picozu > section").append(this.template));$(b+" .buttons").append('<span title="'+l("%window.close")+'" class="tips close">×</span>');$(b).on("click",".minimize",function(){c.hide();return!1}).on("click",".close",function(){!0===c.isSystem()?c.hide():c.destroy();return!1}).on("click",".apply-button",function(){c.onApply.call(c);return!1}).on("click",".accept-button",function(){!1!==c.onApply.call(c)&&(!0===c.isSystem()?c.hide():c.destroy());return!1}).on("click",".cancel-button",
|
|
function(){!0===c.isSystem()?c.hide():c.destroy();return!1});c.isSystem()&&($(b+" .buttons").append('<span title="'+l("%window.minimize")+'" class="tips minimize"></span>'),c.templateTaskbar=c.templateTaskbar.replace(/{id}/g,c.getId()).replace(/{name}/g,this.getName()),d.taskbar.injectHtml(this.templateTaskbar),c.show());!0===this.isResizeable()&&($(b+" .buttons").append('<span title="'+l("%window.maximize")+'" class="tips maximize"></span>'),$(b).on("click",".maximize",function(){c.maximize();return!1}).on("click",
|
|
".restore",function(){c.restore();return!1}));$(b).css({width:c.width,height:c.height,left:!1===d.getCapability("mobile",picozu.SCOPE_BROWSER)?c.left:"0px",top:!1===d.getCapability("mobile",picozu.SCOPE_BROWSER)?c.top:"0px"});!0===this.isMovable()&&$(b).draggable({opacity:0.8,containment:".picozu > section",handle:"header"});return this}});
|
|
picozu.objects.plugin=function(a,c){this.parent=null;this.parameters={id:null,title:null,handle:null,version:null,email:null,url:null,description:null,depends:null,requires:null,enabled:!1};this.getHandle=function(){return this.parameters.handle};this.getDependencies=function(){return this.parameters.depends};this.getRequirements=function(){return this.parameters.requires};this.install=function(){var a=this.parent.getStorage("plugins");if(!1===a.findIndexM(this.parameters.handle)){if(null!==this.parameters.depends&&
|
|
!0===!this.parent.pluginIsInstalled(this.parameters.depends))return this.parent.notify(l("%plugin.depends.on")+this.parameters.depends+l("%plugin.depends.install"),!0),!1;a[a.length]={handle:this.getHandle(),enabled:!1};this.parent.setStorage("plugins",a);this.onInstall.call(this.parent);this.parent.log('<span class="keyword">'+this.getHandle()+"</span> "+l("%installed"),l("%PLUGIN"))}return this};this.uninstall=function(){var a=this.parent.getStorage("plugins"),c=a.findIndexM(this.parameters.handle);
|
|
!1!==c&&(this.parent.plugins[c]=null,a.splice(c,1),this.parent.setStorage("plugins",a),this.onUninstall.call(this.parent),this.parent.log('<span class="keyword">'+this.getHandle()+"</span> "+l("%uninstalled"),l("%PLUGIN")));this.__destructor()};this.enable=function(){var a=this.parent.getStorage("plugins"),c=a.findIndexM(this.getHandle());!1!==c&&(a[c].enabled=!0,this.parent.setStorage("plugins",a),this.onEnable.call(this.parent),this.parent.log('<span class="keyword">'+this.getHandle()+"</span> "+
|
|
l("%enabled"),l("%PLUGIN")));return this};this.disable=function(){var a=this.parent.getStorage("plugins"),c=a.findIndexM(this.getHandle());!1!==c&&(a[c].enabled=!1,this.parent.setStorage("plugins",a),this.onDisable.call(this.parent),this.parent.log('<span class="keyword">'+this.getHandle()+"</span> "+l("%disabled"),l("%PLUGIN")));return this};this.setup=function(){this.onSetup.call(this.parent);return this};this.action=function(a,c){this.onAction.call(this.parent,a,c)};this.__constructor=function(a,
|
|
c){this.parent=c;this.parameters.id=this.parent.plugins.length;a.onInstall instanceof Function&&(this.onInstall=a.onInstall);a.onUninstall instanceof Function&&(this.onUninstall=a.onUninstall);a.onEnable instanceof Function&&(this.onEnable=a.onEnable);a.onDisable instanceof Function&&(this.onDisable=a.onDisable);a.onSetup instanceof Function&&(this.onSetup=a.onSetup);a.onAction instanceof Function&&(this.onAction=a.onAction);for(var e in a.parameters)this.parameters[e]=a.parameters[e];this.parent.plugins[this.parameters.id]=
|
|
this;this.parent.log('<span class="keyword">'+this.getHandle()+"</span> "+l("%initialized"),l("%PLUGIN"));return this};this.__destructor=function(){this.parent.log('<span class="keyword">'+this.getHandle()+"</span> "+l("%destroyed"),l("%PLUGIN"))};this.onInstall=function(){};this.onUninstall=function(){};this.onEnable=function(){};this.onDisable=function(){};this.onAction=function(){};this.onSetup=function(){};return this.__constructor(a,c)};
|
|
picozu.objects.workspace=function(a){this.parameters={preserveAlpha:!0,curves:null,activeLayer:null,color:[],smooth:!1,tool:null,backgroundColor:[0,0,0],foregroundColor:[0,0,0],zoom:100,hue:0,saturation:0,lightness:0,brightness:0,gradient:null,gradientType:"linear",contrast:0,opacity:10,brushSize:1,brushHardness:60,brushFlow:100,brushType:"brush_normal",shadowoX:0,shadowoY:0,fillTolerance:30,shadowBlur:0,border:1,fontSize:30,fontFamily:"Times New Roman",fontCase:picozu.FONT_CASE_NORMAL,fontAlign:"left",
|
|
fontWeight:"normal",fontStyle:"normal",shapeRadius:10,fontDecoration:"none",sColor:[0,0,0],dColor:[219,2,104],drawMode:picozu.DRAW_MODE_STROKE,defaultImage:null,isCreatingText:!1,apiKey:picozu.API_KEY,whiteLabel:!1,logo:null};this._appCapabilities={};this._browserCapabilities={touch:!1,gesture:!1,platform:picozu.PLATFORM_GENERIC_DESKTOP,webgl:!1,orientation:!1,fullscreen:!1,websockets:!1,metroUI:!1,webstorage:!0,mobile:!1,collab:!1};this.settings={token:null,url:null,fullscreen:!1,locale:"en-US",
|
|
snapGrid:!1,snapTab:!1,snapLayers:!0,online:!0,autosave:!1,loadImage:null,showTips:!0,showGrid:!0,theme:picozu.THEME_DEFAULT,uAgent:null};this.coords={select:{left:0,top:0,width:0,height:0},start:{x:0,y:0},end:{x:0,y:0},move:{x:0,y:0},offset:{x:0,y:0},width:0,height:0};this.account={achievements:{points:0,ids:[],list:[]},id:null,username:null,nickname:"user-"+Math.random(),email:null,guid:null};this.template='<header><div class="header"><div class="logo"></div></div><div class="subheader"></div></header><section></section><footer></footer>';
|
|
this.loaderTemplate='<div class="pico-main-loader"><header class="header"><h1><a href="#">Picozu</a></h1><div class="loader"><span class="browser">'+l("%browser.too.old")+'</span><span class="join">'+l("%JOIN")+'</span><span class="draw">'+l("%CREATE")+'</span><span class="edit">'+l("%EDIT")+'</span><span class="share">'+l("%SHARE")+"</span></div></header></div>";this.containerTemplate='<div class="picozu"></div>';this.threads=[];this.tabs=[];this.toolbars=[];this.dockbars=[];this.propbars=[];this.windows=
|
|
[];this.menus=[];this.contextmenus=[];this.taskbar=null;this.plugins=[];this.modules=[];this.connectors=[];this.helpers=[];this.parent=null;this.heap={};this.debug=this.modal=this.logger=this.notifier=null;this.__destructor=function(){};this.__constructor=function(a){this.initTime=+new Date;this.clearHeap();$.support.cors=!0;$.event.props.push("dataTransfer");var b=picozu.THEME_DEFAULT,d=localStorage.getItem("theme");null!==d&&d!==b&&($("#pico-theme-loaded").attr("href",picozu.API_ENTRY_POINT+d+".css"),
|
|
this.setSetting("theme",d));this.heap.params=a="undefined"!==typeof a&&"object"===typeof a?a:{};this._parseParameters(a)._detectCapabilities()._setDefaultSettings();picozu.events.initKeyboard.call(this);this._init(!0);"undefined"!==typeof a.theme&&this.loadTheme(a.theme);return this};this._init=function(a){!0===this.getSetting("hasFullscreen")?(this.coords.width=screen.width,this.coords.height=screen.height-81):(this.coords.width=window.innerWidth,this.coords.height=window.innerHeight-81);if(!0!==
|
|
this._checkBrowser())return $(".pico-main-loader .browser").fadeIn(),!1;$(".pico-main-loader .join").delay(500).fadeIn();"undefined"!==typeof a&&!0===a?$(".picozu").append(this.template):$(".picozu").empty().append(this.template);this.notifier=new picozu.objects.notifier;this.logger=new picozu.objects.logger;this.modal=new picozu.objects.modal;$(".picozu > section").append('<canvas id="pico-temp-canvas"></canvas>');this.tempCanvas=$("#pico-temp-canvas")[0];this._parseURL();this._heartbeat();("undefined"===
|
|
typeof this.settings.loadImage||null===this.settings.loadImage)&&this.openWindow("intro");return this};this._parseParameters=function(a){$("body").append(this.containerTemplate);$(".picozu").append(this.loaderTemplate);"undefined"!==typeof a.key&&null!==a.key&&(this.parameters.apiKey=picozu.API_KEY=a.key);"undefined"!==typeof a.whiteLabel&&null!==a.whiteLabel&&(this.parameters.whiteLabel=a.whiteLabel);"undefined"!==typeof a.saveURL&&null!==a.saveURL&&(picozu.API_SAVE=a.saveURL);!0===this.parameters.whiteLabel&&
|
|
$(".pico-main-loader header h1").hide();this.settings.loadImage="undefined"!==typeof a.loadImage&&null!==a.loadImage?!0===this.validateBase64(a.loadImage)?window.atob(a.loadImage):!0===this.validateImageURL(a.loadImage)?a.loadImage:null:null;return this};this.createGradient=function(a,b,d,e,f){var g=null,h=this.getParam("gradient");if(null!==h){this.getParam("gradientType")==picozu.GRADIENT_MODE_LINEAR?g=a.createLinearGradient(b+e,d+f,e,f):(g=b+e/2,d+=f/2,_r=e/2,g=a.createRadialGradient(g,d,0,g,d,
|
|
_r));for(a=0;a<h.stops.length;a++)g.addColorStop(h.stops[a].position,h.stops[a].color)}return g};this._enterFullscreen=function(){document.documentElement.requestFullScreen?document.documentElement.requestFullScreen():document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullScreen&&document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);this.setSetting("fullscreen",!0);return this};this._leaveFullscreen=
|
|
function(){document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen();this.setSetting("fullscreen",!1);return this};this.reset=function(a){this.tabs=[];this.toolbars=[];this.dockbars=[];this.propbars=[];this.windows=[];this.menus=[];this.contextmenus=[];this.taskbar=null;this.plugins=[];this.setSetting("token",null);this.heap.lastTabIndex=0;return this._init(a)};this._resizeUI=
|
|
function(){!0===this.getSetting("fullscreen")?(this.coords.width=screen.width,this.coords.height=screen.height-$(".picozu > header").height()-$(".picozu > footer").height()):(this.coords.width=!0===this.getSetting("isEmbed")?this.settings.container.width():$(".picozu").width(),this.coords.height=(!0===this.getSetting("isEmbed")?this.settings.container.height():$(".picozu").height())-$(".picozu > header").height()-$(".picozu > footer").height());$("#pico-dockbar-0, .picozu > section, #pico-dockbar-0 > section").height(this.coords.height);
|
|
var a=this.getSelectedTab();null!==a&&$(".pico-tab > section").css({width:this.coords.width<a.getWidth()?this.coords.width:a.getWidth(),height:this.coords.height<a.getHeight()?this.coords.height:a.getHeight()});return this};this.updateInfoPanel=function(a){"undefined"!==typeof a.x&&0<a.x&&$(".info-left").html(a.x);"undefined"!=typeof a.y&&0<a.y&&$(".info-top").html(a.y);"undefined"!==typeof a.w&&0<a.w&&$(".info-width").html(a.w);"undefined"!==typeof a.h&&0<a.h&&$(".info-height").html(a.h);if("undefined"!==
|
|
typeof a.rgb){$(".info-red").html(a.rgb[0]);$(".info-green").html(a.rgb[1]);$(".info-blue").html(a.rgb[2]);var b=Color.rgb2hsv(a.rgb[0],a.rgb[1],a.rgb[2]);$(".info-hue").html(Math.round(b[0].toFixed(4)));$(".info-sat").html(Math.round(100*b[1].toFixed(4)));$(".info-value").html(Math.round(100*b[2].toFixed(4)));b=Color.rgb2cmyk(a.rgb[0],a.rgb[1],a.rgb[2]);$(".info-cyan").html(b[0].toFixed(4));$(".info-magenta").html(b[1].toFixed(4));$(".info-yellow").html(b[2].toFixed(4));$(".info-black").html(b[3].toFixed(4));
|
|
b=Color.rgb2hex(a.rgb[0],a.rgb[1],a.rgb[2]);$(".info-hex").html(b);b=Color.rgb2xyz(a.rgb[0],a.rgb[1],a.rgb[2]);$(".info-x").html((100*b[0]).toFixed(1));$(".info-y").html((100*b[1]).toFixed(1));$(".info-z").html((100*b[2]).toFixed(1));b=Color.xyz2lab(100*b[0],100*b[1],100*b[2]);$(".info-l").html(b[0].toFixed(1));$(".info-a").html(b[1].toFixed(1));$(".info-b").html(b[2].toFixed(1))}return this};this.isOnline=function(){return this.getSetting("online")};this.setCapability=function(a,b,d){"undefined"!==
|
|
typeof d||d===picozu.SCOPE_APP?this._appCapabilities[a]=b:this._browserCapabilities[a]=b;return this};this.getCapability=function(a,b){return b===picozu.SCOPE_APP?"undefined"!==typeof this._appCapabilities[a]?this._appCapabilities[a]:1:b===picozu.SCOPE_BROWSER?"undefined"!==typeof this._browserCapabilities[a]?this._browserCapabilities[a]:!1:!1};this._setupDefaultUI=function(){var a=this;new picozu.objects.taskbar({parent:this});new picozu.objects.propbar({name:l("%Debugger"),parent:this,hidden:!0,
|
|
panels:picozu.DEBUGGER_PROPBAR});this.log(l("%ui.system.start"),l("%UI"));new picozu.objects.menu({parent:this});new picozu.objects.toolbar({parent:this,buttons:picozu.MAIN_TOOLBAR_DEFS});new picozu.objects.dockbar({parent:this,panels:picozu.MAIN_DOCKBAR_PANELS});new picozu.objects.propbar({parent:this,panels:picozu.MAIN_PROPBAR_PANELS});null!==this.settings.loadImage?this.parseImageFile(this.settings.loadImage):!0===picozu.START_WITH_SAMPLE_IMAGE?this.parseImageFile(picozu.DEFAULT_PATH+"images/samples/"+Math.floor(Math.random()*picozu.SAMPLE_IMAGES+1)+".jpg"):new picozu.objects.tab({parent:this});$(".pico-main-loader .draw").delay(1E3).fadeIn();this._resizeUI();$(".pico-main-loader .edit").delay(1500).fadeIn();
|
|
this.setParam("backgroundColor",[0,0,0]).setParam("foregroundColor",[219,2,104]);this.tempCanvas.width=this.coords.width;this.tempCanvas.height=this.coords.height;this._setupEvents();if("undefined"===typeof this.heap.params.workspace||1==this.heap.params.workspace)this.toolbars[0].show(),this.dockbars[0].show(),this.getStorage("plugins")?this._loadPlugins():this._loadPlugins(picozu.DEFAULT_PLUGINS);else switch(this.heap.params.workspace){case 0:this.propbars[1].hide();this.toolbars[0].show();this.dockbars[0].hide();
|
|
break;case 2:this.propbars[1].hide();this.toolbars[0].show();this.dockbars[0].show();this._loadPlugins(picozu.DEFAULT_EDUCATIONAL_PLUGINS);break;case 3:this.propbars[1].hide(),this.toolbars[0].show(),this.dockbars[0].show(),this._loadPlugins(picozu.DEFAULT_KIDS_PLUGINS)}this.doTool(null);this.endTime=+new Date;this.log(l("%app initialized in")+" "+(this.endTime-this.initTime)+l("%ms"));$(".pico-main-loader .share").delay(2E3).fadeIn();$(".tips").tipsy({gravity:$.fn.tipsy.autoNS});
|
|
$(".tipse").tipsy({gravity:$.fn.tipsy.autoWE});$(".tipsw").tipsy({gravity:"sw"});$(".pico-main-loader").delay(2500).fadeOut("fast",function(){a._resizeUI();$(this).remove();$(".pico-app-wrapper .close").show()});!1===this.getCapability("mobile",picozu.SCOPE_BROWSER)&&(!1!==this.getSetting("autosave")&&!0===this.getSetting("online")&&(a.heap.autosaveInterval=setInterval(function(){a.autosave()},parseInt(a.getSetting("autosave")))),a.heap.tipsInterval=setInterval(function(){a.showTip()},12E4));return this};
|
|
this._refreshAll=function(){null!==this.getSelectedTab()&&!0===this.getSelectedTab().isReady()&&(this.getSelectedTab()._refreshPreview(),this._refreshMinimap()._refreshSwatches()._refreshHistograms());this._refreshLayers();return this};this._setupEvents=function(){$(window).on("resize",picozu.events.onWindowResize.bind(this)).on("deviceorientation",picozu.events.onChangeOrientation.bind(this)).on("devicemotion",picozu.events.onChangeAcceleration.bind(this)).on("beforeunload",function(){return l("%unsaved.changes")});
|
|
$(document).on("dragover",picozu.events.onCanvasDocumentDragOver.bind(this)).on("dragleave",picozu.events.onCanvasDocumentLeave.bind(this)).on("drop",picozu.events.onCanvasDocumentDrop.bind(this)).on("contextmenu",function(a){a.preventDefault()});$(this.tempCanvas).on("mousedown",picozu.events.onCanvasMouseDown.bind(this)).on("mouseup",picozu.events.onCanvasMouseUp.bind(this)).on("mousemove",picozu.events.onCanvasMouseMove.bind(this)).on("dblclick",picozu.events.onCanvasMouseDblclick.bind(this)).on("mousewheel",
|
|
picozu.events.onCanvasMouseWheelScroll.bind(this)).on("DOMMouseScroll",picozu.events.onCanvasMouseWheelScroll.bind(this));if(!0===this.getCapability("touch",picozu.SCOPE_BROWSER))$(this.tempCanvas).on("touchstart",picozu.events.onCanvasTouchStart.bind(this)).on("touchend",picozu.events.onCanvasTouchEnd.bind(this)).on("touchmove",picozu.events.onCanvasTouchMove.bind(this));return this};this.getParent=function(){return this.parent};this.getCoords=function(){return this.coords};this.magicErase=function(a,
|
|
b){return!0===this.getSelectedTab().isReady()?(this.spawnThread(picozu.WORKER_TYPE_PROCESS,"fill",{params:{tolerance:this.getParam("fillTolerance"),color:[0,0,0,0],mode:"erase",x:a,y:b},imageData:this.getSelectedLayerImageData()}),this):!1};this.floodFill=function(a,b){return!0===this.getSelectedTab().isReady()?(this.spawnThread(picozu.WORKER_TYPE_PROCESS,"fill",{params:{tolerance:this.getParam("fillTolerance"),color:this.getParam("foregroundColor"),mode:"fill",x:a,y:b},imageData:this.getSelectedLayerImageData()}),
|
|
this):!1};this.addDefaultWatermark=function(){this.addWatermark(picozu.DEFAULT_PATH+"images/logos/watermark.png",10,10);return this};this.addWatermark=function(a,b,d){var e=this,f=new Image,g=null;f.onload=function(){g=(new picozu.objects.layer({parent:e.getSelectedTab(),width:f.width,height:f.height,left:b,top:d,name:l("%Watermark"),opacity:3})).drawImage(f,f.width,f.height);e._refreshAll();return g};f.onerror=function(){e.error(l("%main.image.notloaded"))};f.src=a;return this};this.refreshTool=
|
|
function(){null!==this.heap.tool&&"object"===typeof this.heap.tool&&(this.heap.tool.__destructor(),this.heap.tool=new (picozu.tools[this.getTool()])(this.getSelectedLayer(),this.parameters,this,this.tempCanvas));return this};this.doTool=function(a){if(null===this.getSelectedLayer())return this.disableTransformHelper(),!1;if(!1===this.isEditableLayer(a))return this.error(l("%layer.locked")).disableTransformHelper(),!1;null!==this.heap.tool&&"object"===typeof this.heap.tool&&(this.heap.tool.__destructor(),
|
|
this.log(l("%tool destroyed")));if(null!==a&&a!==this.getTool()){if($("#pico-toolbar-0 .pico-button, #pico-toolbar-0 .pico-buttonGroup").removeClass("selected pressed"),null!==a&&(-1<a.search("pencil_")?$("#pico-toolbar-0 .pico-button.pencil").addClass("selected"):$("#pico-toolbar-0 .pico-button."+a).addClass("selected").parent().parent(".pico-buttonGroup").addClass("selected")),$(".pico-textform-helper").remove(),this.disableTransformHelper(),this.heap.activeBrush=a,null!==a){switch(a){case "pencil_normal":this.propbars[1].hideAllExcept(["brush",
|
|
"shapes"]);break;case "pencil_smooth":case "pencil_sketchtaculous":case "pencil_sketchy":case "pencil_chrome":case "pencil_fur":case "pencil_web":case "pencil_shaded":case "pencil_ribbon":case "pencil_circles":case "pencil_stars":case "pencil_diamonds":case "pencil_shadetastic":case "pencil_grid":case "pencil_longfur":case "pencil_squares":case "pencil_string":case "pencil_curves":case "pencil_parvo":case "pencil_flowers":case "pencil_palm":case "pencil_palmtree":case "pencil_grassy":case "pencil_starry":case "pencil_naturalfur":this.propbars[1].hideAllExcept(["brush",
|
|
"shapes"]);break;case "brush":case "pen":this.propbars[1].hideAllExcept(["brush","shapes"]);break;case "eraser":this.propbars[1].hideAllExcept(["brush","shapes"]);break;case "magiceraser":case "colorfill":case "airbrush":this.propbars[1].hideAllExcept("brush");break;case "text":this.propbars[1].hideAllExcept("font");break;case "line":case "arrow":case "rectangle":case "circle":case "ellipse":case "roundedRectangle":this.propbars[1].hideAllExcept("shapes");break;case "hand":this.enableTransformHelper()}this.heap.tool=
|
|
new picozu.tools[a](this.getSelectedLayer(),this.parameters,this,this.tempCanvas);this.log(l("%tool")+' <span class="keyword">'+a+"</span> "+l("%initialized"))}}else this._clearTempCanvas(),$("#pico-toolbar-0 .pico-button").removeClass("selected pressed"),this.heap.activeBrush=this.heap.tool=null,this.disableTransformHelper();return this};this.log=function(a,b){this.logger.trigger({message:a,scope:"undefined"===typeof b?l("%APP"):b});return this};this.getTool=function(){return this.heap.activeBrush};
|
|
this.disableTransformHelper=function(){$(".transform-helper").css({"z-index":9997}).draggable("option","disabled",!0).resizable("option","disabled",!0).children(".tooltip").hide();return this};this.enableTransformHelper=function(){var a=this.getSelectedLayer().getCoords();$(".transform-helper").css({"z-index":9998}).draggable("option","disabled",!1).resizable("option","disabled",!1);$(".transform-helper .tooltip .left").html(l("%Left")+": "+a.left);$(".transform-helper .tooltip .top").html(l("%Top")+
|
|
": "+a.top);$(".transform-helper .tooltip").show();return this};this.setParam=function(a,b){this.parameters[a]=b;switch(a){case "backgroundColor":$(".pico-swatch .bgcolor").css("background-color","#"+Color.rgb2hex(b[0],b[1],b[2]));break;case "foregroundColor":$(".pico-swatch .fgcolor").css("background-color","#"+Color.rgb2hex(b[0],b[1],b[2])),this.updateInfoPanel({rgb:b}),$(".layerborder .bordercolor").css({"background-color":"#"+Color.rgb2hex(b[0],b[1],b[2])});case "border":case "fontSize":case "brushSize":case "opacity":case "fontFamily":case "fontAlign":case "fontDecoration":case "fontStyle":case "fontWeight":case "shadowoX":case "shadowoY":case "shadowBlur":case "shapeRadius":$("#pz-"+
|
|
a)&&$("#pz-"+a).val(b);if($(".pico-textform")){var d=this.getParam("foregroundColor");$(".pico-textform").css("font-family",this.getParam("fontFamily")).css("font-size",this.getParam("fontSize")).css("font-style",this.getParam("fontStyle")).css("font-weight",this.getParam("fontWeight")).css("text-decoration",this.getParam("fontDecoration")).css("text-align",this.getParam("fontAlign")).css("color","#"+Color.rgb2hex(d[0],d[1],d[2])).css("opacity",this.getParam("opacity")/10)}break;case "drawMode":$(".drawmodeinfo > .pico-button[data-value="+
|
|
b+"]").addClass("selected")}return this};this.getParam=function(a){return"undefined"!==typeof this.parameters[a]?this.parameters[a]:!1};this._refreshHistograms=function(a){null!==this.getSelectedTab()&&(!0===this.getSelectedTab().isReady()&&this.pluginIsEnabled("histograms"))&&this.spawnThread(picozu.WORKER_TYPE_PROCESS,"histogram",{type:a,imageData:this.getPreviewLayer().getImageData(0,0,this.getPreviewLayer().getWidth(),this.getPreviewLayer().getHeight())});return this};this._refreshSwatches=function(){null!==
|
|
this.getSelectedTab()&&(!0===this.getSelectedTab().isReady()&&this.pluginIsEnabled("swatches"))&&(this.spawnThread(picozu.WORKER_TYPE_PROCESS,"swatch",{params:this.parameters,imageData:this.getPreviewLayer().getImageData(0,0,this.getPreviewLayer().getWidth(),this.getPreviewLayer().getHeight())}),this.refreshCustomSwatches());return this};this.pickColor=function(a,b){var d=this.getPreviewLayer().getImageData(a,b,1,1).data;this.setParam("foregroundColor",d).updateInfoPanel({rgb:d});return this};this.importTabs=
|
|
function(a){a=JSON.parse(a);this.reset();for(var b=0;b<a.length;b++)if("tab"===a[b].controlType){for(var d=[],e={},f=0;f<a[b].layers.length;f++)"object"===typeof a[b].layers[f]&&(e=a[b].layers[f],d.push(e));this.newTab({handle:a[b].handle,name:a[b].name,id:a[b].id,width:a[b].coords.width,height:a[b].coords.height,layers:d})}this.hideLoader();return this};this.importLayers=function(a){var b;a=JSON.parse(a);this.getSelectedTab().destroyLayers();for(var d=0;d<a.length;d++)"layer"===a[d].controlType&&
|
|
(b=new picozu.objects.layer({type:a[d].type,id:a[d].id,text:a[d].text,name:a[d].name,composed:a[d].composed,parent:this.getSelectedTab(),left:a[d].coords.left,top:a[d].coords.top,visible:a[d].visible,locked:a[d].locked,width:a[d].coords.width,height:a[d].coords.height,image:null!==a[d].shape.type||null!==a[d].text?null:a[d].image,group:a[d].coords.group,shape:a[d].shape,text:a[d].text,parameters:a[d].parameters,last:d==a.length-1?!0:!1}),d===a.length-1&&b.select());this.hideLoader();return this};
|
|
this.unserialize=function(a){a=JSON.parse(a);this.getSelectedTab().destroyLayers();for(var b=0;b<a.length;b++)switch(a[b].controlType){case "tab":for(var d=[],e={},f=0;f<a[b].layers.length;f++)"object"===typeof a[b].layers[f]&&(e=a[b].layers[f],d.push(e));this.newTab({handle:a[b].handle,name:a[b].name,id:a[b].id,width:a[b].coords.width,height:a[b].coords.height,layers:d});break;case "layer":new picozu.objects.layer({type:a[b].type,id:a[b].id,text:a[b].text,name:a[b].name,composed:a[b].composed,parent:this.getSelectedTab(),
|
|
left:a[b].coords.left,top:a[b].coords.top,width:a[b].coords.width,height:a[b].coords.height,image:null!==a[b].shape.type||null!==a[b].text?null:a[b].image,group:a[b].coords.group,shape:a[b].shape,text:a[b].text,parameters:a[b].parameters,last:b==a.length-1?!0:!1})}this.getSelectedTab().selectLastLayer();this.hideLoader()};this.exportTabs=function(a){for(var b=[],d={},e=0;e<this.tabs.length;e++)if("object"===typeof this.tabs[e]){var f=this.tabs[e],d={controlType:"tab",handle:f.getElementHandle(),name:f.getName(),
|
|
id:f.getId(),coords:f.getCoords(),layers:[]};d.layers=this.exportLayers(!1,f);b.push(d)}return!0===a?JSON.stringify(b):b};this.exportLayers=function(a,b){var d=[],e,f={};e="undefined"!==typeof b?b.layers:this.getSelectedTab().layers;for(var g=1;g<e.length;g++)"object"===typeof e[g]&&(f=e[g],f={controlType:"layer",group:f.getGroup(),text:f.getText(),composed:f.properties.composed,id:f.getId(),position:f.getPosition(),name:f.getName(),opacity:f.getOpacity(),locked:f.isLocked(),visible:f.isVisible(),
|
|
type:f.getType(),image:null!==f.getShape().type||null!==f.getText()?null:f.getCanvas().toDataURL("image/png"),coords:f.getCoords(),shape:f.getShape(),text:f.getText(),parameters:f.getParameters()},d.push(f));return!0===a?JSON.stringify(d):d};this.showTip=function(){!0===this.getSetting("showTips")&&this.notifier.trigger({title:l("%Tips & Tricks"),tip:!0,content:picozu.TIPS[Math.floor(Math.random()*picozu.TIPS.length)]});return this};this.serialize=function(a,b){var d=[],e,f={},g={};this.log(l("%serializing data."));
|
|
if("tabs"===a){e=this.controls();for(var h=0;h<e.tabs.length;h++)if("object"===typeof e.tabs[h]){for(var f=e.tabs[h],f={controlType:"tab",handle:f.getElementHandle(),name:f.getName(),id:f.getId(),coords:f.getCoords(),layers:[]},j=1;j<e.tabs[h].layers.length;j++)"object"===typeof e.tabs[h].layers[j]&&(g=e.tabs[h].layers[j],g={controlType:"layer",group:g.getGroup(),composed:g.properties.composed,text:g.getText(),id:g.getId(),name:g.getName(),opacity:g.getOpacity(),position:g.getPosition(),locked:g.isLocked(),
|
|
visible:g.isVisible(),type:g.getType(),image:null!==g.getShape().type||null!==g.getText()?null:g.getCanvas().toDataURL("image/png"),coords:g.getCoords(),shape:g.getShape(),text:g.getText(),parameters:g.getParameters()},f.layers.push(g));d.push(f)}}else if("layers"===a){e=this.getSelectedTab().layers;for(h=1;h<e.length;h++)"object"===typeof e[h]&&(g=e[h],f={controlType:"layer",group:g.getGroup(),text:g.getText(),composed:g.properties.composed,id:g.getId(),position:g.getPosition(),name:g.getName(),
|
|
opacity:g.getOpacity(),locked:g.isLocked(),visible:g.isVisible(),type:g.getType(),image:null!==g.getShape().type||null!==g.getText()?null:g.getCanvas().toDataURL("image/png"),coords:g.getCoords(),shape:g.getShape(),text:g.getText(),parameters:g.getParameters()},d.push(f))}return!0===b?JSON.stringify(d):d};this.autosave=function(){var a=this;if(!1!==this.getSetting("autosave")&&!0===this.getSetting("online")){var b=null!==this.getSetting("token")?"&token="+this.getSetting("token"):"";this.exportData(picozu.FILE_FORMAT_PZW,
|
|
function(d,e){a.doRequest(picozu.API_AUTOSAVE,"contents="+d+"&format="+e+b,function(b){a.setSetting("token",b.code).notify(l("%main.doneautosave"))},null,"json")})}else this.error(l("%main.offline"));return this};this.clearHeap=function(){this.heap={lastTabIndex:0,lastWinIndex:0,trackerReady:!1,clipboard:{data:null,width:0,height:0},isDraw:!1,tool:null,layer:null,preview:{canvas:null,context:null},minimap:null,queued:!1,activeTab:null,activeBrush:null,cache:{},queue:[],swatches:null,customSwatches:[]};
|
|
return this};this.loadModule=function(a,b){-1==this.modules.indexOf(a)?(this.modules.push(a),$.getScript(picozu.DEFAULT_MODULES_PATH+a+".js",b)):b()};this._refreshMinimap=function(){null!==this.getSelectedTab()&&!0===this.getSelectedTab().isReady()&&(this.heap.minimap=(new picozu.objects.minimap({canvas:$(this.getSelectedTab().layers[0].getElementId())[0]})).update(),this.log(l("%refreshing minimap data")));return this};this._checkBrowser=function(){var a=document.createElement("canvas");return!(!a.getContext||
|
|
!a.getContext("2d"))};this._detectCapabilities=function(){"undefined"!==typeof window.DeviceOrientationEvent&&this.setCapability("orientation",!0);this.setCapability("touch",Boolean("ontouchstart"in window||window.navigator.msMaxTouchPoints));this.setCapability("gesture",Boolean("ongesturestart"in window||window.navigator.msMaxTouchPoints));this.setSetting("uAgent",navigator.userAgent.toLowerCase());for(var a=0,b,d;b=picozu.PLATFORMS[a];a++)if(d=b.regex.exec(navigator.userAgent)){this.setCapability("platform",
|
|
b.id);this.setCapability("mobile",b.mobile);break}"undefined"!==typeof WinJS&&this.setCapability("metroUI",!0);navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;a=document.createElement("canvas");b=null;try{b=a.getContext("webgl")||a.getContext("experimental-webgl")}catch(e){}b&&this.setCapability("webgl",!0);this.setCapability("websockets","WebSocket"in window||"MozWebSocket"in window);return this};this._setDefaultSettings=
|
|
function(){this.getStorage("plugins")||this.setStorage("plugins",picozu.DEFAULT_PLUGINS);return this};this._parseURL=function(){var a=window.location.hash.split("/");"undefined"!==typeof a[1]&&""!==a[1]&&(a=picozu.objects.crypter.decryptObject(a[1],picozu.ENCRYPT_KEY),"undefined"!==typeof a.room&&null!==this.server.socket&&(this.server.invited=!0,this.server.roomID=a.room),"undefined"!==typeof _d.image&&(this.settings.loadImage=_d.image));return this};this._clearTempCanvas=function(){this.tempCanvas.getContext("2d").clearRect(0,
|
|
0,this.getWidth(),this.getHeight());return this};this.getCoords=function(){return this.coords};this.getWidth=function(){return this.coords.width};this.getHeight=function(){return this.coords.height};this.setSetting=function(a,b){this.settings[a]=b;this.setStorage(a,b);return this};this.getSetting=function(a){return"undefined"!==typeof this.settings[a]?this.settings[a]:!1};this._convertSize=function(a,b,d,e){return 1===e?{w:100*(a/d)/100,h:100*(b/d)/100}:{w:a*d,h:b*d}};this._normalizeCoords=function(a,
|
|
b){if(null!==this.getSelectedTab()){var d=$(this.getSelectedTab().getElementId()+" > section"),e=0,f=0;a=a-$(this.getSelectedTab().getElementId()).offset().left+d.scrollLeft();b=b-$(this.getSelectedTab().getElementId()).offset().top+d.scrollTop();if(null!==this.getSelectedLayer()){var d=this.getSelectedLayer().getCoords(),g=this.getTool();"undefined"!==typeof g&&null!==g&&(-1===g.search("diagram_")&&"ellipse"!==g&&"line"!==g&&"arrow"!==g&&"circle"!==g&&"rectangle"!==g&&"roundedRectangle"!==g)&&(e=
|
|
d.left,f=d.top)}}return{x:a-e,y:b-f,tx:a,ty:b}};this.formatLayerName=function(a){var b="";switch(a){case picozu.LAYER_TYPE_TEXT:b=l("%Text");break;case picozu.LAYER_TYPE_NORMAL:b=l("%Normal");break;case picozu.LAYER_TYPE_SHAPE:b=l("%Shape");break;case picozu.LAYER_TYPE_TEXTSHAPE:b=l("%Mixed");break;case picozu.LAYER_TYPE_BACKGROUND:b=l("%Background")}return b};this.formatShapeName=function(a){var b="";switch(a){case picozu.SHAPE_RECTANGLE:b=l("%Rectangle");break;case picozu.SHAPE_CIRCLE:b=l("%Circle");
|
|
break;case picozu.SHAPE_LINE:b=l("%Line");break;case picozu.SHAPE_ELLIPSE:b=l("%Ellipse");break;case picozu.SHAPE_ROUNDED_RECTANGLE:b=l("%Rounded Rect");break;case picozu.SHAPE_ARROW:b=l("%Arrow")}return b};this.loadTheme=function(a){"undefined"!==typeof a?(this.setSetting("theme",a),$("#pico-theme-loaded").attr("href",picozu.API_ENTRY_POINT+a+".css"),this.setStorage("theme",a)):(a=localStorage.getItem("theme"),$("#pico-theme-loaded").attr("href",a+".css"),this.setSetting("theme",a));return this};
|
|
this._applyDefaultSettings=function(a){var b=this.tempCanvas.getContext("2d");a="undefined"!==typeof a?a:this.getSelectedLayer().getContext();b.lineWidth=a.lineWidth=this.getParam("brushSize");b.shadowOffsetX=a.shadowOffsetX=this.getParam("shadowoX");b.shadowOffsetY=a.shadowOffsetY=this.getParam("shadowoY");b.shadowBlur=a.shadowBlur=this.getParam("shadowBlur");b.shadowColor=a.shadowColor="rgba("+this.parameters.backgroundColor[0]+", "+this.parameters.backgroundColor[1]+","+this.parameters.backgroundColor[2]+
|
|
", "+0.1*this.getParam("opacity")+")";b.strokeStyle=a.strokeStyle="rgba("+this.parameters.foregroundColor[0]+", "+this.parameters.foregroundColor[1]+","+this.parameters.foregroundColor[2]+", "+0.1*this.getParam("opacity")+")";b.fillStyle=a.fillStyle="rgba("+this.parameters.backgroundColor[0]+", "+this.parameters.backgroundColor[1]+","+this.parameters.backgroundColor[2]+", "+0.1*this.getParam("opacity")+")";b.globalCompositeOperation=a.globalCompositeOperation="source-over";b.lineCap=a.lineCap="round";
|
|
b.lineJoin=a.lineJoin="round";b.globalAlpha=a.globalAlpha=0.1*this.parameters.opacity;b.textBaseline=a.textBaseline="top";b.textAlign=a.textAlign=this.getParam("fontAlign");return this};this.installSafariShooter=function(){this.plugins.shooterSafari=!0;$(".pico-window-helpcontents .shooter-installed").empty().append("<blockquote>"+l("%picozu.shooter.installed")+"</blockquote>").show();return!1};this._installFirefoxShooter=function(){InstallTrigger.install({Picozu:{URL:picozu.SHOOTER_XPI,IconURL:picozu.SHOOTER_ICON_URL,
|
|
toString:function(){return this.URL}}});this.plugins.shooterFirefox=!0;$(".pico-window-helpcontents .shooter-installed").empty().append("<blockquote>"+l("%picozu.shooter.installed")+"</blockquote>").show();return!1};this._checkAppsInstalled=function(){var a=this;if(a.getCapability("platform",picozu.SCOPE_BROWSER)===picozu.PLATFORM_FIREFOX){var b=new Image;b.onload=function(){a.plugins.shooterFirefox=!0};b.onerror=function(){a.plugins.shooterFirefox=!1;a.notifier.trigger({title:l("%Picozu Shooter"),
|
|
timeout:!1,error:!1,content:l("%picozu.shooter.text1")+' <a target="_blank" href="'+picozu.SHOOTER_PAGE+'">'+l("%Picozu Shooter")+"</a> "+l("%picozu.shooter.text2")+'<br /><hr /><a class="pic-button ok-btn pico-install-shooter" href="#">'+l("%Install")+'</a> <a class="pic-button ok-btn" target="_blank" href="'+picozu.SHOOTER_MOZILLA_PAGE+'">'+l("%Mozilla project page")+"</a>"});$(".pico-notifications").on("click",".pico-install-shooter",function(b){a._installFirefoxShooter(b);return!1})};b.src=picozu.SHOOTER_ICON;
|
|
"undefined"!==typeof window.navigator.mozApps&&(b=window.navigator.mozApps.getSelf(),b.onsuccess=function(){if(null===typeof this.result){var b=navigator.mozApps.install(picozu.API_MOZILLA_MANIFEST);b.onsuccess=function(){a.notify(l("%main.mozillainstall"))};b.onerror=function(){a.error(l("%main.mozilainstall.error")+" "+this.error.name)}}},b.onerror=function(){a.error(l("%main.mozilainstall.error")+" "+this.error.name)})}else a.getCapability("platform",picozu.SCOPE_BROWSER)===picozu.PLATFORM_CHROME?
|
|
chrome.app.isInstalled||(this.notifier.trigger({title:l("%Picozu Chrome"),timeout:!1,error:!1,content:l("%picozu.chrome.text1")+' <a target="_blank" href="'+picozu.CHROME_APP+'">'+l("%Picozu Chrome")+"</a> "+l("%picozu.chrome.text2")+'<br /><hr /><a class="pic-button ok-btn pico-install-chrome" href="#">'+l("%Install")+'</a> <a class="pic-button ok-btn" target="_blank" href="'+picozu.CHROME_APP+'">'+l("%Picozu Chrome app page")+"</a>"}),$(".pico-notifications").on("click",".pico-install-chrome",function(){chrome.webstore.install();
|
|
return!1})):this.getCapability("platform",picozu.SCOPE_BROWSER);return this};this.loadLocales=function(a){this.setStorage("locale",a);String.locale=a;return this};this.addTool=function(a,b){picozu.TOOLS.push({name:a,handle:b});this.rebuildTools();return this};this.removeTool=function(a){if(a=picozu.TOOLS.findIndexM(a))picozu.TOOLS.splice(a,1),this.rebuildTools();return this};this.addImporter=function(a,b){picozu.IMPORTERS.push({name:a,handle:b});this.rebuildImporters();return this};this.removeImporter=
|
|
function(a){if(a=picozu.IMPORTERS.findIndexM(a))picozu.IMPORTERS.splice(a,1),this.rebuildImporters();return this};this.addExporter=function(a,b){picozu.EXPORTERS.push({name:a,handle:b});this.rebuildExporters();return this};this.isErrorRequest=function(a){return"error"===a.status?!0:!1};this.imageFromLayer=function(){var a=this.getSelectedLayer();return this.newTab({imageData:a.getCanvas(),width:a.getWidth(),height:a.getHeight()})};this.removeExporter=function(a){if(a=picozu.EXPORTERS.findIndexM(a))picozu.EXPORTERS.splice(a,
|
|
1),this.rebuildExporters();return this};this.getMainDockbar=function(){return this.dockbars[0]};this.triggerAchievement=function(a){if(!1===this.hasAchievement(a)&&!0===this.getSetting("online")&&!0===picozu.ACHIEVEMENTS){var b=new picozu.objects.achievement(a,picozu.ACHIEVEMENTS_LIST[a],this);b.trigger();this.account.achievements.list[a]=b;return this}return!1};this.hasAchievement=function(a){return!0===picozu.ACHIEVEMENTS?!1===this.account.achievements.ids.findIndex(a)?!1:!0:!1};this._googleAnalyticsInit=
|
|
function(){return this};this.googleAnalyticsTrack=function(){return this};return this.__constructor(a)};
|
|
picozu.objects.workspace.prototype.updateProfile=function(a){var c=this,b=[];this.validEmail(a.email)||b.push(l("%reg.error.email"));""!==a.password&&(this.validPassword(a.password)||b.push(l("%reg.error.password")),a.password!==a.password2&&b.push(l("%reg.error.password2")));0===b.length?($(".prof-pass, .prof-pass2").val(""),this.doRequest(picozu.API_PROFILE,$.param(a)+"&id="+c.account.id,function(a){"error"===a.status?c.error(l("%profile.error")):c.notify(l("%profile.success"))},function(){c.notify(l("%profile.error"))},
|
|
"json")):this.error(b.join("<br />"));return this};picozu.objects.workspace.prototype.recover=function(a){var c=this;$(".rec-username, .rec-email").val("");""===a.username&&""===a.email?c.error(l("%recover.error.empty")):this.doRequest(picozu.API_RECOVER,$.param(a),function(a){c.isErrorRequest(a)?c.error(l("%recover.error")):c.notify(l("%recover.success"))},function(){c.error(l("%recover.error"))},"json");return this};
|
|
picozu.objects.workspace.prototype.login=function(a){var c=this,b=[];$(".log-username, .log-pass").val("");this.validPassword(a.password)||b.push(l("%reg.error.password"));this.validUsername(a.username)||b.push(l("%reg.error.username"));0===b.length?this.doRequest(picozu.API_SIGNIN,$.param(a),function(a){c.isErrorRequest(a)?($(".account-tab.profile-panel").hide(),$(".account-tab.login-panel").show(),c.error(l("%login.error"))):($(".account-tab.login-panel").hide(),$(".account-tab.profile-panel").show(),
|
|
$(".pico-window-account footer").empty().append('<input type="button" class="pico-button ok-btn update" value="'+l("%main.save")+'" /> <input type="button" class="pico-button ok-btn logout" value="'+l("%signout")+'" /> <input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.cancel")+'" />').show())},function(){c.error(l("%login.error"))},"json"):c.error(b.join("<br />"));return this};
|
|
picozu.objects.workspace.prototype.isLoggedIn=function(){return null!==this.account.id&&null!==this.account.username?!0:!1};picozu.objects.workspace.prototype.logout=function(){var a=this;this.doRequest(picozu.API_SIGNOUT,null,function(c){a.isErrorRequest(c)?a.error(l("%logout.error")):(a.resetAccount(),$(".account-tab.profile-panel").hide(),$(".account-tab.login-panel").fadeIn(),$(".pico-window-account footer").empty().hide())},function(){a.error(l("%logout.error"))},"json");return this};
|
|
picozu.objects.workspace.prototype.register=function(a){var c=this,b=[];this.validEmail(a.email)||b.push(l("%reg.error.email"));this.validPassword(a.password)||b.push(l("%reg.error.password"));this.validUsername(a.username)||b.push(l("%reg.error.username"));this.validFullname(a.fullname)||b.push(l("%reg.error.fullname"));a.password!==a.password2&&b.push(l("%reg.error.password2"));0===b.length?($(".reg-fullname, .reg-username, .reg-email, .reg-pass, .reg-pass2").val(""),this.doRequest(picozu.API_SIGNUP,
|
|
$.param(a),function(a){"error"==a.status||"undefined"!==typeof a.user.id.errors?c.error("error"==a.status?a.error:l("%registration.error")):c.notify(l("%registration.success"))},null,"json")):c.error(b.join("<br />"));return this};picozu.objects.workspace.prototype.getAccount=function(){return null!==this.account.id?this.account:!1};
|
|
picozu.objects.workspace.prototype.fillAccount=function(a){this.account={achievements:{points:0,ids:[],list:[]},id:a.user.id,username:a.user.username,nickname:a.user.nickname,email:a.user.email,registered:a.user.registered,avatar:a.user.avatar,guid:picozu.objects.crypter.guid()};$(".prof-username").val(this.account.username);$(".prof-email").val(this.account.email);$(".prof-fullname").val(this.account.nickname);$(".prof-avatar").attr("src",this.account.avatar);return this};
|
|
picozu.objects.workspace.prototype.resetAccount=function(){this.account={achievements:{points:0,ids:[],list:[]},userdata:null,id:null,username:null,nickname:"user-"+Math.random(),email:null,registered:null,avatar:null,guid:null};$(".prof-username").val("");$(".prof-email").val("");$(".prof-nickname").val("");$(".prof-avatar").attr("src",picozu.DEFAULT_PATH+"images/gui/avatar.jpg");return this};
|
|
picozu.objects.workspace.prototype._loadFileHelper=function(a,c,b,d,e,f){!0===a?this.newLayer(c,{width:d,height:e}):(this._getExif(c),this.newTab({name:f,image:c,width:d,height:e,imageFormat:b}));return this};picozu.objects.workspace.prototype.loadPSDFile=function(a,c){this.newTab({name:c,image:a,imageFormat:picozu.FILE_FORMAT_PSD});return this};picozu.objects.workspace.prototype.loadWEBPFile=function(a,c){this.newTab({name:c,image:a,imageFormat:picozu.FILE_FORMAT_WEBP});return this};
|
|
picozu.objects.workspace.prototype.loadSVGFile=function(a,c){this.newTab({name:c,image:a,imageFormat:picozu.FILE_FORMAT_SVG});return this};picozu.objects.workspace.prototype.loadRAWFile=function(a,c){this.spawnThread(picozu.WORKER_TYPE_PROCESS,"raw",{image:a,name:c});return this};
|
|
picozu.objects.workspace.prototype.loadASEFile=function(a,c){var b=Import.fromASE(a),d=this.getStorage("customSwatches"),b=b.flattened;if(null===d)d=b;else for(var e=0;e<b.length;e++)d.push(b[e]);this.setStorage("customSwatches",d);this.refreshCustomSwatches();c instanceof Function&&c.call(this,b);$(".pico-swatches-tabs").tabs("option","active",2);this.notify(l("%main.swatches.done"));return this};
|
|
picozu.objects.workspace.prototype.loadACVFile=function(a,c,b){a=Import.fromACV(a);var d=this.getStorage("curves"),e={handle:c,curves:a};null===d&&(d=[]);!1===d.findIndexM(c)&&(d.push(e),this.setStorage("curves",d));this.setParam("curves",a);this.rebuildCurves();b instanceof Function&&b.call(this,a);this.notify(l("%main.curves.done"));return this};
|
|
picozu.objects.workspace.prototype.loadPZWFile=function(a){a=a.replace("data:application/octet-stream;base64,","");a=Import.fromPZW(picozu.objects.crypter.base64Decode(a));this.parameters=a.d.parameters;this.settings=a.d.settings;this.heap.customSwatches=a.d.swatches;this.reset();this.refreshCustomSwatches();for(var c=0;c<a.d.tabs.length;c++){var b=a.d.tabs[c];this.newTab({width:b.coords.width,height:b.coords.height,layers:b.layers,imageFormat:picozu.FILE_FORMAT_PZW})}this.notify(l("%main.workspace.done"));
|
|
return this};
|
|
picozu.objects.workspace.prototype.loadImageFile=function(a,c,b){var d=new Image,e=this;d.onload=function(){d.width>picozu.WARN_IMAGE_DIMENSION||d.height>picozu.WARN_IMAGE_DIMENSION?e.openWindow("importResize",{name:l("%Resize Image"),handle:"importResize",width:270,modal:!0,template:"<p>"+l("%resize.bigimage")+"</p><hr /><fieldset><label>"+l("%Width")+'</label><select disabled class="medium right pz-image-width-unit"><option value="0">'+l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small pz-image-width" value="'+
|
|
d.width+'" /></fieldset><fieldset><label>'+l("%Height")+'</label><select disabled class="medium right pz-image-height-unit"><option value="0">'+l("%pixels")+'</option><option value="1">'+l("%inches")+'</option></select><input type="text" class="pico-textinput small pz-image-height" value="'+d.height+'" /></fieldset><fieldset><label>'+l("%Keep Ratio")+'</label><input type="checkbox" class="pico-checkbox pz-image-ratio" checked /></fieldset>',onCreate:function(){var a=this,b=this.getElementId(),c=this.getIntValue(".pz-image-width"),
|
|
d=this.getIntValue(".pz-image-height"),e=c/d;this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);$(b).on("keyup.picozu",".pz-image-width",function(){if($(b+" .pz-image-ratio").is(":checked")){var c=parseInt($(this).val())/e+0.5|0;a.setIntValue(".pz-image-height",c)}}).on("keyup.picozu",".pz-image-height",function(){if($(b+" .pz-image-ratio").is(":checked")){var c=parseInt($(this).val())*e+0.5|0;a.setIntValue(".pz-image-width",c)}}).on("change",".pz-image-ratio",function(){var b=a.getIntValue(".pz-image-width")/
|
|
e+0.5|0;a.setIntValue(".pz-image-height",b)}).on("change",".pz-image-width-unit, .pz-image-height-unit",function(){var a=parseInt($(this).val());$(b+" select.pz-image-width-unit, "+b+" select.pz-image-height-unit").val(a)})},onApply:function(){var d=this.getIntValue(".pz-image-width"),g=this.getIntValue(".pz-image-height");e._loadFileHelper(c,a,null,d,g,b)}}):e._loadFileHelper(c,a,null,d.width,d.height,b)};d.onerror=function(){e.error(l("%main.file.notloaded")).hideLoader()};d.src=a;return this};
|
|
picozu.objects.workspace.prototype.isLocalImage=function(a){return"https://www.picozu.com/"===a.substring(0,23)?!0:!1};picozu.objects.workspace.prototype._onFailLoadImage=function(){this.error(l("%main.image.errorimport"));new picozu.objects.tab({parent:this});this.hideLoader()};picozu.objects.workspace.prototype._onDoneLoadImage=function(a){a=a.binaryResponse.getRawData();var c=picozu.objects.crypter.base64Encode(a);this._getExifFromBinary(a);this.loadImageFile("data:image/png;base64,"+c)};
|
|
picozu.objects.workspace.prototype.parseImageFile=function(a,c,b){this.showLoader();var d=this;"undefined"===typeof c&&(c=!1);!0===this.isLocalImage(a)?(a=decodeURIComponent(a),d.doBinaryRequest(a,this._onDoneLoadImage,this._onFailLoadImage)):!1===c?(a=a.split("?")[0],!0===this.validateImageURL(a)?this.doRequest(picozu.API_PROXY,"url="+picozu.objects.crypter.base64Encode(a)+("undefined"!==typeof b?"&token="+b:""),function(a){d.doBinaryRequest(picozu.API_ENTRY_POINT+"v/"+a.dir+a.code+"."+a.format,
|
|
d._onDoneLoadImage,d._onFailLoadImage)},function(){d.error(l("%main.image.errorimport")).hideLoader()},"json"):this.error(l("%main.image.errorimport")).hideLoader()):this.doRequest(picozu.API_PROXY,"url="+picozu.objects.crypter.base64Encode(a)+("undefined"!==typeof b?"&token="+b:""),function(a){d.doBinaryRequest(picozu.API_ENTRY_POINT+"v/"+a.dir+a.code+"."+a.format,d._onDoneLoadImage,d._onFailLoadImage)},function(){d.error(l("%main.image.errorimport")).hideLoader()},"json");return this};
|
|
picozu.objects.workspace.prototype.loadPZIFile=function(a,c){var b=a.replace("data:application/octet-stream;base64,",""),b=Import.fromPZI(picozu.objects.crypter.base64Decode(b));this.newTab({name:c,width:b.d.width,height:b.d.height,layers:b.d.layers,imageFormat:picozu.FILE_FORMAT_PZI});this.notify(l("%main.image.done"));return this};
|
|
picozu.objects.workspace.prototype.loadFile=function(a,c,b){var d=this;this.showLoader();if(""!==a&&null!==a&&"undefined"!==typeof a){var e=new FileReader,f=a.name.split(".").pop().toLowerCase();a.name.split(".");var g=a.type.toLowerCase();e.onload=function(e){e=e.target.result;switch(g){case "image/jpeg":case "image/pjpeg":case "image/png":case "image/bmp":case "image/gif":d.loadImageFile(e,b,a.name);break;case "image/cr2":case "image/crw":d.loadRAWFile(e,a.name);break;case "image/svg+xml":d.loadSVGFile(e,
|
|
a.name);break;case "":switch(f){case "psd":d.loadPSDFile(e,a.name);break;case "webp":d.loadWEBPFile(e,a.name);break;case "pzi":d.loadPZIFile(e,a.name);break;case "pzw":d.loadPZWFile(e);break;case "acv":d.loadACVFile(e,a.name,c);break;case "ase":d.loadASEFile(e,c);break;default:d.error(l("%main.file.unknown"))}break;default:d.error(l("%main.file.unknown")).hideLoader()}d.hideLoader()};e.onerror=function(){d.error(l("%main.file.notloaded")).hideLoader()};"acv"===f||"ase"===f||"webp"===f||"crw"===f||
|
|
"cr2"===f?e.readAsBinaryString(a):e.readAsDataURL(a)}return this};picozu.objects.workspace.prototype.fillPSDInfo=function(a){$(".pico-window-imageinfo .ii-PixelXDimension").val(a.header.cols);$(".pico-window-imageinfo .ii-PixelYDimension").val(a.header.rows);$(".pico-window-imageinfo .ii-ColorMode").val(a.header.modename);$(".pico-window-imageinfo .ii-Channels").val(a.header.channels);return this};
|
|
picozu.objects.workspace.prototype.fillEXIFInfo=function(){var a=this.getSelectedTab().getExif();if(null!==a){for(var c in a)$(".pico-window-imageinfo .ii-"+c).val("object"===typeof c?c.join(","):a[c]);""!=$(".ii-GPSLatitude").val()&&""!=$(".ii-GPSLongitude").val()&&$(".pico-window-imageinfo footer").append('<a href="#" class="pico-button ok-btn locate">'+l("%Locate on map")+"</a>")}return this};
|
|
picozu.objects.workspace.prototype._getExif=function(a){a=a.split(",");this.spawnThread(picozu.WORKER_TYPE_PROCESS,"exif",1<a.length?window.atob(a[1]):window.atob(a[0]));return this};picozu.objects.workspace.prototype._getExifFromBinary=function(a){this.spawnThread(picozu.WORKER_TYPE_PROCESS,"exif",a);return this};
|
|
picozu.objects.workspace.prototype.exportData=function(a,c,b){this.showLoader().getSelectedTab()._refreshPreview();var d,e=!1,f=Export.toPNG(this.getPreviewLayer().getCanvas()),g=picozu.DEFAULT_EXPORTERS.findIndexM(a),h=this.getSelectedTab().getName(),j="";"undefined"!==typeof b&&(j=$.param(b));a!==picozu.FILE_FORMAT_BINARY&&!1===g?this.error(l("%main.exporter")).hideLoader():(!1!==g&&(d=picozu.DEFAULT_EXPORTERS[g],d=d.ext),a===picozu.FILE_FORMAT_PZI?("undefined"!==typeof b&&$.each(b,function(a,b){"encryptPZ"===
|
|
b.name&&(e=!!b.value)}),f=Export.toPZI(this.exportLayers(),this.getSelectedTab().getWidth(),this.getSelectedTab().getHeight(),e)):a===picozu.FILE_FORMAT_PZW?("undefined"!==typeof b&&$.each(b,function(a,b){"encryptPZ"===b.name&&(e=!!b.value)}),f=Export.toPZW(this.exportTabs(),this.parameters,this.settings,this.heap.customSwatches,null,[],e)):a===picozu.FILE_FORMAT_STYLESHEET?(data2=Export.toCSS(this.exportLayers(),f,b),f=[f,data2],d=["png","css"],h=["sprites","style"]):a===picozu.FILE_FORMAT_BINARY&&
|
|
(f=Export.toBinary(this.getPreviewLayer()),d="bin"),c instanceof Function&&c.call(this,f,d,h,j))};
|
|
picozu.objects.workspace.prototype.renderFrame=function(a,c){var b=this,d="undefined"===typeof c?this.getParam("renderFrame"):c.renderFrame;if(null!==d){var e=new Image,f;if("undefined"!==typeof a&&!0===a){var g=$("#filter-preview")[0];f=$("#filter-preview")[0].getContext("2d").getImageData(0,0,g.width,g.height)}else f=this.getSelectedLayerImageData();e.src=picozu.DEFAULT_PATH+d;e.onload=function(){if("undefined"!==typeof a&&!0===a){var c=document.createElement("canvas"),d=c.getContext("2d"),g=$("#filter-preview")[0],
|
|
m=g.getContext("2d");c.width=g.width;c.height=g.height;d.putImageData(f,0,0);m.drawImage(c,0,0,g.width,g.height);m.drawImage(e,0,0,g.width,g.height)}else b.saveUndo(),c=b.getSelectedLayer().getWidth(),d=b.getSelectedLayer().getHeight(),(new picozu.objects.layer({parent:b.getSelectedTab(),width:c,height:d,name:"Frame"})).drawImage(e,c,d),b._refreshAll();b.setParam("renderFrame",null);b.processQueue()};e.onerror=function(){("undefined"===typeof a||!1===a)&&b.error(l("%main.image.notloaded"))}}return this};
|
|
picozu.objects.workspace.prototype.renderImage=function(a,c){var b=this,d="undefined"===typeof c?this.getParam("renderImage"):c.renderImage;if(null!==d){var e=new Image,f;if("undefined"!==typeof a&&!0===a){var g=$("#filter-preview")[0];f=$("#filter-preview")[0].getContext("2d").getImageData(0,0,g.width,g.height)}else!1===this.hasSelection()&&(this.coords.select.width=this.getSelectedLayer().getWidth(),this.coords.select.height=this.getSelectedLayer().getHeight()),g=this.getSelection(),f=this.getSelectedLayer().getImageData(g.left,
|
|
g.top,g.width,g.height);e.src=picozu.DEFAULT_PATH+d;e.onload=function(){"undefined"!==typeof a&&!0===a||b.saveUndo();var c=document.createElement("canvas"),d=c.getContext("2d");c.width=f.width;c.height=f.height;d.drawImage(e,0,0,e.width,e.height,0,0,f.width,f.height);c=d.getImageData(0,0,f.width,f.height);for(d=0;d<f.data.length;d+=4){var g=f.data[d]*c.data[d]/255;f.data[d]=255<g?255:0>g?0:g;g=f.data[d+1]*c.data[d+1]/255;f.data[d+1]=255<g?g:0>g?0:g;g=f.data[d+2]*c.data[d+2]/255;f.data[d+2]=255<g?
|
|
255:0>g?0:g}"undefined"!==typeof a&&!0===a?$("#filter-preview")[0].getContext("2d").putImageData(f,0,0):(b.getSelectedLayer().drawImageData(f,b.coords.select.left,b.coords.select.top),b._refreshAll());b.setParam("renderImage",null);b.processQueue()};e.onerror=function(){("undefined"===typeof a||!1===a)&&b.error(l("%main.image.notloaded"))}}return this};
|
|
picozu.objects.workspace.prototype._refreshFilterPreview=function(a){this.getSelectedTab()._refreshPreview();var c,b,d,e,f,g=$("#filter-preview")[0],h=g.getContext("2d");!0===this.hasSelection()?(e=this.getSelection(),c=e.width,b=e.height,d=e.left,e=e.top):(c=this.getSelectedLayer().getWidth(),b=this.getSelectedLayer().getHeight(),e=d=0);f=c/b;c>b?(g.width=285,g.height=285/f+0.5|0):(g.width=220*f+0.5|0,g.height=220);h.drawImage(this.getSelectedLayer().getCanvas(),d,e,c,b,0,0,g.width,g.height);if("undefined"!==
|
|
typeof a&&(a=this.getFilter(a))){if("undefined"!==typeof a.queue)for(c=0;c<a.queue.length;c++)"undefined"!==typeof a.queue[c].params&&this.configFilter(a.queue[c].params),"undefined"!==typeof a.queue[c].action&&"string"===typeof a.queue[c].action?this.addToQueue(this[a.queue[c].action],!0,a.queue[c].params):"undefined"!==typeof a.queue[c].action&&"function"===typeof a.queue[c].action?this.addToQueue(a.queue[c].action,!0,a.queue[c].params):this.addToQueue(a.queue[c].filter,!0,a.queue[c].params);else"undefined"!==
|
|
typeof a.params&&this.configFilter(a.params),"undefined"!==typeof a.action&&"string"===typeof a.action?this.addToQueue(this[a.action],!0,a.params):"undefined"!==typeof a.action&&"function"===typeof a.action?this.addToQueue(a.action,!0,a.params):this.addToQueue(a.filter,!0,a.params);this.processQueue()}return this};
|
|
picozu.objects.workspace.prototype.applyBlend=function(a,c){var b,d,e="undefined"===typeof c?this.getParam("blendMode"):c.blendMode;if("undefined"!==typeof a&&!0===a){var f=$("#filter-preview")[0];d=b=f.getContext("2d");if("undefined"!==typeof b&&"undefined"!==typeof d)var g={preview:a,params:this.parameters,src:b.getImageData(0,0,f.width,f.height),dst:d.getImageData(0,0,f.width,f.height)}}else b=this.getSelectedLayer(),d=this.getSelectedTab().countLayers(),d=1<d?this.getSelectedTab().layers[d-1]:
|
|
b,"undefined"!==typeof b&&"undefined"!==typeof d&&(g=b.getCoords().left-d.getCoords().left,f=b.getCoords().top-d.getCoords().top,g={params:this.parameters,dst:b.getImageData(0,0,b.getWidth(),b.getHeight()),src:d.getImageData(g,f,b.getWidth(),b.getHeight())});this.spawnThread(picozu.WORKER_TYPE_BLENDMODE,e,g);return this};
|
|
picozu.objects.workspace.prototype.getFilter=function(a){for(var c=0;c<picozu.FILTERS.length;c++)for(var b in picozu.FILTERS[c])for(var d=0;d<picozu.FILTERS[c][b].length;d++)if(a===picozu.FILTERS[c][b][d].filter)return picozu.FILTERS[c][b][d];return!1};picozu.objects.workspace.prototype.configFilter=function(a){for(var c in a)this.setParam(c,a[c]);return this};
|
|
picozu.objects.workspace.prototype.addToQueue=function(a,c,b){"undefined"===typeof c&&(c=!1);b=$.extend({},this.parameters,b);this.heap.queue.push({params:b,filter:a,preview:c});return this};picozu.objects.workspace.prototype.clearQueue=function(){this.heap.queue=[];return this};
|
|
picozu.objects.workspace.prototype.processQueue=function(){var a=this.heap.queue.length-1,c=this.heap.queue[a];"undefined"!==typeof c&&("string"===typeof c.filter&&!1===c.preview?(this.parameters=c.params,this.applyFilter(c.filter)):"string"===typeof c.filter&&!0===c.preview?(this.parameters=c.params,this._applyPreviewFilter(c.filter)):("function"===typeof c.filter&&(this.parameters=c.params),c.filter.call(this,c.preview,c.params)),this.heap.queue.splice(a,1));return this};
|
|
picozu.objects.workspace.prototype._applyPreviewFilter=function(a){var c=$("#filter-preview")[0];this.spawnThread(picozu.WORKER_TYPE_FILTER,a,{params:this.parameters,imageData:c.getContext("2d").getImageData(0,0,c.width,c.height),preview:!0});return this};
|
|
picozu.objects.workspace.prototype.applyFilter=function(a){if(!0===this.isLayerEditable()){if(null===a||"undefined"===typeof a)return self.error(l("%main.select.filter")),!1;!1===this.hasSelection()&&(this.coords.select.width=this.getSelectedLayer().getWidth(),this.coords.select.height=this.getSelectedLayer().getHeight());var c=this.getSelection(),c={params:this.parameters,imageData:this.getSelectedLayer().getImageData(c.left,c.top,c.width,c.height),preview:!1};this.spawnThread(picozu.WORKER_TYPE_FILTER,
|
|
a,c)}return this};
|
|
picozu.objects.workspace.prototype._processThread=function(a,c,b,d,e){b=parseInt(b);this.endTime=+new Date;this.log(l("%thread done")+' <span class="keyword">'+l("%id")+":"+c+'</span> <span class="keyword">'+l("%type")+":"+d+'</span> <span class="keyword">'+l("%time")+":"+(this.endTime-this.initTime)+l("%ms")+"</span>",l("%KERNEL"));if(!0===e)return $("#filter-preview")[0].getContext("2d").putImageData(a,0,0),this._killThread(c),this.log(l("%success.preview.thread")),this.processQueue(),this;if(null!==
|
|
this.getSelectedLayer()){this._killThread(c);e=this.getSelection();switch(b){case picozu.WORKER_TYPE_BLENDMODE:this.saveUndo();this.getSelectedLayer().drawImageData(a,0,0);this.getSelectedLayer().setBlend(d);this.processQueue();break;case picozu.WORKER_TYPE_FILTER:this.saveUndo();this.getSelectedLayer().drawImageData(a,e.left,e.top);this.processQueue();break;case picozu.WORKER_TYPE_FRACTAL:this.getSelectedLayer().drawImageData(a,e.left,e.top);break;case picozu.WORKER_TYPE_OTHER:this.getSelectedLayer().drawImageData(a,
|
|
e.left,e.top);break;case picozu.WORKER_TYPE_TEXTURE:this.getSelectedLayer().drawImageData(a,e.left,e.top);break;case picozu.WORKER_TYPE_PROCESS:if("exif"===d)this.getSelectedTab().heap.exif=a,this.fillEXIFInfo();else if("swatch"===d){$("#pico-toolbar-0 .swcolors").empty();if(null!=a.colors){d="";for(e=0;e<a.colors.length;e++){var f=Color.color2Exp("rgb",a.colors[e]),g=Color.rgb2hex(a.colors[e][0],a.colors[e][1],a.colors[e][2]);6>e&&($("#pico-toolbar-0 .swcolors").append('<li class="swatchcolor color'+
|
|
(e+1)+'"></li>'),$("#pico-toolbar-0 .swcolors .color"+(e+1)).css("background-color",f).data("color",g));d+='<div data-mid="'+e+'" title="#'+g+'" data-color="'+g+'" class="tips pico-image-swatches-item" style="background-color:'+f+'"></div>'}$(".pico-swatches-container-image").empty().append(d)}else $(".pico-swatches-container-image").empty();this.heap.swatches=a.colors}else"histogram"===d?this.drawHistogram(a):"fill"===d?(this.saveUndo(),this.getSelectedLayer().drawImageData(a,e.left,e.top),this._refreshAll()):
|
|
"raw"===d?this.newTab({name:a.name,image:a.image,width:a.width,height:a.height,imageFormat:picozu.FILE_FORMAT_RAW}):this.getSelectedLayer().drawImageData(a,e.left,e.top)}0===this.heap.queue.length&&(b===picozu.WORKER_TYPE_OTHER||b===picozu.WORKER_TYPE_FILTER||b===picozu.WORKER_TYPE_FRACTAL||b===picozu.WORKER_TYPE_BLENDMODE)&&this._refreshAll();this.log(l("%thread processed")+' <span class="keyword">'+l("%id")+":"+c+"</span>",l("%KERNEL"));this.hideLoader()}this.selectNone();return this};
|
|
picozu.objects.workspace.prototype.hasWorkerSupport=function(){return!!window.Worker};
|
|
picozu.objects.workspace.prototype.spawnThread=function(a,c,b){a=parseInt(a);var d=this,e=d.threads.length;if(this.hasWorkerSupport()){this.initTime=+new Date;switch(a){case picozu.WORKER_TYPE_FILTER:!0!==b.preview&&this.showLoader();this.threads[e]=new Worker(picozu.DEFAULT_WORKER_PATH+"filters/"+c+".js");break;case picozu.WORKER_TYPE_TEXTURE:this.showLoader();this.threads[e]=new Worker(picozu.DEFAULT_WORKER_PATH+"textures/"+c+".js");break;case picozu.WORKER_TYPE_BLENDMODE:!0!==b.preview&&this.showLoader();
|
|
this.threads[e]=new Worker(picozu.DEFAULT_WORKER_PATH+"blendmodes/"+c+".js");break;case picozu.WORKER_TYPE_FRACTAL:this.showLoader();this.threads[e]=new Worker(picozu.DEFAULT_WORKER_PATH+"fractals/"+c+".js");break;case picozu.WORKER_TYPE_PROCESS:"fill"===c&&this.showLoader();this.showLoader();this.threads[e]=new Worker(picozu.DEFAULT_WORKER_PATH+"processors/"+c+".js");break;case picozu.WORKER_TYPE_OTHER:this.showLoader(),this.threads[e]=new Worker(picozu.DEFAULT_WORKER_PATH+"other/"+c+".js")}this.threads[e].addEventListener("message",
|
|
function(f){d._processThread(f.data,e,a,c,b.preview)},!1);this.threads[e].addEventListener("error",function(a){d.log(l("%thread")+' <span class="error">#'+e+"</span> "+l("%failed at line")+' <span class="error">'+a.lineno+"</span> "+l("%in")+' <span class="error">'+a.filename+"</span> "+l("%with the message")+' <span class="error">'+a.message+"</span>",l("%ERR"));d._processThreadError(e)},!1);this.threads[e].postMessage(b);this.log(l("%thread spawned")+' <span class="keyword">'+l("%id")+":"+e+'</span> <span class="keyword">'+
|
|
l("%type")+":"+c+"</span> "+(!0===b.preview?'<span class="keyword">'+l("%mode")+":preview</span>":"")+("undefined"!==typeof b.imageData?' <span class="keyword">'+l("%size")+":"+b.imageData.data.length+"</span>":""),l("%KERNEL"))}return this};picozu.objects.workspace.prototype._killThread=function(a){null!==this.threads[a]&&(this.threads[a].terminate(),this.log(l("%thread terminated")+' <span class="keyword">'+l("%id")+":"+a+"</span>",l("%KERNEL")));return this};
|
|
picozu.objects.workspace.prototype._processThreadError=function(a){this._killThread(a).error(l("%main.threadprocesserror")).hideLoader().processQueue();return this};picozu.objects.workspace.prototype._reorderLayers=function(a){for(var c=1,b=a.length-1;0<=b;b--){var d=a[b].split("-").pop();this.getSelectedTab().layers[d].setPosition(c);c++}this.reorderLayers();return this};
|
|
picozu.objects.workspace.prototype.reorderLayers=function(){this.getSelectedTab().layers.sort(function(a,c){var b=a.properties.position,d=c.properties.position;return b<d?-1:b>d?1:0});this._refreshLayers();return this};
|
|
picozu.objects.workspace.prototype._parseLayers=function(a,c){var b,d,e,f,g;if(0<a.length)for(var h=1;h<a.length;h++)if("undefined"!==typeof a[h]&&c===a[h].getGroup()){switch(a[h].getType()){case picozu.LAYER_TYPE_TEXT:b="text";break;case picozu.LAYER_TYPE_SHAPE:b="shape";break;case picozu.LAYER_TYPE_TEXTSHAPE:b="textshape";break;case picozu.LAYER_TYPE_BACKGROUND:b="background";break;default:b="normal"}d=a[h].isSelected()?" selected":"";e=a[h].isVisible()?" visible":" hidden";f=a[h].isLocked()?" locked":
|
|
"";g=null===c?"layer":"layer_group";$(".layers-items-list").prepend('<li id="list-layer-'+h+'" data-lid="'+h+'" data-mid="'+h+'" class="select_'+g+d+'"><span class="tips layerstatus'+e+'" data-id="'+h+'" title="'+l("%layer.visibility")+'"></span><span class="tips layertype '+b+'" title="'+b.capitalize()+" "+l("%Layer")+'"></span><span class="layername" data-id="'+h+'">'+a[h].getName()+'</span><span class="layercolor" style="background-color: '+a[h].getColor()+'"></span><span class="tipse layermode'+
|
|
f+'" data-id="'+h+'" title="'+l("%layer.lockunlock")+'"></span></li>')}return this};
|
|
picozu.objects.workspace.prototype._refreshLayers=function(){var a=this.getSelectedTab();$(".layers-items-list").empty();if(a&&1<a.layers.length){this._parseLayers(a.layers,null);for(var c=0;c<a.groups.length;c++){ths._parseLayers(a.layers,c);var b=a.groups[c];$(".layers-items-list").prepend('<li class="select_group"><span class="tips groupstatus visible" data-id="'+c+'" title="'+l("%layer.visibility")+'"></span><span class="tips layertype group" title="'+l("%layer.group")+'"></span><span class="groupname" data-id="'+
|
|
c+'">'+b+'</span><span class="groupcolor"></span><span class="tips groupmode" data-id="'+c+'" title="'+l("%layer.lockunlock")+'"></span></li>')}}else $(".layers-items-list").append('<li class="nolayers">'+l("%no layers")+"</li>");return this};picozu.objects.workspace.prototype.flattenLayers=function(){this.getSelectedTab().flatten(!0);this._refreshAll();return this};
|
|
picozu.objects.workspace.prototype.duplicateLayer=function(a){"undefined"!==typeof a?this.getSelectedTab().layers[a].duplicate():this.getSelectedLayer().duplicate();this._refreshAll();return this};picozu.objects.workspace.prototype.selectNextLayer=function(){for(var a=this.getSelectedTab().countLayers()+1,c=this.getSelectedLayer().getId()+1;c<a;c++)if("object"===typeof this.getSelectedTab().layers[c]){this.getSelectedTab().layers[c].select();break}return this};
|
|
picozu.objects.workspace.prototype.selectPreviousLayer=function(){for(var a=this.getSelectedLayer().getId()-1;0<a;a--)if("object"===typeof this.getSelectedTab().layers[a]){this.getSelectedTab().layers[a].select();break}return this};
|
|
picozu.objects.workspace.prototype.deleteLayer=function(a){0<this.getSelectedTab().countLayers()?this.confirmWindow(l("%main.deletelayer"),l("%main.deletelayer.text"),function(){"undefined"!==typeof a?this.getSelectedTab().layers[a].destroy(!0):this.getSelectedLayer().destroy(!0);this._refreshAll()}):this.error(l("%main.selectlayer.error"));return this};picozu.objects.workspace.prototype.getSelectedLayer=function(){return null!==this.heap.activeTab?this.getSelectedTab().activeLayer:null};
|
|
picozu.objects.workspace.prototype.getPreviewLayer=function(){return null!==this.heap.activeTab?this.getSelectedTab().getPreviewLayer():null};picozu.objects.workspace.prototype.getSelectedLayerImageData=function(){return null!==this.getSelectedLayer()?this.getSelectedLayer().getImageData(0,0,this.getSelectedLayer().getWidth(),this.getSelectedLayer().getHeight()):!1};
|
|
picozu.objects.workspace.prototype.isEditableLayer=function(a){"undefined"===typeof a&&(a=this.getTool());return null===a?!0:"line"!==a&&"circle"!==a&&"ellipse"!==a&&"colorpicker"!==a&&"rectangle"!==a&&"roundedRectangle"!==a&&"ruler"!==a&&"arrow"!==a&&"text"!==a&&!0===this.getSelectedLayer().isLocked()?!1:!0};
|
|
picozu.objects.workspace.prototype.isLayerEditable=function(){return!0===this.getSelectedLayer().isLocked()?(this.error(l("%layer.locked")),!1):null===this.getSelectedLayer()?(this.error(l("%main.select.layer.fractal")),!1):!0};
|
|
picozu.objects.workspace.prototype.newLayerTextShape=function(a,c,b,d){return(new picozu.objects.layer({type:picozu.LAYER_TYPE_TEXTSHAPE,name:c+" "+l("%Block"),parent:this.getSelectedTab(),width:b.width,height:b.height,left:b.left,opacity:this.getParam("opacity"),top:b.top,shape:{type:a,points:d},parameters:{fontColor:this.getParam("foregroundColor"),fontFamily:this.getParam("fontFamily"),fontCase:this.getParam("fontCase"),fontStyle:this.getParam("fontStyle"),fontWeight:this.getParam("fontWeight"),
|
|
fontAlign:this.getParam("fontAlign"),fontSize:this.getParam("fontSize")},text:c})).select()};
|
|
picozu.objects.workspace.prototype.newLayerShape=function(a,c,b){return(new picozu.objects.layer({type:picozu.LAYER_TYPE_SHAPE,name:this.formatShapeName(a)+" "+l("%Shape"),parent:this.getSelectedTab(),width:c.width,height:c.height,left:c.left,opacity:this.getParam("opacity"),top:c.top,shape:{type:a,points:b},parameters:{strokeColor:this.getParam("foregroundColor"),fillColor:this.getParam("backgroundColor"),shapeBorder:this.getParam("border"),drawMode:this.getParam("drawMode")}})).select()};
|
|
picozu.objects.workspace.prototype.newLayer=function(a,c){c="undefined"===typeof c?{}:c;return(new picozu.objects.layer({type:picozu.LAYER_TYPE_NORMAL,parent:this.getSelectedTab(),width:"undefined"!==typeof c.width?c.width:this.getSelectedTab().getWidth(),height:"undefined"!==typeof c.height?c.height:this.getSelectedTab().getHeight(),left:"undefined"!==typeof c.left?c.left:0,top:"undefined"!==typeof c.top?c.top:0,image:a,opacity:this.getParam("opacity"),composed:!0,last:!0})).select()};
|
|
picozu.objects.workspace.prototype.newLayerText=function(a,c){return(new picozu.objects.layer({type:picozu.LAYER_TYPE_TEXT,name:a.substr(0,picozu.MAX_CHARS_LAYER_NAME),parent:this.getSelectedTab(),width:c.width,height:c.height,opacity:this.getParam("opacity"),left:c.left,top:c.top,text:a,parameters:{fontColor:this.getParam("foregroundColor"),fillColor:this.getParam("backgroundColor"),fontFamily:this.getParam("fontFamily"),fontCase:this.getParam("fontCase"),fontStyle:this.getParam("fontStyle"),fontWeight:this.getParam("fontWeight"),
|
|
fontAlign:this.getParam("fontAlign"),fontSize:this.getParam("fontSize"),drawMode:this.getParam("drawMode")}})).select()};picozu.objects.workspace.prototype._loadPlugins=function(a){var c;if("undefined"===typeof a||null===a)a=this.getStorage("plugins");if(a)for(var b=0;b<a.length;b++)c=this.loadPlugin(a[b].handle,!1),!0===a[b].enabled&&c&&c.install().enable();return this};
|
|
picozu.objects.workspace.prototype._unloadPlugins=function(){var a=this.getStorage("plugins"),c;if(a)for(var b=0;b<a.length;b++)(c=this.getPlugin(a[b].handle))&&c.disable().uninstall();return this};picozu.objects.workspace.prototype.getPlugin=function(a){for(var c=window.picozu.extensions.plugins[a],b=0;b<this.plugins.length;b++)if(this.plugins[b].parameters.handle===a)return this.plugins[b];return"undefined"!==typeof c&&null!==c&&c.parameters.handle===a?c:!1};
|
|
picozu.objects.workspace.prototype.pluginIsEnabled=function(a){var c=this.getStorage("plugins");return null!==c&&(a=c.findIndexM(a),!1!==a&&!1!==c[a].enabled)?!0:!1};picozu.objects.workspace.prototype.pluginIsInstalled=function(a){return this.getStorage("plugins").findIndexM(a)};
|
|
picozu.objects.workspace.prototype.unloadPlugin=function(a,c){var b=this.getPlugin(a);b.disable().uninstall();("undefined"===typeof c||!0===c)&&this.notify(l("%Plugin")+" <strong>"+b.getHandle().capitalize()+"</strong> "+l("%uninstalled successfully"));return this};
|
|
picozu.objects.workspace.prototype.loadPlugin=function(a,c){var b=null,b=window.picozu.extensions.plugins[a];if("undefined"!==typeof b&&null!==b)return b=new picozu.objects.plugin(b,this),"object"===typeof b.install()?(("undefined"===typeof c||!0===c)&&this.notify(l("%Plugin")+" <strong>"+b.getHandle().capitalize()+"</strong> "+l("%installed successfully")),b):!1;this.log(l("%plugin.notfound")+" "+a.capitalize(),l("%ERR"));return!1};
|
|
picozu.objects.workspace.prototype.dispatchAction=function(a,c){for(var b=0;b<this.plugins.length;b++)this.pluginIsEnabled(this.plugins[b].parameters.handle)&&"undefined"!==typeof this.plugins[b].action&&this.plugins[b].action(a,c);return this};
|
|
picozu.objects.workspace.prototype.doBinaryRequest=function(a,c,b,d){function e(){var a=null;window.ActiveXObject?a=new ActiveXObject("Microsoft.XMLHTTP"):window.XMLHttpRequest&&(a=new XMLHttpRequest);return a}function f(a,b,c,d,f,h){var j=e();if(j){var u=0,t=0;d&&!f&&(u=d[0]);d&&(t=d[1]-d[0]+1);b&&("undefined"!=typeof j.onload?j.onload=function(){"200"==j.status||"206"==j.status||"0"==j.status?(j.binaryResponse=new picozu.objects.binary(j.responseText,u,t),j.fileSize=h||j.getResponseHeader("Content-Length"),
|
|
b.call(g,j)):c&&c.call(g);j=null}:j.onreadystatechange=function(){if(4==j.readyState){if("200"==j.status||"206"==j.status||"0"==j.status){var a={status:j.status,binaryResponse:new new picozu.objects.binary("unknown"==typeof j.responseBody?j.responseBody:j.responseText,u,t),fileSize:h||j.getResponseHeader("Content-Length")};b.call(g,a)}else c&&c.call(g);j=null}});j.open("GET",a,!0);j.overrideMimeType&&j.overrideMimeType("text/plain; charset=x-user-defined");d&&f&&j.setRequestHeader("Range","bytes="+
|
|
d[0]+"-"+d[1]);j.setRequestHeader("If-Modified-Since","Sat, 1 Jan 1970 00:00:00 GMT");j.setRequestHeader("X-Requested-With","XMLHttpRequest");j.send(null)}else c&&c.call(g)}var g=this;if(d){var h=function(e){var g=parseInt(e.getResponseHeader("Content-Length"),10);e=e.getResponseHeader("Accept-Ranges");var h;h=d[0];0>d[0]&&(h+=g);f(a,c,b,[h,h+d[1]-1],"bytes"==e,g)},j=e();j&&(h&&("undefined"!=typeof j.onload?j.onload=function(){"200"==j.status&&h.call(g,this);j=null}:j.onreadystatechange=function(){4==
|
|
j.readyState&&("200"==j.status&&h.call(g,this),j=null)}),j.open("HEAD",a,!0),j.send(null))}else f(a,c,b);return this};
|
|
picozu.objects.workspace.prototype.doRequest=function(a,c,b,d,e,f,g){var h=this,j;j=null;parent!==window&&(j=document.referrer);null===c&&(c="");c+="&key="+picozu.API_KEY;null!==j&&(c+="&sign="+window.btoa(j));$.ajax({type:picozu.API_METHOD,dataType:"undefined"!==typeof e?e:"jsonp",xhrFields:{withCredentials:"undefined"===typeof f||!0===f?!0:!1},crossDomain:!0,data:c,url:a,async:"undefined"===typeof g||!0==g?!0:!1,success:b instanceof Function?b:function(){},error:d instanceof Function?d:function(){},
|
|
complete:function(){h.hideLoader()}});return this};picozu.objects.workspace.prototype.heartbeat=function(a,c){var b=this;this.doRequest(picozu.API_HEARTBEAT,null,function(c){b.setSetting("online",!0);if("ok"===c.status&&(b._appCapabilities=c.capabilities,b.parameters.whiteLabel=0===c.whitelabel?!1:!0,b.parameters.logo=""===c.logo?null:c.logo,0!==c.user.id&&b.fillAccount(c),a instanceof Function))return a.call(b)},function(){b.setSetting("online",!1);if(c instanceof Function)return c.call(b)},"json")};
|
|
picozu.objects.workspace.prototype._heartbeat=function(){var a=this;this.heartbeat(function(){a._setupDefaultUI()},function(){a._setupDefaultUI()});return this};picozu.objects.workspace.prototype.hasSelection=function(){return 0<this.coords.select.width&&0<this.coords.select.height?!0:!1};
|
|
picozu.objects.workspace.prototype.cutClipboard=function(){var a=this.getSelectedLayer();if(!0===this.hasSelection()&&!1===a.isLocked()){this.saveUndo();var c=this.getSelection(),b=a.getImageData(c.left,c.top,c.width,c.height);this.heap.clipboard={data:b,width:c.width,height:c.height};a.clear(c.left,c.top,c.width,c.height);this._refreshAll();$("#menu-edit-paste").removeClass("disabled");return!0}return null!==a&&!1===a.isLocked()?(this.saveUndo(),b=a.getImageData(0,0,a.getWidth(),a.getHeight()),this.heap.clipboard=
|
|
{data:b,width:a.getWidth(),height:a.getHeight()},a.clear(0,0,a.getWidth(),a.getHeight()),this._refreshAll(),$("#menu-edit-paste").removeClass("disabled"),!0):!1};
|
|
picozu.objects.workspace.prototype.copyClipboard=function(a){var c=this.getSelectedLayer();if(!0===this.hasSelection()){a=this.getSelection();var b=c.getImageData(a.left,a.top,a.width,a.height);this.heap.clipboard={data:b,width:a.width,height:a.height};$("#menu-edit-paste").removeClass("disabled");return!0}return!0===a||null!==c?(b=c.getImageData(0,0,c.getWidth(),c.getHeight()),this.heap.clipboard={data:b,width:c.getWidth(),height:c.getHeight()},$("#menu-edit-paste").removeClass("disabled"),!0):!1};
|
|
picozu.objects.workspace.prototype.hasClipboard=function(){return null!==this.heap.clipboard.data?!0:!1};picozu.objects.workspace.prototype.getClipboard=function(){return this.heap.clipboard};picozu.objects.workspace.prototype.emptyClipboard=function(){this.heap.clipboard={data:null,width:0,height:0};return this};
|
|
picozu.objects.workspace.prototype.pasteClipboard=function(a){if(!0===this.hasClipboard()){this.saveUndo();this._clearTempCanvas();var c=this.getClipboard();"undefined"!==typeof a&&!0===a?((new picozu.objects.layer({parent:this.getSelectedTab(),width:c.width,height:c.height,left:0,top:0})).select().drawImageData(c.data,0,0),this.selectNone()):!1===this.getSelectedLayer().isLocked()&&(c=this.getClipboard(),a=this.getSelection(),this.getSelectedLayer().drawImageData(c.data,a.left,a.top),this.selectNone());
|
|
this._refreshAll();$("#menu-edit-paste").addClass("disabled");return!0}return!1};picozu.objects.workspace.prototype.getSelection=function(){return this.coords.select};picozu.objects.workspace.prototype.clearSelection=function(){this.coords.select.left=0;this.coords.select.top=0;this.coords.select.width=0;this.coords.select.height=0;return this};
|
|
picozu.objects.workspace.prototype.selectArea=function(a,c,b,d){this._clearTempCanvas();this.tempCanvas.getContext("2d").lineWidth=1;this.tempCanvas.getContext("2d").fillStyle=picozu.OVERLAY_COLOR_SELECT;this.tempCanvas.getContext("2d").fillRect(a,c,b,d);this.coords.select.left=a;this.coords.select.top=c;this.coords.select.width=b;this.coords.select.height=d;return this};picozu.objects.workspace.prototype.toggleSelection=function(){!0===this.hasSelection()?this.selectNone():this.selectAll();return this};
|
|
picozu.objects.workspace.prototype.selectAll=function(){this._clearTempCanvas();this.coords.select.left=0;this.coords.select.top=0;this.coords.select.width=this.getSelectedLayer().getWidth();this.coords.select.height=this.getSelectedLayer().getHeight();this.tempCanvas.getContext("2d").lineWidth=1;this.tempCanvas.getContext("2d").fillStyle=picozu.OVERLAY_COLOR_SELECT;this.tempCanvas.getContext("2d").fillRect(this.getSelectedLayer().getCoords().left,this.getSelectedLayer().getCoords().top,this.getSelectedLayer().getWidth(),
|
|
this.getSelectedLayer().getHeight());return this};picozu.objects.workspace.prototype.selectNone=function(){this.clearSelection()._clearTempCanvas();return this};picozu.objects.workspace.prototype.saveUndo=function(){this.getSelectedTab().setUndo();$("#menu-edit-undo").removeClass("disabled");return this};
|
|
picozu.objects.workspace.prototype.doUndo=function(){var a=this.getSelectedTab().getUndo(),c,b=this;0<a.length?(this.showLoader().importLayers(a.pop()),0>=a.length&&$("#menu-edit-undo").addClass("disabled"),c=setInterval(function(){b._refreshAll();clearInterval(c)},2E3)):$("#menu-edit-undo").addClass("disabled");return this};
|
|
picozu.objects.workspace.prototype.setStorage=function(a,c){if(!0===this.getCapability("webstorage",picozu.SCOPE_BROWSER))if(!0===this.getCapability("metroUI",picozu.SCOPE_BROWSER))Windows.Storage.ApplicationData.current.roamingSettings.values[a]=JSON.stringify(c);else return"object"===typeof c?localStorage.setItem(a,JSON.stringify(c)):localStorage.setItem(a,c);return!1};
|
|
picozu.objects.workspace.prototype.getStorage=function(a){return!0===this.getCapability("webstorage",picozu.SCOPE_BROWSER)?!0===this.getCapability("metroUI",picozu.SCOPE_BROWSER)?((a=Windows.Storage.ApplicationData.current.roamingSettings.values[a])&&(a=JSON.parse(a)),a):JSON.parse(localStorage.getItem(a)):!1};
|
|
picozu.objects.workspace.prototype.delStorage=function(a){!0===this.getCapability("webstorage",picozu.SCOPE_BROWSER)&&(!0===this.getCapability("metroUI",picozu.SCOPE_BROWSER)?Windows.Storage.ApplicationData.current.roamingSettings.values.remove(a):localStorage.removeItem(a));return this};picozu.objects.workspace.prototype.clearStorage=function(){!0===this.getCapability("webstorage",picozu.SCOPE_BROWSER)&&!0!==this.getCapability("metroUI",picozu.SCOPE_BROWSER)&&localStorage.clear();return this};
|
|
picozu.objects.workspace.prototype.clearCustomSwatches=function(){return this.confirmWindow(l("%main.clearswatches"),l("%main.clearswatches.text"),function(){this.heap.customSwatches=[];this.setStorage("customSwatches",[]);$(".pico-swatches-container-custom").empty();this.notify(l("%main.clearswatches.success"))})};
|
|
picozu.objects.workspace.prototype.refreshCustomSwatches=function(){var a="",c=this.getStorage("customSwatches");if(null!==c)for(var b=0;b<c.length;b++)this.heap.customSwatches.push(c[b]);var d=[];$.each(this.heap.customSwatches,function(a,b){-1===$.inArray(b,d)&&d.push(b)});for(c=0;c<d.length;c++)a+='<div title="#'+d[c]+'" data-color="'+d[c]+'" class="tips pico-custom-swatches-item" style="background-color: #'+d[c]+'"></div>';$(".pico-swatches-container-custom").empty().append(a);this.setStorage("customSwatches",
|
|
d);this.heap.customSwatches=d;return this};picozu.objects.workspace.prototype.addCustomSwatch=function(a){var c=this.getStorage("customSwatches");this.heap.customSwatches.push(a);null===c&&(c=[]);c.push(a);this.setStorage("customSwatches",c);$(".pico-swatches-container-custom").append('<div title="#'+a+'" data-color="'+a+'" class="tips pico-custom-swatches-item" style="background-color: #'+a+'"></div>');return this};
|
|
picozu.objects.workspace.prototype.deleteCustomSwatch=function(a){this.heap.customSwatches.splice(a,1);return this};
|
|
picozu.objects.workspace.prototype.exportColorPalette=function(a){this.showLoader();var c="",b="",d=[];if("image"===this.heap.paletteExport)d=this.heap.swatches;else{this.refreshCustomSwatches();for(var e=0;e<this.heap.customSwatches.length;e++)d.push(Color.hex2rgb("#"+this.heap.customSwatches[e]))}switch(a){case picozu.FILE_FORMAT_ASE:c=Export.toASE(d);b="ase";break;case picozu.FILE_FORMAT_CLR:c=Export.toCLR(d);b="clr";break;case picozu.FILE_FORMAT_ACT:c=Export.toACT(d);b="act";break;case picozu.FILE_FORMAT_GMP:c=
|
|
Export.toGIMP(d);b="gmp";break;case picozu.FILE_FORMAT_ACO:c=Export.toACO(d),b="aco"}!0===this.getSetting("online")?($(".pico-iframe").remove(),$(".picozu").append('<iframe class="pico-iframe" src=""></iframe>'),this.doRequest(picozu.API_CONVERT,"contents="+c+"&format="+b,function(a){$(".pico-iframe").attr("src",picozu.API_RETRIEVE+"?temp=1&file="+a.code+"&format="+a.format)},null,"json",!1)):this.error(l("%main.offline")).hideLoader();return this};picozu.objects.workspace.prototype.getSwatches=function(){return this.heap.swatches};
|
|
picozu.objects.workspace.prototype.error=function(a,c){return this.notify(a,!0,c)};picozu.objects.workspace.prototype.infoWindow=function(a,c){this.modal.open({title:a,text:c,leftButtons:[l("%main.ok")],rightButtons:null,onClick:function(){return!1}});return this};picozu.objects.workspace.prototype.confirmWindow=function(a,c,b){var d=this;this.modal.open({title:a,text:c,onClick:function(a){if(a===picozu.BUTTON_YES)return b.apply(d)}});return this};
|
|
picozu.objects.workspace.prototype.notify=function(a,c,b){this.notifier.trigger({title:!0===c?l("%Error"):"undefined"!==typeof b?b:l("%Info"),error:!0===c?!0:!1,content:a});!0===c&&this.log(a,l("%ERR"));return this};picozu.objects.workspace.prototype.insertStyle=function(a,c){"undefined"!==typeof c&&!0===c&&(a=picozu.DEFAULT_PLUGINS_PATH+a+"/"+a+".css");$('<link rel="stylesheet" media="screen" type="text/css" href="'+a+'" />').appendTo("head");return this};
|
|
picozu.objects.workspace.prototype.insertScript=function(a,c,b){"undefined"!==typeof c&&""!==c&&(a=picozu.DEFAULT_PLUGINS_PATH+c+"/"+a+".js",b="generic-"+c);var d=document.getElementsByTagName("script")[0];document.getElementById(b)||(c=document.createElement("script"),c.id=b,c.async=!0,c.src=a,d.parentNode.insertBefore(c,d));return this};
|
|
picozu.objects.workspace.prototype.removeWindow=function(a){var c;if("object"===typeof a)for(var b=0;b<a.length;b++)(c=this.getWindow(a[b]))&&c.destroy();else(c=this.getWindow(a))&&c.destroy();return this};picozu.objects.workspace.prototype.addToolbarButtonGroup=function(a,c,b){this.toolbars[0].addButtonGroup({label:a,icon:c,group:b});return this};picozu.objects.workspace.prototype.removeToolbarButtonGroup=function(a){(a=this.toolbars[0].getButtonGroup(a))&&a.destroy();return this};
|
|
picozu.objects.workspace.prototype.addToolbarButton=function(a,c){this.toolbars[0].addButton({label:a,icon:c,handle:c});return this};picozu.objects.workspace.prototype.removeToolbarButton=function(a){(a=this.toolbars[0].getButton(a))&&a.destroy();return this};picozu.objects.workspace.prototype.removeDockbarPanel=function(a){(a=this.dockbars[0].getPanel(a))&&a.destroy();return this};
|
|
picozu.objects.workspace.prototype.paginate=function(a,c,b){var d="";if(1>=a)$(b).empty();else{1<c&&(d+='<li class="prev"><a href="#">«</a></li>');if(11>a)for(i=1;i<=a;i++)d=c==i?d+("<li><span>"+i+"</span></li>"):d+('<li><a href="#">'+i+"</a></li>");else if(11<=a)if(7>c){for(i=1;8>i;i++)d=c==i?d+("<li><span>"+i+"</span></li>"):d+('<li><a href="#">'+i+"</a></li>");d+='<li><span class="dots">...</span></li><li><a href="#">'+a+"</a></li>"}else if(a-4>c&&4<c){d+='<li><a href="#">1</a></li><li><span class="dots">...</span></li>';
|
|
for(i=c-2;i<=parseInt(c)+2;i++)d=c==i?d+("<li><span>"+i+"</span></li>"):d+('<li><a href="#">'+i+"</a></li>");d+='<li><span class="dots">...</span></li><li><a href="#">'+a+"</a></li>"}else{d+='<li><a href="#">1</a></li><li><span class="dots">...</span></li>';for(i=a-7;i<=a;i++)d=c==i?d+("<li><span>"+i+"</span></li>"):d+('<li><a href="#">'+i+"</a></li>")}c<=a-1&&(d+='<li class="next"><a href="#">»</a></li>');$(b).empty().append(d);return this}};
|
|
picozu.objects.workspace.prototype.rebuildCurves=function(){var a="",c=this.getStorage("curves");if(null!==c){for(var b=0;b<c.length;b++)a+='<li><a data-handle="'+c[b].handle+'" href="#">'+c[b].handle+"</a></li>";a+='<li class="separator"> </li>'}a+='<li><a class="special" id="clear-recent-curves" href="#">'+l("%Clear recent curves")+"</a></li>";$("#menu-curves-list").empty().append(a);return this};
|
|
picozu.objects.workspace.prototype.rebuildExporters=function(){for(var a="",c=0;c<picozu.EXPORTERS.length;c++)a="undefined"!==typeof picozu.EXPORTERS[c].separator&&!0===picozu.EXPORTERS[c].separator?a+'<li class="separator"> </li>':a+('<li><a data-handle="'+picozu.EXPORTERS[c].handle+'" href="#">'+picozu.EXPORTERS[c].name+"</a></li>");$("#menu-exporters-list").empty().append(a);return this};
|
|
picozu.objects.workspace.prototype.rebuildTools=function(){for(var a="",c=0;c<picozu.TOOLS.length;c++)a+='<li><a data-handle="'+picozu.TOOLS[c].handle+'" href="#">'+picozu.TOOLS[c].name+"</a></li>";$("#menu-tools-list").empty().append(a);return this};
|
|
picozu.objects.workspace.prototype.rebuildImporters=function(){for(var a="",c=0;c<picozu.IMPORTERS.length;c++)a="undefined"!==typeof picozu.IMPORTERS[c].separator&&!0===picozu.IMPORTERS[c].separator?a+'<li class="separator"> </li>':a+('<li><a data-handle="'+picozu.IMPORTERS[c].handle+'" href="#">'+picozu.IMPORTERS[c].name+"</a></li>");$("#menu-importers-list").empty().append(a);return this};
|
|
picozu.objects.workspace.prototype.showLoader=function(){$(".picozu").prepend('<div class="pico-worker-loader"></div>');$(".pico-worker-loader").fadeIn(1E3);return this};picozu.objects.workspace.prototype.hideLoader=function(){$(".pico-worker-loader").fadeOut(1E3,function(){$(this).remove()});return this};
|
|
picozu.objects.workspace.prototype.switchWorkspace=function(a){switch(a){case 0:this.loadTheme(picozu.THEME_DEFAULT);this.propbars[1].hide();this.toolbars[0].show();this.dockbars[0].hide();this._unloadPlugins();break;case 1:this.loadTheme(picozu.THEME_DEFAULT);this.propbars[1].show();this.toolbars[0].show();this.dockbars[0].show();this._unloadPlugins();this._loadPlugins(picozu.DEFAULT_PLUGINS);break;case 2:this.loadTheme(picozu.THEME_DEFAULT);this.propbars[1].hide();this.toolbars[0].show();this.dockbars[0].show();
|
|
this._unloadPlugins();this._loadPlugins(picozu.DEFAULT_EDUCATIONAL_PLUGINS);break;case 3:this.loadTheme(picozu.THEME_KIDS),this.propbars[1].hide(),this.toolbars[0].show(),this.dockbars[0].show(),this._unloadPlugins(),this._loadPlugins(picozu.DEFAULT_KIDS_PLUGINS)}return this};picozu.objects.workspace.prototype.toggleFullscreen=function(){!this.isFullscreen()?this._enterFullscreen():this._leaveFullscreen();return this};
|
|
picozu.objects.workspace.prototype.isFullscreen=function(){return!(document.fullScreenElement&&null!==document.fullScreenElement||!document.mozFullScreen&&!document.webkitIsFullScreen)};
|
|
picozu.objects.workspace.prototype.newTab=function(a){return this.tabs.length>picozu.MAX_TABS-1?(this.error(l("%tab.toomany")),!1):new picozu.objects.tab({parent:this,name:a.name,image:"undefined"!==typeof a.image?a.image:null,imageData:"undefined"!==typeof a.imageData?a.imageData:null,imageFormat:"undefined"!==typeof a.imageFormat?a.imageFormat:"undefined",width:"undefined"!==typeof a.width?a.width:picozu.DEFAULT_WIDTH,height:"undefined"!==typeof a.height?a.height:picozu.DEFAULT_HEIGHT,layers:"undefined"!==
|
|
typeof a.layers?a.layers:"undefined",handle:"undefined"!==typeof a.handle?a.handle:"undefined",id:"undefined"!==typeof a.id?a.id:"undefined",hasBackground:"undefined"!==typeof a.hasBackground?a.hasBackground:!1,backgroundColor:"undefined"!==typeof a.backgroundColor?a.backgroundColor:"undefined"})};picozu.objects.workspace.prototype._getWindowData=function(a){for(var c=0;c<picozu.WINDOWS.length;c++)if(picozu.WINDOWS[c].handle===a)return picozu.WINDOWS[c];return!1};
|
|
picozu.objects.workspace.prototype.openWindow=function(a,c){var b=!1;return this.getWindow(a)?this.getWindow(a).show():"undefined"!==typeof c?(c.parent=this,(new picozu.objects.window(c)).show()):(b=this._getWindowData(a))?(b.parent=this,(new picozu.objects.window(b)).show()):!1};
|
|
picozu.objects.workspace.prototype.getWindow=function(a){if("number"===typeof a)return this.windows[a];if("object"===typeof a)for(var c=0;c<this.windows.length;c++){if("undefined"!==typeof this.windows[c]&&this.windows[c]===a)return this.windows[c]}else if("string"===typeof a)for(c=0;c<this.windows.length;c++)if("undefined"!==typeof this.windows[c]&&this.windows[c].getHandle().toLowerCase()===a.toLowerCase())return this.windows[c];return!1};
|
|
picozu.objects.workspace.prototype.injectHtml=function(a){$(".picozu > section").append(a);return this};picozu.objects.workspace.prototype.getSelectedTab=function(){return this.heap.activeTab};picozu.objects.workspace.prototype.controls=function(){return{tabs:this.tabs,toolbars:this.toolbars,dockbars:this.dockbars,windows:this.windows,menus:this.menus,contextmenus:this.contextmenus,propbars:this.propbars,taskbar:this.taskbar}};
|
|
picozu.objects.workspace.prototype.validateImageURL=function(a){return null!=a.match(/\.(jpeg|jpg|gif|png)$/)};picozu.objects.workspace.prototype.validateBase64=function(a){return/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/.test(a)};picozu.objects.workspace.prototype.validateImageSize=function(a){return 0<a&&9999>a&&!isNaN(a)?!0:!1};
|
|
picozu.objects.workspace.prototype.validUsername=function(a){return 0===a.length?!1:4>a.length||50<a.length||!/^[a-zA-Z0-9_][-a-zA-Z0-9_]+$/.test(a)?!1:!0};picozu.objects.workspace.prototype.validFullname=function(a){return 0===a.length?!1:!0};picozu.objects.workspace.prototype.validPassword=function(a){return 0===a.length?!1:6>a.length||50<a.length?!1:!0};
|
|
picozu.objects.workspace.prototype.validEmail=function(a){return 0===a.length?!1:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(a)?!0:
|
|
!1};picozu.objects.workspace.prototype.drawLine=function(a,c){this._clearTempCanvas()._applyDefaultSettings(a);this.tempCanvas.getContext("2d").lineWidth=a.lineWidth=this.getParam("border");var b=this.getParam("border")/2,d=this.getParam("border");a.beginPath();a.moveTo(c[0][0]+b,c[0][1]+b);a.lineTo(c[1][0]-d,c[1][1]-d);this.getParam("drawMode")===picozu.DRAW_MODE_STROKE?a.stroke():this.getParam("drawMode")===picozu.DRAW_MODE_FILL?a.fill():(a.fill(),a.stroke());a.closePath();return this};
|
|
picozu.objects.workspace.prototype.drawArrow=function(a,c){this._clearTempCanvas()._applyDefaultSettings(a);this.tempCanvas.getContext("2d").lineWidth=a.lineWidth=this.getParam("border");this.getParam("border");var b=this.getParam("border");a.beginPath();a.moveTo(c[0][0]+b,c[0][1]+b);a.lineTo(c[1][0],c[1][1]);a.stroke();var d=[[0,0],[-10*b/2,-5.5*b/2],[-10*b/2,5.5*b/2]],e=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]),b=this.getParam("backgroundColor"),f=this.getParam("foregroundColor");a.fillStyle=
|
|
"rgba("+f[0]+", "+f[1]+", "+f[2]+", "+0.1*this.getParam("opacity")+")";d=Others.translateShape(Others.rotateShape(d,e),c[1][0],c[1][1]);a.beginPath();a.moveTo(d[0][0],d[0][1]);for(var g in d)0<g&&a.lineTo(d[g][0],d[g][1]);a.lineTo(d[0][0],d[0][1]);a.fill();a.fillStyle="rgba("+b[0]+", "+b[1]+", "+b[2]+", "+0.1*this.getParam("opacity")+")";return this};
|
|
picozu.objects.workspace.prototype.drawEllipse=function(a,c){this._clearTempCanvas()._applyDefaultSettings(a);this.tempCanvas.getContext("2d").lineWidth=a.lineWidth=this.getParam("border");var b=this.getParam("border")/2,d=this.getParam("border"),e=Math.abs(c[0][0]-c[1][0])-d,f=Math.abs(c[0][1]-c[1][1])-d,d=c[0][0]+b,b=c[0][1]+b,g=0.5522848*(e/2),h=0.5522848*(f/2),j=d+e,k=b+f,e=d+e/2,f=b+f/2;a.beginPath();a.moveTo(d,f);a.bezierCurveTo(d,f-h,e-g,b,e,b);a.bezierCurveTo(e+g,b,j,f-h,j,f);a.bezierCurveTo(j,
|
|
f+h,e+g,k,e,k);a.bezierCurveTo(e-g,k,d,f+h,d,f);a.closePath();this.getParam("drawMode")===picozu.DRAW_MODE_STROKE?0<this.getParam("border")&&a.stroke():this.getParam("drawMode")===picozu.DRAW_MODE_FILL?a.fill():this.getParam("drawMode")===picozu.DRAW_MODE_BOTH?(a.fill(),0<this.getParam("border")&&a.stroke()):this.getParam("drawMode")===picozu.DRAW_MODE_GRADIENT&&(d=this.createGradient(a,c[0],c[1],c[2],c[3]),a.fillStyle=d,a.fill(),0<this.getParam("border")&&a.stroke());return this};
|
|
picozu.objects.workspace.prototype.drawCircle=function(a,c){this._clearTempCanvas()._applyDefaultSettings(a);this.tempCanvas.getContext("2d").lineWidth=a.lineWidth=this.getParam("border");var b;this.getParam("border");this.getParam("border");b=Math.abs(c[0][0]-c[1][0]);var d=Math.abs(c[0][1]-c[1][1]),e=c[0][1],f=Math.max(c[0][0],c[1][0])-b/2,e=Math.max(e,c[1][1])-d/2;b=Math.sqrt(Math.pow(b,2)+Math.pow(d,2))/4;a.beginPath();a.arc(f,e,b,0,2*Math.PI);a.closePath();this.getParam("drawMode")===picozu.DRAW_MODE_STROKE?
|
|
0<this.getParam("border")&&a.stroke():this.getParam("drawMode")===picozu.DRAW_MODE_FILL?a.fill():this.getParam("drawMode")===picozu.DRAW_MODE_BOTH?(a.fill(),0<this.getParam("border")&&a.stroke()):this.getParam("drawMode")===picozu.DRAW_MODE_GRADIENT&&(f=this.createGradient(a,c.x1,c.y1,c.x-c.x1,c.y-c.y1),a.fillStyle=f,a.fill(),0<this.getParam("border")&&a.stroke());return this};
|
|
picozu.objects.workspace.prototype.drawRoundedRectangle=function(a,c){this._clearTempCanvas()._applyDefaultSettings(a);this.tempCanvas.getContext("2d").lineWidth=a.lineWidth=this.getParam("border");this.tempCanvas.getContext("2d").lineJoin=a.lineJoin="miter";this.tempCanvas.getContext("2d").lineCap=a.lineCap="butt";var b=this.getParam("border")/2,d=this.getParam("border");this.getParam("drawMode")===picozu.DRAW_MODE_STROKE?0<this.getParam("border")&&a.roundRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-
|
|
d,this.getParam("shapeRadius")):this.getParam("drawMode")===picozu.DRAW_MODE_FILL?a.roundRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-d,this.getParam("shapeRadius"),!0):this.getParam("drawMode")===picozu.DRAW_MODE_BOTH?(a.roundRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-d,this.getParam("shapeRadius"),!0),0<this.getParam("border")&&a.roundRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-d,this.getParam("shapeRadius"))):this.getParam("drawMode")===picozu.DRAW_MODE_GRADIENT&&(b=this.createGradient(a,0,0,c.width,
|
|
c.height),a.fillStyle=b,a.fillRect(c.left,c.top,c.width,c.height),0<this.getParam("border")&&a.strokeRect(c.left,c.top,c.width,c.height));return this};
|
|
picozu.objects.workspace.prototype.drawRectangle=function(a,c){this._clearTempCanvas()._applyDefaultSettings(a);this.tempCanvas.getContext("2d").lineWidth=a.lineWidth=this.getParam("border");this.tempCanvas.getContext("2d").lineJoin=a.lineJoin="miter";this.tempCanvas.getContext("2d").lineCap=a.lineCap="butt";var b=this.getParam("border")/2,d=this.getParam("border");this.getParam("drawMode")===picozu.DRAW_MODE_STROKE?0<this.getParam("border")&&a.strokeRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-d):
|
|
this.getParam("drawMode")===picozu.DRAW_MODE_FILL?a.fillRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-d):this.getParam("drawMode")===picozu.DRAW_MODE_BOTH?(a.fillRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-d),0<this.getParam("border")&&a.strokeRect(c[0][0]+b,c[0][1]+b,c[1][0]-d,c[1][1]-d)):this.getParam("drawMode")===picozu.DRAW_MODE_GRADIENT&&(b=this.createGradient(a,0,0,c.width,c.height),a.fillStyle=b,a.fillRect(c.left,c.top,c.width,c.height),0<this.getParam("border")&&a.strokeRect(c.left,c.top,c.width,
|
|
c.height));return this};
|
|
picozu.events.initKeyboard=function(){var a=this;$(document).on("keydown.picozu",null,"left",function(){a.getSelectedLayer()._move(-1,0);return!1}).on("keydown.picozu",null,"right",function(){a.getSelectedLayer()._move(1,0);return!1}).on("keydown.picozu",null,"up",function(){a.getSelectedLayer()._move(0,-1);return!1}).on("keydown.picozu",null,"down",function(){a.getSelectedLayer()._move(0,1);return!1}).on("keydown.picozu",null,"esc",function(){a.doTool(null);return!1}).on("keydown.picozu",null,"ctrl+1",
|
|
function(){a.dockbars[0].toggle();return!1}).on("keydown.picozu",null,"ctrl+2",function(){a.toolbars[0].toggle();return!1}).on("keydown.picozu",null,"ctrl+3",function(){a.propbars[1].toggle();return!1}).on("keydown.picozu",null,"ctrl+shift+d",function(){a.propbars[0].toggle();return!1}).on("keydown.picozu",null,"ctrl+0",function(){a.dockbars[0].hide();a.toolbars[0].hide();a.propbars[1].hide();return!1});return this};
|
|
picozu.events.onCanvasMouseDown=function(a){var c=this._normalizeCoords(a.pageX,a.pageY);switch(a.button){case 0:null!==this.heap.tool&&!0===this.isEditableLayer()&&(this.getSelectedTab().setDirty(!0),this.heap.isDraw=!0,this.heap.tool.start(c.x,c.y,this.getSelectedLayer().getContext(),a))}};
|
|
picozu.events.onCanvasMouseWheelScroll=function(a){null!==this.heap.minimap&&(this.heap.minimap.selected=!1);var c=this._normalizeCoords(a.pageX,a.pageY);null!==this.heap.tool&&(this.heap.isDraw=!1,this.heap.tool.scroll(c.x,c.y,this.getSelectedLayer().getContext(),a),null!==this.heap.minimap&&this.heap.minimap.update())};
|
|
picozu.events.onCanvasMouseDblclick=function(a){null!==this.heap.minimap&&(this.heap.minimap.selected=!1);var c=this._normalizeCoords(a.pageX,a.pageY);if(null!==this.heap.tool)this.heap.isDraw=!1,this.heap.tool.dblclick(c.x,c.y,this.getSelectedLayer().getContext(),a),null!==this.heap.minimap&&this.heap.minimap.update();else if(this.getSelectedLayer().getType()===picozu.LAYER_TYPE_TEXT){var b=this.getSelectedTab().getElementHandle(),d=this.getSelectedLayer();"true"!=$(".pico-textform").data("editing")&&
|
|
(a='<div class="pico-textform-helper"><textarea class="pico-textform">'+d.getText()+'</textarea><span title="'+l("%text.apply")+'" class="tips button validate"></span><span title="'+l("%text.discard")+'" class="tips button invalidate"></span></div>',c=this.getParam("foregroundColor"),$("#"+b).append(a),$("#"+b+" .pico-textform").focus().data("editing","true").css("font-family",d.getParameter("fontFamily")).css("line-height",d.getParameter("fontSize")+"px").css("font-size",d.getParameter("fontSize")).css("font-style",
|
|
d.getParameter("fontStyle")).css("font-weight",d.getParameter("fontWeight")).css("text-align",d.getParameter("fontAlign")).css("color","#"+Color.rgb2hex(c[0],c[1],c[2])).css("opacity",d.getOpacity()/10),$("#"+b+" .pico-textform-helper").css("left",d.getCoords().left-2).css("top",d.getCoords().top-3).show(),$(".pico-textform-helper").on("click",".validate",function(){var a=$("#"+b+" .pico-textform").val();$("#"+b+" .pico-textform").width();$("#"+b+" .pico-textform").height();$(".pico-textform-helper").remove();
|
|
$.fn.tipsy.revalidate();d.setText(a).drawText()}),$(".pico-textform-helper").on("click",".invalidate",function(){$(".pico-textform-helper").remove();$.fn.tipsy.revalidate()}))}};
|
|
picozu.events.onCanvasMouseUp=function(a){null!==this.heap.minimap&&(this.heap.minimap.selected=!1);var c=this._normalizeCoords(a.pageX,a.pageY);if(1<a.detail)null!==this.heap.tool&&(this.heap.isDraw=!1,this.heap.tool.dblclick(c.x,c.y,this.getSelectedLayer().getContext(),a));else switch(a.button){case 0:null!==this.heap.tool&&(this.heap.isDraw=!1,this.heap.tool.end(c.x,c.y,this.getSelectedLayer().getContext(),a),a=this.getTool(),"hand"!==a&&("colorpicker"!==a&&"ruler"!==a&&"charts"!==a&&"crop"!==
|
|
a)&&(this.getSelectedTab()._refreshPreview(),null!==this.heap.minimap&&this.heap.minimap.update()))}};picozu.events.onCanvasMouseMove=function(a){var c=this._normalizeCoords(a.pageX,a.pageY);this.updateInfoPanel({x:c.tx,y:c.ty});null!==this.heap.tool&&this.heap.isDraw&&(this._clearTempCanvas(),this.heap.tool.move(c.x,c.y,this.tempCanvas.getContext("2d"),a))};picozu.events.onCanvasDocumentDragOver=function(a){a.preventDefault()};picozu.events.onCanvasDocumentLeave=function(a){a.preventDefault()};
|
|
picozu.events.onCanvasDocumentDrop=function(a){a.preventDefault();if(a.target===$(".subheader")[0])for(var c=0;c<a.dataTransfer.files.length;c++)this.loadFile(a.dataTransfer.files[c]);else for(c=0;c<a.dataTransfer.files.length;c++)this.loadFile(a.dataTransfer.files[c],null,!0)};picozu.events.onWindowResize=function(a){a.target==window&&(this._resizeUI(),null!==this.getSelectedTab()&&this.getSelectedTab().isReady()&&(this.getSelectedTab()._refreshPreview(),this._refreshMinimap()));return!1};
|
|
picozu.events.onChangeOrientation=function(){this._resizeUI();null!==this.getSelectedTab()&&this.getSelectedTab().isReady()&&(this.getSelectedTab()._refreshPreview(),this._refreshMinimap());return!0};picozu.events.onChangeAcceleration=function(a){a.preventDefault()};
|
|
picozu.events.onCanvasTouchStart=function(a){var c=this._normalizeCoords(a.touches[0].pageX,a.touches[0].pageY);null!==this.heap.tool&&!0===this.isEditableLayer()&&(this.getSelectedTab().setDirty(!0),this.heap.isDraw=!0,this.heap.tool.start(c.x,c.y,this.getSelectedLayer().getContext(),a))};
|
|
picozu.events.onCanvasTouchEnd=function(a){null!==this.heap.minimap&&(this.heap.minimap.selected=!1);var c=this._normalizeCoords(a.touches[0].pageX,a.touches[0].pageY);null!==this.heap.tool&&(this.heap.isDraw=!1,this.heap.tool.end(c.x,c.y,this.getSelectedLayer().getContext(),a),null!==this.heap.minimap&&this.heap.minimap.update(),this.getSelectedTab()._refreshPreview(),null!==this.heap.minimap&&this.heap.minimap.update())};
|
|
picozu.events.onCanvasTouchMove=function(a){var c=this._normalizeCoords(a.touches[0].pageX,a.touches[0].pageY);this.updateInfoPanel({x:c.tx,y:c.ty});null!==this.heap.tool&&this.heap.isDraw&&(this._clearTempCanvas(),this.heap.tool.move(c.x,c.y,this.tempCanvas.getContext("2d"),a))};
|
|
picozu.tools.pencil_chrome=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);return this},move:function(a,c){var b,d,e,f=this.layer.getContext(),g=this.workspace.getParam("foregroundColor");this.points.push([a,c]);f.beginPath();f.moveTo(this.prevX,this.prevY);f.lineTo(a,c);f.stroke();for(var h=0;h<this.points.length;h++)b=this.points[h][0]-this.points[this.count][0],d=this.points[h][1]-this.points[this.count][1],e=b*b+d*d,1E3>e&&(f.strokeStyle=
|
|
"rgba("+Math.floor(Math.random()*g[0])+", "+Math.floor(Math.random()*g[1])+", "+Math.floor(Math.random()*g[2])+", "+0.1*this.workspace.getParam("opacity")+")",f.beginPath(),f.moveTo(this.points[this.count][0]+0.2*b,this.points[this.count][1]+0.2*d),f.lineTo(this.points[h][0]-0.2*b,this.points[h][1]-0.2*d),f.stroke());this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_circles=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);return this},move:function(a,c){for(var b=this.layer.getContext(),d=a-this.prevX,e=c-this.prevY,f=2*Math.sqrt(d*d+e*e),d=100*Math.floor(a/100)+50,e=100*Math.floor(c/100)+50,g=Math.floor(10*Math.random()),f=f/g,h=0;h<g;h++)b.beginPath(),b.arc(d,e,(g-h)*f,0,2*Math.PI,!0),b.stroke();this.prevX=a;this.prevY=c;return this}});
|
|
picozu.tools.pencil_curves=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.15);return this},move:function(a,c){function b(a,b){var c;for(c=b.length-a;c<b.length;c++)if(b[c])return b[c]}var d=this.layer.getContext();this.points.push([a,c]);d.beginPath();d.moveTo(this.prevX,this.prevY);d.lineTo(a,c);d.stroke();d.beginPath();var e=b(30,this.points),f=b(10,this.points),g=b(20,this.points);d.moveTo(e[0],e[1]);d.bezierCurveTo(f[0],f[1],g[0],
|
|
g[1],a,c);d.stroke();this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_flowers=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this.move(a,c);return this},move:function(a,c){function b(a,b){this.x=a;this.y=b}function d(a,b,c,d,e,f){this.stretchA=a;this.stretchB=b;this.startAngle=c;this.angle=d;this.bloom=f;this.growFactor=e;this.r=1;this.isfinished=!1}function e(a,b,c,d,e){this.p=a;this.r=b;this.c=c;this.pc=d;this.petals=[];this.brush=e;this.init();this.brush.addBloom(this)}function f(a){this.blooms=[];this.element=a;this.ctx=
|
|
this.element.getContext("2d")}b.prototype={rotate:function(a){var b=this.x,c=this.y;this.x=Math.cos(a)*b-Math.sin(a)*c;this.y=Math.sin(a)*b+Math.cos(a)*c;return this},mult:function(a){this.x*=a;this.y*=a;return this},clone:function(){return new b(this.x,this.y)},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},subtract:function(a){this.x-=a.x;this.y-=a.y;return this},set:function(a,b){this.x=a;this.y=b;return this}};d.prototype={draw:function(){var a=this.bloom.brush.ctx,c=(new b(0,
|
|
this.r)).rotate(2*Math.PI/360*this.startAngle),d=c.clone().rotate(2*Math.PI/360*this.angle),e=c.clone().mult(this.stretchA),f=d.clone().mult(this.stretchB);a.strokeStyle=this.bloom.c;a.beginPath();a.moveTo(c.x,c.y);a.bezierCurveTo(e.x,e.y,f.x,f.y,d.x,d.y);a.stroke()},render:function(){this.r<=this.bloom.r?(this.r+=this.growFactor,this.draw()):this.isfinished=!0}};e.prototype={draw:function(){var a,b=!0;this.brush.ctx.save();this.brush.ctx.translate(this.p.x,this.p.y);for(var c=0;c<this.petals.length;c++)a=
|
|
this.petals[c],a.render(),b*=a.isfinished;this.brush.ctx.restore();!0==b&&this.brush.removeBloom(this)},init:function(){for(var a=360/this.pc,b=Others.randomInt(0,90),c=0;c<this.pc;c++)this.petals.push(new d(Others.random(0.1,3),Others.random(2,3),b+c*a,a,Others.random(0.1,1),this))}};f.prototype={render:function(){for(var a=0;a<this.blooms.length;a++)this.blooms[a].draw()},addBloom:function(a){this.blooms.push(a)},removeBloom:function(a){for(var b,c=0;c<this.blooms.length;c++)if(b=this.blooms[c],
|
|
b===a)return this.blooms.splice(c,1),this},createBloom:function(a,c){new e(new b(a,c),Others.randomInt(5,20),Color.randomRgba(0,255,0.5),Others.randomInt(5,15),this)}};var g=new b(0,0),h=new b(0,0),j=new f(this.layer.getCanvas());setInterval(function(){j.render()},1E3/60);20<h.set(a,c).subtract(g).length()&&(j.createBloom(a,c),g.set(a,c))}});
|
|
picozu.tools.pencil_fur=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);return this},move:function(a,c){var b,d,e,f=this.layer.getContext();this.points.push([a,c]);f.beginPath();f.moveTo(this.prevX,this.prevY);f.lineTo(a,c);f.stroke();for(var g=0;g<this.points.length;g++)b=this.points[g][0]-this.points[this.count][0],d=this.points[g][1]-this.points[this.count][1],e=b*b+d*d,2E3>e&&Math.random()>e/2E3&&(f.beginPath(),f.moveTo(a+0.5*
|
|
b,c+0.5*d),f.lineTo(a-0.5*b,c-0.5*d),f.stroke());this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_grassy=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);return this},move:function(a,c){function b(a,b,c,d,e){var f=Math.sin(c);c=Math.cos(c);d-=a;e-=b;var g=d*f+e*c;d=d*c-e*f+a;return{x:d,y:g+b}}var d=this.layer.getContext();for(this.points.push([a,c]);100<this.points.length;)this.points.shift();var e=[],f,g,h,j=1E3+1E4*this.workspace.getParam("brushSize")/20,k,m,n,s=this.points.length,r;for(n=0;n<s;n++)k=this.points[n][0],
|
|
m=this.points[n][1],g=k-a,f=m-c,h=g*g+f*f,Math.random()>h/j&&n+100>s&&(h=20*Math.random(),r=h*Math.PI/180,g*=0.3,f*=0.3,h=b(a,c,r,k-g,m-f),e.push([h.x,h.y]),h=b(a,c,r,a+g,c+f),e.push([h.x,h.y]),h=180*Math.random(),r=h*Math.PI/180,h=b(a,c,r,k-g,m-f),e.push([h.x,h.y]),h=b(a,c,r,a+g,c+f),e.push([h.x,h.y]));f=e.length;for(k=0;k<f;k+=2)g=e[k],j=e[k+1],d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(j[0],j[1]),d.stroke();d.stroke();this.prevX=a;this.prevY=c;return this}});
|
|
picozu.tools.pencil_grid=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.01);return this},move:function(a,c){for(var b=this.layer.getContext(),d=100*Math.round(a/100),e=100*Math.round(c/100),f=10*(d-a),g=10*(e-c),h=0;50>h;h++)b.beginPath(),b.moveTo(d,e),b.quadraticCurveTo(a+Math.random()*f,c+Math.random()*g,d,e),b.stroke();return this}});
|
|
picozu.tools.pencil_longfur=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.05);return this},move:function(a,c){var b,d,e,f,g=this.layer.getContext();this.points.push([a,c]);for(var h=0;h<this.points.length;h++)b=-Math.random(),d=this.points[h][0]-this.points[this.count][0],e=this.points[h][1]-this.points[this.count][1],f=d*d+e*e,4E3>f&&Math.random()>f/4E3&&(g.beginPath(),g.moveTo(this.points[this.count][0]+d*b,this.points[this.count][1]+
|
|
e*b),g.lineTo(this.points[h][0]-d*b+2*Math.random(),this.points[h][1]-e*b+2*Math.random()),g.stroke());this.count++;return this}});
|
|
picozu.tools.pencil_normal=picozu.objects.brush.extend({__constructor:function(a,c,b){this.layer=a;this.workspace=b;this.oldSize=this.workspace.getParam("brushSize");this.workspace.setParam("brushSize",1)},__destructor:function(){this.workspace.setParam("brushSize",this.oldSize)},start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.2);return this},move:function(a,c){var b=this.layer.getContext();b.beginPath();b.moveTo(this.prevX,this.prevY);b.lineTo(a,c);b.stroke();
|
|
this.prevX=a;this.prevY=c;return this},end:function(a,c,b,d){a=this.layer.getContext();a.closePath();d&&d.shiftKey&&a.fill();a.stroke();return this}});
|
|
picozu.tools.pencil_palm=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);return this},move:function(a,c){function b(a,b,c,d,e){var f=Math.sin(c);c=Math.cos(c);d-=a;e-=b;var g=d*f+e*c;d=d*c-e*f+a;return{x:d,y:g+b}}var d=this.layer.getContext();for(this.points.push([a,c]);100<this.points.length;)this.points.shift();var e=[],f,g,h,j=1E3+1E4*this.workspace.getParam("brushSize")/20,k,m,n,s=this.points.length,r;for(n=0;n<s;n++)k=this.points[n][0],
|
|
m=this.points[n][1],g=k-a,f=m-c,h=g*g+f*f,Math.random()>h/j&&n+100>s&&(g*=0.3,f*=0.3,h=90,r=h*Math.PI/180,h=b(a,c,r,k-g,m-f),e.push([h.x,h.y]),h=b(a,c,r,a+g,c+f),e.push([h.x,h.y]),h=270,r=h*Math.PI/180,h=b(a,c,r,k-g,m-f),e.push([h.x,h.y]),h=b(a,c,r,a+g,c+f),e.push([h.x,h.y]));f=e.length;for(k=0;k<f;k+=2)g=e[k],j=e[k+1],d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(j[0],j[1]),d.stroke();d.stroke();this.prevX=a;this.prevY=c;return this}});
|
|
picozu.tools.pencil_ribbon=picozu.objects.brush.extend({start:function(a,c){var b=this,d=this.layer.getContext(),e=this.workspace.getParam("foregroundColor");4>e.length&&e.push(0.5*this.workspace.getParam("opacity"));this.prevX=a;this.prevY=c;for(var f=0;50>f;f++)this.points.push({dx:(window.innerWidth-20)/2,dy:(window.innerHeight-20)/2,ax:0,ay:0,div:0.1,ease:0.2*Math.random()+0.6});this._i=setInterval(function(){d.lineWidth=b.workspace.getParam("brushSize");d.strokeStyle=Color.color2Exp("rgba",e);
|
|
for(var a=0;a<b.points.length;a++)d.beginPath(),d.moveTo(b.points[a].dx,b.points[a].dy),b.points[a].dx-=b.points[a].ax=(b.points[a].ax+(b.points[a].dx-b.prevX)*b.points[a].div)*b.points[a].ease,b.points[a].dy-=b.points[a].ay=(b.points[a].ay+(b.points[a].dy-b.prevY)*b.points[a].div)*b.points[a].ease,d.lineTo(b.points[a].dx,b.points[a].dy),d.stroke()},1E3/60);for(f=0;f<this.points.length;f++)this.points[f].dx=a,this.points[f].dy=c;return this},end:function(){clearInterval(this._i);return this},move:function(a,
|
|
c){this.prevX=a;this.prevY=c;return this}});
|
|
picozu.tools.pencil_shaded=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();return this},move:function(a,c){var b,d,e=this.workspace.getParam("foregroundColor"),f=this.layer.getContext();this.points.push([a,c]);for(var g=0;g<this.points.length;g++)b=this.points[g][0]-this.points[this.count][0],d=this.points[g][1]-this.points[this.count][1],b=b*b+d*d,1E3>b&&(f.strokeStyle="rgba("+e[0]+", "+e[1]+","+e[2]+", "+0.1*(1-b/1E3)*this.workspace.getParam("opacity")+
|
|
")",f.beginPath(),f.moveTo(this.points[this.count][0],this.points[this.count][1]),f.lineTo(this.points[g][0],this.points[g][1]),f.stroke());this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_dynamic=picozu.objects.brush.extend({__constructor:function(a,c,b){function d(){this.lasty=this.lastx=this.drag=this.mass=this.angy=this.angx=this.acc=this.accy=this.accx=this.vel=this.vely=this.velx=this.cury=this.curx=0;this.fixedangle=e.FIXED_ANGLE}var e=this;this.layer=a;this.workspace=b;this.curmass=0.5;this.curdrag=0.35;this.WIDTH=0.3;this.FIXED_ANGLE=0;this.MIN_MASS=1;this.MAX_MASS=160;this.MIN_DRAG=0;this.MAX_DRAG=0.5;this.xsize=this.layer.getWidth();this.ysize=this.layer.getWidth();
|
|
this.xyratio=this.xsize/this.ysize;this.my=this.mx=this.odely=this.odelx=0;this.isMouseDown=!1;this.oldCap=this.layer.getContext().lineCap;this.layer.getContext().lineJoin=this.layer.getContext().lineCap="round";d.prototype.setpos=function(a,b){this.curx=a;this.cury=b;this.lastx=a;this.lasty=b;this.accy=this.accx=this.vely=this.velx=0};d.prototype.apply=function(a,b){var c,d,k,m;c=e._flerp(e.MIN_MASS,e.MAX_MASS,e.curmass);d=e._flerp(e.MIN_DRAG,e.MAX_DRAG,e.curdrag*e.curdrag);k=a-this.curx;m=b-this.cury;
|
|
this.acc=Math.sqrt(k*k+m*m);if(1E-6>this.acc)return 0;this.accx=k/c;this.accy=m/c;this.velx+=this.accx;this.vely+=this.accy;this.vel=Math.sqrt(this.velx*this.velx+this.vely*this.vely);if(1E-6>this.vel)return 0;this.angx=-this.vely;this.angy=this.velx;this.angx/=this.vel;this.angy/=this.vel;this.fixedangle&&(this.angx=0.6,this.angy=0.2);this.velx*=1-d;this.vely*=1-d;this.lastx=this.curx;this.lasty=this.cury;this.curx+=this.velx;this.cury+=this.vely;return 1};this.mouse=new d;setInterval(function(){e.isMouseDown&&
|
|
e.mouse.apply(e.mx,e.my)&&e._draw()},5)},_flerp:function(a,c,b){return a*(1-b)+c*b},_draw:function(){var a=this.layer.getContext(),c=this.workspace.getParam("foregroundColor");4>c.length&&c.push(0.5*this.workspace.getParam("opacity"));var b,d,e,f,g,h;d=0.04-this.mouse.vel;d*=this.WIDTH;1E-5>d&&(d=1E-5);b=this.mouse.angx*d;d*=this.mouse.angy;e=this.mouse.lastx;f=this.mouse.lasty;g=this.mouse.curx;h=this.mouse.cury;a.fillStyle=Color.color2Exp("rgba",c);a.strokeStyle=Color.color2Exp("rgba",c);a.beginPath();
|
|
a.moveTo(this.xsize*(e+this.odelx)/this.xyratio,this.ysize*(f+this.odely));a.lineTo(this.xsize*(e-this.odelx)/this.xyratio,this.ysize*(f-this.odely));a.stroke();a.lineTo(this.xsize*(g-b)/this.xyratio,this.ysize*(h-d));a.lineTo(this.xsize*(g+b)/this.xyratio,this.ysize*(h+d));a.closePath();a.fill();this.odelx=b;this.odely=d},__destructor:function(){this.layer.getContext().lineJoin=this.layer.getContext().lineCap=this.oldCap},end:function(){this.isMouseDown=!1},start:function(a,c){this.isMouseDown=!0;
|
|
this.mx=this.xyratio*a/this.xsize;this.my=c/this.ysize;this.mouse.setpos(this.mx,this.my);this.odely=this.odelx=0;return this},move:function(a,c){this.mx=this.xyratio*a/this.xsize;this.my=c/this.ysize;return this}});
|
|
picozu.tools.pencil_sketchy=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.05);return this},move:function(a,c){var b,d,e,f=this.layer.getContext();this.points.push([a,c]);f.beginPath();f.moveTo(this.prevX,this.prevY);f.lineTo(a,c);f.stroke();for(var g=0;g<this.points.length;g++)b=this.points[g][0]-this.points[this.count][0],d=this.points[g][1]-this.points[this.count][1],e=b*b+d*d,4E3>e&&Math.random()>e/2E3&&(f.beginPath(),f.moveTo(this.points[this.count][0]+
|
|
0.3*b,this.points[this.count][1]+0.3*d),f.lineTo(this.points[g][0]-0.3*b,this.points[g][1]-0.3*d),f.stroke());this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_sketchtaculous=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.05);return this},move:function(a,c){var b,d,e,f=this.layer.getContext();this.points.push([a,c]);f.beginPath();f.moveTo(this.prevX,this.prevY);f.lineTo(a,c);f.stroke();for(var g=0;g<this.points.length;g++)b=this.points[g][0]-this.points[this.count][0],d=this.points[g][1]-this.points[this.count][1],e=b*b+d*d,4E4>e&&Math.random()>e/2E4&&(f.beginPath(),f.moveTo(this.points[this.count][0]+
|
|
0.3*b,this.points[this.count][1]+0.3*d),f.lineTo(this.points[g][0]-0.3*b,this.points[g][1]-0.3*d),f.stroke());this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_squares=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);this._setFill(0.1);return this},move:function(a,c){var b=a-this.prevX,d=c-this.prevY,e=this.layer.getContext(),f=Math.cos(1.57079633)*b-Math.sin(1.57079633)*d,b=Math.sin(1.57079633)*b+Math.cos(1.57079633)*d;e.beginPath();e.moveTo(this.prevX-f,this.prevY-b);e.lineTo(this.prevX+f,this.prevY+b);e.lineTo(a+f,c+b);e.lineTo(a-f,c-b);e.lineTo(this.prevX-f,this.prevY-
|
|
b);e.fill();e.stroke();this.prevX=a;this.prevY=c;return this}});
|
|
picozu.tools.pencil_string=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();return this},move:function(a,c){var b=this.workspace.getParam("foregroundColor"),d=a+10*(Math.random()-0.5),e=c+10*(Math.random()-0.5),f=this.layer.getContext();4>b.length&&b.push(0.15);if(this.count){this.points.push([d,e]);f.beginPath();f.moveTo(this.prevX,this.prevY);f.lineTo(d,e);f.stroke();for(var g=this.points.slice(this.points.length-15,this.points.length),h=0;h<g.length;h++)f.strokeStyle=
|
|
Color.color2Exp("rgba",b),f.beginPath(),f.moveTo(d,e),f.lineTo(g[h][0],g[h][1]),f.stroke();this.prevX=d;this.prevY=e}this.count++;return this}});
|
|
picozu.tools.pencil_web=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);return this},move:function(a,c){var b,d,e=this.layer.getContext();this.points.push([a,c]);e.beginPath();e.moveTo(this.prevX,this.prevY);e.lineTo(a,c);e.stroke();for(var f=0;f<this.points.length;f++)b=this.points[f][0]-this.points[this.count][0],d=this.points[f][1]-this.points[this.count][1],b=b*b+d*d,2500>b&&0.9<Math.random()&&(e.beginPath(),e.moveTo(this.points[this.count][0],
|
|
this.points[this.count][1]),e.lineTo(this.points[f][0],this.points[f][1]),e.stroke());this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_stars=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.5);this._setFill(0.5);return this},move:function(a,c){var b=a-this.prevX,d=c-this.prevY;Math.cos(1.57079633);Math.sin(1.57079633);b=Math.sin(1.57079633)*b+Math.cos(1.57079633)*d;this._shape(this.layer.getContext(),a,c,Math.abs(b));this.prevX=a;this.prevY=c;return this},_shape:function(a,c,b,d){a.beginPath();var e=1*d/2;a.moveTo(c+e*Math.cos(6*Math.PI/180),b+d*
|
|
Math.sin(6*Math.PI/180));for(var f=1;6>f;f++){var g=d*Math.cos((72*f-20)*Math.PI/180),h=d*Math.sin((72*f-20)*Math.PI/180);a.lineTo(c+g,b+h);g=e*Math.cos((72*f-20+36)*Math.PI/180);h=e*Math.sin((72*f-20+36)*Math.PI/180);a.lineTo(c+g,b+h)}a.fill();a.stroke();return this}});
|
|
picozu.tools.pencil_rounds=picozu.objects.brush.extend({__constructor:function(a,c,b){this.layer=a;this.workspace=b;this.points=[];this.oldCap=this.layer.getContext().lineCap;this.oldAlpha=this.layer.getContext().globalAlpha;this.layer.getContext().lineJoin=this.layer.getContext().lineCap="round"},__destructor:function(){this.layer.getContext().lineJoin=this.layer.getContext().lineCap=this.oldCap;this.layer.getContext().globalAlpha=this.oldAlpha},end:function(){this.points.length=0},start:function(a,
|
|
c){this.points.push({x:a,y:c,radius:Others.randomInt(10,30),opacity:Math.random()});return this},move:function(a,c){var b=this.layer.getContext(),d=this.workspace.getParam("foregroundColor");b.fillStyle=Color.color2Exp("rgb",d);this.points.push({x:a,y:c,radius:Others.randomInt(5,20),opacity:Math.random()});for(d=0;d<this.points.length;d++)b.beginPath(),b.globalAlpha=this.points[d].opacity,b.arc(this.points[d].x,this.points[d].y,this.points[d].radius,!1,2*Math.PI,!1),b.fill();return this}});
|
|
picozu.tools.pencil_diamonds=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.5);return this},move:function(a,c){var b,d,e,f,g=this.layer.getContext();b=a-this.prevX;d=c-this.prevY;e=2*Math.sqrt(b*b+d*d);b=100*Math.floor(a/100)+50;d=100*Math.floor(c/100)+50;f=Math.floor(10*Math.random());e/=f;for(var h=0;h<f;h++)g.beginPath(),this._shape(g,b,d,(f-h)*e),g.stroke();this.prevX=a;this.prevY=c;return this},_shape:function(a,c,b,d){a.arc(c-
|
|
d,b-d,d,Math.PI/2,0,!0);a.arc(c+d,b-d,d,Math.PI,Math.PI/2,!0);a.arc(c+d,b+d,d,3*(Math.PI/2),Math.PI,!0);a.arc(c-d,b+d,d,2*Math.PI,3*(Math.PI/2),!0);a.stroke();return this}});
|
|
picozu.tools.pencil_shadetastic=picozu.objects.brush.extend({start:function(a,c){this.prevX=a;this.prevY=c;this._setLineWidth();return this},move:function(a,c){var b,d,e=this.workspace.getParam("foregroundColor"),f=this.layer.getContext();this.points.push([a,c]);for(var g=0;g<this.points.length;g++)b=this.points[g][0]-this.points[this.count][0],d=this.points[g][1]-this.points[this.count][1],b=b*b+d*d,1E5>b&&(f.strokeStyle="rgba("+e[0]+", "+e[1]+","+e[2]+", "+0.1*(1-b/1E5)*this.workspace.getParam("opacity")+
|
|
")",f.beginPath(),f.moveTo(this.points[this.count][0],this.points[this.count][1]),f.lineTo(this.points[g][0],this.points[g][1]),f.stroke());this.prevX=a;this.prevY=c;this.count++;return this}});
|
|
picozu.tools.pencil_smooth=picozu.objects.brush.extend({start:function(a,c){this.layer.getContext().globalCompositeOperation="source-over";this.prevX=a;this.prevY=c;this._setLineWidth();this._setStroke(0.1);return this},move:function(a,c){for(var b=a-this.prevX,d=c-this.prevY,e=this.layer.getContext(),f=2*Math.sqrt(b*b+d*d),b=100*Math.floor(a/100)+50,d=100*Math.floor(c/100)+50,g=Math.floor(10*Math.random()),f=f/g,h=0;h<g;h++)e.beginPath(),this._shape(e,b,d,(g-h)*f),e.stroke();this.prevX=a;this.prevY=
|
|
c;return this},_shape:function(a,c,b,d){c-=d*Math.cos(Math.PI/4);b-=d*Math.sin(Math.PI/4);d*=1.4142;a.moveTo(c,b);a.lineTo(c+d,b);a.lineTo(c+d,b+d);a.lineTo(c,b+d);a.lineTo(c,b);a.stroke();return this}});
|
|
picozu.extensions.plugins.camera={parameters:{title:"Camera",handle:"camera",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",requires:["camera"],description:"This plugin adds webcam/camera support to Picozu. By enabling it you can import and edit a photo taken with your webcam."},onDisable:function(){this.removeImporter("camera");this.removeWindow("camera")},onEnable:function(){this.addImporter(l("%camera.title"),"camera");var a=this;picozu.WINDOWS.push({name:l("%camera.title"),handle:"camera",
|
|
width:660,center:!0,onShow:function(){var c=this;this.heap.video=document.getElementById("pico-window-camera-video");window.URL=window.URL||window.webkitURL;navigator.getUserMedia({video:!0,audio:!1},function(a){c.heap.video.src=window.URL.createObjectURL(a);c.heap.video.play()},function(b){a.notify(l("%camera.notsupported"),!0);console.log(b)})},onCreate:function(){var c=this.getElementId(),b=this;this.addElement({type:picozu.CONTROL_HTML,template:'<div class="pico-camera-container"><video id="pico-window-camera-video" width="640" height="480" autoplay></video></div>'}).addFooter('<a href="#" class="pico-button ok-btn capture-image">'+
|
|
l("%camera.newimage")+'</a> <a href="#" class="pico-button ok-btn capture-layer">'+l("%camera.newlayer")+'</a> <a href="#" class="pico-button gui-btn cancel-button">'+l("%main.cancel")+"</a>");$(c).on("click",".capture-layer",function(){(new picozu.objects.layer({parent:a.getSelectedTab(),width:640,height:480,name:"Camera Image"})).drawImage(b.heap.video,640,480).select()}).on("click",".capture-image",function(){a.newTab({width:640,height:480,imageData:b.heap.video})})}})}};
|
|
String.toLocale({"en-US":{"%camera.title":"Camera","%camera.notsupported":"Unfortunately, your browser cannot give Picozu access to your computer camere, so therefore is not supported.","%camera.newlayer":"Capture as new layer","%camera.newimage":"Capture as new image"}});
|
|
picozu.extensions.plugins.cliparts={parameters:{title:"Cliparts",handle:"cliparts",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",description:"Insert small illustrations into your Picozu workspace by choosing from four different categories."},onDisable:function(){this.removeTool("cliparts");this.removeWindow("cliparts")},onEnable:function(){this.addTool(l("%Cliparts"),"cliparts");var a=this;this.helperCliparts={page:1,folder:null,results:15,getAll:function(c,b){a.showLoader();"prev"===
|
|
c?this.page--:"next"===c?this.page++:this.page="undefined"===typeof c?1:c;"undefined"!==typeof b&&(this.folder=b);$(".pico-cliparts-list ul.photolist").empty();var d="",e=picozu.DEFAULT_CLIPARTS[this.folder],f=(this.page-1)*this.results,g=this.results*this.page;if(0<e)for(var h=0;h<e;h++)d+=this.photoCallback(this.folder,h,!(h>=f&&h<g));else d+='<li class="noresults">'+l("%main.noimages")+"</li>";a.paginate(Math.ceil(e/this.results),this.page,".pico-cliparts-pager");$(".pico-cliparts-list ul.photolist").append(d);
|
|
a.hideLoader()},photoCallback:function(a,b,d){var e="";d||(e='<li><a href="'+picozu.DEFAULT_PLUGINS_PATH+"cliparts/templates/"+a+"/"+b+'.png"><img src="'+picozu.DEFAULT_PLUGINS_PATH+"cliparts/templates/"+a+"/"+b+'_tb.png" /></a></li>');return e}};picozu.WINDOWS.push({name:l("%Cliparts"),handle:"cliparts",center:!0,width:545,template:" <fieldset><label>"+l("%Category")+'</label><select class="pico-select categories"></select></fieldset><hr /><div class="pico-cliparts-list photolist clearfix"><ul class="photolist"><li class="noresults">'+
|
|
l("%main.noimages")+'</li></ul></div><ul class="pico-cliparts-pager pagination"></ul>',onCreate:function(){var c=this,b=this.getElementId(),d='<option value="0">-- '+l("%select")+" --</option>";this.addFooter(picozu.BROWSER_WINDOW_FOOTER);for(var e in picozu.DEFAULT_CLIPARTS)d+='<option value="'+e+'">'+e+"</option>";$(b+" .categories").append(d);$(b).on("change",".categories",function(){$(".pico-cliparts-pager").empty();a.helperCliparts.getAll(1,c.getStrValue(".categories"));return!1}).on("click",
|
|
".reload",function(){a.helperCliparts.getAll(1,c.getStrValue(".categories"));return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?a.helperCliparts.getAll("next"):$(this).parent("li").hasClass("prev")?a.helperCliparts.getAll("prev"):a.helperCliparts.getAll(parseInt($(this).text()));return!1}).on("click",".photolist ul li a",function(){a.showLoader();var b=$(this).attr("href"),c=new Image;c.onload=function(){a.saveUndo();(new picozu.objects.layer({parent:a.getSelectedTab(),
|
|
left:0,top:0,width:c.width,height:c.height,name:"Clipart"})).drawImage(c,c.width,c.height).select();a._refreshAll();a.hideLoader()};c.onerror=function(){a.notify(l("%main.image.notloaded"),!0).hideLoader()};c.src=b;return!1})}})}};String.toLocale({"en-US":{"%Cliparts":"Cliparts","%Category":"Category"}});picozu.DEFAULT_CLIPARTS={cute:60,doodles:9,flowers:21,leaves:11};
|
|
picozu.extensions.plugins.collage={parameters:{title:"Collage",handle:"collage",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",description:"This plugin helps you create different type of photo collages with your favorite photos."},onDisable:function(){this.removeTool("collage");this.removeWindow("collage");this.helpers.collage=null},onEnable:function(){this.addTool(l("%Collage"),"collage");var a=this;this.helpers.collage={done:!1,width:1024,height:768,createLayers:!1,thumbWidth:300,
|
|
thumbHeight:240,count:1,tab:null,files:[],ratios:{width:0.932,height:0.9},styleRatiosCalculate:function(a,b){this.ratios.padding=Math.round((a-a*this.ratios.width)/2);this.ratios.widthToHeightRatio=a*this.ratios.width/(b*this.ratios.height);this.ratios.heightToWidthRatio=b*this.ratios.height/(a*this.ratios.width)},prepare:function(){var c=a.getSelectedTab();c.heap.collage=!0;c.getCoords();c.getPreviewLayer().getCanvas();this.tab=a.newTab({width:this.width,name:"collage",height:this.height}).activate();
|
|
a.addDefaultWatermark().hideLoader();this.done=!0},drawImage:function(a,b,d,e){var f=Math.floor(97*Math.random())-48;b.save();b.translate(d+this.thumbWidth/2,e+this.thumbHeight/2);b.rotate(Math.PI/180*f);b.translate(-this.thumbWidth/2,-this.thumbHeight/2);b.shadowOffsetX=0.0125*this.thumbWidth;b.shadowOffsetY=0.0125*this.thumbHeight;b.shadowBlur=0.025*this.thumbWidth;b.shadowColor="rgba(0,0,0,0.4)";d=b.createLinearGradient(50,180,-10,20);d.addColorStop(0,"#FFFFFF");d.addColorStop(1,"#E6E1E1");b.fillStyle=
|
|
d;b.fillRect(0,0,this.thumbWidth,this.thumbHeight);b.shadowOffsetX=0;b.shadowOffsetY=0;b.shadowBlur=0;b.shadowColor="transparent";b.drawImage(a,this.ratios.padding,this.ratios.padding,this.thumbWidth*this.ratios.width,this.thumbHeight*this.ratios.height);b.restore()},applySettings:function(a,b,d,e,f){this.width="undefined"!=typeof a||300>a||6E3<a?a:1024;this.height="undefined"!=typeof b||300>b||6E3<b?b:768;this.thumbWidth="undefined"!=typeof d||100>d||500<d?d:300;this.thumbHeight="undefined"!=typeof e||
|
|
100>e||500<e?e:240;this.count="undefined"!=typeof f||0>f||20<f?f:1},applyCollage:function(){a.showLoader();a.saveUndo();var c=this,b,d,e,f,g=Math.floor(this.thumbWidth/3);this.styleRatiosCalculate(this.thumbWidth,this.thumbHeight);for(var h=0,j;j=this.files[h];h++)if(j.type.match("image.*")){var k=new FileReader;k.onload=function(a){return function(h){var j=new Image;j.onload=function(){for(var h=0;h<c.count;h++){var k=Math.floor(Math.random()*(c.width-c.thumbWidth)),n=Math.floor(Math.random()*(c.height-
|
|
c.thumbHeight));!0===c.createLayers?(d=b=g,e=new picozu.objects.layer({parent:c.tab,width:c.thumbWidth+2*g,height:c.thumbHeight+2*g,left:k,top:n,name:a.name}),f=e.getContext()):(b=k,d=n,f=c.tab.getSelectedLayer().getContext());c.drawImage(j,f,b,d)}};j.src=h.target.result}}(j);k.readAsDataURL(j)}this.files=[];a._refreshAll();a.hideLoader()}};picozu.WINDOWS.push({name:l("%Create Collage"),handle:"collage",center:!0,width:320,height:590,template:'<img src="'+picozu.DEFAULT_PLUGINS_PATH+'collage/splash.png" /><hr /><fieldset><label>'+
|
|
l("%Collage width")+'</label><input class="pico-textinput width" type="text" value="1024" /></fieldset><fieldset><label>'+l("%Collage height")+'</label><input class="pico-textinput height" type="text" value="768" /></fieldset><fieldset><label>'+l("%Repeat image x times")+'</label><input class="pico-textinput count" type="text" value="1" /></fieldset><fieldset><label>'+l("%Thumb width")+'</label><input class="pico-textinput twidth" type="text" value="300" /></fieldset><fieldset><label>'+l("%Thumb height")+
|
|
'</label><input class="pico-textinput theight" type="text" value="240" /></fieldset><hr /><fieldset><label>'+l("%Select files")+'</label><input type="button" class="button ok-btn upload" value="'+l("%main.selectfiles")+'" /><input class="pico-textinput pico-collage-upload hidden" type="file" multiple="multiple" /></fieldset><ul></ul>',onCreate:function(){var c=this,b=this.getElementId();this.addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%Create layers"),handle:"ptm-create-layers",property:"ptmCreateLayers",
|
|
value:!0,checked:!1,callback:function(b){a.helpers.collage.createLayers=b}}).addFooter(picozu.BROWSER_WINDOW_FOOTER);$(b).on("click",".reload",function(){a.helpers.collage.applySettings(c.getIntValue(".width"),c.getIntValue(".height"),c.getIntValue(".twidth"),c.getIntValue(".theight"),c.getIntValue(".count"));!1===a.helpers.collage.done&&"undefined"===typeof a.getSelectedTab().heap.collage&&a.helpers.collage.prepare();a.helpers.collage.applyCollage();return!1}).on("click",".upload",function(){$(b+
|
|
" .pico-collage-upload").trigger("click");return!1}).on("change",".pico-collage-upload",function(b){b=b.target.files;for(var c=0;b[c];c++)a.helpers.collage.files.push(b[c]);return!1})}})}};String.toLocale({"en-US":{"%Collage":"Collage","%Create Collage":"Create Collage","%Select files":"Select files","%Collage width":"Collage width","%Collage height":"Collage height","%Repeat image x times":"Repeat image x times","%Thumb width":"Thumb width","%Thumb height":"Thumb height","%Create layers":"Create layers"}});
|
|
picozu.extensions.plugins.demotivator={parameters:{title:"Demotivator",handle:"demotivator",version:"1.1",email:"office@picozu.com",url:"www.picozu.com",description:"Plugin for creating (de)motivational posters."},onDisable:function(){this.removeTool("demotivator");this.removeWindow("demotivator");this.helpers.demotivator=null},onEnable:function(){this.addTool(l("%Demotivator"),"demotivator");var a=this;this.insertStyle("demotivator",!0);this.helpers.demotivator={done:!1,textLayer:null,titleLayer:null,
|
|
imageLayer:null,newTab:null,leftSpacing:40,topSpacing:40,lineSize:5,titleFontSize:40,textFontSize:20,fontFamily:"Impact",imageHeight:0,text:"",title:"",prepare:function(){a.showLoader();var c=a.getSelectedTab();c._refreshPreview();c.heap.demotivator=!0;var b=c.getCoords(),c=c.getPreviewLayer().getCanvas();this.newTab=a.newTab({width:b.width+2*this.leftSpacing,height:b.height+2*this.topSpacing+120,hasBackground:!0,name:"demotivator",backgroundColor:[0,0,0,1]}).activate();this.imageLayer=(new picozu.objects.layer({parent:this.newTab,
|
|
width:b.width,height:b.height,left:this.leftSpacing,composed:!0,top:this.topSpacing,name:"Demotivator Image"})).drawImage(c,b.width,b.height);c=this.imageLayer.getContext();this.imageHeight=b.height;c.lineWidth=this.lineSize;c.strokeStyle="rgb(255, 255, 255)";c.beginPath();c.moveTo(0,0);c.lineTo(b.width,0);c.lineTo(b.width,b.height);c.lineTo(0,b.height);c.closePath();c.stroke();this.titleLayer=new picozu.objects.layer({type:picozu.LAYER_TYPE_TEXT,parent:this.newTab,width:b.width,height:40,left:this.leftSpacing,
|
|
text:$(".pico-window-demotivator .title").val(),name:"Demotivator Title",parameters:{fillColor:[255,255,255],fontColor:[255,255,255],fontFamily:"Impact",fontAlign:"center",drawMode:picozu.DRAW_MODE_FILL,fontSize:40},top:b.height+this.topSpacing+5});this.textLayer=new picozu.objects.layer({type:picozu.LAYER_TYPE_TEXT,parent:this.newTab,width:b.width,height:20,text:$(".pico-window-demotivator .text").val(),left:this.leftSpacing,name:"Demotivator Text",parameters:{fillColor:[255,255,255],fontColor:[255,
|
|
255,255],fontFamily:"Impact",fontAlign:"center",drawMode:picozu.DRAW_MODE_FILL,fontSize:20},top:b.height+this.topSpacing+60});a.addDefaultWatermark().hideLoader();this.apply();this.done=!0},apply:function(){this.title=$(".pico-window-demotivator .title").val();this.text=$(".pico-window-demotivator .text").val();this.titleFontSize=$(".pico-window-demotivator .titlesize").val();this.textFontSize=$(".pico-window-demotivator .textsize").val();this.fontFamily=$(".pico-window-demotivator .font").val();
|
|
this.textLayer.setText(this.text).setParameter("fontSize",this.textFontSize).setParameter("fontFamily",this.fontFamily).drawText();this.titleLayer.setText(this.title).setParameter("fontSize",this.titleFontSize).setParameter("fontFamily",this.fontFamily).drawText()}};picozu.WINDOWS.push({name:l("%demotivator.title"),handle:"demotivator",center:!0,width:500,template:"<fieldset><label>"+l("%main.title")+'</label><select class="pico-select titlesize"></select><textarea class="left pico-textinput title">'+
|
|
l("%demotivator.titletext")+"</textarea></fieldset><hr /><fieldset><label>"+l("%Text")+'</label><select class="pico-select textsize"></select><textarea class="pico-textinput text">'+l("%demotivator.maintext")+"</textarea></fieldset><hr /><fieldset><label>"+l("%main.font")+'</label><select class="pico-select font"></select></fieldset>',onShow:function(){!1===a.helpers.demotivator.done&&"undefined"===typeof a.getSelectedTab().heap.demotivator&&a.helpers.demotivator.prepare()},onCreate:function(){var c=
|
|
"",b="",d=this.getElementId();this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);for(var e=30;71>e;e++)b=a.helpers.demotivator.titleFontSize==e?"selected ":"",c+="<option "+b+'value="'+e+'">'+e+"</option>";$(d+" .titlesize").append(c);b=c="";for(e=10;41>e;e++)b=a.helpers.demotivator.textFontSize==e?"selected ":"",c+="<option "+b+'value="'+e+'">'+e+"</option>";$(d+" .textsize").append(c);b=c="";for(e=0;e<picozu.DEFAULT_FONTS.length;e++)b=a.helpers.demotivator.fontFamily==picozu.DEFAULT_FONTS[e].handle?"selected ":
|
|
"",c+="<option "+b+'style="font-family: '+picozu.DEFAULT_FONTS[e].handle+'" value="'+picozu.DEFAULT_FONTS[e].handle+'">'+picozu.DEFAULT_FONTS[e].name+"</option>";$(d+" .font").append(c);$(d).on("keyup.picozu","textarea",function(){a.helpers.demotivator.apply()}).on("change",".font, .textsize, .titlesize",function(){a.helpers.demotivator.apply()})}})}};String.toLocale({"en-US":{"%Demotivator":"Demotivator","%demotivator.title":"Demotivate this Image","%demotivator.titletext":"This is the title","%demotivator.maintext":"This is a long demotivator text that you can customize to your needs."}});
|
|
picozu.extensions.plugins.dropbox={parameters:{title:"Dropbox",handle:"dropbox",version:"1.12",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"Dropbox integration plugin; import your Dropbox images into Picozu and export them back when you are done enhancing them."},onDisable:function(){this.removeImporter("dropboxopen");this.removeExporter("dropboxsave");this.removeWindow(["dropboxopen","dropboxsave"])},onEnable:function(){var a=this;this.addImporter(l("%Dropbox"),
|
|
"dropboxopen");this.addExporter(l("%Dropbox"),"dropboxsave");this.insertScript("prerequisites","dropbox");this.insertStyle("dropbox",!0);this.connectors.dropbox={key:"vcvzkkvrq09x39b",encodedKey:"Y2q7YhCYOSA=|o6w+KaciiIeX4Q7GLvMlkCfQe66NvRck6LK9G+csbA==",page:1,results:15,folder:0,client:null,images:[],folders:[],fCnt:".pico-window-dropboxopen .folders, .pico-window-dropboxsave .folders",initialize:function(){this.client=new Dropbox.Client({key:this.key,sandbox:!0});this.isAuth();return this},getFolders:function(){a.showLoader();
|
|
var b=this;$(this.fCnt).empty();this.client.readdir("/",function(a,c,f,g){if(0<g.length){$(b.fCnt).empty().append('<option value="">-- '+l("%select folder")+" --</option>");for(a=0;a<g.length;a++)!0===g[a].isFolder&&($(b.fCnt).append('<option value="'+g[a].path+'">'+g[a].name+"</option>"),b.folders.push(g[a]))}else $(b.fCnt).empty().append('<option value="">-- '+l("%no folders")+" --</option>")})},deauthenticate:function(){this.client.signOff();this._logout();a.notifier.trigger({title:l("%Info"),
|
|
content:l("%dropbox.signout")})},authenticate:function(){var a=this;a.client.authDriver(new Dropbox.AuthDriver.Popup({receiverUrl:picozu.SITE_ENTRY_POINT+"oauth_receiver.html",rememberUser:!0}));a.client.authenticate(function(c){if(c)return a._logout(),!1;a.client.isAuthenticated()&&a._login()})},isAuth:function(){this.client.isAuthenticated()?this._login():this._logout()},upload:function(b,c){this.client.writeFile(c,b,function(b){b?a.notifier.trigger({title:l("%Error"),error:!0,content:l("%dropbox.errorupload")}):
|
|
a.notifier.trigger({title:l("%Info"),content:l("%dropbox.doneupload")});a.hideLoader()})},getAll:function(){this.getFolders();this.getPhotos()},_login:function(){this.getAll();$(".pico-window-dropboxopen > footer, .pico-window-dropboxsave > footer").show();$(".pico-window-dropboxopen .folders, .pico-window-dropboxsave .folders").empty().append('<option value="">-- '+l("%select folder")+" --</option>");$(".pico-dropbox-loggedout").hide();$(".pico-dropbox-loggedin").show()},_logout:function(){$(".pico-window-dropboxopen > footer, .pico-window-dropboxsave > footer").hide();
|
|
$(".pico-window-dropboxopen .folders, .pico-window-dropboxsave .folders").empty();$(".pico-dropbox-loggedout").show();$(".pico-dropbox-loggedin").hide()},_retrievePhotos:function(a){var c=this;c.images=[];c.client.readdir(a,function(e,f){for(var g=0;g<f.length;g++)ext=f[g].split(".").pop(),("jpg"===ext||"jpeg"===ext||"pzi"===ext||"pzw"===ext||"png"===ext)&&c.images.push(f[g]);c._process(a)})},_process:function(b){var c=this.images,e=[],f=c.length,g=(this.page-1)*this.results,h=this.results*this.page;
|
|
$(".pico-dropbox-list .photolist").empty();if(0<f)for(var j=0;j<f;j++)e=c[j],0===this.album&&(e=e[0]),this._photoCallback(e,!(j>=g&&j<h),b);else $(".pico-dropbox-list ul.photolist").empty().append('<li class="noresults">'+l("%main.noimages")+"</li>");a.paginate(Math.ceil(f/this.results),this.page,".pico-dropbox-pager");a.hideLoader()},getPhotos:function(b,c){a.showLoader();"prev"===b?this.page--:"next"===b?this.page++:this.page="undefined"===typeof b?1:b;"undefined"===typeof c&&(c="/");this._retrievePhotos(c)},
|
|
_photoCallback:function(a,c,e){"/"!==e&&(e+="/");if(!c){var f=this.client.thumbnailUrl(e+a,{sizeCode:"medium"});this.client.makeUrl(e+a,{download:!0},function(a,b){$(".pico-dropbox-list ul.photolist").append('<li><a href="'+b.url+'"><img class="tips" title="'+b.url.substring(b.url.lastIndexOf("/")+1)+'" src="'+f+'" alt="" /></a></li>')})}}};var c=this.connectors.dropbox;picozu.WINDOWS.push({name:l("%dropbox.import"),handle:"dropboxopen",center:!0,width:545,onShow:function(){c.initialize()},onCreate:function(){var b=
|
|
this,d=this.getElementId();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="pico-dropbox-loggedin"></div><div class="pico-dropbox-loggedout connect"></div>'}).addElement({type:picozu.CONTROL_SELECT,legend:l("%Folder"),handle:"pico-dOfolders",cssClass:"folders",legendClass:"legend",data:[]},".pico-dropbox-loggedin").addElement({type:picozu.CONTROL_HTML,template:'<hr /><div class="pico-dropbox-list photolist clearfix"><ul class="photolist"><li class="noresults">'+l("%main.noimages")+
|
|
'</li></ul></div><ul class="pico-dropbox-pager pagination"></ul>'},".pico-dropbox-loggedin").addFooter(picozu.CONNECTOR_OPEN_WINDOW_FOOTER);$(d).on("click",".logout",function(){c.deauthenticate();b.hide();return!1}).on("change",".folders",function(){c.getPhotos(1,$(this).val())}).on("click",".connect",function(){c.authenticate();return!1}).on("click",".reload",function(){c.getAll();return!1}).on("click",".photolist ul li a",function(){var c=$(this).attr("href");a.parseImageFile(c);b.hide();return!1}).on("click",
|
|
".pagination a",function(){$(this).parent("li").hasClass("next")?c.getPhotos("next"):$(this).parent("li").hasClass("prev")?c.getPhotos("prev"):c.getPhotos(parseInt($(this).text()));return!1})}});picozu.WINDOWS.push({name:l("%dropbox.export"),handle:"dropboxsave",center:!0,width:545,onShow:function(){c.initialize()},onCreate:function(){var b=this,d=this.getElementId();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="pico-dropbox-loggedin"></div><div class="pico-dropbox-loggedout connect"></div>'}).addElement({type:picozu.CONTROL_SELECT,
|
|
legend:l("%Folder"),handle:"pico-dSfolders",cssClass:"folders",legendClass:"legend",data:[]},".pico-dropbox-loggedin").addElement({type:picozu.CONTROL_TEXTINPUT_FILE,legend:l("%main.filename"),extension:"png",placeholder:"enter a file name",handle:"pz-dropboxsave-filename",legendClass:"legend"},".pico-dropbox-loggedin").addFooter(picozu.CONNECTOR_SAVE_WINDOW_FOOTER);$(d).on("click",".save",function(){var d=b.getStrValue("#pz-dropboxsave-filename"),f=b.getStrValue("#pico-dSfolders");""!==d?(a.showLoader(),
|
|
a.exportData(picozu.FILE_FORMAT_PNG,function(a){a=picozu.objects.crypter.base64.decodeArrayBuffer(a.split(",")[1]);c.upload(a,f+"/"+d+".png");b.setValue("#pz-dropboxsave-filename","");b.hide()})):a.notifier.trigger({title:l("%Error"),error:!0,content:l("%dropbox.filename")});return!1}).on("click",".connect",function(){c.authenticate();return!1}).on("click",".logout",function(){c.deauthenticate();b.hide();return!1})}})}};
|
|
String.toLocale({"en-US":{"%Dropbox":"Dropbox","%dropbox.errorupload":"Error uploading your image to Dropbox.","%dropbox.doneupload":"Image uploaded successfully to Dropbox.","%dropbox.signout":"Successfully signed out from Dropbox.","%dropbox.import":"Import from Dropbox","%dropbox.export":"Export to Dropbox","%dropbox.filename":"You must specify a file name."}});
|
|
picozu.extensions.plugins.facebook={parameters:{title:"Facebook",handle:"facebook",version:"1.8",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"This plugin allows you to import photos from your Facebook account / pages and export them back after editing."},onDisable:function(){this.removeImporter("facebookopen");this.removeExporter("facebooksave");this.removeWindow(["facebookopen","facebooksave"])},onEnable:function(){var a=this;this.addImporter(l("%Facebook"),"facebookopen");
|
|
this.addExporter(l("%Facebook"),"facebooksave");this.insertScript("//connect.facebook.net/en_US/all.js","","facebook-jssdk");this.insertStyle("facebook",!0);window.fbAsyncInit=function(){FB.init({appId:a.connectors.facebook.key,status:!0,cookie:!0,oauth:!0,xfbml:!0})};this.connectors.facebook={key:"153040191459844",page:1,results:15,album:"",photos:[],albums:[],pages:[],fCnt:".pico-window-facebookopen .albums, .pico-window-facebooksave .albums",page:null,token:"",scope:"manage_pages,read_stream,publish_actions,user_photos",
|
|
deauthenticate:function(){var b=this;FB.logout(function(){b._logout();a.notifier.trigger({title:l("%Info"),content:l("%facebook.signout")})})},getAll:function(){this.getAccess();this.getAlbums();this.getPhotos()},authenticate:function(){var a=this;FB.login(function(c){c.authResponse?(a.token=c.authResponse.accessToken,a._login()):a._logout()},{scope:a.scope})},initialize:function(){var a=this;FB.getLoginStatus(function(c){c.authResponse?a._login():a._logout()})},_getPageToken:function(a){return this.pages[a]},
|
|
upload:function(b,c,e,f){FB.api("/"+e+"/photos","post",{message:c,url:b,status:"success",access_token:this._getPageToken(f)},function(b){!b||b.error?a.notifier.trigger({title:l("%Error"),error:!0,content:l("%facebook.errorupload")}):a.notifier.trigger({title:l("%Info"),content:l("%facebook.doneupload")})})},setAlbum:function(a){this.album=a;return this},_getPhotos:function(a){var c=this;""!=a&&(this.photos=[],FB.api("/"+c.album+"/photos?type=small",function(a){c.photos=a.data;c._process()}))},getAccess:function(){a.showLoader();
|
|
var b=this,c="",e=$(".saveas");this.pages=[];FB.api("/me/accounts",function(f){e.empty().append('<option value="me">'+l("%You")+"</option>");if("undefined"!=typeof f.data){for(var g=0;g<f.data.length;g++)b.pages[f.data[g].id]=f.data[g].access_token,c+='<option value="'+f.data[g].id+'">'+f.data[g].category+" - "+f.data[g].name+"</option>";e.append(c)}a.hideLoader()});return this},getAlbums:function(b){a.showLoader();var c=this,e="";"undefined"===typeof b&&(b="me");$(c.fCnt).empty().append('<option value="">-- '+
|
|
l("%select album")+" --</option>");FB.api("/"+b+"/albums",function(b){if("undefined"!==typeof b.data&&0<b.data.length){for(var g=0;g<b.data.length;g++)c.albums=b.data,e+='<option value="'+b.data[g].id+'">'+b.data[g].name+"</option>";$(c.fCnt).append(e);c._process()}else $(c.fCnt).empty().append('<option value="">-- '+l("%no albums")+" --</option>");a.hideLoader()});return this},_login:function(){this.getAll();$(".pico-window-facebookopen > footer, .pico-window-facebooksave > footer").show();$(this.fCnt).empty().append('<option value="">-- '+
|
|
l("%select album")+" --</option>");$(".pico-fb-loggedout").hide();$(".pico-fb-loggedin").show();return this},_logout:function(){this.token=null;this.pages=[];this.albums=[];$(".pico-window-facebookopen > footer, .pico-window-facebooksave > footer").hide();$(this.fCnt).empty().append('<option value="">-- '+l("%select album")+" --</option>");$(".pico-fb-loggedout").show();$(".pico-fb-loggedin").hide();return this},_process:function(){var b="",c=(this.page-1)*this.results,e=this.results*this.page;if(0<
|
|
this.photos.length)for(var f=0;f<this.photos.length;f++)b+=this._photoCallback(this.photos[f],!(f>=c&&f<e));else b+='<li class="noresults">'+l("%main.noimages")+"</li>";a.paginate(Math.ceil(this.photos.length/this.results),this.page,".pico-fb-pager");$(".pico-fb-list ul.photolist").empty().append(b);a.hideLoader()},getPhotos:function(b){a.showLoader();"prev"===b?this.page--:"next"===b?this.page++:this.page="undefined"===typeof b?1:b;this._getPhotos(this.album);return this},_photoCallback:function(a,
|
|
c){var e="";c||(e='<li><a href="'+a.source+'"><img src="'+a.picture+'" alt="" /></a></li>');return e}};var c=this.connectors.facebook;picozu.WINDOWS.push({name:l("%facebook.import"),handle:"facebookopen",center:!0,width:545,template:'<div class="pico-fb-loggedin"><fieldset><label>'+l("%main.openas")+'</label><select class="pico-select saveas"></select></fieldset><fieldset><label>'+l("%Album")+'</label><select class="pico-select albums"></select></fieldset><hr /><div class="pico-fb-list photolist clearfix"><ul class="photolist"><li class="noresults">'+
|
|
l("%main.noimages")+'</li></ul></div><ul class="pico-fb-pager pagination"></ul></div><div class="pico-fb-loggedout connect"></div>',onShow:function(){c.initialize()},onCreate:function(){var b=this,d=this.getElementId();this.addFooter(picozu.CONNECTOR_OPEN_WINDOW_FOOTER);$(d).on("click",".reload",function(){c.getAll();return!1}).on("change",".albums",function(){var a=$(this).val();""!=a&&c.setAlbum(a).getPhotos()}).on("change",".saveas",function(){c.getAlbums($(this).val())}).on("click",".logout",
|
|
function(){c.deauthenticate();b.hide();return!1}).on("click",".connect",function(){c.authenticate();return!1}).on("click",".photolist ul li a",function(){var c=$(this).attr("href");a.parseImageFile(c,!0);b.hide();return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?c.getPhotos("next"):$(this).parent("li").hasClass("prev")?c.getPhotos("prev"):c.getPhotos(parseInt($(this).text()));return!1})}});picozu.WINDOWS.push({name:l("%facebook.export"),handle:"facebooksave",center:!0,
|
|
width:545,template:'<div class="pico-fb-loggedin"><fieldset><label>'+l("%main.saveas")+'</label><select class="pico-select saveas"></select></fieldset><fieldset><label>'+l("%Album")+'</label><select class="pico-select albums"></select></fieldset><fieldset><label>'+l("%Description")+'</label><textarea class="pico-textfield description"></textarea></fieldset></div><div class="pico-fb-loggedout connect"></div>',onShow:function(){c.initialize()},onCreate:function(){var b=this,d=this.getElementId();this.addFooter(picozu.CONNECTOR_SAVE_WINDOW_FOOTER);
|
|
$(d).on("click",".save",function(){a.exportData(picozu.FILE_FORMAT_PNG,function(d,f){a.doRequest(picozu.API_CONVERT,"contents="+d+"&format="+f,function(d){c.upload(picozu.API_ENTRY_POINT+"v/"+d.dir+d.code+"."+d.format,b.getStrValue(".description"),b.getStrValue(".albums"),b.getStrValue(".saveas"));$(".description").val("");a.hideLoader()},null,"json");b.hide()});return!1}).on("change",".saveas",function(){c.getAlbums($(this).val())}).on("click",".connect",function(){c.authenticate();return!1}).on("click",
|
|
".logout",function(){c.deauthenticate();b.hide();return!1})}})}};String.toLocale({"en-US":{"%facebook.errorupload":"Error uploading your image to Facebook.","%facebook.doneupload":"Image uploaded successfully to Facebook.","%facebook.signout":"Successfully signed out from Facebook.","%Facebook":"Facebook","%facebook.import":"Import from Facebook","%facebook.export":"Export to Facebook"}});
|
|
picozu.extensions.plugins.flickr={parameters:{title:"Flickr",handle:"flickr",version:"1.2",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"Flickr integration plugin. Import photos via Flickr search."},onDisable:function(){this.removeImporter("flickr");this.removeWindow("flickr")},onEnable:function(){this.addImporter(l("%Flickr"),"flickr");var a=this;this.connectors.flickr={key:"a7e9b881a3ba68ab185372a9faeb128a",url:"https://api.flickr.com/services/rest/?format=json&method=",
|
|
results:15,page:1,client:null,tags:"",user:"",setFilter:function(a,b){this.user=a;this.tags=b;return this},initialize:function(){},getAll:function(c){a.showLoader();"prev"===c?this.page--:"next"===c?this.page++:this.page="undefined"===typeof c?1:c;var b=this;c=b.url;if(""!=this.user)c+="flickr.photos.search&api_key="+this.key+"&user_id="+this.user;else{var d=new Date;d.setDate(d.getDate()-1);d=Math.round(d/1E3);c+="flickr.photos.search&api_key="+b.key+"&min_upload_date="+d}""!=this.tags&&(c+="&tags="+
|
|
encodeURIComponent(this.tags));c=c+"&license=4,2,3,6,1,5,7"+("&per_page="+b.results+"&page="+b.page+"&privacy_filter=1&safe_search=1&jsoncallback=?");var e="";$.getJSON(c,function(c){$(".pico-flickr-list ul.photolist").empty();0<c.photos.pages?$.each(c.photos.photo,function(a,b){var c="https://farm"+b.farm+".static.flickr.com/"+b.server+"/"+b.id+"_"+b.secret;e+='<li><a href="'+(c+"_b.jpg")+'" id="'+b.id+'"><img title="'+b.title+'" class="tips" src="'+(c+"_s.jpg")+'" alt="'+b.title+'"/></a></li>'}):
|
|
e+='<li class="noresults">'+l("%main.noimages.generic")+"</li>";a.paginate(c.photos.pages,b.page,".pico-flickr-pager");$(".pico-flickr-list ul.photolist").append(e);a.hideLoader()})}};picozu.WINDOWS.push({name:l("%flickr.title"),handle:"flickr",center:!0,width:545,template:"<fieldset><label>"+l("%From user")+'</label><input type="text" class="pico-textinput user" placeholder="'+l("%user name")+'" /></fieldset><fieldset><label>'+l("%Tag")+'</label><input type="text" class="pico-textinput tag" placeholder="'+
|
|
l("%enter tag")+'" /></fieldset><hr /><div class="pico-flickr-list photolist"><ul class="photolist"><li class="noresults">'+l("%main.noimages.generic")+'</li></ul></div><ul class="pico-flickr-pager pagination"></ul>',onShow:function(){a.connectors.flickr.getAll()},onCreate:function(){var c=this,b=this.getElementId();$(b).on("click",".photolist ul li a",function(){var b=$(this).attr("href");a.parseImageFile(b);c.hide();return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?
|
|
a.connectors.flickr.getAll("next"):$(this).parent("li").hasClass("prev")?a.connectors.flickr.getAll("prev"):a.connectors.flickr.getAll(parseInt($(this).text()));return!1}).on("keyup.picozu",".user, .tag",function(b){13===b.keyCode&&(a.connectors.flickr.setFilter(c.getStrValue(".user"),c.getStrValue(".tag")).getAll(),$(this).blur());return!1})}})}};String.toLocale({"en-US":{"%Flickr":"Flickr","%flickr.title":"Import from Flickr","%flickr.nophotos":"Sorry, no photos match that search. Please try again."}});
|
|
picozu.extensions.plugins.fractals={parameters:{title:"Fractals",handle:"fractals",version:"1.1",email:"office@picozu.com",url:"www.picozu.com",requires:["workers"],description:"Fractal generation plugin, providing several fractal types: Mandelbrot, Multibrot, Julia, Burning Ship, Douady`s Rabbit, Julia variations and many more."},onDisable:function(){this.removeDockbarPanel("fractals")},onEnable:function(){var a=this;this.insertStyle("fractals",!0);this.generateFractal=function(a){if(!0===this.isLayerEditable()){if(null===
|
|
a||"undefined"===typeof a)return this.error(l("%main.select.fractal")),!1;!1===this.hasSelection()&&(this.coords.select.width=this.getSelectedLayer().getWidth(),this.coords.select.height=this.getSelectedLayer().getHeight());var b=this.getSelection();this.spawnThread(picozu.WORKER_TYPE_FRACTAL,a,{params:this.parameters,imageData:this.getSelectedLayer().getImageData(b.left,b.top,b.width,b.height)});return this}return!1};this.getMainDockbar().addPanel({name:l("%fractals.title"),handle:"fractals",template:"",
|
|
onCreate:function(){this.addElement({type:picozu.CONTROL_SELECT,handle:"pico-fractal-type",data:picozu.DEFAULT_FRACTALS,callback:function(c){"none"!==c&&a.generateFractal(c)}})}})}};String.toLocale({"en-US":{"%fractals.title":"Fractals","%select-fractal":"-- select a fractal --"}});
|
|
picozu.DEFAULT_FRACTALS=[{name:l("%select-fractal"),handle:"none"},{name:"Mandelbrot",handle:"mandelbrot"},{name:"Multibrot 1",handle:"multibrot1"},{name:"Multibrot 2",handle:"multibrot2"},{name:"Multibrot 3",handle:"multibrot3"},{name:"Dendrite",handle:"dendrite"},{name:"Barnsley`s Tree",handle:"barnsleytree"},{name:"Burning Ship",handle:"burningship"},{name:"Douady Rabbit",handle:"douadyrabbit"},{name:"Julia Cosine",handle:"juliacosine"},{name:"Julia Cosine 1",handle:"juliacosine1"},{name:"Julia Cosine 2",
|
|
handle:"juliacosine2"},{name:"Julia Cube",handle:"juliacube"},{name:"Julia Set 1",handle:"juliaset1"},{name:"Julia Set 2",handle:"juliaset2"},{name:"Julia Set 3",handle:"juliaset3"},{name:"Julia Set 4",handle:"juliaset4"},{name:"Julia Set 5",handle:"juliaset5"},{name:"Julia Set 6",handle:"juliaset6"},{name:"Julia Sine",handle:"juliasine"},{name:"Julia Sine 1",handle:"juliasine1"},{name:"SanMarco",handle:"sanmarco"},{name:"Siegel Disk",handle:"siegeldisk"},{name:"Tricorn",handle:"tricorn"}];
|
|
picozu.extensions.plugins.histograms={parameters:{title:"Histograms",handle:"histograms",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",requires:["workers"],description:"This educational plugin enables Picozu to generate histograms."},onDisable:function(){this.removeDockbarPanel("histogram")},onEnable:function(){var a=this;this.insertStyle("histograms",!0);this.drawHistogram=function(a){this.dispatchAction(picozu.ACTION_CHANGE,a);return this};this.dockbars[0].addPanel({name:l("%histogram.title"),
|
|
handle:"histogram",template:'<select class="pico-select pico-histogram-select"><option value="rgb">RGB</option><option value="red">Red</option><option value="green">Green</option><option value="blue">Blue</option><option value="hue">Hue</option><option value="sat">Saturation</option><option value="val">Value</option><option value="cmyk">CMYK</option><option value="cyan">Cyan</option><option value="magenta">Magenta</option><option value="yellow">Yellow</option><option value="kelvin">Kelvin</option></select><hr /><canvas id="pico-histogram"></canvas>',
|
|
onCreate:function(){$(".pico-dockbar").on("change",".pico-histogram-select",function(){a._refreshHistograms($(this).val())});$(".pico-histogram-select").trigger("change")}});this.refreshHistogram=function(a){if(null!==a){for(var b=document.getElementById("pico-histogram"),d=b.getContext("2d"),e={red:["#000","#f00"],green:["#000","#0f0"],blue:["#000","#00f"],hue:"#f00 #ff0 #0f0 #0ff #00f #f0f #f00".split(" "),val:["#000","#fff"],kelvin:["#fff","#000"],cyan:["#000","#0ff"],yellow:["#000","#ff0"],magenta:["#000",
|
|
"#f0f"]},f=d.createLinearGradient(0,0,b.width,0),g=e.hue,h=0,j=g.length;h<j;h++)f.addColorStop(1*h/(j-1),g[h]);d.clearRect(0,0,b.width,b.height);d.globalCompositeOperation="lighter";h=0;for(j=a.histogram.chans.length;h<j;h++){var k=a.histogram.subtypes[h],g=a.histogram.chans[h],m=a.histogram.maxCount;"hue"===k?(d.strokeStyle="#000",d.fillStyle=f):k in e&&"val"!==k?(d.strokeStyle="#000",d.fillStyle=e[k][1]):(d.fillStyle="#000",d.strokeStyle="#000");d.beginPath();d.moveTo(0,b.height);for(var n=k=void 0,
|
|
s=0;255>=s;s++)s in g&&(n=Math.round(g[s]/m*b.height),k=Math.round(s/255*b.width),d.lineTo(k,b.height-n));d.lineTo(k,b.height);d.fill();d.stroke();d.closePath()}d.globalCompositeOperation="source-over"}}},onAction:function(a,c){a==picozu.ACTION_CHANGE&&this.refreshHistogram(c)}};String.toLocale({"en-US":{"%histogram.title":"Histogram"}});
|
|
picozu.extensions.plugins.iconfinder={parameters:{title:"Iconfinder",handle:"iconfinder",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"Import images from searching them in IconFinder."},onDisable:function(){this.removeImporter("iconfinder");this.removeWindow("iconfinder")},onEnable:function(){this.addImporter(l("%Iconfinder"),"iconfinder");var a=this;this.connectors.iconfinder={url:"http://www.iconfinder.com/json/search/?min=16&max=256&api_key=",results:15,
|
|
apiKey:"30774ed6e6764d508193784b8c0227cf",page:1,tag:"social",getAll:function(c){a.showLoader();"prev"===c?this.page--:"next"===c?this.page++:this.page="undefined"===typeof c?1:c;var b="",d=this;c=this.url+this.apiKey+"&q="+encodeURIComponent(this.tag)+"&c=15&p="+this.page;$.getJSON(c,"callback=?",function(c){$(".pico-iconfinder-list ul.photolist").empty();var f=c.searchresults?c.searchresults.icons.length:0;if(0<f)for(var g=0;g<f;g++)b+="<li><a href='"+decodeURI(c.searchresults.icons[g].image)+"' title='"+
|
|
c.searchresults.icons[g].size+"'><img src='"+decodeURI(c.searchresults.icons[g].image)+"'/></a></li>";else b+='<li class="noresults">'+l("%main.noimages.generic")+"</li>";a.paginate(Math.ceil(c.searchresults.totalResults/d.results),d.page,".pico-iconfinder-pager");$(".pico-iconfinder-list ul.photolist").append(b);a.hideLoader()})},setFilter:function(a){""!=a&&(this.tag=a);return this},_photoCallback:function(a,b){var d="";b||(d="<li><a href='"+decodeURI(a.image)+"' title='"+a.size+"'><img src='"+
|
|
decodeURI(a.image)+"'/></a></li>");return d}};picozu.WINDOWS.push({name:l("%iconfinder.title"),handle:"iconfinder",center:!0,width:545,template:"<fieldset><label>"+l("%Tag")+'</label><input class="pico-textinput tag" type="text" placeholder="'+l("%enter tag")+'" /></fieldset><hr /><div class="pico-iconfinder-list photolist clearfix"><ul class="photolist"><li class="noresults">'+l("%main.noimages.generic")+'</li></ul></div><ul class="pico-iconfinder-pager pagination"></ul>',onShow:function(){a.connectors.iconfinder.getAll()},
|
|
onCreate:function(){var c=this,b=this.getElementId();this.addFooter(picozu.BROWSER_WINDOW_FOOTER);$(b).on("click",".photolist ul li a",function(){var b=$(this).attr("href");a.parseImageFile(b);c.hide();return!1}).on("click",".reload",function(){a.connectors.iconfinder.setFilter(c.getStrValue(".tag")).getAll();return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?a.connectors.iconfinder.getAll("next"):$(this).parent("li").hasClass("prev")?a.connectors.iconfinder.getAll("prev"):
|
|
a.connectors.iconfinder.getAll(parseInt($(this).text()));return!1}).on("keyup.picozu",".tag",function(b){13===b.keyCode&&(a.connectors.iconfinder.setFilter(c.getStrValue(".tag")).getAll(),$(this).blur());return!1})}})}};String.toLocale({"en-US":{"%Iconfinder":"Iconfinder","%iconfinder.title":"Import from Iconfinder"}});
|
|
picozu.extensions.plugins.palettomatic={parameters:{title:"Palett-o-matic",handle:"palettomatic",version:"1.0",depends:["swatches"],email:"office@picozu.com",url:"www.picozu.com",description:"Plugin that helps you create different types of color palettes based on your images."},onDisable:function(){this.removeTool("palettomatic");this.removeWindow("palettomatic");this.helpers.palettomatic=null},onEnable:function(){this.addTool(l("%Palett-o-matic"),"palettomatic");var a=this;if(!this.pluginIsEnabled("swatches"))return this.log(l("%plugin.depends"),
|
|
l("%ERR")),!1;this.helpers.palettomatic={done:!1,blockLayer:null,imageLayer:null,newTab:null,leftSpacing:10,topSpacing:10,blocks:6,blockHeight:200,background:[255,255,255],blockWidth:200,fontSize:19,coords:null,prepHorizontal:function(){this.blockLayer=new picozu.objects.layer({parent:this.newTab,width:this.coords.width,height:this.blockHeight,left:this.leftSpacing,top:2*this.topSpacing+this.coords.height,name:"Color blocks"})},prepVertical:function(){this.blockLayer=new picozu.objects.layer({parent:this.newTab,
|
|
width:this.blockWidth,height:this.coords.height,left:2*this.leftSpacing+this.coords.width,top:this.topSpacing,name:"Color blocks"})},prepare:function(){a.showLoader();var c=a.getSelectedTab();c._refreshPreview();this.swatches=a.heap.swatches;this.coords=c.getCoords();image=c.getPreviewLayer().getCanvas();this.coords.width>this.coords.height?(this.blockHeight=20*this.coords.height/100,this.newWidth=this.coords.width+2*this.leftSpacing,this.newHeight=this.coords.height+3*this.topSpacing+this.blockHeight):
|
|
(this.blockWidth=20*this.coords.width/100,this.newWidth=this.coords.width+3*this.leftSpacing+this.blockWidth,this.newHeight=this.coords.height+2*this.topSpacing);this.newTab=a.newTab({width:this.newWidth,height:this.newHeight,hasBackground:!0,name:"palett-o-matic",backgroundColor:[255,255,255,1]}).activate();this.imageLayer=(new picozu.objects.layer({parent:this.newTab,width:this.coords.width,height:this.coords.height,left:this.leftSpacing,top:this.topSpacing,name:"Main image"})).drawImage(image,
|
|
this.coords.width,this.coords.height);this.coords.width>this.coords.height?this.prepHorizontal():this.prepVertical();a.addDefaultWatermark().hideLoader()},refreshSwatches:function(){a.showLoader();a.saveUndo();var c=[255,255,255];this.blockLayer._clear();this.newTab.getBackgroundLayer()._fill(this.background);if(this.coords.width>this.coords.height){this.blockWidth=(this.coords.width-(this.blocks-1)*this.leftSpacing)/this.blocks;this.fontSize=Math.round(this.blockWidth/10)+4;for(var b=0;b<this.blocks;b++)if(this.blockLayer.getContext().fillStyle=
|
|
Color.color2Exp("rgb",this.swatches[b]),this.blockLayer.getContext().fillRect(this.leftSpacing*b+b*this.blockWidth,0,this.blockWidth,this.blockHeight),!0===this.codes){var d=this.leftSpacing*b+b*this.blockWidth+this.blockWidth/2,e=this.blockHeight/2+this.fontSize/2,c=Color.isDark(this.swatches[b])?[40,40,40]:[255,255,255];this.blockLayer.getContext().fillStyle=Color.color2Exp("rgb",c);this.blockLayer.getContext().textAlign="center";this.blockLayer.getContext().font="bold "+this.fontSize+"px Comic Sans MS";
|
|
this.blockLayer.getContext().fillText(Color.color2Exp("hex",this.swatches[b]),d,e)}}else{this.blockHeight=(this.coords.height-(this.blocks-1)*this.topSpacing)/this.blocks;this.fontSize=Math.round(this.blockWidth/10)+4;for(b=0;b<this.blocks;b++)this.blockLayer.getContext().fillStyle=Color.color2Exp("rgb",this.swatches[b]),this.blockLayer.getContext().fillRect(0,this.topSpacing*b+b*this.blockHeight,this.blockWidth,this.blockHeight),!0===this.codes&&(d=this.blockWidth/2+this.fontSize/2,e=this.topSpacing*
|
|
b+b*this.blockHeight+this.blockHeight/2,c=Color.isDark(this.swatches[b])?[40,40,40]:[255,255,255],this.blockLayer.getContext().fillStyle=Color.color2Exp("rgb",c),this.blockLayer.getContext().textAlign="center",this.blockLayer.getContext().font="bold "+this.fontSize+"px Comic Sans MS",this.blockLayer.getContext().fillText(Color.color2Exp("hex",this.swatches[b]),d,e))}a._refreshAll();a.hideLoader()}};picozu.WINDOWS.push({name:l("%Palett-o-matic"),handle:"palettomatic",center:!0,width:320,template:'<img src="'+
|
|
picozu.DEFAULT_PLUGINS_PATH+'palettomatic/splash.png" /><hr /><fieldset><label>'+l("%Number of colors")+'</label><select class="pico-select count"></select></fieldset>',onShow:function(){!1===a.helpers.palettomatic.done&&"undefined"===typeof a.getSelectedTab().heap.demotivator&&a.helpers.palettomatic.prepare()},onCreate:function(){var c=this.getElementId();this.addElement({type:picozu.CONTROL_COLORSELECT,legend:l("%Background color"),handle:"ptm-background-color",value:[255,255,255],property:"ptmColor",
|
|
callback:function(b){a.helpers.palettomatic.background=b}}).addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%Show color codes"),handle:"ptm-show-codes",property:"ptmCodes",checked:!1,value:!0,callback:function(b){a.helpers.palettomatic.codes=b}}).addFooter(picozu.BROWSER_WINDOW_FOOTER);for(var b="",d="",e=2;21>e;e++)d=6==e?"selected ":d="",b+="<option "+d+'value="'+e+'">'+e+"</option>";$(c+" .count").append(b);$(c).on("click",".reload",function(){a.helpers.palettomatic.refreshSwatches()}).on("change",
|
|
".count",function(){a.helpers.palettomatic.blocks=parseInt($(this).val())})}})}};String.toLocale({"en-US":{"%Palett-o-matic":"Palett-o-matic","%Number of colors":"Number of colors","%Background color":"Background color","%Show color codes":"Show color codes"}});
|
|
picozu.extensions.plugins.tagcloud={parameters:{title:"Tag Cloud",handle:"tagcloud",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",description:"Plugin for creating tag clouds."},onDisable:function(){this.removeTool("tagcloud");this.removeWindow("tagcloud");this.helpers.tagcloud=null},onEnable:function(){this.addTool(l("%Tag Cloud"),"tagcloud");var a=this;this.insertScript("prerequisites","tagcloud");this.insertStyle("tagcloud",!0);var c=function(a){return function(){return a[Math.floor(Math.random()*
|
|
a.length)]}};this.helpers.tagcloud={textLayer:null,newTab:null,shape:"circle",weight:8,url:"",fontFamily:"Impact",text:"",theme:0,themes:[{name:l("%Default"),color:"random-dark"},{name:l("%Cold as Ice"),color:c("#141614 #a5bcae #4a6176 #21203d #72737b #3b3841".split(" "))},{name:l("%Bubblegum Candy"),color:c("#32a9db #de57a4 #d9cc48 #9291ea #cd9b95 #a7d2e0 #cfb22a #3a4c2b".split(" "))},{name:l("%Autumn Harvest"),color:c("#663211 #945b1d #ea773e #c83c08 #6a5961 #ce9068 #30170b".split(" "))},{name:l("%Forest Fantasy"),
|
|
color:c("#46572b #afae8c #6b694f #0a1415 #445a44 #35704f #2c6807 #64a526".split(" "))},{name:l("%Plums"),color:c(["#865b97","#cea3d0","#c27cbf","#581477","#980470"])},{name:l("%Noir"),color:c("#000000 #111111 #222222 #333333 #444444 #555555 #666666 #777777 #888888 #999999 #aaaaaa #bbbbbb".split(" "))},{name:l("%Picozu"),color:c("#ed1978 #ed5e9d #6c6c6c #f47cba #d2136a #c30c5f #ec1474".split(" "))},{name:l("%Party Tones"),color:c("#66d9ef #a6e22d #fd9720 #a6e22a #a581ff #f92772".split(" "))},{name:l("%Folklore"),
|
|
color:c(["#ff0000","#ffff00","#0000ff"])},{name:l("%Jingle All The Way"),color:c("#670504 #e01c04 #fed883 #914804 #4c5004 #79a40e".split(" "))},{name:l("%Raspberry Tints"),color:c(["#5eaa9f","#8dc7b7","#ebe6ce","#e8b165","#b81f56"])},{name:l("%Roses for the Sweet"),color:c(["#e1bad9","#c52774","#d672b0","#b2dfda","#52b3ba"])},{name:l("%Artichoke Splash"),color:c(["#cdc89a","#b482aa","#825e82","#6b4267","#6b7870"])}],prepare:function(){a.showLoader();this.newTab=a.newTab({width:800,height:600,name:"tagcloud"}).activate();
|
|
this.newTab.heap.tagcloud=!0;this.textLayer=new picozu.objects.layer({parent:this.newTab,width:800,height:600,name:"Tag Cloud Text"});a.addDefaultWatermark().hideLoader();$(this.textLayer.getElementId()).on("wordcloudstop",function(){a._refreshAll()});this.apply()},getTheme:function(){return this.themes[this.theme].color},parseText:function(a){var c=this;WordFreq({workerUrl:picozu.DEFAULT_PLUGINS_PATH+"tagcloud/wordfreq.worker.js"}).process(a,function(a){WordCloud(c.textLayer.getCanvas(),{list:a,
|
|
fontFamily:c.fontFamily,color:c.getTheme(),weightFactor:c.weight,backgroundColor:"rgba(0, 0, 0, 0)",gridSize:Math.round(16*c.textLayer.getWidth()/1024),minRotation:-Math.PI/2,maxRotation:Math.PI/2,shuffle:!0,rotateRatio:0.1,shape:c.shape,ellipticity:0.65})})},parseURL:function(){},apply:function(){this.text=$(".pico-window-tagcloud .tag-text").val();this.url=$(".pico-window-tagcloud .tag-url").val();this.fontFamily=$(".pico-window-tagcloud .tag-font").val();this.shape=$(".pico-window-tagcloud .tag-shape").val();
|
|
this.weight=$(".pico-window-tagcloud .tag-weight").val();this.theme=$(".pico-window-tagcloud .tag-theme").val();""!=this.text?this.parseText(this.text):""!=this.url&&this.parseURL()}};picozu.WINDOWS.push({name:l("%tagcloud.title"),handle:"tagcloud",center:!0,width:500,template:"<fieldset><label>"+l("%Text")+'</label><textarea class="pico-textinput tag-text">'+l("%tagcloud.text")+"</textarea></fieldset>or<fieldset><label>"+l("%tagcloud.rss")+'</label><input type="text" class="pico-textinput tag-url" placeholder="http://www.yoursite.com/rss" /></fieldset><hr /><fieldset><label>'+
|
|
l("%main.font")+'</label><select class="pico-select tag-font"></select></fieldset><hr /><fieldset><label>'+l("%tagcloud.shape")+'</label><select class="pico-select tag-shape"><option value="circle">circle</option><option value="cardioid">cardioid</option><option value="diamond">diamond</option><option value="triangle">triangle</option><option value="star">star</option></select></fieldset><hr /><fieldset><label>'+l("%tagcloud.weightFactor")+'</label><select class="pico-select tag-weight"></select></fieldset><hr /><fieldset><label>'+
|
|
l("%tagcloud.theme")+'</label><select class="pico-select tag-theme"></select></fieldset>',onShow:function(){"undefined"===typeof a.getSelectedTab().heap.tagcloud&&a.helpers.tagcloud.prepare()},onCreate:function(){var b="",c="",e=this.getElementId();this.addFooter(picozu.BROWSER_WINDOW_FOOTER);for(var f=1;30>=f;f++)c=a.helpers.tagcloud.weight==f?"selected ":"",b+="<option "+c+'value="'+f+'">'+f+"</option>";$(e+" .tag-weight").append(b);c=b="";for(f=30;71>f;f++)c=a.helpers.tagcloud.fontSize==f?"selected ":
|
|
"",b+="<option "+c+'value="'+f+'">'+f+"</option>";$(e+" .tag-textsize").append(b);c=b="";for(f=0;f<picozu.DEFAULT_FONTS.length;f++)c=a.helpers.tagcloud.fontFamily==picozu.DEFAULT_FONTS[f].handle?"selected ":"",b+="<option "+c+'style="font-family: '+picozu.DEFAULT_FONTS[f].name+'" value="'+picozu.DEFAULT_FONTS[f].name+'">'+picozu.DEFAULT_FONTS[f].name+"</option>";$(e+" .tag-font").append(b);c=b="";for(f=0;f<a.helpers.tagcloud.themes.length;f++)b+='<option value="'+f+'">'+a.helpers.tagcloud.themes[f].name+
|
|
"</option>";$(e+" .tag-theme").append(b);$(e).on("change",".tag-theme, .tag-shape, .tag-weight",function(){a.helpers.tagcloud.apply()}).on("change",".tag-font",function(){var b=$(e+" .tag-font").val();WebFont.load({google:{families:[b]},active:function(){a.helpers.tagcloud.apply()},inactive:function(){}})}).on("click",".reload",function(){a.helpers.tagcloud.apply()})}})}};
|
|
String.toLocale({"en-US":{"%Tag Cloud":"Tag Cloud","%tagcloud.title":"Tag Cloud Generator","%tagcloud.text":"Picozu the HTML5 image editor Sharing Picozu Creativity Join Draw Edit Share Picozu the HTML5 image editor Sharing Creativity Picozu the HTML5 image editor Sharing Creativity Join Draw Edit Share Picozu the HTML5 image editor Picozu Sharing Creativity Picozu Join Draw Edit Share","%tagcloud.shape":"Shape","%tagcloud.weightFactor":"Weight Factor","%tagcloud.rss":"RSS feed URL","%tagcloud.theme":"Color Theme",
|
|
"%Default":"Default","%Cold as Ice":"Cold as Ice","%Noir":"Noir","%Autumn Harvest":"Autumn Harvest","%Bubblegum Candy":"Bubblegum Candy","%Forest Fantasy":"Forest Fantasy","%Plums":"Plums","%Party Tones":"Party Tones"}});
|
|
picozu.extensions.plugins.picasa={parameters:{title:"Picasa",handle:"picasa",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"Import images by searching them in Picasa."},onDisable:function(){this.removeImporter("picasa");this.removeWindow("picasa")},onEnable:function(){this.addImporter(l("%Picasa"),"picasa");var a=this;this.connectors.picasa={url:"http://picasaweb.google.com/data/feed/api/",albumsUrl:"http://picasaweb.google.com/data/feed/api/user/",
|
|
results:15,page:1,user:"",tags:"",getAll:function(c){a.showLoader();"prev"===c?this.page--:"next"===c?this.page++:this.page="undefined"===typeof c?1:c;var b="",d=this;$.getJSON(this.url+(""!==this.user?"user/"+this.user:"all")+"?kind=photo&max-results=1000&alt=json"+(""!=this.tags?"&q="+this.tags:"")+"&thumbsize=72u,800","callback=?",function(c){$(".pico-picasa-list ul.photolist").empty();var f=c.feed?c.feed.entry.length:0,g=(d.page-1)*d.results,h=d.results*d.page;if(0<f)for(var j=0;j<f;j++)b+=d._photoCallback(c.feed.entry[j],
|
|
!(j>=g&&j<h));else b+='<li class="noresults">'+l("%main.noimages.generic")+"</li>";a.paginate(Math.ceil(f/d.results),d.page,".pico-picasa-pager");$(".pico-picasa-list ul.photolist").append(b);a.hideLoader()});return this},setFilter:function(a,b){this.user=a;this.tags=b;return this},_nl2br:function(a){return a.replace(/\n/g,"<br />\n")},_photoCallback:function(a,b){var d="",e="",f="",f=this._nl2br(a.summary?a.summary.$t:"");b||(e+=f.replace(RegExp("'","g"),"'"),d='<li><a href="'+a.media$group.media$thumbnail[1].url+
|
|
'"><img title="'+e+'" class="tips" src="'+a.media$group.media$thumbnail[0].url+'" /></a></li>');return d}};picozu.WINDOWS.push({name:l("%picasa.title"),handle:"picasa",center:!0,width:545,template:"<fieldset><label>"+l("%From user")+'</label><input class="pico-textinput user" type="text" placeholder="'+l("%user name")+'" /></fieldset><fieldset><label>'+l("%Tag")+'</label><input class="pico-textinput tag" type="text" placeholder="'+l("%enter tag")+'" /></fieldset><hr /><div class="pico-picasa-list photolist clearfix"><ul class="photolist"><li class="noresults">'+
|
|
l("%main.noimages.generic")+'</li></ul></div><hr /><ul class="pico-picasa-pager pagination"></ul>',onShow:function(){a.connectors.picasa.getAll()},onCreate:function(){var c=this,b=this.getElementId();$(b).on("click",".photolist ul li a",function(){var b=$(this).attr("href");a.parseImageFile(b);c.hide();return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?a.connectors.picasa.getAll("next"):$(this).parent("li").hasClass("prev")?a.connectors.picasa.getAll("prev"):a.connectors.picasa.getAll(parseInt($(this).text()));
|
|
return!1}).on("keyup.picozu",".user, .tag",function(b){13===b.keyCode&&(a.connectors.picasa.setFilter(c.getStrValue(".user"),c.getStrValue(".tag")).getAll(),$(this).blur());return!1})}})}};String.toLocale({"en-US":{"%Picasa":"Picasa","%picasa.title":"Import from Picasa"}});
|
|
picozu.extensions.plugins.onedrive={parameters:{title:"Onedrive",handle:"onedrive",version:"1.4",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"This plugin provides a basic integration with Microsoft Onedrive, allowing you to import your photos from Onedrive and export them back."},onDisable:function(){this.removeImporter("onedriveopen");this.removeExporter("onedrivesave");this.removeWindow(["onedriveopen","onedrivesave"])},onEnable:function(){var a=this;this.addImporter(l("%Onedrive"),
|
|
"onedriveopen");this.addExporter(l("%Onedrive"),"onedrivesave");this.insertScript("//js.live.net/v5.0/wl.js","","onedrive");this.insertStyle("onedrive",!0);this.connectors.onedrive={appId:"00000000400D721E",redirectURI:"https://www.picozu.com/live_receiver.html",scope:["wl.signin","wl.basic","wl.photos","wl.skydrive_update"],page:1,results:15,inited:!1,album:"",token:null,photos:[],fCnt:".pico-window-onedriveopen .folders, .pico-window-onedrivesave .folders",albums:[],account:null,deauthenticate:function(){WL.logout();
|
|
a.notifier.trigger({title:l("%Info"),content:l("%onedrive.signout")})},authenticate:function(){var a=this;WL.login({scope:a.scope}).then(function(){a._login()},function(c){a.error(c.error.message)})},createUploadRequestBody:function(a,c){return'--A300x\r\nContent-Disposition: form-data; name="file"; filename="'+c+'"\r\nContent-Type: application/octet-stream\r\n\r\n'+a.replace("data:image/png;base64,","")+"\r\n--A300x--\r\n"},upload:function(b,c,e){$.ajax({type:"POST",contentType:"multipart/form-data; boundary=A300x",
|
|
processData:!1,beforeSend:function(){},url:"https://apis.live.net/v5.0/"+b+"/files?access_token="+this.token,data:this.createUploadRequestBody(c,e),success:function(){a.notifier.trigger({title:l("%Info"),content:l("%onedrive.doneupload")});a.hideLoader()},error:function(){a.notifier.trigger({title:l("%Error"),error:!0,content:l("%onedrive.errorupload")});a.hideLoader()}})},getAll:function(){this.getAlbums();this.getPhotos()},_login:function(){this.getAll();$(".pico-window-onedriveopen > footer, .pico-window-onedrivesave > footer").show();
|
|
$(this.fCnt).empty().append('<option value="me">-- '+l("%select folder")+" --</option>");$(".pico-onedrive-loggedout").hide();$(".pico-onedrive-loggedin").show()},_logout:function(){this.inited=!1;this.token=this.account=null;$(".pico-window-onedriveopen > footer, .pico-window-onedrivesave > footer").hide();$(this.fCnt).empty().append('<option value="me">-- '+l("%select folder")+" --</option>");$(".pico-onedrive-loggedout").show();$(".pico-onedrive-loggedin").hide()},init:function(){var a=this;!1===
|
|
this.inited?(WL.Event.subscribe("auth.login",function(c){a.token=c.session.access_token}),WL.Event.subscribe("auth.logout",function(){a._logout()}),WL.init({client_id:a.appId,redirect_uri:a.redirectURI,response_type:"token",secure_cookie:!0}),a.inited=!0):a.authenticate()},getPhotos:function(a){"prev"===a?this.page--:"next"===a?this.page++:this.page="undefined"===typeof a?1:a;this.getPhotosFrom(this.album)},getPhotosFrom:function(b){a.showLoader();var c=this;""!=b&&(this.photos=[],WL.api({path:"/"+
|
|
b+"/photos",method:"GET"}).then(function(a){for(var b=0;b<a.data.length;b++)"photo"===a.data[b].type&&c.photos.push(a.data[b]);c._process()},function(a){c.error(a.error.message)}))},getAlbums:function(b){a.showLoader();var c=this;"undefined"==typeof b&&(b="/me/skydrive/files",$(this.fCnt).empty().append('<option value="me">-- '+l("%select folder")+" --</option>"));WL.api({path:b,method:"GET"}).then(function(b){if(0<b.data.length&&"undefined"!=typeof b.data)for(var f=0;f<b.data.length;f++)if("album"==
|
|
b.data[f].type||"folder"==b.data[f].type)$(c.fCnt).append('<option value="'+b.data[f].id+'">'+b.data[f].name+"</option>"),c.getAlbums("/"+b.data[f].id+"/files");a.hideLoader()},function(a){c.error(a.error.message)});return this},error:function(b){this._logout();a.hideLoader();a.notifier.trigger({title:l("%Error"),error:!0,content:b})},_process:function(){var b="",c=(this.page-1)*this.results,e=this.results*this.page;if(0<this.photos.length)for(var f=0;f<this.photos.length;f++)b+=this._photoCallback(this.photos[f],
|
|
!(f>=c&&f<e));else b+='<li class="noresults">'+l("%main.noimages")+"</li>";a.paginate(Math.ceil(this.photos.length/this.results),this.page,".pico-onedrive-pager");$(".pico-onedrive-list ul.photolist").empty().append(b);a.hideLoader()},_photoCallback:function(a,c){var e="";c||(e='<li><a href="'+a.source+'"><img class="tips" title="'+a.name+'" src="'+a.picture+'" alt="" /></a></li>');return e}};var c=this.connectors.onedrive;picozu.WINDOWS.push({name:l("%onedrive.import"),handle:"onedriveopen",center:!0,
|
|
width:545,onShow:function(){c.init()},onCreate:function(){var b=this,d=this.getElementId();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="pico-onedrive-loggedin"></div><div class="pico-onedrive-loggedout connect"></div>'}).addElement({type:picozu.CONTROL_SELECT,legend:l("%Folder"),handle:"pico-sOfolders",legendClass:"legend",cssClass:"folders",data:[]},".pico-onedrive-loggedin").addElement({type:picozu.CONTROL_HTML,template:'<hr /><div class="pico-onedrive-list photolist clearfix"><ul class="photolist"><li class="noresults">'+
|
|
l("%main.noimages")+'</li></ul></div><ul class="pico-onedrive-pager pagination"></ul>'},".pico-onedrive-loggedin").addFooter(picozu.CONNECTOR_OPEN_WINDOW_FOOTER);$(d).on("click",".logout",function(){c.deauthenticate();b.hide();return!1}).on("change",".folders",function(){c.getPhotosFrom($(this).val())}).on("click",".reload",function(){c.getAll();return!1}).on("click",".connect",function(){c.authenticate();return!1}).on("click","ul li a",function(){var c=$(this).attr("href");a.parseImageFile(c);b.hide();
|
|
return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?c.getPhotos("next"):$(this).parent("li").hasClass("prev")?c.getPhotos("prev"):c.getPhotos(parseInt($(this).text()));return!1})}});picozu.WINDOWS.push({name:l("%onedrive.export"),handle:"onedrivesave",center:!0,width:545,onShow:function(){c.init()},onCreate:function(){var b=this,d=this.getElementId();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="pico-onedrive-loggedin"></div><div class="pico-onedrive-loggedout connect"></div>'}).addElement({type:picozu.CONTROL_SELECT,
|
|
legend:l("%Folder"),handle:"pico-sSfolders",cssClass:"folders",legendClass:"legend",data:[]},".pico-onedrive-loggedin").addElement({type:picozu.CONTROL_TEXTINPUT_FILE,legend:l("%main.filename"),extension:"png",placeholder:"enter a file name",handle:"pz-onedrive-filename",legendClass:"legend"},".pico-onedrive-loggedin").addFooter(picozu.CONNECTOR_SAVE_WINDOW_FOOTER);$(d).on("click",".save",function(){var d=b.getStrValue("#pz-onedrive-filename"),f=b.getStrValue(".folders");a.showLoader();""!==d?a.exportData(picozu.FILE_FORMAT_PNG,
|
|
function(a){c.upload(f,a,d+".png")}):a.notifier.trigger({title:l("%Error"),error:!0,content:l("%onedrive.filename")});return!1}).on("click",".connect",function(){c.authenticate();return!1}).on("click",".logout",function(){c.deauthenticate();b.hide();return!1})}})}};
|
|
String.toLocale({"en-US":{"%Onedrive":"Onedrive","%onedrive.errorupload":"Error uploading your image to your Onedrive.","%onedrive.doneupload":"Image uploaded successfully to your Onedrive.","%onedrive.signout":"Successfully signed out from Onedrive.","%onedrive.import":"Import from Onedrive","%onedrive.export":"Export to Onedrive","%onedrive.filename":"You must specify a file name.","%onedrive.signout":"Successfully signed out from Onedrive."}});
|
|
picozu.extensions.plugins.swatches={parameters:{title:"Swatches",handle:"swatches",version:"1.8",email:"office@picozu.com",url:"www.picozu.com",requires:["workers"],description:"Organize your color swatches with ease by using this plugin."},onDisable:function(){this.removeImporter("swatches");this.removeWindow("swatches");this.removeDockbarPanel("swatches");$(".pico-swatch .swcolors").empty()},onEnable:function(){var a=this;this.addImporter(l("%Color Palette"),"swatches");this.dockbars[0].addPanel({name:l("%Swatches"),
|
|
handle:"swatches",template:'<div class="pico-swatches-tabs"><ul><li><a href="#tabs-swatches-default">'+l("%Default")+'</a></li><li><a href="#tabs-swatches-image">'+l("%Image")+'</a></li><li><a href="#tabs-swatches-custom">'+l("%Custom")+'</a></li></ul><div id="tabs-swatches-default" class="clearfix"><div class="pico-swatches-container-default"></div></div><div id="tabs-swatches-image" class="clearfix"><div class="pico-swatches-container-image"></div></div><div id="tabs-swatches-custom" class="clearfix"><div class="pico-swatches-container-custom"></div></div></div>',
|
|
onCreate:function(){var c="",b=this.getElementId();$(".pico-swatches-tabs").tabs();for(var d=0;d<picozu.DEFAULT_SWATCHES.length;d++)c+='<div data-mid="'+d+'" data-color="'+picozu.DEFAULT_SWATCHES[d].value+'" title="'+picozu.DEFAULT_SWATCHES[d].name+" #"+picozu.DEFAULT_SWATCHES[d].value+'" class="tips pico-swatches-item" style="background-color: #'+picozu.DEFAULT_SWATCHES[d].value+'"></div>';$(".pico-swatches-container-default").append(c);$(b).on("click",".pico-swatches-item, .pico-image-swatches-item, .pico-custom-swatches-item",
|
|
function(){var b=$(this).data("color"),b=Color.hex2rgb("#"+b);a.setParam("foregroundColor",b);a.updateInfoPanel({rgb:b})});new picozu.objects.contextmenu({target:".pico-swatches-item",parent:a,submenus:picozu.SWATCHES_CONTEXTMENU_DEFS});new picozu.objects.contextmenu({target:".pico-image-swatches-item",parent:a,submenus:picozu.IMAGE_SWATCHES_CONTEXTMENU_DEFS});new picozu.objects.contextmenu({target:".pico-custom-swatches-item",parent:a,submenus:picozu.CUSTOM_SWATCHES_CONTEXTMENU_DEFS})}});picozu.WINDOWS.push({name:l("%Import swatches"),
|
|
handle:"swatches",center:!0,width:300,onCreate:function(){var a=this,b=this.getElementId(),d=this.getWorkspace();this.addElement({type:picozu.CONTROL_IMAGE,image:picozu.DEFAULT_PATH+"images/windows/colorpalette/splash.png"}).addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_HTML,template:"<p>"+l("%upload.swatches")+'</p><input type="file" class="hidden pico-upload-swatches" />'}).addFooter('<input type="button" class="button ok-btn upload" value="'+l("%main.selectfile")+
|
|
'" /> <input type="button" class="button gui-btn cancel-button" value="'+l("%main.cancel")+'" />');$(b).on("click",".upload",function(){$(b+" .pico-upload-swatches").trigger("click");return!1}).on("change",".pico-upload-swatches",function(b){a.hide();d.showLoader();b=b||window.event;b.preventDefault();b=b.originalEvent||b;d.loadFile(b.target.files[0]);return!1})}});a._refreshSwatches()}};
|
|
String.toLocale({"en-US":{"%Color Palette":"Color Palette","%Import swatches":"Import swatches","%Swatches":"Swatches","%export.ase":"Adobe Swatch Exchange (.ase)","%export.clr":"Adobe Flash color palette (.clr)","%export.act":"Adobe Fireworks color table (.act)","%export.gmp":"GIMP color palette (.txt)","%export.aco":"Adobe pre-CS2 color palette (.aco)","%upload.swatches":"Select a swatches file to import into Picozu. Currently you can select Adobe StackExchange (.ase) swatch files."}});
|
|
picozu.DEFAULT_SWATCHES=[{name:"Alice Blue",value:"F0F8FF"},{name:"Antique White",value:"FAEBD7"},{name:"Aquamarine",value:"7FFFD4"},{name:"Azure",value:"F0FFFF"},{name:"Beige",value:"F5F5DC"},{name:"Bisque",value:"FFE4C4"},{name:"Black",value:"000000"},{name:"Blanched Almond",value:"FFEBCD"},{name:"Blue",value:"0000FF"},{name:"Blue Violet",value:"8A2BE2"},{name:"Brown",value:"A52A2A"},{name:"Burly Wood",value:"DEB887"},{name:"Cadet Blue",value:"5F9EA0"},{name:"Chartreuse",value:"7FFF00"},{name:"Chocolate",
|
|
value:"D2691E"},{name:"Coral",value:"FF7F50"},{name:"Cornflower Blue",value:"6495ED"},{name:"Cornsilk",value:"FFF8DC"},{name:"Crimson",value:"DC143C"},{name:"Cyan",value:"00FFFF"},{name:"Dark Blue",value:"00008B"},{name:"Dark Cyan",value:"008B8B"},{name:"Dark Golden Rod",value:"B8860B"},{name:"Dark Gray",value:"A9A9A9"},{name:"Dark Green",value:"006400"},{name:"Dark Khaki",value:"BDB76B"},{name:"Dark Magenta",value:"8B008B"},{name:"Dark Olive Green",value:"556B2F"},{name:"Dark Orange",value:"FF8C00"},
|
|
{name:"Dark Orchid",value:"9932CC"},{name:"Dark Red",value:"8B0000"},{name:"Dark Salmon",value:"E9967A"},{name:"Dark Sea Green",value:"8FBC8F"},{name:"Dark Slate Blue",value:"483D8B"},{name:"Dark Slate Gray",value:"2F4F4F"},{name:"Dark Turquoise",value:"00CED1"},{name:"Dark Violet",value:"9400D3"},{name:"Deep Pink",value:"FF1493"},{name:"Deep Sky Blue",value:"00BFFF"},{name:"Dim Gray",value:"696969"},{name:"Dodger Blue",value:"1E90FF"},{name:"Fire Brick",value:"B22222"},{name:"Floral White",value:"FFFAF0"},
|
|
{name:"Forest Green",value:"228B22"},{name:"Gainsboro",value:"DCDCDC"},{name:"Ghost White",value:"F8F8FF"},{name:"Gold",value:"FFD700"},{name:"Golden Rod",value:"DAA520"},{name:"Green",value:"00FF00"},{name:"Green Yellow",value:"ADFF2F"},{name:"Honey Dew",value:"F0FFF0"},{name:"Hot Pink",value:"FF69B4"},{name:"Indian Red",value:"CD5C5C"},{name:"Indigo",value:"4B0082"},{name:"Ivory",value:"FFFFF0"},{name:"Khaki",value:"F0E68C"},{name:"Lavender",value:"E6E6FA"},{name:"Lavender Blush",value:"FFF0F5"},
|
|
{name:"Lawn Green",value:"7CFC00"},{name:"Lemon Chiffon",value:"FFFACD"},{name:"Light Blue",value:"ADD8E6"},{name:"Light Coral",value:"F08080"},{name:"Light Cyan",value:"E0FFFF"},{name:"Light Golden Rod",value:"EEDD82"},{name:"Light Golden Rod Yellow",value:"FAFAD2"},{name:"Light Gray",value:"D3D3D3"},{name:"Light Green",value:"90EE90"},{name:"Light Pink",value:"FFB6C1"},{name:"Light Salmon",value:"FFA07A"},{name:"Light Sea Green",value:"20B2AA"},{name:"Light Sky Blue",value:"87CEFA"},{name:"Light Slate Blue",
|
|
value:"8470FF"},{name:"Light Slate Gray",value:"778899"},{name:"Light Steel Blue",value:"B0C4DE"},{name:"Light Yellow",value:"FFFFE0"},{name:"Lime Green",value:"32CD32"},{name:"Linen",value:"FAF0E6"},{name:"Magenta",value:"FF00FF"},{name:"Maroon",value:"B03060"},{name:"Medium Aquamarine",value:"66CDAA"},{name:"Medium Blue",value:"0000CD"},{name:"Medium Orchid",value:"BA55D3"},{name:"Medium Purple",value:"9370DB"},{name:"Medium Sea Green",value:"3CB371"},{name:"Medium Slate Blue",value:"7B68EE"},{name:"Medium Spring Green",
|
|
value:"00FA9A"},{name:"Medium Turquoise",value:"48D1CC"},{name:"Medium Violet Red",value:"C71585"},{name:"Midnight Blue",value:"191970"},{name:"Mint Cream",value:"F5FFFA"},{name:"Misty Rose",value:"FFE4E1"},{name:"Moccasin",value:"FFE4B5"},{name:"Navajo White",value:"FFDEAD"},{name:"Navy",value:"000080"},{name:"Navy Blue",value:"000080"},{name:"Old Lace",value:"FDF5E6"},{name:"Olive Drab",value:"6B8E23"},{name:"Orange",value:"FFA500"},{name:"Orange Red",value:"FF4500"},{name:"Orchid",value:"DA70D6"},
|
|
{name:"Pale Golden Rod",value:"EEE8AA"},{name:"Pale Green",value:"98FB98"},{name:"Pale Turquoise",value:"AFEEEE"},{name:"Pale Violet Red",value:"DB7093"},{name:"Papaya Whip",value:"FFEFD5"},{name:"Peach Puff",value:"FFDAB9"},{name:"Peru",value:"CD853F"},{name:"Picozu",value:"DB0268"},{name:"Pink",value:"FFC0CB"},{name:"Plum",value:"DDA0DD"},{name:"Powder Blue",value:"B0E0E6"},{name:"Purple",value:"A020F0"},{name:"Red",value:"FF0000"},{name:"Rosy Brown",value:"BC8F8F"},{name:"Royal Blue",value:"4169E1"},
|
|
{name:"Saddle Brown",value:"8B4513"},{name:"Salmon",value:"FA8072"},{name:"Sandy Brown",value:"F4A460"},{name:"Sea Green",value:"2E8B57"},{name:"Sea Shell",value:"FFF5EE"},{name:"SGI Beet",value:"8E388E"},{name:"SGI Bright Gray",value:"C5C1AA"},{name:"SGI Chartreuse",value:"71C671"},{name:"SGI Light Blue",value:"7D9EC0"},{name:"SGI Light Gray",value:"AAAAAA"},{name:"sgilightgrey",value:"AAAAAA"},{name:"SGI Olive Drab",value:"8E8E38"},{name:"SGI Salmon",value:"C67171"},{name:"SGI Slate Blue",value:"7171C6"},
|
|
{name:"SGI Teal",value:"388E8E"},{name:"SGI Very Dark Gray",value:"282828"},{name:"SGI Very Light Gray",value:"D6D6D6"},{name:"Sienna",value:"A0522D"},{name:"Sky Blue",value:"87CEEB"},{name:"Slate Blue",value:"6A5ACD"},{name:"Slate Grey",value:"708090"},{name:"Snow",value:"FFFAFA"},{name:"Spring Green",value:"00FF7F"},{name:"Steel Blue",value:"4682B4"},{name:"Tan",value:"D2B48C"},{name:"Thistle",value:"D8BFD8"},{name:"Tomato",value:"FF6347"},{name:"Turquoise",value:"40E0D0"},{name:"Violet",value:"EE82EE"},
|
|
{name:"Violet Red",value:"D02090"},{name:"Wheat",value:"F5DEB3"},{name:"White",value:"FFFFFF"},{name:"White Smoke",value:"F5F5F5"},{name:"Yellow",value:"FFFF00"},{name:"Yellow Green",value:"9ACD32"}];
|
|
picozu.extensions.plugins.charts={parameters:{title:"Charts",handle:"charts",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",description:"Allows you to integrate various types of charts into your workspaces and adjust settings such as shapes and colors."},onDisable:function(){this.removeToolbarButton("charts");this.removeWindow("charts");this.helpers.charts=null},onEnable:function(){var a=this;this.insertScript("prerequisites","charts");this.insertStyle("charts",!0);this.addToolbarButton(l("%charts"),
|
|
"charts");this.helpers.charts={layer:null,createLayer:function(){var c=a.getSelectedTab();this.layer=(new picozu.objects.layer({parent:c,width:c.getWidth(),height:c.getHeight(),left:0,top:0,name:"Chart"})).select();this.layer.setHeap("charts",!0)},prepare:function(){var c=a.getSelectedTab();!0===c.getSelectedLayer().getHeap().charts?this.layer=c.getSelectedLayer():this.createLayer()},getLayer:function(){return this.layer}};picozu.WINDOWS.push({name:l("%charts"),handle:"charts",top:100,left:300,width:370,
|
|
onShow:function(){a.helpers.charts.prepare()},onDestroy:function(){a.doTool(null)},onCreate:function(){function c(c){for(var d="",e=b.getIntValue("#pz-chartsItems"),j=b.getIntValue("#pz-chartsPoints"),k=0;k<e;k++){_color=Color.randomRgb();d+='<fieldset class="clearfix"><input type="text" class="pico-textinput legend" placeholder="legend" />';!0!==b.getBoolValue("#pz-chartsRandom")&&(d+='<div data-color="'+_color.join(",")+'" class="pico-control-colorselect"><span style="background-color: '+Color.color2Exp("rgb",
|
|
_color)+'"></span><b class="caret"></b></div>');for(var m=0;m<j;m++)d+='<input type="text" class="pico-textinput value" placeholder="value" />';d+="</fieldset>";k<e-1&&(d+="<hr />");if(!0!==b.getBoolValue("#pz-chartsRandom"))$(elId).on("click",".pico-control-colorselect",function(){var b=this;a.openWindow("colorpicker",{handle:"colorpicker",name:l("%Color"),left:200,parent:a,top:150,width:320,template:'<div id="charts-dataset-'+k+'-picker" class="pico-color-picker"></div>',onCreate:function(){var a=
|
|
this;a.heap.color=_color;this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);$("#charts-dataset-"+k+"-picker").colorPicker({color:_color,onColorChange:function(b){a.heap.color=b}})},onApply:function(){var a=this.heap.color;$(b).children("span").css({"background-color":Color.color2Exp("rgb",a)});$(b).data("color",a.join(","));this.destroy()}})})}!0===c&&$(".pico-charts-datasets").empty();$(".pico-charts-datasets").append(d)}var b=this;this.getElementId();var d="";this.addElement({type:picozu.CONTROL_IMAGE,
|
|
cssClass:"pz-chartsImage",image:picozu.DEFAULT_PLUGINS_PATH+"charts/Line.png"}).addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_SELECT,legend:l("%Type"),tips:l("%tips.charts.type"),handle:"pz-chartsType",data:picozu.CHART_TYPES}).addElement({type:picozu.CONTROL_HTML,template:'<div class="clearfix"><div class="column1"></div><div class="column2"></div><div class="column3"></div><div class="column4"></div></div>'}).addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%charts.showLabels"),
|
|
tips:l("%tips.charts.labels"),handle:"pz-chartsLabels",checked:!0},".column1").addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%charts.showGrid"),tips:l("%tips.charts.grid"),handle:"pz-chartsGrid",checked:!0},".column1").addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%charts.fill"),tips:l("%tips.charts.fill"),handle:"pz-chartsFill",checked:!0},".column1").addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%charts.stroke"),tips:l("%tips.charts.stroke"),handle:"pz-chartsStroke",checked:!0},".column2").addElement({type:picozu.CONTROL_CHECKBOX,
|
|
legend:l("%charts.dot"),tips:l("%tips.charts.dot"),handle:"pz-chartsDot",checked:!0},".column2").addElement({type:picozu.CONTROL_CHECKBOX,legend:l("%charts.random"),tips:l("%tips.charts.random"),handle:"pz-chartsRandom",callback:function(){c(!0)}},".column2").addElement({type:picozu.CONTROL_SELECT,legend:l("%charts.items"),tips:l("%tips.charts.items"),handle:"pz-chartsItems"},".column3").addElement({type:picozu.CONTROL_SELECT,legend:l("%charts.points"),tips:l("%tips.charts.points"),handle:"pz-chartsPoints"},
|
|
".column4").addElement({type:picozu.CONTROL_SEPARATOR}).addElement({type:picozu.CONTROL_HTML,template:'<div class="pico-charts-datasets"></div>'}).addFooter('<input type="button" class="pico-button ok-btn refresh" value="'+l("%main.apply")+'" /> <input type="button" class="pico-button ok-btn reset" value="'+l("%Reset")+'" /> <input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.cancel")+'" />');$(elId).on("click",".reset",function(){c(!0)});for(var e=1;11>e;e++)d+="<option "+
|
|
(2===e?'selected="selected" ':"")+'value="'+e+'">'+e+"</option>";$(elId+" #pz-chartsItems").append(d);d="";for(e=1;11>e;e++)d+="<option "+(3===e?'selected="selected" ':"")+'value="'+e+'">'+e+"</option>";$(elId+" #pz-chartsPoints").append(d);$(elId).on("change","#pz-chartsType",function(){var a=$(this).val();$(elId+" .pz-chartsImage").attr("src",picozu.DEFAULT_PLUGINS_PATH+"charts/"+a+".png");"StackedBar"===a||"Bar"===a||"Line"===a||"Radar"===a?$("#pz-chartsPoints").val(3).attr("disabled",!1):$("#pz-chartsPoints").val(1).attr("disabled",
|
|
"disabled");c(!0)}).on("change","#pz-chartsItems, #pz-chartsPoints",function(){c(!0)}).on("click",".refresh",function(){a.helpers.charts.prepare();var c=[],d=b.getStrValue("#pz-chartsType"),e={};if("StackedBar"===d||"Bar"===d||"Line"===d||"Radar"===d){var j={},k=[];$(".pico-charts-datasets input.legend").each(function(){var a=[],d=$(this),e=d.parent().children("input.value"),g=null;c.push($(this).val());$(e).each(function(){a.push(parseInt($(this).val()))});g=!0===b.getBoolValue("#pz-chartsRandom")?
|
|
Color.randomRgb():$.map(d.parent().children(".pico-control-colorselect").data("color").split(","),function(a){return parseInt(a,10)});k.push({fillColor:Color.color2Exp("rgba",Color.rgb2rgba(g,0.4)),strokeColor:Color.color2Exp("rgba",Color.rgb2rgba(g,1)),pointColor:Color.color2Exp("rgba",Color.rgb2rgba(g,1)),pointStrokeColor:"#fff",data:a})});j={labels:c,datasets:k}}else j=[],$(".pico-charts-datasets input.legend").each(function(){var a=$(this);a.parent().children("input.value");var c=null;!0===b.getBoolValue("#pz-chartsRandom")?
|
|
c=Color.random():(c=$.map(a.parent().children(".pico-control-colorselect").data("color").split(","),function(a){return parseInt(a,10)}),c="#"+Color.rgb2hex(c));j.push({color:c,value:parseInt(a.parent().children("input.value").val())})});e={scaleShowGridLines:b.getBoolValue("#pz-chartsGrid"),scaleShowLabels:b.getBoolValue("#pz-chartsLabels"),datasetFill:b.getBoolValue("#pz-chartsFill"),pointDot:b.getBoolValue("#pz-chartsDot"),datasetStroke:b.getBoolValue("#pz-chartsStroke"),segmentStrokeWidth:4};(new Chart(a.helpers.charts.getLayer().getContext()))[d](j,
|
|
e);a._refreshAll()});c(!0)}})}};
|
|
String.toLocale({"en-US":{"%charts":"Charts","%Bar":"Bar","%Stacked Bar":"Stacked Bar","%Pie":"Pie","%Polar Area":"Polar Area","%Doughnut":"Doughnut","%Radar":"Radar","%tips.charts.type":"Type of the generated chart.","%charts.font":"Font","%tips.charts.font":"Font type used for the labels. Not available for all types of charts.","%charts.random":"Random colors","%tips.charts.random":"Enable dataset color selection or draw the datasets using random colors.","%charts.showLabels":"Show labels","%tips.charts.labels":"Toggle showing of labels. Not available for all types of charts.",
|
|
"%charts.showGrid":"Show grid","%tips.charts.grid":"Toggle showing of grid lines across the chart. Not available for all types of charts.","%charts.adddataset":"Add dataset","%charts.fill":"Fill datasets","%tips.charts.fill":"Fill the dataset with the specified color. Not available for all types of charts.","%charts.stroke":"Stroke datasets","%tips.charts.stroke":"Stroke the dataset edges with the specified color. Not available for all types of charts.","%charts.dot":"Show dots","%tips.charts.dot":"Show a point for each dataset point. Not available for all types of charts.",
|
|
"%charts.items":"Datasets","%tips.charts.items":"Number of datasets for the chart.","%charts.points":"Points per dataset","%tips.charts.points":"Number of points per each dataset."}});picozu.tools.charts=picozu.objects.tool.extend({__constructor:function(a,c,b){b.saveUndo();b.openWindow("charts")},__destructor:function(){}});
|
|
picozu.CHART_TYPES=[{name:l("%Line"),handle:"Line"},{name:l("%Bar"),handle:"Bar"},{name:l("%Stacked Bar"),handle:"StackedBar"},{name:l("%Radar"),handle:"Radar"},{name:l("%Polar Area"),handle:"PolarArea"},{name:l("%Pie"),handle:"Pie"},{name:l("%Doughnut"),handle:"Doughnut"}];
|
|
picozu.extensions.plugins.youtube={parameters:{title:"Youtube",handle:"youtube",version:"1.1",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"Youtube integration plugin that allows you to browse Youtube content and play it while remaining in editor."},onDisable:function(){this.removeTool("youtubeplayer");this.removeWindow("youtubeplayer")},onEnable:function(){this.addTool(l("%youtubeplayer.title"),"youtubeplayer");this.insertScript("prerequisites","youtube");this.insertStyle("youtube",
|
|
!0);picozu.WINDOWS.push({name:l("%youtubeplayer.title"),handle:"youtubeplayer",left:200,top:100,system:!0,width:660,template:'<div class="ui-front"><input type="text" class="pz-youtubeSearch pico-textinput" /></div><hr /><iframe class="pz-youtubeIframe" width="640" height="390" src="https://www.youtube.com/embed/LithNQVsqa4?loop=1&iv_load_policy=3&modestbranding=1&theme=light&autohide=1" frameborder="0" allowfullscreen></iframe>',onCreate:function(){var a=this.getElementId();$(a).on("focus",".pz-youtubeSearch",
|
|
function(){var a=$(this);a.select();a.mouseup(function(){a.unbind("mouseup");return!1})});$(a+" .pz-youtubeSearch").autocomplete({source:function(a,b){$.ajax({url:"https://gdata.youtube.com/feeds/videos?max-results=10&alt=json-in-script&orderby=relevance&sortorder=descending&format=5&fmt=18",dataType:"jsonp",data:{vq:a.term},success:function(a){b($.map(a.feed.entry,function(a){var b=a.link[0].href,b=b.replace("&feature=youtube_gdata","");return{label:a.title.$t,value:b}}))}})},minLength:4,select:function(c,
|
|
b){var d=b.item.value,d=d.split("=").pop();$(a+" .pz-youtubeIframe").attr("src","https://www.youtube.com/embed/"+d+"?autoplay=1&loop=1&iv_load_policy=3&modestbranding=1&theme=light&autohide=1")}})}})},onAction:function(a,c){a==picozu.ACTION_OPEN_YOUTUBE_PLAYER&&(this.openWindow("youtubeplayer"),$(".pico-window-youtubeplayer .pz-youtubeIframe").attr("src","https://www.youtube.com/embed/"+c+"?autoplay=1&loop=1&iv_load_policy=3&modestbranding=1&theme=light&autohide=1"))}};String.toLocale({"en-US":{"%youtubeplayer.title":"Youtube Player"}});
|
|
picozu.extensions.plugins.twitter={parameters:{title:"Twitter",handle:"twitter",version:"1.2",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"This plugin allows you to tweet and stay up to date with Twitter updates."},onDisable:function(){this.removeTool("twitter");this.removeWindow("twitter")},onEnable:function(){this.addTool(l("%twitter.title"),"twitter");var a=this;this.insertStyle("twitter",!0);this.connectors.twitter={is_auth:!1,relativeTime:function(a){var b=
|
|
a.split(" ");a=b[1]+" "+b[2]+", "+b[5]+" "+b[3];var d=Date.parse(a),b=1<arguments.length?arguments[1]:new Date,d=parseInt((b.getTime()-d)/1E3),d=d+60*b.getTimezoneOffset();return 60>d?"less than a minute ago":120>d?"about a minute ago":3600>d?parseInt(d/60).toString()+" minutes ago":7200>d?"about an hour ago":86400>d?"about "+parseInt(d/3600).toString()+" hours ago":172800>d?"1 day ago":parseInt(d/86400).toString()+" days ago"},signIn:function(){document.location.href=picozu.API_ENTRY_POINT+"api/social/twitter_login/"},
|
|
initialize:function(){var c=this;a.showLoader();a.doRequest(picozu.API_SOCIAL+"twitter_isauth/",null,function(b){a.hideLoader();a.isErrorRequest(b)?(c.logout(),a.notifier.trigger({title:l("%Error"),error:!0,content:b.error})):!0===b.auth?c.login():c.logout()},function(){a.hideLoader();c.logout()},"json")},isAuth:function(){return this.is_auth},setStatus:function(c,b){var d=this;!0===this.isAuth()?(a.showLoader(),!0===b?a.exportData(picozu.FILE_FORMAT_PNG,function(b){a.doRequest(picozu.API_SAVE,"contents="+
|
|
b+"&format=png&title=TwitterUpload&description=&visibility=6",function(b){a.doRequest(picozu.API_SOCIAL+"twitter_post_update/","status="+c+"&image="+b.code,function(b){a.hideLoader();a.isErrorRequest(b)?(self.logout(),a.notifier.trigger({title:l("%Error"),error:!0,content:b.error})):a.notifier.trigger({title:l("%Info"),content:l("%twitter.posted")})},function(){a.hideLoader();d.logout()},"json")},function(){},"json")}):a.doRequest(picozu.API_SOCIAL+"twitter_post_update/","status="+c,function(b){a.hideLoader();
|
|
a.isErrorRequest(b)?(self.logout(),a.notifier.trigger({title:l("%Error"),error:!0,content:b.error})):a.notifier.trigger({title:l("%Info"),content:l("%twitter.posted")})},function(){a.hideLoader();d.logout()},"json")):this.logout()},login:function(){this.is_auth=!0;this.getHomeTimeline();$(".pico-window-twitter .tweet-list").empty();$(".pico-window-twitter .tweet-box").attr("disabled",!1);$(".pico-window-twitter footer").show();$(".pico-twitter-loggedout").hide();$(".pico-twitter-loggedin").show()},
|
|
logout:function(){this.is_auth=!1;$(".pico-window-twitter header .name").html(l("%twitter.title")+" - "+l("%twitter.notauth"));$(".pico-window-twitter .tweet-list").empty();$(".pico-window-twitter .tweet-box").attr("disabled",!0);$(".pico-window-twitter footer").hide();$(".pico-twitter-loggedout").show();$(".pico-twitter-loggedin").hide()},getUserTimeline:function(c){var b=this;$(".pico-window-twitter .tweet-list").empty();!0===this.isAuth()?(a.showLoader(),a.doRequest(picozu.API_SOCIAL+"twitter_user_timeline/",
|
|
"user="+c,function(d){if(a.isErrorRequest(d))b.logout(),a.notifier.trigger({title:l("%Error"),error:!0,content:d.error});else{var e="<ul>";if(0<$(d).length){for(var f=0;f<$(d).length;f++)var g=$(d)[f].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(a){return'<a target="_blank" href="'+a+'">'+a+"</a>"}).replace(/\B@([_a-z0-9]+)/ig,function(a){return a.charAt(0)+'<a data-by="'+a.substring(1)+'" class="by" href="#">'+a.substring(1)+"</a>"}),e=e+("<li>"+g+' - <span class="xsmall">'+
|
|
b.relativeTime($(d)[f].created_at)+"</span></li>");$(".pico-window-twitter .tweet-list").append(e+"</ul>");$(".pico-window-twitter header .name").html(l("%twitter.title")+" - "+c+" "+l("%twitter.timeline"))}else $(".pico-window-twitter .tweet-list").append(l("%twitter.noresults"))}a.hideLoader()},function(){a.hideLoader()},"json")):this.logout()},getHomeTimeline:function(){var c=this;$(".pico-window-twitter .tweet-list").empty();!0===this.isAuth()?(a.showLoader(),a.doRequest(picozu.API_SOCIAL+"twitter_home_timeline/",
|
|
null,function(b){if(a.isErrorRequest(b))a.notifier.trigger({title:l("%Error"),error:!0,content:b.error});else{var d="<ul>";if(0<$(b).length){for(var e=0;e<$(b).length;e++)var f=$(b)[e].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(a){return'<a target="_blank" href="'+a+'">'+a+"</a>"}).replace(/\B@([_a-z0-9]+)/ig,function(a){return a.charAt(0)+'<a data-by="'+a.substring(1)+'" class="by" href="#">'+a.substring(1)+"</a>"}),d=d+("<li>"+f+" <i>"+l("%twitter.by")+
|
|
'</i> <a href="#" data-by="'+$(b)[e].user.screen_name+'" class="by">'+$(b)[e].user.name+'</a> - <span class="xsmall">'+c.relativeTime($(b)[e].created_at)+"</span></li>");$(".pico-window-twitter .tweet-list").append(d+"</ul>");$(".pico-window-twitter header .name").html(l("%twitter.title")+" - "+l("%twitter.yourtimeline"))}else $(".pico-window-twitter .tweet-list").append(l("%twitter.noresults"))}a.hideLoader()},function(){a.hideLoader()},"json"),$(".pico-window-twitter").on("click",".by",function(){var b=
|
|
$(this).data("by");a.connectors.twitter.getUserTimeline(b)})):this.logout()}};picozu.WINDOWS.push({name:l("%twitter.title"),handle:"twitter",left:400,system:!0,top:100,width:393,template:'<div class="pico-twitter-loggedin"><div class="main-tweet-box"><textarea disabled="disabled" class="tweet-box"></textarea><div class="num-chars">140</div><div class="with-media"><input title="Attach current workspace image to the Twitter post." class="twitter-media tips" type="checkbox" /></div></div><div class="tweet-list"></div></div><div class="pico-twitter-loggedout connect"></div>',
|
|
onShow:function(){a.connectors.twitter.initialize()},onCreate:function(){var c=this.getElementId(),b=this,d=140;this.addFooter('<input type="text" class="search pico-textinput" placeholder="'+l("%twitter.search")+'" /> <input type="button" class="pico-button gui-btn cancel-btn reload" value="'+l("%twitter.refresh")+'" /> <input type="button" class="pico-button ok-btn tweet" value="'+l("%twitter.tweet")+'" />');$(c).on("click",".tweet",function(){var d=b.getStrValue(".tweet-box"),f=$(c+" .twitter-media").is(":checked");
|
|
a.connectors.twitter.setStatus(d,f);b.setValue(".tweet-box","");return!1}).on("keyup",".tweet-box",function(){var a=$(this);a.val().length>d?a.val(a.val().substr(0,d)):$(c+" .num-chars").html(d-a.val().length)}).on("click",".connect",function(){a.connectors.twitter.signIn();return!1}).on("click",".twitter-media",function(){d=$(this).is(":checked")?117:140;$(c+" .tweet-box").trigger("keyup")}).on("click",".reload",function(){var c=b.getStrValue(".search");""!=c?(a.connectors.twitter.getUserTimeline(c),
|
|
b.setValue(".search","")):a.connectors.twitter.getHomeTimeline();return!1});$(c+" .tweet-box").focusin(function(){$(this).height(88)}).focusout(function(){$(this).height(18)});setInterval(function(){a.connectors.twitter.getHomeTimeline()},3E5)}})}};
|
|
String.toLocale({"en-US":{"%twitter.search":"search user","%twitter.tweet":"Tweet","%twitter.title":"Twitter","%twitter.posted":"Successfully posted to Twitter.","%twitter.timeline":"Timeline","%twitter.by":"by","%twitter.yourtimeline":"Your Timeline","%twitter.refresh":"Refresh","%twitter.noresults":"There are no results for your query.","%twitter.notauth":"Not logged in"}});
|
|
picozu.extensions.plugins.gdrive={parameters:{title:"Google Drive",handle:"gdrive",version:"1.7",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"This plugin provides a basic integration with Google Drive, allowing you to import your photos from Google Drive and export them back."},onDisable:function(){this.removeImporter("gdriveopen");this.removeExporter("gdrivesave");this.removeWindow(["gdriveopen","gdrivesave"])},onEnable:function(){var a=this;this.addImporter(l("%Google Drive"),
|
|
"gdriveopen");this.addExporter(l("%Google Drive"),"gdrivesave");this.insertScript("https://apis.google.com/js/client.js","","gapi-jssdk");this.insertStyle("gdrive",!0);this.connectors.gdrive={clientId:"421704185582.apps.googleusercontent.com",scopes:"https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file",page:1,results:15,fCnt:".pico-window-gdriveopen .folders, .pico-window-gdrivesave .folders",album:"root",photos:[],token:null,getAll:function(){this.getFolders();this.getFiles()},
|
|
initialize:function(){var a=this;gapi.auth.authorize({client_id:a.clientId,scope:a.scopes,immediate:!0},function(c){c&&!c.error?a._login():a._logout()})},deauthenticate:function(){this._logout();$.ajax({type:"POST",url:"https://accounts.google.com/o/oauth2/revoke?token="+gapi.auth.getToken().access_token,success:function(){},error:function(){}});a.notifier.trigger({title:l("%Info"),content:l("%gdrive.signout")})},getFiles:function(){a.showLoader();var b=this,c="";gapi.client.load("drive","v2",function(){var e=
|
|
[];gapi.client.drive.files.list({q:"'"+b.album+"' in parents and mimeType contains 'image'"}).execute(function(f){e=e.concat(f.items);f=(b.page-1)*b.results;var g=b.results*b.page;if("undefined"!==typeof e&&0<e.length){for(var h=0;h<e.length;h++)c+=b._photoCallback(e[h],!(h>=f&&h<g));a.paginate(Math.ceil(b.photos.length/b.results),b.page,".pico-gdrive-pager")}else c+='<li class="noresults">'+l("%main.noimages")+"</li>";$(".pico-gdrive-list ul.photolist").empty().append(c);a.hideLoader()})})},getFolders:function(){a.showLoader();
|
|
var b="",c=this;gapi.client.load("drive","v2",function(){var e=[];gapi.client.drive.files.list({q:"mimeType = 'application/vnd.google-apps.folder'"}).execute(function(f){e="undefined"!==typeof f.items?e.concat(f.items):[];$(c.fCnt).empty().append('<option value="root">-- '+l("%select album")+" --</option>");if(0<e.length){for(f=0;f<e.length;f++)b+='<option value="'+e[f].id+'">'+e[f].title+"</option>";$(c.fCnt).append(b)}a.hideLoader()})})},authenticate:function(){var a=this;gapi.auth.authorize({client_id:a.clientId,
|
|
scope:a.scopes,immediate:!1},function(c){c&&!c.error?a._login():a._logout()})},upload:function(a,c,e){var f=this;gapi.client.load("drive","v2",function(){f._upload(a,c,e)})},_upload:function(b,c){""===c&&(c="Untitled");b=b.replace("data:image/png;base64,","");var e="\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify({title:c+".png",mimeType:"image/png"})+"\r\n---------314159265358979323846\r\nContent-Type: image/png\r\nContent-Transfer-Encoding: base64\r\n\r\n"+
|
|
b+"\r\n---------314159265358979323846--";gapi.client.request({path:"/upload/drive/v2/files",method:"POST",params:{uploadType:"multipart"},headers:{"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'},body:e}).execute(function(b){a.notifier.trigger({title:l("%Info"),content:l("%gdrive.doneupload")+" "+l("%Click")+' <a target="_blank" href="'+b.alternateLink+'">'+l("%here")+"</a> "+l("%gdrive.account")});$("#pz-gdrivesave-editLink").val(b.alternateLink);$("#pz-gdrivesave-downloadLink").val(b.downloadUrl);
|
|
$("#pz-gdrivesave-shareLink").val(b.webContentLink);$("#pz-gdrivesave-fileSize").val(b.fileSize+" "+l("%bytes"));$(".pz-gdriveInfo").fadeIn();a.hideLoader()})},setAlbum:function(a){this.album=a;return this},_login:function(){this.getAll();$(".pico-window-gdriveopen > footer, .pico-window-gdrivesave > footer").show();$(this.fCnt).empty().append('<option value="root">-- '+l("%select album")+" --</option>");$(".pico-gdrive-loggedout").hide();$(".pico-gdrive-loggedin").show()},_logout:function(){$(".pico-window-gdriveopen > footer, .pico-window-gdrivesave > footer").hide();
|
|
$(this.fCnt).empty().append('<option value="root">-- '+l("%select album")+" --</option>");$(".pico-gdrive-loggedout").show();$(".pico-gdrive-loggedin").hide()},_photoCallback:function(a,c){var e="";c||(e='<li><a href="'+a.downloadUrl+'"><img class="tips" title="'+a.title+'" src="'+a.thumbnailLink+'" alt="" /></a></li>');return e}};var c=this.connectors.gdrive;picozu.WINDOWS.push({name:l("%gdrive.import"),handle:"gdriveopen",center:!0,width:545,template:'<div class="pico-gdrive-loggedin"><fieldset><label>'+
|
|
l("%Album")+'</label><select class="pico-select folders"></select></fieldset><hr /><div class="pico-gdrive-list photolist clearfix"><ul class="photolist"><li class="noresults">'+l("%main.noimages")+'</li></ul></div><ul class="pico-gdrive-pager pagination"></ul></div><div class="pico-gdrive-loggedout connect"></div>',onShow:function(){c.initialize()},onCreate:function(){var b=this,d=this.getElementId();this.addFooter(picozu.CONNECTOR_OPEN_WINDOW_FOOTER);$(d).on("click",".reload",function(){c.getAll();
|
|
return!1}).on("change",".folders",function(){var a=$(this).val();""!=a&&c.setAlbum(a).getFiles()}).on("click",".logout",function(){c.deauthenticate();b.hide();return!1}).on("click",".connect",function(){c.authenticate();return!1}).on("click",".photolist ul li a",function(){var c=$(this).attr("href");a.parseImageFile(c,!0,gapi.auth.getToken().access_token);b.hide();return!1}).on("click",".pagination a",function(){$(this).parent("li").hasClass("next")?c.getFiles("next"):$(this).parent("li").hasClass("prev")?
|
|
c.getFiles("prev"):c.getFiles(parseInt($(this).text()));return!1})}});picozu.WINDOWS.push({name:l("%gdrive.export"),handle:"gdrivesave",center:!0,width:545,onShow:function(){c.initialize()},onCreate:function(){var b=this,d=this.getElementId();this.addElement({type:picozu.CONTROL_HTML,template:'<div class="pico-gdrive-loggedin"></div><div class="pico-gdrive-loggedout connect"></div>'}).addElement({type:picozu.CONTROL_TEXTINPUT_FILE,legend:l("%main.filename"),placeholder:"enter a file name",extension:"png",
|
|
handle:"pz-gdrivesave-filename",cssClass:"filename",legendClass:"legend"},".pico-gdrive-loggedin").addElement({type:picozu.CONTROL_HTML,template:'<fieldset class="pz-gdriveInfo"><legend>File information</legend></fieldset>'},".pico-gdrive-loggedin").addElement({type:picozu.CONTROL_TEXTINPUT,legend:l("%gdrive.editlink"),handle:"pz-gdrivesave-editLink",value:"",readonly:!0,autoselect:!0,tips:l("%tips.gdrive.editlink"),legendClass:"legend"},".pz-gdriveInfo").addElement({type:picozu.CONTROL_TEXTINPUT,
|
|
legend:l("%gdrive.downloadlink"),handle:"pz-gdrivesave-downloadLink",value:"",readonly:!0,autoselect:!0,tips:l("%tips.gdrive.downloadlink"),legendClass:"legend"},".pz-gdriveInfo").addElement({type:picozu.CONTROL_TEXTINPUT,legend:l("%gdrive.sharelink"),handle:"pz-gdrivesave-shareLink",value:"",readonly:!0,autoselect:!0,tips:l("%tips.gdrive.sharelink"),legendClass:"legend"},".pz-gdriveInfo").addElement({type:picozu.CONTROL_TEXTINPUT,legend:l("%gdrive.filesize"),handle:"pz-gdrivesave-fileSize",value:"",
|
|
readonly:!0,legendClass:"legend"},".pz-gdriveInfo").addFooter(picozu.CONNECTOR_SAVE_WINDOW_FOOTER);$(d).on("click",".save",function(){$(".pz-gdriveInfo").fadeOut();a.getSelectedTab()._refreshPreview();a.exportData(picozu.FILE_FORMAT_PNG,function(d){!0===a.isOnline()?(a.showLoader(),c.upload(d,b.getStrValue(".filename")),b.setValue(".filename","")):(a.hideLoader(),a.notify(l("%main.offline"),!0))},$("form.expSettings").serializeArray());return!1}).on("click",".connect",function(){c.authenticate();
|
|
return!1}).on("click",".logout",function(){c.deauthenticate();b.hide();return!1})}})}};
|
|
String.toLocale({"en-US":{"%gdrive.errorupload":"Error uploading your image to Google Drive.","%gdrive.doneupload":"Image uploaded successfully to Google Drive.","%gdrive.signout":"Successfully signed out from Google Drive.","%Google Drive":"Google Drive","%gdrive.import":"Import from Google Drive","%gdrive.export":"Export to Google Drive","%gdrive.account":"to view it in your Google Drive account.","%gdrive.downloadlink":"Download link","%gdrive.editlink":"Edit link","%gdrive.sharelink":"Share link",
|
|
"%tips.gdrive.downloadlink":"Use this link to download the file directy.","%tips.gdrive.sharelink":"Use this link to share the file with your friends.","%tips.gdrive.editlink":"Use this link to edit the file.","%gdrive.filesize":"File size"}});
|
|
picozu.extensions.plugins.memes={parameters:{title:"Meme Designer",handle:"memes",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",description:"The plugin offers the possibility to design your own memes in just few easy steps. You can choose from various types of memes and share your creations directly to 9GAG."},onDisable:function(){this.removeTool("memes");this.removeWindow("memes");this.helpers.memes=null},onEnable:function(){this.addTool(l("%memes.title"),"memes");var a=this;this.insertStyle("memes",
|
|
!0);this.helpers.memes={done:!1,imageLayer:null,newTab:null,topLayer:null,bottomLayer:null,topFontSize:42,bottomFontSize:42,width:400,height:400,prepare:function(){a.showLoader();this.newTab=a.newTab({width:400,height:400,name:"meme designer"}).activate();this.newTab.heap.memes=!0;this.topLayer=new picozu.objects.layer({type:picozu.LAYER_TYPE_TEXT,parent:this.newTab,width:400,height:42,left:10,parameters:{fontColor:[0,0,0],fillColor:[255,255,255],fontFamily:"Impact",fontCase:picozu.FONT_CASE_UPPERCASE,
|
|
fontAlign:"center",fontSize:42,drawMode:picozu.DRAW_MODE_BOTH},text:l("%Top Text"),name:"Top Meme Text",top:10});this.bottomLayer=new picozu.objects.layer({type:picozu.LAYER_TYPE_TEXT,parent:this.newTab,width:400,height:42,text:l("%Bottom Text"),left:10,name:"Bottom Meme Text",top:340,parameters:{fontColor:[0,0,0],fillColor:[255,255,255],fontFamily:"Impact",fontCase:picozu.FONT_CASE_UPPERCASE,fontAlign:"center",fontSize:42,drawMode:picozu.DRAW_MODE_BOTH}});a.addDefaultWatermark().hideLoader()},load:function(c){a.showLoader();
|
|
var b=this,d=new Image;d.onload=function(){b.newTab.resize(d.width,d.height,!0);b.newTab.layers[1].resize(d.width,d.height).drawImage(d,d.width,d.height);b.width=d.width;b.height=d.height;b.bottomLayer.move(0,d.height-10-b.bottomLayer.getHeight());a._refreshAll();b.refresh();a.hideLoader()};d.onerror=function(){a.notify(l("%main.image.notloaded"),!0)};d.src=c},refresh:function(){var a=$("#meme-gen-toptext").val(),b=$("#meme-gen-bottext").val();this.topLayer.setText(a).setWidth(this.width).drawText();
|
|
this.bottomLayer.setWidth(this.width).setText(b).drawText();this.bottomLayer.move(0,this.height-10-this.bottomLayer.getHeight())},adjustTopFont:function(a){10<=this.topFontSize&&100>=this.topFontSize&&(this.topFontSize=!0===a?this.topFontSize-2:this.topFontSize+2,this.topLayer.setParameter("fontSize",this.topFontSize).setHeight(this.topFontSize+10).drawText(),this.refresh())},adjustBottomFont:function(a){10<=this.bottomFontSize&&100>=this.bottomFontSize&&(this.bottomFontSize=!0===a?this.bottomFontSize-
|
|
2:this.bottomFontSize+2,this.bottomLayer.setParameter("fontSize",this.bottomFontSize).setHeight(this.bottomFontSize+10).drawText(),this.refresh())}};picozu.WINDOWS.push({name:l("%memes.title"),handle:"memes",center:!0,width:500,template:'<div class="images-list"><ul></ul></div><hr /><fieldset><textarea placeholder="top text" class="pico-textarea" id="meme-gen-toptext">'+l("%Top Text")+'</textarea><div id="meme-inc-toptext" class="pico-button gui-btn tips down" title="'+l("%Decrease Font Size")+'">-</div><div id="meme-dec-toptext" class="pico-button gui-btn tips up" title="'+
|
|
l("%Increase Font Size")+'">+</div></fieldset><hr /><fieldset><textarea placeholder="bottom text" class="pico-textarea" id="meme-gen-bottext">'+l("%Bottom Text")+'</textarea><div id="meme-inc-bottext" class="pico-button gui-btn tips down" title="'+l("%Decrease Font Size")+'">-</div><div id="meme-dec-bottext" class="pico-button gui-btn tips up" title="'+l("%Increase Font Size")+'">+</div></fieldset>',onShow:function(){a.helpers.memes.load(picozu.DEFAULT_PLUGINS_PATH+"memes/templates/0.jpg")},onCreate:function(){var c=
|
|
this.getElementId();this.addFooter('<input type="button" class="pico-button ok-btn accept-button" value="'+l("%main.ok")+'" /> <input type="button" class="pico-button ok-btn upload" value="'+l("%share.9gag")+'" /> <input type="button" class="pico-button gui-btn cancel-button" value="'+l("%main.cancel")+'" />');!1===a.helpers.memes.done&&"undefined"===typeof a.getSelectedTab().heap.memes&&a.helpers.memes.prepare();for(var b=0;b<picozu.MEME_TEMPLATES.length;b++)$(c+" .images-list > ul").append('<li><a style="background: #fff url('+
|
|
picozu.DEFAULT_PLUGINS_PATH+"memes/templates/"+b+'_tb.jpg) no-repeat center center" class="item" data-id="'+b+'" href="#"><span>'+picozu.MEME_TEMPLATES[b].name+"</span></a></li>");$(c+" .images-list > ul").width(114*picozu.MEME_TEMPLATES.length);$(c).on("click",".images-list ul li a",function(){var b=$(this).data("id");null!==picozu.MEME_TEMPLATES[b].topText?$("#meme-gen-toptext").val(picozu.MEME_TEMPLATES[b].topText):$("#meme-gen-toptext").val(l("%Top Text"));null!==picozu.MEME_TEMPLATES[b].bottomText?
|
|
$("#meme-gen-bottext").val(picozu.MEME_TEMPLATES[b].bottomText):$("#meme-gen-bottext").val(l("%Bottom Text"));a.helpers.memes.load(picozu.DEFAULT_PLUGINS_PATH+"memes/templates/"+b+".jpg");return!1}).on("keyup.picozu","textarea",function(){a.helpers.memes.refresh()}).on("click","#meme-inc-toptext",function(){a.helpers.memes.adjustTopFont(!0)}).on("click","#meme-dec-toptext",function(){a.helpers.memes.adjustTopFont(!1)}).on("click","#meme-inc-bottext",function(){a.helpers.memes.adjustBottomFont(!0)}).on("click",
|
|
"#meme-dec-bottext",function(){a.helpers.memes.adjustBottomFont(!1)}).on("click",".upload",function(){a.exportData(picozu.FILE_FORMAT_PNG,function(b,c){$.ajax({type:picozu.API_METHOD,data:"key="+picozu.API_KEY+"&contents="+b+"&format="+c,dataType:"json",async:!1,url:picozu.API_CONVERT,success:function(b){window.open("http://9gag.com/submit?url="+encodeURIComponent(picozu.API_ENTRY_POINT+"v/"+b.dir+b.code+"."+b.format)+"&title=test.+test","_blank");a.hideLoader()}})})})}})}};
|
|
String.toLocale({"en-US":{"%memes.title":"Meme Designer","%Top Text":"Top Text","%Bottom Text":"Bottom Text","%Decrease Font Size":"Decrease Font Size","%Increase Font Size":"Increase Font Size","%share.9gag":"Share to 9GAG"}});
|
|
picozu.MEME_TEMPLATES=[{name:"Forever Alone",topText:null,bottomText:null},{name:"Stoner Stanley",topText:null,bottomText:null},{name:"Philosocraptor",topText:null,bottomText:null},{name:"Most Interesting",topText:"I don't always",bottomText:"but when I do,"},{name:"Brace Yourself",topText:null,bottomText:null},{name:"Asian Father",topText:null,bottomText:null},{name:"Imagination",topText:null,bottomText:null},{name:"First World",topText:null,bottomText:null},{name:"Buzz and Woody",topText:null,bottomText:null},
|
|
{name:"Ancient Aliens",topText:null,bottomText:null},{name:"College Freshman",topText:null,bottomText:null},{name:"Awkward Penguin",topText:null,bottomText:null},{name:"Condescending",topText:null,bottomText:null},{name:"I Will Find You",topText:null,bottomText:null},{name:"Annoyed Picard",topText:"Why the fuck",bottomText:null},{name:"One does not",topText:null,bottomText:null},{name:"Business Cat",topText:null,bottomText:null},{name:"Bad Luck Brian",topText:null,bottomText:null},{name:"Conspiracy Keanu",
|
|
topText:null,bottomText:null},{name:"Grumpy Cat",topText:null,bottomText:null},{name:"Evil Toddler",topText:null,bottomText:null},{name:"Suspicious Fry",topText:"Not sure if",bottomText:"or"},{name:"Good Guy Greg",topText:null,bottomText:null},{name:"Grumpy Cat",topText:null,bottomText:null},{name:"Overly Attached",topText:null,bottomText:null},{name:"Facepalm Picard",topText:null,bottomText:null},{name:"Scumbag Steve",topText:null,bottomText:null},{name:"Awesome",topText:null,bottomText:null},{name:"Success Kid",
|
|
topText:null,bottomText:null},{name:"Y U NO",topText:null,bottomText:"Y U NO"},{name:"Pedo Bear",topText:null,bottomText:null}];
|
|
picozu.extensions.plugins.socl={parameters:{title:"So.cl",handle:"socl",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"This plugin allows you to share your images on So.cl."},onDisable:function(){this.removeExporter("soclsave");this.removeWindow(["soclsave"])},onEnable:function(){this.addExporter(l("%So.cl"),"soclsave");var a=this;this.insertStyle("socl",!0);picozu.WINDOWS.push({name:l("%Export to So.cl"),handle:"soclsave",center:!0,width:545,template:'<div class="pico-socl-loggedout connect"></div>',
|
|
onCreate:function(){var c=this,b=this.getElementId();$(b).on("click",".connect",function(){a.exportData(picozu.FILE_FORMAT_PNG,function(b,e){a.doRequest(picozu.API_CONVERT,"contents="+b+"&format="+e,function(b){window.open("http://www.so.cl/#/postbuilder?v=results&bk=2.0&q="+encodeURIComponent(picozu.API_ENTRY_POINT+"v/"+b.dir+b.code+"."+b.format),"_blank");a.hideLoader();c.hide()},null,"json",!0,!1)});return!1})}})}};String.toLocale({"en-US":{"%So.cl":"So.cl","%Export to So.cl":"Export to So.cl"}});
|
|
picozu.extensions.plugins.notes={parameters:{title:"Notes",handle:"notes",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",requires:["internet","account"],description:"Notes plugin. Notes can be saved in the Picozu Cloud or attached to a workspace and saved with it."},onDisable:function(){this.removeDockbarPanel("notes");this.removeWindow(["notescreate","notesdisplay"])},onEnable:function(){var a=this;this.insertStyle("notes",!0);this.heap.notes=[];this.helpers.notes={notes:[],selectedId:null,
|
|
selectedIid:null,getSelected:function(){return{id:this.selectedId,iid:this.selectedIid}},setSelected:function(a,b){this.selectedId=a;this.selectedIid=b},get:function(a){return this.notes[a]},refreshPanel:function(){var c=this;$("ul.notes-items-list").empty().append('<li class="noitems">'+l("%notes.none")+"</li>");a.doRequest(picozu.API_NOTES_LIST,null,function(b){if("error"!==b.status){if(0<b.notes.length){c.notes=b.notes;for(var d="",e=0;e<b.notes.length;e++)d+='<li data-id="'+e+'" data-internal-id="'+
|
|
b.notes[e].id+'">'+b.notes[e].title+"</li>";$("ul.notes-items-list").empty().append(d)}}else a.notifier.trigger({title:l("%Error"),error:!0,content:b.error})},function(){a.notifier.trigger({title:l("%Error"),error:!0,content:l("%notes.refresherror")})},"json")}};this.getMainDockbar().addPanel({name:l("%notes.title"),handle:"notes",template:'<ul class="notes-items-list"></ul><hr /><nav class="notes-toolbar"><span title="'+l("%notes.view")+'" class="tips view"></span><span title="'+l("%notes.new")+
|
|
'" class="tips new"></span><span title="'+l("%notes.attach")+'" class="tips attach"></span><span title="'+l("%notes.refresh")+'" class="tips refresh"></span><span title="'+l("%notes.delete")+'" class="tipse delete"></span></nav>',onCreate:function(){a.helpers.notes.refreshPanel();$(".pico-panel-notes").on("click",".new",function(){a.openWindow("notescreate");return!1}).on("click",".refresh",function(){a.helpers.notes.refreshPanel();return!1}).on("click",".view",function(){var c=a.helpers.notes.getSelected().id;
|
|
if(null!==c){var b=a.helpers.notes.get(c);a.removeWindow("notesdisplay");a.openWindow("notesdisplay",{name:b.title,handle:"notesdisplay",center:!0,width:300,template:'<input maxlength="32" type="text" class="note-title" /><textarea class="note-description"></textarea>',onCreate:function(){var a=this.getElementId();this.addFooter(picozu.DEFAULT_WINDOW_FOOTER);$(a+" .note-description").val(b.note);$(a+" .note-title").val(b.title)},onApply:function(){var c=b.id,e=this.getStrValue(".note-title"),f=this.getStrValue(".note-description");
|
|
a.doRequest(picozu.API_NOTES_UPDATE,"title="+e+"¬e="+f+"&id="+c,function(){a.notifier.trigger({title:l("%Info"),content:l("%notes.updatedsuccess")});a.helpers.notes.refreshPanel()},function(){a.notifier.trigger({title:l("%Error"),error:!0,content:l("%notes.updatederror")})},"json")}})}else a.notifier.trigger({title:l("%Error"),error:!0,content:l("%notes.selecterror")});return!1}).on("click","ul.notes-items-list li",function(){$(this).hasClass("noitems")||($("ul.notes-items-list li").removeClass("selected"),
|
|
$(this).addClass("selected"),a.helpers.notes.setSelected($(this).data("id"),$(this).data("internal-id")));return!1}).on("dblclick","ul.notes-items-list li",function(){$("ul.notes-items-list li").removeClass("selected");$(this).addClass("selected");a.helpers.notes.setSelected($(this).data("id"),$(this).data("internal-id"));$(".pico-panel-notes .view").trigger("click");return!1}).on("click",".delete",function(){var c=a.helpers.notes.getSelected(),b=c.iid;null!==c.id?a.doRequest(picozu.API_NOTES_DELETE,
|
|
"id="+b,function(){a.notifier.trigger({title:l("%Info"),content:l("%notes.deletedsuccess")});a.removeWindow("notesdisplay");a.helpers.notes.refreshPanel()},function(){a.notifier.trigger({title:l("%Error"),error:!0,content:l("%notes.deletederror")})},"json"):a.notifier.trigger({title:l("%Error"),error:!0,content:l("%notes.selecterror")});return!1}).on("click",".attach",function(){null===a.helpers.notes.getSelected().id&&a.notifier.trigger({title:l("%Error"),error:!0,content:l("%notes.selecterror")});
|
|
return!1})}});picozu.WINDOWS.push({name:l("%notes.create"),handle:"notescreate",center:!0,width:300,template:'<input maxlength="32" type="text" class="note-title" /><textarea class="note-description"></textarea>',onCreate:function(){this.getElementId();this.addFooter(picozu.DEFAULT_WINDOW_FOOTER)},onApply:function(){var c=this.getStrValue(".note-title"),b=this.getStrValue(".note-description");a.doRequest(picozu.API_NOTES_CREATE,"title="+c+"¬e="+b,function(b){"error"!==b.status?(a.notifier.trigger({title:l("%Info"),
|
|
content:l("%notes.createdsuccess")}),a.helpers.notes.refreshPanel()):a.notifier.trigger({title:l("%Error"),error:!0,content:b.error})},function(){a.notifier.trigger({title:l("%Error"),error:!0,content:l("%notes.createderror")})},"json")}})}};
|
|
String.toLocale({"en-US":{"%notes.title":"Notes","%notes.create":"Create a new note","%notes.new":"Create a new note.","%notes.view":"View/Edit the selected note.","%notes.delete":"Delete the selected note.","%notes.attach":"Attach the selected note to the current workspace.","%notes.refresh":"Refresh the notes list.","%notes.none":"No notes yet.","%notes.createdsuccess":"Note created successfully.","%notes.updatedsuccess":"Note updated successfully.","%notes.deletedsuccess":"Note deleted successfully.",
|
|
"%notes.refresherror":"Error refreshing the notes list.","%notes.createderror":"Error creating the note.","%notes.updatederror":"Error updating the note.","%notes.deletederror":"Error deleting the note.","%notes.selecterror":"You need to select a note first by clicking on it."}});picozu.API_NOTES_CREATE=picozu.API_ENTRY_POINT+"api/notes/create/";picozu.API_NOTES_LIST=picozu.API_ENTRY_POINT+"api/notes/all/";picozu.API_NOTES_DELETE=picozu.API_ENTRY_POINT+"api/notes/delete/";
|
|
picozu.API_NOTES_UPDATE=picozu.API_ENTRY_POINT+"api/notes/update/";
|
|
picozu.extensions.plugins.support={parameters:{title:"Support",handle:"support",version:"1.0",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"Support plugin enables you to open and check support tickets from the safety of your favorite editor."},onDisable:function(){this.removeDockbarPanel("support");this.removeWindow(["support"])},onEnable:function(){var a=this;this.insertStyle("support",!0);this.getMainDockbar().addPanel({name:l("%support.title"),handle:"support",
|
|
template:'<a class="pico-button ok-btn open-support" href="#">Open Support Tickets</a>',onCreate:function(){$(".pico-panel-support").on("click",".open-support",function(){a.openWindow("support");return!1})}});this.helpers.support={page:1,results:10,_ticketCallback:function(a,b){var d="",e="";b||(e=1==a.priority?l("%Critical")+" "+l("%Priority"):2==a.priority?l("%High")+" "+l("%Priority"):3==a.priority?l("%Medium")+" "+l("%Priority"):4==a.priority?l("%Low")+" "+l("%Priority"):l("%Notice"),d='<li class="ticket clearfix" data-tid="'+
|
|
a.id+'"><span class="title">'+a.subject+'</span> <span title="'+e+'" class="tips priority prio_'+a.priority+'"></span> <span title="'+(null!==a.user_assigned?l("%Assigned to")+" "+a.user_assigned:l("%support.notassigned"))+'" class="tips assign'+(null!==a.user_assigned?"ed":"")+'"></span> <span class="type">'+a.type+'</span> <span class="date">'+a.date+'</span></li><li class="info ticket-id-'+a.id+'"><p>'+a.description+"</p></li>");return d},create:function(c,b,d,e,f){""!==c&&""!==b?(a.showLoader(),
|
|
a.doRequest(picozu.API_SUPPORT_CREATE,"subject="+c+"&description="+b+"&priority="+d+"&public="+e+"&type="+f,function(){$(".pico-window-support .subject").val("");$(".pico-window-support .description").val("");$(".pico-window-support .priority").val("");$(".pico-window-support .public").val("");$(".pico-window-support .type").val("");$(".pico-window-support .reload-all, .pico-window-support .reload-my").trigger("click");a.notify(l("%support.create.success"));a.hideLoader()},function(){a.notify(l("%support.create.error"),
|
|
!0);a.hideLoader()},"json")):a.notify(l("%support.errorempty"),!0)},refresh:function(c,b){$(".pico-window-support ul."+c+".ticketlist").empty();var d="",e="undefined"!==typeof b&&b.issues?b.issues.length:0,f=(this.page-1)*this.results,g=this.results*this.page;if(0<e)for(var h=0;h<e;h++)d+=this._ticketCallback(b.issues[h],!(h>=f&&h<g));else d+='<li class="noresults">'+l("%main."+c+".notickets")+"</li>";a.paginate(Math.ceil(e/this.results),this.page,".pico-tickets-pager."+c);$(".pico-window-support ul."+
|
|
c+".ticketlist").append(d);a.hideLoader()},getAll:function(c,b){var d=this;"prev"===b?this.page--:"next"===b?this.page++:this.page="undefined"===typeof b?1:b;url="my"===c?picozu.API_SUPPORT_MY:picozu.API_SUPPORT_BROWSE;a.showLoader();a.doRequest(url,null,function(a){d.refresh(c,a)},function(){a.notify(l("%support.load.error"),!0);a.hideLoader()},"json")}};picozu.WINDOWS.push({name:l("%support.wintitle"),handle:"support",center:!0,width:600,template:'<div class="tabs"><ul><li><a href="#supptabs-open">'+
|
|
l("%Open Ticket")+'</a></li><li><a href="#supptabs-my">'+l("%My Tickets")+'</a></li><li><a href="#supptabs-all">'+l("%Browse Public Tickets")+'</a></li></ul><div id="supptabs-open" class="clearfix"><fieldset><label>'+l("%Subject")+' <span class="pico-help tips" title="'+l("%tips.support.subject")+'">?</span></label><input class="subject pico-textinput" type="text" placeholder="'+l("%enter ticket subject")+'" /></fieldset><fieldset><label>'+l("%Description")+' <span class="pico-help tips" title="'+
|
|
l("%tips.support.description")+'">?</span></label><textarea class="description pico-textinput" placeholder="'+l("%enter ticket description")+'"></textarea></fieldset><fieldset><label>'+l("%Public")+' <span class="pico-help tips" title="'+l("%tips.support.public")+'">?</span></label><select class="public pico-select"><option value="1">'+l("%Yes")+'</option><option value="0">'+l("%No")+"</option></select></fieldset><fieldset><label>"+l("%Type")+' <span class="pico-help tips" title="'+l("%tips.support.type")+
|
|
'">?</span></label><select class="type pico-select"><option value="Bug">'+l("%Bug / Error")+'</option><option value="Improvement">'+l("%Improvement")+'</option><option value="New feature">'+l("%New feature")+"</option></select></fieldset><fieldset><label>"+l("%Priority")+' <span class="pico-help tips" title="'+l("%tips.support.priority")+'">?</span></label><select class="priority pico-select"><option value="1">'+l("%Critical")+'</option><option value="2">'+l("%High")+'</option><option selected="selected" value="3">'+
|
|
l("%Medium")+'</option><option value="4">'+l("%Low")+'</option><option value="5">'+l("%Notice")+'</option></select></fieldset><hr /><input type="button" class="pico-button ok-btn create" value="'+l("%main.create")+'" /></div><div id="supptabs-my" class="clearfix"><ul class="my ticketlist"><li class="noresults">'+l("%main.my.notickets")+'</li></ul><ul class="my pico-tickets-pager pagination"></ul><hr /><input type="button" class="pico-button ok-btn reload-my" value="'+l("%main.reload")+'" /></div><div id="supptabs-all" class="clearfix"><ul class="all ticketlist"><li class="noresults">'+
|
|
l("%main.all.notickets")+'</li></ul><ul class="all pico-tickets-pager pagination"></ul><hr /><input type="button" class="pico-button ok-btn reload-all" value="'+l("%main.reload")+'" /></div></div>',onCreate:function(){var c=this,b=this.getElementId();$(b+" .tabs").tabs();$(b).on("click",".ticketlist.my li.ticket",function(){var a=$(this);a.hasClass("noresults")||(a=a.data("tid"),$("ul.my li.info").hide(),$("ul.my li.ticket-id-"+a).fadeIn());return!1}).on("click",".ticketlist.all li.ticket",function(){var a=
|
|
$(this);a.hasClass("noresults")||(a=a.data("tid"),$("ul.all li.info").hide(),$("ul.all li.ticket-id-"+a).fadeIn());return!1}).on("click",".create",function(){a.helpers.support.create(c.getValue(".subject"),c.getValue(".description"),c.getValue(".priority"),c.getValue(".public"),c.getValue(".type"));return!1}).on("click",".reload-all",function(){a.helpers.support.getAll("all");return!1}).on("click",".reload-my",function(){a.helpers.support.getAll("my");return!1}).on("click",".pagination a",function(){var b=
|
|
$(this).parent("li").parent("ul").hasClass("my")?"my":"all";$(this).parent("li").hasClass("next")?a.helpers.support.getAll(b,"next"):$(this).parent("li").hasClass("prev")?a.helpers.support.getAll(b,"prev"):a.helpers.support.getAll(b,parseInt($(this).text()));return!1});$(b+" .reload-all, "+b+" .reload-my").trigger("click")}})}};
|
|
String.toLocale({"en-US":{"%support.title":"Support","%support.wintitle":"Support Tickets","%tips.support.subject":"Keep the subject of the ticket as simple as possible, 3-6 words at most.","%tips.support.description":"Please give as much information about the ticket as you can.","%tips.support.priority":"The priority of the ticket, try to be as objective as possible.","%tips.support.type":"Select the type of the ticket.","%tips.support.public":"Whether this ticket will be seen by everybody else. Note: the ticket won't go into the public tickets pool until validated by a community manager.",
|
|
"%support.notassigned":"Not assigned yet","%support.create.success":"Your ticket was created successfully.","%support.create.error":"We encountered an error while saving your ticket. Please try again later.","%support.load.error":"We were unable to load the list of tickets. Please try again later.","%Subject":"Subject","%Priority":"Priority","%Public":"Public","%Bug / Error":"Bug / Error","%Improvement":"Improvement","%New feature":"New feature","%Notice":"Notice","%Low":"Low","%support.errorempty":"Please fill in the required information for the ticket creation.",
|
|
"%Medium":"Medium","%High":"High","%Critical":"Critical","%enter ticket description":"enter ticket description","%enter ticket subject":"enter ticket subject","%main.my.notickets":"You have no opened tickets.","%main.all.notickets":"There are no public tickets you can browse.","%Open Ticket":"Open Ticket","%My Tickets":"My Tickets","%Browse Public Tickets":"Browse Public Tickets"}});picozu.API_SUPPORT_CREATE=picozu.API_ENTRY_POINT+"api/support/create/";
|
|
picozu.API_SUPPORT_BROWSE=picozu.API_ENTRY_POINT+"api/support/all/";picozu.API_SUPPORT_MY=picozu.API_ENTRY_POINT+"api/support/my/";
|
|
picozu.extensions.plugins.collab={parameters:{title:"Collab",handle:"collab",version:"0.1",email:"office@picozu.com",url:"www.picozu.com",requires:["internet"],description:"Collaborative drawing plugin."},onDisable:function(){this.removeDockbarPanel("collab")},onEnable:function(){var a=this;this.insertStyle("collab",!0);this.helpers.collab={createRoom:function(){var c=this;a.doRequest(picozu.API_COLLAB_CREATE_ROOM,"room="+a.account.guid,function(b){a.isErrorRequest(b)?a.error(l("%collab.error")):
|
|
c.getMessages()},function(){a.error(l("%collab.error"))},"json")},getMessages:function(){$(".pico-window-collab .messages ul").empty();a.doRequest(picozu.API_COLLAB_ROOM_MESSAGES,"room="+a.account.guid,function(c){if(a.isErrorRequest(c))a.error(l("%collab.error"));else{if(0<c.messages.length)for(var b=0;b<c.messages.length;b++)$(".pico-window-collab .messages ul").append('<li class="clearfix"><span class="avatar"><img src="'+c.messages[b].avatar+'" /></span><span class="name">'+c.messages[b].nickname+
|
|
'</span><span class="date">'+c.messages[b].date+'</span><div class="message">'+c.messages[b].message+"</div></li>");else $(".pico-window-collab .messages ul").append('<li class="noitems">'+l("%collab.noitems")+"</li>");$(".pico-window-collab .messages").show()}},function(){a.error(l("%collab.error"))},"json")},getUsers:function(){$(".pico-window-collab .sidebar ul").empty().append('<li class="selected">'+a.account.nickname+"</li>");a.doRequest(picozu.API_COLLAB_ROOM_MEMBERS,"room="+a.account.guid,
|
|
function(c){if(a.isErrorRequest(c))a.error(l("%collab.error"));else for(var b=0;b<c.users.length;b++)$(".pico-window-collab .sidebar ul").append("<li>"+c.users[b].nickname+"</li>")},function(){a.error(l("%collab.error"))},"json")},sendMessage:function(c){var b=this;""!==c?a.doRequest(picozu.API_COLLAB_SEND_TO_ROOM,"room="+a.account.guid+"&message="+c,function(c){a.isErrorRequest(c)?a.error(l("%collab.error")):b.getMessages()},function(){a.error(l("%collab.error"))},"json"):a.error(l("%collab.empty.message"));
|
|
$(".pico-window-collab .send-text").val("")}};picozu.WINDOWS.push({name:l("%collab.title"),handle:"collab",width:740,system:!0,center:!0,template:'<div class="sidebar"><ul></ul><div class="toolbar"><a href="#" title="'+l("%collab.invite")+'" class="tips invite"><span> </span></a><a style="display: none" href="#" title="'+l("%collab.unmute")+'" class="tips unmute"><span> </span></a><a href="#" title="'+l("%collab.mute")+'" class="tips mute"><span> </span></a><a href="#" title="'+l("%collab.kick")+
|
|
'" class="tips kick disabled"><span> </span></a><a href="#" title="'+l("%collab.clear")+'" class="tips history"><span> </span></a><a href="#" title="'+l("%collab.settings")+'" class="tips settings"><span> </span></a></div></div><div class="main"><div style="display: none" class="messages"><ul></ul></div><div class="input"><input type="text" class="send-text" placeholder="'+l("%collab.placeholder")+'" /><a class="tips send" title="'+l("%collab.send")+'" href="#"><span> </span></a><a class="tips image" title="'+
|
|
l("%collab.attach")+'" href="#"><span> </span></a></div></div>',onCreate:function(){a.helpers.collab.createRoom();$(".pico-window-collab").on("click",".send",function(){var c=$(".pico-window-collab .send-text").val();a.helpers.collab.sendMessage(c)}).on("keyup.picozu",".send-text",function(c){var b=$(this).val();13===c.keyCode&&a.helpers.collab.sendMessage(b)})},onShow:function(){a.helpers.collab.getUsers();a.helpers.collab.getMessages()}});this.getMainDockbar().addPanel({name:l("%collab.title"),
|
|
handle:"collab",template:'<a class="collab-start ok-btn" href="#">'+l("%collab.start")+"</a>",onCreate:function(){$(".collab-start").on("click",function(){!0!==a.isLoggedIn()?a.notify(l("%main.notloggedin"),!0):a.openWindow("collab");return!1})}})}};picozu.API_COLLAB_SEND_TO_ROOM=picozu.API_ENTRY_POINT+"api/collab/send_to_room/";picozu.API_COLLAB_CREATE_ROOM=picozu.API_ENTRY_POINT+"api/collab/create_room/";picozu.API_COLLAB_ROOM_MESSAGES=picozu.API_ENTRY_POINT+"api/collab/room_messages/";
|
|
picozu.API_COLLAB_ROOM_MEMBERS=picozu.API_ENTRY_POINT+"api/collab/room_members/";
|
|
String.toLocale({"en-US":{"%collab.title":"Collaborative Drawing","%collab.start":"Invite and Start Sharing","%collab.invite":"Invite a new user","%collab.unmute":"Unmute the selected user","%collab.mute":"Mute the selected user","%collab.kick":"Kick the selected user","%collab.clear":"Clear history","%collab.settings":"Change settings","%collab.placeholder":"enter your message here","%collab.send":"Send the message","%collab.attach":"Attach your current image to the message","%collab.error":"Unable to perform the requested action.",
|
|
"%collab.noitems":"You have no messages.","%collab.empty.message":"The message must not be empty."}});
|