All Downloads are FREE. Search and download functionalities are using the official Maven repository.

assets.js.GroupDocsAtmosphere.min.js Maven / Gradle / Ivy

Go to download

GroupDocs.Annotation is an HTML5-based document & image annotator designed to be easily integrated into web, mobile and desktop apps. It allows developers to provide end users with the ability to annotate documents and images of more than 50 file formats, including PDF and Microsoft Office documents, Visio diagrams, CAD and raster images.

There is a newer version: 18.4
Show newest version
$(function(){if(!window.console){window.console={log:function(val){}};}window.jQuery.connection={hub:{id:null,qs:null,start:function(){var socket=atmosphere;var transport="websocket";var request={url:window.baseUrl+"annotation",contentType:"application/json",logLevel:"debug",transport:transport,trackMessageLength:true};if(typeof window.jQuery.connection.hub.url!="undefined"&&window.jQuery.connection.hub.url.indexOf("/signalr1_1_2/hubs")!=-1){window.jQuery.connection.hub.url=request.url;}request.onOpen=function(response){console.log("Atmosphere connected using "+response.transport);if(request.uuid===response.request.uuid){return;}transport=response.transport;request.uuid=response.request.uuid;if(window.jQuery.connection.annotationHub.established!=null){window.jQuery.connection.annotationHub.established();}window.jQuery.connection.subSocket.push({data:JSON.stringify({action:"updateUUID",clientUUID:window.jQuery.connection._clientUUID})});};request.onClientTimeout=function(r){console.log("Client closed the connection after a timeout. Reconnecting in "+request.reconnectInterval);setTimeout(function(){window.jQuery.connection.subSocket=socket.subscribe(request);},request.reconnectInterval);};request.onReopen=function(response){console.log("Atmosphere re-connected using "+response.transport);};request.onTransportFailure=function(errorMsg,request){atmosphere.util.info(errorMsg);request.fallbackTransport="long-polling";console.log("Atmosphere Chat. Default transport is WebSocket, fallback is "+request.fallbackTransport);};request.onMessage=function(response){var message=response.responseBody;try{var json=atmosphere.util.parseJSON(message);if(window.jQuery.connection&&window.jQuery.connection.onMessage&&response.status==200){window.jQuery.connection.onMessage(json);}else{console.log("Atmosphere incoming message status: "+response.status);}}catch(e){console.log("This doesn't look like a valid JSON: ",message);}};request.onClose=function(response){console.log("Server closed the connection after a timeout");};request.onError=function(response){console.log("Sorry, but there's some problem with your socket or the server is down");};request.onReconnect=function(request,response){console.log("Connection lost, trying to reconnect. Trying to reconnect "+request.reconnectInterval);};window.jQuery.connection.subSocket=socket.subscribe(request);window.jQuery.connection.onMessage=function(jsonObj){if(window.jQuery.connection.annotationHub.callers.hasOwnProperty(jsonObj.action)){window.jQuery.connection.annotationHub.callers[jsonObj.action](jsonObj.action,jsonObj);}};window.jQuery.connection._clientUUID=(function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase();};}(/[xy]/g,function(b){var a=Math.random()*16|0,d=b=="x"?a:a&3|8;return d.toString(16);}))();return window.jQuery.connection.annotationHub;}},annotationHub:{established:null,client:{},callers:{updateUUID:function(action,data){if(window.jQuery.connection._clientUUID==data.clientUUID&&window.jQuery.connection.hub.id!==data.UUID){window.jQuery.connection.hub.id=data.UUID;}},createAnnotationOnClient:function(action,data){if(data.documentGuid==window.jQuery.connection.annotationHub.server.fileId){window.jQuery.connection.annotationHub.client[action](data.UUID,data);}},createReplyOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data);},deleteAnnotationOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data.annotationGuid);},deleteAnnotationReplyOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data.annotationGuid,data.replyGuid,data.childReplies);},editAnnotationReplyOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data.annotationGuid,data.replyGuid,data.newText);},moveAnnotationMarkerOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data.annotationGuid,data.position,data.data);},moveAnnotationOnClient:function(action,data){},resizeAnnotationOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data.annotationGuid,data.width,data.height);},setAnnotationAccessOnClient:function(action,data){},setReviewersColorsOnClient:function(action,data){},setTextFieldColorOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data.annotationGuid,data.color);},updateTextFieldOnClient:function(action,data){window.jQuery.connection.annotationHub.client[action](data.UUID,data.annotationGuid,data.newText,data.fontFamily,data.fontSize);}},server:{fileId:null,setDocumentGuidForConnection:function(fileId){window.jQuery.connection.annotationHub.server.fileId=fileId;}},done:function(established){window.jQuery.connection.annotationHub.established=established;}}};});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy