mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
update setting
This commit is contained in:
1 parent
5bd2de4179
commit
018b556d6b
6 files changed
+102
-82
No files matched your search
@@ -7,6 +7,14 @@ export default function aspectRatio(art) {
|
||||
return value === 'default' ? i18n.get('Default') : value;
|
||||
}
|
||||
|
||||
function update($panel, item, value) {
|
||||
item.$desc.innerText = getI18n(value);
|
||||
const $current = queryAll('.art-setting-item', $panel).find((item) => item.dataset.value === value);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
html: i18n.get('Aspect Ratio'),
|
||||
@@ -23,15 +31,9 @@ export default function aspectRatio(art) {
|
||||
art.aspectRatio = item.value;
|
||||
},
|
||||
mounted: ($panel, item) => {
|
||||
item.$desc.innerText = getI18n(art.aspectRatio);
|
||||
|
||||
art.on('aspectRatio', (value) => {
|
||||
item.$desc.innerText = getI18n(art.aspectRatio);
|
||||
|
||||
const $current = queryAll('.art-setting-item', $panel).find((item) => item.dataset.value === value);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
update($panel, item, art.aspectRatio);
|
||||
art.on('aspectRatio', () => {
|
||||
update($panel, item, art.aspectRatio);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -9,6 +9,14 @@ export default function flip(art) {
|
||||
vertical: 'Vertical',
|
||||
};
|
||||
|
||||
function update($panel, item, value) {
|
||||
item.$desc.innerText = i18n.get(keys[value]);
|
||||
const $current = queryAll('.art-setting-item', $panel).find((item) => item.dataset.value === value);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
html: i18n.get('Video Flip'),
|
||||
@@ -25,15 +33,9 @@ export default function flip(art) {
|
||||
art.flip = item.value;
|
||||
},
|
||||
mounted: ($panel, item) => {
|
||||
item.$desc.innerText = i18n.get(keys[art.flip]);
|
||||
|
||||
art.on('flip', (value) => {
|
||||
item.$desc.innerText = i18n.get(keys[art.flip]);
|
||||
|
||||
const $current = queryAll('.art-setting-item', $panel).find((item) => item.dataset.value === value);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
update($panel, item, art.flip);
|
||||
art.on('flip', () => {
|
||||
update($panel, item, art.flip);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -7,6 +7,14 @@ export default function playbackRate(art) {
|
||||
return value === 1.0 ? i18n.get('Normal') : value;
|
||||
}
|
||||
|
||||
function update($panel, item, value) {
|
||||
item.$desc.innerText = getI18n(value);
|
||||
const $current = queryAll('.art-setting-item', $panel).find((item) => Number(item.dataset.value) === value);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
html: i18n.get('Play Speed'),
|
||||
@@ -23,18 +31,9 @@ export default function playbackRate(art) {
|
||||
art.playbackRate = item.value;
|
||||
},
|
||||
mounted: ($panel, item) => {
|
||||
item.$desc.innerText = getI18n(art.playbackRate);
|
||||
|
||||
art.on('playbackRate', (value) => {
|
||||
item.$desc.innerText = getI18n(art.playbackRate);
|
||||
|
||||
const $current = queryAll('.art-setting-item', $panel).find(
|
||||
(item) => Number(item.dataset.value) === value,
|
||||
);
|
||||
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
update($panel, item, art.playbackRate);
|
||||
art.on('playbackRate', () => {
|
||||
update($panel, item, art.playbackRate);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -7,6 +7,14 @@ export default function subtitleOffset(art) {
|
||||
return value === 0 ? i18n.get('Normal') : value;
|
||||
}
|
||||
|
||||
function update($panel, item, value) {
|
||||
item.$desc.innerText = getI18n(value);
|
||||
const $current = queryAll('.art-setting-item', $panel).find((item) => Number(item.dataset.value) === value);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
width: 200,
|
||||
html: i18n.get('Subtitle Offset'),
|
||||
@@ -23,17 +31,9 @@ export default function subtitleOffset(art) {
|
||||
art.subtitleOffset = item.value;
|
||||
},
|
||||
mounted: ($panel, item) => {
|
||||
item.$desc.innerText = getI18n(art.subtitleOffset);
|
||||
|
||||
art.on('subtitleOffset', (value) => {
|
||||
item.$desc.innerText = getI18n(art.subtitleOffset);
|
||||
|
||||
const $current = queryAll('.art-setting-item', $panel).find(
|
||||
(item) => Number(item.dataset.value) === value,
|
||||
);
|
||||
if ($current) {
|
||||
inverseClass($current, 'art-current');
|
||||
}
|
||||
update($panel, item, art.subtitleOffset);
|
||||
art.on('subtitleOffset', () => {
|
||||
update($panel, item, art.subtitleOffset);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user