2020-12-15 00:26:19 +01:00
|
|
|
|
<template>
|
2024-12-17 02:02:49 +01:00
|
|
|
|
<div
|
2024-12-27 23:12:41 +01:00
|
|
|
|
class="context-spawn uw-ui-area"
|
2024-12-26 17:54:05 +01:00
|
|
|
|
style="z-index: 1000;"
|
|
|
|
|
v-if="!triggerZoneEditorVisible"
|
2024-12-17 02:02:49 +01:00
|
|
|
|
>
|
|
|
|
|
<div
|
2024-12-28 00:42:40 +01:00
|
|
|
|
class="spawn-container uw-ui-trigger"
|
2024-12-17 02:02:49 +01:00
|
|
|
|
:style="triggerZoneStyles"
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2022-06-11 15:40:36 +02:00
|
|
|
|
<div
|
2024-10-24 01:47:46 +02:00
|
|
|
|
v-if="contextMenuActive || settingsInitialized && uwTriggerZoneVisible && !isGlobal"
|
2024-12-27 23:12:41 +01:00
|
|
|
|
class="context-spawn uw-clickable uw-ui-area"
|
2024-12-17 02:02:49 +01:00
|
|
|
|
style="z-index: 1001"
|
2024-12-27 23:12:41 +01:00
|
|
|
|
|
2022-06-11 15:40:36 +02:00
|
|
|
|
>
|
2024-12-17 02:02:49 +01:00
|
|
|
|
<GhettoContextMenu
|
|
|
|
|
alignment="right" class="uw-menu"
|
2024-12-27 23:12:41 +01:00
|
|
|
|
@mouseenter="() => {preventContextMenuHide(); newFeatureViewUpdate('uw6.ui-popup')}"
|
|
|
|
|
@mouseleave="allowContextMenuHide()"
|
2024-12-17 02:02:49 +01:00
|
|
|
|
>
|
2024-10-23 01:23:54 +02:00
|
|
|
|
<template v-slot:activator>
|
|
|
|
|
<div class="context-item">
|
|
|
|
|
Ultrawidify
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<slot>
|
2024-10-24 01:47:46 +02:00
|
|
|
|
|
2024-12-26 14:58:14 +01:00
|
|
|
|
<!--
|
|
|
|
|
Didn't manage to ensure that extension status pops up above other menu items in less than 3 minutes with z-index,
|
|
|
|
|
so wrapping 'status' and 'real menu items' in two different divs, ordering them in the opposite way, and then
|
|
|
|
|
ensuring correct ordering with flex-direction: column-reverse ended up being easier and faster.
|
|
|
|
|
-->
|
|
|
|
|
<div class="menu-width flex-reverse-order">
|
|
|
|
|
<div style="z-index: 1000">
|
|
|
|
|
<GhettoContextMenu alignment="right">
|
|
|
|
|
<template v-slot:activator>
|
|
|
|
|
Crop
|
|
|
|
|
</template>
|
|
|
|
|
<slot>
|
|
|
|
|
<GhettoContextMenuOption
|
|
|
|
|
v-for="(command, index) of settings?.active.commands.crop"
|
|
|
|
|
:key="index"
|
|
|
|
|
:label="command.label"
|
|
|
|
|
:shortcut="getKeyboardShortcutLabel(command)"
|
|
|
|
|
@click="execAction(command)"
|
|
|
|
|
>
|
|
|
|
|
</GhettoContextMenuOption>
|
|
|
|
|
</slot>
|
|
|
|
|
</GhettoContextMenu>
|
|
|
|
|
<GhettoContextMenu alignment="right">
|
|
|
|
|
<template v-slot:activator>
|
|
|
|
|
Stretch
|
|
|
|
|
</template>
|
|
|
|
|
<slot>
|
|
|
|
|
<GhettoContextMenuOption
|
|
|
|
|
v-for="(command, index) of settings?.active.commands.stretch"
|
|
|
|
|
:key="index"
|
|
|
|
|
:label="command.label"
|
|
|
|
|
:shortcut="getKeyboardShortcutLabel(command)"
|
|
|
|
|
@click="execAction(command)"
|
|
|
|
|
>
|
|
|
|
|
</GhettoContextMenuOption>
|
|
|
|
|
</slot>
|
|
|
|
|
</GhettoContextMenu>
|
|
|
|
|
<GhettoContextMenu alignment="right">
|
|
|
|
|
<template v-slot:activator>
|
|
|
|
|
<div class="context-item">
|
|
|
|
|
Align
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<slot>
|
|
|
|
|
<GhettoContextMenuItem :disableHover="true" :css="{'reduced-padding': true}">
|
|
|
|
|
<AlignmentOptionsControlComponent
|
|
|
|
|
:eventBus="eventBus"
|
|
|
|
|
>
|
|
|
|
|
</AlignmentOptionsControlComponent>
|
|
|
|
|
</GhettoContextMenuItem>
|
|
|
|
|
</slot>
|
|
|
|
|
</GhettoContextMenu>
|
|
|
|
|
|
|
|
|
|
<!-- shortcut for configuring UI -->
|
2024-10-24 01:47:46 +02:00
|
|
|
|
<GhettoContextMenuOption
|
2024-12-26 14:58:14 +01:00
|
|
|
|
v-if="settings.active.newFeatureTracker?.['uw6.ui-popup']?.show > 0"
|
|
|
|
|
@click="showUwWindow('playerUiSettings')"
|
2024-10-24 01:47:46 +02:00
|
|
|
|
>
|
2024-12-26 14:58:14 +01:00
|
|
|
|
<span style="color: #fa6;">I hate this popup<br/></span>
|
|
|
|
|
<span style="font-size: 0.8em">
|
|
|
|
|
<span style="text-transform: uppercase; font-size: 0.8em">
|
|
|
|
|
<a @click="showUwWindow('playerUiSettings')">
|
|
|
|
|
Do something about it
|
|
|
|
|
</a> × <a @click="acknowledgeNewFeature('uw6.ui-popup')">keep the popup</a>
|
|
|
|
|
</span>
|
|
|
|
|
<br/>
|
|
|
|
|
<span style="opacity: 0.5">This menu option will show {{settings.active.newFeatureTracker?.['uw6.ui-popup']?.show}} more<br/> times; or until clicked or dismissed.<br/>
|
|
|
|
|
Also accessible via <span style="font-variant: small-caps">extension settings</span>.
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
2024-10-24 01:47:46 +02:00
|
|
|
|
</GhettoContextMenuOption>
|
2024-12-26 14:58:14 +01:00
|
|
|
|
|
|
|
|
|
<!-- -->
|
2024-10-24 01:47:46 +02:00
|
|
|
|
<GhettoContextMenuOption
|
2024-12-26 14:58:14 +01:00
|
|
|
|
@click="showUwWindow()"
|
|
|
|
|
label="Extension settings"
|
2024-10-24 01:47:46 +02:00
|
|
|
|
>
|
|
|
|
|
</GhettoContextMenuOption>
|
2024-12-26 14:58:14 +01:00
|
|
|
|
<GhettoContextMenuOption
|
|
|
|
|
@click="showUwWindow('playerDetection')"
|
|
|
|
|
label="Incorrect cropping?"
|
|
|
|
|
>
|
|
|
|
|
</GhettoContextMenuOption>
|
|
|
|
|
<GhettoContextMenuOption
|
|
|
|
|
@click="showUwWindow('about')"
|
|
|
|
|
label="Not working?"
|
|
|
|
|
>
|
|
|
|
|
</GhettoContextMenuOption>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="z-index: 10000">
|
|
|
|
|
<GhettoContextMenuItem
|
|
|
|
|
class="extension-status-messages"
|
|
|
|
|
:disableHover="true"
|
|
|
|
|
>
|
|
|
|
|
Site compatibility:
|
|
|
|
|
<SupportLevelIndicator
|
|
|
|
|
:siteSupportLevel="siteSupportLevel"
|
2024-10-24 01:47:46 +02:00
|
|
|
|
>
|
2024-12-26 14:58:14 +01:00
|
|
|
|
</SupportLevelIndicator>
|
|
|
|
|
<div v-if="statusFlags.hasDrm" class="aard-blocked">
|
|
|
|
|
Autodetection potentially<br/>
|
|
|
|
|
unavailable due to <a href="https://en.wikipedia.org/wiki/Digital_rights_management">DRM</a>.
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="statusFlags.aardErrors?.cors" class="aard-blocked">
|
|
|
|
|
Autodetection blocked<br/>
|
|
|
|
|
by site/browser (CORS).
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="statusFlags.aardErrors?.webglError" class="aard-blocked">
|
|
|
|
|
Autodetection unavailable<br/>
|
|
|
|
|
due to webgl error.
|
|
|
|
|
</div>
|
2024-10-24 01:47:46 +02:00
|
|
|
|
</GhettoContextMenuItem>
|
2024-12-26 14:58:14 +01:00
|
|
|
|
</div>
|
2024-10-23 01:23:54 +02:00
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</GhettoContextMenu>
|
2020-12-17 01:49:28 +01:00
|
|
|
|
</div>
|
2023-01-06 18:47:42 +01:00
|
|
|
|
|
2022-06-11 15:40:36 +02:00
|
|
|
|
<div
|
2023-01-06 18:47:42 +01:00
|
|
|
|
v-if="settingsInitialized && uwWindowVisible"
|
2024-12-27 23:12:41 +01:00
|
|
|
|
class="uw-window flex flex-col uw-clickable uw-ui-area"
|
2022-06-11 15:40:36 +02:00
|
|
|
|
:class="{'fade-out': uwWindowFadeOut}"
|
|
|
|
|
>
|
2023-01-06 18:47:42 +01:00
|
|
|
|
<PlayerUIWindow
|
|
|
|
|
:settings="settings"
|
|
|
|
|
:eventBus="eventBus"
|
|
|
|
|
:logger="logger"
|
2024-06-02 16:06:26 +02:00
|
|
|
|
:in-player="!isGlobal"
|
2023-01-06 18:47:42 +01:00
|
|
|
|
:site="site"
|
2024-12-17 12:30:37 +01:00
|
|
|
|
:defaultTab="defaultWindowTab"
|
2023-01-06 18:47:42 +01:00
|
|
|
|
@close="uwWindowVisible = false"
|
|
|
|
|
@preventClose="(event) => uwWindowFadeOutDisabled = event"
|
|
|
|
|
></PlayerUIWindow>
|
2020-12-15 00:26:19 +01:00
|
|
|
|
</div>
|
2024-12-26 14:58:14 +01:00
|
|
|
|
|
|
|
|
|
<div
|
2024-12-26 17:54:05 +01:00
|
|
|
|
v-if="triggerZoneEditorVisible"
|
2024-12-27 23:12:41 +01:00
|
|
|
|
class="context-spawn uw-ui-area"
|
2024-12-28 00:42:40 +01:00
|
|
|
|
style="z-index: 1000;"
|
2024-12-26 14:58:14 +01:00
|
|
|
|
>
|
|
|
|
|
<TriggerZoneEditor
|
|
|
|
|
:settings="settings"
|
2024-12-27 23:12:41 +01:00
|
|
|
|
:eventBus="eventBus"
|
2024-12-26 14:58:14 +01:00
|
|
|
|
:playerDimensions="playerDimensions"
|
|
|
|
|
>
|
|
|
|
|
</TriggerZoneEditor>
|
|
|
|
|
</div>
|
2020-12-15 00:26:19 +01:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-10-23 01:23:54 +02:00
|
|
|
|
import PlayerUIWindow from './src/PlayerUIWindow.vue';
|
|
|
|
|
import GhettoContextMenu from './src/components/GhettoContextMenu.vue';
|
2024-10-24 01:47:46 +02:00
|
|
|
|
import GhettoContextMenuItem from './src/components/GhettoContextMenuItem.vue';
|
|
|
|
|
import GhettoContextMenuOption from './src/components/GhettoContextMenuOption.vue';
|
|
|
|
|
import AlignmentOptionsControlComponent from './src/PlayerUiPanels/AlignmentOptionsControlComponent.vue';
|
2021-01-21 00:21:15 +01:00
|
|
|
|
import BrowserDetect from '../ext/conf/BrowserDetect';
|
|
|
|
|
import Logger from '../ext/lib/Logger';
|
|
|
|
|
import Settings from '../ext/lib/Settings';
|
2022-03-29 01:53:16 +02:00
|
|
|
|
import EventBus from '../ext/lib/EventBus';
|
2023-01-04 18:09:01 +01:00
|
|
|
|
import UIProbeMixin from './src/utils/UIProbeMixin';
|
2024-10-24 01:47:46 +02:00
|
|
|
|
import KeyboardShortcutParserMixin from './src/utils/KeyboardShortcutParserMixin';
|
|
|
|
|
import CommsMixin from './src/utils/CommsMixin';
|
2024-12-26 14:58:14 +01:00
|
|
|
|
import SupportLevelIndicator from './src/components/SupportLevelIndicator.vue';
|
|
|
|
|
import TriggerZoneEditor from './src/components/TriggerZoneEditor.vue';
|
2020-12-15 00:26:19 +01:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
2024-10-23 01:23:54 +02:00
|
|
|
|
PlayerUIWindow,
|
2024-10-24 01:47:46 +02:00
|
|
|
|
GhettoContextMenu,
|
|
|
|
|
GhettoContextMenuItem,
|
|
|
|
|
GhettoContextMenuOption,
|
|
|
|
|
AlignmentOptionsControlComponent,
|
2024-12-26 14:58:14 +01:00
|
|
|
|
SupportLevelIndicator,
|
|
|
|
|
TriggerZoneEditor,
|
2020-12-15 00:26:19 +01:00
|
|
|
|
},
|
2023-01-04 18:09:01 +01:00
|
|
|
|
mixins: [
|
2024-10-24 01:47:46 +02:00
|
|
|
|
UIProbeMixin,
|
|
|
|
|
KeyboardShortcutParserMixin,
|
|
|
|
|
CommsMixin
|
2023-01-04 18:09:01 +01:00
|
|
|
|
],
|
2020-12-15 00:26:19 +01:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
2022-06-11 15:40:36 +02:00
|
|
|
|
uwTriggerZoneVisible: false,
|
|
|
|
|
uwTriggerZoneTimeout: undefined,
|
|
|
|
|
uwTriggerRegionConf: {
|
|
|
|
|
left: "10%",
|
|
|
|
|
top: "10%",
|
|
|
|
|
height: "30%",
|
|
|
|
|
width: "30%",
|
|
|
|
|
maxWidth: "24rem",
|
|
|
|
|
maxHeight: "13.37rem",
|
|
|
|
|
},
|
|
|
|
|
|
2022-06-15 00:43:36 +02:00
|
|
|
|
uwWindowFadeOutDisabled: false,
|
2022-06-11 15:40:36 +02:00
|
|
|
|
uwWindowFadeOut: false,
|
|
|
|
|
uwWindowCloseTimeout: undefined,
|
|
|
|
|
uwWindowVisible: false,
|
2024-12-26 17:54:05 +01:00
|
|
|
|
triggerZoneEditorVisible: false,
|
2022-06-11 15:40:36 +02:00
|
|
|
|
|
2021-01-21 00:21:15 +01:00
|
|
|
|
// component properties
|
|
|
|
|
settings: {},
|
2021-10-22 00:30:56 +02:00
|
|
|
|
BrowserDetect: BrowserDetect,
|
2021-01-21 00:21:15 +01:00
|
|
|
|
settingsInitialized: false,
|
2022-03-29 01:53:16 +02:00
|
|
|
|
eventBus: new EventBus(),
|
2021-01-21 00:21:15 +01:00
|
|
|
|
logger: null,
|
|
|
|
|
|
2022-03-21 00:50:03 +01:00
|
|
|
|
// NOTE: chromium doesn't allow us to access window.parent.location
|
|
|
|
|
// meaning we will have to correct this value from our uwui-probe
|
|
|
|
|
// messages ... which is a bummer.
|
|
|
|
|
site: null,
|
2022-03-22 01:23:15 +01:00
|
|
|
|
origin: '*', // will be set appropriately once the first uwui-probe event is received
|
2022-03-20 20:44:50 +01:00
|
|
|
|
lastProbeTs: null,
|
2021-11-21 02:08:53 +01:00
|
|
|
|
|
2024-06-05 01:08:50 +02:00
|
|
|
|
isGlobal: true,
|
|
|
|
|
disabled: false,
|
2024-06-02 16:06:26 +02:00
|
|
|
|
|
2024-10-24 01:47:46 +02:00
|
|
|
|
contextMenuActive: false,
|
2024-12-17 02:02:49 +01:00
|
|
|
|
triggerZoneActive: false,
|
2024-10-24 01:47:46 +02:00
|
|
|
|
|
2020-12-16 00:19:02 +01:00
|
|
|
|
uiVisible: true,
|
|
|
|
|
debugData: {
|
|
|
|
|
resizer: {},
|
|
|
|
|
player: {},
|
2020-12-16 01:40:09 +01:00
|
|
|
|
},
|
2022-03-28 23:14:52 +02:00
|
|
|
|
debugDataPrettified: '',
|
|
|
|
|
|
2024-06-05 01:08:50 +02:00
|
|
|
|
// in global overlay, this property is used to determine
|
|
|
|
|
// if closing the window should emit uw-set-ui-state
|
|
|
|
|
// event on eventBus
|
|
|
|
|
showPlayerUIAfterClose: false,
|
|
|
|
|
|
2022-07-28 00:45:27 +02:00
|
|
|
|
statusFlags: {
|
|
|
|
|
hasDrm: undefined,
|
2024-12-26 14:58:14 +01:00
|
|
|
|
aardErrors: undefined,
|
2022-07-28 00:45:27 +02:00
|
|
|
|
},
|
2024-12-17 12:30:37 +01:00
|
|
|
|
defaultWindowTab: 'videoSettings',
|
2022-07-28 00:45:27 +02:00
|
|
|
|
|
2024-06-05 01:08:50 +02:00
|
|
|
|
saveState: {},
|
2024-12-26 14:58:14 +01:00
|
|
|
|
siteSettings: undefined,
|
|
|
|
|
previewZoneVisible: false,
|
2020-12-15 00:26:19 +01:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
2021-11-21 02:08:53 +01:00
|
|
|
|
// LPT: NO ARROW FUNCTIONS IN COMPUTED,
|
|
|
|
|
// IS SUPER HARAM
|
|
|
|
|
// THINGS WILL NOT WORK IF YOU USE ARROWS
|
|
|
|
|
windowWidth() {
|
2020-12-16 01:40:09 +01:00
|
|
|
|
return window.innerWidth;
|
|
|
|
|
},
|
2021-11-21 02:08:53 +01:00
|
|
|
|
windowHeight() {
|
2020-12-16 01:40:09 +01:00
|
|
|
|
return window.innerHeight;
|
|
|
|
|
},
|
2024-12-26 14:58:14 +01:00
|
|
|
|
// LPT: NO ARROW FUNCTIONS IN COMPUTED,
|
|
|
|
|
// IS SUPER HARAM
|
|
|
|
|
// THINGS WILL NOT WORK IF YOU USE ARROWS
|
|
|
|
|
siteSupportLevel() {
|
|
|
|
|
return (this.site && this.siteSettings) ? this.siteSettings.data.type || 'no-support' : 'waiting';
|
|
|
|
|
}
|
2020-12-15 00:26:19 +01:00
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
showUi(visible) {
|
|
|
|
|
if (visible !== undefined) {
|
|
|
|
|
this.uiVisible = visible;
|
|
|
|
|
}
|
2020-12-16 00:19:02 +01:00
|
|
|
|
},
|
|
|
|
|
resizerDebugData(newData) {
|
|
|
|
|
this.debugData.resizer = newData;
|
2020-12-16 01:40:09 +01:00
|
|
|
|
this.debugDataPrettified = JSON.stringify(this.debugData, null, 2);
|
2020-12-16 00:19:02 +01:00
|
|
|
|
},
|
|
|
|
|
playerDebugData(newData) {
|
|
|
|
|
this.debugData.player = newData;
|
2020-12-16 01:40:09 +01:00
|
|
|
|
this.debugDataPrettified = JSON.stringify(this.debugData, null, 2);
|
2020-12-15 00:26:19 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
2022-03-20 20:43:49 +01:00
|
|
|
|
|
2021-01-21 00:21:15 +01:00
|
|
|
|
async created() {
|
2022-03-22 01:23:15 +01:00
|
|
|
|
this.logger = new Logger();
|
2023-01-04 18:09:01 +01:00
|
|
|
|
|
|
|
|
|
// this prolly needs to be taken out
|
2022-03-22 01:23:15 +01:00
|
|
|
|
await this.logger.init({
|
|
|
|
|
allowLogging: true,
|
|
|
|
|
});
|
2021-01-21 00:21:15 +01:00
|
|
|
|
|
2022-03-22 01:23:15 +01:00
|
|
|
|
this.settings = new Settings({afterSettingsSaved: this.updateConfig, logger: this.logger});
|
2024-12-26 14:58:14 +01:00
|
|
|
|
this.settings.listenAfterChange(() => this.updateTriggerZones());
|
|
|
|
|
|
2022-03-22 01:23:15 +01:00
|
|
|
|
await this.settings.init();
|
|
|
|
|
this.settingsInitialized = true;
|
2021-01-21 00:21:15 +01:00
|
|
|
|
|
2023-07-10 22:56:26 +02:00
|
|
|
|
// set up communication with client script.
|
|
|
|
|
// NOTE: companion onmousemove is set up in UIProbeMixin
|
2022-03-22 01:23:15 +01:00
|
|
|
|
window.addEventListener('message', event => {
|
|
|
|
|
this.handleMessage(event);
|
|
|
|
|
});
|
|
|
|
|
|
2022-07-30 00:47:11 +02:00
|
|
|
|
this.eventBus.subscribe('uw-config-broadcast', {function: (data) => {
|
2024-12-26 14:58:14 +01:00
|
|
|
|
switch (data.type) {
|
|
|
|
|
case 'drm-status':
|
|
|
|
|
this.statusFlags.hasDrm = data.hasDrm;
|
|
|
|
|
break;
|
|
|
|
|
case 'aard-error':
|
|
|
|
|
this.statusFlags.aardErrors = data.aardErrors;
|
|
|
|
|
break;
|
|
|
|
|
case 'player-dimensions':
|
|
|
|
|
this.playerDimensionsUpdate(data.data);
|
|
|
|
|
break;
|
2022-07-28 00:45:27 +02:00
|
|
|
|
}
|
2022-07-30 00:47:11 +02:00
|
|
|
|
}});
|
2024-06-02 16:06:26 +02:00
|
|
|
|
|
|
|
|
|
this.eventBus.subscribe('uw-set-ui-state', { function: (data) => {
|
2024-06-05 01:08:50 +02:00
|
|
|
|
if (data.globalUiVisible !== undefined) {
|
|
|
|
|
if (this.isGlobal) {
|
|
|
|
|
if (data.globalUiVisible) {
|
|
|
|
|
this.showUwWindow();
|
|
|
|
|
} else {
|
|
|
|
|
this.hideUwWindow(true);
|
|
|
|
|
}
|
|
|
|
|
// this.showPlayerUIAfterClose = data.showPlayerUIAfterClose;
|
|
|
|
|
} else {
|
|
|
|
|
// non global UIs are hidden while global overlay
|
|
|
|
|
// is visible and vice versa
|
|
|
|
|
// this.disabled = data.globalUiVisible;
|
|
|
|
|
this.saveState = {
|
|
|
|
|
uwWindowVisible: this.uwWindowVisible,
|
|
|
|
|
uwWindowFadeOutDisabled: this.uwWindowFadeOutDisabled,
|
|
|
|
|
uwWindowFadeOut: this.uwWindowFadeOut
|
|
|
|
|
};
|
|
|
|
|
this.uwWindowFadeOutDisabled = false;
|
|
|
|
|
this.hideUwWindow(true);
|
|
|
|
|
}
|
2024-06-02 16:06:26 +02:00
|
|
|
|
}
|
|
|
|
|
}});
|
2024-06-05 01:08:50 +02:00
|
|
|
|
|
|
|
|
|
this.eventBus.subscribe(
|
|
|
|
|
'uw-restore-ui-state',
|
|
|
|
|
{
|
|
|
|
|
function: (data) => {
|
|
|
|
|
if (this.saveState) {
|
|
|
|
|
if (this.saveState.uwWindowVisible) {
|
|
|
|
|
this.showUwWindow();
|
|
|
|
|
}
|
|
|
|
|
this.uwWindowFadeOutDisabled = this.saveState.uwWindowFadeOutDisabled;
|
|
|
|
|
this.uwWindowFadeOut = this.saveState.uwWindowFadeOut;
|
|
|
|
|
}
|
|
|
|
|
this.saveState = {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2024-12-26 14:58:14 +01:00
|
|
|
|
this.eventBus.subscribe('ui-trigger-zone-update', {
|
|
|
|
|
function: (data) => {
|
|
|
|
|
this.showTriggerZonePreview = data.previewZoneVisible;
|
|
|
|
|
// this.;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-12-26 17:54:05 +01:00
|
|
|
|
this.eventBus.subscribe(
|
|
|
|
|
'start-trigger-zone-edit',
|
|
|
|
|
{
|
|
|
|
|
function: () => {
|
|
|
|
|
this.triggerZoneEditorVisible = true;
|
|
|
|
|
this.uwWindowVisible = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2024-12-27 23:12:41 +01:00
|
|
|
|
this.eventBus.subscribe(
|
|
|
|
|
'finish-trigger-zone-edit',
|
|
|
|
|
{
|
|
|
|
|
function: () => {
|
|
|
|
|
this.triggerZoneEditorVisible = false;
|
|
|
|
|
this.showUwWindow('playerUiSettings');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2024-06-05 01:08:50 +02:00
|
|
|
|
this.sendToParentLowLevel('uwui-get-role', null);
|
|
|
|
|
this.sendToParentLowLevel('uwui-get-theme', null);
|
|
|
|
|
|
2024-12-26 14:58:14 +01:00
|
|
|
|
this.sendToParentLowLevel('uw-bus-tunnel', {
|
|
|
|
|
action: 'get-player-dimensions'
|
|
|
|
|
});
|
2020-12-15 00:26:19 +01:00
|
|
|
|
},
|
2022-03-21 00:50:03 +01:00
|
|
|
|
|
2020-12-15 00:26:19 +01:00
|
|
|
|
methods: {
|
2022-03-21 00:50:03 +01:00
|
|
|
|
/**
|
|
|
|
|
* Gets URL of the browser settings page (i think?)
|
|
|
|
|
*/
|
2020-12-22 03:14:03 +01:00
|
|
|
|
getUrl(url) {
|
2020-12-30 15:35:54 +01:00
|
|
|
|
return BrowserDetect.getURL(url);
|
2020-12-22 23:23:03 +01:00
|
|
|
|
},
|
2022-03-21 00:50:03 +01:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Mostly intended to process messages received via window.addEventListener('message').
|
|
|
|
|
* This method should include minimal logic — instead, it should only route messages
|
|
|
|
|
* to the correct function down the line.
|
|
|
|
|
*/
|
|
|
|
|
handleMessage(event) {
|
2024-06-05 01:08:50 +02:00
|
|
|
|
switch (event.data.action) {
|
|
|
|
|
case 'uwui-probe':
|
|
|
|
|
if (!this.site) {
|
|
|
|
|
this.origin = event.origin;
|
|
|
|
|
this.site = event.origin.split('//')[1];
|
2024-12-26 14:58:14 +01:00
|
|
|
|
this.siteSettings = this.settings.getSiteSettings(this.site);
|
2024-06-05 01:08:50 +02:00
|
|
|
|
}
|
|
|
|
|
return this.handleProbe(event.data, event.origin); // handleProbe is defined in UIProbeMixin
|
|
|
|
|
case 'uw-bus-tunnel':
|
|
|
|
|
return this.handleBusTunnelIn(event.data.payload);
|
|
|
|
|
case 'uwui-set-role':
|
|
|
|
|
this.isGlobal = event.data.payload.role === 'global';
|
|
|
|
|
this.sendToParentLowLevel('uwui-interface-ready', true);
|
|
|
|
|
break;
|
2022-03-21 00:50:03 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 02:02:49 +01:00
|
|
|
|
/**
|
|
|
|
|
* Handles trigger zone
|
|
|
|
|
*/
|
|
|
|
|
handleTriggerZone(mouseInside) {
|
|
|
|
|
// this.triggerZoneActive = mouseInside;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
acknowledgeNewFeature(featureKey) {
|
|
|
|
|
delete this.settings.active.newFeatureTracker[featureKey];
|
|
|
|
|
this.settings.saveWithoutReload();
|
|
|
|
|
},
|
|
|
|
|
newFeatureViewUpdate(featureKey) {
|
|
|
|
|
if (!this.settings.active.newFeatureTracker[featureKey]) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
this.settings.active.newFeatureTracker[featureKey].show--;
|
|
|
|
|
this.settings.saveWithoutReload();
|
|
|
|
|
|
|
|
|
|
if (this.settings.active.newFeatureTracker[featureKey]?.show < 0) {
|
|
|
|
|
this.acknowledgeNewFeature(featureKey);
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// do nothing
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2024-06-05 01:08:50 +02:00
|
|
|
|
/**
|
|
|
|
|
* Sends message to parent _without_ using event bus.
|
|
|
|
|
*/
|
|
|
|
|
sendToParentLowLevel(action, payload, lowLevelExtras = {}) {
|
|
|
|
|
window.parent.postMessage(
|
|
|
|
|
{
|
|
|
|
|
action, payload, ...lowLevelExtras
|
|
|
|
|
},
|
|
|
|
|
'*'
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
|
2024-10-24 01:47:46 +02:00
|
|
|
|
preventContextMenuHide() {
|
|
|
|
|
this.contextMenuActive = true;
|
|
|
|
|
},
|
|
|
|
|
allowContextMenuHide() {
|
|
|
|
|
this.contextMenuActive = false;
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 02:02:49 +01:00
|
|
|
|
setTriggerZoneActive(active, event) {
|
|
|
|
|
this.triggerZoneActive = active;
|
|
|
|
|
},
|
|
|
|
|
|
2024-12-17 12:30:37 +01:00
|
|
|
|
showUwWindow(tab) {
|
|
|
|
|
this.defaultWindowTab = tab; // can be undefined
|
|
|
|
|
|
2022-06-11 15:40:36 +02:00
|
|
|
|
this.uwWindowFadeOut = false;
|
|
|
|
|
this.uwWindowVisible = true;
|
|
|
|
|
this.uwTriggerZoneVisible = false;
|
2024-12-17 12:30:37 +01:00
|
|
|
|
this.allowContextMenuHide();
|
2022-07-28 00:45:27 +02:00
|
|
|
|
|
|
|
|
|
// refresh DRM status
|
|
|
|
|
this.eventBus.send('get-drm-status');
|
2024-06-05 01:08:50 +02:00
|
|
|
|
|
|
|
|
|
// if (this.isGlobal) {
|
|
|
|
|
// this.sendToParentLowLevel('uwui-clickable', undefined, {clickable: true});
|
|
|
|
|
// }
|
2022-06-11 15:40:36 +02:00
|
|
|
|
},
|
|
|
|
|
|
2024-06-05 01:08:50 +02:00
|
|
|
|
hideUwWindow(skipTimeout = false) {
|
2022-06-15 00:43:36 +02:00
|
|
|
|
if (this.uwWindowFadeOutDisabled) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-06-05 01:08:50 +02:00
|
|
|
|
|
|
|
|
|
const timeout = skipTimeout ? 0 : 1100;
|
|
|
|
|
|
|
|
|
|
this.uwWindowCloseTimeout = setTimeout(
|
|
|
|
|
() => {
|
|
|
|
|
this.uwWindowVisible = false;
|
|
|
|
|
|
|
|
|
|
// Global UI has some extra housekeeping to do when window gets hidden
|
|
|
|
|
if (this.isGlobal) {
|
|
|
|
|
this.sendToParentLowLevel('uwui-global-window-hidden', {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
timeout
|
|
|
|
|
);
|
2022-06-11 15:40:36 +02:00
|
|
|
|
this.uwWindowFadeOut = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
cancelUwWindowHide() {
|
|
|
|
|
this.uwWindowFadeOut = false;
|
|
|
|
|
clearTimeout(this.uwWindowCloseTimeout);
|
|
|
|
|
},
|
|
|
|
|
|
2022-03-29 01:53:16 +02:00
|
|
|
|
handleBusTunnelIn(payload) {
|
2024-06-05 01:08:50 +02:00
|
|
|
|
this.eventBus.send(payload.action, payload.config, payload.routingData);
|
2022-03-21 00:50:03 +01:00
|
|
|
|
}
|
2020-12-15 00:26:19 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2024-10-24 01:47:46 +02:00
|
|
|
|
<style lang="scss">
|
|
|
|
|
.ard-blocked {
|
|
|
|
|
color: rgb(219, 125, 48) !important;
|
|
|
|
|
background-color: rgba(0,0,0,0.85) !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2024-12-27 23:12:41 +01:00
|
|
|
|
|
|
|
|
|
<style lang="scss" src="./src/res-common/panels.scss" scoped module></style>
|
|
|
|
|
<style lang="scss" src="./src/res-common/common.scss" scoped module></style>
|
|
|
|
|
|
2022-01-29 16:23:40 +01:00
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
|
|
.uw-hover {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 999999999999999999;
|
|
|
|
|
}
|
2022-06-11 15:40:36 +02:00
|
|
|
|
|
2024-10-24 01:47:46 +02:00
|
|
|
|
.reduced-padding {
|
|
|
|
|
padding: 1rem !important;
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-11 15:40:36 +02:00
|
|
|
|
.uv-hover-trigger-region {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
border: 0.5rem dashed #fff;
|
|
|
|
|
color: #fff;
|
|
|
|
|
backdrop-filter: blur(0.5rem) brightness(0.5);
|
2022-01-29 16:23:40 +01:00
|
|
|
|
}
|
2020-12-17 01:49:28 +01:00
|
|
|
|
|
2023-01-06 18:47:42 +01:00
|
|
|
|
.uw-window {
|
2024-12-27 04:40:30 +01:00
|
|
|
|
position: fixed;
|
2021-10-19 22:49:56 +02:00
|
|
|
|
|
2022-01-29 16:23:40 +01:00
|
|
|
|
top: 10%;
|
|
|
|
|
left: 10%;
|
2020-12-17 01:49:28 +01:00
|
|
|
|
|
2022-01-29 16:23:40 +01:00
|
|
|
|
z-index: 999999999999999999;
|
2020-12-16 01:40:09 +01:00
|
|
|
|
|
2022-01-29 16:23:40 +01:00
|
|
|
|
width: 2500px;
|
|
|
|
|
height: 1200px;
|
|
|
|
|
max-width: 80%;
|
|
|
|
|
max-height: 80%;
|
2020-12-16 01:40:09 +01:00
|
|
|
|
|
2022-01-29 16:23:40 +01:00
|
|
|
|
pointer-events: all !important;
|
2020-12-16 01:40:09 +01:00
|
|
|
|
|
2023-01-06 18:47:42 +01:00
|
|
|
|
opacity: 1;
|
2022-01-29 16:23:40 +01:00
|
|
|
|
backdrop-filter: blur(16px) saturate(120%);
|
2021-10-22 00:30:56 +02:00
|
|
|
|
|
2022-06-11 15:40:36 +02:00
|
|
|
|
&.fade-out {
|
|
|
|
|
opacity: 0;
|
2023-01-06 18:47:42 +01:00
|
|
|
|
transition: opacity 0.5s;
|
|
|
|
|
transition-delay: 0.5s;
|
2022-06-11 15:40:36 +02:00
|
|
|
|
}
|
2022-01-29 16:23:40 +01:00
|
|
|
|
}
|
2020-12-15 00:26:19 +01:00
|
|
|
|
|
2024-10-24 01:47:46 +02:00
|
|
|
|
.gib-bg {
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
|
backdrop-filter: blur(16px) saturate(120%);
|
|
|
|
|
|
|
|
|
|
width: fit-content;
|
|
|
|
|
block-size: fit-content;
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-23 01:23:54 +02:00
|
|
|
|
|
|
|
|
|
.context-spawn {
|
|
|
|
|
position: absolute;
|
2024-12-27 04:40:30 +01:00
|
|
|
|
top: 0;
|
2024-10-23 01:23:54 +02:00
|
|
|
|
left: 0;
|
2024-12-27 04:40:30 +01:00
|
|
|
|
|
|
|
|
|
width: 100dvw;
|
|
|
|
|
height: 100dvh;
|
|
|
|
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
2024-10-23 01:23:54 +02:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
// width: 100%;
|
|
|
|
|
// height: 100%;
|
|
|
|
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
2024-10-24 01:47:46 +02:00
|
|
|
|
// .context-item {
|
|
|
|
|
// font-size: .95rem;
|
|
|
|
|
// padding: 1rem 1.6rem;
|
|
|
|
|
// background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
|
// backdrop-filter: blur(16px) saturate(120%);
|
2024-10-23 01:23:54 +02:00
|
|
|
|
|
2024-10-24 01:47:46 +02:00
|
|
|
|
// white-space: nowrap;
|
|
|
|
|
// }
|
2024-12-17 02:02:49 +01:00
|
|
|
|
|
|
|
|
|
// .spawn-container {
|
|
|
|
|
// border: 1px solid white;
|
|
|
|
|
// }
|
2024-10-23 01:23:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-26 14:58:14 +01:00
|
|
|
|
.extension-status-messages {
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
width: 112.25%;
|
|
|
|
|
transform: translate(-12.5%, 12.5%) scale(0.75);
|
|
|
|
|
|
|
|
|
|
> * {
|
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.flex-reverse-order {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column-reverse;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.aard-blocked {
|
|
|
|
|
color: #fa6;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.trigger-zone-preview {
|
|
|
|
|
border: 4px solid #fa4;
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-27 23:12:41 +01:00
|
|
|
|
.debug-1 {
|
|
|
|
|
border: 1px solid yellow;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background-color: rbba(255,255,0,0.5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.debug-2 {
|
|
|
|
|
border: 1px solid blue;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
background-color: rbba(0,0,255,.5);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-10-19 22:49:56 +02:00
|
|
|
|
</style>
|