Moved source code under src folder - massive change

This commit is contained in:
Mark McDowall
2013-10-02 18:01:32 -07:00
parent 2fc8123d6b
commit 5bf0e197ec
1499 changed files with 1054 additions and 1444 deletions

View File

@@ -0,0 +1,51 @@
'use strict';
define(
[
'app',
'signalR'
], function () {
return {
appInitializer: function () {
console.log('starting signalR');
var getStatus = function (status) {
switch (status) {
case 0:
return 'connecting';
case 1:
return 'connected';
case 2:
return 'reconnecting';
case 4:
return 'disconnected';
default:
throw 'invalid status ' + status;
}
};
this.signalRconnection = $.connection('/signalr');
this.signalRconnection.stateChanged(function (change) {
console.debug('SignalR: [{0}]'.format(getStatus(change.newState)));
});
this.signalRconnection.received(function (message) {
require(
[
'app'
], function (app) {
app.vent.trigger('server:' + message.name, message.body);
});
});
this.signalRconnection.start({ transport:
[
'longPolling'
] });
return this;
}
};
});