[Pkg-javascript-commits] [sockjs-client] 22/434: Add a landing page.
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 ae8ffcce2b7105baec85a4c8d6ae2667779f0256
Author: Marek Majkowski <majek04 at gmail.com>
Date: Tue Jul 26 14:42:39 2011 +0100
Add a landing page.
---
index.html | 38 +++++---------------------------------
index.html => tests-qunit.html | 8 +++++++-
tests-src/test-factory.coffee | 12 ++++++------
3 files changed, 18 insertions(+), 40 deletions(-)
diff --git a/index.html b/index.html
index c48aa0d..f6dd088 100644
--- a/index.html
+++ b/index.html
@@ -6,40 +6,12 @@
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" />
- <script type="text/javascript" src="sockjs.js"></script>
-
- <script type="text/javascript" src="static/jquery.min.js"></script>
-
- <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="tests/test-factory.js"></script>
- <script type="text/javascript" src="tests/test-run.js"></script>
</head>
<body>
- <p>
- <h1 id="qunit-header">SockJS Test Suite</h1>
- <h2 id="qunit-banner"></h2>
- <div id="qunit-testrunner-toolbar"></div>
- <h2 id="qunit-userAgent"></h2>
- <ol id="qunit-tests"></ol>
- <div id="qunit-fixture">test markup</div>
- </p>
- <br>
- <code id="logs" style="height:200px; overflow:auto; display: block; border: 1px grey solid;">
- </code>
-
-<script>
- var test_server_url = document.location.protocol + '//' + document.location.hostname + ':9999';
- function log(a, e) {
- if ('console' in window && 'log' in window.console) {
- console.log(a, e);
- }
- $('#logs').append($("<code>").text(a));
- $('#logs').append($("<pre>").text(JSON.stringify(e, null, 4)));
- $('#logs').append($("<br>"));
- $('#logs').scrollTop($('#logs').scrollTop()+10000);
- }
-</script>
+ <h1>SockJS</h1>
+ <ul>
+ <li><a href="tests-qunit.html">QUnit tests</a></li>
+ <li><a href="example-cursors.html">Cursors example</a></li>
+ </ul>
</body>
</html>
diff --git a/index.html b/tests-qunit.html
similarity index 82%
copy from index.html
copy to tests-qunit.html
index c48aa0d..38a115a 100644
--- a/index.html
+++ b/tests-qunit.html
@@ -30,7 +30,13 @@
</code>
<script>
- var test_server_url = document.location.protocol + '//' + document.location.hostname + ':9999';
+ // 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);
diff --git a/tests-src/test-factory.coffee b/tests-src/test-factory.coffee
index 52e69f2..0aafc2b 100644
--- a/tests-src/test-factory.coffee
+++ b/tests-src/test-factory.coffee
@@ -2,7 +2,7 @@ echo_factory_factory = (protocol, messages) ->
return ->
expect(3 + messages.length)
a = messages.slice(0)
- r = new SockJS(test_server_url + '/echo', [protocol])
+ r = new SockJS(sockjs_url + '/echo', [protocol])
ok(r)
r.onopen = (e) ->
ok(true)
@@ -80,7 +80,7 @@ factor_echo_large_message = (protocol) ->
batch_factory_factory = (protocol, messages) ->
return ->
expect(3 + messages.length)
- r = new SockJS(test_server_url + '/echo', [protocol])
+ r = new SockJS(sockjs_url + '/echo', [protocol])
ok(r)
counter = 0
r.onopen = (e) ->
@@ -113,7 +113,7 @@ factor_batch_large = (protocol) ->
factor_user_close = (protocol) ->
return ->
expect(4)
- r = new SockJS(test_server_url + '/echo', [protocol])
+ r = new SockJS(sockjs_url + '/echo', [protocol])
ok(r)
r.onopen = (e) ->
ok(true)
@@ -126,7 +126,7 @@ factor_user_close = (protocol) ->
factor_server_close = (protocol) ->
return ->
expect(3)
- r = new SockJS(test_server_url + '/close', [protocol])
+ r = new SockJS(sockjs_url + '/close', [protocol])
ok(r)
r.onopen = (e) ->
ok(true)
@@ -137,7 +137,7 @@ factor_server_close = (protocol) ->
test_invalid_url_404 = (protocol) ->
return ->
expect(2)
- r = new SockJS(test_server_url + '/invalid_url', [protocol])
+ r = new SockJS(sockjs_url + '/invalid_url', [protocol])
ok(r)
r.onopen = (e) ->
fail(true)
@@ -148,7 +148,7 @@ test_invalid_url_404 = (protocol) ->
test_invalid_url_500 = (protocol) ->
return ->
expect(2)
- r = new SockJS(test_server_url + '/500_error', [protocol])
+ r = new SockJS(sockjs_url + '/500_error', [protocol])
ok(r)
r.onopen = (e) ->
fail(true)
--
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