[Pkg-javascript-commits] [sockjs-client] 257/434: Cosmetic.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit fe049be0e5c3b00b5ef7ca7b64f5d13df356f3b6
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Tue Dec 13 14:27:32 2011 +0000

    Cosmetic.
---
 Makefile        |  1 +
 README.md       | 14 ++++++++++----
 tests/server.js | 31 +++++++++++++++----------------
 3 files changed, 26 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index 5eeab85..6c0d7f7 100644
--- a/Makefile
+++ b/Makefile
@@ -84,6 +84,7 @@ upload: build
 	for f in sock*js; do						\
 		cp $$f ../sockjs-client-gh-pages/`echo $$f|sed 's|\(sockjs\)\(.*[.]js\)|\1-$(VER)\2|g'`; \
 	done
+	echo "Majver=$(MAJVER)"
 	for f in sock*js; do						\
 		cp $$f ../sockjs-client-gh-pages/`echo $$f|sed 's|\(sockjs\)\(.*[.]js\)|\1-$(MAJVER)\2|g'`; \
 	done
diff --git a/README.md b/README.md
index 72f0889..6cead09 100644
--- a/README.md
+++ b/README.md
@@ -231,6 +231,7 @@ server for that. To run it (by default it will be listening on port 8081):
 
     cd sockjs-node
     npm install --dev
+    make build
     make test_server
 
 At this point you're ready to run a SockJS-client server that will
@@ -245,9 +246,14 @@ At that point you should have two web servers running: sockjs-node on
 [http://localhost:8080/](http://localhost:8080/) you should be able
 run the QUnit tests against your sockjs-node server.
 
-If you want to test the sockjs completely you also must change the
-`sockjs_url` that is used by SockJS-node test server. To do that
-edit the `config.js` file:
+If you look at your browser console you will see warnings like that:
+
+    Incompatibile SockJS! Main site uses: "a", the iframe: "b".
+
+This is due to a fact that SockJS-node test server is using compiled
+javascript from CDN, rather than your freshly compiled version. To fix
+that you must amend `sockjs_url` that is used by SockJS-node test
+server. Edit the `config.js` file:
 
     vim sockjs-node/examples/test_server/config.js
 
@@ -255,7 +261,7 @@ And replace `sockjs_url` setting which by default points to CDN:
 
     sockjs_url: 'http://cdn.sockjs.org/sockjs-0.1.min.js',
 
-to a compiled sockjs javascript that you're serving. For example:
+to a freshly compiled sockjs, for example:
 
     sockjs_url: 'http://localhost:8080/lib/sockjs.js',
 
diff --git a/tests/server.js b/tests/server.js
index f5f4a2f..4abc30a 100644
--- a/tests/server.js
+++ b/tests/server.js
@@ -3,27 +3,26 @@ var node_static = require('node-static');
 
 var config = require('./config').config;
 
-
 var static_directory = new node_static.Server(__dirname + '/html');
 
 
 var server = http.createServer();
 server.addListener('request', function(req, res) {
-                       if (/[/]slow-script.js/.test(req.url)) {
-                           res.setHeader('content-type', 'application/javascript');
-                           res.writeHead(200);
-                           setTimeout(function() {
-                               res.end('var a = 1;\n');
-                           }, 500);
-                       } else if (req.url === '/config.js') {
-                           res.setHeader('content-type', 'application/javascript');
-                           res.writeHead(200);
-                           res.end('var client_opts = ' +
-                                   JSON.stringify(config.client_opts) + ';');
-                       } else {
-                           static_directory.serve(req, res);
-                       }
-                   });
+    if ( /\/slow-script.js/.test(req.url) ) {
+        res.setHeader('content-type', 'application/javascript');
+        res.writeHead(200);
+        setTimeout(function() {
+            res.end('var a = 1;\n');
+        }, 500);
+    } else if (req.url === '/config.js') {
+        res.setHeader('content-type', 'application/javascript');
+        res.writeHead(200);
+        res.end('var client_opts = ' +
+                JSON.stringify(config.client_opts) + ';');
+    } else {
+        static_directory.serve(req, res);
+    }
+});
 
 console.log(" [*] Listening on", config.host + ':' + config.port);
 server.listen(config.port, config.host);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list