Permalink
Browse files

code reorg for js consolidation

  • Loading branch information...
1 parent e5f2375 commit 10d5a43a3a349e81e663601a649a1c05c88714a8 @devendram devendram committed Jan 22, 2013
@@ -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',
@@ -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
@@ -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(){
// --------------------------------
@@ -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({
@@ -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(){
// --------------------------------
@@ -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')
@@ -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();

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Binary file not shown.
@@ -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({}));
-
-})();
Binary file not shown.
@@ -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
@@ -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({

0 comments on commit 10d5a43

Please sign in to comment.