i18n改用json格式

This commit is contained in:
Harvey Zack committed 2019-05-06 09:12:36 +08:00
1 parent ffd7a38b35
commit 0bc9c88af2
18 files changed
+211 -184

No files matched your search

+1 -13
View File
@@ -108,18 +108,6 @@ export function remove(child) {
return child.parentNode.removeChild(child);
}
export function insertByIndex(parent, child, index) {
const childs = Array.from(parent.children);
child.dataset.index = index;
const nextChild = childs.find(item => Number(item.dataset.index) >= Number(index));
if (nextChild) {
nextChild.insertAdjacentElement('beforebegin', child);
} else {
append(parent, child);
}
return child;
}
export function setStyle(element, key, value) {
element.style[key] = value;
return element;
@@ -171,7 +159,7 @@ export function vttToBlob(vttText) {
);
}
export function downloadImage(url, name) {
export function downloadFile(url, name) {
const elink = document.createElement('a');
setStyle(elink, 'display', 'none');
elink.href = url;