mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
@ -14,7 +14,7 @@
|
|||||||
type: 'desktop or mobile or embedded',
|
type: 'desktop or mobile or embedded',
|
||||||
width: '100% by default',
|
width: '100% by default',
|
||||||
height: '100% by default',
|
height: '100% by default',
|
||||||
documentType: 'word' | 'cell' | 'slide' | 'pdf' ,// deprecate 'text' | 'spreadsheet' | 'presentation',
|
documentType: 'word' | 'cell' | 'slide' | 'pdf' | 'diagram' ,// deprecate 'text' | 'spreadsheet' | 'presentation',
|
||||||
token: <string> encrypted signature
|
token: <string> encrypted signature
|
||||||
document: {
|
document: {
|
||||||
title: 'document title',
|
title: 'document title',
|
||||||
@ -478,11 +478,12 @@
|
|||||||
'word': 'docx',
|
'word': 'docx',
|
||||||
'cell': 'xlsx',
|
'cell': 'xlsx',
|
||||||
'slide': 'pptx',
|
'slide': 'pptx',
|
||||||
'pdf': 'pdf'
|
'pdf': 'pdf',
|
||||||
|
'diagram': 'vsdx'
|
||||||
}, app;
|
}, app;
|
||||||
|
|
||||||
if (_config.documentType=='text' || _config.documentType=='spreadsheet' ||_config.documentType=='presentation')
|
if (_config.documentType=='text' || _config.documentType=='spreadsheet' ||_config.documentType=='presentation')
|
||||||
console.warn("The \"documentType\" parameter for the config object must take one of the values word/cell/slide/pdf.");
|
console.warn("The \"documentType\" parameter for the config object must take one of the values word/cell/slide/pdf/diagram.");
|
||||||
|
|
||||||
if (typeof _config.documentType === 'string' && _config.documentType != '') {
|
if (typeof _config.documentType === 'string' && _config.documentType != '') {
|
||||||
app = appMap[_config.documentType.toLowerCase()];
|
app = appMap[_config.documentType.toLowerCase()];
|
||||||
@ -496,7 +497,7 @@
|
|||||||
|
|
||||||
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
||||||
_config.document.fileType = _config.document.fileType.toLowerCase();
|
_config.document.fileType = _config.document.fileType.toLowerCase();
|
||||||
var type = /^(?:(xls|xlsx|ods|csv|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb|sxc|et|ett|numbers)|(pps|ppsx|ppt|pptx|odp|gslides|pot|potm|potx|ppsm|pptm|fodp|otp|sxi|dps|dpt|key)|(pdf|djvu|xps|oxps)|(doc|docx|odt|gdoc|txt|rtf|mht|htm|html|mhtml|epub|docm|dot|dotm|dotx|fodt|ott|fb2|xml|oform|docxf|sxw|stw|wps|wpt|pages|hwp|hwpx))$/
|
var type = /^(?:(xls|xlsx|ods|csv|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb|sxc|et|ett|numbers)|(pps|ppsx|ppt|pptx|odp|gslides|pot|potm|potx|ppsm|pptm|fodp|otp|sxi|dps|dpt|key)|(pdf|djvu|xps|oxps)|(doc|docx|odt|gdoc|txt|rtf|mht|htm|html|mhtml|epub|docm|dot|dotm|dotx|fodt|ott|fb2|xml|oform|docxf|sxw|stw|wps|wpt|pages|hwp|hwpx)|(vsdx|vssx|vstx|vsdm|vssm|vstm))$/
|
||||||
.exec(_config.document.fileType);
|
.exec(_config.document.fileType);
|
||||||
if (!type) {
|
if (!type) {
|
||||||
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
||||||
@ -505,7 +506,8 @@
|
|||||||
if (typeof type[1] === 'string') _config.documentType = 'cell'; else
|
if (typeof type[1] === 'string') _config.documentType = 'cell'; else
|
||||||
if (typeof type[2] === 'string') _config.documentType = 'slide'; else
|
if (typeof type[2] === 'string') _config.documentType = 'slide'; else
|
||||||
if (typeof type[3] === 'string') _config.documentType = 'pdf'; else
|
if (typeof type[3] === 'string') _config.documentType = 'pdf'; else
|
||||||
if (typeof type[4] === 'string') _config.documentType = 'word';
|
if (typeof type[4] === 'string') _config.documentType = 'word'; else
|
||||||
|
if (typeof type[5] === 'string') _config.documentType = 'diagram';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1067,6 +1069,7 @@
|
|||||||
'cell': 'spreadsheeteditor',
|
'cell': 'spreadsheeteditor',
|
||||||
'slide': 'presentationeditor',
|
'slide': 'presentationeditor',
|
||||||
'pdf': 'pdfeditor',
|
'pdf': 'pdfeditor',
|
||||||
|
'diagram': 'visioeditor',
|
||||||
'common': 'common'
|
'common': 'common'
|
||||||
},
|
},
|
||||||
appType = 'word',
|
appType = 'word',
|
||||||
@ -1075,7 +1078,7 @@
|
|||||||
isForm = false;
|
isForm = false;
|
||||||
if (config.document) {
|
if (config.document) {
|
||||||
if (typeof config.document.fileType === 'string')
|
if (typeof config.document.fileType === 'string')
|
||||||
type = /^(?:(pdf)|(djvu|xps|oxps)|(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb|numbers)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp|key)|(oform|docxf))$/
|
type = /^(?:(pdf)|(djvu|xps|oxps)|(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb|numbers)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp|key)|(oform|docxf)|(vsdx|vssx|vstx|vsdm|vssm|vstm))$/
|
||||||
.exec(config.document.fileType);
|
.exec(config.document.fileType);
|
||||||
|
|
||||||
if (config.document.permissions)
|
if (config.document.permissions)
|
||||||
@ -1098,7 +1101,8 @@
|
|||||||
appType = config.documentType.toLowerCase();
|
appType = config.documentType.toLowerCase();
|
||||||
else {
|
else {
|
||||||
if (type && typeof type[3] === 'string') appType = 'cell'; else
|
if (type && typeof type[3] === 'string') appType = 'cell'; else
|
||||||
if (type && typeof type[4] === 'string') appType = 'slide';
|
if (type && typeof type[4] === 'string') appType = 'slide'; else
|
||||||
|
if (type && typeof type[6] === 'string') appType = 'diagram';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(config.editorConfig && config.editorConfig.shardkey && config.document && config.editorConfig.shardkey!==config.document.key))
|
if (!(config.editorConfig && config.editorConfig.shardkey && config.document && config.editorConfig.shardkey!==config.document.key))
|
||||||
|
|||||||
@ -677,7 +677,8 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
cmd: function() {
|
cmd: function() {
|
||||||
const editor = packageFile.name == 'presentationeditor' ? 'slide' :
|
const editor = packageFile.name == 'presentationeditor' ? 'slide' :
|
||||||
packageFile.name == 'spreadsheeteditor' ? 'cell' : 'word';
|
packageFile.name == 'spreadsheeteditor' ? 'cell' :
|
||||||
|
packageFile.name == 'visioeditor' ? 'visio' : 'word';
|
||||||
return `npm run deploy-${editor}`;
|
return `npm run deploy-${editor}`;
|
||||||
|
|
||||||
// const addon_path = `${packageFile.mobile.js.reactjs && !!packageFile.mobile.js.reactjs.features ? `ADDON_ENV=${packageFile.mobile.js.reactjs.features}` : ''}`;
|
// const addon_path = `${packageFile.mobile.js.reactjs && !!packageFile.mobile.js.reactjs.features ? `ADDON_ENV=${packageFile.mobile.js.reactjs.features}` : ''}`;
|
||||||
@ -850,6 +851,7 @@ module.exports = function(grunt) {
|
|||||||
doRegisterInitializeAppTask('spreadsheeteditor', 'SpreadsheetEditor', 'spreadsheeteditor.json');
|
doRegisterInitializeAppTask('spreadsheeteditor', 'SpreadsheetEditor', 'spreadsheeteditor.json');
|
||||||
doRegisterInitializeAppTask('presentationeditor', 'PresentationEditor', 'presentationeditor.json');
|
doRegisterInitializeAppTask('presentationeditor', 'PresentationEditor', 'presentationeditor.json');
|
||||||
doRegisterInitializeAppTask('pdfeditor', 'PDFEditor', 'pdfeditor.json');
|
doRegisterInitializeAppTask('pdfeditor', 'PDFEditor', 'pdfeditor.json');
|
||||||
|
doRegisterInitializeAppTask('visioeditor', 'VisioEditor', 'visioeditor.json');
|
||||||
|
|
||||||
doRegisterInitializeAppTask('testdocumenteditor', 'TestDocumentEditor', 'testdocumenteditor.json');
|
doRegisterInitializeAppTask('testdocumenteditor', 'TestDocumentEditor', 'testdocumenteditor.json');
|
||||||
doRegisterInitializeAppTask('testpresentationeditor', 'TestPresentationEditor', 'testpresentationeditor.json');
|
doRegisterInitializeAppTask('testpresentationeditor', 'TestPresentationEditor', 'testpresentationeditor.json');
|
||||||
@ -871,6 +873,7 @@ module.exports = function(grunt) {
|
|||||||
grunt.registerTask('deploy-spreadsheeteditor-component', ['init-build-spreadsheeteditor', 'deploy-app']);
|
grunt.registerTask('deploy-spreadsheeteditor-component', ['init-build-spreadsheeteditor', 'deploy-app']);
|
||||||
grunt.registerTask('deploy-presentationeditor-component', ['init-build-presentationeditor', 'deploy-app']);
|
grunt.registerTask('deploy-presentationeditor-component', ['init-build-presentationeditor', 'deploy-app']);
|
||||||
grunt.registerTask('deploy-pdfeditor-component', ['init-build-pdfeditor', 'deploy-app']);
|
grunt.registerTask('deploy-pdfeditor-component', ['init-build-pdfeditor', 'deploy-app']);
|
||||||
|
grunt.registerTask('deploy-visioeditor-component', ['init-build-visioeditor', 'deploy-app']);
|
||||||
// This task is called from the Makefile, don't delete it.
|
// This task is called from the Makefile, don't delete it.
|
||||||
grunt.registerTask('deploy-documents-component', ['deploy-common-component']);
|
grunt.registerTask('deploy-documents-component', ['deploy-common-component']);
|
||||||
|
|
||||||
@ -878,6 +881,7 @@ module.exports = function(grunt) {
|
|||||||
grunt.registerTask('deploy-spreadsheeteditor', ['deploy-common-component', 'deploy-spreadsheeteditor-component']);
|
grunt.registerTask('deploy-spreadsheeteditor', ['deploy-common-component', 'deploy-spreadsheeteditor-component']);
|
||||||
grunt.registerTask('deploy-presentationeditor', ['deploy-common-component', 'deploy-presentationeditor-component']);
|
grunt.registerTask('deploy-presentationeditor', ['deploy-common-component', 'deploy-presentationeditor-component']);
|
||||||
grunt.registerTask('deploy-pdfeditor', ['deploy-common-component', 'deploy-pdfeditor-component']);
|
grunt.registerTask('deploy-pdfeditor', ['deploy-common-component', 'deploy-pdfeditor-component']);
|
||||||
|
grunt.registerTask('deploy-visioeditor', ['deploy-common-component', 'deploy-visioeditor-component']);
|
||||||
|
|
||||||
grunt.registerTask('deploy-testdocumenteditor', ['init-build-testdocumenteditor', 'deploy-app']);
|
grunt.registerTask('deploy-testdocumenteditor', ['init-build-testdocumenteditor', 'deploy-app']);
|
||||||
grunt.registerTask('deploy-testpresentationeditor', ['init-build-testpresentationeditor', 'deploy-app']);
|
grunt.registerTask('deploy-testpresentationeditor', ['init-build-testpresentationeditor', 'deploy-app']);
|
||||||
@ -887,5 +891,6 @@ module.exports = function(grunt) {
|
|||||||
'deploy-documenteditor-component',
|
'deploy-documenteditor-component',
|
||||||
'deploy-spreadsheeteditor-component',
|
'deploy-spreadsheeteditor-component',
|
||||||
'deploy-presentationeditor-component',
|
'deploy-presentationeditor-component',
|
||||||
'deploy-pdfeditor-component']);
|
'deploy-pdfeditor-component',
|
||||||
|
'deploy-visioeditor-component']);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user