From 5e9ecfffb01f129e6452a14fd606bc1c127bad7b Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Fri, 1 Dec 2006 03:13:21 +0000 Subject: [PATCH] Compress scripts using Dojo and link to the compressed versions, saving about 27kb total. Everything I tested still worked, except the colorpicker which is why it's not compressed. git-svn-id: https://develop.svn.wordpress.org/trunk@4566 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/dbx.compressed.js | 1 + wp-includes/js/fat.compressed.js | 1 + wp-includes/js/prototype.compressed.js | 1 + wp-includes/js/quicktags.compressed.js | 1 + wp-includes/js/tw-sack.compressed.js | 1 + wp-includes/script-loader.php | 10 +++++----- 6 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 wp-includes/js/dbx.compressed.js create mode 100644 wp-includes/js/fat.compressed.js create mode 100644 wp-includes/js/prototype.compressed.js create mode 100644 wp-includes/js/quicktags.compressed.js create mode 100644 wp-includes/js/tw-sack.compressed.js diff --git a/wp-includes/js/dbx.compressed.js b/wp-includes/js/dbx.compressed.js new file mode 100644 index 0000000000..ea637400d9 --- /dev/null +++ b/wp-includes/js/dbx.compressed.js @@ -0,0 +1 @@ +var dbx;function dbxManager(_1){dbx=this;if(!/^[-_a-z0-9]+$/i.test(_1)){alert("Error from dbxManager:\n\""+_1+"\" is an invalid session ID");return;}this.supported=!(document.getElementsByTagName("*").length==0||(navigator.vendor=="KDE"&&typeof window.sidebar=="undefined"));if(!this.supported){return;}this.etype=typeof document.addEventListener!="undefined"?"addEventListener":typeof document.attachEvent!="undefined"?"attachEvent":"none";this.eprefix=(this.etype=="attachEvent"?"on":"");if(typeof window.opera!="undefined"&&parseFloat(navigator.userAgent.toLowerCase().split(/opera[\/ ]/)[1].split(" ")[0],10)<7.5){this.etype="none";}if(this.etype=="none"){this.supported=false;return;}this.running=0;this.sid=_1;this.savedata={};this.cookiestate=this.getCookieState();}dbxManager.prototype.setCookieState=function(){var _2=new Date();_2.setTime(_2.getTime()+(365*24*60*60*1000));var _3="";for(j in this.savedata){if(typeof this.savedata[j]!="function"){_3+=j+"="+this.savedata[j]+"&";}}this.state=_3.replace(/^(.+)&$/,"$1");this.cookiestring=this.state.replace(/,/g,"|");this.cookiestring=this.cookiestring.replace(/=/g,":");if(typeof this.onstatechange=="undefined"||this.onstatechange()){document.cookie="dbx-"+this.sid+"="+this.cookiestring+"; expires="+_2.toGMTString()+"; path=/";}};dbxManager.prototype.getCookieState=function(){this.cookiestate=null;if(document.cookie){if(document.cookie.indexOf("dbx-"+this.sid)!=-1){this.cookie=document.cookie.split("dbx-"+this.sid+"=")[1].split(";")[0].split("&");for(var i in this.cookie){if(typeof this.cookie[i]!="function"){this.cookie[i]=this.cookie[i].replace(/\|/g,",");this.cookie[i]=this.cookie[i].replace(/:/g,"=");this.cookie[i]=this.cookie[i].split("=");this.cookie[i][1]=this.cookie[i][1].split(",");}}this.cookiestate={};for(i in this.cookie){if(typeof this.cookie[i]!="function"){this.cookiestate[this.cookie[i][0]]=this.cookie[i][1];}}}}return this.cookiestate;};dbxManager.prototype.addDataMember=function(_5,_6){this.savedata[_5]=_6;};dbxManager.prototype.createElement=function(_7){return typeof document.createElementNS!="undefined"?document.createElementNS("http://www.w3.org/1999/xhtml",_7):document.createElement(_7);};dbxManager.prototype.getTarget=function(e,_9,_a){if(typeof _a!="undefined"){var _b=_a;}else{_b=typeof e.target!="undefined"?e.target:e.srcElement;}var _c=new RegExp(_9,"");while(!_c.test(_b.className)){_b=_b.parentNode;}return _b;};function dbxGroup(_d,_e,_f,fix,ani,_12,def,_14,_15,_16,_17,_18,_19,_1a){if(!/^[-_a-z0-9]+$/i.test(_d)){alert("Error from dbxGroup:\n\""+_d+"\" is an invalid container ID");return;}this.container=document.getElementById(_d);if(this.container==null||!dbx.supported){return;}var _1b=this;this.gid=_d;this.dragok=false;this.box=null;this.vertical=_e=="vertical";this.threshold=parseInt(_f,10);this.restrict=fix=="yes";this.resolution=parseInt(ani,10);this.toggles=_12=="yes";this.defopen=def!="closed";this.vocab={"open":_14,"close":_15,"move":_16,"toggle":_17,"kmove":_18,"ktoggle":_19,"syntax":_1a};this.container.style.position="relative";this.container.style.display="block";if(typeof window.opera!="undefined"){this.container.style.display="run-in";}this.boxes=[];this.buttons=[];this.order=[];this.eles=this.container.getElementsByTagName("*");for(var i=0;i0)){var _38=this.boxes[_35[i+(_33?1:-1)][0]];if(this.resolution>0){var _39={"x":_34.offsetLeft,"y":_34.offsetTop};var _3a={"x":_38.offsetLeft,"y":_38.offsetTop};}var obj={"insert":(_33?_38:_34),"before":(_33?_34:_38)};this.container.insertBefore(obj.insert,obj.before);if(this.resolution>0){var _3c={"sibling":new dbxAnimator(this,_38,_3a,this.resolution,true,_32),"parent":new dbxAnimator(this,_34,_39,this.resolution,true,_32)};}else{_32.focus();}break;}}}this.getBoxOrder();}};dbxGroup.prototype.compare=function(a,b){return a[1]-b[1];};dbxGroup.prototype.createTooltip=function(_3f,_40){if(this.keydown){this.tooltip=this.container.appendChild(dbx.createElement("span"));this.tooltip.style.visibility="hidden";this.tooltip.className="dbx-tooltip";if(_3f!=null){this.tooltip.appendChild(document.createTextNode(this.vocab.kmove+this.vocab.ktoggle.replace("%toggle%",_3f?this.vocab.close:this.vocab.open)));}else{this.tooltip.appendChild(document.createTextNode(this.vocab.kmove));}var _41=dbx.getTarget(null,"dbx-box",_40);this.tooltip.style.left=_41.offsetLeft+"px";this.tooltip.style.top=_41.offsetTop+"px";var _42=this.tooltip;window.setTimeout(function(){if(_42!=null){_42.style.visibility="visible";}},500);}};dbxGroup.prototype.removeTooltip=function(){if(this.tooltip!=null){this.tooltip.parentNode.removeChild(this.tooltip);this.tooltip=null;}};dbxGroup.prototype.mousedown=function(e,box){var _45=typeof e.target!="undefined"?e.target:e.srcElement;if(_45.nodeName=="#text"){_45=_45.parentNode;}if(!/dbx\-(toggle|box|group)/i.test(_45.className)){while(!/dbx\-(handle|box|group)/i.test(_45.className)){_45=_45.parentNode;}}if(/dbx\-handle/i.test(_45.className)){this.removeTooltip();this.released=false;this.initial={"x":e.clientX,"y":e.clientY};this.current={"x":0,"y":0};this.createCloneBox(box);if(typeof e.preventDefault!="undefined"){e.preventDefault();}if(typeof document.onselectstart!="undefined"){document.onselectstart=function(){return false;};}}};dbxGroup.prototype.mousemove=function(e){if(this.dragok&&this.box!=null){this.positive=this.vertical?(e.clientY>this.current.y?true:false):(e.clientX>this.current.x?true:false);this.current={"x":e.clientX,"y":e.clientY};var _47={"x":this.current.x-this.initial.x,"y":this.current.y-this.initial.y};if(((_47.x>=0&&_47.x<=this.threshold)||(_47.x<=0&&_47.x>=0-this.threshold))&&((_47.y>=0&&_47.y<=this.threshold)||(_47.y<=0&&_47.y>=0-this.threshold))){this.current.x-=_47.x;this.current.y-=_47.y;}if(this.released||_47.x>this.threshold||_47.x<(0-this.threshold)||_47.y>this.threshold||_47.y<(0-this.threshold)){dbx.group=this.container;dbx.box=this.box;dbx.event=e;if(typeof dbx.onboxdrag=="undefined"||dbx.onboxdrag()){this.released=true;if(!this.restrict||!this.vertical){this.boxclone.style.left=(this.current.x-this.difference.x)+"px";}if(!this.restrict||this.vertical){this.boxclone.style.top=(this.current.y-this.difference.y)+"px";}this.moveOriginalToPosition(this.current.x,this.current.y);if(typeof e.preventDefault!="undefined"){e.preventDefault();}}}}return true;};dbxGroup.prototype.mouseup=function(e){if(this.box!=null){this.moveOriginalToPosition(e.clientX,e.clientY);this.removeCloneBox();this.getBoxOrder();if(typeof document.onselectstart!="undefined"){document.onselectstart=function(){return true;};}}this.dragok=false;};dbxGroup.prototype.keypress=function(e,_4a){if(/^(3[7-9])|(40)$/.test(e.keyCode)){this.removeTooltip();if((this.vertical&&/^(38|40)$/.test(e.keyCode))||(!this.vertical&&/^(37|39)$/.test(e.keyCode))){this.shiftBoxPosition(e,_4a,/^[3][78]$/.test(e.keyCode)?false:true);if(typeof e.preventDefault!="undefined"){e.preventDefault();}else{return false;}typeof e.stopPropagation!="undefined"?e.stopPropagation():e.cancelBubble=true;this.keydown=false;}}return true;};dbxGroup.prototype.getBoxOrder=function(){this.order=[];var len=this.eles.length;for(var j=0;j_54.xy&&_51.xy<_54.xy)||(!this.positive&&_51.xy<_54.xy&&_51.xy+_51.wh>_54.xy)){if(this.boxes[i]==this.box){return;}var _55=this.box.nextSibling;while(_55.className==null||!/dbx\-box/.test(_55.className)){_55=_55.nextSibling;}if(this.boxes[i]==_55){return;}if(this.resolution>0){if(this.box[this.vertical?"offsetTop":"offsetLeft"]<_54.xy){var _56=this.boxes[i].previousSibling;while(_56.className==null||!/dbx\-box/.test(_56.className)){_56=_56.previousSibling;}}else{_56=this.boxes[i];}var _57={"x":_56.offsetLeft,"y":_56.offsetTop};}var _58={"x":this.box.offsetLeft,"y":this.box.offsetTop};this.container.insertBefore(this.box,this.boxes[i]);this.initial.x+=(this.box.offsetLeft-_58.x);this.initial.y+=(this.box.offsetTop-_58.y);if(this.resolution>0&&_56!=this.box){var _59=new dbxAnimator(this,_56,_57,this.resolution,false,null);}else{}break;}}};function dbxAnimator(_5a,box,pos,res,kbd,_5f){this.caller=_5a;this.box=box;this.timer=null;var _60=pos[this.caller.vertical?"y":"x"];var _61=this.box[this.caller.vertical?"offsetTop":"offsetLeft"];if(_60!=_61){if(dbx.running>this.caller.boxes.length-1){return;}var _62=this.caller.createClone(this.box,29999,arguments[2]);_62.style.visibility="visible";this.box.style.visibility="hidden";this.animateClone(_62,_60,_61>_60?_61-_60:0-(_60-_61),this.caller.vertical?"top":"left",res,kbd,_5f);}}dbxAnimator.prototype.animateClone=function(_63,_64,_65,dir,res,kbd,_69){var _6a=this;var _6b=0;dbx.running++;this.timer=window.setInterval(function(){_6b++;_64+=_65/res;_63.style[dir]=_64+"px";if(_6b==res){window.clearTimeout(_6a.timer);_6a.timer=null;dbx.running--;_6a.caller.container.removeChild(_63);_6a.box.style.visibility="visible";if(kbd){if(_69!=null&&_69.parentNode.style.visibility!="hidden"){_69.focus();}else{if(_6a.caller.toggles){var _6c=_6a.caller.buttons[parseInt(_6a.box.className.split("dbxid")[1],10)];if(_6c!=null&&typeof _6c.isactive!="undefined"){_6c.focus();}}}}}},20);};if(typeof window.attachEvent!="undefined"){window.attachEvent("onunload",function(){var ev=["mousedown","mousemove","mouseup","mouseout","click","keydown","keyup","focus","blur","selectstart","statechange","boxdrag","boxopen","boxclose"];var el=ev.length;var dl=document.all.length;for(var i=0;i)((\n|\r|.)*?)(?:)",emptyFunction:function(){},K:function(x){return x;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(_2,_3){for(var _4 in _3){_2[_4]=_3[_4];}return _2;};Object.inspect=function(_5){try{if(_5==undefined){return "undefined";}if(_5==null){return "null";}return _5.inspect?_5.inspect():_5.toString();}catch(e){if(e instanceof RangeError){return "...";}throw e;}};Function.prototype.bind=function(){var _6=this,args=$A(arguments),object=args.shift();return function(){return _6.apply(object,args.concat($A(arguments)));};};Function.prototype.bindAsEventListener=function(_7){var _8=this;return function(_9){return _8.call(_7,_9||window.event);};};Object.extend(Number.prototype,{toColorPart:function(){var _a=this.toString(16);if(this<16){return "0"+_a;}return _a;},succ:function(){return this+1;},times:function(_b){$R(0,this,true).each(_b);return this;}});var Try={these:function(){var _c;for(var i=0;i0){if(match=source.match(_11)){_13+=source.slice(0,match.index);_13+=(_12(match)||"").toString();source=source.slice(match.index+match[0].length);}else{_13+=source,source="";}}return _13;},sub:function(_14,_15,_16){_15=this.gsub.prepareReplacement(_15);_16=_16===undefined?1:_16;return this.gsub(_14,function(_17){if(--_16<0){return _17[0];}return _15(_17);});},scan:function(_18,_19){this.gsub(_18,_19);return this;},truncate:function(_1a,_1b){_1a=_1a||30;_1b=_1b===undefined?"...":_1b;return this.length>_1a?this.slice(0,_1a-_1b.length)+_1b:this;},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var _1c=new RegExp(Prototype.ScriptFragment,"img");var _1d=new RegExp(Prototype.ScriptFragment,"im");return (this.match(_1c)||[]).map(function(_1e){return (_1e.match(_1d)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(_1f){return eval(_1f);});},escapeHTML:function(){var div=document.createElement("div");var _21=document.createTextNode(this);div.appendChild(_21);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement("div");div.innerHTML=this.stripTags();return div.childNodes[0]?div.childNodes[0].nodeValue:"";},toQueryParams:function(){var _23=this.match(/^\??(.*)$/)[1].split("&");return _23.inject({},function(_24,_25){var _26=_25.split("=");_24[_26[0]]=_26[1];return _24;});},toArray:function(){return this.split("");},camelize:function(){var _27=this.split("-");if(_27.length==1){return _27[0];}var _28=this.indexOf("-")==0?_27[0].charAt(0).toUpperCase()+_27[0].substring(1):_27[0];for(var i=1,len=_27.length;i=_5b){_5b=_5c;}});return _5b;},min:function(_5e){var _5f;this.each(function(_60,_61){_60=(_5e||Prototype.K)(_60,_61);if(_5f==undefined||_60<_5f){_5f=_60;}});return _5f;},partition:function(_62){var _63=[],falses=[];this.each(function(_64,_65){((_62||Prototype.K)(_64,_65)?_63:falses).push(_64);});return [_63,falses];},pluck:function(_66){var _67=[];this.each(function(_68,_69){_67.push(_68[_66]);});return _67;},reject:function(_6a){var _6b=[];this.each(function(_6c,_6d){if(!_6a(_6c,_6d)){_6b.push(_6c);}});return _6b;},sortBy:function(_6e){return this.collect(function(_6f,_70){return {value:_6f,criteria:_6e(_6f,_70)};}).sort(function(_71,_72){var a=_71.criteria,b=_72.criteria;return ab?1:0;}).pluck("value");},toArray:function(){return this.collect(Prototype.K);},zip:function(){var _74=Prototype.K,args=$A(arguments);if(typeof args.last()=="function"){_74=args.pop();}var _75=[this].concat(args).map($A);return this.map(function(_76,_77){return _74(_75.pluck(_77));});},inspect:function(){return "#";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(_78){if(!_78){return [];}if(_78.toArray){return _78.toArray();}else{var _79=[];for(var i=0;i<_78.length;i++){_79.push(_78[i]);}return _79;}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(_7b){for(var i=0;i";}};function $H(_8e){var _8f=Object.extend({},_8e||{});Object.extend(_8f,Enumerable);Object.extend(_8f,Hash);return _8f;}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(_90,end,_92){this.start=_90;this.end=end;this.exclusive=_92;},_each:function(_93){var _94=this.start;do{_93(_94);_94=_94.succ();}while(this.include(_94));},include:function(_95){if(_95=200&&this.transport.status<300);},responseIsFailure:function(){return !this.responseIsSuccess();}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,_a3){this.transport=Ajax.getTransport();this.setOptions(_a3);this.request(url);},request:function(url){var _a5=this.options.parameters||"";if(_a5.length>0){_a5+="&_=";}try{this.url=url;if(this.options.method=="get"&&_a5.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+_a5;}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1);}).bind(this),10);}this.setRequestHeaders();var _a6=this.options.postBody?this.options.postBody:_a5;this.transport.send(this.options.method=="post"?_a6:null);}catch(e){this.dispatchException(e);}},setRequestHeaders:function(){var _a7=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version,"Accept","text/javascript, text/html, application/xml, text/xml, */*"];if(this.options.method=="post"){_a7.push("Content-type",this.options.contentType);if(this.transport.overrideMimeType){_a7.push("Connection","close");}}if(this.options.requestHeaders){_a7.push.apply(_a7,this.options.requestHeaders);}for(var i=0;i<_a7.length;i+=2){this.transport.setRequestHeader(_a7[i],_a7[i+1]);}},onStateChange:function(){var _a9=this.transport.readyState;if(_a9!=1){this.respondToReadyState(this.transport.readyState);}},header:function(_aa){try{return this.transport.getResponseHeader(_aa);}catch(e){}},evalJSON:function(){try{return eval("("+this.header("X-JSON")+")");}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},respondToReadyState:function(_ab){var _ac=Ajax.Request.Events[_ab];var _ad=this.transport,json=this.evalJSON();if(_ac=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_ad,json);}catch(e){this.dispatchException(e);}if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse();}}try{(this.options["on"+_ac]||Prototype.emptyFunction)(_ad,json);Ajax.Responders.dispatch("on"+_ac,this,_ad,json);}catch(e){this.dispatchException(e);}if(_ac=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},dispatchException:function(_ae){(this.options.onException||Prototype.emptyFunction)(this,_ae);Ajax.Responders.dispatch("onException",this,_ae);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_af,url,_b1){this.containers={success:_af.success?$(_af.success):$(_af),failure:_af.failure?$(_af.failure):(_af.success?null:$(_af))};this.transport=Ajax.getTransport();this.setOptions(_b1);var _b2=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(_b3,_b4){this.updateContent();_b2(_b3,_b4);}).bind(this);this.request(url);},updateContent:function(){var _b5=this.responseIsSuccess()?this.containers.success:this.containers.failure;var _b6=this.transport.responseText;if(!this.options.evalScripts){_b6=_b6.stripScripts();}if(_b5){if(this.options.insertion){new this.options.insertion(_b5,_b6);}else{Element.update(_b5,_b6);}}if(this.responseIsSuccess()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10);}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_b7,url,_b9){this.setOptions(_b9);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=_b7;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(_ba){if(this.options.decay){this.decay=(_ba.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=_ba.responseText;}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(){var _bb=[],element;for(var i=0;i"+this.content+"";return $A(div.childNodes[0].childNodes[0].childNodes);}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(_fd){_fd.each((function(_fe){this.element.parentNode.insertBefore(_fe,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(_ff){_ff.reverse(false).each((function(_100){this.element.insertBefore(_100,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(_101){_101.each((function(_102){this.element.appendChild(_102);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(_103){_103.each((function(_104){this.element.parentNode.insertBefore(_104,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(_105){this.element=$(_105);},_each:function(_106){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(_106);},set:function(_108){this.element.className=_108;},add:function(_109){if(this.include(_109)){return;}this.set(this.toArray().concat(_109).join(" "));},remove:function(_10a){if(!this.include(_10a)){return;}this.set(this.select(function(_10b){return _10b!=_10a;}).join(" "));},toString:function(){return this.toArray().join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(_10c){this.params={classNames:[]};this.expression=_10c.toString().strip();this.parseExpression();this.compileMatcher();},parseExpression:function(){function abort(_10d){throw "Parse error in selector: "+_10d;}if(this.expression==""){abort("empty expression");}var _10e=this.params,expr=this.expression,match,modifier,clause,rest;while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){_10e.attributes=_10e.attributes||[];_10e.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||""});expr=match[1];}if(expr=="*"){return this.params.wildcard=true;}while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){modifier=match[1],clause=match[2],rest=match[3];switch(modifier){case "#":_10e.id=clause;break;case ".":_10e.classNames.push(clause);break;case "":case undefined:_10e.tagName=clause.toUpperCase();break;default:abort(expr.inspect());}expr=rest;}if(expr.length>0){abort(expr.inspect());}},buildMatchExpression:function(){var _10f=this.params,conditions=[],clause;if(_10f.wildcard){conditions.push("true");}if(clause=_10f.id){conditions.push("element.id == "+clause.inspect());}if(clause=_10f.tagName){conditions.push("element.tagName.toUpperCase() == "+clause.inspect());}if((clause=_10f.classNames).length>0){for(var i=0;i=0){opt=_14b.options[index];_14c=opt.value||opt.text;}return [_14b.name,_14c];},selectMany:function(_14d){var _14e=[];for(var i=0;i<_14d.length;i++){var opt=_14d.options[i];if(opt.selected){_14e.push(opt.value||opt.text);}}return [_14d.name,_14e];}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(_151,_152,_153){this.frequency=_152;this.element=$(_151);this.callback=_153;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var _154=this.getValue();if(this.lastValue!=_154){this.callback(this.element,_154);this.lastValue=_154;}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(_155,_156){this.element=$(_155);this.callback=_156;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var _157=this.getValue();if(this.lastValue!=_157){this.callback(this.element,_157);this.lastValue=_157;}},registerFormCallbacks:function(){var _158=Form.getElements(this.element);for(var i=0;i<_158.length;i++){this.registerCallback(_158[i]);}},registerCallback:function(_15a){if(_15a.type){switch(_15a.type.toLowerCase()){case "checkbox":case "radio":Event.observe(_15a,"click",this.onElementEvent.bind(this));break;case "password":case "text":case "textarea":case "select-one":case "select-multiple":Event.observe(_15a,"change",this.onElementEvent.bind(this));break;}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_15b){return _15b.target||_15b.srcElement;},isLeftClick:function(_15c){return (((_15c.which)&&(_15c.which==1))||((_15c.button)&&(_15c.button==1)));},pointerX:function(_15d){return _15d.pageX||(_15d.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(_15e){return _15e.pageY||(_15e.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(_15f){if(_15f.preventDefault){_15f.preventDefault();_15f.stopPropagation();}else{_15f.returnValue=false;_15f.cancelBubble=true;}},findElement:function(_160,_161){var _162=Event.element(_160);while(_162.parentNode&&(!_162.tagName||(_162.tagName.toUpperCase()!=_161.toUpperCase()))){_162=_162.parentNode;}return _162;},observers:false,_observeAndCache:function(_163,name,_165,_166){if(!this.observers){this.observers=[];}if(_163.addEventListener){this.observers.push([_163,name,_165,_166]);_163.addEventListener(name,_165,_166);}else{if(_163.attachEvent){this.observers.push([_163,name,_165,_166]);_163.attachEvent("on"+name,_165);}}},unloadCache:function(){if(!Event.observers){return;}for(var i=0;i=this.offset[1]&&y=this.offset[0]&&x=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp","","b");edButtons[edButtons.length]=new edButton("ed_em","i","","","i");edButtons[edButtons.length]=new edButton("ed_link","link","","","a");edButtons[edButtons.length]=new edButton("ed_block","b-quote","\n\n
","
\n\n","q");edButtons[edButtons.length]=new edButton("ed_del","del","","","d");edButtons[edButtons.length]=new edButton("ed_ins","ins","","","s");edButtons[edButtons.length]=new edButton("ed_img","img","","","m",-1);edButtons[edButtons.length]=new edButton("ed_ul","ul","
    \n","
