/*! * ASP.NET SignalR JavaScript Library 2.4.3 * 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['icpOperationHub'] = this.createHubProxy('icpOperationHub'); proxies['icpOperationHub'].client = { }; proxies['icpOperationHub'].server = { batchDelete: function (ids, userName) { return proxies['icpOperationHub'].invoke.apply(proxies['icpOperationHub'], $.merge(["BatchDelete"], $.makeArray(arguments))); }, batchWriteOffAccesses: function (ids, userName) { return proxies['icpOperationHub'].invoke.apply(proxies['icpOperationHub'], $.merge(["BatchWriteOffAccesses"], $.makeArray(arguments))); }, generatePromise: function (websiteIds, userName) { return proxies['icpOperationHub'].invoke.apply(proxies['icpOperationHub'], $.merge(["GeneratePromise"], $.makeArray(arguments))); }, generateRealVerification: function (generateType, attachmentIds, userName) { return proxies['icpOperationHub'].invoke.apply(proxies['icpOperationHub'], $.merge(["GenerateRealVerification"], $.makeArray(arguments))); } }; proxies['loginInfoCheckHub'] = this.createHubProxy('loginInfoCheckHub'); proxies['loginInfoCheckHub'].client = { }; proxies['loginInfoCheckHub'].server = { logOff: function (userName) { return proxies['loginInfoCheckHub'].invoke.apply(proxies['loginInfoCheckHub'], $.merge(["LogOff"], $.makeArray(arguments))); } }; proxies['notificationsHub'] = this.createHubProxy('notificationsHub'); proxies['notificationsHub'].client = { }; proxies['notificationsHub'].server = { batchSaveIcpUploadTasks: function (identity, ids, verifyOpinion, verificationMethod, remark, isUser, userName) { return proxies['notificationsHub'].invoke.apply(proxies['notificationsHub'], $.merge(["BatchSaveIcpUploadTasks"], $.makeArray(arguments))); }, batchVerifyFailedTasks: function (ids, userName) { return proxies['notificationsHub'].invoke.apply(proxies['notificationsHub'], $.merge(["BatchVerifyFailedTasks"], $.makeArray(arguments))); } }; proxies['uploadAttachmentsHub'] = this.createHubProxy('uploadAttachmentsHub'); proxies['uploadAttachmentsHub'].client = { }; proxies['uploadAttachmentsHub'].server = { batchDeleteAttachments: function (attachmentIds, userName) { return proxies['uploadAttachmentsHub'].invoke.apply(proxies['uploadAttachmentsHub'], $.merge(["BatchDeleteAttachments"], $.makeArray(arguments))); }, batchOverWrite: function (fileName, attachmentIds, userName) { return proxies['uploadAttachmentsHub'].invoke.apply(proxies['uploadAttachmentsHub'], $.merge(["BatchOverWrite"], $.makeArray(arguments))); }, generateIcpVerifyingRecord: function (ispSerailNumber) { return proxies['uploadAttachmentsHub'].invoke.apply(proxies['uploadAttachmentsHub'], $.merge(["GenerateIcpVerifyingRecord"], $.makeArray(arguments))); }, syncAttachments: function (recordId, websiteIds, attachmentIds, icpOperationType, userName, userId) { return proxies['uploadAttachmentsHub'].invoke.apply(proxies['uploadAttachmentsHub'], $.merge(["SyncAttachments"], $.makeArray(arguments))); }, upload: function (fileName, websiteIds, operationType, purpose, recordId, webOfficerName, webOfficerLicenseType, webOfficerLicenseNumber, userId, userName, obtainSource) { return proxies['uploadAttachmentsHub'].invoke.apply(proxies['uploadAttachmentsHub'], $.merge(["Upload"], $.makeArray(arguments))); } }; proxies['userNotificationsHub'] = this.createHubProxy('userNotificationsHub'); proxies['userNotificationsHub'].client = { }; proxies['userNotificationsHub'].server = { batchCancel: function (ids) { return proxies['userNotificationsHub'].invoke.apply(proxies['userNotificationsHub'], $.merge(["BatchCancel"], $.makeArray(arguments))); }, batchSubmitIcpUploadTasks: function (ids) { return proxies['userNotificationsHub'].invoke.apply(proxies['userNotificationsHub'], $.merge(["BatchSubmitIcpUploadTasks"], $.makeArray(arguments))); } }; proxies['userUploadAttachmentsHub'] = this.createHubProxy('userUploadAttachmentsHub'); proxies['userUploadAttachmentsHub'].client = { }; proxies['userUploadAttachmentsHub'].server = { batchDeleteAttachments: function (attachmentIds, userName) { return proxies['userUploadAttachmentsHub'].invoke.apply(proxies['userUploadAttachmentsHub'], $.merge(["BatchDeleteAttachments"], $.makeArray(arguments))); }, batchOverWrite: function (fileName, attachmentIds, userName) { return proxies['userUploadAttachmentsHub'].invoke.apply(proxies['userUploadAttachmentsHub'], $.merge(["BatchOverWrite"], $.makeArray(arguments))); }, generateIcpVerifyingRecord: function (ispSerailNumber) { return proxies['userUploadAttachmentsHub'].invoke.apply(proxies['userUploadAttachmentsHub'], $.merge(["GenerateIcpVerifyingRecord"], $.makeArray(arguments))); }, syncAttachments: function (recordId, websiteIds, attachmentIds, icpOperationType, userName, userId) { return proxies['userUploadAttachmentsHub'].invoke.apply(proxies['userUploadAttachmentsHub'], $.merge(["SyncAttachments"], $.makeArray(arguments))); }, upload: function (fileName, websiteIds, operationType, purpose, recordId, webOfficerName, webOfficerLicenseType, webOfficerLicenseNumber, userId, userName, obtainSource) { return proxies['userUploadAttachmentsHub'].invoke.apply(proxies['userUploadAttachmentsHub'], $.merge(["Upload"], $.makeArray(arguments))); } }; return proxies; }; signalR.hub = $.hubConnection("/signalr", { useDefaultPath: false }); $.extend(signalR, signalR.hub.createHubProxies()); }(window.jQuery, window));