diff options
-rw-r--r-- | css/document.scss | 13 | ||||
-rw-r--r-- | src/document.js | 23 | ||||
-rw-r--r-- | templates/documents.php | 4 |
3 files changed, 37 insertions, 3 deletions
diff --git a/css/document.scss b/css/document.scss index abf502aa..46b4f1f5 100644 --- a/css/document.scss +++ b/css/document.scss @@ -140,6 +140,19 @@ body { background-color: var(--color-main-background); } +#proxyLoadingContainer { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: var(--color-main-background); +} + +#proxyLoadingMessage { + position: relative; + margin-top: 10px; +} + #revViewerContainer{ position: absolute; width: 100%; diff --git a/src/document.js b/src/document.js index e2f5f69e..0fe8fb17 100644 --- a/src/document.js +++ b/src/document.js @@ -18,8 +18,25 @@ const PostMessages = new PostMessageService({ loolframe: () => document.getElementById('loleafletframe').contentWindow }) -const showLoadingIndicator = () => document.getElementById('loadingContainer').classList.add('icon-loading') -const hideLoadingIndicator = () => document.getElementById('loadingContainer').classList.remove('icon-loading') +const showLoadingIndicator = () => { + if (OC.appswebroots.richdocumentscode && Config.get('urlsrc').indexOf('proxy.php') >= 0) { + var url = Config.get('urlsrc').substr(0, Config.get('urlsrc').indexOf('proxy.php') + 'proxy.php'.length) + $.get(url + '?status').done(function(val) { + if (val && val.status && val.status === 'starting') { + document.getElementById('proxyLoadingIcon').classList.add('icon-loading-small') + document.getElementById('proxyLoadingMessage').textContent = t('richdocuments', 'Built-in CODE Server is starting up shortly, please wait.') + } + }) + } else { + document.getElementById('loadingContainer').classList.add('icon-loading') + } +} + +const hideLoadingIndicator = () => { + document.getElementById('loadingContainer').classList.remove('icon-loading') + document.getElementById('proxyLoadingIcon').classList.remove('icon-loading-small') + document.getElementById('proxyLoadingMessage').textContent = '' +} showLoadingIndicator() @@ -219,7 +236,7 @@ const documentsMain = { const message = { 'MessageId': 'App_LoadingStatus', 'Values': { 'Status': 'Timeout' } } editorInitListener({ data: JSON.stringify(message), parsed: message }) } - }, 15000) + }, 45000) }) $('#loleafletframe').load(function() { diff --git a/templates/documents.php b/templates/documents.php index 877cc7a9..85ff8f81 100644 --- a/templates/documents.php +++ b/templates/documents.php @@ -15,4 +15,8 @@ script('richdocuments', 'document'); ?> <div id="loadingContainer"></div> +<div id="proxyLoadingContainer"> + <div id="proxyLoadingIcon"></div> + <div id="proxyLoadingMessage"></div> +</div> <div id="documents-content"></div> |