This repository has been archived by the owner on Aug 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
29,149 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Chatle</title> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | ||
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> | ||
</head> | ||
<body class="chatle" aurelia-app="main"> | ||
<script src="scripts/vendor-bundle.js" data-main="aurelia-bootstrapper"></script> | ||
<script src="scripts/jquery.signalR.min.js"></script> | ||
<script src="scripts/chatle.signalR.js"></script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/*! | ||
* ASP.NET SignalR JavaScript Library v2.2.0-pre | ||
* http://signalr.net/ | ||
* | ||
* Copyright Microsoft Open Technologies, Inc. All rights reserved. | ||
* Licensed under the Apache 2.0 | ||
* https://github.com/SignalR/SignalR/blob/master/LICENSE.md | ||
* | ||
*/ | ||
(function ($, window, undefined) { | ||
/// <param name="$" type="jQuery" /> | ||
"use strict"; | ||
|
||
if (typeof ($.signalR) !== "function") { | ||
throw new Error("SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js."); | ||
} | ||
|
||
var signalR = $.signalR; | ||
|
||
function makeProxyCallback(hub, callback) { | ||
return function () { | ||
// Call the client hub method | ||
callback.apply(hub, $.makeArray(arguments)); | ||
}; | ||
} | ||
|
||
function registerHubProxies(instance, shouldSubscribe) { | ||
var key, hub, memberKey, memberValue, subscriptionMethod; | ||
|
||
for (key in instance) { | ||
if (instance.hasOwnProperty(key)) { | ||
hub = instance[key]; | ||
|
||
if (!(hub.hubName)) { | ||
// Not a client hub | ||
continue; | ||
} | ||
|
||
if (shouldSubscribe) { | ||
// We want to subscribe to the hub events | ||
subscriptionMethod = hub.on; | ||
} else { | ||
// We want to unsubscribe from the hub events | ||
subscriptionMethod = hub.off; | ||
} | ||
|
||
// Loop through all members on the hub and find client hub functions to subscribe/unsubscribe | ||
for (memberKey in hub.client) { | ||
if (hub.client.hasOwnProperty(memberKey)) { | ||
memberValue = hub.client[memberKey]; | ||
|
||
if (!$.isFunction(memberValue)) { | ||
// Not a client hub function | ||
continue; | ||
} | ||
|
||
subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue)); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
$.hubConnection.prototype.createHubProxies = function () { | ||
var proxies = {}; | ||
this.starting(function () { | ||
// Register the hub proxies as subscribed | ||
// (instance, shouldSubscribe) | ||
registerHubProxies(proxies, true); | ||
|
||
this._registerSubscribedHubs(); | ||
}).disconnected(function () { | ||
// Unsubscribe all hub proxies when we "disconnect". This is to ensure that we do not re-add functional call backs. | ||
// (instance, shouldSubscribe) | ||
registerHubProxies(proxies, false); | ||
}); | ||
|
||
proxies['chat'] = this.createHubProxy('chat'); | ||
proxies['chat'].client = { }; | ||
proxies['chat'].server = { | ||
}; | ||
|
||
return proxies; | ||
}; | ||
|
||
signalR.hub = $.hubConnection("http://localhost:5000/signalr", { useDefaultPath: false }); | ||
$.extend(signalR, signalR.hub.createHubProxies()); | ||
|
||
}(window.jQuery, window)); |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.