From d60a50622dd95b13cc799ccacd3fd87a3f1d863a Mon Sep 17 00:00:00 2001 From: Elso Date: Thu, 23 May 2013 12:56:07 +0200 Subject: [PATCH 1/5] Add a statusbar with word and/or character counter and resize function --- Assets/MooEditable/MooEditable.css | 24 + Assets/MooEditable/Other/resize.png | Bin 0 -> 121 bytes .../MooEditable/MooEditable.UI.Statusbar.html | 57 ++ Demos/assets/mootools-core-1.4.4.js | 526 ++++++++++++ Demos/assets/mootools-more-1.4.0.1.js | 751 ++++++++++++++++++ .../MooEditable/MooEditable.UI.Statusbar.js | 133 ++++ 6 files changed, 1491 insertions(+) create mode 100644 Assets/MooEditable/Other/resize.png create mode 100644 Demos/MooEditable/MooEditable.UI.Statusbar.html create mode 100644 Demos/assets/mootools-core-1.4.4.js create mode 100644 Demos/assets/mootools-more-1.4.0.1.js create mode 100644 Source/MooEditable/MooEditable.UI.Statusbar.js diff --git a/Assets/MooEditable/MooEditable.css b/Assets/MooEditable/MooEditable.css index 0cfe3be..6a1a9de 100644 --- a/Assets/MooEditable/MooEditable.css +++ b/Assets/MooEditable/MooEditable.css @@ -178,4 +178,28 @@ .mooeditable-ui-button-overlay .overlay-content{ padding: 10px; +} + +.mooeditable-ui-statusbar{ + background-color: #eee; + border-top: 1px solid #aaa; + position: relative; +} + +.mooeditable-ui-statusbar-wordcount{ + text-align: right; + padding: 10px; +} + +.mooeditable-ui-statusbar-resize{ + background: transparent url(Other/resize.png) no-repeat 0 0px; + display: inline-block; + clear: both; + bottom: 0; + height: 16px; + margin: 0; + position: absolute; + right: 0; + visibility: visible; + width: 16px; } \ No newline at end of file diff --git a/Assets/MooEditable/Other/resize.png b/Assets/MooEditable/Other/resize.png new file mode 100644 index 0000000000000000000000000000000000000000..3c0492a3f4d828f9c1758881fa6b4e2e0fadabb5 GIT binary patch literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf696VhdLp07OCrD^~_zwiq|BMZQ z;9<}qj-`bfH%@G5blUxKN26e`TQI}s*(K%+ZucJL?Xk#Eds8-9o^J*NLz$dbbjzop RD?qatJYD@<);T3K0RZ6+Djom; literal 0 HcmV?d00001 diff --git a/Demos/MooEditable/MooEditable.UI.Statusbar.html b/Demos/MooEditable/MooEditable.UI.Statusbar.html new file mode 100644 index 0000000..4d95ffd --- /dev/null +++ b/Demos/MooEditable/MooEditable.UI.Statusbar.html @@ -0,0 +1,57 @@ + + + + + MooEditable basic example + + + + + + + + + + + + + + +

MooEditable basic example

+ +
+ + + + + + +
+ +
+ + + diff --git a/Demos/assets/mootools-core-1.4.4.js b/Demos/assets/mootools-core-1.4.4.js new file mode 100644 index 0000000..7eb13c2 --- /dev/null +++ b/Demos/assets/mootools-core-1.4.4.js @@ -0,0 +1,526 @@ +/* +--- +MooTools: the javascript framework + +web build: + - http://mootools.net/core/76bf47062d6c1983d66ce47ad66aa0e0 + +packager build: + - packager build Core/Core Core/Array Core/String Core/Number Core/Function Core/Object Core/Event Core/Browser Core/Class Core/Class.Extras Core/Slick.Parser Core/Slick.Finder Core/Element Core/Element.Style Core/Element.Event Core/Element.Delegation Core/Element.Dimensions Core/Fx Core/Fx.CSS Core/Fx.Tween Core/Fx.Morph Core/Fx.Transitions Core/Request Core/Request.HTML Core/Request.JSON Core/Cookie Core/JSON Core/DOMReady Core/Swiff + +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ + +(function(){this.MooTools={version:"1.4.4",build:"adb02e676407521b516ffa10d2dc6b54237a80f9"};var e=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family(); +}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; +}if("item" in i){return"collection";}}}return typeof i;};var u=this.instanceOf=function(w,i){if(w==null){return false;}var v=w.$constructor||w.constructor; +while(v){if(v===i){return true;}v=v.parent;}if(!w.hasOwnProperty){return false;}return w instanceof i;};var f=this.Function;var r=true;for(var q in {toString:1}){r=null; +}if(r){r=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];}f.prototype.overloadSetter=function(v){var i=this; +return function(x,w){if(x==null){return this;}if(v||typeof x!="string"){for(var y in x){i.call(this,y,x[y]);}if(r){for(var z=r.length;z--;){y=r[z];if(x.hasOwnProperty(y)){i.call(this,y,x[y]); +}}}}else{i.call(this,x,w);}return this;};};f.prototype.overloadGetter=function(v){var i=this;return function(x){var y,w;if(v||typeof x!="string"){y=x;}else{if(arguments.length>1){y=arguments; +}}if(y){w={};for(var z=0;z>>0; +b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d);for(var a=0;a>>0; +b-1:String(this).indexOf(a)>-1;},trim:function(){return String(this).replace(/^\s+|\s+$/g,""); +},clean:function(){return String(this).replace(/\s+/g," ").trim();},camelCase:function(){return String(this).replace(/-\D/g,function(a){return a.charAt(1).toUpperCase(); +});},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(a){return a.toUpperCase(); +});},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this); +},hexToRgb:function(b){var a=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=String(this).match(/\d{1,3}/g); +return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return String(this).replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); +}return(a[c]!=null)?a[c]:"";});}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0); +return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a1?Array.slice(arguments,1):null,d=function(){};var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype; +g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments);return g==e?f:g;};return c;},pass:function(b,c){var a=this; +if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); +},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});delete Function.prototype.bind;Function.implement({create:function(b){var a=this; +b=b||{};return function(d){var c=b.arguments;c=(c!=null)?Array.from(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c);}var e=function(){return a.apply(b.bind||null,c); +};if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return Function.attempt(e);}return e();}; +},bind:function(c,b){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},bindWithEvent:function(c,b){var a=this; +if(b!=null){b=Array.from(b);}return function(d){return a.apply(c,(b==null)?arguments:[d].concat(b));};},run:function(a,b){return this.apply(b,Array.from(a)); +}});if(Object.create==Function.prototype.create){Object.create=null;}var $try=Function.attempt;(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={}; +for(var e=0,b=g.length;e]*>([\s\S]*?)<\/script>/gi,function(r,s){e+=s+"\n"; +return"";});if(p===true){o.exec(e);}else{if(typeOf(p)=="function"){p(e,q);}}return q;});o.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); +this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,p){h[e]=p;});this.Document=k.$constructor=new Type("Document",function(){}); +k.$family=Function.from("document").hide();Document.mirror(function(e,p){k[e]=p;});k.html=k.documentElement;if(!k.head){k.head=k.getElementsByTagName("head")[0]; +}if(k.execCommand){try{k.execCommand("BackgroundImageCache",false,true);}catch(g){}}if(this.attachEvent&&!this.addEventListener){var c=function(){this.detachEvent("onunload",c); +k.head=k.html=k.window=null;};this.attachEvent("onunload",c);}var m=Array.from;try{m(k.html.childNodes);}catch(g){Array.from=function(p){if(typeof p!="string"&&Type.isEnumerable(p)&&typeOf(p)!="array"){var e=p.length,q=new Array(e); +while(e--){q[e]=p[e];}return q;}return m(p);};var l=Array.prototype,n=l.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var p=l[e]; +Array[e]=function(q){return p.apply(Array.from(q),n.call(arguments,1));};});}if(o.Platform.ios){o.Platform.ipod=true;}o.Engine={};var d=function(p,e){o.Engine.name=p; +o.Engine[p+e]=true;o.Engine.version=e;};if(o.ie){o.Engine.trident=true;switch(o.version){case 6:d("trident",4);break;case 7:d("trident",5);break;case 8:d("trident",6); +}}if(o.firefox){o.Engine.gecko=true;if(o.version>=3){d("gecko",19);}else{d("gecko",18);}}if(o.safari||o.chrome){o.Engine.webkit=true;switch(o.version){case 2:d("webkit",419); +break;case 3:d("webkit",420);break;case 4:d("webkit",525);}}if(o.opera){o.Engine.presto=true;if(o.version>=9.6){d("presto",960);}else{if(o.version>=9.5){d("presto",950); +}else{d("presto",925);}}}if(o.name=="unknown"){switch((a.match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":o.Engine.webkit=true;break;case"gecko":o.Engine.gecko=true; +}}this.$exec=o.exec;})();(function(){var b={};var a=this.DOMEvent=new Type("DOMEvent",function(c,g){if(!g){g=window;}c=c||g.event;if(c.$extended){return c; +}this.event=c;this.$extended=true;this.shift=c.shiftKey;this.control=c.ctrlKey;this.alt=c.altKey;this.meta=c.metaKey;var i=this.type=c.type;var h=c.target||c.srcElement; +while(h&&h.nodeType==3){h=h.parentNode;}this.target=document.id(h);if(i.indexOf("key")==0){var d=this.code=(c.which||c.keyCode);this.key=b[d]||Object.keyOf(Event.Keys,d); +if(i=="keydown"){if(d>111&&d<124){this.key="f"+(d-111);}else{if(d>95&&d<106){this.key=d-96;}}}if(this.key==null){this.key=String.fromCharCode(d).toLowerCase(); +}}else{if(i=="click"||i=="dblclick"||i=="contextmenu"||i=="DOMMouseScroll"||i.indexOf("mouse")==0){var j=g.document;j=(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body; +this.page={x:(c.pageX!=null)?c.pageX:c.clientX+j.scrollLeft,y:(c.pageY!=null)?c.pageY:c.clientY+j.scrollTop};this.client={x:(c.pageX!=null)?c.pageX-g.pageXOffset:c.clientX,y:(c.pageY!=null)?c.pageY-g.pageYOffset:c.clientY}; +if(i=="DOMMouseScroll"||i=="mousewheel"){this.wheel=(c.wheelDelta)?c.wheelDelta/120:-(c.detail||0)/3;}this.rightClick=(c.which==3||c.button==2);if(i=="mouseover"||i=="mouseout"){var k=c.relatedTarget||c[(i=="mouseover"?"from":"to")+"Element"]; +while(k&&k.nodeType==3){k=k.parentNode;}this.relatedTarget=document.id(k);}}else{if(i.indexOf("touch")==0||i.indexOf("gesture")==0){this.rotation=c.rotation; +this.scale=c.scale;this.targetTouches=c.targetTouches;this.changedTouches=c.changedTouches;var f=this.touches=c.touches;if(f&&f[0]){var e=f[0];this.page={x:e.pageX,y:e.pageY}; +this.client={x:e.clientX,y:e.clientY};}}}}if(!this.client){this.client={};}if(!this.page){this.page={};}});a.implement({stop:function(){return this.preventDefault().stopPropagation(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});a.defineKey=function(d,c){b[d]=c;return this;};a.defineKeys=a.defineKey.overloadSetter(true);a.defineKeys({"38":"up","40":"down","37":"left","39":"right","27":"esc","32":"space","8":"backspace","9":"tab","46":"delete","13":"enter"}); +})();var Event=DOMEvent;Event.Keys={};Event.Keys=new Hash(Event.Keys);(function(){var a=this.Class=new Type("Class",function(h){if(instanceOf(h,Function)){h={initialize:h}; +}var g=function(){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; +return i;}.extend(this).implement(h);g.$constructor=a;g.prototype.$constructor=g;g.prototype.parent=c;return g;});var c=function(){if(!this.$caller){throw new Error('The method "parent" cannot be called.'); +}var g=this.$caller.$name,h=this.$caller.$owner.parent,i=(h)?h.prototype[g]:null;if(!i){throw new Error('The method "'+g+'" has no parent.');}return i.apply(this,arguments); +};var e=function(g){for(var h in g){var j=g[h];switch(typeOf(j)){case"object":var i=function(){};i.prototype=j;g[h]=e(new i);break;case"array":g[h]=j.clone(); +break;}}return g;};var b=function(g,h,j){if(j.$origin){j=j.$origin;}var i=function(){if(j.$protected&&this.$caller==null){throw new Error('The method "'+h+'" cannot be called.'); +}var l=this.caller,m=this.$caller;this.caller=m;this.$caller=i;var k=j.apply(this,arguments);this.$caller=m;this.caller=l;return k;}.extend({$owner:g,$origin:j,$name:h}); +return i;};var f=function(h,i,g){if(a.Mutators.hasOwnProperty(h)){i=a.Mutators[h].call(this,i);if(i==null){return this;}}if(typeOf(i)=="function"){if(i.$hidden){return this; +}this.prototype[h]=(g)?i:b(this,h,i);}else{Object.merge(this.prototype,h,i);}return this;};var d=function(g){g.$prototyping=true;var h=new g;delete g.$prototyping; +return h;};a.implement("implement",f.overloadSetter());a.Mutators={Extends:function(g){this.parent=g;this.prototype=d(g);},Implements:function(g){Array.from(g).each(function(j){var h=new j; +for(var i in h){f.call(this,i,h[i],true);}},this);}};})();(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments)); +return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty(); +return this;}});var a=function(b){return b.replace(/^on([A-Z])/,function(c,d){return d.toLowerCase();});};this.Events=new Class({$events:{},addEvent:function(d,c,b){d=a(d); +if(c==$empty){return this;}this.$events[d]=(this.$events[d]||[]).include(c);if(b){c.internal=true;}return this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]); +}return this;},fireEvent:function(e,c,b){e=a(e);var d=this.$events[e];if(!d){return this;}c=Array.from(c);d.each(function(f){if(b){f.delay(b,this,c);}else{f.apply(this,c); +}},this);return this;},removeEvent:function(e,d){e=a(e);var c=this.$events[e];if(c&&!d.internal){var b=c.indexOf(d);if(b!=-1){delete c[b];}}return this; +},removeEvents:function(d){var e;if(typeOf(d)=="object"){for(e in d){this.removeEvent(e,d[e]);}return this;}if(d){d=a(d);}for(e in this.$events){if(d&&d!=e){continue; +}var c=this.$events[e];for(var b=c.length;b--;){if(b in c){this.removeEvent(e,c[b]);}}}return this;}});this.Options=new Class({setOptions:function(){var b=this.options=Object.merge.apply(null,[{},this.options].append(arguments)); +if(this.addEvent){for(var c in b){if(typeOf(b[c])!="function"||!(/^on[A-Z]/).test(c)){continue;}this.addEvent(c,b[c]);delete b[c];}}return this;}});})(); +(function(){var k,n,l,g,a={},c={},m=/\\/g;var e=function(q,p){if(q==null){return null;}if(q.Slick===true){return q;}q=(""+q).replace(/^\s+|\s+$/g,"");g=!!p; +var o=(g)?c:a;if(o[q]){return o[q];}k={Slick:true,expressions:[],raw:q,reverse:function(){return e(this.raw,true);}};n=-1;while(q!=(q=q.replace(j,b))){}k.length=k.expressions.length; +return o[k.raw]=(g)?h(k):k;};var i=function(o){if(o==="!"){return" ";}else{if(o===" "){return"!";}else{if((/^!/).test(o)){return o.replace(/^!/,"");}else{return"!"+o; +}}}};var h=function(u){var r=u.expressions;for(var p=0;p+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); +function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; +if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); +}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); +}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); +}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); +break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; +case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); +};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); +};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var k={},m={},d=Object.prototype.toString; +k.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};k.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(d.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); +};k.setDocument=function(w){var p=w.nodeType;if(p==9){}else{if(p){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return; +}this.document=w;var A=w.documentElement,o=this.getUIDXML(A),s=m[o],r;if(s){for(r in s){this[r]=s[r];}return;}s=m[o]={};s.root=A;s.isXMLDocument=this.isXML(w); +s.brokenStarGEBTN=s.starSelectsClosedQSA=s.idGetsName=s.brokenMixedCaseQSA=s.brokenGEBCN=s.brokenCheckedQSA=s.brokenEmptyAttributeQSA=s.isHTMLDocument=s.nativeMatchesSelector=false; +var q,u,y,z,t;var x,v="slick_uniqueid";var c=w.createElement("div");var n=w.body||w.getElementsByTagName("body")[0]||A;n.appendChild(c);try{c.innerHTML=''; +s.isHTMLDocument=!!w.getElementById(v);}catch(C){}if(s.isHTMLDocument){c.style.display="none";c.appendChild(w.createComment(""));u=(c.getElementsByTagName("*").length>1); +try{c.innerHTML="foo";x=c.getElementsByTagName("*");q=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/");}catch(C){}s.brokenStarGEBTN=u||q;try{c.innerHTML=''; +s.idGetsName=w.getElementById(v)===c.firstChild;}catch(C){}if(c.getElementsByClassName){try{c.innerHTML='';c.getElementsByClassName("b").length; +c.firstChild.className="b";z=(c.getElementsByClassName("b").length!=2);}catch(C){}try{c.innerHTML='';y=(c.getElementsByClassName("a").length!=2); +}catch(C){}s.brokenGEBCN=z||y;}if(c.querySelectorAll){try{c.innerHTML="foo";x=c.querySelectorAll("*");s.starSelectsClosedQSA=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/"); +}catch(C){}try{c.innerHTML='';s.brokenMixedCaseQSA=!c.querySelectorAll(".MiX").length;}catch(C){}try{c.innerHTML=''; +s.brokenCheckedQSA=(c.querySelectorAll(":checked").length==0);}catch(C){}try{c.innerHTML='';s.brokenEmptyAttributeQSA=(c.querySelectorAll('[class*=""]').length!=0); +}catch(C){}}try{c.innerHTML='
';t=(c.firstChild.getAttribute("action")!="s");}catch(C){}s.nativeMatchesSelector=A.matchesSelector||A.mozMatchesSelector||A.webkitMatchesSelector; +if(s.nativeMatchesSelector){try{s.nativeMatchesSelector.call(A,":slick");s.nativeMatchesSelector=null;}catch(C){}}}try{A.slick_expando=1;delete A.slick_expando; +s.getUID=this.getUIDHTML;}catch(C){s.getUID=this.getUIDXML;}n.removeChild(c);c=x=n=null;s.getAttribute=(s.isHTMLDocument&&t)?function(G,E){var H=this.attributeGetters[E]; +if(H){return H.call(G);}var F=G.getAttributeNode(E);return(F)?F.nodeValue:null;}:function(F,E){var G=this.attributeGetters[E];return(G)?G.call(F):F.getAttribute(E); +};s.hasAttribute=(A&&this.isNativeCode(A.hasAttribute))?function(F,E){return F.hasAttribute(E);}:function(F,E){F=F.getAttributeNode(E);return !!(F&&(F.specified||F.nodeValue)); +};var D=A&&this.isNativeCode(A.contains),B=w&&this.isNativeCode(w.contains);s.contains=(D&&B)?function(E,F){return E.contains(F);}:(D&&!B)?function(E,F){return E===F||((E===w)?w.documentElement:E).contains(F); +}:(A&&A.compareDocumentPosition)?function(E,F){return E===F||!!(E.compareDocumentPosition(F)&16);}:function(E,F){if(F){do{if(F===E){return true;}}while((F=F.parentNode)); +}return false;};s.documentSorter=(A.compareDocumentPosition)?function(F,E){if(!F.compareDocumentPosition||!E.compareDocumentPosition){return 0;}return F.compareDocumentPosition(E)&4?-1:F===E?0:1; +}:("sourceIndex" in A)?function(F,E){if(!F.sourceIndex||!E.sourceIndex){return 0;}return F.sourceIndex-E.sourceIndex;}:(w.createRange)?function(H,F){if(!H.ownerDocument||!F.ownerDocument){return 0; +}var G=H.ownerDocument.createRange(),E=F.ownerDocument.createRange();G.setStart(H,0);G.setEnd(H,0);E.setStart(F,0);E.setEnd(F,0);return G.compareBoundaryPoints(Range.START_TO_END,E); +}:null;A=null;for(r in s){this[r]=s[r];}};var f=/^([#.]?)((?:[\w-]+|\*))$/,h=/\[.+[*$^]=(?:""|'')?\]/,g={};k.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]); +if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9);if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U); +}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(f);simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors; +}E=U.getElementsByTagName(v);if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors; +}A=U.getElementById(v);if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A); +}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v); +if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+e.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*"); +for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p); +}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||g[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&h.test(z))||(!y&&z.indexOf(",")>-1)||e.disableQSA){break querySelector; +}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null; +}else{E=U.querySelectorAll(S);}}catch(Q){g[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0; +A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p); +}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z; +return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID; +if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator; +if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1)); +this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search; +}}else{if(s&&w){for(L=0,K=N.length;L1)){this.sort(p);}return(s)?(p[0]||null):p;};k.uidx=1;k.uidk="slick-uniqueid";k.getUIDXML=function(n){var c=n.getAttribute(this.uidk); +if(!c){c=this.uidx++;n.setAttribute(this.uidk,c);}return c;};k.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};k.sort=function(c){if(!this.documentSorter){return c; +}c.sort(this.documentSorter);return c;};k.cacheNTH={};k.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;k.parseNTHArgument=function(q){var o=q.match(this.matchNTH); +if(!o){return false;}var p=o[2]||false;var n=o[1]||1;if(n=="-"){n=-1;}var c=+o[3]||0;o=(p=="n")?{a:n,b:c}:(p=="odd")?{a:2,b:1}:(p=="even")?{a:2,b:0}:{a:0,b:n}; +return(this.cacheNTH[q]=o);};k.createNTHPseudo=function(p,n,c,o){return function(s,q){var u=this.getUID(s);if(!this[c][u]){var A=s.parentNode;if(!A){return false; +}var r=A[p],t=1;if(o){var z=s.nodeName;do{if(r.nodeName!=z){continue;}this[c][this.getUID(r)]=t++;}while((r=r[n]));}else{do{if(r.nodeType!=1){continue; +}this[c][this.getUID(r)]=t++;}while((r=r[n]));}}q=q||"n";var v=this.cacheNTH[q]||this.parseNTHArgument(q);if(!v){return false;}var y=v.a,x=v.b,w=this[c][u]; +if(y==0){return x==w;}if(y>0){if(w":function(p,c,r,o,n,q){if((p=p.firstChild)){do{if(p.nodeType==1){this.push(p,c,r,o,n,q); +}}while((p=p.nextSibling));}},"+":function(p,c,r,o,n,q){while((p=p.nextSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q);break;}}},"^":function(p,c,r,o,n,q){p=p.firstChild; +if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:+"](p,c,r,o,n,q);}}},"~":function(q,c,s,p,n,r){while((q=q.nextSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}},"++":function(p,c,r,o,n,q){this["combinator:+"](p,c,r,o,n,q); +this["combinator:!+"](p,c,r,o,n,q);},"~~":function(p,c,r,o,n,q){this["combinator:~"](p,c,r,o,n,q);this["combinator:!~"](p,c,r,o,n,q);},"!":function(p,c,r,o,n,q){while((p=p.parentNode)){if(p!==this.document){this.push(p,c,r,o,n,q); +}}},"!>":function(p,c,r,o,n,q){p=p.parentNode;if(p!==this.document){this.push(p,c,r,o,n,q);}},"!+":function(p,c,r,o,n,q){while((p=p.previousSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q); +break;}}},"!^":function(p,c,r,o,n,q){p=p.lastChild;if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:!+"](p,c,r,o,n,q);}}},"!~":function(q,c,s,p,n,r){while((q=q.previousSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}}};for(var i in j){k["combinator:"+i]=j[i];}var l={empty:function(c){var n=c.firstChild; +return !(n&&n.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,n){return !this.matchNode(c,n);},contains:function(c,n){return(c.innerText||c.textContent||"").indexOf(n)>-1; +},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"only-child":function(o){var n=o;while((n=n.previousSibling)){if(n.nodeType==1){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"nth-child":k.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":k.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":k.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":k.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(n,c){return this["pseudo:nth-child"](n,""+(c+1)); +},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var n=c.nodeName; +while((c=c.previousSibling)){if(c.nodeName==n){return false;}}return true;},"last-of-type":function(c){var n=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==n){return false; +}}return true;},"only-of-type":function(o){var n=o,p=o.nodeName;while((n=n.previousSibling)){if(n.nodeName==p){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeName==p){return false; +}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); +},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var b in l){k["pseudo:"+b]=l[b];}var a=k.attributeGetters={"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for"); +},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href");},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style"); +},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null;},type:function(){return this.getAttribute("type"); +},maxlength:function(){var c=this.getAttributeNode("maxLength");return(c&&c.specified)?c.nodeValue:null;}};a.MAXLENGTH=a.maxLength=a.maxlength;var e=k.Slick=(this.Slick||{}); +e.version="1.1.7";e.search=function(n,o,c){return k.search(n,o,c);};e.find=function(c,n){return k.search(c,n,null,true);};e.contains=function(c,n){k.setDocument(c); +return k.contains(c,n);};e.getAttribute=function(n,c){k.setDocument(n);return k.getAttribute(n,c);};e.hasAttribute=function(n,c){k.setDocument(n);return k.hasAttribute(n,c); +};e.match=function(n,c){if(!(n&&c)){return false;}if(!c||c===n){return true;}k.setDocument(n);return k.matchNode(n,c);};e.defineAttributeGetter=function(c,n){k.attributeGetters[c]=n; +return this;};e.lookupAttributeGetter=function(c){return k.attributeGetters[c];};e.definePseudo=function(c,n){k["pseudo:"+c]=function(p,o){return n.call(p,o); +};return this;};e.lookupPseudo=function(c){var n=k["pseudo:"+c];if(n){return function(o){return n.call(this,o);};}return null;};e.override=function(n,c){k.override(n,c); +return this;};e.isXML=k.isXML;e.uidOf=function(c){return k.getUIDHTML(c);};if(!this.Slick){this.Slick=e;}}).apply((typeof exports!="undefined")?exports:this); +var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; +b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var a,f=0,c=d.length;f=this.length){delete this[g--];}return e;}.protect());}Array.forEachMethod(function(g,e){Elements.implement(e,g);});Array.mirror(Elements);var d; +try{d=(document.createElement("").name=="x");}catch(b){}var c=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,g){if(g&&g.checked!=null){g.defaultChecked=g.checked; +}if(d&&g){e="<"+e;if(g.name){e+=' name="'+c(g.name)+'"';}if(g.type){e+=' type="'+c(g.type)+'"';}e+=">";delete g.name;delete g.type;}return this.id(this.createElement(e)).set(g); +}});})();(function(){Slick.uidOf(window);Slick.uidOf(document);Document.implement({newTextNode:function(e){return this.createTextNode(e);},getDocument:function(){return this; +},getWindow:function(){return this.window;},id:(function(){var e={string:function(E,D,l){E=Slick.find(l,"#"+E.replace(/(\W)/g,"\\$1"));return(E)?e.element(E,D):null; +},element:function(D,E){Slick.uidOf(D);if(!E&&!D.$family&&!(/^(?:object|embed)$/i).test(D.tagName)){var l=D.fireEvent;D._fireEvent=function(F,G){return l(F,G); +};Object.append(D,Element.Prototype);}return D;},object:function(D,E,l){if(D.toElement){return e.element(D.toElement(l),E);}return null;}};e.textnode=e.whitespace=e.window=e.document=function(l){return l; +};return function(D,F,E){if(D&&D.$family&&D.uniqueNumber){return D;}var l=typeOf(D);return(e[l])?e[l](D,F,E||document):null;};})()});if(window.$==null){Window.implement("$",function(e,l){return document.id(e,l,this.document); +});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(e){return Slick.search(this,e,new Elements); +},getElement:function(e){return document.id(Slick.find(this,e));}});var m={contains:function(e){return Slick.contains(this,e);}};if(!document.contains){Document.implement(m); +}if(!document.createElement("div").contains){Element.implement(m);}Element.implement("hasChild",function(e){return this!==e&&this.contains(e);});(function(l,E,e){this.Selectors={}; +var F=this.Selectors.Pseudo=new Hash();var D=function(){for(var G in F){if(F.hasOwnProperty(G)){Slick.definePseudo(G,F[G]);delete F[G];}}};Slick.search=function(H,I,G){D(); +return l.call(this,H,I,G);};Slick.find=function(G,H){D();return E.call(this,G,H);};Slick.match=function(H,G){D();return e.call(this,H,G);};})(Slick.search,Slick.find,Slick.match); +var r=function(E,D){if(!E){return D;}E=Object.clone(Slick.parse(E));var l=E.expressions;for(var e=l.length;e--;){l[e][0].combinator=D;}return E;};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,l){Element.implement(l,function(D){return this.getElement(r(D,e)); +});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,l){Element.implement(l,function(D){return this.getElements(r(D,e)); +});});Element.implement({getFirst:function(e){return document.id(Slick.search(this,r(e,">"))[0]);},getLast:function(e){return document.id(Slick.search(this,r(e,">")).getLast()); +},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1"))); +},match:function(e){return !e||Slick.match(this,e);}});if(window.$$==null){Window.implement("$$",function(e){var H=new Elements;if(arguments.length==1&&typeof e=="string"){return Slick.search(this.document,e,H); +}var E=Array.flatten(arguments);for(var F=0,D=E.length;F(?![^<]*<['"])/)).indexOf(F)<0){return null;}E[F]=true;}}var e=Slick.getAttribute(this,F); +return(!e&&!Slick.hasAttribute(this,F))?null:e;},getProperties:function(){var e=Array.from(arguments);return e.map(this.getProperty,this).associate(e); +},removeProperty:function(e){return this.setProperty(e,null);},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},set:function(D,l){var e=Element.Properties[D]; +(e&&e.set)?e.set.call(this,l):this.setProperty(D,l);}.overloadSetter(),get:function(l){var e=Element.Properties[l];return(e&&e.get)?e.get.apply(this):this.getProperty(l); +}.overloadGetter(),erase:function(l){var e=Element.Properties[l];(e&&e.erase)?e.erase.apply(this):this.removeProperty(l);return this;},hasClass:function(e){return this.className.clean().contains(e," "); +},addClass:function(e){if(!this.hasClass(e)){this.className=(this.className+" "+e).clean();}return this;},removeClass:function(e){this.className=this.className.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)"),"$1"); +return this;},toggleClass:function(e,l){if(l==null){l=!this.hasClass(e);}return(l)?this.addClass(e):this.removeClass(e);},adopt:function(){var E=this,e,G=Array.flatten(arguments),F=G.length; +if(F>1){E=e=document.createDocumentFragment();}for(var D=0;D";var a=(t.childNodes.length==1);if(!a){var s="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),b=document.createDocumentFragment(),u=s.length; +while(u--){b.createElement(s[u]);}}t=null;var g=Function.attempt(function(){var e=document.createElement("table");e.innerHTML="";return true; +});var c=document.createElement("tr"),o="";c.innerHTML=o;var y=(c.innerHTML==o);c=null;if(!g||!y||!a){Element.Properties.html.set=(function(l){var e={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; +e.thead=e.tfoot=e.tbody;return function(D){var E=e[this.get("tag")];if(!E&&!a){E=[0,"",""];}if(!E){return l.call(this,D);}var H=E[0],G=document.createElement("div"),F=G; +if(!a){b.appendChild(G);}G.innerHTML=[E[1],D,E[2]].flatten().join("");while(H--){F=F.firstChild;}this.empty().adopt(F.childNodes);if(!a){b.removeChild(G); +}G=null;};})(Element.Properties.html.set);}var n=document.createElement("form");n.innerHTML="";if(n.firstChild.value!="s"){Element.Properties.value={set:function(G){var l=this.get("tag"); +if(l!="select"){return this.setProperty("value",G);}var D=this.getElements("option");for(var E=0;E0||k==null?"visible":"hidden";};var f=(h?function(l,k){l.style.opacity=k;}:(e?function(l,k){var n=l.style; +if(!l.currentStyle||!l.currentStyle.hasLayout){n.zoom=1;}if(k==null){k="";}else{k="alpha(opacity="+(k*100).limit(0,100).round()+")";}var m=n.filter||l.getComputedStyle("filter")||""; +n.filter=j.test(m)?m.replace(j,k):m+k;if(!n.filter){n.removeAttribute("filter");}}:a));var g=(h?function(l){var k=l.style.opacity||l.getComputedStyle("opacity"); +return(k=="")?1:k.toFloat();}:(e?function(l){var m=(l.style.filter||l.getComputedStyle("filter")),k;if(m){k=m.match(j);}return(k==null||m==null)?1:(k[1]/100); +}:function(l){var k=l.retrieve("$opacity");if(k==null){k=(l.style.visibility=="hidden"?0:1);}return k;}));var b=(i.style.cssFloat==null)?"styleFloat":"cssFloat"; +Element.implement({getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()];}var l=Element.getDocument(this).defaultView,k=l?l.getComputedStyle(this,null):null; +return(k)?k.getPropertyValue((m==b)?"float":m.hyphenate()):null;},setStyle:function(l,k){if(l=="opacity"){if(k!=null){k=parseFloat(k);}f(this,k);return this; +}l=(l=="float"?b:l).camelCase();if(typeOf(k)!="string"){var m=(Element.Styles[l]||"@").split(" ");k=Array.from(k).map(function(o,n){if(!m[n]){return""; +}return(typeOf(o)=="number")?m[n].replace("@",Math.round(o)):o;}).join(" ");}else{if(k==String(Number(k))){k=Math.round(k);}}this.style[l]=k;if((k==""||k==null)&&c&&this.style.removeAttribute){this.style.removeAttribute(l); +}return this;},getStyle:function(q){if(q=="opacity"){return g(this);}q=(q=="float"?b:q).camelCase();var k=this.style[q];if(!k||q=="zIndex"){k=[];for(var p in Element.ShortStyles){if(q!=p){continue; +}for(var o in Element.ShortStyles[p]){k.push(this.getStyle(o));}return k.join(" ");}k=this.getComputedStyle(q);}if(k){k=String(k);var m=k.match(/rgba?\([\d\s,]+\)/); +if(m){k=k.replace(m[0],m[0].rgbToHex());}}if(Browser.opera||(Browser.ie&&isNaN(parseFloat(k)))){if((/^(height|width)$/).test(q)){var l=(q=="width")?["left","right"]:["top","bottom"],n=0; +l.each(function(r){n+=this.getStyle("border-"+r+"-width").toInt()+this.getStyle("padding-"+r).toInt();},this);return this["offset"+q.capitalize()]-n+"px"; +}if(Browser.opera&&String(k).indexOf("px")!=-1){return k;}if((/^border(.+)Width|margin|padding/).test(q)){return"0px";}}return k;},setStyles:function(l){for(var k in l){this.setStyle(k,l[k]); +}return this;},getStyles:function(){var k={};Array.flatten(arguments).each(function(l){k[l]=this.getStyle(l);},this);return k;}});Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}; +Element.implement({setOpacity:function(k){f(this,k);return this;},getOpacity:function(){return g(this);}});Element.Properties.opacity={set:function(k){f(this,k); +a(this,k);},get:function(){return g(this);}};Element.Styles=new Hash(Element.Styles);Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}}; +["Top","Right","Bottom","Left"].each(function(q){var p=Element.ShortStyles;var l=Element.Styles;["margin","padding"].each(function(r){var s=r+q;p[r][s]=l[s]="@px"; +});var o="border"+q;p.border[o]=l[o]="@px @ rgb(@, @, @)";var n=o+"Width",k=o+"Style",m=o+"Color";p[o]={};p.borderWidth[n]=p[o][n]=l[n]="@px";p.borderStyle[k]=p[o][k]=l[k]="@"; +p.borderColor[m]=p[o][m]=l[m]="rgb(@, @, @)";});})();(function(){Element.Properties.events={set:function(b){this.addEvents(b);}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{}); +if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this;}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h,f); +}if(b.condition){d=function(k){if(b.condition.call(this,k,f)){return h.call(this,k);}return true;};}if(b.base){g=Function.from(b.base).call(this,f);}}var e=function(){return h.call(j); +};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new DOMEvent(k,j.getWindow());if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]); +}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events");if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d); +if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e];if(f){if(f.onRemove){f.onRemove.call(this,d,e);}if(f.base){e=Function.from(f.base).call(this,e); +}}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; +},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events");if(!c){return this; +}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this);delete c[b]; +}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); +}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); +}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +Element.Events={mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};if("onmouseenter" in document.documentElement){Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2; +}else{var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); +};Element.Events.mouseenter={base:"mouseover",condition:a};Element.Events.mouseleave={base:"mouseout",condition:a};}if(!window.addEventListener){Element.NativeEvents.propertychange=2; +Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change";},condition:function(b){return this.type!="radio"||(b.event.propertyName=="checked"&&this.checked); +}};}Element.Events=new Hash(Element.Events);})();(function(){var c=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2; +var k=function(l,m,n,o,p){while(p&&p!=l){if(m(p,o)){return n.call(p,o,p);}p=document.id(p.parentNode);}};var a={mouseenter:{base:"mouseover"},mouseleave:{base:"mouseout"},focus:{base:"focus"+(c?"":"in"),capture:true},blur:{base:c?"blur":"focusout",capture:true}}; +var b="$delegation:";var i=function(l){return{base:"focusin",remove:function(m,o){var p=m.retrieve(b+l+"listeners",{})[o];if(p&&p.forms){for(var n=p.forms.length; +n--;){p.forms[n].removeEvent(l,p.fns[n]);}}},listen:function(x,r,v,n,t,s){var o=(t.get("tag")=="form")?t:n.target.getParent("form");if(!o){return;}var u=x.retrieve(b+l+"listeners",{}),p=u[s]||{forms:[],fns:[]},m=p.forms,w=p.fns; +if(m.indexOf(o)!=-1){return;}m.push(o);var q=function(y){k(x,r,v,y,t);};o.addEvent(l,q);w.push(q);u[s]=p;x.store(b+l+"listeners",u);}};};var d=function(l){return{base:"focusin",listen:function(m,n,p,q,r){var o={blur:function(){this.removeEvents(o); +}};o[l]=function(s){k(m,n,p,s,r);};q.target.addEvents(o);}};};if(!c){Object.append(a,{submit:i("submit"),reset:i("reset"),change:d("change"),select:d("select")}); +}var h=Element.prototype,f=h.addEvent,j=h.removeEvent;var e=function(l,m){return function(r,q,n){if(r.indexOf(":relay")==-1){return l.call(this,r,q,n); +}var o=Slick.parse(r).expressions[0][0];if(o.pseudos[0].key!="relay"){return l.call(this,r,q,n);}var p=o.tag;o.pseudos.slice(1).each(function(s){p+=":"+s.key+(s.value?"("+s.value+")":""); +});l.call(this,r,q);return m.call(this,p,o.pseudos[0].value,q);};};var g={addEvent:function(v,q,x){var t=this.retrieve("$delegates",{}),r=t[v];if(r){for(var y in r){if(r[y].fn==x&&r[y].match==q){return this; +}}}var p=v,u=q,o=x,n=a[v]||{};v=n.base||p;q=function(B){return Slick.match(B,u);};var w=Element.Events[p];if(w&&w.condition){var l=q,m=w.condition;q=function(C,B){return l(C,B)&&m.call(C,B,v); +};}var z=this,s=String.uniqueID();var A=n.listen?function(B,C){if(!C&&B&&B.target){C=B.target;}if(C){n.listen(z,q,x,B,C,s);}}:function(B,C){if(!C&&B&&B.target){C=B.target; +}if(C){k(z,q,x,B,C);}};if(!r){r={};}r[s]={match:u,fn:o,delegator:A};t[p]=r;return f.call(this,v,A,n.capture);},removeEvent:function(r,n,t,u){var q=this.retrieve("$delegates",{}),p=q[r]; +if(!p){return this;}if(u){var m=r,w=p[u].delegator,l=a[r]||{};r=l.base||m;if(l.remove){l.remove(this,u);}delete p[u];q[m]=p;return j.call(this,r,w);}var o,v; +if(t){for(o in p){v=p[o];if(v.match==n&&v.fn==t){return g.removeEvent.call(this,r,n,t,o);}}}else{for(o in p){v=p[o];if(v.match==n){g.removeEvent.call(this,r,n,v.fn,o); +}}}return this;}};[Element,Window,Document].invoke("implement",{addEvent:e(f,g.addEvent),removeEvent:e(j,g.removeEvent)});})();(function(){var h=document.createElement("div"),e=document.createElement("div"); +h.style.height="0";h.appendChild(e);var d=(e.offsetParent===h);h=e=null;var l=function(m){return k(m,"position")!="static"||a(m);};var i=function(m){return l(m)||(/^(?:table|td|th)$/i).test(m.tagName); +};Element.implement({scrollTo:function(m,n){if(a(this)){this.getWindow().scrollTo(m,n);}else{this.scrollLeft=m;this.scrollTop=n;}return this;},getSize:function(){if(a(this)){return this.getWindow().getSize(); +}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(a(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight}; +},getScroll:function(){if(a(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var n=this.parentNode,m={x:0,y:0}; +while(n&&!a(n)){m.x+=n.scrollLeft;m.y+=n.scrollTop;n=n.parentNode;}return m;},getOffsetParent:d?function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; +}var n=(k(m,"position")=="static")?i:l;while((m=m.parentNode)){if(n(m)){return m;}}return null;}:function(){var m=this;if(a(m)||k(m,"position")=="fixed"){return null; +}try{return m.offsetParent;}catch(n){}return null;},getOffsets:function(){if(this.getBoundingClientRect&&!Browser.Platform.ios){var r=this.getBoundingClientRect(),o=document.id(this.getDocument().documentElement),q=o.getScroll(),t=this.getScrolls(),s=(k(this,"position")=="fixed"); +return{x:r.left.toInt()+t.x+((s)?0:q.x)-o.clientLeft,y:r.top.toInt()+t.y+((s)?0:q.y)-o.clientTop};}var n=this,m={x:0,y:0};if(a(this)){return m;}while(n&&!a(n)){m.x+=n.offsetLeft; +m.y+=n.offsetTop;if(Browser.firefox){if(!c(n)){m.x+=b(n);m.y+=g(n);}var p=n.parentNode;if(p&&k(p,"overflow")!="visible"){m.x+=b(p);m.y+=g(p);}}else{if(n!=this&&Browser.safari){m.x+=b(n); +m.y+=g(n);}}n=n.offsetParent;}if(Browser.firefox&&!c(this)){m.x-=b(this);m.y-=g(this);}return m;},getPosition:function(p){var q=this.getOffsets(),n=this.getScrolls(); +var m={x:q.x-n.x,y:q.y-n.y};if(p&&(p=document.id(p))){var o=p.getPosition();return{x:m.x-o.x-b(p),y:m.y-o.y-g(p)};}return m;},getCoordinates:function(o){if(a(this)){return this.getWindow().getCoordinates(); +}var m=this.getPosition(o),n=this.getSize();var p={left:m.x,top:m.y,width:n.x,height:n.y};p.right=p.left+p.width;p.bottom=p.top+p.height;return p;},computePosition:function(m){return{left:m.x-j(this,"margin-left"),top:m.y-j(this,"margin-top")}; +},setPosition:function(m){return this.setStyles(this.computePosition(m));}});[Document,Window].invoke("implement",{getSize:function(){var m=f(this);return{x:m.clientWidth,y:m.clientHeight}; +},getScroll:function(){var n=this.getWindow(),m=f(this);return{x:n.pageXOffset||m.scrollLeft,y:n.pageYOffset||m.scrollTop};},getScrollSize:function(){var o=f(this),n=this.getSize(),m=this.getDocument().body; +return{x:Math.max(o.scrollWidth,m.scrollWidth,n.x),y:Math.max(o.scrollHeight,m.scrollHeight,n.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var m=this.getSize(); +return{top:0,left:0,bottom:m.y,right:m.x,height:m.y,width:m.x};}});var k=Element.getComputedStyle;function j(m,n){return k(m,n).toInt()||0;}function c(m){return k(m,"-moz-box-sizing")=="border-box"; +}function g(m){return j(m,"border-top-width");}function b(m){return j(m,"border-left-width");}function a(m){return(/^(?:body|html)$/i).test(m.tagName); +}function f(m){var n=m.getDocument();return(!n.compatMode||n.compatMode=="CSS1Compat")?n.html:n.body;}})();Element.alias({position:"setPosition"});[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y; +},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x; +},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y; +},getLeft:function(){return this.getPosition().x;}});(function(){var f=this.Fx=new Class({Implements:[Chain,Events,Options],options:{fps:60,unit:false,duration:500,frames:null,frameSkip:true,link:"ignore"},initialize:function(g){this.subject=this.subject||this; +this.setOptions(g);},getTransition:function(){return function(g){return -(Math.cos(Math.PI*g)-1)/2;};},step:function(g){if(this.options.frameSkip){var h=(this.time!=null)?(g-this.time):0,i=h/this.frameInterval; +this.time=g;this.frame+=i;}else{this.frame++;}if(this.frame=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3); +}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2);});});(function(){var d=function(){},a=("onprogress" in new Browser.Request); +var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,timeout:0,noCache:false},initialize:function(e){this.xhr=new Browser.Request(); +this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false; +this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d; +}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml); +}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return Browser.exec(e); +}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]); +},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f; +return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this; +}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options; +o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString(); +break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e; +j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g; +}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID(); +}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this); +}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true; +}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]); +}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}else{if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this); +}}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d; +if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e}; +if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e); +return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}); +this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})(); +Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(f){var e=this.options,c=this.response; +c.html=f.stripScripts(function(h){c.javascript=h;});var d=c.html.match(/]*>([\s\S]*?)<\/body>/i);if(d){c.html=d[1];}var b=new Element("div").set("html",c.html); +c.tree=b.childNodes;c.elements=b.getElements(e.filter||"*");if(e.filter){c.tree=c.elements;}if(e.update){var g=document.id(e.update).empty();if(e.filter){g.adopt(c.elements); +}else{g.set("html",c.html);}}else{if(e.append){var a=document.id(e.append);if(e.filter){c.elements.reverse().inject(a);}else{a.adopt(b.getChildren());}}}if(e.evalScripts){Browser.exec(c.javascript); +}this.onSuccess(c.tree,c.elements,c.html,c.javascript);}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this; +},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});this.store("load",a);}return a; +}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString}));return this;}});if(typeof JSON=="undefined"){this.JSON={}; +}JSON=new Hash({stringify:JSON.stringify,parse:JSON.parse});(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}; +var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4);};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""); +return(/^[\],:{}\s]*$/).test(string);};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj);}:function(obj){if(obj&&obj.toJSON){obj=obj.toJSON(); +}switch(typeOf(obj)){case"string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+obj.map(JSON.encode).clean()+"]";case"object":case"hash":var string=[]; +Object.each(obj,function(value,key){var json=JSON.encode(value);if(json){string.push(JSON.encode(key)+":"+json);}});return"{"+string+"}";case"number":case"boolean":return""+obj; +case"null":return"null";}return null;};JSON.decode=function(string,secure){if(!string||typeOf(string)!="string"){return null;}if(secure||JSON.secure){if(JSON.parse){return JSON.parse(string); +}if(!JSON.validate(string)){throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}}return eval("("+string+")"); +};})();Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"}); +},success:function(c){var b;try{b=this.response.json=JSON.decode(c,this.options.secure);}catch(a){this.fireEvent("error",[c,a]);return;}if(b==null){this.onFailure(); +}else{this.onSuccess(b,c);}}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:false,duration:false,secure:false,document:document,encode:true},initialize:function(b,a){this.key=b; +this.setOptions(a);},write:function(b){if(this.options.encode){b=encodeURIComponent(b);}if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path; +}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure"; +}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)"); +return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write("");return this;}}); +Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose(); +};(function(i,k){var l,f,e=[],c,b,d=k.createElement("div");var g=function(){clearTimeout(b);if(l){return;}Browser.loaded=l=true;k.removeListener("DOMContentLoaded",g).removeListener("readystatechange",a); +k.fireEvent("domready");i.fireEvent("domready");};var a=function(){for(var m=e.length;m--;){if(e[m]()){g();return true;}}return false;};var j=function(){clearTimeout(b); +if(!a()){b=setTimeout(j,10);}};k.addListener("DOMContentLoaded",g);var h=function(){try{d.doScroll();return true;}catch(m){}return false;};if(d.doScroll&&!h()){e.push(h); +c=true;}if(k.readyState){e.push(function(){var m=k.readyState;return(m=="loaded"||m=="complete");});}if("onreadystatechange" in k){k.addListener("readystatechange",a); +}else{c=true;}if(c){j();}Element.Events.domready={onAdd:function(m){if(l){m.call(this);}}};Element.Events.load={base:"load",onAdd:function(m){if(f&&this==i){m.call(this); +}},condition:function(){if(this==i){g();delete Element.Events.load;}return true;}};i.addEvent("load",function(){f=true;});})(window,document);(function(){var Swiff=this.Swiff=new Class({Implements:Options,options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"window",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object; +},initialize:function(path,options){this.instance="Swiff_"+String.uniqueID();this.setOptions(options);options=this.options;var id=this.id=options.id||this.instance; +var container=document.id(options.container);Swiff.CallBacks[this.instance]={};var params=options.params,vars=options.vars,callBacks=options.callBacks; +var properties=Object.append({height:options.height,width:options.width},options.properties);var self=this;for(var callBack in callBacks){Swiff.CallBacks[this.instance][callBack]=(function(option){return function(){return option.apply(self.object,arguments); +};})(callBacks[callBack]);vars[callBack]="Swiff.CallBacks."+this.instance+"."+callBack;}params.flashVars=Object.toQueryString(vars);if(Browser.ie){properties.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; +params.movie=path;}else{properties.type="application/x-shockwave-flash";}properties.data=path;var build='';}}build+="";this.object=((container)?container.empty():new Element("div")).set("html",build).firstChild; +},replaces:function(element){element=document.id(element,true);element.parentNode.replaceChild(this.toElement(),element);return this;},inject:function(element){document.id(element,true).appendChild(this.toElement()); +return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].append(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction(''+__flash__argumentsToXML(arguments,2)+""); +return eval(rs);};})(); \ No newline at end of file diff --git a/Demos/assets/mootools-more-1.4.0.1.js b/Demos/assets/mootools-more-1.4.0.1.js new file mode 100644 index 0000000..6f41f4d --- /dev/null +++ b/Demos/assets/mootools-more-1.4.0.1.js @@ -0,0 +1,751 @@ +// MooTools: the javascript framework. +// Load this file's selection again by visiting: http://mootools.net/more/4cf4cb7f4a4f2bc7bf16784d73b3ebc4 +// Or build this file again with packager using: packager build More/More More/Events.Pseudos More/Class.Refactor More/Class.Binds More/Class.Occlude More/Chain.Wait More/Array.Extras More/Date More/Date.Extras More/Number.Format More/Object.Extras More/String.Extras More/String.QueryString More/URI More/URI.Relative More/Hash More/Hash.Extras More/Element.Forms More/Elements.From More/Element.Event.Pseudos More/Element.Event.Pseudos.Keys More/Element.Measure More/Element.Pin More/Element.Position More/Element.Shortcuts More/Form.Request More/Form.Request.Append More/Form.Validator More/Form.Validator.Inline More/Form.Validator.Extras More/OverText More/Fx.Elements More/Fx.Accordion More/Fx.Move More/Fx.Reveal More/Fx.Scroll More/Fx.Slide More/Fx.SmoothScroll More/Fx.Sort More/Drag More/Drag.Move More/Slider More/Sortables More/Request.JSONP More/Request.Queue More/Request.Periodical More/Assets More/Color More/Group More/Hash.Cookie More/IframeShim More/Table More/HtmlTable More/HtmlTable.Zebra More/HtmlTable.Sort More/HtmlTable.Select More/Keyboard More/Keyboard.Extras More/Mask More/Scroller More/Tips More/Spinner More/Locale More/Locale.Set.From More/Locale.en-US.Date More/Locale.en-US.Form.Validator More/Locale.en-US.Number More/Locale.de-DE.Date More/Locale.de-DE.Form.Validator More/Locale.de-DE.Number More/Locale.en-GB.Date More/Locale.EU.Number +/* +--- +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ +MooTools.More={version:"1.4.0.1",build:"a4244edf2aa97ac8a196fc96082dd35af1abab87"};(function(){Events.Pseudos=function(h,e,f){var d="_monitorEvents:";var c=function(i){return{store:i.store?function(j,k){i.store(d+j,k); +}:function(j,k){(i._monitorEvents||(i._monitorEvents={}))[j]=k;},retrieve:i.retrieve?function(j,k){return i.retrieve(d+j,k);}:function(j,k){if(!i._monitorEvents){return k; +}return i._monitorEvents[j]||k;}};};var g=function(k){if(k.indexOf(":")==-1||!h){return null;}var j=Slick.parse(k).expressions[0][0],p=j.pseudos,i=p.length,o=[]; +while(i--){var n=p[i].key,m=h[n];if(m!=null){o.push({event:j.tag,value:p[i].value,pseudo:n,original:k,listener:m});}}return o.length?o:null;};return{addEvent:function(m,p,j){var n=g(m); +if(!n){return e.call(this,m,p,j);}var k=c(this),r=k.retrieve(m,[]),i=n[0].event,l=Array.slice(arguments,2),o=p,q=this;n.each(function(s){var t=s.listener,u=o; +if(t==false){i+=":"+s.pseudo+"("+s.value+")";}else{o=function(){t.call(q,s,u,arguments,o);};}});r.include({type:i,event:p,monitor:o});k.store(m,r);if(m!=i){e.apply(this,[m,p].concat(l)); +}return e.apply(this,[i,o].concat(l));},removeEvent:function(m,l){var k=g(m);if(!k){return f.call(this,m,l);}var n=c(this),j=n.retrieve(m);if(!j){return this; +}var i=Array.slice(arguments,2);f.apply(this,[m,l].concat(i));j.each(function(o,p){if(!l||o.event==l){f.apply(this,[o.type,o.monitor].concat(i));}delete j[p]; +},this);n.store(m,j);return this;}};};var b={once:function(e,f,d,c){f.apply(this,d);this.removeEvent(e.event,c).removeEvent(e.original,f);},throttle:function(d,e,c){if(!e._throttled){e.apply(this,c); +e._throttled=setTimeout(function(){e._throttled=false;},d.value||250);}},pause:function(d,e,c){clearTimeout(e._pause);e._pause=e.delay(d.value||250,this,c); +}};Events.definePseudo=function(c,d){b[c]=d;return this;};Events.lookupPseudo=function(c){return b[c];};var a=Events.prototype;Events.implement(Events.Pseudos(b,a.addEvent,a.removeEvent)); +["Request","Fx"].each(function(c){if(this[c]){this[c].implement(Events.prototype);}});})();Class.refactor=function(b,a){Object.each(a,function(e,d){var c=b.prototype[d]; +c=(c&&c.$origin)||c||function(){};b.implement(d,(typeof e=="function")?function(){var f=this.previous;this.previous=c;var g=e.apply(this,arguments);this.previous=f; +return g;}:e);});return b;};Class.Mutators.Binds=function(a){if(!this.prototype.initialize){this.implement("initialize",function(){});}return Array.from(a).concat(this.prototype.Binds||[]); +};Class.Mutators.initialize=function(a){return function(){Array.from(this.Binds).each(function(b){var c=this[b];if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments); +};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property);if(a&&!this.occluded){return(this.occluded=a); +}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});(function(){var a={wait:function(b){return this.chain(function(){this.callChain.delay(b==null?500:b,this); +return this;}.bind(this));}};Chain.implement(a);if(this.Fx){Fx.implement(a);}if(this.Element&&Element.implement&&this.Fx){Element.implement({chains:function(b){Array.from(b||["tween","morph","reveal"]).each(function(c){c=this.get(c); +if(!c){return;}c.setOptions({link:"chain"});},this);return this;},pauseFx:function(c,b){this.chains(b).get(b||"tween").wait(c);return this;}});}})();(function(a){Array.implement({min:function(){return Math.min.apply(null,this); +},max:function(){return Math.max.apply(null,this);},average:function(){return this.length?this.sum()/this.length:0;},sum:function(){var b=0,c=this.length; +if(c){while(c--){b+=this[c];}}return b;},unique:function(){return[].combine(this);},shuffle:function(){for(var c=this.length;c&&--c;){var b=this[c],d=Math.floor(Math.random()*(c+1)); +this[c]=this[d];this[d]=b;}return this;},reduce:function(d,e){for(var c=0,b=this.length;c3&&a<21)?"th":["th","st","nd","rd","th"][Math.min(a%10,4)]; +},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",weekAgo:"1 week ago",weeksAgo:"{delta} weeks ago",monthAgo:"1 month ago",monthsAgo:"{delta} months ago",yearAgo:"1 year ago",yearsAgo:"{delta} years ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now",weekUntil:"1 week from now",weeksUntil:"{delta} weeks from now",monthUntil:"1 month from now",monthsUntil:"{delta} months from now",yearUntil:"1 year from now",yearsUntil:"{delta} years from now"}); +(function(){var a=this.Date;var f=a.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds","UTCMilliseconds"].each(function(s){a.Methods[s.toLowerCase()]=s; +});var p=function(u,t,s){if(t==1){return u;}return u28){return 1;}if(y==0&&s<-2){x=new a(x).decrement("day",u); +u=0;}w=new a(x.get("year"),0,1).get("day")||7;if(w>4){t=-7;}}else{w=new a(x.get("year"),0,1).get("day");}t+=x.get("dayofyear");t+=6-u;t+=(7+w-v)%7;return(t/7); +},getOrdinal:function(s){return a.getMsg("ordinal",s||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3"); +},getGMTOffset:function(){var s=this.get("timezoneOffset");return((s>0)?"-":"+")+p((s.abs()/60).floor(),2)+p(s%60,2);},setAMPM:function(s){s=s.toUpperCase(); +var t=this.get("hr");if(t>11&&s=="AM"){return this.decrement("hour",12);}else{if(t<12&&s=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM"; +},parse:function(s){this.set("time",a.parse(s));return this;},isValid:function(s){if(!s){s=this;}return typeOf(s)=="date"&&!isNaN(s.valueOf());},format:function(s){if(!this.isValid()){return"invalid date"; +}if(!s){s="%x %X";}if(typeof s=="string"){s=g[s.toLowerCase()]||s;}if(typeof s=="function"){return s(this);}var t=this;return s.replace(/%([a-z%])/gi,function(v,u){switch(u){case"a":return a.getMsg("days_abbr")[t.get("day")]; +case"A":return a.getMsg("days")[t.get("day")];case"b":return a.getMsg("months_abbr")[t.get("month")];case"B":return a.getMsg("months")[t.get("month")]; +case"c":return t.format("%a %b %d %H:%M:%S %Y");case"d":return p(t.get("date"),2);case"e":return p(t.get("date"),2," ");case"H":return p(t.get("hr"),2); +case"I":return p((t.get("hr")%12)||12,2);case"j":return p(t.get("dayofyear"),3);case"k":return p(t.get("hr"),2," ");case"l":return p((t.get("hr")%12)||12,2," "); +case"L":return p(t.get("ms"),3);case"m":return p((t.get("mo")+1),2);case"M":return p(t.get("min"),2);case"o":return t.get("ordinal");case"p":return a.getMsg(t.get("ampm")); +case"s":return Math.round(t/1000);case"S":return p(t.get("seconds"),2);case"T":return t.format("%H:%M:%S");case"U":return p(t.get("week"),2);case"w":return t.get("day"); +case"x":return t.format(a.getMsg("shortDate"));case"X":return t.format(a.getMsg("shortTime"));case"y":return t.get("year").toString().substr(2);case"Y":return t.get("year"); +case"z":return t.get("GMTOffset");case"Z":return t.get("Timezone");}return u;});},toISOString:function(){return this.format("iso8601");}}).alias({toJSON:"toISOString",compare:"diff",strftime:"format"}); +var k=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var g={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M",rfc822:function(s){return k[s.get("day")]+s.format(", %d ")+h[s.get("month")]+s.format(" %Y %H:%M:%S %Z"); +},rfc2822:function(s){return k[s.get("day")]+s.format(", %d ")+h[s.get("month")]+s.format(" %Y %H:%M:%S %z");},iso8601:function(s){return(s.getUTCFullYear()+"-"+p(s.getUTCMonth()+1,2)+"-"+p(s.getUTCDate(),2)+"T"+p(s.getUTCHours(),2)+":"+p(s.getUTCMinutes(),2)+":"+p(s.getUTCSeconds(),2)+"."+p(s.getUTCMilliseconds(),3)+"Z"); +}};var c=[],n=a.parse;var r=function(v,x,u){var t=-1,w=a.getMsg(v+"s");switch(typeOf(x)){case"object":t=w[x.get(v)];break;case"number":t=w[x];if(!t){throw new Error("Invalid "+v+" index: "+x); +}break;case"string":var s=w.filter(function(y){return this.test(y);},new RegExp("^"+x,"i"));if(!s.length){throw new Error("Invalid "+v+" string");}if(s.length>1){throw new Error("Ambiguous "+v); +}t=s[0];}return(u)?w.indexOf(t):t;};var i=1900,o=70;a.extend({getMsg:function(t,s){return Locale.get("Date."+t,s);},units:{ms:Function.from(1),second:Function.from(1000),minute:Function.from(60000),hour:Function.from(3600000),day:Function.from(86400000),week:Function.from(608400000),month:function(t,s){var u=new a; +return a.daysInMonth(t!=null?t:u.get("mo"),s!=null?s:u.get("year"))*86400000;},year:function(s){s=s||new a().get("year");return a.isLeapYear(s)?31622400000:31536000000; +}},daysInMonth:function(t,s){return[31,a.isLeapYear(s)?29:28,31,30,31,30,31,31,30,31,30,31][t];},isLeapYear:function(s){return((s%4===0)&&(s%100!==0))||(s%400===0); +},parse:function(v){var u=typeOf(v);if(u=="number"){return new a(v);}if(u!="string"){return v;}v=v.clean();if(!v.length){return null;}var s;c.some(function(w){var t=w.re.exec(v); +return(t)?(s=w.handler(t)):false;});if(!(s&&s.isValid())){s=new a(n(v));if(!(s&&s.isValid())){s=new a(v.toInt());}}return s;},parseDay:function(s,t){return r("day",s,t); +},parseMonth:function(t,s){return r("month",t,s);},parseUTC:function(t){var s=new a(t);var u=a.UTC(s.get("year"),s.get("mo"),s.get("date"),s.get("hr"),s.get("min"),s.get("sec"),s.get("ms")); +return new a(u);},orderIndex:function(s){return a.getMsg("dateOrder").indexOf(s)+1;},defineFormat:function(s,t){g[s]=t;return this;},parsePatterns:c,defineParser:function(s){c.push((s.re&&s.handler)?s:l(s)); +return this;},defineParsers:function(){Array.flatten(arguments).each(a.defineParser);return this;},define2DigitYearStart:function(s){o=s%100;i=s-o;return this; +}}).extend({defineFormats:a.defineFormat.overloadSetter()});var d=function(s){return new RegExp("(?:"+a.getMsg(s).map(function(t){return t.substr(0,3); +}).join("|")+")[a-z]*");};var m=function(s){switch(s){case"T":return"%H:%M:%S";case"x":return((a.orderIndex("month")==1)?"%m[-./]%d":"%d[-./]%m")+"([-./]%y)?"; +case"X":return"%H([.:]%M)?([.:]%S([.:]%s)?)? ?%p? ?%z?";}return null;};var j={d:/[0-2]?[0-9]|3[01]/,H:/[01]?[0-9]|2[0-3]/,I:/0?[1-9]|1[0-2]/,M:/[0-5]?\d/,s:/\d+/,o:/[a-z]*/,p:/[ap]\.?m\.?/,y:/\d{2}|\d{4}/,Y:/\d{4}/,z:/Z|[+-]\d{2}(?::?\d{2})?/}; +j.m=j.I;j.S=j.M;var e;var b=function(s){e=s;j.a=j.A=d("days");j.b=j.B=d("months");c.each(function(u,t){if(u.format){c[t]=l(u.format);}});};var l=function(u){if(!e){return{format:u}; +}var s=[];var t=(u.source||u).replace(/%([a-z])/gi,function(w,v){return m(v)||w;}).replace(/\((?!\?)/g,"(?:").replace(/ (?!\?|\*)/g,",? ").replace(/%([a-z%])/gi,function(w,v){var x=j[v]; +if(!x){return v;}s.push(v);return"("+x.source+")";}).replace(/\[a-z\]/gi,"[a-z\\u00c0-\\uffff;&]");return{format:u,re:new RegExp("^"+t+"$","i"),handler:function(y){y=y.slice(1).associate(s); +var v=new a().clearTime(),x=y.y||y.Y;if(x!=null){q.call(v,"y",x);}if("d" in y){q.call(v,"d",1);}if("m" in y||y.b||y.B){q.call(v,"m",1);}for(var w in y){q.call(v,w,y[w]); +}return v;}};};var q=function(s,t){if(!t){return this;}switch(s){case"a":case"A":return this.set("day",a.parseDay(t,true));case"b":case"B":return this.set("mo",a.parseMonth(t,true)); +case"d":return this.set("date",t);case"H":case"I":return this.set("hr",t);case"m":return this.set("mo",t-1);case"M":return this.set("min",t);case"p":return this.set("ampm",t.replace(/\./g,"")); +case"S":return this.set("sec",t);case"s":return this.set("ms",("0."+t)*1000);case"w":return this.set("day",t);case"Y":return this.set("year",t);case"y":t=+t; +if(t<100){t+=i+(t0.75*a){e=c;}break;}f/=a;e=c+"s";}f=f.round();return Date.getMsg(e+d,f).substitute({delta:f});}}).defineParsers({re:/^(?:tod|tom|yes)/i,handler:function(a){var b=new Date().clearTime(); +switch(a[0]){case"tom":return b.increment();case"yes":return b.decrement();default:return b;}}},{re:/^(next|last) ([a-z]+)$/i,handler:function(e){var f=new Date().clearTime(); +var b=f.getDay();var c=Date.parseDay(e[2],true);var a=c-b;if(c<=b){a+=7;}if(e[1]=="last"){a-=7;}return f.set("date",f.getDate()+a);}}).alias("timeAgoInWords","timeDiffInWords"); +Locale.define("en-US","Number",{decimal:".",group:",",currency:{prefix:"$ "}});Number.implement({format:function(q){var n=this;q=q?Object.clone(q):{};var a=function(i){if(q[i]!=null){return q[i]; +}return Locale.get("Number."+i);};var f=n<0,h=a("decimal"),k=a("precision"),o=a("group"),c=a("decimals");if(f){var e=a("negative")||{};if(e.prefix==null&&e.suffix==null){e.prefix="-"; +}["prefix","suffix"].each(function(i){if(e[i]){q[i]=a(i)+e[i];}});n=-n;}var l=a("prefix"),p=a("suffix");if(c!==""&&c>=0&&c<=20){n=n.toFixed(c);}if(k>=1&&k<=21){n=(+n).toPrecision(k); +}n+="";var m;if(a("scientific")===false&&n.indexOf("e")>-1){var j=n.split("e"),b=+j[1];n=j[0].replace(".","");if(b<0){b=-b-1;m=j[0].indexOf(".");if(m>-1){b-=m-1; +}while(b--){n="0"+n;}n="0."+n;}else{m=j[0].lastIndexOf(".");if(m>-1){b-=j[0].length-m-1;}while(b--){n+="0";}}}if(h!="."){n=n.replace(".",h);}if(o){m=n.lastIndexOf(h); +m=(m>-1)?m:n.length;var d=n.substring(m),g=m;while(g--){if((m-g-1)%3==0&&g!=(m-1)){d=o+d;}d=n.charAt(g)+d;}n=d;}if(l){n=l+n;}if(p){n+=p;}return n;},formatCurrency:function(b){var a=Locale.get("Number.currency")||{}; +if(a.scientific==null){a.scientific=false;}a.decimals=b!=null?b:(a.decimals==null?2:a.decimals);return this.format(a);},formatPercentage:function(b){var a=Locale.get("Number.percentage")||{}; +if(a.suffix==null){a.suffix="%";}a.decimals=b!=null?b:(a.decimals==null?2:a.decimals);return this.format(a);}});(function(){var c={a:/[àáâãäåăą]/g,A:/[ÀÃÂÃÄÅĂĄ]/g,c:/[ćÄç]/g,C:/[ĆČÇ]/g,d:/[ÄÄ‘]/g,D:/[ÄŽÃ]/g,e:/[èéêëěę]/g,E:/[ÈÉÊËĚĘ]/g,g:/[ÄŸ]/g,G:/[Äž]/g,i:/[ìíîï]/g,I:/[ÃŒÃÃŽÃ]/g,l:/[ĺľł]/g,L:/[ĹĽÅ]/g,n:/[ñňń]/g,N:/[ÑŇŃ]/g,o:/[òóôõöøő]/g,O:/[ÒÓÔÕÖØ]/g,r:/[řŕ]/g,R:/[ŘŔ]/g,s:/[Å¡Å¡ÅŸ]/g,S:/[ŠŞŚ]/g,t:/[ťţ]/g,T:/[ŤŢ]/g,ue:/[ü]/g,UE:/[Ãœ]/g,u:/[ùúûůµ]/g,U:/[ÙÚÛŮ]/g,y:/[ÿý]/g,Y:/[ŸÃ]/g,z:/[žźż]/g,Z:/[ŽŹŻ]/g,th:/[þ]/g,TH:/[Þ]/g,dh:/[ð]/g,DH:/[Ã]/g,ss:/[ß]/g,oe:/[Å“]/g,OE:/[Å’]/g,ae:/[æ]/g,AE:/[Æ]/g},b={" ":/[\xa0\u2002\u2003\u2009]/g,"*":/[\xb7]/g,"'":/[\u2018\u2019]/g,'"':/[\u201c\u201d]/g,"...":/[\u2026]/g,"-":/[\u2013]/g,"»":/[\uFFFD]/g}; +var a=function(f,h){var e=f,g;for(g in h){e=e.replace(h[g],g);}return e;};var d=function(e,g){e=e||"";var h=g?"<"+e+"(?!\\w)[^>]*>([\\s\\S]*?)":"]+)?>",f=new RegExp(h,"gi"); +return f;};String.implement({standardize:function(){return a(this,c);},repeat:function(e){return new Array(e+1).join(this);},pad:function(e,h,g){if(this.length>=e){return this; +}var f=(h==null?" ":""+h).repeat(e-this.length).substr(0,e-this.length);if(!g||g=="right"){return this+f;}if(g=="left"){return f+this;}return f.substr(0,(f.length/2).floor())+this+f.substr(0,(f.length/2).ceil()); +},getTags:function(e,f){return this.match(d(e,f))||[];},stripTags:function(e,f){return this.replace(d(e,f),"");},tidy:function(){return a(this,b);},truncate:function(e,f,i){var h=this; +if(f==null&&arguments.length==1){f="…";}if(h.length>e){h=h.substring(0,e);if(i){var g=h.lastIndexOf(i);if(g!=-1){h=h.substr(0,g);}}if(f){h+=f;}}return h; +}});})();String.implement({parseQueryString:function(d,a){if(d==null){d=true;}if(a==null){a=true;}var c=this.split(/[&;]/),b={};if(!c.length){return b; +}c.each(function(i){var e=i.indexOf("=")+1,g=e?i.substr(e):"",f=e?i.substr(0,e-1).match(/([^\]\[]+|(\B)(?=\]))/g):[i],h=b;if(!f){return;}if(a){g=decodeURIComponent(g); +}f.each(function(k,j){if(d){k=decodeURIComponent(k);}var l=h[k];if(j0){c.pop(); +}else{if(f!="."){c.push(f);}}});return c.join("/")+"/";},combine:function(c){return c.value||c.scheme+"://"+(c.user?c.user+(c.password?":"+c.password:"")+"@":"")+(c.host||"")+(c.port&&c.port!=this.schemes[c.scheme]?":"+c.port:"")+(c.directory||"/")+(c.file||"")+(c.query?"?"+c.query:"")+(c.fragment?"#"+c.fragment:""); +},set:function(d,f,e){if(d=="value"){var c=f.match(a.regs.scheme);if(c){c=c[1];}if(c&&this.schemes[c.toLowerCase()]==null){this.parsed={scheme:c,value:f}; +}else{this.parsed=this.parse(f,(e||this).parsed)||(c?{scheme:c,value:f}:{value:f});}}else{if(d=="data"){this.setData(f);}else{this.parsed[d]=f;}}return this; +},get:function(c,d){switch(c){case"value":return this.combine(this.parsed,d?d.parsed:false);case"data":return this.getData();}return this.parsed[c]||""; +},go:function(){document.location.href=this.toString();},toURI:function(){return this;},getData:function(e,d){var c=this.get(d||"query");if(!(c||c===0)){return e?null:{}; +}var f=c.parseQueryString();return e?f[e]:f;},setData:function(c,f,d){if(typeof c=="string"){var e=this.getData();e[arguments[0]]=arguments[1];c=e;}else{if(f){c=Object.merge(this.getData(),c); +}}return this.set(d||"query",Object.toQueryString(c));},clearData:function(c){return this.set(c||"query","");},toString:b,valueOf:b});a.regs={endSlash:/\/$/,scheme:/^(\w+):/,directoryDot:/\.\/|\.$/}; +a.base=new a(Array.from(document.getElements("base[href]",true)).getLast(),{base:document.location});String.implement({toURI:function(c){return new a(this,c); +}});})();URI=Class.refactor(URI,{combine:function(f,e){if(!e||f.scheme!=e.scheme||f.host!=e.host||f.port!=e.port){return this.previous.apply(this,arguments); +}var a=f.file+(f.query?"?"+f.query:"")+(f.fragment?"#"+f.fragment:"");if(!e.directory){return(f.directory||(f.file?"":"./"))+a;}var d=e.directory.split("/"),c=f.directory.split("/"),g="",h; +var b=0;for(h=0;h=0||g.parentPositioned||d.allowNegative)?c.x:0).toInt(); +c.top=((c.y>=0||g.parentPositioned||d.allowNegative)?c.y:0).toInt();a.toMinMax(c,d);if(d.relFixedPosition||f.getStyle("position")=="fixed"){a.toRelFixedPosition(f,c); +}if(d.ignoreScroll){a.toIgnoreScroll(f,c);}if(d.ignoreMargins){a.toIgnoreMargins(c,d);}c.left=Math.ceil(c.left);c.top=Math.ceil(c.top);delete c.x;delete c.y; +return c;},setPositionCoordinates:function(k,g,d){var f=k.offset.y,h=k.offset.x,e=(d==document.body)?window.getScroll():d.getPosition(),j=e.y,c=e.x,i=window.getSize(); +switch(k.position.x){case"left":g.x=c+h;break;case"right":g.x=c+h+d.offsetWidth;break;default:g.x=c+((d==document.body?i.x:d.offsetWidth)/2)+h;break;}switch(k.position.y){case"top":g.y=j+f; +break;case"bottom":g.y=j+f+d.offsetHeight;break;default:g.y=j+((d==document.body?i.y:d.offsetHeight)/2)+f;break;}},toMinMax:function(c,d){var f={left:"x",top:"y"},e; +["minimum","maximum"].each(function(g){["left","top"].each(function(h){e=d[g]?d[g][f[h]]:null;if(e!=null&&((g=="minimum")?c[h]e)){c[h]=e;}});}); +},toRelFixedPosition:function(e,c){var d=window.getScroll();c.top+=d.y;c.left+=d.x;},toIgnoreScroll:function(e,d){var c=e.getScroll();d.top-=c.y;d.left-=c.x; +},toIgnoreMargins:function(c,d){c.left+=d.edge.x=="right"?d.dimensions["margin-right"]:(d.edge.x!="center"?-d.dimensions["margin-left"]:-d.dimensions["margin-left"]+((d.dimensions["margin-right"]+d.dimensions["margin-left"])/2)); +c.top+=d.edge.y=="bottom"?d.dimensions["margin-bottom"]:(d.edge.y!="center"?-d.dimensions["margin-top"]:-d.dimensions["margin-top"]+((d.dimensions["margin-bottom"]+d.dimensions["margin-top"])/2)); +},toEdge:function(c,d){var e={},g=d.dimensions,f=d.edge;switch(f.x){case"left":e.x=0;break;case"right":e.x=-g.x-g.computedRight-g.computedLeft;break;default:e.x=-(Math.round(g.totalWidth/2)); +break;}switch(f.y){case"top":e.y=0;break;case"bottom":e.y=-g.y-g.computedTop-g.computedBottom;break;default:e.y=-(Math.round(g.totalHeight/2));break;}c.x+=e.x; +c.y+=e.y;},getCoordinateFromValue:function(c){if(typeOf(c)!="string"){return c;}c=c.toLowerCase();return{x:c.test("left")?"left":(c.test("right")?"right":"center"),y:c.test(/upper|top/)?"top":(c.test("bottom")?"bottom":"center")}; +}};Element.implement({position:function(d){if(d&&(d.x!=null||d.y!=null)){return(b?b.apply(this,arguments):this);}var c=this.setStyle("position","absolute").calculatePosition(d); +return(d&&d.returnPos)?c:this.setStyles(c);},calculatePosition:function(c){return a.getPosition(this,c);}});})(Element.prototype.position);Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; +},isVisible:function(){var a=this.offsetWidth,b=this.offsetHeight;return(a==0&&b==0)?false:(a>0&&b>0)?true:this.style.display!="none";},toggle:function(){return this[this.isDisplayed()?"hide":"show"](); +},hide:function(){var b;try{b=this.getStyle("display");}catch(a){}if(b=="none"){return this;}return this.store("element:_originalDisplay",b||"").setStyle("display","none"); +},show:function(a){if(!a&&this.isDisplayed()){return this;}a=a||this.retrieve("element:_originalDisplay")||"block";return this.setStyle("display",(a=="none")?"block":a); +},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Document.implement({clearSelection:function(){if(window.getSelection){var a=window.getSelection(); +if(a&&a.removeAllRanges){a.removeAllRanges();}}else{if(document.selection&&document.selection.empty){try{document.selection.empty();}catch(b){}}}}});var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.ie6||(Browser.firefox&&Browser.version<3&&Browser.Platform.mac))},property:"IframeShim",initialize:function(b,a){this.element=document.id(b); +if(this.occlude()){return this.occluded;}this.setOptions(a);this.makeShim();return this;},makeShim:function(){if(this.options.browsers){var c=this.element.getStyle("zIndex").toInt(); +if(!c){c=1;var b=this.element.getStyle("position");if(b=="static"||!b){this.element.setStyle("position","relative");}this.element.setStyle("zIndex",c); +}c=((this.options.zIndex!=null||this.options.zIndex===0)&&c>this.options.zIndex)?this.options.zIndex:c-1;if(c<0){c=1;}this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:c,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this); +var a=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject");}).bind(this);if(!IframeShim.ready){window.addEvent("load",a); +}else{a();}}else{this.position=this.hide=this.show=this.dispose=Function.from(this);}},position:function(){if(!IframeShim.ready||!this.shim){return this; +}var a=this.element.measure(function(){return this.getSize();});if(this.options.margin!=undefined){a.x=a.x-(this.options.margin*2);a.y=a.y-(this.options.margin*2); +this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin;}this.shim.set({width:a.x,height:a.y}).position({relativeTo:this.element,offset:this.options.offset}); +return this;},hide:function(){if(this.shim){this.shim.setStyle("display","none");}return this;},show:function(){if(this.shim){this.shim.setStyle("display","block"); +}return this.position();},dispose:function(){if(this.shim){this.shim.dispose();}return this;},destroy:function(){if(this.shim){this.shim.destroy();}return this; +}});window.addEvent("load",function(){IframeShim.ready=true;});var Mask=new Class({Implements:[Options,Events],Binds:["position"],options:{style:{},"class":"mask",maskMargins:false,useIframeShim:true,iframeShimOptions:{}},initialize:function(b,a){this.target=document.id(b)||document.id(document.body); +this.target.store("mask",this);this.setOptions(a);this.render();this.inject();},render:function(){this.element=new Element("div",{"class":this.options["class"],id:this.options.id||"mask-"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:"none"}),events:{click:function(a){this.fireEvent("click",a); +if(this.options.hideOnClick){this.hide();}}.bind(this)}});this.hidden=true;},toElement:function(){return this.element;},inject:function(b,a){a=a||(this.options.inject?this.options.inject.where:"")||this.target==document.body?"inside":"after"; +b=b||(this.options.inject&&this.options.inject.target)||this.target;this.element.inject(b,a);if(this.options.useIframeShim){this.shim=new IframeShim(this.element,this.options.iframeShimOptions); +this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)});}},position:function(){this.resize(this.options.width,this.options.height); +this.element.position({relativeTo:this.target,position:"topLeft",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body});return this; +},resize:function(a,e){var b={styles:["padding","border"]};if(this.options.maskMargins){b.styles.push("margin");}var d=this.target.getComputedSize(b);if(this.target==document.body){this.element.setStyles({width:0,height:0}); +var c=window.getScrollSize();if(d.totalHeight=0&&a.options[a.selectedIndex].value!=""); +}else{return((a.get("value")==null)||(a.get("value").length==0));}}});Form.Validator.addAllThese([["required",{errorMsg:function(){return Form.Validator.getMsg("required"); +},test:function(a){return !Form.Validator.getValidator("IsEmpty").test(a);}}],["length",{errorMsg:function(a,b){if(typeOf(b.length)!="null"){return Form.Validator.getMsg("length").substitute({length:b.length,elLength:a.get("value").length}); +}else{return"";}},test:function(a,b){if(typeOf(b.length)!="null"){return(a.get("value").length==b.length||a.get("value").length==0);}else{return true;}}}],["minLength",{errorMsg:function(a,b){if(typeOf(b.minLength)!="null"){return Form.Validator.getMsg("minLength").substitute({minLength:b.minLength,length:a.get("value").length}); +}else{return"";}},test:function(a,b){if(typeOf(b.minLength)!="null"){return(a.get("value").length>=(b.minLength||0));}else{return true;}}}],["maxLength",{errorMsg:function(a,b){if(typeOf(b.maxLength)!="null"){return Form.Validator.getMsg("maxLength").substitute({maxLength:b.maxLength,length:a.get("value").length}); +}else{return"";}},test:function(a,b){return a.get("value").length<=(b.maxLength||10000);}}],["validate-integer",{errorMsg:Form.Validator.getMsg.pass("integer"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(-?[1-9]\d*|0)$/).test(a.get("value")); +}}],["validate-numeric",{errorMsg:Form.Validator.getMsg.pass("numeric"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(a.get("value")); +}}],["validate-digits",{errorMsg:Form.Validator.getMsg.pass("digits"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^[\d() .:\-\+#]+$/.test(a.get("value"))); +}}],["validate-alpha",{errorMsg:Form.Validator.getMsg.pass("alpha"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^[a-zA-Z]+$/).test(a.get("value")); +}}],["validate-alphanum",{errorMsg:Form.Validator.getMsg.pass("alphanum"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||!(/\W/).test(a.get("value")); +}}],["validate-date",{errorMsg:function(a,b){if(Date.parse){var c=b.dateFormat||"%x";return Form.Validator.getMsg("dateSuchAs").substitute({date:new Date().format(c)}); +}else{return Form.Validator.getMsg("dateInFormatMDY");}},test:function(e,g){if(Form.Validator.getValidator("IsEmpty").test(e)){return true;}var a=Locale.getCurrent().sets.Date,b=new RegExp([a.days,a.days_abbr,a.months,a.months_abbr].flatten().join("|"),"i"),i=e.get("value"),f=i.match(/[a-z]+/gi); +if(f&&!f.every(b.exec,b)){return false;}var c=Date.parse(i),h=g.dateFormat||"%x",d=c.format(h);if(d!="invalid date"){e.set("value",d);}return c.isValid(); +}}],["validate-email",{errorMsg:Form.Validator.getMsg.pass("email"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(a.get("value")); +}}],["validate-url",{errorMsg:Form.Validator.getMsg.pass("url"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(a.get("value")); +}}],["validate-currency-dollar",{errorMsg:Form.Validator.getMsg.pass("currencyDollar"),test:function(a){return Form.Validator.getValidator("IsEmpty").test(a)||(/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/).test(a.get("value")); +}}],["validate-one-required",{errorMsg:Form.Validator.getMsg.pass("oneRequired"),test:function(a,b){var c=document.id(b["validate-one-required"])||a.getParent(b["validate-one-required"]); +return c.getElements("input").some(function(d){if(["checkbox","radio"].contains(d.get("type"))){return d.get("checked");}return d.get("value");});}}]]); +Element.Properties.validator={set:function(a){this.get("validator").setOptions(a);},get:function(){var a=this.retrieve("validator");if(!a){a=new Form.Validator(this); +this.store("validator",a);}return a;}};Element.implement({validate:function(a){if(a){this.set("validator",a);}return this.get("validator").validate();}}); +var FormValidator=Form.Validator;Form.Validator.Inline=new Class({Extends:Form.Validator,options:{showError:function(a){if(a.reveal){a.reveal();}else{a.setStyle("display","block"); +}},hideError:function(a){if(a.dissolve){a.dissolve();}else{a.setStyle("display","none");}},scrollToErrorsOnSubmit:true,scrollToErrorsOnBlur:false,scrollToErrorsOnChange:false,scrollFxOptions:{transition:"quad:out",offset:{y:-20}}},initialize:function(b,a){this.parent(b,a); +this.addEvent("onElementValidate",function(g,f,e,h){var d=this.getValidator(e);if(!g&&d.getError(f)){if(h){f.addClass("warning");}var c=this.makeAdvice(e,f,d.getError(f),h); +this.insertAdvice(c,f);this.showAdvice(e,f);}else{this.hideAdvice(e,f);}});},makeAdvice:function(d,f,c,g){var e=(g)?this.warningPrefix:this.errorPrefix; +e+=(this.options.useTitles)?f.title||c:c;var a=(g)?"warning-advice":"validation-advice";var b=this.getAdvice(d,f);if(b){b=b.set("html",e);}else{b=new Element("div",{html:e,styles:{display:"none"},id:"advice-"+d.split(":")[0]+"-"+this.getFieldId(f)}).addClass(a); +}f.store("$moo:advice-"+d,b);return b;},getFieldId:function(a){return a.id?a.id:a.id="input_"+a.name;},showAdvice:function(b,c){var a=this.getAdvice(b,c); +if(a&&!c.retrieve("$moo:"+this.getPropName(b))&&(a.getStyle("display")=="none"||a.getStyle("visiblity")=="hidden"||a.getStyle("opacity")==0)){c.store("$moo:"+this.getPropName(b),true); +this.options.showError(a);this.fireEvent("showAdvice",[c,a,b]);}},hideAdvice:function(b,c){var a=this.getAdvice(b,c);if(a&&c.retrieve("$moo:"+this.getPropName(b))){c.store("$moo:"+this.getPropName(b),false); +this.options.hideError(a);this.fireEvent("hideAdvice",[c,a,b]);}},getPropName:function(a){return"advice"+a;},resetField:function(a){a=document.id(a);if(!a){return this; +}this.parent(a);a.get("validators").each(function(b){this.hideAdvice(b,a);},this);return this;},getAllAdviceMessages:function(d,c){var b=[];if(d.hasClass("ignoreValidation")&&!c){return b; +}var a=d.get("validators").some(function(g){var e=g.test("^warn-")||d.hasClass("warnOnly");if(e){g=g.replace(/^warn-/,"");}var f=this.getValidator(g);if(!f){return; +}b.push({message:f.getError(d),warnOnly:e,passed:f.test(),validator:f});},this);return b;},getAdvice:function(a,b){return b.retrieve("$moo:advice-"+a); +},insertAdvice:function(a,c){var b=c.get("validatorProps");if(!b.msgPos||!document.id(b.msgPos)){if(c.type&&c.type.toLowerCase()=="radio"){c.getParent().adopt(a); +}else{a.inject(document.id(c),"after");}}else{document.id(b.msgPos).grab(a);}},validateField:function(g,f,b){var a=this.parent(g,f);if(((this.options.scrollToErrorsOnSubmit&&b==null)||b)&&!a){var c=document.id(this).getElement(".validation-failed"); +var d=document.id(this).getParent();while(d!=document.body&&d.getScrollSize().y==d.getSize().y){d=d.getParent();}var e=d.retrieve("$moo:fvScroller");if(!e&&window.Fx&&Fx.Scroll){e=new Fx.Scroll(d,this.options.scrollFxOptions); +d.store("$moo:fvScroller",e);}if(c){if(e){e.toElement(c);}else{d.scrollTo(d.getScroll().x,c.getPosition(d).y-20);}}}return a;},watchFields:function(a){a.each(function(b){if(this.options.evaluateFieldsOnBlur){b.addEvent("blur",this.validationMonitor.pass([b,false,this.options.scrollToErrorsOnBlur],this)); +}if(this.options.evaluateFieldsOnChange){b.addEvent("change",this.validationMonitor.pass([b,true,this.options.scrollToErrorsOnChange],this));}},this);}}); +Form.Validator.addAllThese([["validate-enforce-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator");if(!c){return true;}(b.toEnforce||document.id(b.enforceChildrenOf).getElements("input, select, textarea")).map(function(d){if(a.checked){c.enforceField(d); +}else{c.ignoreField(d);c.resetField(d);}});return true;}}],["validate-ignore-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator"); +if(!c){return true;}(b.toIgnore||document.id(b.ignoreChildrenOf).getElements("input, select, textarea")).each(function(d){if(a.checked){c.ignoreField(d); +c.resetField(d);}else{c.enforceField(d);}});return true;}}],["validate-nospace",{errorMsg:function(){return Form.Validator.getMsg("noSpace");},test:function(a,b){return !a.get("value").test(/\s/); +}}],["validate-toggle-oncheck",{test:function(b,c){var d=b.getParent("form").retrieve("validator");if(!d){return true;}var a=c.toToggle||document.id(c.toToggleChildrenOf).getElements("input, select, textarea"); +if(!b.checked){a.each(function(e){d.ignoreField(e);d.resetField(e);});}else{a.each(function(e){d.enforceField(e);});}return true;}}],["validate-reqchk-bynode",{errorMsg:function(){return Form.Validator.getMsg("reqChkByNode"); +},test:function(a,b){return(document.id(b.nodeId).getElements(b.selector||"input[type=checkbox], input[type=radio]")).some(function(c){return c.checked; +});}}],["validate-required-check",{errorMsg:function(a,b){return b.useTitle?a.get("title"):Form.Validator.getMsg("requiredChk");},test:function(a,b){return !!a.checked; +}}],["validate-reqchk-byname",{errorMsg:function(a,b){return Form.Validator.getMsg("reqChkByName").substitute({label:b.label||a.get("type")});},test:function(b,d){var c=d.groupName||b.get("name"); +var a=$$(document.getElementsByName(c)).some(function(g,f){return g.checked;});var e=b.getParent("form").retrieve("validator");if(a&&e){e.resetField(b); +}return a;}}],["validate-match",{errorMsg:function(a,b){return Form.Validator.getMsg("match").substitute({matchName:b.matchName||document.id(b.matchInput).get("name")}); +},test:function(b,c){var d=b.get("value");var a=document.id(c.matchInput)&&document.id(c.matchInput).get("value");return d&&a?d==a:true;}}],["validate-after-date",{errorMsg:function(a,b){return Form.Validator.getMsg("afterDate").substitute({label:b.afterLabel||(b.afterElement?Form.Validator.getMsg("startDate"):Form.Validator.getMsg("currentDate"))}); +},test:function(b,c){var d=document.id(c.afterElement)?Date.parse(document.id(c.afterElement).get("value")):new Date();var a=Date.parse(b.get("value")); +return a&&d?a>=d:true;}}],["validate-before-date",{errorMsg:function(a,b){return Form.Validator.getMsg("beforeDate").substitute({label:b.beforeLabel||(b.beforeElement?Form.Validator.getMsg("endDate"):Form.Validator.getMsg("currentDate"))}); +},test:function(b,c){var d=Date.parse(b.get("value"));var a=document.id(c.beforeElement)?Date.parse(document.id(c.beforeElement).get("value")):new Date(); +return a&&d?a>=d:true;}}],["validate-custom-required",{errorMsg:function(){return Form.Validator.getMsg("required");},test:function(a,b){return a.get("value")!=b.emptyValue; +}}],["validate-same-month",{errorMsg:function(a,b){var c=document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value");var d=a.get("value");if(d!=""){return Form.Validator.getMsg(c?"sameMonth":"startMonth"); +}},test:function(a,b){var d=Date.parse(a.get("value"));var c=Date.parse(document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value"));return d&&c?d.format("%B")==c.format("%B"):true; +}}],["validate-cc-num",{errorMsg:function(a){var b=a.get("value").replace(/[^0-9]/g,"");return Form.Validator.getMsg("creditcard").substitute({length:b.length}); +},test:function(c){if(Form.Validator.getValidator("IsEmpty").test(c)){return true;}var g=c.get("value");g=g.replace(/[^0-9]/g,"");var a=false;if(g.test(/^4[0-9]{12}([0-9]{3})?$/)){a="Visa"; +}else{if(g.test(/^5[1-5]([0-9]{14})$/)){a="Master Card";}else{if(g.test(/^3[47][0-9]{13}$/)){a="American Express";}else{if(g.test(/^6011[0-9]{12}$/)){a="Discover"; +}}}}if(a){var d=0;var e=0;for(var b=g.length-1;b>=0;--b){e=g.charAt(b).toInt();if(e==0){continue;}if((g.length-b)%2==0){e+=e;}if(e>9){e=e.toString().charAt(0).toInt()+e.toString().charAt(1).toInt(); +}d+=e;}if((d%10)==0){return true;}}var f="";while(g!=""){f+=" "+g.substr(0,4);g=g.substr(4);}c.getParent("form").retrieve("validator").ignoreField(c);c.set("value",f.clean()); +c.getParent("form").retrieve("validator").enforceField(c);return false;}}]]);var OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:["reposition","assert","focus","hide"],options:{element:"label",labelClass:"overTxtLabel",positionOptions:{position:"upperLeft",edge:"upperLeft",offset:{x:4,y:2}},poll:false,pollInterval:250,wrap:false},property:"OverText",initialize:function(b,a){b=this.element=document.id(b); +if(this.occlude()){return this.occluded;}this.setOptions(a);this.attach(b);OverText.instances.push(this);if(this.options.poll){this.poll();}},toElement:function(){return this.element; +},attach:function(){var b=this.element,a=this.options,c=a.textOverride||b.get("alt")||b.get("title");if(!c){return this;}var d=this.text=new Element(a.element,{"class":a.labelClass,styles:{lineHeight:"normal",position:"absolute",cursor:"text"},html:c,events:{click:this.hide.pass(a.element=="label",this)}}).inject(b,"after"); +if(a.element=="label"){if(!b.get("id")){b.set("id","input_"+String.uniqueID());}d.set("for",b.get("id"));}if(a.wrap){this.textHolder=new Element("div.overTxtWrapper",{styles:{lineHeight:"normal",position:"relative"}}).grab(d).inject(b,"before"); +}return this.enable();},destroy:function(){this.element.eliminate(this.property);this.disable();if(this.text){this.text.destroy();}if(this.textHolder){this.textHolder.destroy(); +}return this;},disable:function(){this.element.removeEvents({focus:this.focus,blur:this.assert,change:this.assert});window.removeEvent("resize",this.reposition); +this.hide(true,true);return this;},enable:function(){this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert});window.addEvent("resize",this.reposition); +this.reposition();return this;},wrap:function(){if(this.options.element=="label"){if(!this.element.get("id")){this.element.set("id","input_"+String.uniqueID()); +}this.text.set("for",this.element.get("id"));}},startPolling:function(){this.pollingPaused=false;return this.poll();},poll:function(a){if(this.poller&&!a){return this; +}if(a){clearInterval(this.poller);}else{this.poller=(function(){if(!this.pollingPaused){this.assert(true);}}).periodical(this.options.pollInterval,this); +}return this;},stopPolling:function(){this.pollingPaused=true;return this.poll(true);},focus:function(){if(this.text&&(!this.text.isDisplayed()||this.element.get("disabled"))){return this; +}return this.hide();},hide:function(c,a){if(this.text&&(this.text.isDisplayed()&&(!this.element.get("disabled")||a))){this.text.hide();this.fireEvent("textHide",[this.text,this.element]); +this.pollingPaused=true;if(!c){try{this.element.fireEvent("focus");this.element.focus();}catch(b){}}}return this;},show:function(){if(this.text&&!this.text.isDisplayed()){this.text.show(); +this.reposition();this.fireEvent("textShow",[this.text,this.element]);this.pollingPaused=false;}return this;},test:function(){return !this.element.get("value"); +},assert:function(a){return this[this.test()?"show":"hide"](a);},reposition:function(){this.assert(true);if(!this.element.isVisible()){return this.stopPolling().hide(); +}if(this.text&&this.test()){this.text.position(Object.merge(this.options.positionOptions,{relativeTo:this.element}));}return this;}});OverText.instances=[]; +Object.append(OverText,{each:function(a){return OverText.instances.each(function(c,b){if(c.element&&c.text){a.call(OverText,c,b);}});},update:function(){return OverText.each(function(a){return a.reposition(); +});},hideAll:function(){return OverText.each(function(a){return a.hide(true,true);});},showAll:function(){return OverText.each(function(a){return a.show(); +});}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a);},compute:function(g,h,j){var c={}; +for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c;},set:function(b){for(var c in b){if(!this.elements[c]){continue; +}var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this;}var h={},j={}; +for(var d in c){if(!this.elements[d]){continue;}var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from; +g[b]=e.to;}}return this.parent(h,j);}});Fx.Accordion=new Class({Extends:Fx.Elements,options:{fixedHeight:false,fixedWidth:false,display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:"click",initialDisplayFx:true,resetHeight:true},initialize:function(){var g=function(h){return h!=null; +};var f=Array.link(arguments,{container:Type.isElement,options:Type.isObject,togglers:g,elements:g});this.parent(f.elements,f.options);var b=this.options,e=this.togglers=$$(f.togglers); +this.previous=-1;this.internalChain=new Chain();if(b.alwaysHide){this.options.link="chain";}if(b.show||this.options.show===0){b.display=false;this.previous=b.show; +}if(b.start){b.display=false;b.show=false;}var d=this.effects={};if(b.opacity){d.opacity="fullOpacity";}if(b.width){d.width=b.fixedWidth?"fullWidth":"offsetWidth"; +}if(b.height){d.height=b.fixedHeight?"fullHeight":"scrollHeight";}for(var c=0,a=e.length;c=0?a-1:0)).chain(d);}else{d();}return this;},detach:function(b){var a=function(c){c.removeEvent(this.options.trigger,c.retrieve("accordion:display")); +}.bind(this);if(!b){this.togglers.each(a);}else{a(b);}return this;},display:function(b,c){if(!this.check(b,c)){return this;}var h={},g=this.elements,a=this.options,f=this.effects; +if(c==null){c=true;}if(typeOf(b)=="element"){b=g.indexOf(b);}if(b==this.previous&&!a.alwaysHide){return this;}if(a.resetHeight){var e=g[this.previous]; +if(e&&!this.selfHidden){for(var d in f){e.setStyle(d,e[f[d]]);}}}if((this.timer&&a.link=="chain")||(b===this.previous&&!a.alwaysHide)){return this;}this.previous=b; +this.selfHidden=false;g.each(function(l,k){h[k]={};var j;if(k!=b){j=true;}else{if(a.alwaysHide&&((l.offsetHeight>0&&a.height)||l.offsetWidth>0&&a.width)){j=true; +this.selfHidden=true;}}this.fireEvent(j?"background":"active",[this.togglers[k],l]);for(var m in f){h[k][m]=j?0:l[f[m]];}if(!c&&!j&&a.resetHeight){h[k].height="auto"; +}},this);this.internalChain.clearChain();this.internalChain.chain(function(){if(a.resetHeight&&!this.selfHidden){var i=g[b];if(i){i.setStyle("height","auto"); +}}}.bind(this));return c?this.start(h):this.set(h).internalChain.callChain();}});var Accordion=new Class({Extends:Fx.Accordion,initialize:function(){this.parent.apply(this,arguments); +var a=Array.link(arguments,{container:Type.isElement});this.container=a.container;},addSection:function(c,b,e){c=document.id(c);b=document.id(b);var d=this.togglers.contains(c); +var a=this.togglers.length;if(a&&(!d||e)){e=e!=null?e:a-1;c.inject(this.togglers[e],"before");b.inject(c,"after");}else{if(this.container&&!d){c.inject(this.container); +b.inject(this.container);}}return this.parent.apply(this,arguments);}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(a){var b=this.element,c=b.getStyles("top","left"); +if(c.top=="auto"||c.left=="auto"){b.setPosition(b.getPosition(b.getOffsetParent()));}return this.parent(b.position(Object.merge({},this.options,a,{returnPos:true}))); +}});Element.Properties.move={set:function(a){this.get("move").cancel().setOptions(a);return this;},get:function(){var a=this.retrieve("move");if(!a){a=new Fx.Move(this,{link:"cancel"}); +this.store("move",a);}return a;}};Element.implement({move:function(a){this.get("move").start(a);return this;}});(function(){Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(c,b){this.element=this.subject=document.id(c); +this.parent(b);if(typeOf(this.element)!="element"){this.element=document.id(this.element.getDocument().body);}if(this.options.wheelStops){var d=this.element,e=this.cancel.pass(false,this); +this.addEvent("start",function(){d.addEvent("mousewheel",e);},true);this.addEvent("complete",function(){d.removeEvent("mousewheel",e);},true);}},set:function(){var b=Array.flatten(arguments); +if(Browser.firefox){b=[Math.round(b[0]),Math.round(b[1])];}this.element.scrollTo(b[0],b[1]);return this;},compute:function(d,c,b){return[0,1].map(function(e){return Fx.compute(d[e],c[e],b); +});},start:function(c,d){if(!this.check(c,d)){return this;}var b=this.element.getScroll();return this.parent([b.x,b.y],[c,d]);},calculateScroll:function(g,f){var d=this.element,b=d.getScrollSize(),h=d.getScroll(),j=d.getSize(),c=this.options.offset,i={x:g,y:f}; +for(var e in i){if(!i[e]&&i[e]!==0){i[e]=h[e];}if(typeOf(i[e])!="number"){i[e]=b[e]-j[e];}i[e]+=c[e];}return[i.x,i.y];},toTop:function(){return this.start.apply(this,this.calculateScroll(false,0)); +},toLeft:function(){return this.start.apply(this,this.calculateScroll(0,false));},toRight:function(){return this.start.apply(this,this.calculateScroll("right",false)); +},toBottom:function(){return this.start.apply(this,this.calculateScroll(false,"bottom"));},toElement:function(d,e){e=e?Array.from(e):["x","y"];var c=a(this.element)?{x:0,y:0}:this.element.getScroll(); +var b=Object.map(document.id(d).getPosition(this.element),function(g,f){return e.contains(f)?g+c[f]:false;});return this.start.apply(this,this.calculateScroll(b.x,b.y)); +},toElementEdge:function(d,g,e){g=g?Array.from(g):["x","y"];d=document.id(d);var i={},f=d.getPosition(this.element),j=d.getSize(),h=this.element.getScroll(),b=this.element.getSize(),c={x:f.x+j.x,y:f.y+j.y}; +["x","y"].each(function(k){if(g.contains(k)){if(c[k]>h[k]+b[k]){i[k]=c[k]-b[k];}if(f[k]this.elements.length){e.splice(this.elements.length-1,e.length-this.elements.length); +}}var b=0;i=a=0;e.each(function(k){var j={};if(d){j.top=i-f[k].top-b;i+=f[k].height;}else{j.left=a-f[k].left;a+=f[k].width;}b=b+f[k].margin;c[k]=j;},this); +var g={};Array.clone(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; +var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); +},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; +});},getCurrentOrder:function(){return this.currentOrder;},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse()); +},reverse:function(){return this.sort(this.currentOrder.reverse());},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b); +},this));},swap:function(c,b){if(typeOf(c)=="element"){c=this.elements.indexOf(c);}if(typeOf(b)=="element"){b=this.elements.indexOf(b);}var a=Array.clone(this.currentOrder); +a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;return this.sort(a);}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,element:function(c){return c!=null; +}});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=typeOf(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element; +this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.ie)?"selectstart":"mousedown";if(Browser.ie&&!Drag.ondragstartFixed){document.ondragstart=Function.from(false); +Drag.ondragstartFixed=true;}this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:Function.from(false)}; +this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start); +return this;},start:function(a){var j=this.options;if(a.rightClick){return;}if(j.preventDefault){a.preventDefault();}if(j.stopPropagation){a.stopPropagation(); +}this.mouse.start=a.page;this.fireEvent("beforeStart",this.element);var c=j.limit;this.limit={x:[],y:[]};var e,g;for(e in j.modifiers){if(!j.modifiers[e]){continue; +}var b=this.element.getStyle(j.modifiers[e]);if(b&&!b.match(/px$/)){if(!g){g=this.element.getCoordinates(this.element.getOffsetParent());}b=g[j.modifiers[e]]; +}if(j.style){this.value.now[e]=(b||0).toInt();}else{this.value.now[e]=this.element[j.modifiers[e]];}if(j.invert){this.value.now[e]*=-1;}this.mouse.pos[e]=a.page[e]-this.value.now[e]; +if(c&&c[e]){var d=2;while(d--){var f=c[e][d];if(f||f===0){this.limit[e][d]=(typeof f=="function")?f():f;}}}}if(typeOf(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}; +}var h={mousemove:this.bound.check,mouseup:this.bound.cancel};h[this.selection]=this.bound.eventStop;this.document.addEvents(h);},check:function(a){if(this.options.preventDefault){a.preventDefault(); +}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop}); +this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:function(b){var a=this.options;if(a.preventDefault){b.preventDefault(); +}this.mouse.now=b.page;for(var c in a.modifiers){if(!a.modifiers[c]){continue;}this.value.now[c]=this.mouse.now[c]-this.mouse.pos[c];if(a.invert){this.value.now[c]*=-1; +}if(a.limit&&this.limit[c]){if((this.limit[c][1]||this.limit[c][1]===0)&&(this.value.now[c]>this.limit[c][1])){this.value.now[c]=this.limit[c][1];}else{if((this.limit[c][0]||this.limit[c][0]===0)&&(this.value.now[c]d.left&&b.xd.top);},this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]); +}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables(); +}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a); +this.store("dragger",b);return b;}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(a){this.setKnobPosition(a); +},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(f,a,e){this.setOptions(e);e=this.options;this.element=document.id(f); +a=this.knob=document.id(a);this.previousChange=this.previousEnd=this.step=-1;var b={},d={x:false,y:false};switch(e.mode){case"vertical":this.axis="y";this.property="top"; +this.offset="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";this.offset="offsetWidth";}this.setSliderDimensions();this.setRange(e.range); +if(a.getStyle("position")=="static"){a.setStyle("position","relative");}a.setStyle(this.property,-e.offset);d[this.axis]=this.property;b[this.axis]=[-e.offset,this.full-e.offset]; +var c={snap:0,limit:b,modifiers:d,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:(function(){this.isDragging=true;}).bind(this),onCancel:function(){this.isDragging=false; +}.bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end();}.bind(this)};if(e.snap){this.setSnap(c);}this.drag=new Drag(a,c); +this.attach();if(e.initialStep!=null){this.set(e.initialStep);}},attach:function(){this.element.addEvent("mousedown",this.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement); +}this.drag.attach();return this;},detach:function(){this.element.removeEvent("mousedown",this.clickedElement).removeEvent("mousewheel",this.scrolledElement); +this.drag.detach();return this;},autosize:function(){this.setSliderDimensions().setKnobPosition(this.toPosition(this.step));this.drag.options.limit[this.axis]=[-this.options.offset,this.full-this.options.offset]; +if(this.options.snap){this.setSnap();}return this;},setSnap:function(a){if(!a){a=this.drag.options;}a.grid=Math.ceil(this.stepWidth);a.limit[this.axis][1]=this.full; +return this;},setKnobPosition:function(a){if(this.options.snap){a=this.toPosition(this.step);}this.knob.setStyle(this.property,a);return this;},setSliderDimensions:function(){this.full=this.element.measure(function(){this.half=this.knob[this.offset]/2; +return this.element[this.offset]-this.knob[this.offset]+(this.options.offset*2);}.bind(this));return this;},set:function(a){if(!((this.range>0)^(a0)^(a>this.max))){a=this.max;}this.step=Math.round(a);return this.checkStep().fireEvent("tick",this.toPosition(this.step)).end();},setRange:function(a,b){this.min=Array.pick([a[0],0]); +this.max=Array.pick([a[1],this.options.steps]);this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps; +this.stepWidth=this.stepSize*this.full/Math.abs(this.range);if(a){this.set(Array.pick([b,this.step]).floor(this.min).max(this.max));}return this;},clickedElement:function(c){if(this.isDragging||c.target==this.knob){return; +}var b=this.range<0?-1:1,a=c.page[this.axis]-this.element.getPosition()[this.axis]-this.half;a=a.limit(-this.options.offset,this.full-this.options.offset); +this.step=Math.round(this.min+b*this.toStep(a));this.checkStep().fireEvent("tick",a).end();},scrolledElement:function(a){var b=(this.options.mode=="horizontal")?(a.wheel<0):(a.wheel>0); +this.set(this.step+(b?-1:1)*this.stepSize);a.stop();},draggedKnob:function(){var b=this.range<0?-1:1,a=this.drag.value.now[this.axis];a=a.limit(-this.options.offset,this.full-this.options.offset); +this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();},checkStep:function(){var a=this.step;if(this.previousChange!=a){this.previousChange=a; +this.fireEvent("change",a);}return this;},end:function(){var a=this.step;if(this.previousEnd!==a){this.previousEnd=a;this.fireEvent("complete",a+"");}return this; +},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b;},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset; +}});var Sortables=new Class({Implements:[Events,Options],options:{opacity:1,clone:false,revert:false,handle:false,dragOptions:{},snap:4,constrain:false,preventDefault:false},initialize:function(a,b){this.setOptions(b); +this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(a)||a));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,Object.merge({duration:250,link:"cancel"},this.options.revert)); +}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a); +var b=a.retrieve("sortables:start",function(c){this.start.call(this,c,a);}.bind(this));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b); +},this);return this;},addLists:function(){Array.flatten(arguments).each(function(a){this.lists.include(a);this.addItems(a.getChildren());},this);return this; +},removeItems:function(){return $$(Array.flatten(arguments).map(function(a){this.elements.erase(a);var b=a.retrieve("sortables:start");(this.options.handle?a.getElement(this.options.handle)||a:a).removeEvent("mousedown",b); +return a;},this));},removeLists:function(){return $$(Array.flatten(arguments).map(function(a){this.lists.erase(a);this.removeItems(a.getChildren());return a; +},this));},getClone:function(b,a){if(!this.options.clone){return new Element(a.tagName).inject(document.body);}if(typeOf(this.options.clone)=="function"){return this.options.clone.call(this,b,a,this.list); +}var c=a.clone(true).setStyles({margin:0,position:"absolute",visibility:"hidden",width:a.getStyle("width")}).addEvent("mousedown",function(d){a.fireEvent("mousedown",d); +});if(c.get("html").test("radio")){c.getElements("input[type=radio]").each(function(d,e){d.set("name","clone_"+e);if(d.get("checked")){a.getElements("input[type=radio]")[e].set("checked",true); +}});}return c.inject(this.list).setPosition(a.getPosition(a.getOffsetParent()));},getDroppables:function(){var a=this.list.getChildren().erase(this.clone).erase(this.element); +if(!this.options.constrain){a.append(this.lists).erase(this.list);}return a;},insert:function(c,b){var a="inside";if(this.lists.contains(b)){this.list=b; +this.drag.droppables=this.getDroppables();}else{a=this.element.getAllPrevious().contains(b)?"before":"after";}this.element.inject(b,a);this.fireEvent("sort",[this.element,this.clone]); +},start:function(b,a){if(!this.idle||b.rightClick||["button","input","a","textarea"].contains(b.target.get("tag"))){return;}this.idle=false;this.element=a; +this.opacity=a.getStyle("opacity");this.list=a.getParent();this.clone=this.getClone(b,a);this.drag=new Drag.Move(this.clone,Object.merge({preventDefault:this.options.preventDefault,snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables()},this.options.dragOptions)).addEvents({onSnap:function(){b.stop(); +this.clone.setStyle("visibility","visible");this.element.setStyle("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]); +}.bind(this),onEnter:this.insert.bind(this),onCancel:this.end.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(b); +},end:function(){this.drag.detach();this.element.setStyle("opacity",this.opacity);if(this.effect){var b=this.element.getStyles("width","height"),d=this.clone,c=d.computePosition(this.element.getPosition(this.clone.getOffsetParent())); +var a=function(){this.removeEvent("cancel",a);d.destroy();};this.effect.element=d;this.effect.start({top:c.top,left:c.left,width:b.width,height:b.height,opacity:0.25}).addEvent("cancel",a).chain(a); +}else{this.clone.destroy();}this.reset();},reset:function(){this.idle=true;this.fireEvent("complete",this.element);},serialize:function(){var c=Array.link(arguments,{modifier:Type.isFunction,index:function(d){return d!=null; +}});var b=this.lists.map(function(d){return d.getChildren().map(c.modifier||function(e){return e.get("id");},this);},this);var a=c.index;if(this.lists.length==1){a=0; +}return(a||a===0)&&a>=0&&a2083){this.fireEvent("error",f);}Request.JSONP.request_map["request_"+b]=function(){this.success(arguments,b);}.bind(this);var a=this.getScript(f).inject(c.injectScript); +this.fireEvent("request",[f,a]);if(c.timeout){this.timeout.delay(c.timeout,this);}return this;},getScript:function(a){if(!this.script){this.script=new Element("script",{type:"text/javascript",async:true,src:a}); +}return this.script;},success:function(b,a){if(!this.running){return;}this.clear().fireEvent("complete",b).fireEvent("success",b).callChain();},cancel:function(){if(this.running){this.clear().fireEvent("cancel"); +}return this;},isRunning:function(){return !!this.running;},clear:function(){this.running=false;if(this.script){this.script.destroy();this.script=null; +}return this;},timeout:function(){if(this.running){this.running=false;this.fireEvent("timeout",[this.script.get("src"),this.script]).fireEvent("failure").cancel(); +}return this;}});Request.JSONP.counter=0;Request.JSONP.request_map={};Request.Queue=new Class({Implements:[Options,Events],Binds:["attach","request","complete","cancel","success","failure","exception"],options:{stopOnFailure:true,autoAdvance:true,concurrent:1,requests:{}},initialize:function(a){var b; +if(a){b=a.requests;delete a.requests;}this.setOptions(a);this.requests={};this.queue=[];this.reqBinders={};if(b){this.addRequests(b);}},addRequest:function(a,b){this.requests[a]=b; +this.attach(a,b);return this;},addRequests:function(a){Object.each(a,function(c,b){this.addRequest(b,c);},this);return this;},getName:function(a){return Object.keyOf(this.requests,a); +},attach:function(a,b){if(b._groupSend){return this;}["request","complete","cancel","success","failure","exception"].each(function(c){if(!this.reqBinders[a]){this.reqBinders[a]={}; +}this.reqBinders[a][c]=function(){this["on"+c.capitalize()].apply(this,[a,b].append(arguments));}.bind(this);b.addEvent(c,this.reqBinders[a][c]);},this); +b._groupSend=b.send;b.send=function(c){this.send(a,c);return b;}.bind(this);return this;},removeRequest:function(b){var a=typeOf(b)=="object"?this.getName(b):b; +if(!a&&typeOf(a)!="string"){return this;}b=this.requests[a];if(!b){return this;}["request","complete","cancel","success","failure","exception"].each(function(c){b.removeEvent(c,this.reqBinders[a][c]); +},this);b.send=b._groupSend;delete b._groupSend;return this;},getRunning:function(){return Object.filter(this.requests,function(a){return a.running;}); +},isRunning:function(){return !!(Object.keys(this.getRunning()).length);},send:function(b,a){var c=function(){this.requests[b]._groupSend(a);this.queue.erase(c); +}.bind(this);c.name=b;if(Object.keys(this.getRunning()).length>=this.options.concurrent||(this.error&&this.options.stopOnFailure)){this.queue.push(c);}else{c(); +}return this;},hasNext:function(a){return(!a)?!!this.queue.length:!!this.queue.filter(function(b){return b.name==a;}).length;},resume:function(){this.error=false; +(this.options.concurrent-Object.keys(this.getRunning()).length).times(this.runNext,this);return this;},runNext:function(a){if(!this.queue.length){return this; +}if(!a){this.queue[0]();}else{var b;this.queue.each(function(c){if(!b&&c.name==a){b=true;c();}});}return this;},runAll:function(){this.queue.each(function(a){a(); +});return this;},clear:function(a){if(!a){this.queue.empty();}else{this.queue=this.queue.map(function(b){if(b.name!=a){return b;}else{return false;}}).filter(function(b){return b; +});}return this;},cancel:function(a){this.requests[a].cancel();return this;},onRequest:function(){this.fireEvent("request",arguments);},onComplete:function(){this.fireEvent("complete",arguments); +if(!this.queue.length){this.fireEvent("end");}},onCancel:function(){if(this.options.autoAdvance&&!this.error){this.runNext();}this.fireEvent("cancel",arguments); +},onSuccess:function(){if(this.options.autoAdvance&&!this.error){this.runNext();}this.fireEvent("success",arguments);},onFailure:function(){this.error=true; +if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext();}this.fireEvent("failure",arguments);},onException:function(){this.error=true; +if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext();}this.fireEvent("exception",arguments);}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(b){var a=function(){if(!this.running){this.send({data:b}); +}};this.lastDelay=this.options.initialDelay;this.timer=a.delay(this.lastDelay,this);this.completeCheck=function(c){clearTimeout(this.timer);this.lastDelay=(c)?this.options.delay:(this.lastDelay+this.options.delay).min(this.options.limit); +this.timer=a.delay(this.lastDelay,this);};return this.addEvent("complete",this.completeCheck);},stopTimer:function(){clearTimeout(this.timer);return this.removeEvent("complete",this.completeCheck); +}});var Asset={javascript:function(d,b){if(!b){b={};}var a=new Element("script",{src:d,type:"text/javascript"}),e=b.document||document,c=b.onload||b.onLoad; +delete b.onload;delete b.onLoad;delete b.document;if(c){if(typeof a.onreadystatechange!="undefined"){a.addEvent("readystatechange",function(){if(["loaded","complete"].contains(this.readyState)){c.call(this); +}});}else{a.addEvent("load",c);}}return a.set(b).inject(e.head);},css:function(d,a){if(!a){a={};}var b=new Element("link",{rel:"stylesheet",media:"screen",type:"text/css",href:d}); +var c=a.onload||a.onLoad,e=a.document||document;delete a.onload;delete a.onLoad;delete a.document;if(c){b.addEvent("load",c);}return b.set(a).inject(e.head); +},image:function(c,b){if(!b){b={};}var d=new Image(),a=document.id(d)||new Element("img");["load","abort","error"].each(function(e){var g="on"+e,f="on"+e.capitalize(),h=b[g]||b[f]||function(){}; +delete b[f];delete b[g];d[g]=function(){if(!d){return;}if(!a.parentNode){a.width=d.width;a.height=d.height;}d=d.onload=d.onabort=d.onerror=null;h.delay(1,a,a); +a.fireEvent(e,a,1);};});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1);}return a.set(b);},images:function(c,b){c=Array.from(c);var d=function(){},a=0; +b=Object.merge({onComplete:d,onProgress:d,onError:d,properties:{}},b);return new Elements(c.map(function(f,e){return Asset.image(f,Object.append(b.properties,{onload:function(){a++; +b.onProgress.call(this,a,e,f);if(a==c.length){b.onComplete();}},onerror:function(){a++;b.onError.call(this,a,e,f);if(a==c.length){b.onComplete();}}})); +}));}};(function(){var a=this.Color=new Type("Color",function(c,d){if(arguments.length>=3){d="rgb";c=Array.slice(arguments,0,3);}else{if(typeof c=="string"){if(c.match(/rgb/)){c=c.rgbToHex().hexToRgb(true); +}else{if(c.match(/hsb/)){c=c.hsbToRgb();}else{c=c.hexToRgb(true);}}}}d=d||"rgb";switch(d){case"hsb":var b=c;c=c.hsbToRgb();c.hsb=b;break;case"hex":c=c.hexToRgb(true); +break;}c.rgb=c.slice(0,3);c.hsb=c.hsb||c.rgbToHsb();c.hex=c.rgbToHex();return Object.append(c,this);});a.implement({mix:function(){var b=Array.slice(arguments); +var d=(typeOf(b.getLast())=="number")?b.pop():50;var c=this.slice();b.each(function(e){e=new a(e);for(var f=0;f<3;f++){c[f]=Math.round((c[f]/100*(100-d))+(e[f]/100*d)); +}});return new a(c,"rgb");},invert:function(){return new a(this.map(function(b){return 255-b;}));},setHue:function(b){return new a([b,this.hsb[1],this.hsb[2]],"hsb"); +},setSaturation:function(b){return new a([this.hsb[0],b,this.hsb[2]],"hsb");},setBrightness:function(b){return new a([this.hsb[0],this.hsb[1],b],"hsb"); +}});this.$RGB=function(e,d,c){return new a([e,d,c],"rgb");};this.$HSB=function(e,d,c){return new a([e,d,c],"hsb");};this.$HEX=function(b){return new a(b,"hex"); +};Array.implement({rgbToHsb:function(){var c=this[0],d=this[1],k=this[2],h=0;var j=Math.max(c,d,k),f=Math.min(c,d,k);var l=j-f;var i=j/255,g=(j!=0)?l/j:0; +if(g!=0){var e=(j-c)/l;var b=(j-d)/l;var m=(j-k)/l;if(c==j){h=m-b;}else{if(d==j){h=2+e-m;}else{h=4+b-e;}}h/=6;if(h<0){h++;}}return[Math.round(h*360),Math.round(g*100),Math.round(i*100)]; +},hsbToRgb:function(){var d=Math.round(this[2]/100*255);if(this[1]==0){return[d,d,d];}else{var b=this[0]%360;var g=b%60;var h=Math.round((this[2]*(100-this[1]))/10000*255); +var e=Math.round((this[2]*(6000-this[1]*g))/600000*255);var c=Math.round((this[2]*(6000-this[1]*(60-g)))/600000*255);switch(Math.floor(b/60)){case 0:return[d,c,h]; +case 1:return[e,d,h];case 2:return[h,d,c];case 3:return[h,e,d];case 4:return[c,h,d];case 5:return[d,h,e];}}return false;}});String.implement({rgbToHsb:function(){var b=this.match(/\d{1,3}/g); +return(b)?b.rgbToHsb():null;},hsbToRgb:function(){var b=this.match(/\d{1,3}/g);return(b)?b.hsbToRgb():null;}});})();(function(){this.Group=new Class({initialize:function(){this.instances=Array.flatten(arguments); +},addEvent:function(e,d){var g=this.instances,a=g.length,f=a,c=new Array(a),b=this;g.each(function(h,j){h.addEvent(e,function(){if(!c[j]){f--;}c[j]=arguments; +if(!f){d.call(b,g,h,c);f=a;c=new Array(a);}});});}});})();Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(b,a){this.parent(b,a); +this.load();},save:function(){var a=JSON.encode(this.hash);if(!a||a.length>4096){return false;}if(a=="{}"){this.dispose();}else{this.write(a);}return true; +},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this;}});Hash.each(Hash.prototype,function(b,a){if(typeof b=="function"){Hash.Cookie.implement(a,function(){var c=b.apply(this.hash,arguments); +if(this.options.autoSave){this.save();}return c;});}});(function(){var a=this.Table=function(){this.length=0;var c=[],b=[];this.set=function(e,g){var d=c.indexOf(e); +if(d==-1){var f=c.length;c[f]=e;b[f]=g;this.length++;}else{b[d]=g;}return this;};this.get=function(e){var d=c.indexOf(e);return(d==-1)?null:b[d];};this.erase=function(e){var d=c.indexOf(e); +if(d!=-1){this.length--;c.splice(d,1);return b.splice(d,1)[0];}return null;};this.each=this.forEach=function(f,g){for(var e=0,d=this.length;e1?$$(a):a.length?document.id(a[0]):false;},setHeaders:function(a){this.set("headers",a); +return this;},setFooters:function(a){this.set("footers",a);return this;},update:function(d,e,a){var b=d.getChildren(a||"td"),c=b.length-1;e.each(function(i,f){var j=b[f]||new Element(a||"td").inject(d),h=(i?i.content:"")||i,g=typeOf(h); +if(i&&i.properties){j.set(i.properties);}if(/(element(s?)|array|collection)/.test(g)){j.empty().adopt(h);}else{j.set("html",h);}if(f>c){b.push(j);}else{b[f]=j; +}});return{tr:d,tds:b};},push:function(e,c,d,a,b){if(typeOf(e)=="element"&&e.get("tag")=="tr"){e.inject(d||this.body,b);return{tr:e,tds:e.getChildren("td")}; +}return this.update(new Element("tr",c).inject(d||this.body,b),e,a);},pushMany:function(d,c,e,a,b){return d.map(function(f){return this.push(f,c,e,a,b); +},this);}});["adopt","inject","wraps","grab","replaces","dispose"].each(function(a){HtmlTable.implement(a,function(){this.element[a].apply(this.element,arguments); +return this;});});HtmlTable=Class.refactor(HtmlTable,{options:{classZebra:"table-tr-odd",zebra:true,zebraOnlyVisibleRows:true},initialize:function(){this.previous.apply(this,arguments); +if(this.occluded){return this.occluded;}if(this.options.zebra){this.updateZebras();}},updateZebras:function(){var a=0;Array.each(this.body.rows,function(b){if(!this.options.zebraOnlyVisibleRows||b.isDisplayed()){this.zebra(b,a++); +}},this);},setRowStyle:function(b,a){if(this.previous){this.previous(b,a);}this.zebra(b,a);},zebra:function(b,a){return b[((a%2)?"remove":"add")+"Class"](this.options.classZebra); +},push:function(){var a=this.previous.apply(this,arguments);if(this.options.zebra){this.updateZebras();}return a;}});HtmlTable=Class.refactor(HtmlTable,{options:{sortIndex:0,sortReverse:false,parsers:[],defaultParser:"string",classSortable:"table-sortable",classHeadSort:"table-th-sort",classHeadSortRev:"table-th-sort-rev",classNoSort:"table-th-nosort",classGroupHead:"table-tr-group-head",classGroup:"table-tr-group",classCellSort:"table-td-sort",classSortSpan:"table-th-sort-span",sortable:false,thSelector:"th"},initialize:function(){this.previous.apply(this,arguments); +if(this.occluded){return this.occluded;}this.sorted={index:null,dir:1};if(!this.bound){this.bound={};}this.bound.headClick=this.headClick.bind(this);this.sortSpans=new Elements(); +if(this.options.sortable){this.enableSort();if(this.options.sortIndex!=null){this.sort(this.options.sortIndex,this.options.sortReverse);}}},attachSorts:function(a){this.detachSorts(); +if(a!==false){this.element.addEvent("click:relay("+this.options.thSelector+")",this.bound.headClick);}},detachSorts:function(){this.element.removeEvents("click:relay("+this.options.thSelector+")"); +},setHeaders:function(){this.previous.apply(this,arguments);if(this.sortEnabled){this.setParsers();}},setParsers:function(){this.parsers=this.detectParsers(); +},detectParsers:function(){return this.head&&this.head.getElements(this.options.thSelector).flatten().map(this.detectParser,this);},detectParser:function(a,b){if(a.hasClass(this.options.classNoSort)||a.retrieve("htmltable-parser")){return a.retrieve("htmltable-parser"); +}var c=new Element("div");c.adopt(a.childNodes).inject(a);var f=new Element("span",{"class":this.options.classSortSpan}).inject(c,"top");this.sortSpans.push(f); +var g=this.options.parsers[b],e=this.body.rows,d;switch(typeOf(g)){case"function":g={convert:g};d=true;break;case"string":g=g;d=true;break;}if(!d){HtmlTable.ParserPriority.some(function(k){var o=HtmlTable.Parsers[k],m=o.match; +if(!m){return false;}for(var n=0,l=e.length;nc){b[f].position--;}}}},setRowStyle:function(b,a){this.previous(b,a);b.cells[this.sorted.index].addClass(this.options.classCellSort); +},setGroupSort:function(b,c,a){if(b==a.value){c.removeClass(this.options.classGroupHead).addClass(this.options.classGroup);}else{c.removeClass(this.options.classGroup).addClass(this.options.classGroupHead); +}return a.value;},getParser:function(){var a=this.parsers[this.sorted.index];return typeOf(a)=="string"?HtmlTable.Parsers[a]:a;},sort:function(c,b,e){if(!this.head){return; +}if(!e){this.clearSort();this.setSortedState(c,b);this.setHeadSort(true);}var f=this.getParser();if(!f){return;}var a;if(!Browser.ie){a=this.body.getParent(); +this.body.dispose();}var d=this.parseData(f).sort(function(h,g){if(h.value===g.value){return 0;}return h.value>g.value?1:-1;});if(this.sorted.reverse==(f==HtmlTable.Parsers["input-checked"])){d.reverse(true); +}this.setRowSort(d,e);if(a){a.grab(this.body);}this.fireEvent("stateChanged");return this.fireEvent("sort",[this.body,this.sorted.index]);},parseData:function(a){return Array.map(this.body.rows,function(d,b){var c=a.convert.call(document.id(d.cells[this.sorted.index])); +return{position:b,value:c};},this);},clearSort:function(){this.setHeadSort(false);this.body.getElements("td").removeClass(this.options.classCellSort);},reSort:function(){if(this.sortEnabled){this.sort.call(this,this.sorted.index,this.sorted.reverse); +}return this;},enableSort:function(){this.element.addClass(this.options.classSortable);this.attachSorts(true);this.setParsers();this.sortEnabled=true;return this; +},disableSort:function(){this.element.removeClass(this.options.classSortable);this.attachSorts(false);this.sortSpans.each(function(a){a.destroy();});this.sortSpans.empty(); +this.sortEnabled=false;return this;}});HtmlTable.ParserPriority=["date","input-checked","input-value","float","number"];HtmlTable.Parsers={date:{match:/^\d{2}[-\/ ]\d{2}[-\/ ]\d{2,4}$/,convert:function(){var a=Date.parse(this.get("text").stripTags()); +return(typeOf(a)=="date")?a.format("db"):"";},type:"date"},"input-checked":{match:/ type="(radio|checkbox)" /,convert:function(){return this.getElement("input").checked; +}},"input-value":{match:/0)){return null; +}if(d){b+=e;}else{var a=0,c=0;if(e>0){while(ce&&b>0){if(this.body.rows[--b].isDisplayed()){c--; +}}}}return b;},attachSelects:function(d){d=d!=null?d:true;var g=d?"addEvents":"removeEvents";this.element[g]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard}); +this.body[g]({"click:relay(tr)":this.bound.clickRow,"contextmenu:relay(tr)":this.bound.clickRow});if(this.options.useKeyboard||this.keyboard){if(!this.keyboard){this.keyboard=new Keyboard(); +}if(!this.selectKeysDefined){this.selectKeysDefined=true;var f,e;var c=function(i){var h=function(j){clearTimeout(f);j.preventDefault();var k=this.body.rows[this.getRowByOffset(i,this.options.selectHiddenRows)]; +if(j.shift&&k&&this.isSelected(k)){this.deselectRow(this.focused);this.focused=k;}else{if(k&&(!this.options.allowMultiSelect||!j.shift)){this.selectNone(); +}this.shiftFocus(i,j);}if(e){f=h.delay(100,this,j);}else{f=(function(){e=true;h(j);}).delay(400);}}.bind(this);return h;}.bind(this);var b=function(){clearTimeout(f); +e=false;};this.keyboard.addEvents({"keydown:shift+up":c(-1),"keydown:shift+down":c(1),"keyup:shift+up":b,"keyup:shift+down":b,"keyup:up":b,"keyup:down":b}); +var a="";if(this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard){a=" (Shift multi-selects).";}this.keyboard.addShortcuts({"Select Previous Row":{keys:"up",shortcut:"up arrow",handler:c(-1),description:"Select the previous row in the table."+a},"Select Next Row":{keys:"down",shortcut:"down arrow",handler:c(1),description:"Select the next row in the table."+a}}); +}this.keyboard[d?"activate":"deactivate"]();}this.updateSelects();},mouseleave:function(){if(this.hovered){this.leaveRow(this.hovered);}}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(a,b){this.element.scrollTo(a,b); +},fps:50},initialize:function(b,a){this.setOptions(a);this.element=document.id(b);this.docBody=document.id(this.element.getDocument().body);this.listener=(typeOf(this.element)!="element")?this.docBody:this.element; +this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)};},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach}); +return this;},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach});this.detach();this.timer=clearInterval(this.timer); +return this;},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords);},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords); +this.timer=clearInterval(this.timer);},getCoords:function(a){this.page=(this.listener.get("tag")=="body")?a.client:a.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this); +}},scroll:function(){var c=this.element.getSize(),a=this.element.getScroll(),h=this.element!=this.docBody?this.element.getOffsets():{x:0,y:0},d=this.element.getScrollSize(),g={x:0,y:0},e=this.options.area.top||this.options.area,b=this.options.area.bottom||this.options.area; +for(var f in this.page){if(this.page[f]<(e+h[f])&&a[f]!=0){g[f]=(this.page[f]-e-h[f])*this.options.velocity;}else{if(this.page[f]+b>(c[f]+h[f])&&a[f]+c[f]!=d[f]){g[f]=(this.page[f]-c[f]+b-h[f])*this.options.velocity; +}}g[f]=g[f].round();}if(g.y||g.x){this.fireEvent("change",[a.x+g.x,a.y+g.y]);}}});(function(){var a=function(c,b){return(c)?(typeOf(c)=="function"?c(b):b.get(c)):""; +};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block");},onHide:function(){this.tip.setStyle("display","none"); +},title:"title",text:function(b){return b.get("rel")||b.get("href");},showDelay:100,hideDelay:100,className:"tip-wrap",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:false,waiAria:true},initialize:function(){var b=Array.link(arguments,{options:Type.isObject,elements:function(c){return c!=null; +}});this.setOptions(b.options);if(b.elements){this.attach(b.elements);}this.container=new Element("div",{"class":"tip"});if(this.options.id){this.container.set("id",this.options.id); +if(this.options.waiAria){this.attachWaiAria();}}},toElement:function(){if(this.tip){return this.tip;}this.tip=new Element("div",{"class":this.options.className,styles:{position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})); +return this.tip;},attachWaiAria:function(){var b=this.options.id;this.container.set("role","tooltip");if(!this.waiAria){this.waiAria={show:function(c){if(b){c.set("aria-describedby",b); +}this.container.set("aria-hidden","false");},hide:function(c){if(b){c.erase("aria-describedby");}this.container.set("aria-hidden","true");}};}this.addEvents(this.waiAria); +},detachWaiAria:function(){if(this.waiAria){this.container.erase("role");this.container.erase("aria-hidden");this.removeEvents(this.waiAria);}},attach:function(b){$$(b).each(function(d){var f=a(this.options.title,d),e=a(this.options.text,d); +d.set("title","").store("tip:native",f).retrieve("tip:title",f);d.retrieve("tip:text",e);this.fireEvent("attach",[d]);var c=["enter","leave"];if(!this.options.fixed){c.push("move"); +}c.each(function(h){var g=d.retrieve("tip:"+h);if(!g){g=function(i){this["element"+h.capitalize()].apply(this,[i,d]);}.bind(this);}d.store("tip:"+h,g).addEvent("mouse"+h,g); +},this);},this);return this;},detach:function(b){$$(b).each(function(d){["enter","leave","move"].each(function(e){d.removeEvent("mouse"+e,d.retrieve("tip:"+e)).eliminate("tip:"+e); +});this.fireEvent("detach",[d]);if(this.options.title=="title"){var c=d.retrieve("tip:native");if(c){d.set("title",c);}}},this);return this;},elementEnter:function(c,b){clearTimeout(this.timer); +this.timer=(function(){this.container.empty();["title","text"].each(function(e){var d=b.retrieve("tip:"+e);var f=this["_"+e+"Element"]=new Element("div",{"class":"tip-"+e}).inject(this.container); +if(d){this.fill(f,d);}},this);this.show(b);this.position((this.options.fixed)?{page:b.getPosition()}:c);}).delay(this.options.showDelay,this);},elementLeave:function(c,b){clearTimeout(this.timer); +this.timer=this.hide.delay(this.options.hideDelay,this,b);this.fireForParent(c,b);},setTitle:function(b){if(this._titleElement){this._titleElement.empty(); +this.fill(this._titleElement,b);}return this;},setText:function(b){if(this._textElement){this._textElement.empty();this.fill(this._textElement,b);}return this; +},fireForParent:function(c,b){b=b.getParent();if(!b||b==document.body){return;}if(b.retrieve("tip:enter")){b.fireEvent("mouseenter",c);}else{this.fireForParent(c,b); +}},elementMove:function(c,b){this.position(c);},position:function(f){if(!this.tip){document.id(this);}var c=window.getSize(),b=window.getScroll(),g={x:this.tip.offsetWidth,y:this.tip.offsetHeight},d={x:"left",y:"top"},e={y:false,x2:false,y2:false,x:false},h={}; +for(var i in d){h[d[i]]=f.page[i]+this.options.offset[i];if(h[d[i]]<0){e[i]=true;}if((h[d[i]]+g[i]-b[i])>c[i]-this.options.windowPadding[i]){h[d[i]]=f.page[i]-this.options.offset[i]-g[i]; +e[i+"2"]=true;}}this.fireEvent("bound",e);this.tip.setStyles(h);},fill:function(b,c){if(typeof c=="string"){b.set("html",c);}else{b.adopt(c);}},show:function(b){if(!this.tip){document.id(this); +}if(!this.tip.getParent()){this.tip.inject(document.body);}this.fireEvent("show",[this.tip,b]);},hide:function(b){if(!this.tip){document.id(this);}this.fireEvent("hide",[this.tip,b]); +}});})();(function(){var a={json:JSON.decode};Locale.Set.defineParser=function(b,c){a[b]=c;};Locale.Set.from=function(d,c){if(instanceOf(d,Locale.Set)){return d; +}if(!c&&typeOf(d)=="string"){c="json";}if(a[c]){d=a[c](d);}var b=new Locale.Set;b.sets=d.sets||{};if(d.inherits){b.inherits.locales=Array.from(d.inherits.locales); +b.inherits.sets=d.inherits.sets||{};}return b;};})();Locale.define("de-DE","Date",{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],months_abbr:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],days_abbr:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],dateOrder:["date","month","year"],shortDate:"%d.%m.%Y",shortTime:"%H:%M",AM:"vormittags",PM:"nachmittags",firstDayOfWeek:1,ordinal:".",lessThanMinuteAgo:"vor weniger als einer Minute",minuteAgo:"vor einer Minute",minutesAgo:"vor {delta} Minuten",hourAgo:"vor einer Stunde",hoursAgo:"vor {delta} Stunden",dayAgo:"vor einem Tag",daysAgo:"vor {delta} Tagen",weekAgo:"vor einer Woche",weeksAgo:"vor {delta} Wochen",monthAgo:"vor einem Monat",monthsAgo:"vor {delta} Monaten",yearAgo:"vor einem Jahr",yearsAgo:"vor {delta} Jahren",lessThanMinuteUntil:"in weniger als einer Minute",minuteUntil:"in einer Minute",minutesUntil:"in {delta} Minuten",hourUntil:"in ca. einer Stunde",hoursUntil:"in ca. {delta} Stunden",dayUntil:"in einem Tag",daysUntil:"in {delta} Tagen",weekUntil:"in einer Woche",weeksUntil:"in {delta} Wochen",monthUntil:"in einem Monat",monthsUntil:"in {delta} Monaten",yearUntil:"in einem Jahr",yearsUntil:"in {delta} Jahren"}); +Locale.define("de-DE","FormValidator",{required:"Dieses Eingabefeld muss ausgefüllt werden.",minLength:"Geben Sie bitte mindestens {minLength} Zeichen ein (Sie haben nur {length} Zeichen eingegeben).",maxLength:"Geben Sie bitte nicht mehr als {maxLength} Zeichen ein (Sie haben {length} Zeichen eingegeben).",integer:'Geben Sie in diesem Eingabefeld bitte eine ganze Zahl ein. Dezimalzahlen (z.B. "1.25") sind nicht erlaubt.',numeric:'Geben Sie in diesem Eingabefeld bitte nur Zahlenwerte (z.B. "1", "1.1", "-1" oder "-1.1") ein.',digits:"Geben Sie in diesem Eingabefeld bitte nur Zahlen und Satzzeichen ein (z.B. eine Telefonnummer mit Bindestrichen und Punkten ist erlaubt).",alpha:"Geben Sie in diesem Eingabefeld bitte nur Buchstaben (a-z) ein. Leerzeichen und andere Zeichen sind nicht erlaubt.",alphanum:"Geben Sie in diesem Eingabefeld bitte nur Buchstaben (a-z) und Zahlen (0-9) ein. Leerzeichen oder andere Zeichen sind nicht erlaubt.",dateSuchAs:'Geben Sie bitte ein gültiges Datum ein (z.B. "{date}").',dateInFormatMDY:'Geben Sie bitte ein gültiges Datum im Format TT.MM.JJJJ ein (z.B. "31.12.1999").',email:'Geben Sie bitte eine gültige E-Mail-Adresse ein (z.B. "max@mustermann.de").',url:'Geben Sie bitte eine gültige URL ein (z.B. "http://www.example.com").',currencyDollar:"Geben Sie bitte einen gültigen Betrag in EURO ein (z.B. 100.00€).",oneRequired:"Bitte füllen Sie mindestens ein Eingabefeld aus.",errorPrefix:"Fehler: ",warningPrefix:"Warnung: ",noSpace:"Es darf kein Leerzeichen in diesem Eingabefeld sein.",reqChkByNode:"Es wurden keine Elemente gewählt.",requiredChk:"Dieses Feld muss ausgefüllt werden.",reqChkByName:"Bitte wählen Sie ein {label}.",match:"Dieses Eingabefeld muss mit dem {matchName} Eingabefeld übereinstimmen.",startDate:"Das Anfangsdatum",endDate:"Das Enddatum",currendDate:"Das aktuelle Datum",afterDate:"Das Datum sollte zur gleichen Zeit oder später sein als {label}.",beforeDate:"Das Datum sollte zur gleichen Zeit oder früher sein als {label}.",startMonth:"Wählen Sie bitte einen Anfangsmonat",sameMonth:"Diese zwei Datumsangaben müssen im selben Monat sein - Sie müssen eines von beiden verändern.",creditcard:"Die eingegebene Kreditkartennummer ist ungültig. Bitte überprüfen Sie diese und versuchen Sie es erneut. {length} Zahlen eingegeben."}); +Locale.define("EU","Number",{decimal:",",group:".",currency:{prefix:"€ "}});Locale.define("de-DE").inherit("EU","Number");Locale.define("en-GB","Date",{dateOrder:["date","month","year"],shortDate:"%d/%m/%Y",shortTime:"%H:%M"}).inherit("en-US","Date"); diff --git a/Source/MooEditable/MooEditable.UI.Statusbar.js b/Source/MooEditable/MooEditable.UI.Statusbar.js new file mode 100644 index 0000000..e96866b --- /dev/null +++ b/Source/MooEditable/MooEditable.UI.Statusbar.js @@ -0,0 +1,133 @@ +/* +--- + +name: MooEditable.UI.Statusbar + +description: Draw Statusbar with character and/or word counter. + +license: MIT-style license + +author: +- René Grosseck + +requires: +- MooEditable +- More/String.Extras +- More/Class.Refactor +- More/Class.Mask +- More/Drag + +usage: + Add the following tags in your html + + + + + + + +provides: [MooEditable.UI.Statusbar] + +... +*/ + +(function () { + + MooEditable.Locale.define({ + words : 'Words', + chars : 'Characters' + }); + + MooEditable = Class.refactor(MooEditable, { + + options: { + 'showwords' : true, + 'showchars' : true, + 'resizeable' : true, + 'resizedirection' : {x: true, y: true}, + 'separator' : ' / ', + 'class' : '' + }, + + attach: function () { + this.previous(); + this.setOptions(this.options); + this.drawStatusbar(); + return this; + }, + + drawStatusbar: function(){ + var self = this; + this.statusbar = new Element('div', {'class': 'mooeditable-ui-statusbar ' + this.options['class']}); + if ((this.options.showwords) || (this.options.showchars)) { + this.wordcounter = new Element('div', {'class': 'mooeditable-ui-statusbar-wordcount'}); + this.updateCount(); + this.doc.body.addEvent('keyup', this.updateCount.bind(this)); + document.id(this.wordcounter).inject(this.statusbar); + } + + if(this.options.resizeable && (this.options.resizedirection.x || this.options.resizedirection.y)){ + this.resizer = new Element('div', {'class': 'mooeditable-ui-statusbar-resize'}); + var min_width = this.options.dimensions ? Math.max(this.options.dimensions.x, 100) : 100; + var min_height = this.options.dimensions ? Math.max(this.options.dimensions.y, 100) : 100; + var xlimit = {}; + var mcursor = ''; + + if(this.options.resizedirection.y == true){ + Object.append(xlimit, {y: [min_height, 0xFFFF]}); + mcursor+='s'; + } + if(this.options.resizedirection.x == true){ + Object.append(xlimit, {x: [min_width, 0xFFFF]}); + mcursor+='e'; + } + this.resizer.setStyle('cursor', mcursor+'-resize'); + + this.iframe.makeResizable({ + handle: this.resizer, + limit: xlimit, + modifiers: {x: this.options.resizedirection.x == true ? 'width' : false, y: this.options.resizedirection.y == true ? 'height' : false}, + snap: 0, + preventDefault: true, + onBeforeStart: function(e){ + mooeditableiframesaver = new Mask(document.body,{ + style: { + 'z-index': 2147483647, + opacity: 0, + cursor: mcursor+'-resize' + } + }).show(); + mooeditableiframesaver.show(); + this.fireEvent('editorResize', [e, self]); + }, + onDrag: function(el){ + if(self.options.resizedirection.x == true) + self.container.setStyle('width', el.getSize().x); + }, + onComplete: function(){ + mooeditableiframesaver.destroy(); + } + }); + document.id(this.resizer).inject(this.statusbar); + } + document.id(this.statusbar).inject(this.container, 'bottom'); + }, + + updateCount: function(){ + var text = this.getContent().stripTags(); + var numChars = text.length; + var numWords = (numChars != 0) ? text.split(' ').length : 0; + if ((this.options.showwords) && (this.options.showchars)) { + var insertText = MooEditable.Locale.get('words') + ': ' + numWords + this.options.separator + MooEditable.Locale.get('chars') + ': ' + numChars; + } + else { + var insertText = (this.options.showwords) ? MooEditable.Locale.get('words') + ': ' + numWords : (this.options.showchars) ? MooEditable.Locale.get('chars') + ': ' + numChars : ''; + } + this.wordcounter.set('text', insertText); + } + }); +}()); \ No newline at end of file From 085716a48289ec66988ab3891c435ee320359bfc Mon Sep 17 00:00:00 2001 From: Elso Date: Sat, 19 Oct 2013 16:25:31 +0200 Subject: [PATCH 2/5] - fix failure on drag raw-html-editing-mode (thx cyberbeat) - add element path into statusbar - demo example with word limit --- Assets/MooEditable/MooEditable.css | 19 ++- .../MooEditable/MooEditable.UI.Statusbar.html | 13 +- .../MooEditable/MooEditable.UI.Statusbar.js | 148 +++++++++++++++--- 3 files changed, 153 insertions(+), 27 deletions(-) diff --git a/Assets/MooEditable/MooEditable.css b/Assets/MooEditable/MooEditable.css index 6a1a9de..4464cc7 100644 --- a/Assets/MooEditable/MooEditable.css +++ b/Assets/MooEditable/MooEditable.css @@ -176,17 +176,28 @@ -webkit-outline: 0; } -.mooeditable-ui-button-overlay .overlay-content{ - padding: 10px; -} - .mooeditable-ui-statusbar{ background-color: #eee; border-top: 1px solid #aaa; position: relative; + height: 37px; +} + +.mooeditable-ui-statusbar-nodepath{ + padding: 10px; + float: left; +} + +.mooeditable-ui-statusbar-nodepath .node{ + cursor: pointer; +} + +.mooeditable-ui-statusbar-nodepath .node:hover{ + text-decoration: underline; } .mooeditable-ui-statusbar-wordcount{ + float: right; text-align: right; padding: 10px; } diff --git a/Demos/MooEditable/MooEditable.UI.Statusbar.html b/Demos/MooEditable/MooEditable.UI.Statusbar.html index 4d95ffd..84806dc 100644 --- a/Demos/MooEditable/MooEditable.UI.Statusbar.html +++ b/Demos/MooEditable/MooEditable.UI.Statusbar.html @@ -9,7 +9,8 @@ font-family: sans-serif; font-size: .9em; } - #textarea-1{ + #textarea-1, + #textarea-2{ width: 700px; height: 200px; padding: 10px; @@ -26,6 +27,7 @@ - - - - - - - - - -

MooEditable statusbar examples

- -
- - - - - -

- - - -
- -
- - - + + + + + MooEditable basic example + + + + + + + + + + + + + + + +

MooEditable statusbar examples

+ +
+ + + + + +

+ + + +
+ +
+ + + diff --git a/Docs/MooEditable/MooEditable.md b/Docs/MooEditable/MooEditable.md index 316d3fa..77ed244 100644 --- a/Docs/MooEditable/MooEditable.md +++ b/Docs/MooEditable/MooEditable.md @@ -1,596 +1,626 @@ -Class: MooEditable {#MooEditable} -================================= - -A simple web-based WYSIWYG editor. - -### Implements: - -[Events][], [Options][] - - -MooEditable Method: constructor {#MooEditable:constructor} ----------------------------------------------------------- - -### Syntax: - - var myMooEditableInstance = new MooEditable(textarea[, options]); - -### Arguments: - -1. textarea - (*mixed*) A string of the id for an Element or an Element reference of the textarea this editor modifies. -2. options - (*object*, optional) The options object. - -### Options: - -* toolbar - (*boolean*: defaults to true) Whether or not to show the toolbar. -* cleanup: - (*boolean*: defaults to true) Whether or not to clean up the HTML source. -* paragraphise - (*boolean*: defaults to true) Whether or not to create `

` tags when pressing 'Enter'. -* xhtml - (*boolean*: defaults to true) Whether or not to produce XHTML-valid output (empty/void elements with trailing slash). -* semantics - (*boolean*: defaults to true) Whether or not to produce semantic markup (strong/em instead of b/i). -* actions - (*string*: defaults to a string shown below) A string indicating the toolbar items and their arrangement (space-separated). - - 'bold italic underline strikethrough | insertunorderedlist insertorderedlist indent outdent | undo redo | createlink unlink, | urlimage | toggleview' -* handleSubmit - (*boolean*: defaults to true) Whether or not to attach a submit listener to the textarea's parent form, to save content to textarea before submit. -* handleLabel - (*boolean*: defaults to true) Whether or not to attach a click listener to the textarea's related label tag, to focus on the iframe instead. -* baseCSS - (*string*: defaults to a string shown below) A string indicating the base CSS code. - - html{ height: 100%; cursor: text } - body{ font-family: sans-serif; border: 0; } -* extraCSS - (*string*: defaults to null) A string indicating the extra CSS code besides the base. -* externalCSS - (*string*: defaults to null) A string indicating the URL of the external CSS file. No `` tag HTML needed. -* html - (*string*: defaults to a string show below) A string indicating the HTML of the iframe content. - - - - - - {EXTERNALCSS} - - {CONTENT} - -* rootElement - (*string*: defaults to 'p') A string indicating the root element of the editor content. -* baseURL - (*string*: defaults to null) A string indicating the editor content's base URL for resolving relative URLs. -* dimensions - (*object*: defaults to null) An object with x/y values indicating the width and height of the editor. Useful when the editor is not displayed when initialized. - -### Events: - -* render - Executed when the editor is rendered. -* attach - Executed when the editor is attached. -* detach - Executed when the editor is detached. -* editorMouseUp - Executed when 'mouseup' event is fired on the editor. -* editorMouseDown - Executed when 'mousedown' event is fired on the editor. -* editorContextMenu - Executed when 'contextmenu' event is fired on the editor. -* editorClick - Executed when 'click' event is fired on the editor. -* editorDoubleClick - Executed when 'doubleclick' event is fired on the editor. -* editorKeyPress - Executed when 'keypress' event is fired on the editor. -* editorKeyUp - Executed when 'keyup' event is fired on the editor. -* editorKeyDown - Executed when 'keydown' event is fired on the editor. -* dialogOpen - Executed when dialog is opened. -* dialogClose - Executed when dialog is closed. - -### Example: - - var myMooEditable = new MooEditable('myTextarea', { - handleSubmit: false, - onRender: function(){ - alert('Done rendering.'); - } - }); - - - -MooEditable Method: attach {#MooEditable:attach} ------------------------------------------------- - -Attaches the editor and replace the textarea. - -### Syntax: - - myMooEditable.attach(); - -### Returns: - -* (*object*) This MooEditable instance. - - - -MooEditable Method: detach {#MooEditable:detach} ------------------------------------------------- - -Detaches the editor and replaced by the original textarea. - -### Syntax: - - myMooEditable.detach(); - -### Returns: - -* (*object*) This MooEditable instance. - - - -MooEditable Method: focus {#MooEditable:focus} ----------------------------------------------- - -Focus on the editor, regardless of which view is shown. - -### Syntax: - - myMooEditable.focus(); - -### Returns: - -* (*object*) This MooEditable instance. - - - -MooEditable Method: toggleView {#MooEditable:toggleView} --------------------------------------------------------- - -Toggles the editor view of the source or the WYSIWYG content. - -### Syntax: - - myMooEditable.toggleView(); - -### Returns: - -* (*object*) This MooEditable instance. - - - -MooEditable Method: getContent {#MooEditable:getContent} --------------------------------------------------------- - -Returns the source of the editor content. - -### Syntax: - - myMooEditable.getContent(); - -### Returns: - -* (*string*) The HTML source of the content - - - -MooEditable Method: setContent {#MooEditable:setContent} --------------------------------------------------------- - -Sets the source of the editor content. - -### Syntax: - - myMooEditable.setContent('

Hello World.

'); - -### Returns: - -* (*object*) This MooEditable instance. - - - -MooEditable Method: saveContent {#MooEditable:saveContent} ----------------------------------------------------------- - -Saves the source of the WYSIWYG content to the textarea. - -### Syntax: - - myMooEditable.saveContent(); - -### Returns: - -* (*object*) This MooEditable instance. - - - -Object: MooEditable.UI {#MooEditable-UI} -======================================== - -This Object contains the interface classes for MooEditable. - - - -Class: MooEditable.UI.Toolbar {#MooEditable-UI-Toolbar} -======================================================= - -The toolbar interface. - -### Implements: - -[Events][], [Options][] - - -MooEditable.UI.Toolbar Method: constructor {#MooEditable-UI-Toolbar:constructor} --------------------------------------------------------------------------------- - -### Syntax: - - var myMooEditableToolbar = new MooEditable.UI.Toolbar([options]); - -### Arguments: - -1. options - (*object*, optional) The options object. - -### Options: - -* class - (*string*: defaults to null) The class name of the toolbar. - -### Events: - -* itemAction - Executed when an action of an item on the toolbar is executed. - - - -MooEditable.UI.Toolbar Method: addItem {#MooEditable-UI-Toolbar:addItem} ------------------------------------------------------------------------- - -Add an item to the toolbar. - -### Syntax: - - myMooEditableToolbar.addItem('item'); - -### Arguments: - -1. item - (*string*) An action name that matches one already specified in [MooEditable.Actions](#MooEditable-Actions) hash. - -### Returns: - -* (*object*) The MooEditable.UI.item instance. - - - -MooEditable.UI.Toolbar Method: getItem {#MooEditable-UI-Toolbar:getItem} ------------------------------------------------------------------------- - -Returns the item from the toolbar. - -### Syntax: - - var myItem = myMooEditableToolbar.getItem('item'); - -### Arguments: - -1. item - (*string*) An action name that matches one already specified in [MooEditable.Actions](#MooEditable-Actions) hash. - -### Returns: - -* (*object*) The MooEditable.Actions.item object. - - - -MooEditable.UI.Toolbar Method: addSeparator {#MooEditable-UI-Toolbar:addSeparator} ----------------------------------------------------------------------------------- - -Add a separator to the toolbar. - -### Syntax: - - myMooEditableToolbar.addSeparator(); - -### Returns: - -* (*object*) The Element object of the separator. - - - -MooEditable.UI.Toolbar Method: enable {#MooEditable-UI-Toolbar:enable} ----------------------------------------------------------------------- - -Enables all the items on the toolbar. - -### Syntax: - - myMooEditableToolbar.enable(); - -### Returns: - -* (*object*) This MooEditable.UI.Toolbar instance. - - - -MooEditable.UI.Toolbar Method: disable {#MooEditable-UI-Toolbar:disable} ------------------------------------------------------------------------- - -Disables the items on the toolbar. - -### Syntax: - - myMooEditableToolbar.disable(except); - -### Arguments: - -1. except - (*string*) An action name that matches one already specified in [MooEditable.Actions](#MooEditable-Actions) hash, to be excepted from becoming disabled on the toolbar. - -### Returns: - -* (*object*) This MooEditable.UI.Toolbar instance. - - - -MooEditable.UI.Toolbar Method: show {#MooEditable-UI-Toolbar:show} ------------------------------------------------------------------- - -Shows the toolbar. - -### Syntax: - - myMooEditableToolbar.show(); - -### Returns: - -* (*object*) This MooEditable.UI.Toolbar instance. - - - -MooEditable.UI.Toolbar Method: hide {#MooEditable-UI-Toolbar:hide} ------------------------------------------------------------------- - -Hides the toolbar. - -### Syntax: - - myMooEditableToolbar.hide(); - -### Returns: - -* (*object*) This MooEditable.UI.Toolbar instance. - - - -Class: MooEditable.UI.Button {#MooEditable-UI-Button} -===================================================== - -The button interface. - -### Implements: - -[Events][], [Options][] - - -MooEditable.UI.Button Method: constructor {#MooEditable-UI-Button:constructor} ------------------------------------------------------------------------------- - -### Syntax: - - var myMooEditableButton = new MooEditable.UI.Button([options]); - -### Arguments: - -1. options - (*object*, optional) The options object. - -### Options: - -* title - (*string*: defaults to null) The title of the button. -* name - (*string*: defaults to null) The unique name of the button. -* text - (*string*: defaults to 'Button') The text shown on the button. -* class - (*string*: defaults to null) The class name of the button. -* shortcut - (*string*: defaults to null) The keyboard shortcut key to trigger the action of the button. -* mode - (*string*: defaults to 'icon') Can be 'icon', 'text' or 'icon-text'. - * 'icon' - Iconic button - * 'text' - Textual button - * 'icon-text' - Icon and text shown on the button. - -### Events: - -* action - Executed when the action of the button is executed. - - - -MooEditable.UI.Button Method: enable {#MooEditable-UI-Button:enable} --------------------------------------------------------------------- - -Enables the button. - -### Syntax: - - myMooEditableButton.enable(); - -### Returns: - -* (*object*) This MooEditable.UI.Button instance. - - - -MooEditable.UI.Button Method: disable {#MooEditable-UI-Button:disable} ----------------------------------------------------------------------- - -Disables the button. - -### Syntax: - - myMooEditableButton.disable(); - -### Returns: - -* (*object*) This MooEditable.UI.Button instance. - - - -MooEditable.UI.Button Method: activate {#MooEditable-UI-Button:activate} ------------------------------------------------------------------------- - -Activates the button. - -### Syntax: - - myMooEditableButton.activate(); - -### Returns: - -* (*object*) This MooEditable.UI.Button instance. - - - -MooEditable.UI.Button Method: deactivate {#MooEditable-UI-Button:deactivate} ----------------------------------------------------------------------------- - -Deactivates the button. - -### Syntax: - - myMooEditableButton.deactivate(); - -### Returns: - -* (*object*) This MooEditable.UI.Button instance. - - - -Class: MooEditable.UI.Dialog {#MooEditable-UI-Dialog} -===================================================== - -The dialog interface. - -### Implements: - -[Events][], [Options][] - - -MooEditable.UI.Dialog Method: constructor {#MooEditable-UI-Dialog:constructor} ------------------------------------------------------------------------------- - -### Syntax: - - var myMooEditableDialog = new MooEditable.UI.Dialog([options]); - -### Arguments: - -1. options - (*object*, optional) The options object. - -### Options: - -* class - (*string*: defaults to null) The class name of the dialog. -* contentClass - (*string*: defaults to null) The class name of the dialog content. - -### Events: - -* open - Executed when the dialog is opened. -* close - Executed when the dialog is closed. - - - -MooEditable.UI.Dialog Method: open {#MooEditable-UI-Dialog:open} ----------------------------------------------------------------- - -Opens the dialog. - -### Syntax: - - myMooEditableDialog.open(); - -### Returns: - -* (*object*) This MooEditable.UI.Dialog instance. - - - -MooEditable.UI.Dialog Method: close {#MooEditable-UI-Dialog:close} ------------------------------------------------------------------- - -Closes the dialog. - -### Syntax: - - myMooEditableDialog.close(); - -### Returns: - -* (*object*) This MooEditable.UI.Dialog instance. - - - -Function: MooEditable.UI.AlertDialog {#MooEditable-UI-AlertDialog} -================================================================== - -The alert dialog interface. Replacement for `alert()`. - -### Syntax: - - var myMooEditableAlertDialog = MooEditable.UI.AlertDialog(text); - -### Arguments: - -1. text - (*string*) A string to be shown on the alert dialog. - - - -Function: MooEditable.UI.PromptDialog {#MooEditable-UI-PromptDialog} -================================================================== - -The prompt dialog interface. Replacement for `prompt()`. - -### Syntax: - - var myMooEditablePromptDialog = MooEditable.UI.PromptDialog(question[, answer, fn]); - -### Arguments: - -1. question - (*string*) A string to be shown as the question on the prompt dialog. -2. answer - (*string*, optional) A string to be shown in the answer field on the prompt dialog. -3. fn - (*function*, optional) Executed when the OK button of the prompt dialog is clicked. - - - -Hash: MooEditable.Actions {#MooEditable-Actions} -================================================ - -This Hash contains the objects that specifies all 'actions' for the editor. The list of actions are: - -* bold -* italic -* underline -* strikethrough -* insertunorderedlist -* insertorderedlist -* indent -* outdent -* undo -* redo -* unlink -* createlink -* urlimage -* toggleview - - - -Native: Element {#Element} -================================================ - -Custom Native to allow all of its methods to be used with any DOM element via the dollar function [$][]. - -Element Method: mooEditable {#Element:mooEditable} --------------------------------------------------- - -Initializes the MooEditable instance on the element. - -### Syntax: - - var myMooEditable = myElement.mooEditable([options]); - -### Arguments: - -* options - (*object*, optional) See [MooEditable](#MooEditable) for acceptable options. - -### Returns: - -* (*object*) The MooEditable instance that was created. - -### Examples: - - var myMooEditable = $('myElement').mooEditable({ - onRender: function(){ - alert('Done rendering.'); - } - }); - -### See Also: - -* [MooEditable](#MooEditable) - - - -[$]: http://mootools.net/docs/Element/Element/#dollar -[Events]: http://mootools.net/docs/Class/Class.Extras#Events +Class: MooEditable {#MooEditable} +================================= + +A simple web-based WYSIWYG editor. + +### Implements: + +[Events][], [Options][] + + +MooEditable Method: constructor {#MooEditable:constructor} +---------------------------------------------------------- + +### Syntax: + + var myMooEditableInstance = new MooEditable(textarea[, options]); + +### Arguments: + +1. textarea - (*mixed*) A string of the id for an Element or an Element reference of the textarea this editor modifies. +2. options - (*object*, optional) The options object. + +### Options: + +* toolbar - (*boolean*: defaults to true) Whether or not to show the toolbar. +* cleanup: - (*boolean*: defaults to true) Whether or not to clean up the HTML source. +* paragraphise - (*boolean*: defaults to true) Whether or not to create `

` tags when pressing 'Enter'. +* xhtml - (*boolean*: defaults to true) Whether or not to produce XHTML-valid output (empty/void elements with trailing slash). +* semantics - (*boolean*: defaults to true) Whether or not to produce semantic markup (strong/em instead of b/i). +* actions - (*string*: defaults to a string shown below) A string indicating the toolbar items and their arrangement (space-separated). + + 'bold italic underline strikethrough | insertunorderedlist insertorderedlist indent outdent | undo redo | createlink unlink, | urlimage | toggleview' +* handleSubmit - (*boolean*: defaults to true) Whether or not to attach a submit listener to the textarea's parent form, to save content to textarea before submit. +* handleLabel - (*boolean*: defaults to true) Whether or not to attach a click listener to the textarea's related label tag, to focus on the iframe instead. +* baseCSS - (*string*: defaults to a string shown below) A string indicating the base CSS code. + + html{ height: 100%; cursor: text } + body{ font-family: sans-serif; border: 0; } +* extraCSS - (*string*: defaults to null) A string indicating the extra CSS code besides the base. +* externalCSS - (*string*: defaults to null) A string indicating the URL of the external CSS file. No `` tag HTML needed. +* html - (*string*: defaults to a string show below) A string indicating the HTML of the iframe content. + + + + + + {EXTERNALCSS} + + {CONTENT} + +* rootElement - (*string*: defaults to 'p') A string indicating the root element of the editor content. +* baseURL - (*string*: defaults to null) A string indicating the editor content's base URL for resolving relative URLs. +* dimensions - (*object*: defaults to null) An object with x/y values indicating the width and height of the editor. Useful when the editor is not displayed when initialized. + +### Events: + +* render - Executed when the editor is rendered. +* attach - Executed when the editor is attached. +* detach - Executed when the editor is detached. +* editorMouseUp - Executed when 'mouseup' event is fired on the editor. +* editorMouseDown - Executed when 'mousedown' event is fired on the editor. +* editorContextMenu - Executed when 'contextmenu' event is fired on the editor. +* editorClick - Executed when 'click' event is fired on the editor. +* editorDoubleClick - Executed when 'doubleclick' event is fired on the editor. +* editorKeyPress - Executed when 'keypress' event is fired on the editor. +* editorKeyUp - Executed when 'keyup' event is fired on the editor. +* editorKeyDown - Executed when 'keydown' event is fired on the editor. +* dialogOpen - Executed when dialog is opened. +* dialogClose - Executed when dialog is closed. + +### Example: + + var myMooEditable = new MooEditable('myTextarea', { + handleSubmit: false, + onRender: function(){ + alert('Done rendering.'); + } + }); + + + +MooEditable Method: attach {#MooEditable:attach} +------------------------------------------------ + +Attaches the editor and replace the textarea. + +### Syntax: + + myMooEditable.attach(); + +### Returns: + +* (*object*) This MooEditable instance. + + + +MooEditable Method: detach {#MooEditable:detach} +------------------------------------------------ + +Detaches the editor and replaced by the original textarea. + +### Syntax: + + myMooEditable.detach(); + +### Returns: + +* (*object*) This MooEditable instance. + + + +MooEditable Method: focus {#MooEditable:focus} +---------------------------------------------- + +Focus on the editor, regardless of which view is shown. + +### Syntax: + + myMooEditable.focus(); + +### Returns: + +* (*object*) This MooEditable instance. + + + +MooEditable Method: toggleView {#MooEditable:toggleView} +-------------------------------------------------------- + +Toggles the editor view of the source or the WYSIWYG content. + +### Syntax: + + myMooEditable.toggleView(); + +### Returns: + +* (*object*) This MooEditable instance. + + + +MooEditable Method: getContent {#MooEditable:getContent} +-------------------------------------------------------- + +Returns the source of the editor content. + +### Syntax: + + myMooEditable.getContent(); + +### Returns: + +* (*string*) The HTML source of the content + + + +MooEditable Method: setContent {#MooEditable:setContent} +-------------------------------------------------------- + +Sets the source of the editor content. + +### Syntax: + + myMooEditable.setContent('

Hello World.

'); + +### Returns: + +* (*object*) This MooEditable instance. + + + +MooEditable Method: saveContent {#MooEditable:saveContent} +---------------------------------------------------------- + +Saves the source of the WYSIWYG content to the textarea. + +### Syntax: + + myMooEditable.saveContent(); + +### Returns: + +* (*object*) This MooEditable instance. + + + +Object: MooEditable.UI {#MooEditable-UI} +======================================== + +This Object contains the interface classes for MooEditable. + + + +Class: MooEditable.UI.Toolbar {#MooEditable-UI-Toolbar} +======================================================= + +The toolbar interface. + +### Implements: + +[Events][], [Options][] + + + +MooEditable.UI.Toolbar Method: constructor {#MooEditable-UI-Toolbar:constructor} +-------------------------------------------------------------------------------- + +### Syntax: + + var myMooEditableToolbar = new MooEditable.UI.Toolbar([options]); + +### Arguments: + +1. options - (*object*, optional) The options object. + +### Options: + +* class - (*string*: defaults to null) The class name of the toolbar. + +### Events: + +* itemAction - Executed when an action of an item on the toolbar is executed. + + + +MooEditable.UI.Toolbar Method: addItem {#MooEditable-UI-Toolbar:addItem} +------------------------------------------------------------------------ + +Add an item to the toolbar. + +### Syntax: + + myMooEditableToolbar.addItem('item'); + +### Arguments: + +1. item - (*string*) An action name that matches one already specified in [MooEditable.Actions](#MooEditable-Actions) hash. + +### Returns: + +* (*object*) The MooEditable.UI.item instance. + + + +MooEditable.UI.Toolbar Method: getItem {#MooEditable-UI-Toolbar:getItem} +------------------------------------------------------------------------ + +Returns the item from the toolbar. + +### Syntax: + + var myItem = myMooEditableToolbar.getItem('item'); + +### Arguments: + +1. item - (*string*) An action name that matches one already specified in [MooEditable.Actions](#MooEditable-Actions) hash. + +### Returns: + +* (*object*) The MooEditable.Actions.item object. + + + +MooEditable.UI.Toolbar Method: addSeparator {#MooEditable-UI-Toolbar:addSeparator} +---------------------------------------------------------------------------------- + +Add a separator to the toolbar. + +### Syntax: + + myMooEditableToolbar.addSeparator(); + +### Returns: + +* (*object*) The Element object of the separator. + + + +MooEditable.UI.Toolbar Method: enable {#MooEditable-UI-Toolbar:enable} +---------------------------------------------------------------------- + +Enables all the items on the toolbar. + +### Syntax: + + myMooEditableToolbar.enable(); + +### Returns: + +* (*object*) This MooEditable.UI.Toolbar instance. + + + +MooEditable.UI.Toolbar Method: disable {#MooEditable-UI-Toolbar:disable} +------------------------------------------------------------------------ + +Disables the items on the toolbar. + +### Syntax: + + myMooEditableToolbar.disable(except); + +### Arguments: + +1. except - (*string*) An action name that matches one already specified in [MooEditable.Actions](#MooEditable-Actions) hash, to be excepted from becoming disabled on the toolbar. + +### Returns: + +* (*object*) This MooEditable.UI.Toolbar instance. + + + +MooEditable.UI.Toolbar Method: show {#MooEditable-UI-Toolbar:show} +------------------------------------------------------------------ + +Shows the toolbar. + +### Syntax: + + myMooEditableToolbar.show(); + +### Returns: + +* (*object*) This MooEditable.UI.Toolbar instance. + + + +MooEditable.UI.Toolbar Method: hide {#MooEditable-UI-Toolbar:hide} +------------------------------------------------------------------ + +Hides the toolbar. + +### Syntax: + + myMooEditableToolbar.hide(); + +### Returns: + +* (*object*) This MooEditable.UI.Toolbar instance. + + + +Class: MooEditable.UI.Statusbar {#MooEditable-UI-Statusbar} +=========================================================== + +Attach a Statusbar with character and/or word counter, show html path, allows word and character/word entry limit to the interface. + +### Options: +* showwords - (*boolean*: defaults to true) - Show counter of words. +* showchars - (*boolean*: defaults to true) - Show counter of chars. +* shownode - (*boolean*: defaults to true) - Show html nodes. +* showmaxwords - (*boolean*: defaults to true) - Show word limit if set by maxwords. +* showmaxchars - (*boolean*: defaults to true) - Show chars limit if set by maxchars or maxrealchar. +* maxwords - (*integer*: defaults to null) - Word limit into Html View. +* maxchars - (*integer*: defaults to null) - Character limit into Html View (only text). +* maxrealchars - (*integer*: defaults to null) - Character limit into Code View (text + html-tags). +* resizeable - (*boolean*: defaults to true) - Is Editor resizable? +* resizedirection - (*object*: defaults to a object shown below) - Which directions is Editor resizable? + + {x: false, y: true} +* separator - (*string*: defaults to '/') - Seperator between words and characters counter. +* class - (*string*: defaults to null) - The additional class name of the statusbar. + +### Events: + +* editorResizeBeforeStart - Executed before resizing starts. +* editorResizeDrag - Executed on resizing. +* editorResizeComplete - Executed after resizing end. + + + +Class: MooEditable.UI.Button {#MooEditable-UI-Button} +===================================================== + +The button interface. + +### Implements: + +[Events][], [Options][] + + +MooEditable.UI.Button Method: constructor {#MooEditable-UI-Button:constructor} +------------------------------------------------------------------------------ + +### Syntax: + + var myMooEditableButton = new MooEditable.UI.Button([options]); + +### Arguments: + +1. options - (*object*, optional) The options object. + +### Options: + +* title - (*string*: defaults to null) The title of the button. +* name - (*string*: defaults to null) The unique name of the button. +* text - (*string*: defaults to 'Button') The text shown on the button. +* class - (*string*: defaults to null) The class name of the button. +* shortcut - (*string*: defaults to null) The keyboard shortcut key to trigger the action of the button. +* mode - (*string*: defaults to 'icon') Can be 'icon', 'text' or 'icon-text'. + * 'icon' - Iconic button + * 'text' - Textual button + * 'icon-text' - Icon and text shown on the button. + +### Events: + +* action - Executed when the action of the button is executed. + + + +MooEditable.UI.Button Method: enable {#MooEditable-UI-Button:enable} +-------------------------------------------------------------------- + +Enables the button. + +### Syntax: + + myMooEditableButton.enable(); + +### Returns: + +* (*object*) This MooEditable.UI.Button instance. + + + +MooEditable.UI.Button Method: disable {#MooEditable-UI-Button:disable} +---------------------------------------------------------------------- + +Disables the button. + +### Syntax: + + myMooEditableButton.disable(); + +### Returns: + +* (*object*) This MooEditable.UI.Button instance. + + + +MooEditable.UI.Button Method: activate {#MooEditable-UI-Button:activate} +------------------------------------------------------------------------ + +Activates the button. + +### Syntax: + + myMooEditableButton.activate(); + +### Returns: + +* (*object*) This MooEditable.UI.Button instance. + + + +MooEditable.UI.Button Method: deactivate {#MooEditable-UI-Button:deactivate} +---------------------------------------------------------------------------- + +Deactivates the button. + +### Syntax: + + myMooEditableButton.deactivate(); + +### Returns: + +* (*object*) This MooEditable.UI.Button instance. + + + +Class: MooEditable.UI.Dialog {#MooEditable-UI-Dialog} +===================================================== + +The dialog interface. + +### Implements: + +[Events][], [Options][] + + +MooEditable.UI.Dialog Method: constructor {#MooEditable-UI-Dialog:constructor} +------------------------------------------------------------------------------ + +### Syntax: + + var myMooEditableDialog = new MooEditable.UI.Dialog([options]); + +### Arguments: + +1. options - (*object*, optional) The options object. + +### Options: + +* class - (*string*: defaults to null) The class name of the dialog. +* contentClass - (*string*: defaults to null) The class name of the dialog content. + +### Events: + +* open - Executed when the dialog is opened. +* close - Executed when the dialog is closed. + + + +MooEditable.UI.Dialog Method: open {#MooEditable-UI-Dialog:open} +---------------------------------------------------------------- + +Opens the dialog. + +### Syntax: + + myMooEditableDialog.open(); + +### Returns: + +* (*object*) This MooEditable.UI.Dialog instance. + + + +MooEditable.UI.Dialog Method: close {#MooEditable-UI-Dialog:close} +------------------------------------------------------------------ + +Closes the dialog. + +### Syntax: + + myMooEditableDialog.close(); + +### Returns: + +* (*object*) This MooEditable.UI.Dialog instance. + + + +Function: MooEditable.UI.AlertDialog {#MooEditable-UI-AlertDialog} +================================================================== + +The alert dialog interface. Replacement for `alert()`. + +### Syntax: + + var myMooEditableAlertDialog = MooEditable.UI.AlertDialog(text); + +### Arguments: + +1. text - (*string*) A string to be shown on the alert dialog. + + + +Function: MooEditable.UI.PromptDialog {#MooEditable-UI-PromptDialog} +================================================================== + +The prompt dialog interface. Replacement for `prompt()`. + +### Syntax: + + var myMooEditablePromptDialog = MooEditable.UI.PromptDialog(question[, answer, fn]); + +### Arguments: + +1. question - (*string*) A string to be shown as the question on the prompt dialog. +2. answer - (*string*, optional) A string to be shown in the answer field on the prompt dialog. +3. fn - (*function*, optional) Executed when the OK button of the prompt dialog is clicked. + + + +Hash: MooEditable.Actions {#MooEditable-Actions} +================================================ + +This Hash contains the objects that specifies all 'actions' for the editor. The list of actions are: + +* bold +* italic +* underline +* strikethrough +* insertunorderedlist +* insertorderedlist +* indent +* outdent +* undo +* redo +* unlink +* createlink +* urlimage +* toggleview + + + +Native: Element {#Element} +================================================ + +Custom Native to allow all of its methods to be used with any DOM element via the dollar function [$][]. + +Element Method: mooEditable {#Element:mooEditable} +-------------------------------------------------- + +Initializes the MooEditable instance on the element. + +### Syntax: + + var myMooEditable = myElement.mooEditable([options]); + +### Arguments: + +* options - (*object*, optional) See [MooEditable](#MooEditable) for acceptable options. + +### Returns: + +* (*object*) The MooEditable instance that was created. + +### Examples: + + var myMooEditable = $('myElement').mooEditable({ + onRender: function(){ + alert('Done rendering.'); + } + }); + +### See Also: + +* [MooEditable](#MooEditable) + + + +[$]: http://mootools.net/docs/Element/Element/#dollar +[Events]: http://mootools.net/docs/Class/Class.Extras#Events [Options]: http://mootools.net/docs/Class/Class.Extras#Options \ No newline at end of file diff --git a/Source/Locale/Locale.de-DE.MooEditable.js b/Source/Locale/Locale.de-DE.MooEditable.js index bfb04e0..86a398f 100644 --- a/Source/Locale/Locale.de-DE.MooEditable.js +++ b/Source/Locale/Locale.de-DE.MooEditable.js @@ -1,124 +1,129 @@ -/* ---- - -name: Locale.de-DE.MooEditable - -description: MooEditable messages for German. - -license: MIT-style license - -authors: -- André Fiedler - -requires: -- MooEditable -- more:1.3/Locale - -provides: [Locale.de-DE.MooEditable] - -... -*/ - -Locale.define('de-DE', 'MooEditable', { - - // MooEditable - ok: 'OK', - cancel: 'Abbrechen', - bold: 'Fett', - italic: 'Kursiv', - underline: 'Unterstrichen', - strikethrough: 'Durchgestrichen', - unorderedList: 'Aufzählungszeichen', - orderedList: 'Nummerierung', - indent: 'Einzug vergrößern', - outdent: 'Einzug verkleinern', - undo: 'Rückgängig', - redo: 'Wiederholen', - removeHyperlink: 'Hyperlink entfernen', - addHyperlink: 'Hyperlink hinzufügen', - selectTextHyperlink: 'Bitte markieren Sie zuerst den zu verlinkenden Text.', - enterURL: 'URL eingeben', - enterImageURL: 'Bild URL eingeben', - addImage: 'Image hinzufügen', - toggleView: 'Ansicht umschalten', - - // MooEditable.Charmap - insertCustomCharacter: 'Sonderzeichen einfügen', - insertCharacter: 'Zeichen einfügen', - - // MooEditable.Extras - blockFormatting: 'Block-Formatierung', - paragraph: 'Absatz', - heading1: 'Ãœberschrift 1', - heading2: 'Ãœberschrift 2', - heading3: 'Ãœberschrift 3', - alignLeft: 'Linksbündig ausrichten', - alignRight: 'Rechtsbündig ausrichten', - alignCenter: 'Zentriert ausrichten', - alignJustify: 'Blocksatz', - removeFormatting: 'Formatierung entfernen', - insertHorizontalRule: 'Horizontale Linie einfügen', - - // MooEditable.Flash - embed: 'Embedcode einfügen', - flashEmbed: 'Flash Embed', - - // MooEditable.Forecolor - changeColor: 'Farbe ändern', - - // MooEditable.Image - imageAlt: 'alt', - imageClass: 'class', - imageAlign: 'Ausrichtung', - imageAlignNone: 'none', - imageAlignLeft: 'left', - imageAlignCenter: 'center', - imageAlignRight: 'right', - addEditImage: 'Bild hinzufügen/bearbeiten', - - // MooEditable.Pagebreak - pageBreak: 'Seitenumbruch', - - // MooEditable.Smiley - insertSmiley: 'Smiley einfügen', - - // MooEditable.Table - tableColumns: 'Spalten', - tableRows: 'Zeilen', - tableWidth: 'Breite', - tableClass: 'class', - tableType: 'type', - tableHeader: 'Header', - tableCell: 'Zelle', - tableAlign: 'Ausrichtung', - tableAlignNone: 'none', - tableAlignCenter: 'center', - tableAlignRight: 'right', - tableValign: 'vertikale Ausrichtung', - tableValignNone: 'none', - tableValignTop: 'top', - tableValignMiddle: 'middle', - tableValignBottom: 'bottom', - addTable: 'Tabelle einfügen', - editTable: 'Tabelle bearbeiten', - addTableRow: 'Tabellenzeile einfügen', - editTableRow: 'Tabellenzeile bearbeiten', - mergeTableRow: 'Tabellenzeilen verbinden', - splitTableRow: 'Tabellenzeile teilen', - deleteTableRow: 'Tabellenzeile löschen', - addTableCol: 'Tabellenspalte einfügen', - editTableCol: 'Tabellenspalte bearbeiten', - mergeTableCell: 'Tabellenspalten verbinden', - splitTableCell: 'Tabellenspalten teilen', - deleteTableCol: 'Tabellenspalten löschen', - - // MooEditable.UI.ExtendedLinksDialog - protocol: 'Protokoll', - link: 'Link', - email: 'E-Mail', - urlWithoutHttp: 'URL (ohne http://)', - window: 'Fenster', - sameWindow: 'gleiches Fenster', - newWindow: 'neues Fenster' - +/* +--- + +name: Locale.de-DE.MooEditable + +description: MooEditable messages for German. + +license: MIT-style license + +authors: +- André Fiedler + +requires: +- MooEditable +- more:1.3/Locale + +provides: [Locale.de-DE.MooEditable] + +... +*/ + +Locale.define('de-DE', 'MooEditable', { + + // MooEditable + ok: 'OK', + cancel: 'Abbrechen', + bold: 'Fett', + italic: 'Kursiv', + underline: 'Unterstrichen', + strikethrough: 'Durchgestrichen', + unorderedList: 'Aufzählungszeichen', + orderedList: 'Nummerierung', + indent: 'Einzug vergrößern', + outdent: 'Einzug verkleinern', + undo: 'Rückgängig', + redo: 'Wiederholen', + removeHyperlink: 'Hyperlink entfernen', + addHyperlink: 'Hyperlink hinzufügen', + selectTextHyperlink: 'Bitte markieren Sie zuerst den zu verlinkenden Text.', + enterURL: 'URL eingeben', + enterImageURL: 'Bild URL eingeben', + addImage: 'Image hinzufügen', + toggleView: 'Ansicht umschalten', + + // MooEditable.Charmap + insertCustomCharacter: 'Sonderzeichen einfügen', + insertCharacter: 'Zeichen einfügen', + + // MooEditable.Extras + blockFormatting: 'Block-Formatierung', + paragraph: 'Absatz', + heading1: 'Ãœberschrift 1', + heading2: 'Ãœberschrift 2', + heading3: 'Ãœberschrift 3', + alignLeft: 'Linksbündig ausrichten', + alignRight: 'Rechtsbündig ausrichten', + alignCenter: 'Zentriert ausrichten', + alignJustify: 'Blocksatz', + removeFormatting: 'Formatierung entfernen', + insertHorizontalRule: 'Horizontale Linie einfügen', + + // MooEditable.Flash + embed: 'Embedcode einfügen', + flashEmbed: 'Flash Embed', + + // MooEditable.Forecolor + changeColor: 'Farbe ändern', + + // MooEditable.Image + imageAlt: 'alt', + imageClass: 'class', + imageAlign: 'Ausrichtung', + imageAlignNone: 'none', + imageAlignLeft: 'left', + imageAlignCenter: 'center', + imageAlignRight: 'right', + addEditImage: 'Bild hinzufügen/bearbeiten', + + // MooEditable.Pagebreak + pageBreak: 'Seitenumbruch', + + // MooEditable.Smiley + insertSmiley: 'Smiley einfügen', + + // MooEditable.Table + tableColumns: 'Spalten', + tableRows: 'Zeilen', + tableWidth: 'Breite', + tableClass: 'class', + tableType: 'type', + tableHeader: 'Header', + tableCell: 'Zelle', + tableAlign: 'Ausrichtung', + tableAlignNone: 'none', + tableAlignCenter: 'center', + tableAlignRight: 'right', + tableValign: 'vertikale Ausrichtung', + tableValignNone: 'none', + tableValignTop: 'top', + tableValignMiddle: 'middle', + tableValignBottom: 'bottom', + addTable: 'Tabelle einfügen', + editTable: 'Tabelle bearbeiten', + addTableRow: 'Tabellenzeile einfügen', + editTableRow: 'Tabellenzeile bearbeiten', + mergeTableRow: 'Tabellenzeilen verbinden', + splitTableRow: 'Tabellenzeile teilen', + deleteTableRow: 'Tabellenzeile löschen', + addTableCol: 'Tabellenspalte einfügen', + editTableCol: 'Tabellenspalte bearbeiten', + mergeTableCell: 'Tabellenspalten verbinden', + splitTableCell: 'Tabellenspalten teilen', + deleteTableCol: 'Tabellenspalten löschen', + + // MooEditable.UI.ExtendedLinksDialog + protocol: 'Protokoll', + link: 'Link', + email: 'E-Mail', + urlWithoutHttp: 'URL (ohne http://)', + window: 'Fenster', + sameWindow: 'gleiches Fenster', + newWindow: 'neues Fenster', + + // MooEditable.UI.Statusbar + words : 'Wörter', + chars : 'Zeichen', + maxof : 'von' + }); \ No newline at end of file diff --git a/Source/Locale/Locale.fr-FR.MooEditable.js b/Source/Locale/Locale.fr-FR.MooEditable.js index b1fe580..454ab43 100644 --- a/Source/Locale/Locale.fr-FR.MooEditable.js +++ b/Source/Locale/Locale.fr-FR.MooEditable.js @@ -1,115 +1,121 @@ -/* ---- - -name: Locale.fr-FR.MooEditable - -description: MooEditable messages for French. - -license: MIT-style license - -authors: -- Roparz - -requires: -- MooEditable -- more:1.3/Locale - -provides: [Locale.fr-FR.MooEditable] - -... -*/ - -Locale.define('fr-FR', 'MooEditable', { - - // MooEditable - ok: 'OK', - cancel: 'Annuler', - bold: 'Gras', - italic: 'Italique', - underline: 'Souligné', - strikethrough: 'Barré', - unorderedList: 'Liste à puce', - orderedList: 'Liste ordonnée', - indent: 'Augmenter le retrait', - outdent: 'Diminuer le retrait', - undo: 'Annuler', - redo: 'Restaurer', - removeHyperlink: 'Supprimer le lien', - addHyperlink: 'Ajouter un lien', - selectTextHyperlink: 'Veuillez sélectionner le texte à lier.', - enterURL: 'Entrez une URL', - enterImageURL: 'Entrez l\'URL de l\'image', - addImage: 'Ajouter une image', - toggleView: 'Changer de vue', - - // MooEditable.Charmap - insertCustomCharacter: 'Ajouter un caratère spécial', - insertCharacter: 'Ajouter', - - // MooEditable.Extras - blockFormatting: 'Formatage', - paragraph: 'Paragraphe', - heading1: 'Titre 1', - heading2: 'Titre 2', - heading3: 'Titre 3', - alignLeft: 'Aligner à gauche', - alignRight: 'Aligner à droite', - alignCenter: 'Centrer', - alignJustify: 'Justifier', - removeFormatting: 'Supprimer le formatage', - insertHorizontalRule: 'Insérer une ligne horizontale', - - // MooEditable.Flash - embed: 'Entrer le code embed', - flashEmbed: 'Ajouter un objet flash', - - // MooEditable.Forecolor - changeColor: 'Changer la couleur', - - // MooEditable.Image - imageAlt: 'alt', - imageClass: 'classe', - imageAlign: 'alignement', - imageAlignNone: 'aucun', - imageAlignLeft: 'gauche', - imageAlignCenter: 'centre', - imageAlignRight: 'droite', - addEditImage: 'Ajouter/Editer une image', - - // MooEditable.Pagebreak - pageBreak: 'Saut de page', - - // MooEditable.Smiley - insertSmiley: 'Ajouter un Smiley', - - // MooEditable.Table - tableColumns: 'colonnes', - tableRows: 'lignes', - tableWidth: 'largeur', - tableClass: 'classe', - tableType: 'type', - tableHeader: 'entête', - tableCell: 'cellule', - tableAlign: 'alignement', - tableAlignNone: 'aucun', - tableAlignCenter: 'centre', - tableAlignRight: 'droite', - tableValign: 'alignement vertical', - tableValignNone: 'aucun', - tableValignTop: 'haut', - tableValignMiddle: 'milieu', - tableValignBottom: 'bas', - addTable: 'Ajouter un tableau', - editTable: 'Editer le tableau', - addTableRow: 'Ajouter une ligne', - editTableRow: 'Editer la ligne', - mergeTableRow: 'Scinder la ligne', - splitTableRow: 'Séparer la ligne', - deleteTableRow: 'Supprimer la ligne', - addTableCol: 'Ajouter une colonne', - editTableCol: 'Editer la colonne', - mergeTableCell: 'Scinder la colonne', - splitTableCell: 'Séprarer la colonne', - deleteTableCol: 'Supprimer la colonne' - +/* +--- + +name: Locale.fr-FR.MooEditable + +description: MooEditable messages for French. + +license: MIT-style license + +authors: +- Roparz + +requires: +- MooEditable +- more:1.3/Locale + +provides: [Locale.fr-FR.MooEditable] + +... +*/ + +Locale.define('fr-FR', 'MooEditable', { + + // MooEditable + ok: 'OK', + cancel: 'Annuler', + bold: 'Gras', + italic: 'Italique', + underline: 'Souligné', + strikethrough: 'Barré', + unorderedList: 'Liste à puce', + orderedList: 'Liste ordonnée', + indent: 'Augmenter le retrait', + outdent: 'Diminuer le retrait', + undo: 'Annuler', + redo: 'Restaurer', + removeHyperlink: 'Supprimer le lien', + addHyperlink: 'Ajouter un lien', + selectTextHyperlink: 'Veuillez sélectionner le texte à lier.', + enterURL: 'Entrez une URL', + enterImageURL: 'Entrez l\'URL de l\'image', + addImage: 'Ajouter une image', + toggleView: 'Changer de vue', + + // MooEditable.Charmap + insertCustomCharacter: 'Ajouter un caratère spécial', + insertCharacter: 'Ajouter', + + // MooEditable.Extras + blockFormatting: 'Formatage', + paragraph: 'Paragraphe', + heading1: 'Titre 1', + heading2: 'Titre 2', + heading3: 'Titre 3', + alignLeft: 'Aligner à gauche', + alignRight: 'Aligner à droite', + alignCenter: 'Centrer', + alignJustify: 'Justifier', + removeFormatting: 'Supprimer le formatage', + insertHorizontalRule: 'Insérer une ligne horizontale', + + // MooEditable.Flash + embed: 'Entrer le code embed', + flashEmbed: 'Ajouter un objet flash', + + // MooEditable.Forecolor + changeColor: 'Changer la couleur', + + // MooEditable.Image + imageAlt: 'alt', + imageClass: 'classe', + imageAlign: 'alignement', + imageAlignNone: 'aucun', + imageAlignLeft: 'gauche', + imageAlignCenter: 'centre', + imageAlignRight: 'droite', + addEditImage: 'Ajouter/Editer une image', + + // MooEditable.Pagebreak + pageBreak: 'Saut de page', + + // MooEditable.Smiley + insertSmiley: 'Ajouter un Smiley', + + // MooEditable.Table + tableColumns: 'colonnes', + tableRows: 'lignes', + tableWidth: 'largeur', + tableClass: 'classe', + tableType: 'type', + tableHeader: 'entête', + tableCell: 'cellule', + tableAlign: 'alignement', + tableAlignNone: 'aucun', + tableAlignCenter: 'centre', + tableAlignRight: 'droite', + tableValign: 'alignement vertical', + tableValignNone: 'aucun', + tableValignTop: 'haut', + tableValignMiddle: 'milieu', + tableValignBottom: 'bas', + addTable: 'Ajouter un tableau', + editTable: 'Editer le tableau', + addTableRow: 'Ajouter une ligne', + editTableRow: 'Editer la ligne', + mergeTableRow: 'Scinder la ligne', + splitTableRow: 'Séparer la ligne', + deleteTableRow: 'Supprimer la ligne', + addTableCol: 'Ajouter une colonne', + editTableCol: 'Editer la colonne', + mergeTableCell: 'Scinder la colonne', + splitTableCell: 'Séprarer la colonne', + deleteTableCol: 'Supprimer la colonne', + + // MooEditable.UI.Statusbar + words : 'Mots', + chars : 'Caractères', + maxof : 'sur' + + }); \ No newline at end of file diff --git a/Source/Locale/Locale.it-IT.MooEditable.js b/Source/Locale/Locale.it-IT.MooEditable.js index 326f9d0..54ef6fa 100644 --- a/Source/Locale/Locale.it-IT.MooEditable.js +++ b/Source/Locale/Locale.it-IT.MooEditable.js @@ -1,115 +1,120 @@ -/* ---- - -name: Locale.it-IT.MooEditable - -description: MooEditable messages for French. - -license: MIT-style license - -authors: -- danielecorti81 - -requires: -- MooEditable -- more:1.3/Locale - -provides: [Locale.it-IT.MooEditable] - -... -*/ - -Locale.define('it-IT', 'MooEditable', { - - // MooEditable - ok: 'OK', - cancel: 'Annullare', - bold: 'Grassetto', - italic: 'Corsivp', - underline: 'Sottolineato', - strikethrough: 'Barrato', - unorderedList: 'Lista non ordinata', - orderedList: 'Lista ordinata', - indent: 'Aumentare il rientro', - outdent: 'Diminuire il rientro', - undo: 'Annulla', - redo: 'Ripristina', - removeHyperlink: 'Rimuovere il link', - addHyperlink: 'Aggiungere un link', - selectTextHyperlink: 'Prego selezionare il testo da includere nel link.', - enterURL: 'Inserire un URL', - enterImageURL: 'Inserire l\'URL dell\'immagine', - addImage: 'Aggiungere un\'immagine', - toggleView: 'Cambia la Vista', - - // MooEditable.Charmap - insertCustomCharacter: 'Aggiungi un carattere speciale', - insertCharacter: 'Aggiungi', - - // MooEditable.Extras - blockFormatting: 'Blocca la Formattazione', - paragraph: 'Paragrafo', - heading1: 'Titolo 1', - heading2: 'Titolo 2', - heading3: 'Titolo 3', - alignLeft: 'Allineamento a sinistra', - alignRight: 'Allineamento a destra', - alignCenter: 'Allineamento centrato', - alignJustify: 'Allineamento Giustificato', - removeFormatting: 'Rimuovere la Formattazione', - insertHorizontalRule: 'Inserimento di una Linea Orizzontale', - - // MooEditable.Flash - embed: 'Inserire il codice da incorporare', - flashEmbed: 'Aggiungere un oggetto flash', - - // MooEditable.Forecolor - changeColor: 'Cambiare il colore', - - // MooEditable.Image - imageAlt: 'alt', - imageClass: 'classe', - imageAlign: 'allineamento', - imageAlignNone: 'nessuno', - imageAlignLeft: 'sinistra', - imageAlignCenter: 'centrato', - imageAlignRight: 'destra', - addEditImage: 'Aggiungere/Modificare un\'immagine', - - // MooEditable.Pagebreak - pageBreak: 'Interruzione di Pagina', - - // MooEditable.Smiley - insertSmiley: 'Ajouter un Smiley', - - // MooEditable.Table - tableColumns: 'colonne', - tableRows: 'righe', - tableWidth: 'larghezza', - tableClass: 'classe', - tableType: 'tipo', - tableHeader: 'intestazione', - tableCell: 'cella', - tableAlign: 'allineamento', - tableAlignNone: 'nessuno', - tableAlignCenter: 'centrato', - tableAlignRight: 'destra', - tableValign: 'allineamento verticale', - tableValignNone: 'nessuno', - tableValignTop: 'in testa', - tableValignMiddle: 'al centro', - tableValignBottom: 'in fondo', - addTable: 'Aggiungere una tabella', - editTable: 'Modificare una tabella', - addTableRow: 'Aggiungere una riga', - editTableRow: 'Modificare una riga', - mergeTableRow: 'Unire la riga', - splitTableRow: 'Dividere la riga', - deleteTableRow: 'Cancellare la riga', - addTableCol: 'Aggiungere una colonna', - editTableCol: 'Modificare la colonna', - mergeTableCell: 'Unire la colonna', - splitTableCell: 'Dividere la colonna', - deleteTableCol: 'Cancellare la colonna' - +/* +--- + +name: Locale.it-IT.MooEditable + +description: MooEditable messages for French. + +license: MIT-style license + +authors: +- danielecorti81 + +requires: +- MooEditable +- more:1.3/Locale + +provides: [Locale.it-IT.MooEditable] + +... +*/ + +Locale.define('it-IT', 'MooEditable', { + + // MooEditable + ok: 'OK', + cancel: 'Annullare', + bold: 'Grassetto', + italic: 'Corsivp', + underline: 'Sottolineato', + strikethrough: 'Barrato', + unorderedList: 'Lista non ordinata', + orderedList: 'Lista ordinata', + indent: 'Aumentare il rientro', + outdent: 'Diminuire il rientro', + undo: 'Annulla', + redo: 'Ripristina', + removeHyperlink: 'Rimuovere il link', + addHyperlink: 'Aggiungere un link', + selectTextHyperlink: 'Prego selezionare il testo da includere nel link.', + enterURL: 'Inserire un URL', + enterImageURL: 'Inserire l\'URL dell\'immagine', + addImage: 'Aggiungere un\'immagine', + toggleView: 'Cambia la Vista', + + // MooEditable.Charmap + insertCustomCharacter: 'Aggiungi un carattere speciale', + insertCharacter: 'Aggiungi', + + // MooEditable.Extras + blockFormatting: 'Blocca la Formattazione', + paragraph: 'Paragrafo', + heading1: 'Titolo 1', + heading2: 'Titolo 2', + heading3: 'Titolo 3', + alignLeft: 'Allineamento a sinistra', + alignRight: 'Allineamento a destra', + alignCenter: 'Allineamento centrato', + alignJustify: 'Allineamento Giustificato', + removeFormatting: 'Rimuovere la Formattazione', + insertHorizontalRule: 'Inserimento di una Linea Orizzontale', + + // MooEditable.Flash + embed: 'Inserire il codice da incorporare', + flashEmbed: 'Aggiungere un oggetto flash', + + // MooEditable.Forecolor + changeColor: 'Cambiare il colore', + + // MooEditable.Image + imageAlt: 'alt', + imageClass: 'classe', + imageAlign: 'allineamento', + imageAlignNone: 'nessuno', + imageAlignLeft: 'sinistra', + imageAlignCenter: 'centrato', + imageAlignRight: 'destra', + addEditImage: 'Aggiungere/Modificare un\'immagine', + + // MooEditable.Pagebreak + pageBreak: 'Interruzione di Pagina', + + // MooEditable.Smiley + insertSmiley: 'Ajouter un Smiley', + + // MooEditable.Table + tableColumns: 'colonne', + tableRows: 'righe', + tableWidth: 'larghezza', + tableClass: 'classe', + tableType: 'tipo', + tableHeader: 'intestazione', + tableCell: 'cella', + tableAlign: 'allineamento', + tableAlignNone: 'nessuno', + tableAlignCenter: 'centrato', + tableAlignRight: 'destra', + tableValign: 'allineamento verticale', + tableValignNone: 'nessuno', + tableValignTop: 'in testa', + tableValignMiddle: 'al centro', + tableValignBottom: 'in fondo', + addTable: 'Aggiungere una tabella', + editTable: 'Modificare una tabella', + addTableRow: 'Aggiungere una riga', + editTableRow: 'Modificare una riga', + mergeTableRow: 'Unire la riga', + splitTableRow: 'Dividere la riga', + deleteTableRow: 'Cancellare la riga', + addTableCol: 'Aggiungere una colonna', + editTableCol: 'Modificare la colonna', + mergeTableCell: 'Unire la colonna', + splitTableCell: 'Dividere la colonna', + deleteTableCol: 'Cancellare la colonna', + + // MooEditable.UI.Statusbar + words : 'Parole', + chars : 'Carattere', + maxof : 'di' + }); \ No newline at end of file diff --git a/Source/Locale/Locale.nl.MooEditable.js b/Source/Locale/Locale.nl.MooEditable.js index e349766..b7f14cc 100644 --- a/Source/Locale/Locale.nl.MooEditable.js +++ b/Source/Locale/Locale.nl.MooEditable.js @@ -1,124 +1,129 @@ -/* ---- - -name: Locale.nl.MooEditable - -description: MooEditable messages in Dutch. - -license: MIT-style license - -authors: -- Erik Dubbelboer - -requires: -- MooEditable -- more:1.3/Locale - -provides: [Locale.nl.MooEditable] - -... -*/ - -Locale.define('nl', 'MooEditable', { - - // MooEditable - ok: 'OK', - cancel: 'Annuleren', - bold: 'Vet', - italic: 'Cursief', - underline: 'Onderstrepen', - strikethrough: 'Doorhalen', - unorderedList: 'Opsommingstekens', - orderedList: 'Nummering', - indent: 'Inspringen', - outdent: 'Uitspringen', - undo: 'Ongedaan maken', - redo: 'Opnieuw', - removeHyperlink: 'Hyperlink verwijderen', - addHyperlink: 'Hyperlink toevoegen', - selectTextHyperlink: 'Selecteer eerst de tekst waar u de hyperlink aan toe wilt voegen', - enterURL: 'Voer de hyperlink in', - enterImageURL: 'Voer de hyperlink van de illustratie in', - addImage: 'Illustratie toevoegen', - toggleView: 'Wijzig modus', - - // MooEditable.Charmap - insertCustomCharacter: 'Voer speciaal symbool in', - insertCharacter: 'Voer symbool in', - - // MooEditable.Extras - blockFormatting: 'Alinea opmaak', - paragraph: 'Paragraaf', - heading1: 'Kop 1', - heading2: 'Kop 2', - heading3: 'Kop 3', - alignLeft: 'Links inspringen', - alignRight: 'Rechts inspringen', - alignCenter: 'Centreren', - alignJustify: 'Uitvullen', - removeFormatting: 'Verwijder opmaak', - insertHorizontalRule: 'Voer horizontale streep in', - - // MooEditable.Flash - embed: 'Voer embed code in', - flashEmbed: 'Flash Embed', - - // MooEditable.Forecolor - changeColor: 'Wijzig kleur', - - // MooEditable.Image - imageAlt: 'alt', - imageClass: 'class', - imageAlign: 'align', - imageAlignNone: 'none', - imageAlignLeft: 'left', - imageAlignCenter: 'center', - imageAlignRight: 'right', - addEditImage: 'Wijzig illustratie', - - // MooEditable.Pagebreak - pageBreak: 'Pagina einde', - - // MooEditable.Smiley - insertSmiley: 'Smiley toevoegen', - - // MooEditable.Table - tableColumns: 'kolommen', - tableRows: 'rijen', - tableWidth: 'breedte', - tableClass: 'class', - tableType: 'type', - tableHeader: 'Hoofd', - tableCell: 'Cel', - tableAlign: 'uitlijnen', - tableAlignNone: 'geen', - tableAlignCenter: 'midden', - tableAlignRight: 'rechts', - tableValign: 'verticaal uitlijnen', - tableValignNone: 'geen', - tableValignTop: 'boven', - tableValignMiddle: 'midden', - tableValignBottom: 'beneden', - addTable: 'Tabel toevoegen', - editTable: 'Tabel aanpassen', - addTableRow: 'Rij toevoegen', - editTableRow: 'Rij aanpassen', - mergeTableRow: 'Rijen samenvoegen', - splitTableRow: 'Rijen splitsen', - deleteTableRow: 'Rijen verwijderen', - addTableCol: 'Kolom toevoegen', - editTableCol: 'Kolom aanpassen', - mergeTableCell: 'Cellen samenvoegen', - splitTableCell: 'Cel splitsen', - deleteTableCol: 'Kolom verwijderen', - - // MooEditable.UI.ExtendedLinksDialog - protocol: 'protocol', - link: 'hyperlink', - email: 'e-Mail', - urlWithoutHttp: 'Hyperlink (zonder http://)', - window: 'Venster', - sameWindow: 'Zelfde venster', - newWindow: 'Nieuw venster' - -}); +/* +--- + +name: Locale.nl.MooEditable + +description: MooEditable messages in Dutch. + +license: MIT-style license + +authors: +- Erik Dubbelboer + +requires: +- MooEditable +- more:1.3/Locale + +provides: [Locale.nl.MooEditable] + +... +*/ + +Locale.define('nl', 'MooEditable', { + + // MooEditable + ok: 'OK', + cancel: 'Annuleren', + bold: 'Vet', + italic: 'Cursief', + underline: 'Onderstrepen', + strikethrough: 'Doorhalen', + unorderedList: 'Opsommingstekens', + orderedList: 'Nummering', + indent: 'Inspringen', + outdent: 'Uitspringen', + undo: 'Ongedaan maken', + redo: 'Opnieuw', + removeHyperlink: 'Hyperlink verwijderen', + addHyperlink: 'Hyperlink toevoegen', + selectTextHyperlink: 'Selecteer eerst de tekst waar u de hyperlink aan toe wilt voegen', + enterURL: 'Voer de hyperlink in', + enterImageURL: 'Voer de hyperlink van de illustratie in', + addImage: 'Illustratie toevoegen', + toggleView: 'Wijzig modus', + + // MooEditable.Charmap + insertCustomCharacter: 'Voer speciaal symbool in', + insertCharacter: 'Voer symbool in', + + // MooEditable.Extras + blockFormatting: 'Alinea opmaak', + paragraph: 'Paragraaf', + heading1: 'Kop 1', + heading2: 'Kop 2', + heading3: 'Kop 3', + alignLeft: 'Links inspringen', + alignRight: 'Rechts inspringen', + alignCenter: 'Centreren', + alignJustify: 'Uitvullen', + removeFormatting: 'Verwijder opmaak', + insertHorizontalRule: 'Voer horizontale streep in', + + // MooEditable.Flash + embed: 'Voer embed code in', + flashEmbed: 'Flash Embed', + + // MooEditable.Forecolor + changeColor: 'Wijzig kleur', + + // MooEditable.Image + imageAlt: 'alt', + imageClass: 'class', + imageAlign: 'align', + imageAlignNone: 'none', + imageAlignLeft: 'left', + imageAlignCenter: 'center', + imageAlignRight: 'right', + addEditImage: 'Wijzig illustratie', + + // MooEditable.Pagebreak + pageBreak: 'Pagina einde', + + // MooEditable.Smiley + insertSmiley: 'Smiley toevoegen', + + // MooEditable.Table + tableColumns: 'kolommen', + tableRows: 'rijen', + tableWidth: 'breedte', + tableClass: 'class', + tableType: 'type', + tableHeader: 'Hoofd', + tableCell: 'Cel', + tableAlign: 'uitlijnen', + tableAlignNone: 'geen', + tableAlignCenter: 'midden', + tableAlignRight: 'rechts', + tableValign: 'verticaal uitlijnen', + tableValignNone: 'geen', + tableValignTop: 'boven', + tableValignMiddle: 'midden', + tableValignBottom: 'beneden', + addTable: 'Tabel toevoegen', + editTable: 'Tabel aanpassen', + addTableRow: 'Rij toevoegen', + editTableRow: 'Rij aanpassen', + mergeTableRow: 'Rijen samenvoegen', + splitTableRow: 'Rijen splitsen', + deleteTableRow: 'Rijen verwijderen', + addTableCol: 'Kolom toevoegen', + editTableCol: 'Kolom aanpassen', + mergeTableCell: 'Cellen samenvoegen', + splitTableCell: 'Cel splitsen', + deleteTableCol: 'Kolom verwijderen', + + // MooEditable.UI.ExtendedLinksDialog + protocol: 'protocol', + link: 'hyperlink', + email: 'e-Mail', + urlWithoutHttp: 'Hyperlink (zonder http://)', + window: 'Venster', + sameWindow: 'Zelfde venster', + newWindow: 'Nieuw venster', + + // MooEditable.UI.Statusbar + words : 'Woorden', + chars : 'Karakters', + maxof : 'van' + +}); diff --git a/Source/Locale/Locale.pt-BR.MooEditable.js b/Source/Locale/Locale.pt-BR.MooEditable.js index e30c8e5..78956df 100644 --- a/Source/Locale/Locale.pt-BR.MooEditable.js +++ b/Source/Locale/Locale.pt-BR.MooEditable.js @@ -1,124 +1,129 @@ -/* ---- - -name: Locale.pt-BR.MooEditable - -description: MooEditable messages for PT Brazilian. - -license: MIT-style license - -authors: -- Rodrigo Panachi - -requires: -- MooEditable -- more:1.3/Locale - -provides: [Locale.pt-BR.MooEditable] - -... -*/ - -Locale.define('pt-BR', 'MooEditable', { - - // MooEditable - ok: 'OK', - cancel: 'Cancelar', - bold: 'Negrito', - italic: 'Itálico', - underline: 'Sublinhado', - strikethrough: 'Tachado', - unorderedList: 'Lista sem números', - orderedList: 'Lista numerada', - indent: 'Aumentar recuo', - outdent: 'Diminuir recuo', - undo: 'Desfazer', - redo: 'Refazer', - removeHyperlink: 'Remover link', - addHyperlink: 'Inserir link', - selectTextHyperlink: 'Por favor, selecione o texto que deseja inserir o link.', - enterURL: 'Forneça a URL', - enterImageURL: 'Forneça a URL da imagem', - addImage: 'Adicionar imagem', - toggleView: 'Alterar visualização', - - // MooEditable.Charmap - insertCustomCharacter: 'Inserir caractere personalizado', - insertCharacter: 'Inserir caractere', - - // MooEditable.Extras - blockFormatting: 'Formatar bloco', - paragraph: 'Parágrafo', - heading1: 'Título 1', - heading2: 'Título 2', - heading3: 'Titulo 3', - alignLeft: 'Alinhar esquerda', - alignRight: 'Alinhar direita', - alignCenter: 'Centralizar', - alignJustify: 'Justificado', - removeFormatting: 'Remover formatação', - insertHorizontalRule: 'Inserir linha horizontal', - - // MooEditable.Flash - embed: 'Forneça código embutido', - flashEmbed: 'Flash embutido', - - // MooEditable.Forecolor - changeColor: 'Alterar cor', - - // MooEditable.Image - imageAlt: 'Alt', - imageClass: 'Classe', - imageAlign: 'Alinhamento', - imageAlignNone: 'nenhum', - imageAlignLeft: 'esquerda', - imageAlignCenter: 'centralizado', - imageAlignRight: 'direita', - addEditImage: 'Inserir/editar imagem', - - // MooEditable.Pagebreak - pageBreak: 'Quebra de página', - - // MooEditable.Smiley - insertSmiley: 'Inserir Smiley', - - // MooEditable.Table - tableColumns: 'Colunas', - tableRows: 'Linhas', - tableWidth: 'Largura', - tableClass: 'Classe', - tableType: 'Tipo', - tableHeader: 'Cabeçalho', - tableCell: 'Célula', - tableAlign: 'Alinhamento', - tableAlignNone: 'nenhum', - tableAlignCenter: 'centralizado', - tableAlignRight: 'direita', - tableValign: 'Alinhamento vertical', - tableValignNone: 'nenhum', - tableValignTop: 'topo', - tableValignMiddle: 'meio', - tableValignBottom: 'inferior', - addTable: 'Inserir tabela', - editTable: 'Editar tabela', - addTableRow: 'Inserir linha', - editTableRow: 'Editar linha', - mergeTableRow: 'Mesclar linha', - splitTableRow: 'Dividir linha', - deleteTableRow: 'Excluir linha', - addTableCol: 'Inserir coluna', - editTableCol: 'Editar coluna', - mergeTableCell: 'Mesclar célula', - splitTableCell: 'Dividir célula', - deleteTableCol: 'Excluir coluna', - - // MooEditable.UI.ExtendedLinksDialog - protocol: 'Protocolo', - link: 'Link', - email: 'E-Mail', - urlWithoutHttp: 'URL (sem http://)', - window: 'Janela', - sameWindow: 'Mesma janela', - newWindow: 'Nova janela' - -}); +/* +--- + +name: Locale.pt-BR.MooEditable + +description: MooEditable messages for PT Brazilian. + +license: MIT-style license + +authors: +- Rodrigo Panachi + +requires: +- MooEditable +- more:1.3/Locale + +provides: [Locale.pt-BR.MooEditable] + +... +*/ + +Locale.define('pt-BR', 'MooEditable', { + + // MooEditable + ok: 'OK', + cancel: 'Cancelar', + bold: 'Negrito', + italic: 'Itálico', + underline: 'Sublinhado', + strikethrough: 'Tachado', + unorderedList: 'Lista sem números', + orderedList: 'Lista numerada', + indent: 'Aumentar recuo', + outdent: 'Diminuir recuo', + undo: 'Desfazer', + redo: 'Refazer', + removeHyperlink: 'Remover link', + addHyperlink: 'Inserir link', + selectTextHyperlink: 'Por favor, selecione o texto que deseja inserir o link.', + enterURL: 'Forneça a URL', + enterImageURL: 'Forneça a URL da imagem', + addImage: 'Adicionar imagem', + toggleView: 'Alterar visualização', + + // MooEditable.Charmap + insertCustomCharacter: 'Inserir caractere personalizado', + insertCharacter: 'Inserir caractere', + + // MooEditable.Extras + blockFormatting: 'Formatar bloco', + paragraph: 'Parágrafo', + heading1: 'Título 1', + heading2: 'Título 2', + heading3: 'Titulo 3', + alignLeft: 'Alinhar esquerda', + alignRight: 'Alinhar direita', + alignCenter: 'Centralizar', + alignJustify: 'Justificado', + removeFormatting: 'Remover formatação', + insertHorizontalRule: 'Inserir linha horizontal', + + // MooEditable.Flash + embed: 'Forneça código embutido', + flashEmbed: 'Flash embutido', + + // MooEditable.Forecolor + changeColor: 'Alterar cor', + + // MooEditable.Image + imageAlt: 'Alt', + imageClass: 'Classe', + imageAlign: 'Alinhamento', + imageAlignNone: 'nenhum', + imageAlignLeft: 'esquerda', + imageAlignCenter: 'centralizado', + imageAlignRight: 'direita', + addEditImage: 'Inserir/editar imagem', + + // MooEditable.Pagebreak + pageBreak: 'Quebra de página', + + // MooEditable.Smiley + insertSmiley: 'Inserir Smiley', + + // MooEditable.Table + tableColumns: 'Colunas', + tableRows: 'Linhas', + tableWidth: 'Largura', + tableClass: 'Classe', + tableType: 'Tipo', + tableHeader: 'Cabeçalho', + tableCell: 'Célula', + tableAlign: 'Alinhamento', + tableAlignNone: 'nenhum', + tableAlignCenter: 'centralizado', + tableAlignRight: 'direita', + tableValign: 'Alinhamento vertical', + tableValignNone: 'nenhum', + tableValignTop: 'topo', + tableValignMiddle: 'meio', + tableValignBottom: 'inferior', + addTable: 'Inserir tabela', + editTable: 'Editar tabela', + addTableRow: 'Inserir linha', + editTableRow: 'Editar linha', + mergeTableRow: 'Mesclar linha', + splitTableRow: 'Dividir linha', + deleteTableRow: 'Excluir linha', + addTableCol: 'Inserir coluna', + editTableCol: 'Editar coluna', + mergeTableCell: 'Mesclar célula', + splitTableCell: 'Dividir célula', + deleteTableCol: 'Excluir coluna', + + // MooEditable.UI.ExtendedLinksDialog + protocol: 'Protocolo', + link: 'Link', + email: 'E-Mail', + urlWithoutHttp: 'URL (sem http://)', + window: 'Janela', + sameWindow: 'Mesma janela', + newWindow: 'Nova janela', + + // MooEditable.UI.Statusbar + words : 'Palavras', + chars : 'Caracteres', + maxof : 'de' + +}); diff --git a/Source/Locale/Locale.zh_CN.MooEditable.js b/Source/Locale/Locale.zh_CN.MooEditable.js index a36c307..2d9a311 100644 --- a/Source/Locale/Locale.zh_CN.MooEditable.js +++ b/Source/Locale/Locale.zh_CN.MooEditable.js @@ -1,103 +1,108 @@ -Locale.define('zh-CN', 'MooEditable', { - - // MooEditable - ok: '确定', - cancel: 'å–消', - bold: '粗体', - italic: '斜体', - underline: '下划线', - strikethrough: '删除线', - unorderedList: '项目符å·', - orderedList: 'ç¼–å·', - indent: '增加缩进é‡', - outdent: 'å‡å°‘缩进é‡', - undo: '撤销', - redo: 'é‡åš', - removeHyperlink: '删除链接', - addHyperlink: '添加链接', - selectTextHyperlink: '请选择è¦æ·»åŠ é“¾æŽ¥çš„文字', - enterURL: '输入链接', - enterImageURL: '输入图片链接', - addImage: '添加图片', - toggleView: '切æ¢è§†å›¾', - - // MooEditable.Charmap - insertCustomCharacter: 'æ’入自定义字符', - insertCharacter: 'æ’入字符', - - // MooEditable.Extras - blockFormatting: 'æ ¼å¼', - paragraph: '正文', - heading1: '标题1', - heading2: '标题2', - heading3: '标题3', - alignLeft: '左对é½', - alignRight: 'å³å¯¹é½', - alignCenter: '居中', - alignJustify: '两端对é½', - removeFormatting: '删除格å¼', - insertHorizontalRule: 'æ’入分割线', - - // MooEditable.Flash - embed: '输入嵌入代ç ', - flashEmbed: '嵌入Flash', - - // MooEditable.Forecolor - changeColor: '更改颜色', - - // MooEditable.Image - imageAlt: 'alt', - imageClass: 'class', - imageAlign: 'align', - imageAlignNone: 'none', - imageAlignLeft: 'left', - imageAlignCenter: 'center', - imageAlignRight: 'right', - addEditImage: '添加/编辑图片', - - // MooEditable.Pagebreak - pageBreak: '分页符', - - // MooEditable.Smiley - insertSmiley: 'æ’入表情', - - // MooEditable.Table - tableColumns: 'columns', - tableRows: 'rows', - tableWidth: 'width', - tableClass: 'class', - tableType: 'type', - tableHeader: 'Header', - tableCell: 'Cell', - tableAlign: 'align', - tableAlignNone: 'none', - tableAlignCenter: 'center', - tableAlignRight: 'right', - tableValign: 'vertical align', - tableValignNone: 'none', - tableValignTop: 'top', - tableValignMiddle: 'middle', - tableValignBottom: 'bottom', - addTable: '新建表格', - editTable: '编辑表格', - addTableRow: '添加行', - editTableRow: '编辑行', - mergeTableRow: 'åˆå¹¶è¡Œ', - splitTableRow: '拆分行', - deleteTableRow: '增加行', - addTableCol: '增加列', - editTableCol: '编辑列', - mergeTableCell: 'åˆå¹¶å•å…ƒæ ¼', - splitTableCell: '拆分å•å…ƒæ ¼', - deleteTableCol: '删除列', - - // MooEditable.UI.ExtendedLinksDialog - protocol: 'protocol', - link: 'link', - email: 'e-Mail', - urlWithoutHttp: 'URL (without http://)', - window: '窗å£', - sameWindow: '当å‰çª—å£', - newWindow: '新窗å£' - -}); +Locale.define('zh-CN', 'MooEditable', { + + // MooEditable + ok: '确定', + cancel: 'å–消', + bold: '粗体', + italic: '斜体', + underline: '下划线', + strikethrough: '删除线', + unorderedList: '项目符å·', + orderedList: 'ç¼–å·', + indent: '增加缩进é‡', + outdent: 'å‡å°‘缩进é‡', + undo: '撤销', + redo: 'é‡åš', + removeHyperlink: '删除链接', + addHyperlink: '添加链接', + selectTextHyperlink: '请选择è¦æ·»åŠ é“¾æŽ¥çš„文字', + enterURL: '输入链接', + enterImageURL: '输入图片链接', + addImage: '添加图片', + toggleView: '切æ¢è§†å›¾', + + // MooEditable.Charmap + insertCustomCharacter: 'æ’入自定义字符', + insertCharacter: 'æ’入字符', + + // MooEditable.Extras + blockFormatting: 'æ ¼å¼', + paragraph: '正文', + heading1: '标题1', + heading2: '标题2', + heading3: '标题3', + alignLeft: '左对é½', + alignRight: 'å³å¯¹é½', + alignCenter: '居中', + alignJustify: '两端对é½', + removeFormatting: '删除格å¼', + insertHorizontalRule: 'æ’入分割线', + + // MooEditable.Flash + embed: '输入嵌入代ç ', + flashEmbed: '嵌入Flash', + + // MooEditable.Forecolor + changeColor: '更改颜色', + + // MooEditable.Image + imageAlt: 'alt', + imageClass: 'class', + imageAlign: 'align', + imageAlignNone: 'none', + imageAlignLeft: 'left', + imageAlignCenter: 'center', + imageAlignRight: 'right', + addEditImage: '添加/编辑图片', + + // MooEditable.Pagebreak + pageBreak: '分页符', + + // MooEditable.Smiley + insertSmiley: 'æ’入表情', + + // MooEditable.Table + tableColumns: 'columns', + tableRows: 'rows', + tableWidth: 'width', + tableClass: 'class', + tableType: 'type', + tableHeader: 'Header', + tableCell: 'Cell', + tableAlign: 'align', + tableAlignNone: 'none', + tableAlignCenter: 'center', + tableAlignRight: 'right', + tableValign: 'vertical align', + tableValignNone: 'none', + tableValignTop: 'top', + tableValignMiddle: 'middle', + tableValignBottom: 'bottom', + addTable: '新建表格', + editTable: '编辑表格', + addTableRow: '添加行', + editTableRow: '编辑行', + mergeTableRow: 'åˆå¹¶è¡Œ', + splitTableRow: '拆分行', + deleteTableRow: '增加行', + addTableCol: '增加列', + editTableCol: '编辑列', + mergeTableCell: 'åˆå¹¶å•å…ƒæ ¼', + splitTableCell: '拆分å•å…ƒæ ¼', + deleteTableCol: '删除列', + + // MooEditable.UI.ExtendedLinksDialog + protocol: 'protocol', + link: 'link', + email: 'e-Mail', + urlWithoutHttp: 'URL (without http://)', + window: '窗å£', + sameWindow: '当å‰çª—å£', + newWindow: '新窗å£', + + // MooEditable.UI.Statusbar + words : 'è¯', + chars : '字符', + maxof : ':' + +}); diff --git a/Source/MooEditable/MooEditable.UI.Statusbar.js b/Source/MooEditable/MooEditable.UI.Statusbar.js index 8fca560..0da4281 100644 --- a/Source/MooEditable/MooEditable.UI.Statusbar.js +++ b/Source/MooEditable/MooEditable.UI.Statusbar.js @@ -1,241 +1,281 @@ -/* ---- - -name: MooEditable.UI.Statusbar - -description: Draw Statusbar with character and/or word counter / show html path word and character/word limit. - -license: MIT-style license - -author: -- René Grosseck - -requires: -- MooEditable -- More/String.Extras -- More/Class.Refactor -- More/Class.Mask -- More/Drag - -usage: - Add the following tags in your html - - - - - - - -provides: [MooEditable.UI.Statusbar] - -version: - 1.0.0 - First release -... -*/ - -(function () { - - MooEditable.Locale.define({ - words : 'Words', - chars : 'Characters' - }); - - MooEditable = Class.refactor(MooEditable, { - - options: { - 'showwords' : true, - 'showchars' : true, - 'shownode' : true, - 'maxwords': null, //Html view word limit - 'maxchars': null, //Html view character limit - 'maxrealchars': null, //Code view character limit - 'resizeable' : true, - 'resizedirection' : {x: false, y: true}, - 'separator' : ' / ', - 'class' : '' - }, - - statusbar: null, - nodepath: null, - resizer: null, - wordcounter: null, - - attach: function () { - this.previous(); - this.setOptions(this.options); - this.drawStatusbar(); - return this; - }, - - drawStatusbar: function(){ - var self = this; - this.statusbar = new Element('div', {'class': 'mooeditable-ui-statusbar ' + this.options['class']}); - - if(this.options.shownode){ - this.nodepath = new Element('div', {'class': 'mooeditable-ui-statusbar-nodepath' + this.options['class']}); - document.id(this.nodepath).inject(this.statusbar); - } - - if ((this.options.showwords) || (this.options.showchars)) { - this.wordcounter = new Element('div', {'class': 'mooeditable-ui-statusbar-wordcount' + this.options['class']}); - this.updateCount(); - this.doc.body.addEvent('keydown', this.updateCount.bind(this)); - this.doc.body.addEvent('keyup', this.updateCount.bind(this)); - this.textarea.addEvent('keydown', this.updateCount.bind(this)); - this.textarea.addEvent('keyup', this.updateCount.bind(this)); - document.id(this.wordcounter).inject(this.statusbar); - } - - if(this.options.resizeable && (this.options.resizedirection.x || this.options.resizedirection.y)){ - this.resizer = new Element('div', {'class': 'mooeditable-ui-statusbar-resize'}); - var min_width = this.options.dimensions ? Math.max(this.options.dimensions.x, 100) : 100; - var min_height = this.options.dimensions ? Math.max(this.options.dimensions.y, 100) : 100; - var xlimit = {}; - var mcursor = ''; - - if(this.options.resizedirection.y == true){ - Object.append(xlimit, {y: [min_height, 0xFFFF]}); - mcursor+='s'; - } - if(this.options.resizedirection.x == true){ - Object.append(xlimit, {x: [min_width, 0xFFFF]}); - mcursor+='e'; - } - this.resizer.setStyle('cursor', mcursor+'-resize'); - - this.iframe.makeResizable({ - handle: this.resizer, - limit: xlimit, - modifiers: {x: this.options.resizedirection.x == true ? 'width' : false, y: this.options.resizedirection.y == true ? 'height' : false}, - snap: 0, - preventDefault: true, - onBeforeStart: function(e){ - mooeditableiframesaver = new Mask(document.body,{ - style: { - 'z-index': 2147483647, - opacity: 0, - cursor: mcursor+'-resize' - } - }).show(); - mooeditableiframesaver.show(); - this.fireEvent('editorResizeStart', [e, self]); - }, - onDrag: function(el){ - self.textarea.setStyle('width', el.getDimensions().x); - self.textarea.setStyle('height', el.getDimensions().y); - - if(self.options.resizedirection.x == true) - self.container.setStyle('width', el.getSize().x); - - this.fireEvent('editorResize', [el, self]); - }, - onComplete: function(e){ - mooeditableiframesaver.destroy(); - this.fireEvent('editorResizeEnd', [e, self]); - } - }); - - document.id(this.resizer).inject(this.statusbar); - } - document.id(this.statusbar).inject(this.container, 'bottom'); - }, - - updateCount: function(e){ - - if ((!this.options.showwords) || (!this.options.showchars)) - return; - - var text = this.mode == 'iframe' ? this.htmlspecialchars_decode(this.getContent().stripTags()) : this.textarea.get('value'); - text = text.replace(/(^\s*)|(\s*$)/gi,"").replace(/[ ]{2,}/gi," ").replace(/\n /,"\n"); - var numChars = text.length; - var realChars = this.getContent().length; - var numWords = (numChars != 0) ? text.split(' ').length : 0; - - if(e && e.key != 'delete' && e.key != 'backspace'){ - if(this.options.maxwords && numWords > this.options.maxwords) - return false; - if(this.options.maxchars && numChars >= this.options.maxchars) - return false; - if(this.options.maxrealchars && realChars >= this.options.maxrealchars) - return false; - } - - if ((this.options.showwords) && (this.options.showchars)) { - var insertText = (this.mode == 'iframe' ? MooEditable.Locale.get('words') + ': ' + numWords + this.options.separator : '') + MooEditable.Locale.get('chars') + ': ' + numChars; - } - else { - var insertText = (this.options.showwords && this.mode == 'iframe') ? MooEditable.Locale.get('words') + ': ' + numWords : (this.options.showchars) ? MooEditable.Locale.get('chars') + ': ' + numChars : ''; - } - this.wordcounter.set('text', insertText); - - }, - - //Clean Elements like   for right counting - htmlspecialchars_decode: function(text){ - var stub_object = new Element('span',{ 'html':text }); - var ret_val = stub_object.get('text'); - delete stub_object; - return ret_val; - }, - - editorClick: function(){ - this.previous(); - this.updateNodePath(); - }, - - action: function(command, args){ - this.previous(command, args); - this.updateCount(); - this.updateNodePath(); - }, - - updateNodePath: function(command){ - - if ((!this.options.shownode)) - return; - - this.nodepath.empty(); - - var elements = []; - var el = this.selection.getNode(); - if(!el) return; - if(typeOf(el) != 'element') return; - - if(el.nodeName.toLowerCase() != 'html' && el.nodeName.toLowerCase() != 'body'){ - elements.include(el); - do { - if(el && el.nodeName.toLowerCase() != 'html' && el.nodeName.toLowerCase() != 'body') - elements.include(el); - } - while ((el = Element.getParent(el)) != null); - } - - if(this.mode == 'iframe'){ - var l = elements.length; - elements.reverse().each(function(elp, i){ - var iel = new Element('span',{ - 'text':elp.nodeName.toLowerCase(), - 'class': 'node' - }); - iel.addEvent('click', function(e){ - var newnode = this.selection.selectNode(elp, true); - }.bind(this)); - iel.inject(this.nodepath); - if(i < (l-1)){ - var iel = new Element('span',{'text':' » '}); - document.id(iel).inject(this.nodepath); - } - }, this); - } - }, - - checkStates: function(){ - this.previous(); - this.updateNodePath(); - } - }); +/* +--- + +name: MooEditable.UI.Statusbar + +description: Draw Statusbar with character and/or word counter / show html path word and character/word limit. + +license: MIT-style license + +author: +- René Grosseck + +requires: +- MooEditable +- More/String.Extras +- More/Class.Refactor +- More/Class.Mask +- More/Drag + +usage: + Add the following tags in your html + + + + + + + +provides: [MooEditable.UI.Statusbar] + +version: + 1.0.0 - First release + 1.0.1 - fix some bugs counting words with limit + - add new options (showmaxwords,showmaxchars,etc) to show maxwords and/or maxchars + - add translation into Locale files + - optimize MooEditable.css padding +... + */ + +(function () { + + MooEditable.Locale.define({ + words : 'Words', + chars : 'Characters', + maxof : 'of' + }); + + MooEditable = Class.refactor(MooEditable, { + + options: { + /* + onEditorResizeBeforeStart : function(){}, + onEditorResizeDrag : function(){}, + onEditorResizeComplete : function(){} + */ + 'showwords' : true, //show count of words + 'showchars' : true, //show count of chars + 'shownode' : true, //show html nodes + 'showmaxwords' : true, //show word limit if set by maxwords + 'showmaxchars' : true, //show chars limit if set by maxchars or maxrealchar + 'maxwords': null, //word limit into Html View + 'maxchars': null, //character limit into Html View (only text) + 'maxrealchars': null, //character limit into Code View (text + html-tags) + 'resizeable' : true, //Editor resizable + 'resizedirection' : {x: false, y: true}, //Editor resizable directions + 'separator' : '/', //seperator between word and character + 'class' : '', + baseCSS: 'html{ height: 100%; cursor: text; margin: 0; padding: 0;} body{ font-family: sans-serif; margin: 0 16px;}' + }, + + statusbar: null, + nodepath: null, + resizer: null, + wordcounter: null, + + attach: function () { + this.previous(); + this.setOptions(this.options); + this.drawStatusbar(); + return this; + }, + + drawStatusbar: function(){ + var self = this; + this.statusbar = new Element('div', {'class': 'mooeditable-ui-statusbar ' + this.options['class']}); + + if(this.options.shownode){ + this.nodepath = new Element('div', {'class': 'mooeditable-ui-statusbar-nodepath' + this.options['class']}); + document.id(this.nodepath).inject(this.statusbar); + } + + if ((this.options.showwords) || (this.options.showchars)) { + this.wordcounter = new Element('div', {'class': 'mooeditable-ui-statusbar-wordcount' + this.options['class']}); + this.updateCount(); + this.doc.body.addEvent('keydown', this.updateCount.bind(this)); + this.doc.body.addEvent('keyup', this.updateCount.bind(this)); + this.textarea.addEvent('keydown', this.updateCount.bind(this)); + this.textarea.addEvent('keyup', this.updateCount.bind(this)); + document.id(this.wordcounter).inject(this.statusbar); + } + + if(this.options.resizeable && (this.options.resizedirection.x || this.options.resizedirection.y)){ + this.resizer = new Element('div', {'class': 'mooeditable-ui-statusbar-resize'}); + var min_width = this.options.dimensions ? Math.max(this.options.dimensions.x, 100) : 100, + min_height = this.options.dimensions ? Math.max(this.options.dimensions.y, 100) : 100, + xlimit = {}, + mcursor = ''; + + if(this.options.resizedirection.y == true){ + Object.append(xlimit, {y: [min_height, 0xFFFF]}); + mcursor+='s'; + } + if(this.options.resizedirection.x == true){ + Object.append(xlimit, {x: [min_width, 0xFFFF]}); + mcursor+='e'; + } + this.resizer.setStyle('cursor', mcursor+'-resize'); + + this.iframe.makeResizable({ + handle: this.resizer, + limit: xlimit, + modifiers: {x: this.options.resizedirection.x == true ? 'width' : false, y: this.options.resizedirection.y == true ? 'height' : false}, + snap: 0, + preventDefault: true, + onBeforeStart: function(e){ + mooeditableiframesaver = new Mask(document.body,{ + style: { + 'z-index': 2147483647, + opacity: 0, + cursor: mcursor+'-resize' + } + }).show(); + mooeditableiframesaver.show(); + this.fireEvent('editorResizeBeforeStart', [e, this]); + }.bind(this), + onDrag: function(el){ + self.textarea.setStyle('width', el.getDimensions().x); + self.textarea.setStyle('height', el.getDimensions().y); + + if(self.options.resizedirection.x == true) + self.container.setStyle('width', el.getSize().x); + + this.fireEvent('editorResizeDrag', [el, this]); + + }.bind(this), + onComplete: function(e){ + mooeditableiframesaver.destroy(); + this.fireEvent('editorResizeComplete', [e, this]); + }.bind(this) + }); + + document.id(this.resizer).inject(this.statusbar); + } + document.id(this.statusbar).inject(this.container, 'bottom'); + return this; + }, + + updateCount: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + if ((!this.options.showwords) && (!this.options.showchars)) + return; + + var text = this.mode == 'iframe' ? this.htmlspecialchars_decode(this.getContent().stripTags()) : this.textarea.get('value'), + text_without_multi_space = text.replace(/(^\s*)|(\s*$)/gi,"").replace(/[ ]{2,}/gi," ").replace(/\n /,"\n"); + + var numChars = text_without_multi_space.length, + realChars = this.getContent().length, + numWords = this.getWordCount(text_without_multi_space), + statusbarText = []; + + if((this.options.showwords) && this.mode == 'iframe') + statusbarText.push(MooEditable.Locale.get('words') + ': ' + numWords); + if((this.options.showmaxwords) && this.mode == 'iframe' && this.options.maxwords && this.options.maxwords > 0) + statusbarText.push(MooEditable.Locale.get('maxof') + ' ' + this.options.maxwords); + if((this.options.showwords) && (this.options.showchars) && this.mode == 'iframe') + statusbarText.push(this.options.separator); + if((this.options.showchars)) + statusbarText.push(MooEditable.Locale.get('chars') + ': ' + numChars); + if((this.options.showmaxchars) && this.mode == 'iframe' && this.options.maxchars && this.options.maxchars > 0) + statusbarText.push(MooEditable.Locale.get('maxof') + ' ' + this.options.maxchars); + if((this.options.showmaxchars) && this.mode != 'iframe' && this.options.maxrealchars && this.options.maxrealchars > 0) + statusbarText.push(MooEditable.Locale.get('maxof') + ' ' + this.options.maxrealchars); + + this.wordcounter.set('text', statusbarText.join(' ')); + + if(e && e.key != 'delete' && e.key != 'backspace' && (e.code < 37 || e.code > 40)){ + if(this.options.maxwords && this.options.maxwords > 0 && (numWords >= this.options.maxwords && text.substr((text.length-1), 1) == ' ')) + return false; + if(this.options.maxchars && numChars >= this.options.maxchars) + return false; + if(this.options.maxrealchars && realChars >= this.options.maxrealchars) + return false; + } + return this; + }, + + //Clean Elements like   for right counting + htmlspecialchars_decode: function(text){ + var stub_object = new Element('span',{ 'html':text }), + ret_val = stub_object.get('text'); + delete stub_object; + return ret_val; + }, + + editorClick: function(){ + this.previous(); + this.updateNodePath(); + }, + + action: function(command, args){ + this.previous(command, args); + this.updateCount(); + this.updateNodePath(); + }, + + updateNodePath: function(command){ + + if ((!this.options.shownode)) + return; + + this.nodepath.empty(); + + var elements = [], + el = this.selection.getNode(); + if(!el) return; + if(typeOf(el) != 'element') return; + + if(el.nodeName.toLowerCase() != 'html' && el.nodeName.toLowerCase() != 'body'){ + elements.include(el); + do { + if(el && el.nodeName.toLowerCase() != 'html' && el.nodeName.toLowerCase() != 'body') + elements.include(el); + } + while ((el = Element.getParent(el)) != null); + } + + if(this.mode == 'iframe'){ + var l = elements.length; + elements.reverse().each(function(elp, i){ + var iel = new Element('span',{ + 'text':elp.nodeName.toLowerCase(), + 'class': 'node' + }); + iel.addEvent('click', function(e){ + var newnode = this.selection.selectNode(elp, true); + }.bind(this)); + iel.inject(this.nodepath); + if(i < (l-1)){ + var iel = new Element('span',{'text':' » '}); + document.id(iel).inject(this.nodepath); + } + }, this); + } + }, + + checkStates: function(){ + this.previous(); + this.updateNodePath(); + }, + + getWordCount: function(text){ + var wordcount_countregex = /[\w\u2019\x27\-\u00C0-\u1FFF]+/g, + wordcount_cleanregex = /[0-9.(),;:!?%#$?\x27\x22_+=\\/\-]*/g; + + if(text){ + text=text.replace(wordcount_cleanregex,""); + var f=text.match(wordcount_countregex),e; + return f&&(e=f.length) ? e : 0; + } + return 0; + } + }); }()); \ No newline at end of file diff --git a/Source/MooEditable/MooEditable.js b/Source/MooEditable/MooEditable.js index 0039340..e9da01b 100644 --- a/Source/MooEditable/MooEditable.js +++ b/Source/MooEditable/MooEditable.js @@ -1,1585 +1,1585 @@ -/* ---- - -name: MooEditable - -description: Class for creating a WYSIWYG editor, for contentEditable-capable browsers. - -license: MIT-style license - -authors: -- Lim Chee Aun -- Radovan Lozej -- Ryan Mitchell -- Olivier Refalo -- T.J. Leahy - -requires: -- Core/Class.Extras -- Core/Element.Event -- Core/Element.Dimensions - -inspiration: -- Code inspired by Stefan's work [Safari Supports Content Editing!](http://www.xs4all.nl/~hhijdra/stefan/ContentEditable.html) from [safari gets contentEditable](http://walkah.net/blog/walkah/safari-gets-contenteditable) -- Main reference from Peter-Paul Koch's [execCommand compatibility](http://www.quirksmode.org/dom/execCommand.html) -- Some ideas and code inspired by [TinyMCE](http://tinymce.moxiecode.com/) -- Some functions inspired by Inviz's [Most tiny wysiwyg you ever seen](http://forum.mootools.net/viewtopic.php?id=746), [mooWyg (Most tiny WYSIWYG 2.0)](http://forum.mootools.net/viewtopic.php?id=5740) -- Some regex from Cameron Adams's [widgEditor](http://widgeditor.googlecode.com/) -- Some code from Juan M Martinez's [jwysiwyg](http://jwysiwyg.googlecode.com/) -- Some reference from MoxieForge's [PunyMCE](http://punymce.googlecode.com/) -- IE support referring Robert Bredlau's [Rich Text Editing](http://www.rbredlau.com/drupal/node/6) - -provides: [MooEditable, MooEditable.Selection, MooEditable.UI, MooEditable.Actions] - -... -*/ - -(function(){ - -var blockEls = /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|SCRIPT|NOSCRIPT|STYLE)$/i; -var urlRegex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i; -var protectRegex = /<(script|noscript|style)[\u0000-\uFFFF]*?<\/(script|noscript|style)>/g; - -this.MooEditable = new Class({ - - Implements: [Events, Options], - - options: { - toolbar: true, - cleanup: true, - paragraphise: true, - xhtml : true, - semantics : true, - actions: 'bold italic underline strikethrough | insertunorderedlist insertorderedlist indent outdent | undo redo | createlink unlink | urlimage | toggleview', - handleSubmit: true, - handleLabel: true, - disabled: false, - baseCSS: 'html{ height: 100%; cursor: text; } body{ font-family: sans-serif; }', - extraCSS: '', - externalCSS: '', - html: '{BASEHREF}{EXTERNALCSS}', - rootElement: 'p', - baseURL: '', - dimensions: null - }, - - initialize: function(el, options){ - - // check for content editable and design mode support - if (!("contentEditable" in document.body) && !("designMode" in document)){ - return; - } - - this.setOptions(options); - this.textarea = document.id(el); - this.textarea.store('MooEditable', this); - this.actions = this.options.actions.clean().split(' '); - this.keys = {}; - this.dialogs = {}; - this.protectedElements = []; - this.actions.each(function(action){ - var act = MooEditable.Actions[action]; - if (!act) return; - if (act.options){ - var key = act.options.shortcut; - if (key) this.keys[key] = action; - } - if (act.dialogs){ - Object.each(act.dialogs, function(dialog, name){ - dialog = dialog.attempt(this); - dialog.name = action + ':' + name; - if (typeOf(this.dialogs[action]) != 'object') this.dialogs[action] = {}; - this.dialogs[action][name] = dialog; - }, this); - } - if (act.events){ - Object.each(act.events, function(fn, event){ - this.addEvent(event, fn); - }, this); - } - }.bind(this)); - this.render(); - }, - - toElement: function(){ - return this.textarea; - }, - - render: function(){ - var self = this; - - // Dimensions - var dimensions = this.options.dimensions || this.textarea.getSize(); - - // Build the container - this.container = new Element('div', { - id: (this.textarea.id) ? this.textarea.id + '-mooeditable-container' : null, - 'class': 'mooeditable-container', - styles: { - width: dimensions.x - } - }); - - // Override all textarea styles - this.textarea.addClass('mooeditable-textarea').setStyle('height', dimensions.y); - - // Build the iframe - this.iframe = new IFrame({ - 'class': 'mooeditable-iframe', - frameBorder: 0, - src: 'javascript:""', // Workaround for HTTPs warning in IE6/7 - styles: { - height: dimensions.y - } - }); - - this.toolbar = new MooEditable.UI.Toolbar({ - onItemAction: function(){ - var args = Array.from(arguments); - var item = args[0]; - self.action(item.name, args); - } - }); - this.attach.delay(1, this); - - // Update the event for textarea's corresponding labels - if (this.options.handleLabel && this.textarea.id) $$('label[for="'+this.textarea.id+'"]').addEvent('click', function(e){ - if (self.mode != 'iframe') return; - e.preventDefault(); - self.focus(); - }); - - // Update & cleanup content before submit - if (this.options.handleSubmit){ - this.form = this.textarea.getParent('form'); - if (this.form) { - this.form.addEvent('submit', function(){ - if (self.mode == 'iframe') self.saveContent(); - }); - } - } - - this.fireEvent('render', this); - }, - - attach: function(){ - var self = this; - - // Assign view mode - this.mode = 'iframe'; - - // Editor iframe state - this.editorDisabled = false; - - // Put textarea inside container - this.container.wraps(this.textarea); - - this.textarea.setStyle('display', 'none'); - - this.iframe.setStyle('display', '').inject(this.textarea, 'before'); - - Object.each(this.dialogs, function(action, name){ - Object.each(action, function(dialog){ - document.id(dialog).inject(self.iframe, 'before'); - var range; - dialog.addEvents({ - open: function(){ - range = self.selection.getRange(); - self.editorDisabled = true; - self.toolbar.disable(name); - self.fireEvent('dialogOpen', this); - }, - close: function(){ - self.toolbar.enable(); - self.editorDisabled = false; - self.focus(); - if (range) self.selection.setRange(range); - self.fireEvent('dialogClose', this); - } - }); - }); - }); - - // contentWindow and document references - this.win = this.iframe.contentWindow; - this.doc = this.win.document; - - // Deal with weird quirks on Gecko - if (Browser.firefox) this.doc.designMode = 'On'; - - // Build the content of iframe - var docHTML = this.options.html.substitute({ - BASECSS: this.options.baseCSS, - EXTRACSS: this.options.extraCSS, - EXTERNALCSS: (this.options.externalCSS) ? '': '', - BASEHREF: (this.options.baseURL) ? '': '' - }); - this.doc.open(); - this.doc.write(docHTML); - this.doc.close(); - - // Turn on Design Mode - // IE fired load event twice if designMode is set - (Browser.ie) ? this.doc.body.contentEditable = true : this.doc.designMode = 'On'; - - // Mootoolize window, document and body - Object.append(this.win, new Window); - Object.append(this.doc, new Document); - if (Browser.Element){ - var winElement = this.win.Element.prototype; - for (var method in Element){ // methods from Element generics - if (!method.test(/^[A-Z]|\$|prototype|mooEditable/)){ - winElement[method] = Element.prototype[method]; - } - } - } else { - document.id(this.doc.body); - } - - this.setContent(this.textarea.get('value')); - - // Bind all events - this.doc.addEvents({ - mouseup: this.editorMouseUp.bind(this), - mousedown: this.editorMouseDown.bind(this), - mouseover: this.editorMouseOver.bind(this), - mouseout: this.editorMouseOut.bind(this), - mouseenter: this.editorMouseEnter.bind(this), - mouseleave: this.editorMouseLeave.bind(this), - contextmenu: this.editorContextMenu.bind(this), - click: this.editorClick.bind(this), - dblclick: this.editorDoubleClick.bind(this), - keypress: this.editorKeyPress.bind(this), - keyup: this.editorKeyUp.bind(this), - keydown: this.editorKeyDown.bind(this), - focus: this.editorFocus.bind(this), - blur: this.editorBlur.bind(this) - }); - this.win.addEvents({ - focus: this.editorFocus.bind(this), - blur: this.editorBlur.bind(this) - }); - ['cut', 'copy', 'paste'].each(function(event){ - self.doc.body.addListener(event, self['editor' + event.capitalize()].bind(self)); - }); - this.textarea.addEvent('keypress', this.textarea.retrieve('mooeditable:textareaKeyListener', this.keyListener.bind(this))); - - // Fix window focus event not firing on Firefox 2 - if (Browser.firefox2) this.doc.addEvent('focus', function(){ - self.win.fireEvent('focus').focus(); - }); - // IE9 is also not firing focus event - if (this.doc.addEventListener) this.doc.addEventListener('focus', function(){ - self.win.fireEvent('focus'); - }, true); - - // styleWithCSS, not supported in IE and Opera - if (!Browser.ie && !Browser.opera){ - var styleCSS = function(){ - self.execute('styleWithCSS', false, false); - self.doc.removeEvent('focus', styleCSS); - }; - this.win.addEvent('focus', styleCSS); - } - - if (this.options.toolbar){ - document.id(this.toolbar).inject(this.container, 'top'); - this.toolbar.render(this.actions); - } - - if (this.options.disabled) this.disable(); - - this.selection = new MooEditable.Selection(this.win); - - this.oldContent = this.getContent(); - - this.fireEvent('attach', this); - - return this; - }, - - detach: function(){ - this.saveContent(); - this.textarea.setStyle('display', '').removeClass('mooeditable-textarea').inject(this.container, 'before'); - this.textarea.removeEvent('keypress', this.textarea.retrieve('mooeditable:textareaKeyListener')); - this.container.dispose(); - this.fireEvent('detach', this); - return this; - }, - - enable: function(){ - this.editorDisabled = false; - this.toolbar.enable(); - return this; - }, - - disable: function(){ - this.editorDisabled = true; - this.toolbar.disable(); - return this; - }, - - editorFocus: function(e){ - this.oldContent = ''; - this.fireEvent('editorFocus', [e, this]); - }, - - editorBlur: function(e){ - this.oldContent = this.saveContent().getContent(); - this.fireEvent('editorBlur', [e, this]); - }, - - editorMouseUp: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - if (this.options.toolbar) this.checkStates(); - - this.fireEvent('editorMouseUp', [e, this]); - }, - - editorMouseDown: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorMouseDown', [e, this]); - }, - - editorMouseOver: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorMouseOver', [e, this]); - }, - - editorMouseOut: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorMouseOut', [e, this]); - }, - - editorMouseEnter: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - if (this.oldContent && this.getContent() != this.oldContent){ - this.focus(); - this.fireEvent('editorPaste', [e, this]); - } - - this.fireEvent('editorMouseEnter', [e, this]); - }, - - editorMouseLeave: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorMouseLeave', [e, this]); - }, - - editorContextMenu: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorContextMenu', [e, this]); - }, - - editorClick: function(e){ - // make images selectable and draggable in Safari - if (Browser.safari || Browser.chrome){ - var el = e.target; - if (Element.get(el, 'tag') == 'img'){ - - // safari doesnt like dragging locally linked images - if (this.options.baseURL){ - if (el.getProperty('src').indexOf('http://') == -1){ - el.setProperty('src', this.options.baseURL + el.getProperty('src')); - } - } - - this.selection.selectNode(el); - this.checkStates(); - } - } - - this.fireEvent('editorClick', [e, this]); - }, - - editorDoubleClick: function(e){ - this.fireEvent('editorDoubleClick', [e, this]); - }, - - editorKeyPress: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.keyListener(e); - - this.fireEvent('editorKeyPress', [e, this]); - }, - - editorKeyUp: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - var c = e.code; - // 33-36 = pageup, pagedown, end, home; 45 = insert - if (this.options.toolbar && (/^enter|left|up|right|down|delete|backspace$/i.test(e.key) || (c >= 33 && c <= 36) || c == 45 || e.meta || e.control)){ - if (Browser.ie6){ // Delay for less cpu usage when you are typing - clearTimeout(this.checkStatesDelay); - this.checkStatesDelay = this.checkStates.delay(500, this); - } else { - this.checkStates(); - } - } - - this.fireEvent('editorKeyUp', [e, this]); - }, - - editorKeyDown: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - if (e.key == 'enter'){ - if (this.options.paragraphise){ - if (e.shift && (Browser.safari || Browser.chrome)){ - var s = this.selection; - var r = s.getRange(); - - // Insert BR element - var br = this.doc.createElement('br'); - r.insertNode(br); - - // Place caret after BR - r.setStartAfter(br); - r.setEndAfter(br); - s.setRange(r); - - // Could not place caret after BR then insert an nbsp entity and move the caret - if (s.getSelection().focusNode == br.previousSibling){ - var nbsp = this.doc.createTextNode('\u00a0'); - var p = br.parentNode; - var ns = br.nextSibling; - (ns) ? p.insertBefore(nbsp, ns) : p.appendChild(nbsp); - s.selectNode(nbsp); - s.collapse(1); - } - - // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 - this.win.scrollTo(0, Element.getOffsets(s.getRange().startContainer).y); - - e.preventDefault(); - } else if (Browser.firefox || Browser.safari || Browser.chrome){ - var node = this.selection.getNode(); - var isBlock = Element.getParents(node).include(node).some(function(el){ - return el.nodeName.test(blockEls); - }); - if (!isBlock) this.execute('insertparagraph'); - } - } else { - if (Browser.ie){ - var r = this.selection.getRange(); - var node = this.selection.getNode(); - if (r && node.get('tag') != 'li'){ - this.selection.insertContent('
'); - this.selection.collapse(false); - } - e.preventDefault(); - } - } - } - - if (Browser.opera){ - var ctrlmeta = e.control || e.meta; - if (ctrlmeta && e.key == 'x'){ - this.fireEvent('editorCut', [e, this]); - } else if (ctrlmeta && e.key == 'c'){ - this.fireEvent('editorCopy', [e, this]); - } else if ((ctrlmeta && e.key == 'v') || (e.shift && e.code == 45)){ - this.fireEvent('editorPaste', [e, this]); - } - } - - this.fireEvent('editorKeyDown', [e, this]); - }, - - editorCut: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorCut', [e, this]); - }, - - editorCopy: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorCopy', [e, this]); - }, - - editorPaste: function(e){ - if (this.editorDisabled){ - e.stop(); - return; - } - - this.fireEvent('editorPaste', [e, this]); - }, - - keyListener: function(e){ - var key = (Browser.Platform.mac) ? e.meta : e.control; - if (!key || !this.keys[e.key]) return; - e.preventDefault(); - var item = this.toolbar.getItem(this.keys[e.key]); - item.action(e); - }, - - focus: function(){ - (this.mode == 'iframe' ? this.win : this.textarea).focus(); - this.fireEvent('focus', this); - return this; - }, - - action: function(command, args){ - var action = MooEditable.Actions[command]; - if (action.command && typeOf(action.command) == 'function'){ - action.command.apply(this, args); - } else { - this.focus(); - this.execute(command, false, args); - if (this.mode == 'iframe') this.checkStates(); - } - }, - - execute: function(command, param1, param2){ - if (this.busy) return; - this.busy = true; - this.doc.execCommand(command, param1, param2); - this.saveContent(); - this.busy = false; - return false; - }, - - toggleView: function(){ - this.fireEvent('beforeToggleView', this); - if (this.mode == 'textarea'){ - this.mode = 'iframe'; - this.iframe.setStyle('display', ''); - this.setContent(this.textarea.value); - this.textarea.setStyle('display', 'none'); - } else { - this.saveContent(); - this.mode = 'textarea'; - this.textarea.setStyle('display', ''); - this.iframe.setStyle('display', 'none'); - } - this.fireEvent('toggleView', this); - this.focus.delay(10, this); - return this; - }, - - getContent: function(){ - var protect = this.protectedElements; - var html = this.doc.body.get('html').replace(//g, function(a, b){ - return protect[b.toInt()]; - }); - return this.cleanup(this.ensureRootElement(html)); - }, - - setContent: function(content){ - var protect = this.protectedElements; - content = content.replace(protectRegex, function(a){ - protect.push(a); - return ''; - }); - this.doc.body.set('html', this.ensureRootElement(content)); - return this; - }, - - saveContent: function(){ - if (this.mode == 'iframe'){ - this.textarea.set('value', this.getContent()); - } - return this; - }, - - ensureRootElement: function(val){ - if (this.options.rootElement){ - var el = new Element('div', {html: val.trim()}); - var start = -1; - var create = false; - var html = ''; - var length = el.childNodes.length; - for (var i=0; i= 0 && create){ - var newel = new Element(this.options.rootElement, {html: html}); - el.replaceChild(newel, el.childNodes[start]); - for (var k=start+1; k/gi, "
"); - source = source.replace(/(.*)<\/span>/gi, '$1'); - source = source.replace(/ class="Apple-style-span"/gi, ''); - source = source.replace(//gi, ''); - - // Remove padded paragraphs - source = source.replace(/

\s*
\s*<\/p>/gi, '

\u00a0

'); - source = source.replace(/

( |\s)*<\/p>/gi, '

\u00a0

'); - if (!this.options.semantics){ - source = source.replace(/\s*
\s*<\/p>/gi, '

'); - } - - // Replace improper BRs (only if XHTML : true) - if (this.options.xhtml){ - source = source.replace(/
/gi, "
"); - } - - if (this.options.semantics){ - //remove divs from
  • - if (Browser.ie){ - source = source.replace(/
  • \s*
    (.+?)<\/div><\/li>/g, '
  • $1
  • '); - } - //remove stupid apple divs - if (Browser.safari || Browser.chrome){ - source = source.replace(/^([\w\s]+.*?)
    /i, '

    $1

    '); - source = source.replace(/
    (.+?)<\/div>/ig, '

    $1

    '); - } - - //

    tags around a list will get moved to after the list - if (!Browser.ie){ - //not working properly in safari? - source = source.replace(/

    [\s\n]*(<(?:ul|ol)>.*?<\/(?:ul|ol)>)(.*?)<\/p>/ig, '$1

    $2

    '); - source = source.replace(/<\/(ol|ul)>\s*(?!<(?:p|ol|ul|img).*?>)((?:<[^>]*>)?\w.*)$/g, '

    $2

    '); - } - - source = source.replace(/]*><\/p>/g, '

    '); // remove
    's that end a paragraph here. - source = source.replace(/

    \s*(]+>)\s*<\/p>/ig, '$1\n'); // if a

    only contains , remove the

    tags - - //format the source - source = source.replace(/]*)>(.*?)<\/p>(?!\n)/g, '$2

    \n'); // break after paragraphs - source = source.replace(/<\/(ul|ol|p)>(?!\n)/g, '\n'); // break after

    tags - source = source.replace(/>
  • /g, '>\n\t
  • '); // break and indent
  • - source = source.replace(/([^\n])<\/(ol|ul)>/g, '$1\n'); //break before tags - source = source.replace(/([^\n])$/gi, ''); - source = source.replace(/^
    /gi, ''); - - // Remove useless BRs - if (this.options.paragraphise) source = source.replace(/(h[1-6]|p|div|address|pre|li|ol|ul|blockquote|center|dl|dt|dd)>
    /gi, '$1>'); - - // Remove BRs right before the end of blocks - source = source.replace(/
    \s*<\/(h1|h2|h3|h4|h5|h6|li|p)/gi, '(.*)<\/span>/gi, '$1'); - source = source.replace(/(.*)<\/span>/gi, '$1'); - source = source.replace(/]*>(.*?)<\/b[^>]*>/gi, '$1'); - source = source.replace(/]*>(.*?)<\/i[^>]*>/gi, '$1'); - source = source.replace(/]*>(.*?)<\/u[^>]*>/gi, '$1'); - source = source.replace(/(.*)<\/span><\/strong>/gi, '$1'); - source = source.replace(/(.*)<\/span><\/em>/gi, '$1'); - source = source.replace(/(.*)<\/span><\/span>/gi, '$1'); - source = source.replace(/(.*)<\/strong>/gi, '$1'); - source = source.replace(/(.*)<\/em>/gi, '$1'); - - // Replace uppercase element names with lowercase - source = source.replace(/<[^> ]*/g, function(match){return match.toLowerCase();}); - - // Replace uppercase attribute names with lowercase - source = source.replace(/<[^>]*>/g, function(match){ - match = match.replace(/ [^=]+=/g, function(match2){return match2.toLowerCase();}); - return match; - }); - - // Put quotes around unquoted attributes - source = source.replace(/<[^!][^>]*>/g, function(match){ - match = match.replace(/( [^=]+=)([^"][^ >]*)/g, "$1\"$2\""); - return match; - }); - - //make img tags xhtml compatible , -> - if (this.options.xhtml){ - source = source.replace(/]+)(\s*[^\/])>(<\/img>)*/gi, ''); - } - - //remove double

    tags and empty

    tags - source = source.replace(/

    (?:\s*)

    /g, '

    '); - source = source.replace(/<\/p>\s*<\/p>/g, '

    '); - - // Replace
    s inside
     automatically added by some browsers
    -			source = source.replace(/]*>.*?<\/pre>/gi, function(match){
    -				return match.replace(/
    /gi, '\n'); - }); - - // Final trim - source = source.trim(); - } - while (source != oSource); - - return source; - } - -}); - -MooEditable.Selection = new Class({ - - initialize: function(win){ - this.win = win; - }, - - getSelection: function(){ - this.win.focus(); - return (this.win.getSelection) ? this.win.getSelection() : this.win.document.selection; - }, - - getRange: function(){ - var s = this.getSelection(); - - if (!s) return null; - - try { - return s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : null); - } catch(e) { - // IE bug when used in frameset - return this.doc.body.createTextRange(); - } - }, - - setRange: function(range){ - if (range.select){ - Function.attempt(function(){ - range.select(); - }); - } else { - var s = this.getSelection(); - if (s.addRange){ - s.removeAllRanges(); - s.addRange(range); - } - } - }, - - selectNode: function(node, collapse){ - var r = this.getRange(); - var s = this.getSelection(); - - if (r.moveToElementText){ - Function.attempt(function(){ - r.moveToElementText(node); - r.select(); - }); - } else if (s.addRange){ - collapse ? r.selectNodeContents(node) : r.selectNode(node); - s.removeAllRanges(); - s.addRange(r); - } else { - s.setBaseAndExtent(node, 0, node, 1); - } - - return node; - }, - - isCollapsed: function(){ - var r = this.getRange(); - if (r.item) return false; - return r.boundingWidth == 0 || this.getSelection().isCollapsed; - }, - - collapse: function(toStart){ - var r = this.getRange(); - var s = this.getSelection(); - - if (r.select){ - r.collapse(toStart); - r.select(); - } else { - toStart ? s.collapseToStart() : s.collapseToEnd(); - } - }, - - getContent: function(){ - var r = this.getRange(); - var body = new Element('body'); - - if (this.isCollapsed()) return ''; - - if (r.cloneContents){ - body.appendChild(r.cloneContents()); - } else if (r.item != undefined || r.htmlText != undefined){ - body.set('html', r.item ? r.item(0).outerHTML : r.htmlText); - } else { - body.set('html', r.toString()); - } - - var content = body.get('html'); - return content; - }, - - getText : function(){ - var r = this.getRange(); - var s = this.getSelection(); - return this.isCollapsed() ? '' : r.text || (s.toString ? s.toString() : ''); - }, - - getNode: function(){ - var r = this.getRange(); - - if (!Browser.ie || Browser.version >= 9){ - var el = null; - - if (r){ - el = r.commonAncestorContainer; - - // Handle selection a image or other control like element such as anchors - if (!r.collapsed) - if (r.startContainer == r.endContainer) - if (r.startOffset - r.endOffset < 2) - if (r.startContainer.hasChildNodes()) - el = r.startContainer.childNodes[r.startOffset]; - - while (typeOf(el) != 'element') el = el.parentNode; - } - - return document.id(el); - } - - return document.id(r.item ? r.item(0) : r.parentElement()); - }, - - insertContent: function(content){ - if (Browser.ie){ - var r = this.getRange(); - if (r.pasteHTML){ - r.pasteHTML(content); - r.collapse(false); - r.select(); - } else if (r.insertNode){ - r.deleteContents(); - if (r.createContextualFragment){ - r.insertNode(r.createContextualFragment(content)); - } else { - var doc = this.win.document; - var fragment = doc.createDocumentFragment(); - var temp = doc.createElement('div'); - fragment.appendChild(temp); - temp.outerHTML = content; - r.insertNode(fragment); - } - } - } else { - this.win.document.execCommand('insertHTML', false, content); - } - } - -}); - -// Avoiding Locale dependency -// Wrapper functions to be used internally and for plugins, defaults to en-US -var phrases = {}; -MooEditable.Locale = { - - define: function(key, value){ - if (typeOf(window.Locale) != 'null') return Locale.define('en-US', 'MooEditable', key, value); - if (typeOf(key) == 'object') Object.merge(phrases, key); - else phrases[key] = value; - }, - - get: function(key){ - if (typeOf(window.Locale) != 'null') return Locale.get('MooEditable.' + key); - return key ? phrases[key] : ''; - } - -}; - -MooEditable.Locale.define({ - ok: 'OK', - cancel: 'Cancel', - bold: 'Bold', - italic: 'Italic', - underline: 'Underline', - strikethrough: 'Strikethrough', - unorderedList: 'Unordered List', - orderedList: 'Ordered List', - indent: 'Indent', - outdent: 'Outdent', - undo: 'Undo', - redo: 'Redo', - removeHyperlink: 'Remove Hyperlink', - addHyperlink: 'Add Hyperlink', - selectTextHyperlink: 'Please select the text you wish to hyperlink.', - enterURL: 'Enter URL', - enterImageURL: 'Enter image URL', - addImage: 'Add Image', - toggleView: 'Toggle View' -}); - -MooEditable.UI = {}; - -MooEditable.UI.Toolbar= new Class({ - - Implements: [Events, Options], - - options: { - /* - onItemAction: function(){}, - */ - 'class': '' - }, - - initialize: function(options){ - this.setOptions(options); - this.el = new Element('div', {'class': 'mooeditable-ui-toolbar ' + this.options['class']}); - this.items = {}; - this.content = null; - }, - - toElement: function(){ - return this.el; - }, - - render: function(actions){ - if (this.content){ - this.el.adopt(this.content); - } else { - this.content = actions.map(function(action){ - if (action == '|') { - return this.addSeparator(); - } - else if (action == '/') { - return this.addLineSeparator(); - } - return this.addItem(action); - }.bind(this)); - } - return this; - }, - - addItem: function(action){ - var self = this; - var act = MooEditable.Actions[action]; - if (!act) return; - var type = act.type || 'button'; - var options = act.options || {}; - var item = new MooEditable.UI[type.camelCase().capitalize()](Object.append(options, { - name: action, - 'class': action + '-item toolbar-item', - title: act.title, - onAction: self.itemAction.bind(self) - })); - this.items[action] = item; - document.id(item).inject(this.el); - return item; - }, - - getItem: function(action){ - return this.items[action]; - }, - - addSeparator: function(){ - return new Element('span.toolbar-separator').inject(this.el); - }, - - addLineSeparator: function(){ - return new Element('div.toolbar-line-separator').inject(this.el); - }, - - itemAction: function(){ - this.fireEvent('itemAction', arguments); - }, - - disable: function(except){ - Object.each(this.items, function(item){ - (item.name == except) ? item.activate() : item.deactivate().disable(); - }); - return this; - }, - - enable: function(){ - Object.each(this.items, function(item){ - item.enable(); - }); - return this; - }, - - show: function(){ - this.el.setStyle('display', ''); - return this; - }, - - hide: function(){ - this.el.setStyle('display', 'none'); - return this; - } - -}); - -MooEditable.UI.Button = new Class({ - - Implements: [Events, Options], - - options: { - /* - onAction: function(){}, - */ - title: '', - name: '', - text: 'Button', - 'class': '', - shortcut: '', - mode: 'icon' - }, - - initialize: function(options){ - this.setOptions(options); - this.name = this.options.name; - this.render(); - }, - - toElement: function(){ - return this.el; - }, - - render: function(){ - var self = this; - var key = (Browser.Platform.mac) ? 'Cmd' : 'Ctrl'; - var shortcut = (this.options.shortcut) ? ' ( ' + key + '+' + this.options.shortcut.toUpperCase() + ' )' : ''; - var text = this.options.title || name; - var title = text + shortcut; - this.el = new Element('button', { - 'class': 'mooeditable-ui-button ' + self.options['class'], - title: title, - html: '' + text + '', - events: { - click: self.click.bind(self), - mousedown: function(e){ e.preventDefault(); } - } - }); - if (this.options.mode != 'icon') this.el.addClass('mooeditable-ui-button-' + this.options.mode); - - this.active = false; - this.disabled = false; - - // add hover effect for IE - if (Browser.ie) this.el.addEvents({ - mouseenter: function(e){ this.addClass('hover'); }, - mouseleave: function(e){ this.removeClass('hover'); } - }); - - return this; - }, - - click: function(e){ - e.preventDefault(); - if (this.disabled) return; - this.action(e); - }, - - action: function(){ - this.fireEvent('action', [this].concat(Array.from(arguments))); - }, - - enable: function(){ - if (this.active) this.el.removeClass('onActive'); - if (!this.disabled) return; - this.disabled = false; - this.el.removeClass('disabled').set({ - disabled: false, - opacity: 1 - }); - return this; - }, - - disable: function(){ - if (this.disabled) return; - this.disabled = true; - this.el.addClass('disabled').set({ - disabled: true, - opacity: 0.4 - }); - return this; - }, - - activate: function(){ - if (this.disabled) return; - this.active = true; - this.el.addClass('onActive'); - return this; - }, - - deactivate: function(){ - this.active = false; - this.el.removeClass('onActive'); - return this; - } - -}); - -MooEditable.UI.Dialog = new Class({ - - Implements: [Events, Options], - - options:{ - /* - onOpen: function(){}, - onClose: function(){}, - */ - 'class': '', - contentClass: '' - }, - - initialize: function(html, options){ - this.setOptions(options); - this.html = html; - - var self = this; - this.el = new Element('div', { - 'class': 'mooeditable-ui-dialog ' + self.options['class'], - html: '
    ' + html + '
    ', - styles: { - 'display': 'none' - }, - events: { - click: self.click.bind(self) - } - }); - }, - - toElement: function(){ - return this.el; - }, - - click: function(){ - this.fireEvent('click', arguments); - return this; - }, - - open: function(){ - this.el.setStyle('display', ''); - this.fireEvent('open', this); - return this; - }, - - close: function(){ - this.el.setStyle('display', 'none'); - this.fireEvent('close', this); - return this; - } - -}); - -MooEditable.UI.AlertDialog = function(alertText){ - if (!alertText) return; - var html = alertText + ' '; - return new MooEditable.UI.Dialog(html, { - 'class': 'mooeditable-alert-dialog', - onOpen: function(){ - var button = this.el.getElement('.dialog-ok-button'); - (function(){ - button.focus(); - }).delay(10); - }, - onClick: function(e){ - e.preventDefault(); - if (e.target.tagName.toLowerCase() != 'button') return; - if (document.id(e.target).hasClass('dialog-ok-button')) this.close(); - } - }); -}; - -MooEditable.UI.PromptDialog = function(questionText, answerText, fn){ - if (!questionText) return; - var html = ' ' - + ''; - return new MooEditable.UI.Dialog(html, { - 'class': 'mooeditable-prompt-dialog', - onOpen: function(){ - var input = this.el.getElement('.dialog-input'); - (function(){ - input.focus(); - input.select(); - }).delay(10); - }, - onClick: function(e){ - e.preventDefault(); - if (e.target.tagName.toLowerCase() != 'button') return; - var button = document.id(e.target); - var input = this.el.getElement('.dialog-input'); - if (button.hasClass('dialog-cancel-button')){ - input.set('value', answerText); - this.close(); - } else if (button.hasClass('dialog-ok-button')){ - var answer = input.get('value'); - input.set('value', answerText); - this.close(); - if (fn) fn.attempt(answer, this); - } - } - }); -}; - -MooEditable.Actions = { - - bold: { - title: MooEditable.Locale.get('bold'), - options: { - shortcut: 'b' - }, - states: { - tags: ['b', 'strong'], - css: {'font-weight': 'bold'} - }, - events: { - beforeToggleView: function(){ - if(Browser.firefox){ - var value = this.textarea.get('value'); - var newValue = value.replace(/]*)>/gi, '').replace(/<\/strong>/gi, ''); - if (value != newValue) this.textarea.set('value', newValue); - } - }, - attach: function(){ - if(Browser.firefox){ - var value = this.textarea.get('value'); - var newValue = value.replace(/]*)>/gi, '').replace(/<\/strong>/gi, ''); - if (value != newValue){ - this.textarea.set('value', newValue); - this.setContent(newValue); - } - } - } - } - }, - - italic: { - title: MooEditable.Locale.get('italic'), - options: { - shortcut: 'i' - }, - states: { - tags: ['i', 'em'], - css: {'font-style': 'italic'} - }, - events: { - beforeToggleView: function(){ - if (Browser.firefox){ - var value = this.textarea.get('value'); - var newValue = value.replace(/]*)>/gi, '') - .replace(/]*)>/gi, '') - .replace(/]*)>/gi, '') - .replace(/<\/em>/gi, ''); - if (value != newValue) this.textarea.set('value', newValue); - } - }, - attach: function(){ - if (Browser.firefox){ - var value = this.textarea.get('value'); - var newValue = value.replace(/]*)>/gi, '') - .replace(/]*)>/gi, '') - .replace(/]*)>/gi, '') - .replace(/<\/em>/gi, ''); - if (value != newValue){ - this.textarea.set('value', newValue); - this.setContent(newValue); - } - } - } - } - }, - - underline: { - title: MooEditable.Locale.get('underline'), - options: { - shortcut: 'u' - }, - states: { - tags: ['u'], - css: {'text-decoration': 'underline'} - }, - events: { - beforeToggleView: function(){ - if(Browser.firefox || Browser.ie){ - var value = this.textarea.get('value'); - var newValue = value.replace(/]*)>/gi, '').replace(/<\/span>/gi, ''); - if (value != newValue) this.textarea.set('value', newValue); - } - }, - attach: function(){ - if(Browser.firefox || Browser.ie){ - var value = this.textarea.get('value'); - var newValue = value.replace(/]*)>/gi, '').replace(/<\/span>/gi, ''); - if (value != newValue){ - this.textarea.set('value', newValue); - this.setContent(newValue); - } - } - } - } - }, - - strikethrough: { - title: MooEditable.Locale.get('strikethrough'), - options: { - shortcut: 's' - }, - states: { - tags: ['s', 'strike'], - css: {'text-decoration': 'line-through'} - } - }, - - insertunorderedlist: { - title: MooEditable.Locale.get('unorderedList'), - states: { - tags: ['ul'] - } - }, - - insertorderedlist: { - title: MooEditable.Locale.get('orderedList'), - states: { - tags: ['ol'] - } - }, - - indent: { - title: MooEditable.Locale.get('indent'), - states: { - tags: ['blockquote'] - } - }, - - outdent: { - title: MooEditable.Locale.get('outdent') - }, - - undo: { - title: MooEditable.Locale.get('undo'), - options: { - shortcut: 'z' - } - }, - - redo: { - title: MooEditable.Locale.get('redo'), - options: { - shortcut: 'y' - } - }, - - unlink: { - title: MooEditable.Locale.get('removeHyperlink') - }, - - createlink: { - title: MooEditable.Locale.get('addHyperlink'), - options: { - shortcut: 'l' - }, - states: { - tags: ['a'] - }, - dialogs: { - alert: MooEditable.UI.AlertDialog.pass(MooEditable.Locale.get('selectTextHyperlink')), - prompt: function(editor){ - return MooEditable.UI.PromptDialog(MooEditable.Locale.get('enterURL'), 'http://', function(url){ - editor.execute('createlink', false, url.trim()); - }); - } - }, - command: function(){ - var selection = this.selection; - var dialogs = this.dialogs.createlink; - if (selection.isCollapsed()){ - var node = selection.getNode(); - if (node.get('tag') == 'a' && node.get('href')){ - selection.selectNode(node); - var prompt = dialogs.prompt; - prompt.el.getElement('.dialog-input').set('value', node.get('href')); - prompt.open(); - } else { - dialogs.alert.open(); - } - } else { - var text = selection.getText(); - var prompt = dialogs.prompt; - if (urlRegex.test(text)) prompt.el.getElement('.dialog-input').set('value', text); - prompt.open(); - } - } - }, - - urlimage: { - title: MooEditable.Locale.get('addImage'), - options: { - shortcut: 'm' - }, - dialogs: { - prompt: function(editor){ - return MooEditable.UI.PromptDialog(MooEditable.Locale.get('enterImageURL'), 'http://', function(url){ - editor.execute('insertimage', false, url.trim()); - }); - } - }, - command: function(){ - this.dialogs.urlimage.prompt.open(); - } - }, - - toggleview: { - title: MooEditable.Locale.get('toggleView'), - command: function(){ - (this.mode == 'textarea') ? this.toolbar.enable() : this.toolbar.disable('toggleview'); - this.toggleView(); - } - } - -}; - -MooEditable.Actions.Settings = {}; - -Element.Properties.mooeditable = { - - get: function(){ - return this.retrieve('MooEditable'); - } - -}; - -Element.implement({ - - mooEditable: function(options){ - var mooeditable = this.get('mooeditable'); - if (!mooeditable) mooeditable = new MooEditable(this, options); - return mooeditable; - } - -}); - -})(); +/* +--- + +name: MooEditable + +description: Class for creating a WYSIWYG editor, for contentEditable-capable browsers. + +license: MIT-style license + +authors: +- Lim Chee Aun +- Radovan Lozej +- Ryan Mitchell +- Olivier Refalo +- T.J. Leahy + +requires: +- Core/Class.Extras +- Core/Element.Event +- Core/Element.Dimensions + +inspiration: +- Code inspired by Stefan's work [Safari Supports Content Editing!](http://www.xs4all.nl/~hhijdra/stefan/ContentEditable.html) from [safari gets contentEditable](http://walkah.net/blog/walkah/safari-gets-contenteditable) +- Main reference from Peter-Paul Koch's [execCommand compatibility](http://www.quirksmode.org/dom/execCommand.html) +- Some ideas and code inspired by [TinyMCE](http://tinymce.moxiecode.com/) +- Some functions inspired by Inviz's [Most tiny wysiwyg you ever seen](http://forum.mootools.net/viewtopic.php?id=746), [mooWyg (Most tiny WYSIWYG 2.0)](http://forum.mootools.net/viewtopic.php?id=5740) +- Some regex from Cameron Adams's [widgEditor](http://widgeditor.googlecode.com/) +- Some code from Juan M Martinez's [jwysiwyg](http://jwysiwyg.googlecode.com/) +- Some reference from MoxieForge's [PunyMCE](http://punymce.googlecode.com/) +- IE support referring Robert Bredlau's [Rich Text Editing](http://www.rbredlau.com/drupal/node/6) + +provides: [MooEditable, MooEditable.Selection, MooEditable.UI, MooEditable.Actions] + +... +*/ + +(function(){ + +var blockEls = /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|SCRIPT|NOSCRIPT|STYLE)$/i; +var urlRegex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i; +var protectRegex = /<(script|noscript|style)[\u0000-\uFFFF]*?<\/(script|noscript|style)>/g; + +this.MooEditable = new Class({ + + Implements: [Events, Options], + + options: { + toolbar: true, + cleanup: true, + paragraphise: true, + xhtml : true, + semantics : true, + actions: 'bold italic underline strikethrough | insertunorderedlist insertorderedlist indent outdent | undo redo | createlink unlink | urlimage | toggleview', + handleSubmit: true, + handleLabel: true, + disabled: false, + baseCSS: 'html{ height: 100%; cursor: text; } body{ font-family: sans-serif; }', + extraCSS: '', + externalCSS: '', + html: '{BASEHREF}{EXTERNALCSS}', + rootElement: 'p', + baseURL: '', + dimensions: null + }, + + initialize: function(el, options){ + + // check for content editable and design mode support + if (!("contentEditable" in document.body) && !("designMode" in document)){ + return; + } + + this.setOptions(options); + this.textarea = document.id(el); + this.textarea.store('MooEditable', this); + this.actions = this.options.actions.clean().split(' '); + this.keys = {}; + this.dialogs = {}; + this.protectedElements = []; + this.actions.each(function(action){ + var act = MooEditable.Actions[action]; + if (!act) return; + if (act.options){ + var key = act.options.shortcut; + if (key) this.keys[key] = action; + } + if (act.dialogs){ + Object.each(act.dialogs, function(dialog, name){ + dialog = dialog.attempt(this); + dialog.name = action + ':' + name; + if (typeOf(this.dialogs[action]) != 'object') this.dialogs[action] = {}; + this.dialogs[action][name] = dialog; + }, this); + } + if (act.events){ + Object.each(act.events, function(fn, event){ + this.addEvent(event, fn); + }, this); + } + }.bind(this)); + this.render(); + }, + + toElement: function(){ + return this.textarea; + }, + + render: function(){ + var self = this; + + // Dimensions + var dimensions = this.options.dimensions || this.textarea.getSize(); + + // Build the container + this.container = new Element('div', { + id: (this.textarea.id) ? this.textarea.id + '-mooeditable-container' : null, + 'class': 'mooeditable-container', + styles: { + width: dimensions.x + } + }); + + // Override all textarea styles + this.textarea.addClass('mooeditable-textarea').setStyle('height', dimensions.y); + + // Build the iframe + this.iframe = new IFrame({ + 'class': 'mooeditable-iframe', + frameBorder: 0, + src: 'javascript:""', // Workaround for HTTPs warning in IE6/7 + styles: { + height: dimensions.y + } + }); + + this.toolbar = new MooEditable.UI.Toolbar({ + onItemAction: function(){ + var args = Array.from(arguments); + var item = args[0]; + self.action(item.name, args); + } + }); + this.attach.delay(1, this); + + // Update the event for textarea's corresponding labels + if (this.options.handleLabel && this.textarea.id) $$('label[for="'+this.textarea.id+'"]').addEvent('click', function(e){ + if (self.mode != 'iframe') return; + e.preventDefault(); + self.focus(); + }); + + // Update & cleanup content before submit + if (this.options.handleSubmit){ + this.form = this.textarea.getParent('form'); + if (this.form) { + this.form.addEvent('submit', function(){ + if (self.mode == 'iframe') self.saveContent(); + }); + } + } + + this.fireEvent('render', this); + }, + + attach: function(){ + var self = this; + + // Assign view mode + this.mode = 'iframe'; + + // Editor iframe state + this.editorDisabled = false; + + // Put textarea inside container + this.container.wraps(this.textarea); + + this.textarea.setStyle('display', 'none'); + + this.iframe.setStyle('display', '').inject(this.textarea, 'before'); + + Object.each(this.dialogs, function(action, name){ + Object.each(action, function(dialog){ + document.id(dialog).inject(self.iframe, 'before'); + var range; + dialog.addEvents({ + open: function(){ + range = self.selection.getRange(); + self.editorDisabled = true; + self.toolbar.disable(name); + self.fireEvent('dialogOpen', this); + }, + close: function(){ + self.toolbar.enable(); + self.editorDisabled = false; + self.focus(); + if (range) self.selection.setRange(range); + self.fireEvent('dialogClose', this); + } + }); + }); + }); + + // contentWindow and document references + this.win = this.iframe.contentWindow; + this.doc = this.win.document; + + // Deal with weird quirks on Gecko + if (Browser.firefox) this.doc.designMode = 'On'; + + // Build the content of iframe + var docHTML = this.options.html.substitute({ + BASECSS: this.options.baseCSS, + EXTRACSS: this.options.extraCSS, + EXTERNALCSS: (this.options.externalCSS) ? '': '', + BASEHREF: (this.options.baseURL) ? '': '' + }); + this.doc.open(); + this.doc.write(docHTML); + this.doc.close(); + + // Turn on Design Mode + // IE fired load event twice if designMode is set + (Browser.ie) ? this.doc.body.contentEditable = true : this.doc.designMode = 'On'; + + // Mootoolize window, document and body + Object.append(this.win, new Window); + Object.append(this.doc, new Document); + if (Browser.Element){ + var winElement = this.win.Element.prototype; + for (var method in Element){ // methods from Element generics + if (!method.test(/^[A-Z]|\$|prototype|mooEditable/)){ + winElement[method] = Element.prototype[method]; + } + } + } else { + document.id(this.doc.body); + } + + this.setContent(this.textarea.get('value')); + + // Bind all events + this.doc.addEvents({ + mouseup: this.editorMouseUp.bind(this), + mousedown: this.editorMouseDown.bind(this), + mouseover: this.editorMouseOver.bind(this), + mouseout: this.editorMouseOut.bind(this), + mouseenter: this.editorMouseEnter.bind(this), + mouseleave: this.editorMouseLeave.bind(this), + contextmenu: this.editorContextMenu.bind(this), + click: this.editorClick.bind(this), + dblclick: this.editorDoubleClick.bind(this), + keypress: this.editorKeyPress.bind(this), + keyup: this.editorKeyUp.bind(this), + keydown: this.editorKeyDown.bind(this), + focus: this.editorFocus.bind(this), + blur: this.editorBlur.bind(this) + }); + this.win.addEvents({ + focus: this.editorFocus.bind(this), + blur: this.editorBlur.bind(this) + }); + ['cut', 'copy', 'paste'].each(function(event){ + self.doc.body.addListener(event, self['editor' + event.capitalize()].bind(self)); + }); + this.textarea.addEvent('keypress', this.textarea.retrieve('mooeditable:textareaKeyListener', this.keyListener.bind(this))); + + // Fix window focus event not firing on Firefox 2 + if (Browser.firefox2) this.doc.addEvent('focus', function(){ + self.win.fireEvent('focus').focus(); + }); + // IE9 is also not firing focus event + if (this.doc.addEventListener) this.doc.addEventListener('focus', function(){ + self.win.fireEvent('focus'); + }, true); + + // styleWithCSS, not supported in IE and Opera + if (!Browser.ie && !Browser.opera){ + var styleCSS = function(){ + self.execute('styleWithCSS', false, false); + self.doc.removeEvent('focus', styleCSS); + }; + this.win.addEvent('focus', styleCSS); + } + + if (this.options.toolbar){ + document.id(this.toolbar).inject(this.container, 'top'); + this.toolbar.render(this.actions); + } + + if (this.options.disabled) this.disable(); + + this.selection = new MooEditable.Selection(this.win); + + this.oldContent = this.getContent(); + + this.fireEvent('attach', this); + + return this; + }, + + detach: function(){ + this.saveContent(); + this.textarea.setStyle('display', '').removeClass('mooeditable-textarea').inject(this.container, 'before'); + this.textarea.removeEvent('keypress', this.textarea.retrieve('mooeditable:textareaKeyListener')); + this.container.dispose(); + this.fireEvent('detach', this); + return this; + }, + + enable: function(){ + this.editorDisabled = false; + this.toolbar.enable(); + return this; + }, + + disable: function(){ + this.editorDisabled = true; + this.toolbar.disable(); + return this; + }, + + editorFocus: function(e){ + this.oldContent = ''; + this.fireEvent('editorFocus', [e, this]); + }, + + editorBlur: function(e){ + this.oldContent = this.saveContent().getContent(); + this.fireEvent('editorBlur', [e, this]); + }, + + editorMouseUp: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + if (this.options.toolbar) this.checkStates(); + + this.fireEvent('editorMouseUp', [e, this]); + }, + + editorMouseDown: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorMouseDown', [e, this]); + }, + + editorMouseOver: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorMouseOver', [e, this]); + }, + + editorMouseOut: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorMouseOut', [e, this]); + }, + + editorMouseEnter: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + if (this.oldContent && this.getContent() != this.oldContent){ + this.focus(); + this.fireEvent('editorPaste', [e, this]); + } + + this.fireEvent('editorMouseEnter', [e, this]); + }, + + editorMouseLeave: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorMouseLeave', [e, this]); + }, + + editorContextMenu: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorContextMenu', [e, this]); + }, + + editorClick: function(e){ + // make images selectable and draggable in Safari + if (Browser.safari || Browser.chrome){ + var el = e.target; + if (Element.get(el, 'tag') == 'img'){ + + // safari doesnt like dragging locally linked images + if (this.options.baseURL){ + if (el.getProperty('src').indexOf('http://') == -1){ + el.setProperty('src', this.options.baseURL + el.getProperty('src')); + } + } + + this.selection.selectNode(el); + this.checkStates(); + } + } + + this.fireEvent('editorClick', [e, this]); + }, + + editorDoubleClick: function(e){ + this.fireEvent('editorDoubleClick', [e, this]); + }, + + editorKeyPress: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.keyListener(e); + + this.fireEvent('editorKeyPress', [e, this]); + }, + + editorKeyUp: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + var c = e.code; + // 33-36 = pageup, pagedown, end, home; 45 = insert + if (this.options.toolbar && (/^enter|left|up|right|down|delete|backspace$/i.test(e.key) || (c >= 33 && c <= 36) || c == 45 || e.meta || e.control)){ + if (Browser.ie6){ // Delay for less cpu usage when you are typing + clearTimeout(this.checkStatesDelay); + this.checkStatesDelay = this.checkStates.delay(500, this); + } else { + this.checkStates(); + } + } + + this.fireEvent('editorKeyUp', [e, this]); + }, + + editorKeyDown: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + if (e.key == 'enter'){ + if (this.options.paragraphise){ + if (e.shift && (Browser.safari || Browser.chrome)){ + var s = this.selection; + var r = s.getRange(); + + // Insert BR element + var br = this.doc.createElement('br'); + r.insertNode(br); + + // Place caret after BR + r.setStartAfter(br); + r.setEndAfter(br); + s.setRange(r); + + // Could not place caret after BR then insert an nbsp entity and move the caret + if (s.getSelection().focusNode == br.previousSibling){ + var nbsp = this.doc.createTextNode('\u00a0'); + var p = br.parentNode; + var ns = br.nextSibling; + (ns) ? p.insertBefore(nbsp, ns) : p.appendChild(nbsp); + s.selectNode(nbsp); + s.collapse(1); + } + + // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 + this.win.scrollTo(0, Element.getOffsets(s.getRange().startContainer).y); + + e.preventDefault(); + } else if (Browser.firefox || Browser.safari || Browser.chrome){ + var node = this.selection.getNode(); + var isBlock = Element.getParents(node).include(node).some(function(el){ + return el.nodeName.test(blockEls); + }); + if (!isBlock) this.execute('insertparagraph'); + } + } else { + if (Browser.ie){ + var r = this.selection.getRange(); + var node = this.selection.getNode(); + if (r && node.get('tag') != 'li'){ + this.selection.insertContent('
    '); + this.selection.collapse(false); + } + e.preventDefault(); + } + } + } + + if (Browser.opera){ + var ctrlmeta = e.control || e.meta; + if (ctrlmeta && e.key == 'x'){ + this.fireEvent('editorCut', [e, this]); + } else if (ctrlmeta && e.key == 'c'){ + this.fireEvent('editorCopy', [e, this]); + } else if ((ctrlmeta && e.key == 'v') || (e.shift && e.code == 45)){ + this.fireEvent('editorPaste', [e, this]); + } + } + + this.fireEvent('editorKeyDown', [e, this]); + }, + + editorCut: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorCut', [e, this]); + }, + + editorCopy: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorCopy', [e, this]); + }, + + editorPaste: function(e){ + if (this.editorDisabled){ + e.stop(); + return; + } + + this.fireEvent('editorPaste', [e, this]); + }, + + keyListener: function(e){ + var key = (Browser.Platform.mac) ? e.meta : e.control; + if (!key || !this.keys[e.key]) return; + e.preventDefault(); + var item = this.toolbar.getItem(this.keys[e.key]); + item.action(e); + }, + + focus: function(){ + (this.mode == 'iframe' ? this.win : this.textarea).focus(); + this.fireEvent('focus', this); + return this; + }, + + action: function(command, args){ + var action = MooEditable.Actions[command]; + if (action.command && typeOf(action.command) == 'function'){ + action.command.apply(this, args); + } else { + this.focus(); + this.execute(command, false, args); + if (this.mode == 'iframe') this.checkStates(); + } + }, + + execute: function(command, param1, param2){ + if (this.busy) return; + this.busy = true; + this.doc.execCommand(command, param1, param2); + this.saveContent(); + this.busy = false; + return false; + }, + + toggleView: function(){ + this.fireEvent('beforeToggleView', this); + if (this.mode == 'textarea'){ + this.mode = 'iframe'; + this.iframe.setStyle('display', ''); + this.setContent(this.textarea.value); + this.textarea.setStyle('display', 'none'); + } else { + this.saveContent(); + this.mode = 'textarea'; + this.textarea.setStyle('display', ''); + this.iframe.setStyle('display', 'none'); + } + this.fireEvent('toggleView', this); + this.focus.delay(10, this); + return this; + }, + + getContent: function(){ + var protect = this.protectedElements; + var html = this.doc.body.get('html').replace(//g, function(a, b){ + return protect[b.toInt()]; + }); + return this.cleanup(this.ensureRootElement(html)); + }, + + setContent: function(content){ + var protect = this.protectedElements; + content = content.replace(protectRegex, function(a){ + protect.push(a); + return ''; + }); + this.doc.body.set('html', this.ensureRootElement(content)); + return this; + }, + + saveContent: function(){ + if (this.mode == 'iframe'){ + this.textarea.set('value', this.getContent()); + } + return this; + }, + + ensureRootElement: function(val){ + if (this.options.rootElement){ + var el = new Element('div', {html: val.trim()}); + var start = -1; + var create = false; + var html = ''; + var length = el.childNodes.length; + for (var i=0; i= 0 && create){ + var newel = new Element(this.options.rootElement, {html: html}); + el.replaceChild(newel, el.childNodes[start]); + for (var k=start+1; k/gi, "
    "); + source = source.replace(/(.*)<\/span>/gi, '$1'); + source = source.replace(/ class="Apple-style-span"/gi, ''); + source = source.replace(//gi, ''); + + // Remove padded paragraphs + source = source.replace(/

    \s*
    \s*<\/p>/gi, '

    \u00a0

    '); + source = source.replace(/

    ( |\s)*<\/p>/gi, '

    \u00a0

    '); + if (!this.options.semantics){ + source = source.replace(/\s*
    \s*<\/p>/gi, '

    '); + } + + // Replace improper BRs (only if XHTML : true) + if (this.options.xhtml){ + source = source.replace(/
    /gi, "
    "); + } + + if (this.options.semantics){ + //remove divs from
  • + if (Browser.ie){ + source = source.replace(/
  • \s*
    (.+?)<\/div><\/li>/g, '
  • $1
  • '); + } + //remove stupid apple divs + if (Browser.safari || Browser.chrome){ + source = source.replace(/^([\w\s]+.*?)
    /i, '

    $1

    '); + source = source.replace(/
    (.+?)<\/div>/ig, '

    $1

    '); + } + + //

    tags around a list will get moved to after the list + if (!Browser.ie){ + //not working properly in safari? + source = source.replace(/

    [\s\n]*(<(?:ul|ol)>.*?<\/(?:ul|ol)>)(.*?)<\/p>/ig, '$1

    $2

    '); + source = source.replace(/<\/(ol|ul)>\s*(?!<(?:p|ol|ul|img).*?>)((?:<[^>]*>)?\w.*)$/g, '

    $2

    '); + } + + source = source.replace(/]*><\/p>/g, '

    '); // remove
    's that end a paragraph here. + source = source.replace(/

    \s*(]+>)\s*<\/p>/ig, '$1\n'); // if a

    only contains , remove the

    tags + + //format the source + source = source.replace(/]*)>(.*?)<\/p>(?!\n)/g, '$2

    \n'); // break after paragraphs + source = source.replace(/<\/(ul|ol|p)>(?!\n)/g, '\n'); // break after

    tags + source = source.replace(/>
  • /g, '>\n\t
  • '); // break and indent
  • + source = source.replace(/([^\n])<\/(ol|ul)>/g, '$1\n'); //break before tags + source = source.replace(/([^\n])$/gi, ''); + source = source.replace(/^
    /gi, ''); + + // Remove useless BRs + if (this.options.paragraphise) source = source.replace(/(h[1-6]|p|div|address|pre|li|ol|ul|blockquote|center|dl|dt|dd)>
    /gi, '$1>'); + + // Remove BRs right before the end of blocks + source = source.replace(/
    \s*<\/(h1|h2|h3|h4|h5|h6|li|p)/gi, '(.*)<\/span>/gi, '$1'); + source = source.replace(/(.*)<\/span>/gi, '$1'); + source = source.replace(/]*>(.*?)<\/b[^>]*>/gi, '$1'); + source = source.replace(/]*>(.*?)<\/i[^>]*>/gi, '$1'); + source = source.replace(/]*>(.*?)<\/u[^>]*>/gi, '$1'); + source = source.replace(/(.*)<\/span><\/strong>/gi, '$1'); + source = source.replace(/(.*)<\/span><\/em>/gi, '$1'); + source = source.replace(/(.*)<\/span><\/span>/gi, '$1'); + source = source.replace(/(.*)<\/strong>/gi, '$1'); + source = source.replace(/(.*)<\/em>/gi, '$1'); + + // Replace uppercase element names with lowercase + source = source.replace(/<[^> ]*/g, function(match){return match.toLowerCase();}); + + // Replace uppercase attribute names with lowercase + source = source.replace(/<[^>]*>/g, function(match){ + match = match.replace(/ [^=]+=/g, function(match2){return match2.toLowerCase();}); + return match; + }); + + // Put quotes around unquoted attributes + source = source.replace(/<[^!][^>]*>/g, function(match){ + match = match.replace(/( [^=]+=)([^"][^ >]*)/g, "$1\"$2\""); + return match; + }); + + //make img tags xhtml compatible , -> + if (this.options.xhtml){ + source = source.replace(/]+)(\s*[^\/])>(<\/img>)*/gi, ''); + } + + //remove double

    tags and empty

    tags + source = source.replace(/

    (?:\s*)

    /g, '

    '); + source = source.replace(/<\/p>\s*<\/p>/g, '

    '); + + // Replace
    s inside
     automatically added by some browsers
    +			source = source.replace(/]*>.*?<\/pre>/gi, function(match){
    +				return match.replace(/
    /gi, '\n'); + }); + + // Final trim + source = source.trim(); + } + while (source != oSource); + + return source; + } + +}); + +MooEditable.Selection = new Class({ + + initialize: function(win){ + this.win = win; + }, + + getSelection: function(){ + this.win.focus(); + return (this.win.getSelection) ? this.win.getSelection() : this.win.document.selection; + }, + + getRange: function(){ + var s = this.getSelection(); + + if (!s) return null; + + try { + return s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : null); + } catch(e) { + // IE bug when used in frameset + return this.doc.body.createTextRange(); + } + }, + + setRange: function(range){ + if (range.select){ + Function.attempt(function(){ + range.select(); + }); + } else { + var s = this.getSelection(); + if (s.addRange){ + s.removeAllRanges(); + s.addRange(range); + } + } + }, + + selectNode: function(node, collapse){ + var r = this.getRange(); + var s = this.getSelection(); + + if (r.moveToElementText){ + Function.attempt(function(){ + r.moveToElementText(node); + r.select(); + }); + } else if (s.addRange){ + collapse ? r.selectNodeContents(node) : r.selectNode(node); + s.removeAllRanges(); + s.addRange(r); + } else { + s.setBaseAndExtent(node, 0, node, 1); + } + + return node; + }, + + isCollapsed: function(){ + var r = this.getRange(); + if (r.item) return false; + return r.boundingWidth == 0 || this.getSelection().isCollapsed; + }, + + collapse: function(toStart){ + var r = this.getRange(); + var s = this.getSelection(); + + if (r.select){ + r.collapse(toStart); + r.select(); + } else { + toStart ? s.collapseToStart() : s.collapseToEnd(); + } + }, + + getContent: function(){ + var r = this.getRange(); + var body = new Element('body'); + + if (this.isCollapsed()) return ''; + + if (r.cloneContents){ + body.appendChild(r.cloneContents()); + } else if (r.item != undefined || r.htmlText != undefined){ + body.set('html', r.item ? r.item(0).outerHTML : r.htmlText); + } else { + body.set('html', r.toString()); + } + + var content = body.get('html'); + return content; + }, + + getText : function(){ + var r = this.getRange(); + var s = this.getSelection(); + return this.isCollapsed() ? '' : r.text || (s.toString ? s.toString() : ''); + }, + + getNode: function(){ + var r = this.getRange(); + + if (!Browser.ie || Browser.version >= 9){ + var el = null; + + if (r){ + el = r.commonAncestorContainer; + + // Handle selection a image or other control like element such as anchors + if (!r.collapsed) + if (r.startContainer == r.endContainer) + if (r.startOffset - r.endOffset < 2) + if (r.startContainer.hasChildNodes()) + el = r.startContainer.childNodes[r.startOffset]; + + while (typeOf(el) != 'element') el = el.parentNode; + } + + return document.id(el); + } + + return document.id(r.item ? r.item(0) : r.parentElement()); + }, + + insertContent: function(content){ + if (Browser.ie){ + var r = this.getRange(); + if (r.pasteHTML){ + r.pasteHTML(content); + r.collapse(false); + r.select(); + } else if (r.insertNode){ + r.deleteContents(); + if (r.createContextualFragment){ + r.insertNode(r.createContextualFragment(content)); + } else { + var doc = this.win.document; + var fragment = doc.createDocumentFragment(); + var temp = doc.createElement('div'); + fragment.appendChild(temp); + temp.outerHTML = content; + r.insertNode(fragment); + } + } + } else { + this.win.document.execCommand('insertHTML', false, content); + } + } + +}); + +// Avoiding Locale dependency +// Wrapper functions to be used internally and for plugins, defaults to en-US +var phrases = {}; +MooEditable.Locale = { + + define: function(key, value){ + if (typeOf(window.Locale) != 'null') return Locale.define('en-US', 'MooEditable', key, value); + if (typeOf(key) == 'object') Object.merge(phrases, key); + else phrases[key] = value; + }, + + get: function(key){ + if (typeOf(window.Locale) != 'null') return Locale.get('MooEditable.' + key); + return key ? phrases[key] : ''; + } + +}; + +MooEditable.Locale.define({ + ok: 'OK', + cancel: 'Cancel', + bold: 'Bold', + italic: 'Italic', + underline: 'Underline', + strikethrough: 'Strikethrough', + unorderedList: 'Unordered List', + orderedList: 'Ordered List', + indent: 'Indent', + outdent: 'Outdent', + undo: 'Undo', + redo: 'Redo', + removeHyperlink: 'Remove Hyperlink', + addHyperlink: 'Add Hyperlink', + selectTextHyperlink: 'Please select the text you wish to hyperlink.', + enterURL: 'Enter URL', + enterImageURL: 'Enter image URL', + addImage: 'Add Image', + toggleView: 'Toggle View' +}); + +MooEditable.UI = {}; + +MooEditable.UI.Toolbar= new Class({ + + Implements: [Events, Options], + + options: { + /* + onItemAction: function(){}, + */ + 'class': '' + }, + + initialize: function(options){ + this.setOptions(options); + this.el = new Element('div', {'class': 'mooeditable-ui-toolbar ' + this.options['class']}); + this.items = {}; + this.content = null; + }, + + toElement: function(){ + return this.el; + }, + + render: function(actions){ + if (this.content){ + this.el.adopt(this.content); + } else { + this.content = actions.map(function(action){ + if (action == '|') { + return this.addSeparator(); + } + else if (action == '/') { + return this.addLineSeparator(); + } + return this.addItem(action); + }.bind(this)); + } + return this; + }, + + addItem: function(action){ + var self = this; + var act = MooEditable.Actions[action]; + if (!act) return; + var type = act.type || 'button'; + var options = act.options || {}; + var item = new MooEditable.UI[type.camelCase().capitalize()](Object.append(options, { + name: action, + 'class': action + '-item toolbar-item', + title: act.title, + onAction: self.itemAction.bind(self) + })); + this.items[action] = item; + document.id(item).inject(this.el); + return item; + }, + + getItem: function(action){ + return this.items[action]; + }, + + addSeparator: function(){ + return new Element('span.toolbar-separator').inject(this.el); + }, + + addLineSeparator: function(){ + return new Element('div.toolbar-line-separator').inject(this.el); + }, + + itemAction: function(){ + this.fireEvent('itemAction', arguments); + }, + + disable: function(except){ + Object.each(this.items, function(item){ + (item.name == except) ? item.activate() : item.deactivate().disable(); + }); + return this; + }, + + enable: function(){ + Object.each(this.items, function(item){ + item.enable(); + }); + return this; + }, + + show: function(){ + this.el.setStyle('display', ''); + return this; + }, + + hide: function(){ + this.el.setStyle('display', 'none'); + return this; + } + +}); + +MooEditable.UI.Button = new Class({ + + Implements: [Events, Options], + + options: { + /* + onAction: function(){}, + */ + title: '', + name: '', + text: 'Button', + 'class': '', + shortcut: '', + mode: 'icon' + }, + + initialize: function(options){ + this.setOptions(options); + this.name = this.options.name; + this.render(); + }, + + toElement: function(){ + return this.el; + }, + + render: function(){ + var self = this; + var key = (Browser.Platform.mac) ? 'Cmd' : 'Ctrl'; + var shortcut = (this.options.shortcut) ? ' ( ' + key + '+' + this.options.shortcut.toUpperCase() + ' )' : ''; + var text = this.options.title || name; + var title = text + shortcut; + this.el = new Element('button', { + 'class': 'mooeditable-ui-button ' + self.options['class'], + title: title, + html: '' + text + '', + events: { + click: self.click.bind(self), + mousedown: function(e){ e.preventDefault(); } + } + }); + if (this.options.mode != 'icon') this.el.addClass('mooeditable-ui-button-' + this.options.mode); + + this.active = false; + this.disabled = false; + + // add hover effect for IE + if (Browser.ie) this.el.addEvents({ + mouseenter: function(e){ this.addClass('hover'); }, + mouseleave: function(e){ this.removeClass('hover'); } + }); + + return this; + }, + + click: function(e){ + e.preventDefault(); + if (this.disabled) return; + this.action(e); + }, + + action: function(){ + this.fireEvent('action', [this].concat(Array.from(arguments))); + }, + + enable: function(){ + if (this.active) this.el.removeClass('onActive'); + if (!this.disabled) return; + this.disabled = false; + this.el.removeClass('disabled').set({ + disabled: false, + opacity: 1 + }); + return this; + }, + + disable: function(){ + if (this.disabled) return; + this.disabled = true; + this.el.addClass('disabled').set({ + disabled: true, + opacity: 0.4 + }); + return this; + }, + + activate: function(){ + if (this.disabled) return; + this.active = true; + this.el.addClass('onActive'); + return this; + }, + + deactivate: function(){ + this.active = false; + this.el.removeClass('onActive'); + return this; + } + +}); + +MooEditable.UI.Dialog = new Class({ + + Implements: [Events, Options], + + options:{ + /* + onOpen: function(){}, + onClose: function(){}, + */ + 'class': '', + contentClass: '' + }, + + initialize: function(html, options){ + this.setOptions(options); + this.html = html; + + var self = this; + this.el = new Element('div', { + 'class': 'mooeditable-ui-dialog ' + self.options['class'], + html: '
    ' + html + '
    ', + styles: { + 'display': 'none' + }, + events: { + click: self.click.bind(self) + } + }); + }, + + toElement: function(){ + return this.el; + }, + + click: function(){ + this.fireEvent('click', arguments); + return this; + }, + + open: function(){ + this.el.setStyle('display', ''); + this.fireEvent('open', this); + return this; + }, + + close: function(){ + this.el.setStyle('display', 'none'); + this.fireEvent('close', this); + return this; + } + +}); + +MooEditable.UI.AlertDialog = function(alertText){ + if (!alertText) return; + var html = alertText + ' '; + return new MooEditable.UI.Dialog(html, { + 'class': 'mooeditable-alert-dialog', + onOpen: function(){ + var button = this.el.getElement('.dialog-ok-button'); + (function(){ + button.focus(); + }).delay(10); + }, + onClick: function(e){ + e.preventDefault(); + if (e.target.tagName.toLowerCase() != 'button') return; + if (document.id(e.target).hasClass('dialog-ok-button')) this.close(); + } + }); +}; + +MooEditable.UI.PromptDialog = function(questionText, answerText, fn){ + if (!questionText) return; + var html = ' ' + + ''; + return new MooEditable.UI.Dialog(html, { + 'class': 'mooeditable-prompt-dialog', + onOpen: function(){ + var input = this.el.getElement('.dialog-input'); + (function(){ + input.focus(); + input.select(); + }).delay(10); + }, + onClick: function(e){ + e.preventDefault(); + if (e.target.tagName.toLowerCase() != 'button') return; + var button = document.id(e.target); + var input = this.el.getElement('.dialog-input'); + if (button.hasClass('dialog-cancel-button')){ + input.set('value', answerText); + this.close(); + } else if (button.hasClass('dialog-ok-button')){ + var answer = input.get('value'); + input.set('value', answerText); + this.close(); + if (fn) fn.attempt(answer, this); + } + } + }); +}; + +MooEditable.Actions = { + + bold: { + title: MooEditable.Locale.get('bold'), + options: { + shortcut: 'b' + }, + states: { + tags: ['b', 'strong'], + css: {'font-weight': 'bold'} + }, + events: { + beforeToggleView: function(){ + if(Browser.firefox){ + var value = this.textarea.get('value'); + var newValue = value.replace(/]*)>/gi, '').replace(/<\/strong>/gi, ''); + if (value != newValue) this.textarea.set('value', newValue); + } + }, + attach: function(){ + if(Browser.firefox){ + var value = this.textarea.get('value'); + var newValue = value.replace(/]*)>/gi, '').replace(/<\/strong>/gi, ''); + if (value != newValue){ + this.textarea.set('value', newValue); + this.setContent(newValue); + } + } + } + } + }, + + italic: { + title: MooEditable.Locale.get('italic'), + options: { + shortcut: 'i' + }, + states: { + tags: ['i', 'em'], + css: {'font-style': 'italic'} + }, + events: { + beforeToggleView: function(){ + if (Browser.firefox){ + var value = this.textarea.get('value'); + var newValue = value.replace(/]*)>/gi, '') + .replace(/]*)>/gi, '') + .replace(/]*)>/gi, '') + .replace(/<\/em>/gi, ''); + if (value != newValue) this.textarea.set('value', newValue); + } + }, + attach: function(){ + if (Browser.firefox){ + var value = this.textarea.get('value'); + var newValue = value.replace(/]*)>/gi, '') + .replace(/]*)>/gi, '') + .replace(/]*)>/gi, '') + .replace(/<\/em>/gi, ''); + if (value != newValue){ + this.textarea.set('value', newValue); + this.setContent(newValue); + } + } + } + } + }, + + underline: { + title: MooEditable.Locale.get('underline'), + options: { + shortcut: 'u' + }, + states: { + tags: ['u'], + css: {'text-decoration': 'underline'} + }, + events: { + beforeToggleView: function(){ + if(Browser.firefox || Browser.ie){ + var value = this.textarea.get('value'); + var newValue = value.replace(/]*)>/gi, '').replace(/<\/span>/gi, ''); + if (value != newValue) this.textarea.set('value', newValue); + } + }, + attach: function(){ + if(Browser.firefox || Browser.ie){ + var value = this.textarea.get('value'); + var newValue = value.replace(/]*)>/gi, '').replace(/<\/span>/gi, ''); + if (value != newValue){ + this.textarea.set('value', newValue); + this.setContent(newValue); + } + } + } + } + }, + + strikethrough: { + title: MooEditable.Locale.get('strikethrough'), + options: { + shortcut: 's' + }, + states: { + tags: ['s', 'strike'], + css: {'text-decoration': 'line-through'} + } + }, + + insertunorderedlist: { + title: MooEditable.Locale.get('unorderedList'), + states: { + tags: ['ul'] + } + }, + + insertorderedlist: { + title: MooEditable.Locale.get('orderedList'), + states: { + tags: ['ol'] + } + }, + + indent: { + title: MooEditable.Locale.get('indent'), + states: { + tags: ['blockquote'] + } + }, + + outdent: { + title: MooEditable.Locale.get('outdent') + }, + + undo: { + title: MooEditable.Locale.get('undo'), + options: { + shortcut: 'z' + } + }, + + redo: { + title: MooEditable.Locale.get('redo'), + options: { + shortcut: 'y' + } + }, + + unlink: { + title: MooEditable.Locale.get('removeHyperlink') + }, + + createlink: { + title: MooEditable.Locale.get('addHyperlink'), + options: { + shortcut: 'l' + }, + states: { + tags: ['a'] + }, + dialogs: { + alert: MooEditable.UI.AlertDialog.pass(MooEditable.Locale.get('selectTextHyperlink')), + prompt: function(editor){ + return MooEditable.UI.PromptDialog(MooEditable.Locale.get('enterURL'), 'http://', function(url){ + editor.execute('createlink', false, url.trim()); + }); + } + }, + command: function(){ + var selection = this.selection; + var dialogs = this.dialogs.createlink; + if (selection.isCollapsed()){ + var node = selection.getNode(); + if (node.get('tag') == 'a' && node.get('href')){ + selection.selectNode(node); + var prompt = dialogs.prompt; + prompt.el.getElement('.dialog-input').set('value', node.get('href')); + prompt.open(); + } else { + dialogs.alert.open(); + } + } else { + var text = selection.getText(); + var prompt = dialogs.prompt; + if (urlRegex.test(text)) prompt.el.getElement('.dialog-input').set('value', text); + prompt.open(); + } + } + }, + + urlimage: { + title: MooEditable.Locale.get('addImage'), + options: { + shortcut: 'm' + }, + dialogs: { + prompt: function(editor){ + return MooEditable.UI.PromptDialog(MooEditable.Locale.get('enterImageURL'), 'http://', function(url){ + editor.execute('insertimage', false, url.trim()); + }); + } + }, + command: function(){ + this.dialogs.urlimage.prompt.open(); + } + }, + + toggleview: { + title: MooEditable.Locale.get('toggleView'), + command: function(){ + (this.mode == 'textarea') ? this.toolbar.enable() : this.toolbar.disable('toggleview'); + this.toggleView(); + } + } + +}; + +MooEditable.Actions.Settings = {}; + +Element.Properties.mooeditable = { + + get: function(){ + return this.retrieve('MooEditable'); + } + +}; + +Element.implement({ + + mooEditable: function(options){ + var mooeditable = this.get('mooeditable'); + if (!mooeditable) mooeditable = new MooEditable(this, options); + return mooeditable; + } + +}); + +})(); diff --git a/Source/scripts.json b/Source/scripts.json index 960f814..e8d66de 100644 --- a/Source/scripts.json +++ b/Source/scripts.json @@ -1,67 +1,72 @@ -{ - - "MooEditable": { - - "MooEditable": { - "deps": ["MooEditable"], - "desc": "Class for creating a WYSIWYG editor, for contentEditable-capable browsers." - }, - - "MooEditable.UI.MenuList": { - "deps": ["MooEditable"], - "desc": "UI Class to create a menu list (select) element." - }, - - "MooEditable.UI.ButtonOverlay": { - "deps": ["MooEditable"], - "desc": "UI Class to create a button element with a popup overlay." - }, - - "MooEditable.Extras": { - "deps": ["MooEditable"], - "desc": "Extends MooEditable to include more (simple) toolbar buttons." - }, - - "MooEditable.Group": { - "deps": ["MooEditable"], - "desc": "Extends MooEditable to have multiple instances on a page controlled by one toolbar." - }, - - "MooEditable.Forecolor": { - "deps": ["MooEditable", "MooEditable.UI.ButtonOverlay"], - "desc": "Extends MooEditable to change the color of the text from a list a predefined colors." - }, - - "MooEditable.Smiley": { - "deps": ["MooEditable", "MooEditable.UI.ButtonOverlay"], - "desc": "Extends MooEditable to insert smiley/emoticons." - }, - - "MooEditable.Table": { - "deps": ["MooEditable"], - "desc": "Extends MooEditable to insert table with manipulation options." - }, - - "MooEditable.Image": { - "deps": ["MooEditable"], - "desc": "Extends MooEditable to insert image with manipulation options." - }, - - "MooEditable.Flash": { - "deps": ["MooEditable"], - "desc": "Extends MooEditable to embed Flash." - }, - - "MooEditable.Charmap": { - "deps": ["MooEditable"], - "desc": "Extends MooEditable with a characters map" - }, - - "MooEditable.Pagebreak": { - "deps": ["MooEditable"], - "desc": "Extends MooEditable with pagebreak plugin" - } - - } - +{ + + "MooEditable": { + + "MooEditable": { + "deps": ["MooEditable"], + "desc": "Class for creating a WYSIWYG editor, for contentEditable-capable browsers." + }, + + "MooEditable.UI.MenuList": { + "deps": ["MooEditable"], + "desc": "UI Class to create a menu list (select) element." + }, + + "MooEditable.UI.ButtonOverlay": { + "deps": ["MooEditable"], + "desc": "UI Class to create a button element with a popup overlay." + }, + + "MooEditable.Extras": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable to include more (simple) toolbar buttons." + }, + + "MooEditable.Group": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable to have multiple instances on a page controlled by one toolbar." + }, + + "MooEditable.Forecolor": { + "deps": ["MooEditable", "MooEditable.UI.ButtonOverlay"], + "desc": "Extends MooEditable to change the color of the text from a list a predefined colors." + }, + + "MooEditable.Smiley": { + "deps": ["MooEditable", "MooEditable.UI.ButtonOverlay"], + "desc": "Extends MooEditable to insert smiley/emoticons." + }, + + "MooEditable.Table": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable to insert table with manipulation options." + }, + + "MooEditable.Image": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable to insert image with manipulation options." + }, + + "MooEditable.Flash": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable to embed Flash." + }, + + "MooEditable.Charmap": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable with a characters map" + }, + + "MooEditable.Pagebreak": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable with pagebreak plugin" + }, + + "MooEditable.UI.Statusbar": { + "deps": ["MooEditable"], + "desc": "Extends MooEditable with Statusbar into footer" + } + + } + } \ No newline at end of file From f14b1b9265c9d6baa0bfaa390a7e58e79f5de2e4 Mon Sep 17 00:00:00 2001 From: elso Date: Thu, 3 Dec 2015 14:15:36 +0100 Subject: [PATCH 5/5] Ignores --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..58c32c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.project +/.settings/