Refactor version display in context menu and clean up versioning format

- Updated the context menu version function to dynamically append the application version to the link and include a ref parameter in the URL.
- Removed the build version log from the initialization logs in the Artplayer class.
- Cleaned up the version and environment getters to return unquoted strings.
This commit is contained in:
Harvey Zack committed 2025-06-20 10:18:39 +08:00
1 parent da94223721
commit 7e7bd8c0ad
4 files changed
+21 -9

No files matched your search

@@ -1,6 +1,13 @@
export default function version(option) {
return {
...option,
html: `<a href="https://artplayer.org" target="_blank">ArtPlayer ${'__APP_VERSION__'}</a>`,
html: `<a href="https://artplayer.org" target="_blank">ArtPlayer</a>`,
mounted(el) {
const link = el.querySelector('a');
const version = this.constructor.version;
const ref = encodeURIComponent(location.href);
link.textContent += ` ${version}`;
link.href += `?ref=${ref}`;
},
};
}