[buddypress-trac] [BuddyPress] #1673: global.js - for packaged jQuery plugins use minify version when possible

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Thu Feb 4 21:19:39 UTC 2010


#1673: global.js - for packaged jQuery plugins use minify version when possible
------------------------+---------------------------------------------------
Reporter:  r-a-y        |       Owner:     
    Type:  enhancement  |      Status:  new
Priority:  minor        |   Milestone:  1.2
Keywords:               |  
------------------------+---------------------------------------------------

Comment(by r-a-y):

 Okay, so this can almost be closed!
 cookie.js is now minified in global.js.

 Now if we can only minify the querystring plugin!

 See below for a minifed version of the querystring plugin:

 {{{
 (function($){function QueryStringParser(){this.load();}
 $.extend(QueryStringParser.prototype,{load:function(suppliedQueryString){this.Values=new
 Object();var queryString=suppliedQueryString||document.URL;var
 qsIndex=(suppliedQueryString||document.URL).indexOf('?');if(qsIndex<0)
 return;queryString=queryString.substring(qsIndex);if(queryString.length<=1){return;}
 var pairs=queryString.split('&');for(var
 i=0;i<pairs.length;i++){this.Values[pairs[i].split('=')[0].toLowerCase()]=decodeURIComponent(pairs[i].split('=')[1]);}},get:function(key){return(this.Values[key.toLowerCase()])?this.Values[key.toLowerCase()]:'';},set:function(key,value){this.Values[key.toLowerCase()]=value;return
 this;}});QueryStringParser.prototype.toString=function(){var
 params=[];for(var prop in
 this.Values){params.push(prop+"="+encodeURIComponent(this.Values[prop]));}
 return'?'+params.join('&');};$.Params=new QueryStringParser();})(jQuery);
 }}}

-- 
Ticket URL: <http://trac.buddypress.org/ticket/1673#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list