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()
if (oThis.IsUseFullUrl) {
var displayN = oThis._isDisplayedImage(imageLocal);
if (0 != displayN) {
var additionalSrc = [];
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);
}
}
var additionalUrl = AscCommon.g_oDocumentUrls.getImageUrlsWithOtherExtention(imageLocal);
oThis.StartRecord(101);
oThis.WriteUChar(additionalUrl.length);
for (var i = 0; i < additionalUrl.length; ++i) {
......@@ -2505,7 +2489,7 @@ function CBinaryFileWriter()
if (-1 != index) {
if (index + findStr.length < strName.length) {
var displayN = parseInt(strName[index + findStr.length]);
if (1 <= displayN && displayN <= 6) {
if (!isNaN(displayN)) {
var imageIndex = index + findStr.length + 1;
if (imageIndex == strName.indexOf("image", imageIndex))
res = displayN;
......
......@@ -241,7 +241,17 @@
getMaxIndex: function (url)
{
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();
......@@ -981,6 +991,13 @@
return sName.substring(nIndex + 1).toLowerCase();
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)
{
......@@ -3047,6 +3064,7 @@
window["AscCommon"].convertUnicodeToUTF16 = convertUnicodeToUTF16;
window["AscCommon"].convertUTF16toUnicode = convertUTF16toUnicode;
window["AscCommon"].build_local_rx = build_local_rx;
window["AscCommon"].GetFileName = GetFileName;
window["AscCommon"].GetFileExtension = GetFileExtension;
window["AscCommon"].changeFileExtention = changeFileExtention;
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