Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated javascript file

  • Loading branch information...
commit f9bb455e07abe74ae0ac8e7a1715cee74a546d06 1 parent cd69ec6
@davidfowl davidfowl authored
View
2  samples/Microsoft.AspNet.SignalR.Samples/Scripts/jquery.signalR.min.js
@@ -7,4 +7,4 @@
* https://github.com/SignalR/SignalR/blob/master/LICENSE.md
*
*/
-(function(n,t){"use strict";function a(t,r){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(t)==="object"||n.type(f)==="string"&&i.transports[f]||(r.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(r.log("No transports remain within the specified transport array."),t=null)}else if(n.type(t)==="object"||i.transports[t]||t==="auto"){if(t==="auto"&&i._.ieVersion<=8)return["longPolling"]}else r.log("Invalid transport: "+t.toString()),t=null;return t}function c(n){return n==="http:"?80:n==="https:"?443:void 0}function s(n,t){return t.match(/:\d+$/)?t:t+":"+c(n)}function l(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1},u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())},u.clear=function(){r=[]}}if(typeof n!="function")throw new Error("SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.");var i,h,e=t.document.readyState==="complete",u=n(t),o="__Negotiate Aborted__",r={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},v=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},f=function(t,i,u){return i===t.state?(t.state=u,n(t).triggerHandler(r.onStateChanged,[{oldState:i,newState:u}]),!0):!1},y=function(n){return n.state===i.connectionState.disconnected},p=function(n){var u,r;n._.configuredStopReconnectingTimeout||(r=function(n){n.log("Couldn't reconnect within the configured timeout ("+n.disconnectTimeout+"ms), disconnecting."),n.stop(!1,!1)},n.reconnecting(function(){var n=this;n.state===i.connectionState.reconnecting&&(u=t.setTimeout(function(){r(n)},n.disconnectTimeout))}),n.stateChanged(function(n){n.oldState===i.connectionState.reconnecting&&t.clearTimeout(u)}),n._.configuredStopReconnectingTimeout=!0)};i=function(n,t,r){return new i.fn.init(n,t,r)},i._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}()},i.events=r,i.changeState=f,i.isDisconnecting=y,i.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},i.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");}},u.load(function(){e=!0}),i.fn=i.prototype={init:function(t,i,u){var f=n(this);this.url=t,this.qs=i,this._={connectingMessageBuffer:new l(this,function(n){f.triggerHandler(r.onReceived,[n])}),onFailedTimeoutHandle:null},typeof u=="boolean"&&(this.logging=u)},_parseResponse:function(n){var t=this;return n?t.ajaxDataType==="text"?t.json.parse(n):n:n},json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=r||t.location,u=t.document.createElement("a"),u.href=i,u.protocol+s(u.protocol,u.host)!==r.protocol+s(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:i.connectionState.disconnected,keepAliveData:{},clientProtocol:"1.3",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,keepAliveWarnAt:2/3,start:function(s,h){var c=this,l={waitForPageLoad:!0,transport:"auto",jsonp:!1},b,v=c._deferral||n.Deferred(),y=t.document.createElement("a"),w;if(c._deferral=v,!c.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(s)==="function"?h=s:n.type(s)==="object"&&(n.extend(l,s),n.type(l.callback)==="function"&&(h=l.callback)),l.transport=a(l.transport,c),!l.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(c._.config=l,!e&&l.waitForPageLoad===!0)?(u.load(function(){c.start(s,h)}),v.promise()):(p(c),c.state===i.connectionState.connecting)?v.promise():f(c,i.connectionState.disconnected,i.connectionState.connecting)===!1?(v.resolve(c),v.promise()):(y.href=c.url,y.protocol&&y.protocol!==":"?(c.protocol=y.protocol,c.host=y.host,c.baseUrl=y.protocol+"//"+y.host):(c.protocol=t.document.location.protocol,c.host=t.document.location.host,c.baseUrl=c.protocol+"//"+c.host),c.wsProtocol=c.protocol==="https:"?"wss://":"ws://",l.transport==="auto"&&l.jsonp===!0&&(l.transport="longPolling"),this.isCrossDomain(c.url)&&(c.log("Auto detected cross domain url."),l.transport==="auto"&&(l.transport=["webSockets","longPolling"]),l.jsonp||(l.jsonp=!n.support.cors,l.jsonp&&c.log("Using jsonp because this browser doesn't support CORS")),c.contentType=i._.defaultContentType),c.ajaxDataType=l.jsonp?"jsonp":"text",n(c).bind(r.onStart,function(){n.type(h)==="function"&&h.call(c),v.resolve(c)}),b=function(e,o){if(o=o||0,o>=e.length){n(c).triggerHandler(r.onError,["SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."]),v.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."),c.stop();return}if(c.state!==i.connectionState.disconnected){var l=e[o],s=n.type(l)==="object"?l:i.transports[l],h=!1,a=function(){h||(h=!0,t.clearTimeout(c._.onFailedTimeoutHandle),s.stop(c),b(e,o+1))};if(c.transport=s,l.indexOf("_")===0){b(e,o+1);return}try{c._.onFailedTimeoutHandle=t.setTimeout(function(){c.log(s.name+" timed out when trying to connect."),a()},c.transportConnectTimeout),s.start(c,function(){c.state!==i.connectionState.disconnected&&(h||(h=!0,t.clearTimeout(c._.onFailedTimeoutHandle),s.supportsKeepAlive&&c.keepAliveData.activated&&i.transports._logic.monitorKeepAlive(c),f(c,i.connectionState.connecting,i.connectionState.connected),c._.connectingMessageBuffer.drain(),n(c).triggerHandler(r.onStart),u.unload(function(){c.stop(!1)})))},a)}catch(y){c.log("SignalR: "+s.name+" transport threw '"+y.message+"' when attempting to start."),a()}}},w=c.url+"/negotiate",w=i.transports._logic.addQs(w,c.qs),w=i.transports._logic.addQs(w,{clientProtocol:c.clientProtocol}),c.log("Negotiating with '"+w+"'."),c._.negotiateRequest=n.ajax({url:w,global:!1,cache:!1,type:"GET",contentType:c.contentType,data:{},dataType:c.ajaxDataType,error:function(t,i){i!==o&&(n(c).triggerHandler(r.onError,[t.responseText]),v.reject("SignalR: Error during negotiation request: "+t.responseText),c.stop())},success:function(t){var u=c._parseResponse(t),f=c.keepAliveData,o,e;if(c.appRelativeUrl=u.Url,c.id=u.ConnectionId,c.token=u.ConnectionToken,c.webSocketServerUrl=u.WebSocketServerUrl,c.disconnectTimeout=u.DisconnectTimeout*1e3,c.transportConnectTimeout=c.transportConnectTimeout+u.TransportConnectTimeout*1e3,u.KeepAliveTimeout?(f.activated=!0,f.timeout=u.KeepAliveTimeout*1e3,f.timeoutWarning=f.timeout*c.keepAliveWarnAt,f.checkInterval=(f.timeout-f.timeoutWarning)/3):f.activated=!1,!u.ProtocolVersion||u.ProtocolVersion!==c.clientProtocol){n(c).triggerHandler(r.onError,["You are using a version of the client that isn't compatible with the server. Client version "+c.clientProtocol+", server version "+u.ProtocolVersion+"."]),v.reject("You are using a version of the client that isn't compatible with the server. Client version "+c.clientProtocol+", server version "+u.ProtocolVersion+".");return}n(c).triggerHandler(r.onStarting),o=[],e=[],n.each(i.transports,function(n){if(n==="webSockets"&&!u.TryWebSockets)return!0;e.push(n)}),n.isArray(l.transport)?n.each(l.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,e)>=0)&&o.push(n.type(t)==="string"?""+t:t)}):n.type(l.transport)==="object"||n.inArray(l.transport,e)>=0?o.push(l.transport):o=e,b(o)}}),v.promise())},starting:function(t){var i=this;return n(i).bind(r.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===i.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===i.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){i._.connectingMessageBuffer.tryBuffer(r)||t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(r.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(r.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(s,h){var c=this;if(!e&&(!c._.config||c._.config.waitForPageLoad===!0)){u.load(function(){c.stop(s,h)});return}if(c.state!==i.connectionState.disconnected){try{c.log("SignalR: Stopping connection."),t.clearTimeout(c._.onFailedTimeoutHandle),c.transport&&(h!==!1&&c.transport.abort(c,s),c.transport.supportsKeepAlive&&c.keepAliveData.activated&&i.transports._logic.stopMonitoringKeepAlive(c),c.transport.stop(c),c.transport=null),c._.negotiateRequest&&(c._.negotiateRequest.abort(o),delete c._.negotiateRequest),n(c).triggerHandler(r.onDisconnect),delete c.messageId,delete c.groupsToken,delete c.id,delete c._deferral,delete c._.config,c._.connectingMessageBuffer.clear()}finally{f(c,c.state,i.connectionState.disconnected)}return c}},log:function(n){v(n,this.logging)}},i.fn.init.prototype=i.fn,i.noConflict=function(){return n.connection===i&&(n.connection=h),i},n.connection&&(h=n.connection),n.connection=n.signalR=i})(window.jQuery,window),function(n,t){"use strict";function f(u){var e=u.keepAliveData,o,s;u.state===i.connectionState.connected&&(o=new Date,o.setTime(o-e.lastKeepAlive),s=o.getTime(),s>=e.timeout?(u.log("Keep alive timed out. Notifying transport that connection has been lost."),u.transport.lostConnection(u)):s>=e.timeoutWarning?e.userNotified||(u.log("Keep alive has been missed, connection may be dead/slow."),n(u).triggerHandler(r.onConnectionSlow),e.userNotified=!0):e.userNotified=!1),e.monitoring&&t.setTimeout(function(){f(u)},e.checkInterval)}function e(n){return n.state===i.connectionState.connected||n.state===i.connectionState.reconnecting}var i=n.signalR,r=n.signalR.events,o=n.signalR.changeState,u;i.transports={},u=i.transports._logic={pingServer:function(t,i){var f=i==="webSockets"?"":t.baseUrl,u=f+t.appRelativeUrl+"/ping",r=n.Deferred();return u=this.addQs(u,t.qs),n.ajax({url:u,global:!1,cache:!1,type:"GET",contentType:t.contentType,data:{},dataType:t.ajaxDataType,success:function(n){var i=t._parseResponse(n);i.Response==="pong"?r.resolve():r.reject("SignalR: Invalid ping response when pinging server: "+(i.responseText||i.statusText))},error:function(n){r.reject("SignalR: Error pinging server: "+(n.responseText||n.statusText))}}),r.promise()},addQs:function(t,i){var u=t.indexOf("?")!==-1?"&":"?",r;if(!i)return t;if(typeof i=="object")return t+u+n.param(i);if(typeof i=="string")return r=i.charAt(0),(r==="?"||r==="&")&&(u=""),t+u+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f){var s=i==="webSockets"?"":n.baseUrl,e=s+n.appRelativeUrl,o="transport="+i+"&connectionToken="+t.encodeURIComponent(n.token);return n.data&&(o+="&connectionData="+t.encodeURIComponent(n.data)),n.groupsToken&&(o+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(e+=f?"/poll":"/reconnect",n.messageId&&(o+="&messageId="+t.encodeURIComponent(n.messageId))):e+="/connect",e+="?"+o,e=u.addQs(e,n.qs),e+="&tid="+Math.floor(Math.random()*11)},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,Disconnect:typeof n.D!="undefined"?!0:!1,TimedOut:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},ajaxSend:function(u,f){var e=u.url+"/send?transport="+u.transport.name+"&connectionToken="+t.encodeURIComponent(u.token);return e=this.addQs(e,u.qs),n.ajax({url:e,global:!1,type:u.ajaxDataType==="jsonp"?"GET":"POST",contentType:i._.defaultContentType,dataType:u.ajaxDataType,data:{data:f},success:function(t){t&&n(u).triggerHandler(r.onReceived,[u._parseResponse(t)])},error:function(t,i){i!=="abort"&&i!=="parsererror"&&n(u).triggerHandler(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionToken="+t.encodeURIComponent(i.token);u=this.addQs(u,i.qs),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",contentType:i.contentType,dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},tryInitialize:function(n,t){n.Initialized&&t()},processMessages:function(t,i,f){var e,o=n(t);if(t.transport&&t.transport.supportsKeepAlive&&t.keepAliveData.activated&&this.updateKeepAlive(t),i){if(e=this.maximizePersistentResponse(i),e.Disconnect){t.log("Disconnect command received from server"),t.stop(!1,!1);return}this.updateGroups(t,e.GroupsToken),e.MessageId&&(t.messageId=e.MessageId),e.Messages&&(n.each(e.Messages,function(n,t){o.triggerHandler(r.onReceived,[t])}),u.tryInitialize(e,f))}},monitorKeepAlive:function(t){var i=t.keepAliveData,u=this;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored"):(i.monitoring=!0,u.updateKeepAlive(t),t.keepAliveData.reconnectKeepAliveUpdate=function(){u.updateKeepAlive(t)},n(t).bind(r.onReconnect,t.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+" and a connection lost timeout of "+i.timeout),f(t))},stopMonitoringKeepAlive:function(t){var i=t.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(r.onReconnect,t.keepAliveData.reconnectKeepAliveUpdate),t.keepAliveData={},t.log("Stopping the monitoring of the keep alive"))},updateKeepAlive:function(n){n.keepAliveData.lastKeepAlive=new Date},ensureReconnectingState:function(t){return o(t,i.connectionState.connected,i.connectionState.reconnecting)===!0&&n(t).triggerHandler(r.onReconnecting),t.state===i.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},reconnect:function(n,r){var u=i.transports[r],f=this;e(n)&&!n._.reconnectTimeout&&(n._.reconnectTimeout=t.setTimeout(function(){u.stop(n),f.ensureReconnectingState(n)&&(n.log(r+" reconnecting"),u.start(n))},n.reconnectDelay))},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:!0,send:function(n,t){n.socket.send(t)},start:function(e,o,s){var h,a=!1,l=this,c=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,c),e.log("Connecting to websocket endpoint '"+h+"'"),e.socket=new t.WebSocket(h),e.socket.onopen=function(){a=!0,e.log("Websocket opened"),i.clearReconnectTimeout(e),f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){if(this===e.socket){if(a)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).triggerHandler(u.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s?s():c&&l.reconnect(e);return}l.reconnect(e)}},e.socket.onmessage=function(t){var r=e._parseResponse(t.data),f=n(e);r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):f.triggerHandler(u.onReceived,[r]))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n),n.socket&&(n.log("Closing the Websocket"),n.socket.close(),n.socket=null)},abort:function(){}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:!0,timeOut:3e3,start:function(e,o,s){var c=this,h=!1,v=n(e),y=!o,l,a;if(e.eventSource&&(e.log("The connection already has an event source. Stopping it."),e.stop()),!t.EventSource){s&&(e.log("This browser doesn't support SSE."),s());return}l=i.getUrl(e,this.name,y);try{e.log("Attempting to connect to SSE endpoint '"+l+"'"),e.eventSource=new t.EventSource(l)}catch(p){e.log("EventSource failed trying to connect with error "+p.Message),s?s():(v.triggerHandler(u.onError,[p]),y&&c.reconnect(e));return}y&&(a=t.setTimeout(function(){h===!1&&e.eventSource.readyState!==t.EventSource.CONNECTING&&e.eventSource.readyState!==t.EventSource.OPEN&&c.reconnect(e)},c.timeOut)),e.eventSource.addEventListener("open",function(){e.log("EventSource connected"),a&&t.clearTimeout(a),i.clearReconnectTimeout(e),h===!1&&(h=!0,f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect))},!1),e.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&i.processMessages(e,e._parseResponse(n.data),o)},!1),e.eventSource.addEventListener("error",function(n){if(this===e.eventSource){if(!h){s&&s();return}e.log("EventSource readyState: "+e.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(e.log("EventSource reconnecting due to the server connection ending"),c.reconnect(e)):(e.log("EventSource error"),v.triggerHandler(u.onError))}},!1)},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){i.clearReconnectTimeout(n),n&&n.eventSource&&(n.log("EventSource calling close()"),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,f=n.signalR.events,e=n.signalR.changeState,i=r.transports._logic,u=function(){var u=null,f=1e3,i=0;return{prevent:function(){r._.ieVersion<=8&&(i===0&&(u=t.setInterval(function(){var t=n("<iframe style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;' src=''></iframe>");n("body").append(t),t.remove(),t=null},f)),i++)},cancel:function(){i===1&&t.clearInterval(u),i>0&&i--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:!0,start:function(r,f,e){var c=this,h=i.foreverFrame.count+=1,s,o=n("<iframe data-signalr-connection-id='"+r.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;' src=''></iframe>");if(t.EventSource){e&&(r.log("This browser supports SSE, skipping Forever Frame."),e());return}u.prevent(),s=i.getUrl(r,this.name),s+="&frameId="+h,n("body").append(o),o.prop("src",s),i.foreverFrame.connections[h]=r,r.log("Binding to iframe's readystatechange event."),o.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(r.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),c.reconnect(r))}),r.frame=o[0],r.frameId=h,f&&(r.onSuccess=function(){f(),delete r.onSuccess})},reconnect:function(n){var r=this;t.setTimeout(function(){if(n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'."),u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,r){var u;i.processMessages(t,r,t.onSuccess),t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>50&&(t.frameMessageCount=0,u=t.frame.contentWindow||t.frame.contentDocument,u&&u.document&&n("body",u.document).empty())},stop:function(t){var r=null;if(u.cancel(),t.frame){if(t.frame.stop)t.frame.stop();else try{r=t.frame.contentWindow||t.frame.contentDocument,r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(f){t.log("SignalR: Error occured when stopping foreverFrame transport. Message = "+f.message)}n(t.frame).remove(),delete i.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,delete t.onSuccess,t.log("Stopping forever frame")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){e(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(f.onReconnect)}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,f=n.signalR.events,e=n.signalR.changeState,u=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:"longPolling",supportsKeepAlive:!1,reconnectDelay:3e3,start:function(o,s,h){var v=this,y=function(){y=n.noop,s(),h=null,o.log("LongPolling connected")},w=function(){return h?(h(),h=null,o.log("LongPolling failed to connect."),!0):!1},l=0,c=null,a=function(i){t.clearTimeout(c),c=null,e(o,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(o.log("Raising the reconnect event"),n(i).triggerHandler(f.onReconnect))},p=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function e(s,h){var nt=s.messageId,d=nt===null,b=!d,g=!h,k=i.getUrl(s,v.name,b,g);u(s)!==!0&&(o.log("Attempting to connect to '"+k+"' using longPolling."),s.pollXhr=n.ajax({url:k,global:!1,cache:!1,type:"GET",dataType:o.ajaxDataType,contentType:o.contentType,success:function(r){var h=o._parseResponse(r),v=0,f;(l=0,c!==null&&a(),h&&(f=i.maximizePersistentResponse(h)),i.processMessages(s,h,y),f&&n.type(f.LongPollDelay)==="number"&&(v=f.LongPollDelay),f&&f.Disconnect)||u(s)!==!0&&(v>0?t.setTimeout(function(){e(s,!1)},v):e(s,!1))},error:function(u,h){if(t.clearTimeout(c),c=null,h==="abort"){o.log("Aborted xhr requst.");return}w()||(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+". "+u.responseText),n(s).triggerHandler(f.onError,[u.responseText])),i.ensureReconnectingState(s),t.setTimeout(function(){e(s,!0)},v.reconnectDelay))}}),b&&h===!0&&(c=t.setTimeout(function(){a(s)},Math.min(1e3*(Math.pow(2,l)-1),p))))})(o)},250)},lostConnection:function(){throw new Error("Lost Connection not handled for LongPolling");},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){"use strict";function u(n){return n+h}function s(n,t,i){for(var f=n.length,u=[],r=0;r<f;r+=1)n.hasOwnProperty(r)&&(u[r]=t.call(i,n[r],r,n));return u}function c(t){return n.isFunction(t)?null:n.type(t)==="undefined"?null:t}function o(n){for(var t in n)if(n.hasOwnProperty(t))return!0;return!1}function r(n,t){return new r.fn.init(n,t)}function i(t,r){var u={qs:null,logging:!1,useDefaultPath:!0};return n.extend(u,r),(!t||u.useDefaultPath)&&(t=(t||"")+"/signalr"),new i.fn.init(t,u)}var e=0,f={},h=".hubProxy";r.fn=r.prototype={init:function(n,t){this.state={},this.connection=n,this.hubName=t,this._={callbackMap:{}}},hasSubscriptions:function(){return o(this._.callbackMap)},on:function(t,i){var f=this,r=f._.callbackMap;return t=t.toLowerCase(),r[t]||(r[t]={}),r[t][i]=function(n,t){i.apply(f,t)},n(f).bind(u(t),r[t][i]),f},off:function(t,i){var f=this,e=f._.callbackMap,r;return t=t.toLowerCase(),r=e[t],r&&(r[i]?(n(f).unbind(u(t),r[i]),delete r[i],o(r)||delete e[t]):i||(n(f).unbind(u(t)),delete e[t])),f},invoke:function(t){var i=this,h=n.makeArray(arguments).slice(1),l=s(h,c),u={H:i.hubName,M:t,A:l,I:e},r=n.Deferred(),o=function(t){var u=i._maximizeHubResponse(t);n.extend(i.state,u.State),u.Error?(u.StackTrace&&i.connection.log(u.Error+"\n"+u.StackTrace),r.rejectWith(i,[u.Error])):r.resolveWith(i,[u.Result])};return f[e.toString()]={scope:i,method:o},e+=1,n.isEmptyObject(i.state)||(u.S=i.state),i.connection.send(i.connection.json.stringify(u)),r.promise()},_maximizeHubResponse:function(n){return{State:n.S,Result:n.R,Id:n.I,Error:n.E,StackTrace:n.T}}},r.fn.init.prototype=r.fn,i.fn=i.prototype=n.connection(),i.fn.init=function(t,i){var e={qs:null,logging:!1,useDefaultPath:!0},r=this;n.extend(e,i),n.signalR.fn.init.call(r,t,e.qs,e.logging),r.proxies={},r.received(function(t){var i,s,o,e,c,h;t&&(typeof t.I!="undefined"?(o=t.I.toString(),e=f[o],e&&(f[o]=null,delete f[o],e.method.call(e.scope,t))):(i=this._maximizeClientHubInvocation(t),r.log("Triggering client hub event '"+i.Method+"' on hub '"+i.Hub+"'."),c=i.Hub.toLowerCase(),h=i.Method.toLowerCase(),s=this.proxies[c],n.extend(s.state,i.State),n(s).triggerHandler(u(h),[i.Args])))})},i.fn._maximizeClientHubInvocation=function(n){return{Hub:n.H,Method:n.M,Args:n.A,State:n.S}},i.fn._registerSubscribedHubs=function(){var t=this;t._subscribedToHubs||(t._subscribedToHubs=!0,t.starting(function(){var i=[];n.each(t.proxies,function(n){this.hasSubscriptions()&&i.push({name:n})}),t.data=t.json.stringify(i)}))},i.fn.createHubProxy=function(n){n=n.toLowerCase();var t=this.proxies[n];return t||(t=r(this,n),this.proxies[n]=t),this._registerSubscribedHubs(),t},i.fn.init.prototype=i.fn,n.hubConnection=i}(window.jQuery,window),function(n){n.signalR.version="2.0.0-beta2"}(window.jQuery)
+(function(n,t){"use strict";function v(t,r){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(t)==="object"||n.type(f)==="string"&&i.transports[f]||(r.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(r.log("No transports remain within the specified transport array."),t=null)}else if(n.type(t)==="object"||i.transports[t]||t==="auto"){if(t==="auto"&&i._.ieVersion<=8)return["longPolling"]}else r.log("Invalid transport: "+t.toString()),t=null;return t}function y(n){return n==="http:"?80:n==="https:"?443:void 0}function h(n,t){return t.match(/:\d+$/)?t:t+":"+y(n)}function p(t,i){var u=this,r=[];u.tryBuffer=function(i){return t.state===n.signalR.connectionState.connecting?(r.push(i),!0):!1},u.drain=function(){if(t.state===n.signalR.connectionState.connected)while(r.length>0)i(r.shift())},u.clear=function(){r=[]}}if(typeof n!="function")throw new Error("SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.");var i,o,e=t.document.readyState==="complete",u=n(t),s="__Negotiate Aborted__",r={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},c=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},f=function(t,i,u){return i===t.state?(t.state=u,n(t).triggerHandler(r.onStateChanged,[{oldState:i,newState:u}]),!0):!1},l=function(n){return n.state===i.connectionState.disconnected},a=function(n){var r,u;n._.configuredStopReconnectingTimeout||(u=function(n){n.log("Couldn't reconnect within the configured timeout ("+n.disconnectTimeout+"ms), disconnecting."),n.stop(!1,!1)},n.reconnecting(function(){var n=this;n.state===i.connectionState.reconnecting&&(r=t.setTimeout(function(){u(n)},n.disconnectTimeout))}),n.stateChanged(function(n){n.oldState===i.connectionState.reconnecting&&t.clearTimeout(r)}),n._.configuredStopReconnectingTimeout=!0)};i=function(n,t,r){return new i.fn.init(n,t,r)},i._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var i,n;return t.navigator.appName==="Microsoft Internet Explorer"&&(n=/MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent),n&&(i=t.parseFloat(n[1]))),i}()},i.events=r,i.changeState=f,i.isDisconnecting=l,i.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},i.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");}},u.load(function(){e=!0}),i.fn=i.prototype={init:function(t,i,u){var f=n(this);this.url=t,this.qs=i,this._={connectingMessageBuffer:new p(this,function(n){f.triggerHandler(r.onReceived,[n])}),onFailedTimeoutHandle:null},typeof u=="boolean"&&(this.logging=u)},_parseResponse:function(n){var t=this;return n?t.ajaxDataType==="text"?t.json.parse(n):n:n},json:t.JSON,isCrossDomain:function(i,r){var u;return(i=n.trim(i),i.indexOf("http")!==0)?!1:(r=r||t.location,u=t.document.createElement("a"),u.href=i,u.protocol+h(u.protocol,u.host)!==r.protocol+h(r.protocol,r.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:i.connectionState.disconnected,keepAliveData:{},clientProtocol:"1.3",reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,keepAliveWarnAt:2/3,start:function(o,h){var c=this,l={waitForPageLoad:!0,transport:"auto",jsonp:!1},b,y=c._deferral||n.Deferred(),p=t.document.createElement("a"),w;if(c._deferral=y,!c.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(n.type(o)==="function"?h=o:n.type(o)==="object"&&(n.extend(l,o),n.type(l.callback)==="function"&&(h=l.callback)),l.transport=v(l.transport,c),!l.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");return(c._.config=l,!e&&l.waitForPageLoad===!0)?(u.load(function(){c.start(o,h)}),y.promise()):(a(c),c.state===i.connectionState.connecting)?y.promise():f(c,i.connectionState.disconnected,i.connectionState.connecting)===!1?(y.resolve(c),y.promise()):(p.href=c.url,p.protocol&&p.protocol!==":"?(c.protocol=p.protocol,c.host=p.host,c.baseUrl=p.protocol+"//"+p.host):(c.protocol=t.document.location.protocol,c.host=t.document.location.host,c.baseUrl=c.protocol+"//"+c.host),c.wsProtocol=c.protocol==="https:"?"wss://":"ws://",l.transport==="auto"&&l.jsonp===!0&&(l.transport="longPolling"),this.isCrossDomain(c.url)&&(c.log("Auto detected cross domain url."),l.transport==="auto"&&(l.transport=["webSockets","longPolling"]),l.jsonp||(l.jsonp=!n.support.cors,l.jsonp&&c.log("Using jsonp because this browser doesn't support CORS")),c.contentType=i._.defaultContentType),c.ajaxDataType=l.jsonp?"jsonp":"text",n(c).bind(r.onStart,function(){n.type(h)==="function"&&h.call(c),y.resolve(c)}),b=function(e,o){if(o=o||0,o>=e.length){n(c).triggerHandler(r.onError,["SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."]),y.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."),c.stop();return}if(c.state!==i.connectionState.disconnected){var h=e[o],s=n.type(h)==="object"?h:i.transports[h],l=!1,a=function(){l||(l=!0,t.clearTimeout(c._.onFailedTimeoutHandle),s.stop(c),b(e,o+1))};if(c.transport=s,h.indexOf("_")===0){b(e,o+1);return}try{c._.onFailedTimeoutHandle=t.setTimeout(function(){c.log(s.name+" timed out when trying to connect."),a()},c.transportConnectTimeout),s.start(c,function(){c.state!==i.connectionState.disconnected&&(l||(l=!0,t.clearTimeout(c._.onFailedTimeoutHandle),s.supportsKeepAlive&&c.keepAliveData.activated&&i.transports._logic.monitorKeepAlive(c),f(c,i.connectionState.connecting,i.connectionState.connected),c._.connectingMessageBuffer.drain(),n(c).triggerHandler(r.onStart),u.unload(function(){c.stop(!1)})))},a)}catch(v){c.log("SignalR: "+s.name+" transport threw '"+v.message+"' when attempting to start."),a()}}},w=c.url+"/negotiate",w=i.transports._logic.addQs(w,c.qs),w=i.transports._logic.addQs(w,{clientProtocol:c.clientProtocol}),c.log("Negotiating with '"+w+"'."),c._.negotiateRequest=n.ajax({url:w,global:!1,cache:!1,type:"GET",contentType:c.contentType,data:{},dataType:c.ajaxDataType,error:function(t,i){i!==s&&(n(c).triggerHandler(r.onError,[t.responseText]),y.reject("SignalR: Error during negotiation request: "+t.responseText),c.stop())},success:function(t){var u=c._parseResponse(t),f=c.keepAliveData,e,o;if(c.appRelativeUrl=u.Url,c.id=u.ConnectionId,c.token=u.ConnectionToken,c.webSocketServerUrl=u.WebSocketServerUrl,c.disconnectTimeout=u.DisconnectTimeout*1e3,c.transportConnectTimeout=c.transportConnectTimeout+u.TransportConnectTimeout*1e3,u.KeepAliveTimeout?(f.activated=!0,f.timeout=u.KeepAliveTimeout*1e3,f.timeoutWarning=f.timeout*c.keepAliveWarnAt,f.checkInterval=(f.timeout-f.timeoutWarning)/3):f.activated=!1,!u.ProtocolVersion||u.ProtocolVersion!==c.clientProtocol){n(c).triggerHandler(r.onError,["You are using a version of the client that isn't compatible with the server. Client version "+c.clientProtocol+", server version "+u.ProtocolVersion+"."]),y.reject("You are using a version of the client that isn't compatible with the server. Client version "+c.clientProtocol+", server version "+u.ProtocolVersion+".");return}n(c).triggerHandler(r.onStarting),e=[],o=[],n.each(i.transports,function(n){if(n==="webSockets"&&!u.TryWebSockets)return!0;o.push(n)}),n.isArray(l.transport)?n.each(l.transport,function(){var t=this;(n.type(t)==="object"||n.type(t)==="string"&&n.inArray(""+t,o)>=0)&&e.push(n.type(t)==="string"?""+t:t)}):n.type(l.transport)==="object"||n.inArray(l.transport,o)>=0?e.push(l.transport):e=o,b(e)}}),y.promise())},starting:function(t){var i=this;return n(i).bind(r.onStarting,function(){t.call(i)}),i},send:function(n){var t=this;if(t.state===i.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(t.state===i.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return t.transport.send(t,n),t},received:function(t){var i=this;return n(i).bind(r.onReceived,function(n,r){i._.connectingMessageBuffer.tryBuffer(r)||t.call(i,r)}),i},stateChanged:function(t){var i=this;return n(i).bind(r.onStateChanged,function(n,r){t.call(i,r)}),i},error:function(t){var i=this;return n(i).bind(r.onError,function(n,r){t.call(i,r)}),i},disconnected:function(t){var i=this;return n(i).bind(r.onDisconnect,function(){t.call(i)}),i},connectionSlow:function(t){var i=this;return n(i).bind(r.onConnectionSlow,function(){t.call(i)}),i},reconnecting:function(t){var i=this;return n(i).bind(r.onReconnecting,function(){t.call(i)}),i},reconnected:function(t){var i=this;return n(i).bind(r.onReconnect,function(){t.call(i)}),i},stop:function(o,h){var c=this;if(!e&&(!c._.config||c._.config.waitForPageLoad===!0)){u.load(function(){c.stop(o,h)});return}if(c.state!==i.connectionState.disconnected){try{c.log("SignalR: Stopping connection."),t.clearTimeout(c._.onFailedTimeoutHandle),c.transport&&(h!==!1&&c.transport.abort(c,o),c.transport.supportsKeepAlive&&c.keepAliveData.activated&&i.transports._logic.stopMonitoringKeepAlive(c),c.transport.stop(c),c.transport=null),c._.negotiateRequest&&(c._.negotiateRequest.abort(s),delete c._.negotiateRequest),n(c).triggerHandler(r.onDisconnect),delete c.messageId,delete c.groupsToken,delete c.id,delete c._deferral,delete c._.config,c._.connectingMessageBuffer.clear()}finally{f(c,c.state,i.connectionState.disconnected)}return c}},log:function(n){c(n,this.logging)}},i.fn.init.prototype=i.fn,i.noConflict=function(){return n.connection===i&&(n.connection=o),i},n.connection&&(o=n.connection),n.connection=n.signalR=i})(window.jQuery,window),function(n,t){"use strict";function f(u){var e=u.keepAliveData,o,s;u.state===i.connectionState.connected&&(o=new Date,o.setTime(o-e.lastKeepAlive),s=o.getTime(),s>=e.timeout?(u.log("Keep alive timed out. Notifying transport that connection has been lost."),u.transport.lostConnection(u)):s>=e.timeoutWarning?e.userNotified||(u.log("Keep alive has been missed, connection may be dead/slow."),n(u).triggerHandler(r.onConnectionSlow),e.userNotified=!0):e.userNotified=!1),e.monitoring&&t.setTimeout(function(){f(u)},e.checkInterval)}function o(n){return n.state===i.connectionState.connected||n.state===i.connectionState.reconnecting}var i=n.signalR,r=n.signalR.events,e=n.signalR.changeState,u;i.transports={},u=i.transports._logic={pingServer:function(t,i){var f=i==="webSockets"?"":t.baseUrl,u=f+t.appRelativeUrl+"/ping",r=n.Deferred();return u=this.addQs(u,t.qs),n.ajax({url:u,global:!1,cache:!1,type:"GET",contentType:t.contentType,data:{},dataType:t.ajaxDataType,success:function(n){var i=t._parseResponse(n);i.Response==="pong"?r.resolve():r.reject("SignalR: Invalid ping response when pinging server: "+(i.responseText||i.statusText))},error:function(n){r.reject("SignalR: Error pinging server: "+(n.responseText||n.statusText))}}),r.promise()},addQs:function(t,i){var r=t.indexOf("?")!==-1?"&":"?",u;if(!i)return t;if(typeof i=="object")return t+r+n.param(i);if(typeof i=="string")return u=i.charAt(0),(u==="?"||u==="&")&&(r=""),t+r+i;throw new Error("Query string property must be either a string or object.");},getUrl:function(n,i,r,f){var s=i==="webSockets"?"":n.baseUrl,e=s+n.appRelativeUrl,o="transport="+i+"&connectionToken="+t.encodeURIComponent(n.token);return n.data&&(o+="&connectionData="+t.encodeURIComponent(n.data)),n.groupsToken&&(o+="&groupsToken="+t.encodeURIComponent(n.groupsToken)),r?(e+=f?"/poll":"/reconnect",n.messageId&&(o+="&messageId="+t.encodeURIComponent(n.messageId))):e+="/connect",e+="?"+o,e=u.addQs(e,n.qs),e+="&tid="+Math.floor(Math.random()*11)},maximizePersistentResponse:function(n){return{MessageId:n.C,Messages:n.M,Initialized:typeof n.S!="undefined"?!0:!1,Disconnect:typeof n.D!="undefined"?!0:!1,TimedOut:typeof n.T!="undefined"?!0:!1,LongPollDelay:n.L,GroupsToken:n.G}},updateGroups:function(n,t){t&&(n.groupsToken=t)},ajaxSend:function(u,f){var e=u.url+"/send?transport="+u.transport.name+"&connectionToken="+t.encodeURIComponent(u.token);return e=this.addQs(e,u.qs),n.ajax({url:e,global:!1,type:u.ajaxDataType==="jsonp"?"GET":"POST",contentType:i._.defaultContentType,dataType:u.ajaxDataType,data:{data:f},success:function(t){t&&n(u).triggerHandler(r.onReceived,[u._parseResponse(t)])},error:function(t,i){i!=="abort"&&i!=="parsererror"&&n(u).triggerHandler(r.onError,[t])}})},ajaxAbort:function(i,r){if(typeof i.transport!="undefined"){r=typeof r=="undefined"?!0:r;var u=i.url+"/abort?transport="+i.transport.name+"&connectionToken="+t.encodeURIComponent(i.token);u=this.addQs(u,i.qs),n.ajax({url:u,async:r,timeout:1e3,global:!1,type:"POST",contentType:i.contentType,dataType:i.ajaxDataType,data:{}}),i.log("Fired ajax abort async = "+r)}},tryInitialize:function(n,t){n.Initialized&&t()},processMessages:function(t,i,f){var e,o=n(t);if(t.transport&&t.transport.supportsKeepAlive&&t.keepAliveData.activated&&this.updateKeepAlive(t),i){if(e=this.maximizePersistentResponse(i),e.Disconnect){t.log("Disconnect command received from server"),t.stop(!1,!1);return}this.updateGroups(t,e.GroupsToken),e.MessageId&&(t.messageId=e.MessageId),e.Messages&&(n.each(e.Messages,function(n,t){o.triggerHandler(r.onReceived,[t])}),u.tryInitialize(e,f))}},monitorKeepAlive:function(t){var i=t.keepAliveData,u=this;i.monitoring?t.log("Tried to monitor keep alive but it's already being monitored"):(i.monitoring=!0,u.updateKeepAlive(t),t.keepAliveData.reconnectKeepAliveUpdate=function(){u.updateKeepAlive(t)},n(t).bind(r.onReconnect,t.keepAliveData.reconnectKeepAliveUpdate),t.log("Now monitoring keep alive with a warning timeout of "+i.timeoutWarning+" and a connection lost timeout of "+i.timeout),f(t))},stopMonitoringKeepAlive:function(t){var i=t.keepAliveData;i.monitoring&&(i.monitoring=!1,n(t).unbind(r.onReconnect,t.keepAliveData.reconnectKeepAliveUpdate),t.keepAliveData={},t.log("Stopping the monitoring of the keep alive"))},updateKeepAlive:function(n){n.keepAliveData.lastKeepAlive=new Date},ensureReconnectingState:function(t){return e(t,i.connectionState.connected,i.connectionState.reconnecting)===!0&&n(t).triggerHandler(r.onReconnecting),t.state===i.connectionState.reconnecting},clearReconnectTimeout:function(n){n&&n._.reconnectTimeout&&(t.clearTimeout(n._.reconnectTimeout),delete n._.reconnectTimeout)},reconnect:function(n,r){var u=i.transports[r],f=this;o(n)&&!n._.reconnectTimeout&&(n._.reconnectTimeout=t.setTimeout(function(){u.stop(n),f.ensureReconnectingState(n)&&(n.log(r+" reconnecting"),u.start(n))},n.reconnectDelay))},foreverFrame:{count:0,connections:{}}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.webSockets={name:"webSockets",supportsKeepAlive:!0,send:function(n,t){n.socket.send(t)},start:function(e,o,s){var h,c=!1,l=this,a=!o,v=n(e);if(!t.WebSocket){s();return}e.socket||(h=e.webSocketServerUrl?e.webSocketServerUrl:e.wsProtocol+e.host,h+=i.getUrl(e,this.name,a),e.log("Connecting to websocket endpoint '"+h+"'"),e.socket=new t.WebSocket(h),e.socket.onopen=function(){c=!0,e.log("Websocket opened"),i.clearReconnectTimeout(e),f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&v.triggerHandler(u.onReconnect)},e.socket.onclose=function(t){if(this===e.socket){if(c)typeof t.wasClean!="undefined"&&t.wasClean===!1?(n(e).triggerHandler(u.onError,[t.reason]),e.log("Unclean disconnect from websocket."+t.reason)):e.log("Websocket closed");else{s?s():a&&l.reconnect(e);return}l.reconnect(e)}},e.socket.onmessage=function(t){var r=e._parseResponse(t.data),f=n(e);r&&(n.isEmptyObject(r)||r.M?i.processMessages(e,r,o):f.triggerHandler(u.onReceived,[r]))})},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},stop:function(n){i.clearReconnectTimeout(n),n.socket&&(n.log("Closing the Websocket"),n.socket.close(),n.socket=null)},abort:function(){}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,u=n.signalR.events,f=n.signalR.changeState,i=r.transports._logic;r.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:!0,timeOut:3e3,start:function(e,o,s){var h=this,c=!1,l=n(e),a=!o,v,y;if(e.eventSource&&(e.log("The connection already has an event source. Stopping it."),e.stop()),!t.EventSource){s&&(e.log("This browser doesn't support SSE."),s());return}v=i.getUrl(e,this.name,a);try{e.log("Attempting to connect to SSE endpoint '"+v+"'"),e.eventSource=new t.EventSource(v)}catch(p){e.log("EventSource failed trying to connect with error "+p.Message),s?s():(l.triggerHandler(u.onError,[p]),a&&h.reconnect(e));return}a&&(y=t.setTimeout(function(){c===!1&&e.eventSource.readyState!==t.EventSource.CONNECTING&&e.eventSource.readyState!==t.EventSource.OPEN&&h.reconnect(e)},h.timeOut)),e.eventSource.addEventListener("open",function(){e.log("EventSource connected"),y&&t.clearTimeout(y),i.clearReconnectTimeout(e),c===!1&&(c=!0,f(e,r.connectionState.reconnecting,r.connectionState.connected)===!0&&l.triggerHandler(u.onReconnect))},!1),e.eventSource.addEventListener("message",function(n){n.data!=="initialized"&&i.processMessages(e,e._parseResponse(n.data),o)},!1),e.eventSource.addEventListener("error",function(n){if(this===e.eventSource){if(!c){s&&s();return}e.log("EventSource readyState: "+e.eventSource.readyState),n.eventPhase===t.EventSource.CLOSED?(e.log("EventSource reconnecting due to the server connection ending"),h.reconnect(e)):(e.log("EventSource error"),l.triggerHandler(u.onError))}},!1)},reconnect:function(n){i.reconnect(n,this.name)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){i.clearReconnectTimeout(n),n&&n.eventSource&&(n.log("EventSource calling close()"),n.eventSource.close(),n.eventSource=null,delete n.eventSource)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,f=n.signalR.events,e=n.signalR.changeState,i=r.transports._logic,u=function(){var u=null,f=1e3,i=0;return{prevent:function(){r._.ieVersion<=8&&(i===0&&(u=t.setInterval(function(){var t=n("<iframe style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;' src=''></iframe>");n("body").append(t),t.remove(),t=null},f)),i++)},cancel:function(){i===1&&t.clearInterval(u),i>0&&i--}}}();r.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:!0,start:function(r,f,e){var c=this,s=i.foreverFrame.count+=1,h,o=n("<iframe data-signalr-connection-id='"+r.id+"' style='position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;' src=''></iframe>");if(t.EventSource){e&&(r.log("This browser supports SSE, skipping Forever Frame."),e());return}u.prevent(),h=i.getUrl(r,this.name),h+="&frameId="+s,n("body").append(o),o.prop("src",h),i.foreverFrame.connections[s]=r,r.log("Binding to iframe's readystatechange event."),o.bind("readystatechange",function(){n.inArray(this.readyState,["loaded","complete"])>=0&&(r.log("Forever frame iframe readyState changed to "+this.readyState+", reconnecting"),c.reconnect(r))}),r.frame=o[0],r.frameId=s,f&&(r.onSuccess=function(){f(),delete r.onSuccess})},reconnect:function(n){var r=this;t.setTimeout(function(){if(n.frame&&i.ensureReconnectingState(n)){var u=n.frame,t=i.getUrl(n,r.name,!0)+"&frameId="+n.frameId;n.log("Updating iframe src to '"+t+"'."),u.src=t}},n.reconnectDelay)},lostConnection:function(n){this.reconnect(n)},send:function(n,t){i.ajaxSend(n,t)},receive:function(t,r){var u;i.processMessages(t,r,t.onSuccess),t.frameMessageCount=(t.frameMessageCount||0)+1,t.frameMessageCount>50&&(t.frameMessageCount=0,u=t.frame.contentWindow||t.frame.contentDocument,u&&u.document&&n("body",u.document).empty())},stop:function(t){var r=null;if(u.cancel(),t.frame){if(t.frame.stop)t.frame.stop();else try{r=t.frame.contentWindow||t.frame.contentDocument,r.document&&r.document.execCommand&&r.document.execCommand("Stop")}catch(f){t.log("SignalR: Error occured when stopping foreverFrame transport. Message = "+f.message)}n(t.frame).remove(),delete i.foreverFrame.connections[t.frameId],t.frame=null,t.frameId=null,delete t.frame,delete t.frameId,delete t.onSuccess,t.log("Stopping forever frame")}},abort:function(n,t){i.ajaxAbort(n,t)},getConnection:function(n){return i.foreverFrame.connections[n]},started:function(t){e(t,r.connectionState.reconnecting,r.connectionState.connected)===!0&&n(t).triggerHandler(f.onReconnect)}}}(window.jQuery,window),function(n,t){"use strict";var r=n.signalR,u=n.signalR.events,e=n.signalR.changeState,f=n.signalR.isDisconnecting,i=r.transports._logic;r.transports.longPolling={name:"longPolling",supportsKeepAlive:!1,reconnectDelay:3e3,start:function(o,s,h){var a=this,v=function(){v=n.noop,s(),h=null,o.log("LongPolling connected")},p=function(){return h?(h(),h=null,o.log("LongPolling failed to connect."),!0):!1},l=0,c=null,y=function(i){t.clearTimeout(c),c=null,e(o,r.connectionState.reconnecting,r.connectionState.connected)===!0&&(o.log("Raising the reconnect event"),n(i).triggerHandler(u.onReconnect))},w=36e5;o.pollXhr&&(o.log("Polling xhr requests already exists, aborting."),o.stop()),o.messageId=null,t.setTimeout(function(){(function e(s,h){var d=s.messageId,g=d===null,b=!g,nt=!h,k=i.getUrl(s,a.name,b,nt);f(s)!==!0&&(o.log("Attempting to connect to '"+k+"' using longPolling."),s.pollXhr=n.ajax({url:k,global:!1,cache:!1,type:"GET",dataType:o.ajaxDataType,contentType:o.contentType,success:function(r){var h=o._parseResponse(r),a=0,u;(l=0,c!==null&&y(),h&&(u=i.maximizePersistentResponse(h)),i.processMessages(s,h,v),u&&n.type(u.LongPollDelay)==="number"&&(a=u.LongPollDelay),u&&u.Disconnect)||f(s)!==!0&&(a>0?t.setTimeout(function(){e(s,!1)},a):e(s,!1))},error:function(f,h){if(t.clearTimeout(c),c=null,h==="abort"){o.log("Aborted xhr requst.");return}p()||(l++,o.state!==r.connectionState.reconnecting&&(o.log("An error occurred using longPolling. Status = "+h+". "+f.responseText),n(s).triggerHandler(u.onError,[f.responseText])),i.ensureReconnectingState(s),t.setTimeout(function(){e(s,!0)},a.reconnectDelay))}}),b&&h===!0&&(c=t.setTimeout(function(){y(s)},Math.min(1e3*(Math.pow(2,l)-1),w))))})(o)},250)},lostConnection:function(){throw new Error("Lost Connection not handled for LongPolling");},send:function(n,t){i.ajaxSend(n,t)},stop:function(n){n.pollXhr&&(n.pollXhr.abort(),n.pollXhr=null,delete n.pollXhr)},abort:function(n,t){i.ajaxAbort(n,t)}}}(window.jQuery,window),function(n){"use strict";function f(n){return n+s}function h(n,t,i){for(var f=n.length,u=[],r=0;r<f;r+=1)n.hasOwnProperty(r)&&(u[r]=t.call(i,n[r],r,n));return u}function c(t){return n.isFunction(t)?null:n.type(t)==="undefined"?null:t}function o(n){for(var t in n)if(n.hasOwnProperty(t))return!0;return!1}function r(n,t){return new r.fn.init(n,t)}function i(t,r){var u={qs:null,logging:!1,useDefaultPath:!0};return n.extend(u,r),(!t||u.useDefaultPath)&&(t=(t||"")+"/signalr"),new i.fn.init(t,u)}var e=0,u={},s=".hubProxy";r.fn=r.prototype={init:function(n,t){this.state={},this.connection=n,this.hubName=t,this._={callbackMap:{}}},hasSubscriptions:function(){return o(this._.callbackMap)},on:function(t,i){var r=this,u=r._.callbackMap;return t=t.toLowerCase(),u[t]||(u[t]={}),u[t][i]=function(n,t){i.apply(r,t)},n(r).bind(f(t),u[t][i]),r},off:function(t,i){var u=this,e=u._.callbackMap,r;return t=t.toLowerCase(),r=e[t],r&&(r[i]?(n(u).unbind(f(t),r[i]),delete r[i],o(r)||delete e[t]):i||(n(u).unbind(f(t)),delete e[t])),u},invoke:function(t){var i=this,o=n.makeArray(arguments).slice(1),s=h(o,c),f={H:i.hubName,M:t,A:s,I:e},r=n.Deferred(),l=function(t){var u=i._maximizeHubResponse(t);n.extend(i.state,u.State),u.Error?(u.StackTrace&&i.connection.log(u.Error+"\n"+u.StackTrace),r.rejectWith(i,[u.Error])):r.resolveWith(i,[u.Result])};return u[e.toString()]={scope:i,method:l},e+=1,n.isEmptyObject(i.state)||(f.S=i.state),i.connection.send(i.connection.json.stringify(f)),r.promise()},_maximizeHubResponse:function(n){return{State:n.S,Result:n.R,Id:n.I,Error:n.E,StackTrace:n.T}}},r.fn.init.prototype=r.fn,i.fn=i.prototype=n.connection(),i.fn.init=function(t,i){var e={qs:null,logging:!1,useDefaultPath:!0},r=this;n.extend(e,i),n.signalR.fn.init.call(r,t,e.qs,e.logging),r.proxies={},r.received(function(t){var i,s,e,o,h,c;t&&(typeof t.I!="undefined"?(e=t.I.toString(),o=u[e],o&&(u[e]=null,delete u[e],o.method.call(o.scope,t))):(i=this._maximizeClientHubInvocation(t),r.log("Triggering client hub event '"+i.Method+"' on hub '"+i.Hub+"'."),h=i.Hub.toLowerCase(),c=i.Method.toLowerCase(),s=this.proxies[h],n.extend(s.state,i.State),n(s).triggerHandler(f(c),[i.Args])))})},i.fn._maximizeClientHubInvocation=function(n){return{Hub:n.H,Method:n.M,Args:n.A,State:n.S}},i.fn._registerSubscribedHubs=function(){var t=this;t._subscribedToHubs||(t._subscribedToHubs=!0,t.starting(function(){var i=[];n.each(t.proxies,function(n){this.hasSubscriptions()&&i.push({name:n})}),t.data=t.json.stringify(i)}))},i.fn.createHubProxy=function(n){n=n.toLowerCase();var t=this.proxies[n];return t||(t=r(this,n),this.proxies[n]=t),this._registerSubscribedHubs(),t},i.fn.init.prototype=i.fn,n.hubConnection=i}(window.jQuery,window),function(n){n.signalR.version="2.0.0-beta2"}(window.jQuery)
Please sign in to comment.
Something went wrong with that request. Please try again.