From cf6bc1798d4c5d1bcdb235208a47e389c2ceaaaf Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Sun, 16 Mar 2025 01:58:52 +0300 Subject: [PATCH] [main] changes for cache sripts --- apps/api/documents/api.js | 17 +++++++++++++++++ apps/api/documents/cache-scripts.html | 2 ++ build/Gruntfile.js | 5 ++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 14f1c7cc3c..a82ecf2a1c 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -940,6 +940,23 @@ return '{{PRODUCT_VERSION}}'; }; + DocsAPI.DocEditor.warmUp = function(id) { + var target = document.getElementById(id); + if ( target ) { + var path = extendAppPath({}, getBasePath()); + path += 'api/documents/cache-scripts.html'; + + var iframe = document.createElement("iframe"); + iframe.width = 0; + iframe.height = 0; + iframe.style = 'border:0 none;'; + iframe.onload = function() { console.log('onload cache script') }; + iframe.src = path; + + target.parentNode && target.parentNode.replaceChild(iframe, target); + } + } + MessageDispatcher = function(fn, scope) { var _fn = fn, _scope = scope || window, diff --git a/apps/api/documents/cache-scripts.html b/apps/api/documents/cache-scripts.html index 4ef772077f..f9e68dd6ef 100644 --- a/apps/api/documents/cache-scripts.html +++ b/apps/api/documents/cache-scripts.html @@ -9,6 +9,8 @@ + + diff --git a/build/Gruntfile.js b/build/Gruntfile.js index 1d838076c9..3a1fe9fd26 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -321,7 +321,10 @@ module.exports = function(grunt) { inline: { dist: { src: packageFile['apps-common'].copy.indexhtml.dest + '/*.html' - } + }, + cachescripts: { + src: packageFile['api'].copy.script.dest + 'documents/cache-scripts.html', + }, } } });