Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

code reorg for js consolidation

  • Loading branch information...
commit 10d5a43a3a349e81e663601a649a1c05c88714a8 1 parent e5f2375
@devendram devendram authored
View
2  javascript/javascript-browser/3.4/tests/head-test.htm
@@ -7,7 +7,7 @@
href=http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css
>
<script src=head.load.min.js></script>
- <script>head.js( '../pubnub-3.4-common.js', '../pubnub-3.4.js', function(){
+ <script>head.js( '../../pubnub-3.4.min.js', function(){
// CREATE A PUBNUB OBJECT
var pubnub = PUBNUB.init({
'publish_key' : 'demo',
View
2  javascript/javascript-browser/3.4/tests/mailto-fix.html
@@ -22,7 +22,7 @@
<div id=output class=well>0</div>
<div id=pubnub pub-key=demo sub-key=demo></div>
-<script src=../pubnub-3.4.js></script>
+<script src=../../pubnub-3.4.min.js></script>
<script>(function(){
var msgs = 1
View
3  javascript/javascript-browser/3.4/tests/multiplexing.html
@@ -20,8 +20,7 @@
<div id=out>...</div>
<div id=pubnub></div>
-<script src=../json.js></script>
-<script src=../pubnub-3.4.js></script>
+<script src=../../pubnub-3.4.min.js></script>
<script>(function(){
// --------------------------------
View
2  javascript/javascript-browser/3.4/tests/presence-ssl.html
@@ -24,7 +24,7 @@
<!-- PUBNUB AT BOTTOM -->
<div id=pubnub ssl=on origin=pubsub.pubnub.com></div>
-<script src=../pubnub-3.4.js></script>
+<script src=../../pubnub-3.4.min.js></script>
<script>(function(){
var p = PUBNUB.init({
View
3  javascript/javascript-browser/3.4/tests/publish-test.html
@@ -23,8 +23,7 @@
<div id=out>...</div>
<div id=pubnub></div>
-<script src=../json.js></script>
-<script src=../pubnub-3.4.min.js></script>
+<script src=../../pubnub-3.4.min.js></script>
<script>(function(){
// --------------------------------
View
2  javascript/javascript-browser/3.4/tests/ssl-test.html
@@ -4,7 +4,7 @@
<div id="output"></div>
<div id=pubnub ssl=on pub-key=demo sub-key=demo></div>
-<script src=../pubnub-3.4.js></script>
+<script src=../../pubnub-3.4.min.js></script>
<script>
var p = PUBNUB.init({ 'subscribe_key': 'demo', 'publish_key': 'demo', ssl : true })
, out = p.$('output')
View
4 javascript/javascript-browser/3.4/tests/unit-test.html
@@ -54,8 +54,8 @@
<div id=pubnub pub-key=demo sub-key=demo origin=pubsub.pubnub.com></div>
<script src=../../pubnub-3.4.min.js></script>
-<script src=../crypto/gibberish-aes.js></script>
-<script src=../crypto/encrypt-pubnub.js></script>
+<script src=../../../crypto/gibberish-aes.js></script>
+<script src=../../../crypto/encrypt-pubnub.js></script>
<script src=./pubnub-test.js></script>
<script>
start_test();
View
7 javascript/javascript-modern/3.1/pubnub-3.1.min.js
@@ -1,7 +0,0 @@
-(function(){function p(b,a){if(b&&a)if(typeof b[0]!="undefined")for(var e=0,g=b.length;e<g;)a.call(b[e],b[e],e++);else for(e in b)b.hasOwnProperty&&b.hasOwnProperty(e)&&a.call(b[e],e,b[e])}function u(b,a){var e=[];p(b||[],function(g,j){e.push(a(g,j))});return e}function q(b){return u(encodeURIComponent(b).split(""),function(a){return"-_.!~*'()".indexOf(a)<0?a:"%"+a.charCodeAt(0).toString(16).toUpperCase()}).join("")}function k(b){var a,e=function(){if(!j){j=1;clearTimeout(l);try{response=JSON.parse(a.responseText)}catch(f){return d(1)}c(response)}},
-g=0,j=0,l=setTimeout(function(){d(1)},v),r=b.fail||function(){},c=b.success||function(){},d=function(f){if(!g){g=1;clearTimeout(l);if(a){a.onerror=a.onload=null;a.abort&&a.abort();a=null}f&&r()}};try{a=typeof XDomainRequest!=="undefined"&&new XDomainRequest||new XMLHttpRequest;a.onerror=a.onabort=function(){d(1)};a.onload=a.onloadend=e;a.timeout=v;a.open("GET",b.url.join(z),true);a.send()}catch(h){d(0);return k(b)}return d}function s(b){var a={},e=b.publish_key||"",g=b.subscribe_key||"",j=b.ssl?"s":
-"",l="http"+j+"://"+(b.origin||"pubsub.pubnub.com"),r={history:function(c,d){d=c.callback||d;var h=c.limit||100,f=c.channel;f&&d&&k({url:[l,"history",g,q(f),0,h],success:function(i){d(i)},fail:function(i){d(i)}})},time:function(c){k({url:[l,"time",0],success:function(d){c(d[0])},fail:function(){c(0)}})},uuid:function(c){k({url:["http"+j+"://pubnub-prod.appspot.com/uuid"],success:function(d){c(d[0])},fail:function(){c(0)}})},publish:function(c,d){d=d||c.callback||function(){};var h=c.message,f=c.channel;
-if(h)if(f)if(e){h=JSON.stringify(h);h=[l,"publish",e,g,0,q(f),0,q(h)];k({success:function(i){d(i)},fail:function(){d([0,"Disconnected"])},url:h})}},unsubscribe:function(c){c=c.channel;if(c in a){a[c].connected=0;a[c].done&&a[c].done(0)}},subscribe:function(c,d){function h(){if(a[f].connected)a[f].done=k({callback:0,url:[A,"subscribe",g,q(f),0,w],fail:function(){if(!m){m=1;B()}setTimeout(h,1E3);r.time(function(n){if(n&&m){m=0;x()}n||C()})},success:function(n){if(a[f].connected){if(!y){y=1;D()}if(m){m=
-0;x()}i=t.set(g+f,w=i&&t.get(g+f)||n[1]);p(n[0],function(E){d(E,n)});setTimeout(h,10)}}})}var f=c.channel;d=d||c.callback;var i=c.restore,w=0,C=c.error||function(){},D=c.connect||function(){},x=c.reconnect||function(){},B=c.disconnect||function(){},m=0,y=0,A=F(l);if(f)if(d)if(g){f in a||(a[f]={});if(!a[f].connected){a[f].connected=1;h()}}},xdr:k,db:t,each:p,map:u,events:o};return r}var t=function(){var b=typeof localStorage!="undefined"&&localStorage;return{get:function(a){try{if(b)return b.getItem(a);
-if(document.cookie.indexOf(a)==-1)return null;return((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||null}catch(e){}},set:function(a,e){try{if(b)return b.setItem(a,e)&&0;document.cookie=a+"="+e+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}catch(g){}}}}(),z="/",v=31E4,F=function(){var b=Math.floor(Math.random()*9)+1;return function(a){return a.indexOf("pubsub")>0&&a.replace("pubsub","ps"+(++b<10?b:b=1))||a}}(),o={list:{},unbind:function(b){o.list[b]=[]},bind:function(b,a){(o.list[b]=
-o.list[b]||[]).push(a)},fire:function(b,a){p(o.list[b]||[],function(e){e(a)})}};typeof module!=="undefined"&&(module.exports=s)||typeof exports!=="undefined"&&(exports.PN=s)||(PUBNUB=s)})();
View
BIN  javascript/javascript-modern/3.1/pubnub-3.1.min.js.gz
Binary file not shown
View
7 javascript/javascript-modern/3.3/pubnub-3.3.min.js
@@ -1,7 +0,0 @@
-(function(){function p(b,a){if(b&&a)if(typeof b[0]!="undefined")for(var e=0,g=b.length;e<g;)a.call(b[e],b[e],e++);else for(e in b)b.hasOwnProperty&&b.hasOwnProperty(e)&&a.call(b[e],e,b[e])}function u(b,a){var e=[];p(b||[],function(g,j){e.push(a(g,j))});return e}function q(b){return u(encodeURIComponent(b).split(""),function(a){return"-_.!~*'()".indexOf(a)<0?a:"%"+a.charCodeAt(0).toString(16).toUpperCase()}).join("")}function k(b){var a,e=function(){if(!j){j=1;clearTimeout(l);try{response=JSON.parse(a.responseText)}catch(f){return d(1)}c(response)}},
-g=0,j=0,l=setTimeout(function(){d(1)},v),r=b.fail||function(){},c=b.success||function(){},d=function(f){if(!g){g=1;clearTimeout(l);if(a){a.onerror=a.onload=null;a.abort&&a.abort();a=null}f&&r()}};try{a=typeof XDomainRequest!=="undefined"&&new XDomainRequest||new XMLHttpRequest;a.onerror=a.onabort=function(){d(1)};a.onload=a.onloadend=e;a.timeout=v;a.open("GET",b.url.join(z),true);a.send()}catch(h){d(0);return k(b)}return d}function s(b){var a={},e=b.publish_key||"",g=b.subscribe_key||"",j=b.ssl?"s":
-"",l="http"+j+"://"+(b.origin||"pubsub.pubnub.com"),r={history:function(c,d){d=c.callback||d;var h=c.limit||100,f=c.channel;f&&d&&k({url:[l,"history",g,q(f),0,h],success:function(i){d(i)},fail:function(i){d(i)}})},time:function(c){k({url:[l,"time",0],success:function(d){c(d[0])},fail:function(){c(0)}})},uuid:function(c){k({url:["http"+j+"://pubnub-prod.appspot.com/uuid"],success:function(d){c(d[0])},fail:function(){c(0)}})},publish:function(c,d){d=d||c.callback||function(){};var h=c.message,f=c.channel;
-if(h)if(f)if(e){h=JSON.stringify(h);h=[l,"publish",e,g,0,q(f),0,q(h)];k({success:function(i){d(i)},fail:function(){d([0,"Disconnected"])},url:h})}},unsubscribe:function(c){c=c.channel;if(c in a){a[c].connected=0;a[c].done&&a[c].done(0)}},subscribe:function(c,d){function h(){if(a[f].connected)a[f].done=k({callback:0,url:[A,"subscribe",g,q(f),0,w],fail:function(){if(!m){m=1;B()}setTimeout(h,1E3);r.time(function(n){if(n&&m){m=0;x()}n||C()})},success:function(n){if(a[f].connected){if(!y){y=1;D()}if(m){m=
-0;x()}i=t.set(g+f,w=i&&t.get(g+f)||n[1]);p(n[0],function(E){d(E,n)});setTimeout(h,10)}}})}var f=c.channel;d=d||c.callback;var i=c.restore,w=0,C=c.error||function(){},D=c.connect||function(){},x=c.reconnect||function(){},B=c.disconnect||function(){},m=0,y=0,A=F(l);if(f)if(d)if(g){f in a||(a[f]={});if(!a[f].connected){a[f].connected=1;h()}}},xdr:k,db:t,each:p,map:u,events:o};return r}var t=function(){var b=typeof localStorage!="undefined"&&localStorage;return{get:function(a){try{if(b)return b.getItem(a);
-if(document.cookie.indexOf(a)==-1)return null;return((document.cookie||"").match(RegExp(a+"=([^;]+)"))||[])[1]||null}catch(e){}},set:function(a,e){try{if(b)return b.setItem(a,e)&&0;document.cookie=a+"="+e+"; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"}catch(g){}}}}(),z="/",v=31E4,F=function(){var b=Math.floor(Math.random()*9)+1;return function(a){return a.indexOf("pubsub")>0&&a.replace("pubsub","ps"+(++b<10?b:b=1))||a}}(),o={list:{},unbind:function(b){o.list[b]=[]},bind:function(b,a){(o.list[b]=
-o.list[b]||[]).push(a)},fire:function(b,a){p(o.list[b]||[],function(e){e(a)})}};typeof module!=="undefined"&&(module.exports=s)||typeof exports!=="undefined"&&(exports.PN=s)||(PUBNUB=s)})();
View
BIN  javascript/javascript-modern/3.3/pubnub-3.3.min.js.gz
Binary file not shown
View
168 javascript/javascript-modern/3.4/pubnub-3.4.min.js
@@ -1,168 +0,0 @@
-(function(){
-window.JSON && window.JSON.stringify || function() {
- function b(a) {
- e.lastIndex = 0;
- return e.test(a) ? '"' + a.replace(e, function(a) {
- var b = i[a];
- return"string" === typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
- }) + '"' : '"' + a + '"'
- }
- function c(e, n) {
- var f, h, l, i, p = a, j, d = n[e];
- d && ("object" === typeof d && "function" === typeof d.toJSON) && (d = d.toJSON(e));
- "function" === typeof k && (d = k.call(n, e, d));
- switch(typeof d) {
- case "string":
- return b(d);
- case "number":
- return isFinite(d) ? String(d) : "null";
- case "boolean":
- ;
- case "null":
- return String(d);
- case "object":
- if(!d) {
- return"null"
- }
- a += g;
- j = [];
- if("[object Array]" === Object.prototype.toString.apply(d)) {
- i = d.length;
- for(f = 0;f < i;f += 1) {
- j[f] = c(f, d) || "null"
- }
- l = 0 === j.length ? "[]" : a ? "[\n" + a + j.join(",\n" + a) + "\n" + p + "]" : "[" + j.join(",") + "]";
- a = p;
- return l
- }
- if(k && "object" === typeof k) {
- i = k.length;
- for(f = 0;f < i;f += 1) {
- h = k[f], "string" === typeof h && (l = c(h, d)) && j.push(b(h) + (a ? ": " : ":") + l)
- }
- }else {
- for(h in d) {
- Object.hasOwnProperty.call(d, h) && (l = c(h, d)) && j.push(b(h) + (a ? ": " : ":") + l)
- }
- }
- l = 0 === j.length ? "{}" : a ? "{\n" + a + j.join(",\n" + a) + "\n" + p + "}" : "{" + j.join(",") + "}";
- a = p;
- return l
- }
- }
- window.JSON || (window.JSON = {});
- "function" !== typeof String.prototype.toJSON && (String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
- return this.valueOf()
- });
- var e = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, a, g, i = {"\b":"\\b", "\t":"\\t", "\n":"\\n", "\f":"\\f", "\r":"\\r", '"':'\\"', "\\":"\\\\"}, k;
- "function" !== typeof JSON.stringify && (JSON.stringify = function(b, e, f) {
- var h;
- g = a = "";
- if("number" === typeof f) {
- for(h = 0;h < f;h += 1) {
- g += " "
- }
- }else {
- "string" === typeof f && (g = f)
- }
- if((k = e) && "function" !== typeof e && ("object" !== typeof e || "number" !== typeof e.length)) {
- throw Error("JSON.stringify");
- }
- return c("", {"":b})
- });
- "function" !== typeof JSON.parse && (JSON.parse = function(a) {
- return eval("(" + a + ")")
- })
-}();
-SECOND = 1E3;
-function m(b) {
- function c(b) {
- g || (g = 1, clearTimeout(k), a && (a.onerror = a.onload = null, a.abort && a.abort(), a = null), b && v())
- }
- function e() {
- if(!i) {
- i = 1;
- clearTimeout(k);
- try {
- response = JSON.parse(a.responseText)
- }catch(b) {
- return c(1)
- }
- n(response)
- }
- }
- var a, g = 0, i = 0, k = q(function() {
- c(1)
- }, r), v = b.e || function() {
- }, n = b.g || function() {
- };
- try {
- a = "undefined" !== typeof XDomainRequest && new XDomainRequest || new XMLHttpRequest;
- a.onerror = a.onabort = function() {
- c(1)
- };
- a.onload = a.onloadend = e;
- a.timeout = r;
- url = b.url.join(s);
- if(b.data) {
- var f = [];
- url += "?";
- for(key in b.data) {
- f.push(key + "=" + b.data[key])
- }
- url += f.join(t)
- }
- a.open("GET", url, !0);
- a.send()
- }catch(h) {
- return c(0), m(b)
- }
- return c
-}
-var s = "/", t = "&", q = PUBNUB_COMMON_JS.timeout, r = 31E4, u, w = "undefined" != typeof localStorage && localStorage;
-u = {get:function(b) {
- try {
- return w ? w.getItem(b) : -1 == document.cookie.indexOf(b) ? null : ((document.cookie || "").match(RegExp(b + "=([^;]+)")) || [])[1] || null
- }catch(c) {
- }
-}, set:function(b, c) {
- try {
- if(w) {
- return w.setItem(b, c) && 0
- }
- document.cookie = b + "=" + c + "; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"
- }catch(e) {
- }
-}};
-var x = {list:{}, unbind:function(b) {
- x.list[b] = []
-}, bind:function(b, c) {
- (x.list[b] = x.list[b] || []).push(c)
-}, fire:function(b, c) {
- function e(a) {
- a(c)
- }
- var a = x.list[b] || [];
- if(a && e) {
- if("undefined" != typeof a[0]) {
- for(var g = 0, i = a.length;g < i;) {
- e.call(a[g], a[g], g++)
- }
- }else {
- for(g in a) {
- a.hasOwnProperty && a.hasOwnProperty(g) && e.call(a[g], g)
- }
- }
- }
-}};
-function y(b) {
- var c = {xdr:m, db:u, each:PUBNUB_COMMON_JS.c, map:PUBNUB_COMMON_JS.map, events:x, init:y};
- b.db = u;
- b.xdr = m;
- c.__proto__ = PUBNUB_COMMON_JS.b(b);
- c.f();
- return c
-}
-"undefined" !== typeof module && (module.d = PN) || "undefined" !== typeof exports && (exports.a = PN) || (PUBNUB = y({}));
-
-})();
View
BIN  javascript/javascript-modern/3.4/pubnub-3.4.min.js.gz
Binary file not shown
View
3  javascript/javascript-modern/3.4/tests/example.html
@@ -10,8 +10,7 @@
<body><div class=container>
</div>
-<script src=../../../javascript/3.4/pubnub-3.4-common.js></script>
-<script src=../pubnub-3.4.js></script>
+<script src=../../pubnub-3.4.min.js></script>
<script>(function() {
// ----------------------------------------------
// INIT
View
5 javascript/javascript-modern/3.4/tests/mx_example.html
@@ -1,12 +1,11 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-<script src=../../../javascript/3.4/pubnub-3.4-common.js></script>
-<script src=../pubnub-3.4.js></script>
+<script src=../../pubnub-3.4.min.js></script>
<script>
var setup = {"origin":"multiplexing.pubnub.com", "subscribe_key":"demo", "publish_key":"demo"};
- var p = PUBNUB(setup);
+ var p = PUBNUB.init(setup);
// LISTEN
p.subscribe({
Please sign in to comment.
Something went wrong with that request. Please try again.