mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Also, the consolidation makes the total file size substantially smaller. In addition, there is a "scripts/packed" directory that contains highly compressed versions of the javascript files. This should be used for production deployment. The initial load size is reduced by ~80%, before considering gzip and caching.
30 lines
798 B
JavaScript
30 lines
798 B
JavaScript
function CookieSet( cookie_name ) {
|
|
this.cookie_name = cookie_name;
|
|
this.store = store = {};
|
|
q.each( ( q.cookie( cookie_name) || "" ).split( "|" ), function( k, v ) {
|
|
store[ v ] = true;
|
|
});
|
|
};
|
|
CookieSet.prototype.add = function( value ) {
|
|
this.store[value] = true;
|
|
return this;
|
|
};
|
|
CookieSet.prototype.remove = function( value ) {
|
|
delete this.store[value];
|
|
return this;
|
|
};
|
|
CookieSet.prototype.removeAll = function( value ) {
|
|
this.store = {};
|
|
return this;
|
|
};
|
|
CookieSet.prototype.contains = function( value ) {
|
|
return ( value in this.store );
|
|
};
|
|
CookieSet.prototype.save = function() {
|
|
t = [];
|
|
for ( key in this.store ) {
|
|
if ( key != "" ) { t.push( key ) }
|
|
}
|
|
q.cookie( this.cookie_name, t.join( "|" ) );
|
|
return this;
|
|
}; |