Compare commits

..

11 Commits

Author SHA1 Message Date
8e7f7c20e4 nodejs: fix opening history without changes 2017-09-14 16:07:53 +03:00
b3f7e9861f Merge remote-tracking branch 'remotes/origin/release/v5.0.0' into develop
# Conflicts:
#	web/documentserver-example/nodejs/config/default.json
#	web/documentserver-example/nodejs/helpers/fileUtility.js
2017-09-07 15:58:30 +03:00
797696ceea Merge branch 'feature/m-formats' into develop 2017-09-07 15:54:54 +03:00
af30096d71 Fix editable formats list 2017-09-07 15:54:14 +03:00
8a7193a645 support template formats 2017-09-07 15:52:47 +03:00
84f5be3556 change viewed formats list 2017-09-07 15:47:47 +03:00
cff90de454 nodejs: edit link only for editable format 2017-09-07 13:51:33 +03:00
18b7bdb401 support convertation -m formats to -x 2017-09-07 12:28:46 +03:00
908affc61c Fix Bug 35704 - commenting in review mode 2017-08-28 17:17:45 +03:00
c5b227d278 remove preselected lang value (Bug 35603) 2017-08-28 16:08:32 +03:00
74537582d7 support -m formats 2017-08-04 17:39:02 +03:00
15 changed files with 94 additions and 66 deletions

View File

@ -51,22 +51,26 @@ namespace OnlineEditorsExampleMVC.Models
public static readonly List<string> ExtsDocument = new List<string>
{
".docx", ".doc", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx",
".ods", ".fods", ".csv"
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv"
};
public static readonly List<string> ExtsPresentation = new List<string>
{
".pps", ".ppsx",
".ppt", ".pptx",
".odp", ".fodp"
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp"
};
}
}

View File

@ -9,9 +9,9 @@
<add key="filesize-max" value="5242880"/>
<add key="files.docservice.viewed-docs" value=".ppt|.pps|.odp|.fodp|.pdf|.djvu|.epub|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.doc|.odt|.fodt|.xlsx|.xls|.ods|.fods|.csv|.pptx|.ppsx|.rtf|.txt|.mht|.html|.htm"/>
<add key="files.docservice.convert-docs" value=".doc|.odt|.fodt|.xls|.ods|.fods|.ppt|.pps|.odp|.fodp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.xlsx|.csv|.pptx|.ppsx|.txt"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.url.storage" value="https://doc.onlyoffice.com/FileUploader.ashx"/>

View File

@ -42,22 +42,26 @@ namespace OnlineEditorsExample
{
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx",
".ods", ".fods", ".csv"
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv"
};
public static readonly List<string> ExtsPresentation = new List<string>
{
".pps", ".ppsx",
".ppt", ".pptx",
".odp", ".fodp"
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp"
};
public static readonly List<string> ExtsDocument = new List<string>
{
".docx", ".doc", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
};
public static string GetInternalExtension(string extension)

View File

@ -5,9 +5,9 @@
<add key="filesize-max" value="5242880"/>
<add key="storage-path" value=""/>
<add key="files.docservice.viewed-docs" value=".ppt|.pps|.odp|.fodp|.pdf|.djvu|.epub|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.doc|.odt|.fodt|.xlsx|.xls|.ods|.fods|.csv|.pptx|.ppsx|.rtf|.txt|.mht|.html|.htm"/>
<add key="files.docservice.convert-docs" value=".doc|.odt|.fodt|.xls|.ods|.fods|.ppt|.pps|.odp|.fodp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.viewed-docs" value=".pdf|.djvu|.xps"/>
<add key="files.docservice.edited-docs" value=".docx|.xlsx|.csv|.pptx|.ppsx|.txt"/>
<add key="files.docservice.convert-docs" value=".docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub"/>
<add key="files.docservice.timeout" value="120000" />
<add key="files.docservice.url.storage" value="https://doc.onlyoffice.com/FileUploader.ashx"/>

View File

