Commit fee02096 authored by Sergey Konovalov's avatar Sergey Konovalov

imgurls for video/audio object in presentation

parent 1a05afb5
...@@ -2454,23 +2454,7 @@ function CBinaryFileWriter() ...@@ -2454,23 +2454,7 @@ function CBinaryFileWriter()
if (oThis.IsUseFullUrl) { if (oThis.IsUseFullUrl) {
var displayN = oThis._isDisplayedImage(imageLocal); var displayN = oThis._isDisplayedImage(imageLocal);
if (0 != displayN) { if (0 != displayN) {
var additionalSrc = []; var additionalUrl = AscCommon.g_oDocumentUrls.getImageUrlsWithOtherExtention(imageLocal);
if (0 != (displayN & 1)) {
additionalSrc.push(AscCommon.changeFileExtention(imageLocal, "wmf"));
}
if (0 != (displayN & 2)) {
additionalSrc.push(AscCommon.changeFileExtention(imageLocal, "emf"));
}
if (0 != (displayN & 4)) {
additionalSrc.push(AscCommon.changeFileExtention(imageLocal, "bin"));
}
var additionalUrl = [];
for (var i = 0; i < additionalSrc.length; ++i) {
var imageUrl = AscCommon.g_oDocumentUrls.getImageUrl(additionalSrc[i]);
if (imageUrl) {
additionalUrl.push(imageUrl);
}
}
oThis.StartRecord(101); oThis.StartRecord(101);
oThis.WriteUChar(additionalUrl.length); oThis.WriteUChar(additionalUrl.length);
for (var i = 0; i < additionalUrl.length; ++i) { for (var i = 0; i < additionalUrl.length; ++i) {
...@@ -2505,7 +2489,7 @@ function CBinaryFileWriter() ...@@ -2505,7 +2489,7 @@ function CBinaryFileWriter()
if (-1 != index) { if (-1 != index) {
if (index + findStr.length < strName.length) { if (index + findStr.length < strName.length) {
var displayN = parseInt(strName[index + findStr.length]); var displayN = parseInt(strName[index + findStr.length]);
if (1 <= displayN && displayN <= 6) { if (!isNaN(displayN)) {
var imageIndex = index + findStr.length + 1; var imageIndex = index + findStr.length + 1;
if (imageIndex == strName.indexOf("image", imageIndex)) if (imageIndex == strName.indexOf("image", imageIndex))
res = displayN; res = displayN;
......
...@@ -241,7 +241,17 @@ ...@@ -241,7 +241,17 @@
getMaxIndex: function (url) getMaxIndex: function (url)
{ {
return this.imageCount; return this.imageCount;
} },
getImageUrlsWithOtherExtention: function(imageLocal) {
var res = [];
var filename = GetFileName(imageLocal);
for (var i in this.urls) {
if (0 == i.indexOf(this.mediaPrefix + filename + '.') && this.mediaPrefix + imageLocal !== i) {
res.push(this.urls[i]);
}
}
return res;
}
}; };
var g_oDocumentUrls = new DocumentUrls(); var g_oDocumentUrls = new DocumentUrls();
...@@ -981,6 +991,13 @@ ...@@ -981,6 +991,13 @@
return sName.substring(nIndex + 1).toLowerCase(); return sName.substring(nIndex + 1).toLowerCase();
return null; return null;
} }
function GetFileName(sName)
{
var nIndex = sName ? sName.lastIndexOf(".") : -1;
if (-1 != nIndex)
return sName.substring(0, nIndex);
return null;
}
function changeFileExtention(sName, sNewExt, opt_lengthLimit) function changeFileExtention(sName, sNewExt, opt_lengthLimit)
{ {
...@@ -3047,6 +3064,7 @@ ...@@ -3047,6 +3064,7 @@
window["AscCommon"].convertUnicodeToUTF16 = convertUnicodeToUTF16; window["AscCommon"].convertUnicodeToUTF16 = convertUnicodeToUTF16;
window["AscCommon"].convertUTF16toUnicode = convertUTF16toUnicode; window["AscCommon"].convertUTF16toUnicode = convertUTF16toUnicode;
window["AscCommon"].build_local_rx = build_local_rx; window["AscCommon"].build_local_rx = build_local_rx;
window["AscCommon"].GetFileName = GetFileName;
window["AscCommon"].GetFileExtension = GetFileExtension; window["AscCommon"].GetFileExtension = GetFileExtension;
window["AscCommon"].changeFileExtention = changeFileExtention; window["AscCommon"].changeFileExtention = changeFileExtention;
window["AscCommon"].getExtentionByFormat = getExtentionByFormat; window["AscCommon"].getExtentionByFormat = getExtentionByFormat;
......
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