diff --git a/browser/src/core/Socket.js b/browser/src/core/Socket.js index a4453c7cc87b..9b43371733e8 100644 --- a/browser/src/core/Socket.js +++ b/browser/src/core/Socket.js @@ -1522,8 +1522,10 @@ app.definitions.Socket = L.Class.extend({ window.app.console.debug('_onSocketClose:'); if (!this._map._docLoadedOnce) { var postMessageObj = { + errorType: 'websocketconnectionfailed', success: false, - errorMsg: errorMessages.websocketconnectionfailed + errorMsg: errorMessages.websocketconnectionfailed, + result: '', }; this._map.fire('postMessage', {msgId: 'Action_Load_Resp', args: postMessageObj}); this._map.fire('error', {msg: errorMessages.websocketconnectionfailed, cmd: 'socket', kind: 'closed', id: 4}); diff --git a/browser/src/errormessages.js b/browser/src/errormessages.js index 3ef4d7cd0e7e..8dd32e2b256f 100644 --- a/browser/src/errormessages.js +++ b/browser/src/errormessages.js @@ -27,7 +27,7 @@ errorMessages.docloadtimeout = _('Failed to load the document. This document is errorMessages.docunloadingretry = _('Cleaning up the document from the last session.'); errorMessages.docunloadinggiveup = _('We are in the process of cleaning up this document from the last session, please try again later.'); errorMessages.clusterconfiguration = _('Your %productName cluster appear to be mis-configured or scaling rapidly - please contact your system administrator. Continuing with editing may result in multiple users not seeing each other, conflicts in the document storage and/or copy/paste problems. Expected serverId %0 for routeToken %1 but connected to serverId %2'); -errorMessages.websocketconnectionfailed = _('Failed to establish socket connection or socket connection closed unexpectedly. The reverse proxy is probably misconfigured, please contact the administrator. For more info on proxy conifguration please checkout https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html'); +errorMessages.websocketconnectionfailed = _('Failed to establish socket connection or socket connection closed unexpectedly. The reverse proxy might be misconfigured, please contact the administrator. For more info on proxy configuration please checkout https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html'); if (window.ThisIsAMobileApp) { errorMessages.storage = { loadfailed: _('Failed to load document.'), diff --git a/browser/src/map/Map.js b/browser/src/map/Map.js index 71b56bf31a8e..486f8498415a 100644 --- a/browser/src/map/Map.js +++ b/browser/src/map/Map.js @@ -308,6 +308,13 @@ L.Map = L.Evented.extend({ this._docLoadedOnce = this._docLoaded; } }, this); + + this.fire('postMessage', { + msgId: 'App_LoadingStatus', + args: { + Status: 'Initialized', + } + }); }, initTextInput: function(docType) { diff --git a/browser/src/map/handler/Map.WOPI.js b/browser/src/map/handler/Map.WOPI.js index e9ba20747c5d..d5f7ec8ce9f2 100644 --- a/browser/src/map/handler/Map.WOPI.js +++ b/browser/src/map/handler/Map.WOPI.js @@ -3,7 +3,7 @@ * L.WOPI contains WOPI related logic */ -/* global w2ui _ app */ +/* global w2ui _ app errorMessages */ L.Map.WOPI = L.Handler.extend({ // If the CheckFileInfo call fails on server side, we won't have any PostMessageOrigin. // So use '*' because we still needs to send 'close' message to the parent frame which @@ -337,6 +337,19 @@ L.Map.WOPI = L.Handler.extend({ this._map._disableDefaultAction[msg.Values.action] = msg.Values.disable; } } + else if (msg.MessageId === 'Error_Messages') { + if (msg.Values && msg.Values.list) { + msg.Values.list.forEach(function (item) { + if (Object.prototype.hasOwnProperty.call(errorMessages.storage, item.type)) { + errorMessages.storage[item.type] = item.msg; + } else if (Object.prototype.hasOwnProperty.call(errorMessages.uploadfile, item.type)) { + errorMessages.uploadfile[item.type] = item.msg; + } else if (Object.prototype.hasOwnProperty.call(errorMessages, item.type)) { + errorMessages[item.type] = item.msg; + } + }); + } + } // All following actions must be done after initialization is completed. if (!window.WOPIPostmessageReady) {