diff --git a/VERSION b/VERSION index 0f44168a4..8997e3efc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.4 +3.6.4.2 diff --git a/bower.json b/bower.json index c5e01cbc9..947450079 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pubnub", - "version": "3.6.4", + "version": "3.6.4.2", "main": "web/pubnub.min.js", "license": "https://github.com/pubnub/javascript/blob/master/LICENSE", "ignore" : [ "**/*", "!web/pubnub.js", "!web/pubnub.min.js"], diff --git a/web/pubnub.js b/web/pubnub.js index 19533271b..2f4a7d9a5 100644 --- a/web/pubnub.js +++ b/web/pubnub.js @@ -1,154 +1,5 @@ -// Version: 3.6.4 -/* =-====================================================================-= */ -/* =-====================================================================-= */ -/* =-========================= JSON =============================-= */ -/* =-====================================================================-= */ -/* =-====================================================================-= */ - -(window['JSON'] && window['JSON']['stringify']) || (function () { - window['JSON'] || (window['JSON'] = {}); - - function toJSON(key) { - try { return this.valueOf() } - catch(e) { return null } - } - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - - function quote(string) { - escapable.lastIndex = 0; - return escapable.test(string) ? - '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : - '"' + string + '"'; - } - - function str(key, holder) { - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - partial, - mind = gap, - value = holder[key]; - - if (value && typeof value === 'object') { - value = toJSON.call( value, key ); - } - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - return String(value); - - case 'object': - - if (!value) { - return 'null'; - } - - gap += indent; - partial = []; - - if (Object.prototype.toString.apply(value) === '[object Array]') { - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } +// Version: 3.6.4.2 - v = partial.length === 0 ? '[]' : - gap ? '[\n' + gap + - partial.join(',\n' + gap) + '\n' + - mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - for (k in value) { - if (Object.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - v = partial.length === 0 ? '{}' : - gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + - mind + '}' : '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - - if (typeof JSON['stringify'] !== 'function') { - JSON['stringify'] = function (value, replacer, space) { - var i; - gap = ''; - indent = ''; - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - } else if (typeof space === 'string') { - indent = space; - } - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - return str('', {'': value}); - }; - } - - if (typeof JSON['parse'] !== 'function') { - // JSON is parsed on the server for security. - JSON['parse'] = function (text) {return eval('('+text+')')}; - } -}()); var NOW = 1 , READY = false , READY_BUFFER = [] @@ -2659,23 +2510,13 @@ console.log || ( * LOCAL STORAGE OR COOKIE */ var db = (function(){ - var ls = window['localStorage']; + var store = {}; return { 'get' : function(key) { - try { - if (ls) return ls.getItem(key); - if (document.cookie.indexOf(key) == -1) return null; - return ((document.cookie||'').match( - RegExp(key+'=([^;]+)') - )||[])[1] || null; - } catch(e) { return } + return store[key]; }, 'set' : function( key, value ) { - try { - if (ls) return ls.setItem( key, value ) && 0; - document.cookie = key + '=' + value + - '; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/'; - } catch(e) { return } + db[key] = value; } }; })(); @@ -3025,16 +2866,16 @@ var PDIV = $('pubnub') || 0 // Add Leave Functions - bind( 'beforeunload', window, function() { + /*bind( 'beforeunload', window, function() { if (leave_on_unload) SELF['each-channel'](function(ch){ SELF['LEAVE']( ch.name, 0 ) }); return true; - } ); + } );*/ // Return without Testing - if (setup['notest']) return SELF; + /*if (setup['notest']) return SELF; bind( 'offline', window, SELF['offline'] ); - bind( 'offline', document, SELF['offline'] ); + bind( 'offline', document, SELF['offline'] );*/ // Return PUBNUB Socket Object return SELF;