\n\n","u");edButtons[edButtons.length]=new edButton("ed_ol","ol","
    \n","
\n\n","o");edButtons[edButtons.length]=new edButton("ed_li","li","\t
  • ","
  • \n","l");edButtons[edButtons.length]=new edButton("ed_code","code","","","c");edButtons[edButtons.length]=new edButton("ed_more","more","","","t",-1);function edLink(){this.display="";this.URL="";this.newWin=0;}edLinks[edLinks.length]=new edLink("WordPress","http://wordpress.org/");edLinks[edLinks.length]=new edLink("alexking.org","http://www.alexking.org/");function edShowButton(_a,i){if(_a.id=="ed_img"){document.write("");}else{if(_a.id=="ed_link"){document.write("");}else{document.write("");}}}function edShowLinks(){var _c="";document.write(_c);}function edAddTag(_d){if(edButtons[_d].tagEnd!=""){edOpenTags[edOpenTags.length]=_d;document.getElementById(edButtons[_d].id).value="/"+document.getElementById(edButtons[_d].id).value;}}function edRemoveTag(_e){for(i=0;i0){return true;}else{return false;}}function edCloseAllTags(){var _11=edOpenTags.length;for(o=0;o<_11;o++){edInsertTag(edCanvas,edOpenTags[edOpenTags.length-1]);}}function edQuickLink(i,_13){if(i>-1){var _14="";if(edLinks[i].newWin==1){_14=" target=\"_blank\"";}var _15=""+edLinks[i].display+"";_13.selectedIndex=0;edInsertContent(edCanvas,_15);}else{_13.selectedIndex=0;}}function edSpell(_16){var _17="";if(document.selection){_16.focus();var sel=document.selection.createRange();if(sel.text.length>0){_17=sel.text;}}else{if(_16.selectionStart||_16.selectionStart=="0"){var _19=_16.selectionStart;var _1a=_16.selectionEnd;if(_19!=_1a){_17=_16.value.substring(_19,_1a);}}}if(_17==""){_17=prompt("Enter a word to look up:","");}if(_17!==null&&/^\w[\w ]*$/.test(_17)){window.open("http://www.answers.com/"+escape(_17));}}function edToolbar(){document.write("
    ");for(i=0;i");document.write("");document.write("
    ");}function edInsertTag(_1b,i){if(document.selection){_1b.focus();sel=document.selection.createRange();if(sel.text.length>0){sel.text=edButtons[i].tagStart+sel.text+edButtons[i].tagEnd;}else{if(!edCheckOpenTags(i)||edButtons[i].tagEnd==""){sel.text=edButtons[i].tagStart;edAddTag(i);}else{sel.text=edButtons[i].tagEnd;edRemoveTag(i);}}_1b.focus();}else{if(_1b.selectionStart||_1b.selectionStart=="0"){var _1d=_1b.selectionStart;var _1e=_1b.selectionEnd;var _1f=_1e;var _20=_1b.scrollTop;if(_1d!=_1e){_1b.value=_1b.value.substring(0,_1d)+edButtons[i].tagStart+_1b.value.substring(_1d,_1e)+edButtons[i].tagEnd+_1b.value.substring(_1e,_1b.value.length);_1f+=edButtons[i].tagStart.length+edButtons[i].tagEnd.length;}else{if(!edCheckOpenTags(i)||edButtons[i].tagEnd==""){_1b.value=_1b.value.substring(0,_1d)+edButtons[i].tagStart+_1b.value.substring(_1e,_1b.value.length);edAddTag(i);_1f=_1d+edButtons[i].tagStart.length;}else{_1b.value=_1b.value.substring(0,_1d)+edButtons[i].tagEnd+_1b.value.substring(_1e,_1b.value.length);edRemoveTag(i);_1f=_1d+edButtons[i].tagEnd.length;}}_1b.focus();_1b.selectionStart=_1f;_1b.selectionEnd=_1f;_1b.scrollTop=_20;}else{if(!edCheckOpenTags(i)||edButtons[i].tagEnd==""){_1b.value+=edButtons[i].tagStart;edAddTag(i);}else{_1b.value+=edButtons[i].tagEnd;edRemoveTag(i);}_1b.focus();}}}function edInsertContent(_21,_22){if(document.selection){_21.focus();sel=document.selection.createRange();sel.text=_22;_21.focus();}else{if(_21.selectionStart||_21.selectionStart=="0"){var _23=_21.selectionStart;var _24=_21.selectionEnd;_21.value=_21.value.substring(0,_23)+_22+_21.value.substring(_24,_21.value.length);_21.focus();_21.selectionStart=_23+_22.length;_21.selectionEnd=_23+_22.length;}else{_21.value+=_22;_21.focus();}}}function edInsertLink(_25,i,_27){if(!_27){_27="http://";}if(!edCheckOpenTags(i)){var URL=prompt("Enter the URL",_27);if(URL){edButtons[i].tagStart="";edInsertTag(_25,i);}}else{edInsertTag(_25,i);}}function edInsertImage(_29){var _2a=prompt("Enter the URL of the image","http://");if(_2a){_2a="\""+prompt("Enter";edInsertContent(_29,_2a);}} \ No newline at end of file diff --git a/wp-includes/js/tw-sack.compressed.js b/wp-includes/js/tw-sack.compressed.js new file mode 100644 index 0000000000..3674c46f13 --- /dev/null +++ b/wp-includes/js/tw-sack.compressed.js @@ -0,0 +1 @@ +function sack(_1){this.xmlhttp=null;this.resetData=function(){this.method="POST";this.queryStringSeparator="?";this.argumentSeparator="&";this.URLString="";this.encodeURIString=true;this.execute=false;this.element=null;this.elementObj=null;this.requestFile=_1;this.vars=new Object();this.responseStatus=new Array(2);};this.resetFunctions=function(){this.onLoading=function(){};this.onLoaded=function(){};this.onInteractive=function(){};this.onCompletion=function(){};this.onError=function(){};this.onFail=function(){};};this.reset=function(){this.resetFunctions();this.resetData();};this.createAJAX=function(){try{this.xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{this.xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){this.xmlhttp=null;}}if(!this.xmlhttp){if(typeof XMLHttpRequest!="undefined"){this.xmlhttp=new XMLHttpRequest();}else{this.failed=true;}}};this.setVar=function(_2,_3){this.vars[_2]=Array(_3,false);};this.encVar=function(_4,_5,_6){if(true==_6){return Array(encodeURIComponent(_4),encodeURIComponent(_5));}else{this.vars[encodeURIComponent(_4)]=Array(encodeURIComponent(_5),true);}};this.processURLString=function(_7,_8){encoded=encodeURIComponent(this.argumentSeparator);regexp=new RegExp(this.argumentSeparator+"|"+encoded);varArray=_7.split(regexp);for(i=0;iadd( 'dbx', '/wp-includes/js/dbx.js', false, '2.05' ); - $this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' ); - $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); - $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' ); + $this->add( 'dbx', '/wp-includes/js/dbx.compressed.js', false, '2.05' ); + $this->add( 'fat', '/wp-includes/js/fat.compressed.js', false, '1.0-RC1_3660' ); + $this->add( 'sack', '/wp-includes/js/tw-sack.compressed.js', false, '1.6.1' ); + $this->add( 'quicktags', '/wp-includes/js/quicktags.compressed.js', false, '3517' ); $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20061113' ); $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20061113' ); - $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0'); + $this->add( 'prototype', '/wp-includes/js/prototype.compressed.js', false, '1.5.0'); $this->add( 'autosave', '/wp-includes/js/autosave.js.php', array('prototype', 'sack'), '4508'); $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), '4459'); $this->add( 'listman', '/wp-includes/js/list-manipulation-js.php', array('wp-ajax', 'fat'), '4459');