Commit 4e06ef33 authored by konovalovsergey's avatar konovalovsergey

for bug 33808. 255 chars limit for download title.

parent f38d7537
...@@ -726,7 +726,7 @@ var editor; ...@@ -726,7 +726,7 @@ var editor;
oAdditionalData["userid"] = this.documentUserId; oAdditionalData["userid"] = this.documentUserId;
oAdditionalData["jwt"] = this.CoAuthoringApi.get_jwt(); oAdditionalData["jwt"] = this.CoAuthoringApi.get_jwt();
oAdditionalData["outputformat"] = sFormat; oAdditionalData["outputformat"] = sFormat;
oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(sFormat)); oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(sFormat), Asc.c_nMaxDownloadTitleLen);
if (DownloadType.Print === options.downloadType) { if (DownloadType.Print === options.downloadType) {
oAdditionalData["inline"] = 1; oAdditionalData["inline"] = 1;
} }
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
var c_oAscMaxColumnWidth = 255; var c_oAscMaxColumnWidth = 255;
var c_oAscMaxRowHeight = 409; var c_oAscMaxRowHeight = 409;
var c_nMaxConversionTime = 900000;//depends on config var c_nMaxConversionTime = 900000;//depends on config
var c_nMaxDownloadTitleLen= 255;
//files type for Saving & DownloadAs //files type for Saving & DownloadAs
var c_oAscFileType = { var c_oAscFileType = {
...@@ -1081,6 +1082,7 @@ ...@@ -1081,6 +1082,7 @@
window['Asc']['c_oAscMaxColumnWidth'] = window['Asc'].c_oAscMaxColumnWidth = c_oAscMaxColumnWidth; window['Asc']['c_oAscMaxColumnWidth'] = window['Asc'].c_oAscMaxColumnWidth = c_oAscMaxColumnWidth;
window['Asc']['c_oAscMaxRowHeight'] = window['Asc'].c_oAscMaxRowHeight = c_oAscMaxRowHeight; window['Asc']['c_oAscMaxRowHeight'] = window['Asc'].c_oAscMaxRowHeight = c_oAscMaxRowHeight;
window['Asc']['c_nMaxConversionTime'] = window['Asc'].c_nMaxConversionTime = c_nMaxConversionTime; window['Asc']['c_nMaxConversionTime'] = window['Asc'].c_nMaxConversionTime = c_nMaxConversionTime;
window['Asc']['c_nMaxDownloadTitleLen'] = window['Asc'].c_nMaxDownloadTitleLen = c_nMaxDownloadTitleLen;
window['Asc']['c_oAscFileType'] = window['Asc'].c_oAscFileType = c_oAscFileType; window['Asc']['c_oAscFileType'] = window['Asc'].c_oAscFileType = c_oAscFileType;
prot = c_oAscFileType; prot = c_oAscFileType;
prot['UNKNOWN'] = prot.UNKNOWN; prot['UNKNOWN'] = prot.UNKNOWN;
......
...@@ -861,10 +861,14 @@ function GetFileExtension (sName) { ...@@ -861,10 +861,14 @@ function GetFileExtension (sName) {
return sName.substring(nIndex + 1).toLowerCase(); return sName.substring(nIndex + 1).toLowerCase();
return null; return null;
} }
function changeFileExtention (sName, sNewExt) { function changeFileExtention (sName, sNewExt, opt_lengthLimit) {
var sOldExt = GetFileExtension(sName); var sOldExt = GetFileExtension(sName);
if(sOldExt) { var nIndexEnd = sOldExt ? sName.length - sOldExt.length - 1 : sName.length;
return sName.substring(0, sName.length - sOldExt.length) + sNewExt; if (opt_lengthLimit && nIndexEnd + sNewExt.length + 1 > opt_lengthLimit) {
nIndexEnd = opt_lengthLimit - sNewExt.length - 1;
}
if(nIndexEnd < sName.length) {
return sName.substring(0, nIndexEnd) + '.' + sNewExt;
} else { } else {
return sName + '.' + sNewExt; return sName + '.' + sNewExt;
} }
......
...@@ -6063,7 +6063,7 @@ background-repeat: no-repeat;\ ...@@ -6063,7 +6063,7 @@ background-repeat: no-repeat;\
oAdditionalData["userid"] = this.documentUserId; oAdditionalData["userid"] = this.documentUserId;
oAdditionalData["jwt"] = this.CoAuthoringApi.get_jwt(); oAdditionalData["jwt"] = this.CoAuthoringApi.get_jwt();
oAdditionalData["outputformat"] = filetype; oAdditionalData["outputformat"] = filetype;
oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(filetype)); oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(filetype), Asc.c_nMaxDownloadTitleLen);
oAdditionalData["savetype"] = AscCommon.c_oAscSaveTypes.CompleteAll; oAdditionalData["savetype"] = AscCommon.c_oAscSaveTypes.CompleteAll;
if (DownloadType.Print === options.downloadType) if (DownloadType.Print === options.downloadType)
{ {
......
...@@ -6464,7 +6464,7 @@ background-repeat: no-repeat;\ ...@@ -6464,7 +6464,7 @@ background-repeat: no-repeat;\
oAdditionalData["userid"] = this.documentUserId; oAdditionalData["userid"] = this.documentUserId;
oAdditionalData["jwt"] = this.CoAuthoringApi.get_jwt(); oAdditionalData["jwt"] = this.CoAuthoringApi.get_jwt();
oAdditionalData["outputformat"] = filetype; oAdditionalData["outputformat"] = filetype;
oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(filetype)); oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(filetype), Asc.c_nMaxDownloadTitleLen);
oAdditionalData["savetype"] = AscCommon.c_oAscSaveTypes.CompleteAll; oAdditionalData["savetype"] = AscCommon.c_oAscSaveTypes.CompleteAll;
if ('savefromorigin' === command) if ('savefromorigin' === command)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment