Permalink
Browse files

Merge branch 'live_console'

  • Loading branch information...
2 parents 6a50fc4 + 8a9cf32 commit 2eeab0f9386928fe70d9643c99b3cccf6524ca4d @matthewfl committed Aug 6, 2011
Showing with 4,874 additions and 11 deletions.
  1. +11 −1 Bespin/control.js
  2. +2 −0 config.sample.js
  3. +6 −7 devel/HostRedirProxy.py
  4. +39 −0 lib/format.js
  5. +49 −0 lib/socket.io/History.md
  6. +19 −0 lib/socket.io/Makefile
  7. +343 −0 lib/socket.io/Readme.md
  8. +8 −0 lib/socket.io/index.js
  9. +96 −0 lib/socket.io/lib/logger.js
  10. +961 −0 lib/socket.io/lib/manager.js
  11. +348 −0 lib/socket.io/lib/namespace.js
  12. +243 −0 lib/socket.io/lib/parser.js
  13. +125 −0 lib/socket.io/lib/socket.io.js
  14. +366 −0 lib/socket.io/lib/socket.js
  15. +98 −0 lib/socket.io/lib/store.js
  16. +143 −0 lib/socket.io/lib/stores/memory.js
  17. +248 −0 lib/socket.io/lib/stores/redis.js
  18. +533 −0 lib/socket.io/lib/transport.js
  19. +102 −0 lib/socket.io/lib/transports/flashsocket.js
  20. +82 −0 lib/socket.io/lib/transports/htmlfile.js
  21. +135 −0 lib/socket.io/lib/transports/http-polling.js
  22. +111 −0 lib/socket.io/lib/transports/http.js
  23. +12 −0 lib/socket.io/lib/transports/index.js
  24. +77 −0 lib/socket.io/lib/transports/jsonp-polling.js
  25. +350 −0 lib/socket.io/lib/transports/websocket.js
  26. +72 −0 lib/socket.io/lib/transports/xhr-polling.js
  27. +25 −0 lib/socket.io/lib/util.js
  28. +22 −0 lib/socket.io/new-old/app.js
  29. +34 −0 lib/socket.io/new-old/index.jade
  30. +42 −0 lib/socket.io/new-old/layout.jade
  31. +9 −0 lib/socket.io/new-old/package.json
  32. +22 −0 lib/socket.io/new-old/public/js/main.js
  33. +28 −0 lib/socket.io/package.json
  34. +1 −1 production.js
  35. +10 −1 sandbox/index.js
  36. +42 −0 static/live_console.html
  37. +60 −1 test.js
