mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
Fix
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
type: 'desktop or mobile or embedded',
|
||||
width: '100% by default',
|
||||
height: '100% by default',
|
||||
documentType: 'word' | 'cell' | 'slide' | 'pdf' | 'diagram' ,// deprecate 'text' | 'spreadsheet' | 'presentation',
|
||||
documentType: 'word' | 'cell' | 'slide' | 'pdf' ,// deprecate 'text' | 'spreadsheet' | 'presentation',
|
||||
token: <string> encrypted signature
|
||||
document: {
|
||||
title: 'document title',
|
||||
@ -474,12 +474,11 @@
|
||||
'word': 'docx',
|
||||
'cell': 'xlsx',
|
||||
'slide': 'pptx',
|
||||
'pdf': 'pdf',
|
||||
'diagram': 'vsdx'
|
||||
'pdf': 'pdf'
|
||||
}, app;
|
||||
|
||||
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/diagram.");
|
||||
console.warn("The \"documentType\" parameter for the config object must take one of the values word/cell/slide/pdf.");
|
||||
|
||||
if (typeof _config.documentType === 'string' && _config.documentType != '') {
|
||||
app = appMap[_config.documentType.toLowerCase()];
|
||||
@ -493,7 +492,7 @@
|
||||
|
||||
if (typeof _config.document.fileType === 'string' && _config.document.fileType != '') {
|
||||
_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)|(vsdx|vssx|vstx|vsdm|vssm|vstm))$/
|
||||
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))$/
|
||||
.exec(_config.document.fileType);
|
||||
if (!type) {
|
||||
window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it.");
|
||||
@ -502,8 +501,7 @@
|
||||
if (typeof type[1] === 'string') _config.documentType = 'cell'; else
|
||||
if (typeof type[2] === 'string') _config.documentType = 'slide'; else
|
||||
if (typeof type[3] === 'string') _config.documentType = 'pdf'; else
|
||||
if (typeof type[4] === 'string') _config.documentType = 'word'; else
|
||||
if (typeof type[5] === 'string') _config.documentType = 'diagram';
|
||||
if (typeof type[4] === 'string') _config.documentType = 'word';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1065,7 +1063,6 @@
|
||||
'cell': 'spreadsheeteditor',
|
||||
'slide': 'presentationeditor',
|
||||
'pdf': 'pdfeditor',
|
||||
'diagram': 'visioeditor',
|
||||
'common': 'common'
|
||||
},
|
||||
appType = 'word',
|
||||
@ -1074,7 +1071,7 @@
|
||||
isForm = false;
|
||||
if (config.document) {
|
||||
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)|(vsdx|vssx|vstx|vsdm|vssm|vstm))$/
|
||||
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))$/
|
||||
.exec(config.document.fileType);
|
||||
|
||||
if (config.document.permissions)
|
||||
@ -1097,8 +1094,7 @@
|
||||
appType = config.documentType.toLowerCase();
|
||||
else {
|
||||
if (type && typeof type[3] === 'string') appType = 'cell'; else
|
||||
if (type && typeof type[4] === 'string') appType = 'slide'; else
|
||||
if (type && typeof type[6] === 'string') appType = 'diagram';
|
||||
if (type && typeof type[4] === 'string') appType = 'slide';
|
||||
}
|
||||
}
|
||||
if (!(config.editorConfig && config.editorConfig.shardkey && config.document && config.editorConfig.shardkey!==config.document.key))
|
||||
|
||||
Reference in New Issue
Block a user