mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
重命名事件
This commit is contained in:
1 parent
a0e13479d3
commit
02915fcee5
10 files changed
+61
-61
No files matched your search
@@ -18,7 +18,7 @@ export default function setting(option) {
|
||||
setting.toggle = true;
|
||||
});
|
||||
|
||||
art.on('setting:toggle', value => {
|
||||
art.on('settingToggle', value => {
|
||||
tooltip($control, i18n.get(value ? 'Hide setting' : 'Show setting'));
|
||||
});
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function subtitle(option) {
|
||||
subtitle.toggle = true;
|
||||
});
|
||||
|
||||
art.on('subtitle:toggle', value => {
|
||||
art.on('subtitleToggle', value => {
|
||||
tooltip($control, i18n.get(value ? 'Hide subtitle' : 'Show subtitle'));
|
||||
});
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ export default class Info extends Component {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
art.on('info:toggle', value => {
|
||||
art.on('infoToggle', value => {
|
||||
clearTimeout(timer);
|
||||
if (value) {
|
||||
loop();
|
||||
|
||||
@@ -45,7 +45,7 @@ export default class Plugins {
|
||||
def(this, pluginName, {
|
||||
value: result,
|
||||
});
|
||||
this.art.emit('plugin:add', plugin);
|
||||
this.art.emit('pluginAdd', plugin);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ export default function miniProgressBar(art) {
|
||||
background: theme,
|
||||
},
|
||||
mounted($progressBar) {
|
||||
art.on('control:toggle', value => {
|
||||
art.on('controlToggle', value => {
|
||||
$progressBar.style.display = value ? 'none' : 'block';
|
||||
});
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export default class Subtitle extends Component {
|
||||
.split(/\r?\n/)
|
||||
.map((item) => `<p>${escape(item)}</p>`)
|
||||
.join('');
|
||||
this.art.emit('subtitle:update', this.activeCue.text);
|
||||
this.art.emit('subtitleUpdate', this.activeCue.text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export default class Subtitle extends Component {
|
||||
if (name) {
|
||||
notice.show = `${i18n.get('Switch subtitle')}: ${name}`;
|
||||
}
|
||||
this.art.emit('subtitle:switch', subUrl);
|
||||
this.art.emit('subtitleSwitch', subUrl);
|
||||
return subUrl;
|
||||
});
|
||||
}
|
||||
@@ -73,7 +73,7 @@ export default class Subtitle extends Component {
|
||||
return fetch(url)
|
||||
.then((response) => response.text())
|
||||
.then((text) => {
|
||||
this.art.emit('subtitle:load', url);
|
||||
this.art.emit('subtitleLoad', url);
|
||||
switch (ext || getExt(url)) {
|
||||
case 'srt':
|
||||
return vttToBlob(srtToVtt(text));
|
||||
@@ -94,7 +94,7 @@ export default class Subtitle extends Component {
|
||||
})
|
||||
.catch((err) => {
|
||||
notice.show = err;
|
||||
this.art.emit('subtitle:err', err);
|
||||
this.art.emit('subtitleErr', err);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export default class Component {
|
||||
} else {
|
||||
removeClass($player, className);
|
||||
}
|
||||
this.art.emit(`${this.name}:toggle`, value);
|
||||
this.art.emit(`${this.name}Toggle`, value);
|
||||
}
|
||||
|
||||
set toggle(value) {
|
||||
@@ -75,7 +75,7 @@ export default class Component {
|
||||
callback($ref, this, this.art);
|
||||
}
|
||||
|
||||
this.art.emit(`${this.name}:add`, option);
|
||||
this.art.emit(`${this.name}Add`, option);
|
||||
|
||||
def(this, name, {
|
||||
get: () => option,
|
||||
|
||||
Reference in new issue
Block a user