|
|
@ -1511,16 +1511,27 @@ define([
|
|
|
|
var _mediasSources = getMediasSources();
|
|
|
|
var _mediasSources = getMediasSources();
|
|
|
|
var images = _obj.data || [];
|
|
|
|
var images = _obj.data || [];
|
|
|
|
if (!Array.isArray(images)) { return; }
|
|
|
|
if (!Array.isArray(images)) { return; }
|
|
|
|
var urls = images.map(function (name) {
|
|
|
|
var urls = [];
|
|
|
|
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
|
|
|
|
images.forEach(function (name) {
|
|
|
|
|
|
|
|
if (/^data\:image/.test(name)) {
|
|
|
|
|
|
|
|
Util.fetch(name, waitFor(function (err, u8) {
|
|
|
|
|
|
|
|
if (err) { return; }
|
|
|
|
|
|
|
|
var b = new Blob([u8]);
|
|
|
|
|
|
|
|
urls.push(URL.createObjectURL(b));
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
var data = _mediasSources[name];
|
|
|
|
var data = _mediasSources[name];
|
|
|
|
if (!data) { return; }
|
|
|
|
if (!data) { return; }
|
|
|
|
var media = mediasData[data.src];
|
|
|
|
var media = mediasData[data.src];
|
|
|
|
if (!media) { return; }
|
|
|
|
if (!media) { return; }
|
|
|
|
return {
|
|
|
|
urls.push({
|
|
|
|
path: name,
|
|
|
|
path: name,
|
|
|
|
url: media.blobUrl,
|
|
|
|
url: media.blobUrl,
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}).filter(Boolean);
|
|
|
|
});
|
|
|
|
|
|
|
|
}).nThen(function () {
|
|
|
|
send({
|
|
|
|
send({
|
|
|
|
type: "documentOpen",
|
|
|
|
type: "documentOpen",
|
|
|
|
data: {
|
|
|
|
data: {
|
|
|
@ -1532,6 +1543,7 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|