View
@@ -324,16 +324,26 @@ exports.saveCommand = function (args, request) {
fileList.push(loadFile);
};
+var console_win;
+
exports.testCommand = function (args, request) {
// this seems to work with better with popup blockers
- var win = window.open("");
+ var win = window.open("",""); // we want to get a new window that will grab the focus
+ if(typeof console_win == "undefined" || console_win.closed)
+ console_win = window.open("http://console.test.jsapp.us:7654", "CONSOLE", "status=0,toolbar=0,location=0,menubar=0,directories=0,width=275,height=500,scrollbars=1");
Ajax.Call({
"action": "test",
"code": env.editor.value,
"randToken": randomToken,
"fileName": loadFile
}, function (p) {
win.location.href=p;
+ win.focus();
+ try {
+ setTimeout(function () {
+ console_win.location.hash=p;
+ }, 500);
+ }catch(e) {}
});
Ajax.send();
track("test");
View
@@ -17,6 +17,8 @@ exports.testHost="node_test_host_id";
exports.testSKey="sampleKey"; // https://www.random.org/passwords/?num=1&len=24&format=plain&rnd=new
exports.testTimeToLive=15*60*1000; // in ms
//exports.testDoNotOverwrite=true; // should be true in production
+exports.testConsole=7654;
+
exports.errorPage="http://jsapp.us/error";
View
@@ -31,14 +31,13 @@ def handle(self):
self.__base_handle()
def _connect_to(self, netloc, soc):
- if netloc.find("jsapp.us") != -1 or netloc.find("google-analytics.com") != -1 or netloc.find(".matthewfl.com") != -1:
- host_port = "localhost", 80
+ i = netloc.find(':')
+ if i >= 0:
+ host_port = netloc[:i], int(netloc[i+1:])
else:
- i = netloc.find(':')
- if i >= 0:
- host_port = netloc[:i], int(netloc[i+1:])
- else:
- host_port = netloc, 80
+ host_port = netloc, 80
+ if netloc.find("jsapp.us") != -1 or netloc.find("google-analytics.com") != -1 or netloc.find(".matthewfl.com") != -1:
+ host_port = "localhost", host_port[1]
print "\t" "connect to %s:%d" % host_port
try: soc.connect(host_port)
except socket.error, arg:
View
@@ -0,0 +1,39 @@
+// copied from the node console.js file
+
+// console object
+var formatRegExp = /%[sdj]/g;
+function format(f) {
+ var util = require('util');
+
+ if (typeof f !== 'string') {
+ var objects = [];
+ for (var i = 0; i < arguments.length; i++) {
+ objects.push(util.inspect(arguments[i]));
+ }
+ return objects.join(' ');
+ }
+
+
+ var i = 1;
+ var args = arguments;
+ var str = String(f).replace(formatRegExp, function(x) {
+ switch (x) {
+ case '%s': return String(args[i++]);
+ case '%d': return Number(args[i++]);
+ case '%j': return JSON.stringify(args[i++]);
+ default:
+ return x;
+ }
+ });
+ for (var len = args.length, x = args[i]; i < len; x = args[++i]) {
+ if (x === null || typeof x !== 'object') {
+ str += ' ' + x;
+ } else {
+ str += ' ' + util.inspect(x);
+ }
+ }
+ return str;
+}
+
+
+exports.format = format;
View
@@ -0,0 +1,49 @@
+
+0.7.6 / 2011-06-30
+==================
+
+ * Fixed general dispatching when a client has closed.
+
+0.7.5 / 2011-06-30
+==================
+
+ * Fixed dispatching to clients that are disconnected.
+
+0.7.4 / 2011-06-30
+==================
+
+ * Fixed; only clear handlers if they were set. [level09]
+
+0.7.3 / 2011-06-30
+==================
+
+ * Exposed handshake data to clients.
+ * Refactored dispatcher interface.
+ * Changed; Moved id generation method into the manager.
+ * Added sub-namespace authorization. [3rd-Eden]
+ * Changed; normalized SocketNamespace local eventing [dvv]
+ * Changed; Use packet.reason or default to 'packet' [3rd-Eden]
+ * Changed console.error to console.log.
+ * Fixed; bind both servers at the same time do that the test never times out.
+ * Added 304 support.
+ * Removed `Transport#name` for abstract interface.
+ * Changed; lazily require http and https module only when needed. [3rd-Eden]
+
+0.7.2 / 2011-06-22
+==================
+
+ * Make sure to write a packet (of type `noop`) when closing a poll.
+ This solves a problem with cross-domain requests being flagged as aborted and
+ reconnection being triggered.
+ * Added `noop` message type.
+
+0.7.1 / 2011-06-21
+==================
+
+ * Fixed cross-domain XHR.
+ * Added CORS test to xhr-polling suite.
+
+0.7.0 / 2010-06-21
+==================
+
+ * http://socket.io/announcement.html
View
@@ -0,0 +1,19 @@
+
+ALL_TESTS = $(shell find test/ -name '*.test.js')
+
+run-tests:
+ @npm link > /dev/null --local
+ @./node_modules/.bin/expresso \
+ -I support \
+ -I lib \
+ --serial \
+ $(TESTFLAGS) \
+ $(TESTS)
+
+test:
+ @$(MAKE) TESTS="$(ALL_TESTS)" run-tests
+
+test-cov:
+ @TESTFLAGS=--cov $(MAKE) test
+
+.PHONY: test
Oops, something went wrong.

0 comments on commit 2eeab0f

Please sign in to comment.