Compare commits

..

8 Commits

24 changed files with 30 additions and 63 deletions

2
.gitmodules vendored
View File

@ -5,7 +5,7 @@
[submodule "web/documentserver-example/nodejs/public/assets/document-formats"]
path = web/documentserver-example/nodejs/public/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
branch = feature/diagram
branch = feature/v9.0
[submodule "web/documentserver-example/csharp-mvc/assets/document-templates"]
path = web/documentserver-example/csharp-mvc/assets/document-templates
url = https://github.com/ONLYOFFICE/document-templates

View File

@ -1,6 +1,11 @@
# Change Log
- nodejs: preload frame moved from uploading popap
- change preload.html address
- nodejs: view odg
- nodejs: edit xlsb
- nodejs: support vsdx in diagram editor
- nodejs: fix wopi verification
- nodejs: user role
- nodejs: start filling

View File

@ -23,7 +23,7 @@
<add key="files.docservice.url.converter" value="converter"/>
<add key="files.docservice.url.api" value="web-apps/apps/api/documents/api.js"/>
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/cache-scripts.html"/>
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/preload.html"/>
<add key="files.docservice.url.command" value="command"/>
<add key="files.docservice.url.example" value=""/>

View File

@ -22,7 +22,7 @@
<add key="files.docservice.url.converter" value="converter"/>
<add key="files.docservice.url.api" value="web-apps/apps/api/documents/api.js"/>
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/cache-scripts.html"/>
<add key="files.docservice.url.preloader" value="web-apps/apps/api/documents/preload.html"/>
<add key="files.docservice.url.command" value="command"/>
<add key="files.docservice.url.example" value=""/>

View File

@ -7,7 +7,7 @@
"DOC_SERVER_HOST" : "http://documentserver/",
"DOC_SERVER_CONVERTER_URL" : "converter",
"DOC_SERVER_API_URL" : "web-apps/apps/api/documents/api.js",
"DOC_SERVER_PRELOADER_URL" : "web-apps/apps/api/documents/cache-scripts.html",
"DOC_SERVER_PRELOADER_URL" : "web-apps/apps/api/documents/preload.html",
"DOC_SERVER_COMMAND_URL" : "command",
"JWT_IS_ENABLED" : false,

View File

@ -11,7 +11,7 @@ files.docservice.url.site=http://documentserver/
files.docservice.url.converter=converter
files.docservice.url.command=command
files.docservice.url.api=web-apps/apps/api/documents/api.js
files.docservice.url.preloader=web-apps/apps/api/documents/cache-scripts.html
files.docservice.url.preloader=web-apps/apps/api/documents/preload.html
files.docservice.url.example=
files.docservice.languages=en:English|sq-AL:Albanian (Albania)|ar:Arabic|hy:Armenian|az:Azerbaijani|eu:Basque|be:Belarusian|bg:Bulgarian|ca:Catalan|zh:Chinese (Simplified)|zh-TW:Chinese (Traditional)|cs:Czech|da:Danish|nl:Dutch|en-GB:English (United Kingdom)|fi:Finnish|fr:French|gl:Galego|de:German|el:Greek|he-IL:Hebrew (Israel)|hu:Hungarian|id:Indonesian|it:Italian|ja:Japanese|ko:Korean|lo:Lao|lv:Latvian|ms:Malay (Malaysia)|no:Norwegian|pl:Polish|pt:Portuguese (Brazil)|pt-PT:Portuguese (Portugal)|ro:Romanian|ru:Russian|sr-Cyrl-RS:Serbian (Cyrillic)|sr-Latn-RS:Serbian (Latin)|si:Sinhala (Sri Lanka)|sk:Slovak|sl:Slovenian|es:Spanish|sv:Swedish|tr:Turkish|uk:Ukrainian|vi:Vietnamese|aa-AA:Test Language

View File

@ -20,7 +20,7 @@
"commandUrl": "command",
"converterUrl": "converter",
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html",
"preloaderUrl": "web-apps/apps/api/documents/preload.html",
"exampleUrl": null,
"storageFolder": "./files",
"storagePath": "/files",

