diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index abe0c0325..abf79f0c5 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -14,7 +14,7 @@ type: 'desktop or mobile', width: '100% by default', height: '100% by default', - documentType: 'text' | 'spreadsheet' | 'presentation', + documentType: 'word' | 'cell' | 'slide',// deprecate 'text' | 'spreadsheet' | 'presentation', document: { title: 'document title', url: 'document url' @@ -163,7 +163,7 @@ type: 'embedded', width: '100% by default', height: '100% by default', - documentType: 'text' | 'spreadsheet' | 'presentation', + documentType: 'word' | 'cell' | 'slide',// deprecate 'text' | 'spreadsheet' | 'presentation', document: { title: 'document title', url: 'document url', @@ -334,9 +334,15 @@ 'text': 'docx', 'text-pdf': 'pdf', 'spreadsheet': 'xlsx', - 'presentation': 'pptx' + 'presentation': 'pptx', + 'word': 'docx', + 'cell': 'xlsx', + 'slide': 'pptx' }, 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."); + if (typeof _config.documentType === 'string' && _config.documentType != '') { app = appMap[_config.documentType.toLowerCase()]; if (!app) { @@ -355,9 +361,9 @@ window.alert("The \"document.fileType\" parameter for the config object is invalid. Please correct it."); return false; } else if (typeof _config.documentType !== 'string' || _config.documentType == ''){ - if (typeof type[1] === 'string') _config.documentType = 'spreadsheet'; else - if (typeof type[2] === 'string') _config.documentType = 'presentation'; else - if (typeof type[3] === 'string') _config.documentType = 'text'; + 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 = 'word'; } } @@ -737,9 +743,12 @@ 'text': 'documenteditor', 'text-pdf': 'documenteditor', 'spreadsheet': 'spreadsheeteditor', - 'presentation': 'presentationeditor' + 'presentation': 'presentationeditor', + 'word': 'documenteditor', + 'cell': 'spreadsheeteditor', + 'slide': 'presentationeditor' }, - app = appMap['text']; + app = appMap['word']; if (typeof config.documentType === 'string') { app = appMap[config.documentType.toLowerCase()]; @@ -748,8 +757,8 @@ var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp))$/ .exec(config.document.fileType); if (type) { - if (typeof type[1] === 'string') app = appMap['spreadsheet']; else - if (typeof type[2] === 'string') app = appMap['presentation']; + if (typeof type[1] === 'string') app = appMap['cell']; else + if (typeof type[2] === 'string') app = appMap['slide']; } } diff --git a/apps/api/documents/index.html.desktop b/apps/api/documents/index.html.desktop index 8f6aea8a6..531e301c3 100644 --- a/apps/api/documents/index.html.desktop +++ b/apps/api/documents/index.html.desktop @@ -53,7 +53,7 @@ type: urlParams['type'], width: '100%', height: '100%', - documentType: urlParams['doctype'] || 'text', + documentType: urlParams['doctype'] || 'word', document: doc, editorConfig: cfg, events: { diff --git a/apps/common/main/lib/controller/ExternalDiagramEditor.js b/apps/common/main/lib/controller/ExternalDiagramEditor.js index de9662b41..d74983b0b 100644 --- a/apps/common/main/lib/controller/ExternalDiagramEditor.js +++ b/apps/common/main/lib/controller/ExternalDiagramEditor.js @@ -59,7 +59,7 @@ define([ externalEditor = new DocsAPI.DocEditor('id-diagram-editor-placeholder', { width : '100%', height : '100%', - documentType: 'spreadsheet', + documentType: 'cell', document : { url : '_chart_', permissions : { diff --git a/apps/common/main/lib/controller/ExternalMergeEditor.js b/apps/common/main/lib/controller/ExternalMergeEditor.js index d9ac85562..69e659c22 100644 --- a/apps/common/main/lib/controller/ExternalMergeEditor.js +++ b/apps/common/main/lib/controller/ExternalMergeEditor.js @@ -58,7 +58,7 @@ define([ externalEditor = new DocsAPI.DocEditor('id-merge-editor-placeholder', { width : '100%', height : '100%', - documentType: 'spreadsheet', + documentType: 'cell', document : { url : '_chart_', permissions : {