response/target/classes/public/Scripts/angular-signalr-hub.min.js
2025-06-27 10:04:22 +08:00

1 line
1.5 KiB
JavaScript

angular.module("SignalR",[]).constant("$",window.jQuery).factory("Hub",["$",function(a){function c(b){var c=null;return c=b&&b.rootPath?a.hubConnection(b.rootPath,{useDefaultPath:!1}):a.hubConnection(),c.logging=b&&b.logging?!0:!1,c}function d(a){var d=!(a&&a.useSharedConnection===!1);return d?"undefined"==typeof b[a.rootPath]?b[a.rootPath]=c(a):b[a.rootPath]:c(a)}var b=[];return function(b,c){var e=this;return e.connection=d(c),e.proxy=e.connection.createHubProxy(b),e.on=function(a,b){e.proxy.on(a,b)},e.invoke=function(a,b){return e.proxy.invoke.apply(e.proxy,arguments)},e.disconnect=function(){e.connection.stop()},e.connect=function(a){var b={};return c.transport&&(b.transport=c.transport),c.jsonp&&(b.jsonp=c.jsonp),angular.isDefined(c.withCredentials)&&(b.withCredentials=c.withCredentials),a&&(e.connection.qs=a),e.connection.start(b)},c&&c.listeners&&Object.getOwnPropertyNames(c.listeners).filter(function(a){return"function"==typeof c.listeners[a]}).forEach(function(a){e.on(a,c.listeners[a])}),c&&c.methods&&angular.forEach(c.methods,function(b){e[b]=function(){var c=a.makeArray(arguments);return c.unshift(b),e.invoke.apply(e,c)}}),c&&c.queryParams&&(e.connection.qs=c.queryParams),c&&c.errorHandler&&e.connection.error(c.errorHandler),c&&c.stateChanged&&e.connection.stateChanged(c.stateChanged),(void 0===c.autoConnect||c.autoConnect)&&(e.promise=e.connect()),e}}]),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="SignalR");