[Pkg-javascript-commits] [sockjs-client] 24/434: Make sockjs_url configurable.

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:46:59 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 7e3ae3e9d50f1cf353948273b4371eeebd75384a
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Tue Jul 26 16:48:56 2011 +0100

    Make sockjs_url configurable.
---
 config.js.example    | 2 ++
 example-cursors.html | 8 ++------
 tests-qunit.html     | 8 +-------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/config.js.example b/config.js.example
new file mode 100644
index 0000000..0601c1a
--- /dev/null
+++ b/config.js.example
@@ -0,0 +1,2 @@
+// by default just change the port to 9999
+var sockjs_url = document.location.protocol + '//' + document.location.hostname + ':9999';
diff --git a/example-cursors.html b/example-cursors.html
index f25d865..ebab80b 100644
--- a/example-cursors.html
+++ b/example-cursors.html
@@ -9,6 +9,8 @@
   <script type="text/javascript" src="sockjs.js"></script>
   <script type="text/javascript" src="static/jquery.min.js"></script>
 
+  <script type="text/javascript" src="config.js"></script>
+
   <style type="text/css">
       .cursor {
         height: 30px;
@@ -27,12 +29,6 @@
   </code>
 
 <script>
-    // by default just change the port to 9999
-    var sockjs_url = document.location.protocol + '//' + document.location.hostname + ':9999';
-    if (document.location.hostname.indexOf('popcnt') !== -1) {
-        // but if hosted, it's run on port 80, but different domain
-        sockjs_url = "http://sockjs1.popcnt.org";
-    }
     sockjs_url += '/broadcast';
 
     function log(a) {
diff --git a/tests-qunit.html b/tests-qunit.html
index 38a115a..da1e3af 100644
--- a/tests-qunit.html
+++ b/tests-qunit.html
@@ -13,6 +13,7 @@
   <link rel="stylesheet" href="static/qunit.css" type="text/css" media="screen">
   <script type="text/javascript" src="static/qunit.min.js"></script>
 
+  <script type="text/javascript" src="config.js"></script>
   <script type="text/javascript" src="tests/test-factory.js"></script>
   <script type="text/javascript" src="tests/test-run.js"></script>
 </head>
@@ -30,13 +31,6 @@
   </code>
 
 <script>
-    // by default just change the port to 9999
-    var sockjs_url = document.location.protocol + '//' + document.location.hostname + ':9999';
-    if (document.location.hostname.indexOf('popcnt') !== -1) {
-        // but if hosted, it's run on port 80, but different domain
-        sockjs_url = "http://sockjs1.popcnt.org";
-    }
-
     function log(a, e) {
             if ('console' in window && 'log' in window.console) {
                 console.log(a, e);

-- 
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