yavsc/Yavsc/wwwroot/js/jquery.signalR-2.2.1.min.js

3 lines
36 KiB
JavaScript

8 years ago
!function(e,t,n){function o(t,n){if(e.isArray(t)){for(var o=t.length-1;o>=0;o--){var r=t[o];"string"===e.type(r)&&s.transports[r]||(n.log("Invalid transport: "+r+", removing it from the transports list."),t.splice(o,1))}0===t.length&&(n.log("No transports remain within the specified transport array."),t=null)}else if(s.transports[t]||"auto"===t){if("auto"===t&&s._.ieVersion<=8)return["longPolling"]}else n.log("Invalid transport: "+t.toString()+"."),t=null;return t}function r(e){return"http:"===e?80:"https:"===e?443:void 0}function i(e,t){return t.match(/:\d+$/)?t:t+":"+r(e)}function a(t,n){var o=this,r=[];o.tryBuffer=function(n){return t.state===e.signalR.connectionState.connecting?(r.push(n),!0):!1},o.drain=function(){if(t.state===e.signalR.connectionState.connected)for(;r.length>0;)n(r.shift())},o.clear=function(){r=[]}}var c={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorDuringStartRequest:"Error during start request. Stopping the connection.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."};if("function"!=typeof e)throw new Error(c.nojQuery);var s,l,u="complete"===t.document.readyState,d=e(t),p="__Negotiate Aborted__",g={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},f={processData:!0,timeout:null,async:!0,global:!1,cache:!1},v=function(e,n){if(n!==!1){var o;"undefined"!=typeof t.console&&(o="["+(new Date).toTimeString()+"] SignalR: "+e,t.console.debug?t.console.debug(o):t.console.log&&t.console.log(o))}},m=function(t,n,o){return n===t.state?(t.state=o,e(t).triggerHandler(g.onStateChanged,[{oldState:n,newState:o}]),!0):!1},h=function(e){return e.state===s.connectionState.disconnected},S=function(e){return e._.keepAliveData.activated&&e.transport.supportsKeepAlive(e)},b=function(n){var o,r;n._.configuredStopReconnectingTimeout||(r=function(t){var n=s._.format(s.resources.reconnectTimeout,t.disconnectTimeout);t.log(n),e(t).triggerHandler(g.onError,[s._.error(n,"TimeoutException")]),t.stop(!1,!1)},n.reconnecting(function(){var e=this;e.state===s.connectionState.reconnecting&&(o=t.setTimeout(function(){r(e)},e.disconn
}}}),b&&l===!0&&(g.reconnectTimeoutId=t.setTimeout(function(){v(s)},Math.min(1e3*(Math.pow(2,f)-1),m))))}(n)},250)},lostConnection:function(e){e.pollXhr&&e.pollXhr.abort("lostConnection")},send:function(e,t){c.ajaxSend(e,t)},stop:function(e){t.clearTimeout(e._.pollTimeoutId),t.clearTimeout(e._.reconnectTimeoutId),delete e._.pollTimeoutId,delete e._.reconnectTimeoutId,e.pollXhr&&(e.pollXhr.abort(),e.pollXhr=null,delete e.pollXhr)},abort:function(e,t){c.ajaxAbort(e,t)}}}(window.jQuery,window),function(e,t,n){function o(e){return e+u}function r(e,t,n){var o,r=e.length,i=[];for(o=0;r>o;o+=1)e.hasOwnProperty(o)&&(i[o]=t.call(n,e[o],o,e));return i}function i(t){return e.isFunction(t)?null:"undefined"===e.type(t)?null:t}function a(e){for(var t in e)if(e.hasOwnProperty(t))return!0;return!1}function c(e,t){var n,o=e._.invocationCallbacks;a(o)&&e.log("Clearing hub invocation callbacks with error: "+t+"."),e._.invocationCallbackId=0,delete e._.invocationCallbacks,e._.invocationCallbacks={};for(var r in o)n=o[r],n.method.call(n.scope,{E:t})}function s(e,t){return new s.fn.init(e,t)}function l(t,n){var o={qs:null,logging:!1,useDefaultPath:!0};return e.extend(o,n),(!t||o.useDefaultPath)&&(t=(t||"")+"/signalr"),new l.fn.init(t,o)}var u=".hubProxy",d=e.signalR;s.fn=s.prototype={init:function(e,t){this.state={},this.connection=e,this.hubName=t,this._={callbackMap:{}}},constructor:s,hasSubscriptions:function(){return a(this._.callbackMap)},on:function(t,n){var r=this,i=r._.callbackMap;return t=t.toLowerCase(),i[t]||(i[t]={}),i[t][n]=function(e,t){n.apply(r,t)},e(r).bind(o(t),i[t][n]),r},off:function(t,n){var r,i=this,c=i._.callbackMap;return t=t.toLowerCase(),r=c[t],r&&(r[n]?(e(i).unbind(o(t),r[n]),delete r[n],a(r)||delete c[t]):n||(e(i).unbind(o(t)),delete c[t])),i},invoke:function(t){var n=this,o=n.connection,a=e.makeArray(arguments).slice(1),c=r(a,i),s={H:n.hubName,M:t,A:c,I:o._.invocationCallbackId},l=e.Deferred(),u=function(r){var i,a,c=n._maximizeHubResponse(r);e.extend(n.state,c.State),c.Progress?l.notifyWith?l.notifyWith(n,[c.Progress.Data]):o._.progressjQueryVersionLogged||(o.log("A hub method invocation progress update was received but the version of jQuery in use ("+e.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),o._.progressjQueryVersionLogged=!0):c.Error?(c.StackTrace&&o.log(c.Error+"\n"+c.StackTrace+"."),i=c.IsHubException?"HubException":"Exception",a=d._.error(c.Error,i),a.data=c.ErrorData,o.log(n.hubName+"."+t+" failed to execute. Error: "+a.message),l.rejectWith(n,[a])):(o.log("Invoked "+n.hubName+"."+t),l.resolveWith(n,[c.Result]))};return o._.invocationCallbacks[o._.invocationCallbackId.toString()]={scope:n,method:u},o._.invocationCallbackId+=1,e.isEmptyObject(n.state)||(s.S=n.state),o.log("Invoking "+n.hubName+"."+t),o.send(s),l.promise()},_maximizeHubResponse:function(e){return{State:e.S,Result:e.R,Progress:e.P?{Id:e.P.I,Data:e.P.D}:null,Id:e.I,IsHubException:e.H,Error:e.E,StackTrace:e.T,ErrorData:e.D}}},s.fn.init.prototype=s.fn,l.fn=l.prototype=e.connection(),l.fn.init=function(t,n){var r={qs:null,logging:!1,useDefaultPath:!0},i=this;e.extend(r,n),e.signalR.fn.init.call(i,t,r.qs,r.logging),i.proxies={},i._.invocationCallbackId=0,i._.invocationCallbacks={},i.received(function(t){var n,r,a,c,s,l;t&&("undefined"!=typeof t.P?(a=t.P.I.toString(),c=i._.invocationCallbacks[a],c&&c.method.call(c.scope,t)):"undefined"!=typeof t.I?(a=t.I.toString(),c=i._.invocationCallbacks[a],c&&(i._.invocationCallbacks[a]=null,delete i._.invocationCallbacks[a],c.method.call(c.scope,t))):(n=this._maximizeClientHubInvocation(t),i.log("Triggering client hub event '"+n.Method+"' on hub '"+n.Hub+"'."),s=n.Hub.toLowerCase(),l=n.Method.toLowerCase(),r=this.proxies[s],e.extend(r.state,n.State),e(r).triggerHandler(o(l),[n.Args])))}),i.error(function(e,t){var n,o;t&&(n=t.I,o=i._.invocationCallbacks[n],o&&(i._.invocationCallbacks[n]=null,delete i._.invocationCallbacks[n],o.method.call(o.scope,{E:e})))}),i.reconnecting(function(){i.transport&&"webSockets"===i.transport.name&&c(i,"Conn