@ -37,14 +37,14 @@ import java.util.Map;
public class FileUtility
{
static {}
public static FileType GetFileType(String fileName)
{
String ext = GetFileExtension(fileName).toLowerCase();
if (ExtsDocument.contains(ext))
return FileType.Text;
if (ExtsSpreadsheet.contains(ext))
return FileType.Spreadsheet;
@ -56,26 +56,33 @@ public class FileUtility
public static List<String> ExtsDocument = Arrays.asList
(
".docx", ".doc", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps"
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps"
);
public static List<String> ExtsSpreadsheet = Arrays.asList
(
".xls", ".xlsx", ".ods", ".fods", ".csv"
".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv"
);
public static List<String> ExtsPresentation = Arrays.asList
(
".pps", ".ppsx", ".ppt", ".pptx", ".odp", ".fodp"
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp"
);
public static String GetFileName (String url)
{
if(url == null) return null;
//for external file url
String tempstorage = ConfigManager.GetProperty("files.docservice.url.tempstorage");
if(!tempstorage.isEmpty() && url.startsWith(tempstorage))
@ -87,7 +94,7 @@ public class FileUtility
String fileName = url.substring(url.lastIndexOf('/')+1, url.length());
return fileName;
}
public static String GetFileNameWithoutExtension (String url)
{
String fileName = GetFileName(url);

View File

@ -1,9 +1,9 @@
filesize-max=5242880
storage-folder=app_data
files.docservice.viewed-docs=.ppt|.pps|.odp|.fodp|.pdf|.djvu|.epub|.xps
files.docservice.edited-docs=.docx|.doc|.odt|.fodt|.xlsx|.xls|.ods|.fods|.csv|.pptx|.ppsx|.rtf|.txt|.mht|.html|.htm
files.docservice.convert-docs=.doc|.odt|.fodt|.xls|.ods|.fods|.ppt|.pps|.odp|.fodp|.rtf|.mht|.html|.htm|.epub
files.docservice.viewed-docs=.pdf|.djvu|.xps
files.docservice.edited-docs=.docx|.xlsx|.csv|.pptx|.ppsx|.txt
files.docservice.convert-docs=.docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub
files.docservice.timeout=120000
files.docservice.url.storage=https://doc.onlyoffice.com/FileUploader.ashx

View File

@ -73,8 +73,8 @@ function key(k) {
};
var getDocumentType = function (ext) {
if (".docx.doc.odt.fodt.rtf.txt.html.htm.mht.pdf.djvu.fb2.epub.xps".indexOf(ext) != -1) return "text";
if (".xls.xlsx.ods.fods.csv".indexOf(ext) != -1) return "spreadsheet";
if (".pps.ppsx.ppt.pptx.odp.fodp".indexOf(ext) != -1) return "presentation";
if (".doc.docx.docm.dot.dotx.dotm.odt.rtf.txt.html.htm.mht.pdf.djvu.fb2.epub.xps".indexOf(ext) != -1) return "text";
if (".xls.xlsx.xlsm.xlt.xltx.xltm.ods.csv".indexOf(ext) != -1) return "spreadsheet";
if (".pps.ppsx.ppsm.ppt.pptx.pptm.pot.potx.potm.odp".indexOf(ext) != -1) return "presentation";
return null;
};

View File

@ -550,14 +550,15 @@ app.get("/editor", function (req, res) {
key: keyVersion,
url: i == countVersion ? url : (docManager.getlocalFileUri(fileName, i, true) + "/prev" + fileUtility.getFileExtension(fileName)),
};
if (i > 1) {
if (i > 1 && docManager.existsSync(docManager.diffPath(fileName, userAddress, i-1))) {
historyD.previous = {
key: historyData[i-2].key,
url: historyData[i-2].url,
};
historyD.changesUrl = docManager.getlocalFileUri(fileName, i-1) + "/diff.zip";
}
historyData.push(historyD);
if (i < countVersion) {

View File

@ -20,9 +20,9 @@
"apiUrl": "web-apps/apps/api/documents/api.js",
"preloaderUrl": "web-apps/apps/api/documents/cache-scripts.html",
"exampleUrl": null,
"viewedDocs": [".ppt", ".pps", ".odp", ".fodp", ".pdf", ".djvu", ".epub", ".xps"],
"editedDocs": [".docx", ".doc", ".odt", ".fodt", ".xlsx", ".xls", ".ods", ".fods", ".csv", ".pptx", ".ppsx", ".rtf", ".txt", ".mht", ".html", ".htm"],
"convertedDocs": [".doc", ".odt", ".fodt", ".xls", ".ods", ".fods", ".ppt", ".pps", ".odp", ".fodp", ".rtf", ".mht", ".html", ".htm", ".epub", ".docm", ".dot", ".dotm", ".dotx", ".xlsm", ".xlt", ".xltm", ".xltx", ".pot", ".potm", ".potx", ".ppsm", ".pptm"],
"viewedDocs": [".pdf", ".djvu", ".xps"],
"editedDocs": [".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt"],
"convertedDocs": [".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".rtf", ".mht", ".html", ".htm", ".epub"],
"storageFolder": "files",
"maxFileSize": 1073741824,
"mobileRegEx": "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino",

View File

@ -244,7 +244,8 @@ docManager.getStoredFiles = function () {
const item = {
time: time,
name: storedFiles[i],
documentType: fileUtility.getFileType(storedFiles[i])
documentType: fileUtility.getFileType(storedFiles[i]),
canEdit: configServer.get("editedDocs").indexOf(fileUtility.getFileExtension(storedFiles[i])) != -1
};
if (!result.length) {
@ -313,7 +314,10 @@ docManager.getDate = function (date) {
};
docManager.getChanges = function (fileName) {
return JSON.parse(fileSystem.readFileSync(fileName));
if (this.existsSync(fileName)) {
return JSON.parse(fileSystem.readFileSync(fileName));
}
return null;
};
docManager.countVersion = function(directory) {

View File

@ -77,11 +77,11 @@ fileUtility.fileType = {
presentation: "presentation"
}
fileUtility.documentExts = [".docx", ".doc", ".odt", ".fodt", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps", ".docm", ".dot", ".dotm", ".dotx"];
fileUtility.documentExts = [".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".ods", ".fods", ".csv", ".xlsm", ".xlt", ".xltm", ".xltx"];
fileUtility.spreadsheetExts = [".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".csv"];
fileUtility.presentationExts = [".pps", ".ppsx", ".ppt", ".pptx", ".odp", ".fodp", ".pot", ".potm", ".potx", ".ppsm", ".pptm"];
fileUtility.presentationExts = [".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp"];
function getUrlParams(url) {
try {

View File

@ -63,7 +63,7 @@
<tr>
<td valign="middle" width="30%">
<select class="select-user" id="language">
<option value="en" selected>English</option>
<option value="en">English</option>
<option value="de">Deutsch</option>
<option value="es">Espanol</option>
<option value="fr">Francais</option>
@ -145,6 +145,7 @@
<a class="delete-file" data="<%= encodeURIComponent(storedFiles[i].name) %>">
<img class="icon-delete" src="images/delete-24.png" alt="Delete" title="Delete" /></a>
</td>
<% if (storedFiles[i].canEdit) { %>
<td class="contentCells contentCells-icon">
<a href="editor?type=desktop&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/desktop-24.png" alt="Open in editor for full size screens" title="Open in editor for full size screens" /></a>
@ -165,6 +166,9 @@
<img src="images/comment-24.png" alt="Open in editor for comment" title="Open in editor for comment" /></a>
<% } %>
</td>
<% } else { %>
<td class="contentCells contentCells-shift contentCells-icon" colspan="4"></td>
<% } %>
<td class="contentCells contentCells-icon">
<a href="editor?type=desktop&mode=view&fileName=<%= encodeURIComponent(storedFiles[i].name) + params %>" target="_blank">
<img src="images/desktop-24.png" alt="Open in viewer for full size screens" title="Open in viewer for full size screens" /></a>

View File

@ -6,9 +6,9 @@ $GLOBALS['ALONE'] = FALSE;
$GLOBALS['MODE'] = "";
$GLOBALS['DOC_SERV_VIEWD'] = array(".ppt",".pps",".odp",".fodp",".pdf",".djvu",".epub",".xps");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx",".doc",".odt",".fodt",".xlsx",".xls",".ods",".fods",".csv",".pptx",".ppsx",".rtf",".txt",".mht",".html",".htm");
$GLOBALS['DOC_SERV_CONVERT'] = array(".doc",".odt",".fodt",".xls",".ods",".fods",".ppt",".pps",".odp",".fodp",".rtf",".mht",".html",".htm",".epub");
$GLOBALS['DOC_SERV_VIEWD'] = array(".pdf", ".djvu", ".xps");
$GLOBALS['DOC_SERV_EDITED'] = array(".docx", ".xlsx", ".csv", ".pptx", ".ppsx", ".txt");
$GLOBALS['DOC_SERV_CONVERT'] = array(".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".rtf", ".mht", ".html", ".htm", ".epub");
$GLOBALS['DOC_SERV_TIMEOUT'] = "120000";
@ -23,16 +23,20 @@ $GLOBALS['EXAMPLE_URL'] = "";
$GLOBALS['MOBILE_REGEX'] = "android|avantgo|playbook|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino";
$GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx",
".ods", ".fods", ".csv");
$GLOBALS['ExtsSpreadsheet'] = array(".xls", ".xlsx", ".xlsm",
".xlt", ".xltx", ".xltm",
".ods", ".csv");
$GLOBALS['ExtsPresentation'] = array(".pps", ".ppsx",
".ppt", ".pptx",
".odp", ".fodp");
$GLOBALS['ExtsPresentation'] = array(".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp");
$GLOBALS['ExtsDocument'] = array(".docx", ".doc", ".odt", ".fodt", ".rtf", ".txt",
".html", ".htm", ".mht", ".pdf", ".djvu",
".fb2", ".epub", ".xps");
$GLOBALS['ExtsDocument'] = array(".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".rtf", ".txt",
".html", ".htm", ".mht",
".pdf", ".djvu", ".fb2", ".epub", ".xps");
if ( !defined('ServiceConverterMaxTry') )
define( 'ServiceConverterMaxTry', 3);

View File

@ -1,10 +1,10 @@
class FileUtility
@@exts_document = %w(.docx .doc .odt .fodt .rtf .txt .html .htm .mht .pdf .djvu .fb2 .epub .xps)
@@exts_document = %w(.doc .docx .docm .dot .dotx .dotm .odt .rtf .txt .html .htm .mht .pdf .djvu .fb2 .epub .xps)
@@exts_spreadsheet = %w(.xls .xlsx .ods .fods .csv)
@@exts_spreadsheet = %w(.xls .xlsx .xlsm .xlt .xltx .xltm .ods .csv)
@@exts_presentation = %w(.pps .ppsx .ppt .pptx .odp .fodp)
@@exts_presentation = %w(.pps .ppsx .ppsm .ppt .pptx .pptm .pot .potx .potm .odp)
class << self

View File

@ -35,9 +35,9 @@ module OnlineEditorsExampleRuby
Rails.configuration.storagePath="app_data"
Rails.configuration.timeout=120
Rails.configuration.viewedDocs=".ppt|.pps|.odp|.fodp|.pdf|.djvu|.epub|.xps"
Rails.configuration.editedDocs=".docx|.doc|.odt|.fodt|.xlsx|.xls|.ods|.fods|.csv|.pptx|.ppsx|.rtf|.txt|.mht|.html|.htm"
Rails.configuration.convertDocs=".doc|.odt|.fodt|.xls|.ods|.fods|.ppt|.pps|.odp|.fodp|.rtf|.mht|.html|.htm|.epub"
Rails.configuration.viewedDocs=".pdf|.djvu|.xps"
Rails.configuration.editedDocs=".docx|.xlsx|.csv|.pptx|.ppsx|.txt"
Rails.configuration.convertDocs=".docm|.dotx|.dotm|.dot|.doc|.odt|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.pptm|.ppt|.ppsm|.pps|.potx|.potm|.pot|.odp|.rtf|.mht|.html|.htm|.epub"
Rails.configuration.urlStorage="https://doc.onlyoffice.com/FileUploader.ashx"
Rails.configuration.urlConverter="https://doc.onlyoffice.com/ConvertService.ashx"