/*! * ASP.NET SignalR JavaScript Library v2.3.0-rtm * http://signalr.net/ * * Copyright (c) .NET Foundation. All rights reserved. * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. * */ /// /// (function ($, window, undefined) { /// "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; } // Use the actual user-provided callback as the "identity" value for the registration. subscriptionMethod.call(hub, memberKey, makeProxyCallback(hub, memberValue), 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['applicationFormHub'] = this.createHubProxy('applicationFormHub'); proxies['applicationFormHub'].client = { }; proxies['applicationFormHub'].server = { applicationFormOnConnectedByDepartmentId: function (lastDepartmentId, currentDepartmentId) { return proxies['applicationFormHub'].invoke.apply(proxies['applicationFormHub'], $.merge(["ApplicationFormOnConnectedByDepartmentId"], $.makeArray(arguments))); } }; proxies['backgroundHub'] = this.createHubProxy('backgroundHub'); proxies['backgroundHub'].client = { }; proxies['backgroundHub'].server = { }; proxies['brokenLinkRepairScheduleHub'] = this.createHubProxy('brokenLinkRepairScheduleHub'); proxies['brokenLinkRepairScheduleHub'].client = { }; proxies['brokenLinkRepairScheduleHub'].server = { brokenLinkRepairScheduleOnConnected: function (siteId, administratorId) { return proxies['brokenLinkRepairScheduleHub'].invoke.apply(proxies['brokenLinkRepairScheduleHub'], $.merge(["BrokenLinkRepairScheduleOnConnected"], $.makeArray(arguments))); } }; proxies['messageManagerHub'] = this.createHubProxy('messageManagerHub'); proxies['messageManagerHub'].client = { }; proxies['messageManagerHub'].server = { messageManagerHubOnConnected: function () { return proxies['messageManagerHub'].invoke.apply(proxies['messageManagerHub'], $.merge(["MessageManagerHubOnConnected"], $.makeArray(arguments))); } }; proxies['mobileUploadHub'] = this.createHubProxy('mobileUploadHub'); proxies['mobileUploadHub'].client = { }; proxies['mobileUploadHub'].server = { }; proxies['myWorkbenchHub'] = this.createHubProxy('myWorkbenchHub'); proxies['myWorkbenchHub'].client = { }; proxies['myWorkbenchHub'].server = { }; proxies['onlineInterviewHub'] = this.createHubProxy('onlineInterviewHub'); proxies['onlineInterviewHub'].client = { }; proxies['onlineInterviewHub'].server = { }; proxies['petitionHub'] = this.createHubProxy('petitionHub'); proxies['petitionHub'].client = { }; proxies['petitionHub'].server = { departmentOnConnected: function (departmentId) { return proxies['petitionHub'].invoke.apply(proxies['petitionHub'], $.merge(["DepartmentOnConnected"], $.makeArray(arguments))); }, petitionLetterOnConnected: function () { return proxies['petitionHub'].invoke.apply(proxies['petitionHub'], $.merge(["PetitionLetterOnConnected"], $.makeArray(arguments))); } }; proxies['pressBriefingHub'] = this.createHubProxy('pressBriefingHub'); proxies['pressBriefingHub'].client = { }; proxies['pressBriefingHub'].server = { }; return proxies; }; signalR.hub = $.hubConnection("/signalr", { useDefaultPath: false }); $.extend(signalR, signalR.hub.createHubProxies()); }(window.jQuery, window));