diff options
author | Mert Tumer <mert.tumer@collabora.com> | 2020-05-26 12:45:02 +0300 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2020-05-26 15:20:22 +0300 |
commit | 0c41283757a571334eddadece7d5e5024854e668 (patch) | |
tree | 668443d6c52ad462353e378fe86f819cb78eba78 /src | |
parent | a988ff21e8df1b8785fc723ac65e69a4ef8ebb16 (diff) |
Built-In CODE Server status message on first load
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/document.js | 23 |
1 files changed, 20 insertions, 3 deletions
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() { |