Move OnlyOffice dist to own directory

https://github.com/cryptpad/cryptpad/issues/1416
This commit is contained in:
Wolfgang Ginolas 2024-02-22 09:23:20 +01:00 committed by wginolas
parent 9a60af328c
commit bb5d7aa326
7 changed files with 12 additions and 14 deletions

1
.gitignore vendored
View File

@ -33,3 +33,4 @@ lib/plugins/*
www/common/onlyoffice/v*
/onlyoffice-builds.git/
/www/common/onlyoffice/dist/

View File

@ -4,11 +4,12 @@ set -euxo pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
BUILDS_DIR=$SCRIPT_DIR/onlyoffice-builds.git
OO_DIR=$SCRIPT_DIR/www/common/onlyoffice
OO_DIR=$SCRIPT_DIR/www/common/onlyoffice/dist
main () {
parse_arguments "$@"
validate_arguments
prepare_builds
install_version v1 4f370beb
install_version v2b d9da72fd
@ -91,6 +92,8 @@ prepare_builds () {
else
git clone --bare git@github.com:cryptpad/onlyoffice-builds.git "$BUILDS_DIR" # TODO use https here, when repo is public
fi
mkdir -p "$OO_DIR"
}
install_version () {

View File

@ -32,13 +32,7 @@ var isPossiblyGenerated = function (key) {
var grep = function (pattern, cb) {
var exclude = [
'www/common/translations/*',
'www/common/onlyoffice/v1/*',
'www/common/onlyoffice/v2b*',
'www/common/onlyoffice/v4*',
'www/common/onlyoffice/v5*',
'www/common/onlyoffice/v6*',
'www/common/onlyoffice/x2t/*',
//'www/common/onlyoffice/build/*',
'www/common/onlyoffice/dist/*',
'www/lib/*',
'www/common/pdfjs/*',
'*.css',

View File

@ -421,7 +421,7 @@ define([
});
});
var sheetURL = '/common/onlyoffice/v5/web-apps/apps/spreadsheeteditor/main/index.html';
var sheetURL = '/common/onlyoffice/dist/v5/web-apps/apps/spreadsheeteditor/main/index.html';
assert(function (cb, msg) {
msg.innerText = "Missing HTTP headers required for .xlsx export from sheets. ";
@ -718,7 +718,7 @@ define([
});
assert(function (cb, msg) { // FIXME possibly superseded by more advanced CSP tests?
var url = '/common/onlyoffice/v5/web-apps/apps/spreadsheeteditor/main/index.html';
var url = '/common/onlyoffice/dist/v5/web-apps/apps/spreadsheeteditor/main/index.html';
msg.appendChild(CSP_WARNING(url));
deferredPostMessage({
command: 'GET_HEADER',

View File

@ -2582,7 +2582,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
(content.version <= 3 ? 'v2b/' : CURRENT_VERSION+'/');
var s = h('script', {
type:'text/javascript',
src: '/common/onlyoffice/'+version+'web-apps/apps/api/documents/api.js'
src: '/common/onlyoffice/dist/'+version+'web-apps/apps/api/documents/api.js'
});
$('#cp-app-oo-editor').empty().append(h('div#cp-app-oo-placeholder-a')).append(s);
@ -3006,7 +3006,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
var s = h('script', {
type:'text/javascript',
src: '/common/onlyoffice/'+version+'web-apps/apps/api/documents/api.js'
src: '/common/onlyoffice/dist/'+version+'web-apps/apps/api/documents/api.js'
});
$('#cp-app-oo-editor').append(s);

View File

@ -19,7 +19,7 @@ define([
var x2tReady = Util.mkEvent(true);
var fetchFonts = function (x2t, obj, cb) {
if (!obj.fonts) { return void cb(); }
var path = ApiConfig.httpSafeOrigin + '/common/onlyoffice/'+CURRENT_VERSION+'/fonts/';
var path = ApiConfig.httpSafeOrigin + '/common/onlyoffice/dist/'+CURRENT_VERSION+'/fonts/';
var ver = '?' + ApiConfig.requireConf.urlArgs;
var fonts = obj.fonts;
var files = obj.fonts_files;

View File

@ -118,7 +118,7 @@ define([
var loadOO = function (blob, type, name, cb) {
var s = h('script', {
type:'text/javascript',
src: '/common/onlyoffice/'+CURRENT_VERSION+'/web-apps/apps/api/documents/api.js'
src: '/common/onlyoffice/dist/'+CURRENT_VERSION+'/web-apps/apps/api/documents/api.js'
});
var file = getFileType(type);
APP.$rightside.append(s);