1/*! 2 * ASP.NET SignalR JavaScript Library v2.3.0-rtm 3 * http://signalr.net/ 4 * 5 * Copyright (c) .NET Foundation. All rights reserved. 6 * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 7 * 8 */ 9 10/// <reference path="..\..\SignalR.Client.JS\Scripts\jquery-1.6.4.js" /> 11/// <reference path="jquery.signalR.js" /> 12(function ($, window, undefined) { 13 /// <param name="$" type="jQuery" /> 14 "use strict"; 15 16 if (typeof ($.signalR) !== "function") { 17 throw new Error("SignalR: SignalR is not loaded. Please ensure jquery.signalR-x.js is referenced before ~/signalr/js."); 18 } 19 20 var signalR = $.signalR; 21 22 function makeProxyCallback(hub, callback) { 23 return function () { 24 // Call the client hub method 25 callback.apply(hub, $.makeArray(arguments)); 26 }; 27 } 28 29 function registerHubProxies(instance, shouldSubscribe) { 30 var key, hub, memberKey, memberValue, subscriptionMethod; 31 32 for (key in instance) { 33 if (instance.hasOwnProperty(key)) { 34 hub = instance[key]; 35 36 if (!(hub.hubName)) { 37 // Not a client hub 38 continue; 39 } 40 41 if (shouldSubscribe) { 42 // We want to subscribe to the hub events 43 subscriptionMethod = hub.on; 44 } else { 45 // We want to unsubscribe from the hub events 46 subscriptionMethod = hub.off; 47 } 48 49 // Loop through all members on the hub and find client hub functions to subscribe/unsubscribe 50 for (memberKey in hub.client) { 51 if (hub.client.hasOwnProperty(memberKey)) { 52 memberValue = hub.client[memberKey]; 53 54 if (!$.isFunction(memberValue)) { 55 // Not a client hub function 56 continue; 57 } 58 59 // Use the actual user-provided callback as the "identity" value for the registration. 60 subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue), memberValue); 61 } 62 } 63 } 64 } 65 } 66 67 $.hubConnection.prototype.createHubProxies = function () { 68 var proxies = {}; 69 this.starting(function () { 70 // Register the hub proxies as subscribed 71 // (instance, shouldSubscribe) 72 registerHubProxies(proxies, true); 73 74 this._registerSubscribedHubs(); 75 }).disconnected(function () { 76 // Unsubscribe all hub proxies when we "disconnect". This is to ensure that we do not re-add functional call backs. 77 // (instance, shouldSubscribe) 78 registerHubProxies(proxies, false); 79 }); 80 81 proxies['egh'] = this.createHubProxy('egh'); 82 proxies['egh'].client = { }; 83 proxies['egh'].server = { 84 }; 85 86 proxies['eh'] = this.createHubProxy('eh'); 87 proxies['eh'].client = { }; 88 proxies['eh'].server = { 89 }; 90 91 proxies['nh'] = this.createHubProxy('nh'); 92 proxies['nh'].client = { }; 93 proxies['nh'].server = { 94 }; 95 96 proxies['ph'] = this.createHubProxy('ph'); 97 proxies['ph'].client = { }; 98 proxies['ph'].server = { 99 }; 100 101 proxies['rh'] = this.createHubProxy('rh'); 102 proxies['rh'].client = { }; 103 proxies['rh'].server = { 104 trackSpectator: function () { 105 return proxies['rh'].invoke.apply(proxies['rh'], $.merge(["TrackSpectator"], $.makeArray(arguments))); 106 }, 107 108 trackUser: function () { 109 return proxies['rh'].invoke.apply(proxies['rh'], $.merge(["TrackUser"], $.makeArray(arguments))); 110 } 111 }; 112 113 proxies['rih'] = this.createHubProxy('rih'); 114 proxies['rih'].client = { }; 115 proxies['rih'].server = { 116 }; 117 118 proxies['sh'] = this.createHubProxy('sh'); 119 proxies['sh'].client = { }; 120 proxies['sh'].server = { 121 }; 122 123 proxies['uh'] = this.createHubProxy('uh'); 124 proxies['uh'].client = { }; 125 proxies['uh'].server = { 126 }; 127 128 return proxies; 129 }; 130 131 signalR.hub = $.hubConnection("/signalr", { useDefaultPath: fal
131se }); 132 $.extend(signalR, signalR.hub.createHubProxies()); 133 134}(window.jQuery, window));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.