View File

@ -1,8 +1,6 @@
{
"server": {
"port": 3000,
"siteUrl": "http://127.0.0.1:8000/",
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html"
"siteUrl": "http://127.0.0.1:8000/"
}
}

View File

@ -1,8 +1,6 @@
{
"server": {
"port": 3000,
"siteUrl": "http://127.0.0.1:8000/",
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html"
"siteUrl": "http://127.0.0.1:8000/"
}
}

View File

@ -1,8 +1,6 @@
{
"server": {
"port": 80,
"siteUrl": "http://127.0.0.1:8000/",
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html"
"siteUrl": "http://127.0.0.1:8000/"
}
}

View File

@ -32,7 +32,7 @@ exports.isValidToken = async (req, res, next) => {
const isValid = wopiValidator.check(
{
url: `${req.protocol}://${req.get('host')}${req.originalUrl || req.url}`,
url: `${req.DocManager.getServerPath()}${req.originalUrl || req.url}`,
accessToken: req.query.access_token,
timestamp: req.headers[reqConsts.requestHeaders.Timestamp.toLowerCase()],
},

View File

@ -139,7 +139,7 @@ if (typeof jQuery != "undefined") {
if (!formatManager.isAutoConvertible(posExt)) {
jq("#step2").addClass("done").removeClass("current");
loadScripts();
onuploaded();
return;
}
@ -199,35 +199,14 @@ if (typeof jQuery != "undefined") {
checkConvert(filePass, fileType);
} else {
jq("#step2").addClass("done").removeClass("current");
loadScripts();
onuploaded();
}
}
});
}, 1000);
};
var loadScripts = function () {
if (!jq("#mainProgress").is(":visible")) {
return;
}
jq("#step3").addClass("current");
if (jq("#loadScripts").is(":empty")) {
var urlScripts = jq("#loadScripts").attr("data-docs");
var frame = '<iframe id="iframeScripts" width=1 height=1 style="position: absolute; visibility: hidden;" ></iframe>';
jq("#loadScripts").html(frame);
document.getElementById("iframeScripts").onload = onloadScripts;
jq("#loadScripts iframe").attr("src", urlScripts);
} else {
onloadScripts();
}
};
var onloadScripts = function () {
if (!jq("#mainProgress").is(":visible")) {
return;
}
jq("#step3").addClass("done").removeClass("current");
var onuploaded = function () {
jq("#beginView, #beginEmbedded").removeClass("disable");
var fileName = jq("#hiddenFileName").val();
@ -276,7 +255,7 @@ if (typeof jQuery != "undefined") {
jq(document).on("click", "#skipPass", function () {
jq("#blockPassword").hide();
loadScripts();
onuploaded();
});
jq(document).on("click", "#beginEdit:not(.disable)", function () {

View File

@ -526,10 +526,6 @@ label .checkbox {
line-height: 150%;
}
#loadScripts {
display: none;
}
#iframeScripts {
position: absolute;
visibility: hidden;

View File

@ -322,10 +322,7 @@
<span class="errorPass"></span>
<br />
</div>
<span id="step3" class="step">3. Loading editor scripts.</span>
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
<br />
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
<br />
<div class="error-message">
@ -369,7 +366,7 @@
</div>
</div>
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
<iframe id="iframeScripts" src="<%= preloaderUrl %>" width=1 height=1 style="position: absolute; visibility: hidden;" ></iframe>
<footer>
<div class="center">

View File

@ -235,11 +235,7 @@
<span class="errorPass"></span>
<br />
</div>
<span id="step3" class="step">3. Loading editor scripts.</span>
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
<br />
<br />
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
<br />
<br />
@ -256,7 +252,7 @@
<div id="cancelEdit" class="button gray">Cancel</div>
</div>
<span id="loadScripts" data-docs="<%= preloaderUrl %>"></span>
<iframe id="iframeScripts" src="<%= preloaderUrl %>" width=1 height=1 style="position: absolute; visibility: hidden;" ></iframe>
<footer>
<div class="center">

View File

@ -24,7 +24,7 @@ DOCUMENT_SERVER_PRIVATE_URL=http://proxy:8080
DOCUMENT_SERVER_API_PATH=web-apps/apps/api/documents/api.js
DOCUMENT_SERVER_COMMAND_PATH=command
DOCUMENT_SERVER_CONVERTER_PATH=converter
DOCUMENT_SERVER_PRELOADER_PATH=web-apps/apps/api/documents/cache-scripts.html
DOCUMENT_SERVER_PRELOADER_PATH=web-apps/apps/api/documents/preload.html
DOCUMENT_SERVER_JWT_HEADER=Authorization
DOCUMENT_SERVER_JWT_ALGORITHM=HS256

View File

@ -32,7 +32,7 @@ class SettingsManager extends OnlyOfficeSettingsManager
$publicServerUrl = rtrim(env('DOCUMENT_SERVER_PUBLIC_URL', 'http://documentserver'), '/');
$privateServerUrl = rtrim(env('DOCUMENT_SERVER_PRIVATE_URL', $publicServerUrl), '/');
$apiUrl = $publicServerUrl.'/'.env('DOCUMENT_SERVER_API_PATH', 'web-apps/apps/api/documents/api.js');
$preloaderUrl = $publicServerUrl.'/'.env('DOCUMENT_SERVER_PRELOADER_PATH', 'web-apps/apps/api/documents/cache-scripts.html');
$preloaderUrl = $publicServerUrl.'/'.env('DOCUMENT_SERVER_PRELOADER_PATH', 'web-apps/apps/api/documents/preload.html');
$conversionUrl = $privateServerUrl.'/'.env('DOCUMENT_SERVER_CONVERTER_PATH', 'convert');
$commandUrl = $privateServerUrl.'/'.env('DOCUMENT_SERVER_COMMAND_PATH', 'command');
$jwtSecret = env('DOCUMENT_SERVER_JWT_SECRET', 'secret');

View File

@ -65,7 +65,7 @@ class ConfigurationManager
{
$serverURL = $this->documentServerPublicURL();
$path = getenv('DOCUMENT_SERVER_PRELOADER_PATH')
?: 'web-apps/apps/api/documents/cache-scripts.html';
?: 'web-apps/apps/api/documents/preload.html';
return $serverURL->joinPath($path);
}

View File

@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerPreloaderURLTests extends TestCase
$configManager = new ConfigurationManager();
$url = $configManager->documentServerPreloaderURL();
$this->assertEquals(
'http://documentserver/web-apps/apps/api/documents/cache-scripts.html',
'http://documentserver/web-apps/apps/api/documents/preload.html',
$url->string()
);
}

View File

@ -61,7 +61,7 @@ class ConfigurationManager:
base_url = server_url.geturl()
path = (
environ.get('DOCUMENT_SERVER_PRELOADER_PATH') or
'/web-apps/apps/api/documents/cache-scripts.html'
'/web-apps/apps/api/documents/preload.html'
)
url = urljoin(base_url, path)
return urlparse(url)

View File

@ -114,7 +114,7 @@ class ConfigurationManagerDocumentServerPreloaderURLTests(TestCase):
url = config_manager.document_server_preloader_url()
self.assertEqual(
url.geturl(),
'http://localhost/web-apps/apps/api/documents/cache-scripts.html'
'http://localhost/web-apps/apps/api/documents/preload.html'
)
@patch.object(

View File

@ -68,7 +68,7 @@ class ConfigurationManager
def document_server_preloader_uri
path =
ENV['DOCUMENT_SERVER_PRELOADER_PATH'] ||
'/web-apps/apps/api/documents/cache-scripts.html'
'/web-apps/apps/api/documents/preload.html'
URI.join(document_server_public_uri, path)
end

View File

@ -127,7 +127,7 @@ class ConfigurationManagerDocumentServerPreloaderURITests < Test::Unit::TestCase
uri = config_manager.document_server_preloader_uri
assert_equal(
uri.to_s,
'http://documentserver/web-apps/apps/api/documents/cache-scripts.html'
'http://documentserver/web-apps/apps/api/documents/preload.html'
)
end