X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/530ef4b6c5b943cfa68b779d11cf7de29aa878bf..b37ceabb82336ee82757cd32efe353cfab8ec267:/src/state/CookieProvider.js diff --git a/src/state/CookieProvider.js b/src/state/CookieProvider.js index 67ccddd4..288f8baa 100644 --- a/src/state/CookieProvider.js +++ b/src/state/CookieProvider.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.1 + * Ext JS Library 3.2.2 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -29,17 +29,18 @@ * Create a new CookieProvider * @param {Object} config The configuration object */ -Ext.state.CookieProvider = function(config){ - Ext.state.CookieProvider.superclass.constructor.call(this); - this.path = "/"; - this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days - this.domain = null; - this.secure = false; - Ext.apply(this, config); - this.state = this.readCookies(); -}; - -Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { +Ext.state.CookieProvider = Ext.extend(Ext.state.Provider, { + + constructor : function(config){ + Ext.state.CookieProvider.superclass.constructor.call(this); + this.path = "/"; + this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days + this.domain = null; + this.secure = false; + Ext.apply(this, config); + this.state = this.readCookies(); + }, + // private set : function(name, value){ if(typeof value == "undefined" || value === null){ @@ -58,13 +59,15 @@ Ext.extend(Ext.state.CookieProvider, Ext.state.Provider, { // private readCookies : function(){ - var cookies = {}; - var c = document.cookie + ";"; - var re = /\s?(.*?)=(.*?);/g; - var matches; + var cookies = {}, + c = document.cookie + ";", + re = /\s?(.*?)=(.*?);/g, + matches, + name, + value; while((matches = re.exec(c)) != null){ - var name = matches[1]; - var value = matches[2]; + name = matches[1]; + value = matches[2]; if(name && name.substring(0,3) == "ys-"){ cookies[name.substr(3)] = this.decodeValue(value); }