Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

code reorg for js consolidation

  • Loading branch information...
commit 10d5a43a3a349e81e663601a649a1c05c88714a8 1 parent e5f2375
devendram authored January 22, 2013
2  javascript/javascript-browser/3.4/tests/head-test.htm
@@ -7,7 +7,7 @@
7 7
         href=http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css
8 8
     >
9 9
     <script src=head.load.min.js></script>
10  
-    <script>head.js( '../pubnub-3.4-common.js', '../pubnub-3.4.js', function(){
  10
+    <script>head.js( '../../pubnub-3.4.min.js', function(){
11 11
         // CREATE A PUBNUB OBJECT
12 12
         var pubnub = PUBNUB.init({
13 13
             'publish_key'   : 'demo',
2  javascript/javascript-browser/3.4/tests/mailto-fix.html
@@ -22,7 +22,7 @@
22 22
 <div id=output class=well>0</div>
23 23
 
24 24
 <div id=pubnub pub-key=demo sub-key=demo></div>
25  
-<script src=../pubnub-3.4.js></script>
  25
+<script src=../../pubnub-3.4.min.js></script>
26 26
 <script>(function(){
27 27
 
28 28
 var msgs = 1
3  javascript/javascript-browser/3.4/tests/multiplexing.html
@@ -20,8 +20,7 @@
20 20
 <div id=out>...</div>
21 21
 
22 22
 <div id=pubnub></div>
23  
-<script src=../json.js></script>
24  
-<script src=../pubnub-3.4.js></script>
  23
+<script src=../../pubnub-3.4.min.js></script>
25 24
 <script>(function(){
26 25
 
27 26
 // --------------------------------
2  javascript/javascript-browser/3.4/tests/presence-ssl.html
@@ -24,7 +24,7 @@
24 24
 
25 25
 <!-- PUBNUB AT BOTTOM -->
26 26
 <div id=pubnub ssl=on origin=pubsub.pubnub.com></div>
27  
-<script src=../pubnub-3.4.js></script>
  27
+<script src=../../pubnub-3.4.min.js></script>
28 28
 <script>(function(){
29 29
 
30 30
     var p = PUBNUB.init({
3  javascript/javascript-browser/3.4/tests/publish-test.html
@@ -23,8 +23,7 @@
23 23
 <div id=out>...</div>
24 24
 
25 25
 <div id=pubnub></div>
26  
-<script src=../json.js></script>
27  
-<script src=../pubnub-3.4.min.js></script>
  26
+<script src=../../pubnub-3.4.min.js></script>
28 27
 <script>(function(){
29 28
 
30 29
 // --------------------------------
2  javascript/javascript-browser/3.4/tests/ssl-test.html
@@ -4,7 +4,7 @@
4 4
 <div id="output"></div>
5 5
 
6 6
 <div id=pubnub ssl=on pub-key=demo sub-key=demo></div>
7  
-<script src=../pubnub-3.4.js></script>
  7
+<script src=../../pubnub-3.4.min.js></script>
8 8
 <script>
9 9
     var p       = PUBNUB.init({ 'subscribe_key': 'demo', 'publish_key': 'demo', ssl : true })
10 10
     ,   out     = p.$('output')
4  javascript/javascript-browser/3.4/tests/unit-test.html
@@ -54,8 +54,8 @@
54 54
 
55 55
 <div id=pubnub pub-key=demo sub-key=demo origin=pubsub.pubnub.com></div>
56 56
 <script src=../../pubnub-3.4.min.js></script>
57  
-<script src=../crypto/gibberish-aes.js></script>
58  
-<script src=../crypto/encrypt-pubnub.js></script>
  57
+<script src=../../../crypto/gibberish-aes.js></script>
  58
+<script src=../../../crypto/encrypt-pubnub.js></script>
59 59
 <script src=./pubnub-test.js></script>
60 60
 <script>
61 61
 start_test();
7  javascript/javascript-modern/3.1/pubnub-3.1.min.js
... ...
@@ -1,7 +0,0 @@
1  
-(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)}},
2  
-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":
3  
-"",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;
4  
-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=
5  
-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);
6  
-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]=
7  
-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)})();
BIN  javascript/javascript-modern/3.1/pubnub-3.1.min.js.gz
Binary file not shown
7  javascript/javascript-modern/3.3/pubnub-3.3.min.js
... ...
@@ -1,7 +0,0 @@
1  
-(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)}},
2  
-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":
3  
-"",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;
4  
-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=
5  
-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);
6  
-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]=
7  
-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)})();
BIN  javascript/javascript-modern/3.3/pubnub-3.3.min.js.gz
Binary file not shown
168  javascript/javascript-modern/3.4/pubnub-3.4.min.js
... ...
@@ -1,168 +0,0 @@
1  
-(function(){
2  
-window.JSON && window.JSON.stringify || function() {
3  
-  function b(a) {
4  
-    e.lastIndex = 0;
5  
-    return e.test(a) ? '"' + a.replace(e, function(a) {
6  
-      var b = i[a];
7  
-      return"string" === typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
8  
-    }) + '"' : '"' + a + '"'
9  
-  }
10  
-  function c(e, n) {
11  
-    var f, h, l, i, p = a, j, d = n[e];
12  
-    d && ("object" === typeof d && "function" === typeof d.toJSON) && (d = d.toJSON(e));
13  
-    "function" === typeof k && (d = k.call(n, e, d));
14  
-    switch(typeof d) {
15  
-      case "string":
16  
-        return b(d);
17  
-      case "number":
18  
-        return isFinite(d) ? String(d) : "null";
19  
-      case "boolean":
20  
-      ;
21  
-      case "null":
22  
-        return String(d);
23  
-      case "object":
24  
-        if(!d) {
25  
-          return"null"
26  
-        }
27  
-        a += g;
28  
-        j = [];
29  
-        if("[object Array]" === Object.prototype.toString.apply(d)) {
30  
-          i = d.length;
31  
-          for(f = 0;f < i;f += 1) {
32  
-            j[f] = c(f, d) || "null"
33  
-          }
34  
-          l = 0 === j.length ? "[]" : a ? "[\n" + a + j.join(",\n" + a) + "\n" + p + "]" : "[" + j.join(",") + "]";
35  
-          a = p;
36  
-          return l
37  
-        }
38  
-        if(k && "object" === typeof k) {
39  
-          i = k.length;
40  
-          for(f = 0;f < i;f += 1) {
41  
-            h = k[f], "string" === typeof h && (l = c(h, d)) && j.push(b(h) + (a ? ": " : ":") + l)
42  
-          }
43  
-        }else {
44  
-          for(h in d) {
45  
-            Object.hasOwnProperty.call(d, h) && (l = c(h, d)) && j.push(b(h) + (a ? ": " : ":") + l)
46  
-          }
47  
-        }
48  
-        l = 0 === j.length ? "{}" : a ? "{\n" + a + j.join(",\n" + a) + "\n" + p + "}" : "{" + j.join(",") + "}";
49  
-        a = p;
50  
-        return l
51  
-    }
52  
-  }
53  
-  window.JSON || (window.JSON = {});
54  
-  "function" !== typeof String.prototype.toJSON && (String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
55  
-    return this.valueOf()
56  
-  });
57  
-  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;
58  
-  "function" !== typeof JSON.stringify && (JSON.stringify = function(b, e, f) {
59  
-    var h;
60  
-    g = a = "";
61  
-    if("number" === typeof f) {
62  
-      for(h = 0;h < f;h += 1) {
63  
-        g += " "
64  
-      }
65  
-    }else {
66  
-      "string" === typeof f && (g = f)
67  
-    }
68  
-    if((k = e) && "function" !== typeof e && ("object" !== typeof e || "number" !== typeof e.length)) {
69  
-      throw Error("JSON.stringify");
70  
-    }
71  
-    return c("", {"":b})
72  
-  });
73  
-  "function" !== typeof JSON.parse && (JSON.parse = function(a) {
74  
-    return eval("(" + a + ")")
75  
-  })
76  
-}();
77  
-SECOND = 1E3;
78  
-function m(b) {
79  
-  function c(b) {
80  
-    g || (g = 1, clearTimeout(k), a && (a.onerror = a.onload = null, a.abort && a.abort(), a = null), b && v())
81  
-  }
82  
-  function e() {
83  
-    if(!i) {
84  
-      i = 1;
85  
-      clearTimeout(k);
86  
-      try {
87  
-        response = JSON.parse(a.responseText)
88  
-      }catch(b) {
89  
-        return c(1)
90  
-      }
91  
-      n(response)
92  
-    }
93  
-  }
94  
-  var a, g = 0, i = 0, k = q(function() {
95  
-    c(1)
96  
-  }, r), v = b.e || function() {
97  
-  }, n = b.g || function() {
98  
-  };
99  
-  try {
100  
-    a = "undefined" !== typeof XDomainRequest && new XDomainRequest || new XMLHttpRequest;
101  
-    a.onerror = a.onabort = function() {
102  
-      c(1)
103  
-    };
104  
-    a.onload = a.onloadend = e;
105  
-    a.timeout = r;
106  
-    url = b.url.join(s);
107  
-    if(b.data) {
108  
-      var f = [];
109  
-      url += "?";
110  
-      for(key in b.data) {
111  
-        f.push(key + "=" + b.data[key])
112  
-      }
113  
-      url += f.join(t)
114  
-    }
115  
-    a.open("GET", url, !0);
116  
-    a.send()
117  
-  }catch(h) {
118  
-    return c(0), m(b)
119  
-  }
120  
-  return c
121  
-}
122  
-var s = "/", t = "&", q = PUBNUB_COMMON_JS.timeout, r = 31E4, u, w = "undefined" != typeof localStorage && localStorage;
123  
-u = {get:function(b) {
124  
-  try {
125  
-    return w ? w.getItem(b) : -1 == document.cookie.indexOf(b) ? null : ((document.cookie || "").match(RegExp(b + "=([^;]+)")) || [])[1] || null
126  
-  }catch(c) {
127  
-  }
128  
-}, set:function(b, c) {
129  
-  try {
130  
-    if(w) {
131  
-      return w.setItem(b, c) && 0
132  
-    }
133  
-    document.cookie = b + "=" + c + "; expires=Thu, 1 Aug 2030 20:00:00 UTC; path=/"
134  
-  }catch(e) {
135  
-  }
136  
-}};
137  
-var x = {list:{}, unbind:function(b) {
138  
-  x.list[b] = []
139  
-}, bind:function(b, c) {
140  
-  (x.list[b] = x.list[b] || []).push(c)
141  
-}, fire:function(b, c) {
142  
-  function e(a) {
143  
-    a(c)
144  
-  }
145  
-  var a = x.list[b] || [];
146  
-  if(a && e) {
147  
-    if("undefined" != typeof a[0]) {
148  
-      for(var g = 0, i = a.length;g < i;) {
149  
-        e.call(a[g], a[g], g++)
150  
-      }
151  
-    }else {
152  
-      for(g in a) {
153  
-        a.hasOwnProperty && a.hasOwnProperty(g) && e.call(a[g], g)
154  
-      }
155  
-    }
156  
-  }
157  
-}};
158  
-function y(b) {
159  
-  var c = {xdr:m, db:u, each:PUBNUB_COMMON_JS.c, map:PUBNUB_COMMON_JS.map, events:x, init:y};
160  
-  b.db = u;
161  
-  b.xdr = m;
162  
-  c.__proto__ = PUBNUB_COMMON_JS.b(b);
163  
-  c.f();
164  
-  return c
165  
-}
166  
-"undefined" !== typeof module && (module.d = PN) || "undefined" !== typeof exports && (exports.a = PN) || (PUBNUB = y({}));
167  
-
168  
-})();
BIN  javascript/javascript-modern/3.4/pubnub-3.4.min.js.gz
Binary file not shown
3  javascript/javascript-modern/3.4/tests/example.html
@@ -10,8 +10,7 @@
10 10
 <body><div class=container>
11 11
 
12 12
 </div>
13  
-<script src=../../../javascript/3.4/pubnub-3.4-common.js></script>
14  
-<script src=../pubnub-3.4.js></script>
  13
+<script src=../../pubnub-3.4.min.js></script>
15 14
 <script>(function() {
16 15
     // ----------------------------------------------
17 16
     // INIT
5  javascript/javascript-modern/3.4/tests/mx_example.html
... ...
@@ -1,12 +1,11 @@
1 1
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
2 2
 
3  
-<script src=../../../javascript/3.4/pubnub-3.4-common.js></script>
4  
-<script src=../pubnub-3.4.js></script>
  3
+<script src=../../pubnub-3.4.min.js></script>
5 4
 
6 5
 <script>
7 6
 
8 7
     var setup = {"origin":"multiplexing.pubnub.com", "subscribe_key":"demo", "publish_key":"demo"};
9  
-    var p = PUBNUB(setup);
  8
+    var p = PUBNUB.init(setup);
10 9
 
11 10
     // LISTEN
12 11
     p.subscribe({

0 notes on commit 10d5a43

Please sign in to comment.
Something went wrong with that request. Please try again.