Skip to:

Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#1673 closed enhancement (fixed)

global.js - for packaged jQuery plugins use minify version when possible

Reported by: r-a-y's profile r-a-y Owned by: djpaul's profile DJPaul
Milestone: 1.5 Priority: minor
Severity: normal Version:
Component: Core Keywords:


Instead of including the .pack versions of jQuery scripts, when possible try to use .min (minify) versions.

Minified scripts offer a performance boost (when gzip'd).

In global.js, the Cookie plugin and querystring plugin are packed.

cookie.min.js can be found here -

An online minify javascript tool can be found here -

Change History (6)

#1 @r-a-y
14 years ago

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)
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);

#2 @DJPaul
14 years ago

  • Milestone changed from 1.2 to 1.2.1

#3 @boonebgorges
14 years ago

  • Component set to Core
  • Owner set to DJPaul
  • Status changed from new to assigned

DJPaul - I'm assigning this to you since you've already looked into the issue of js minification. Let me know if you think it's in the cards for 1.3.

#4 @DJPaul
14 years ago

Sure, it should be relatively straightforward.

#5 @DJPaul
14 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

As this ticket referred to the (old) packed versions of some javascript libraries included in global.js, which have since been replaced by minified versions, I'm marking this ticket as resolved. #1891 covers CSS/JS minify for other parts of core and BP-Default.

#6 @johnjamesjacoby
10 years ago

  • Severity set to normal

See r8453 and #5208.

Note: See TracTickets for help on using tickets.