Compare commits

..

No commits in common. "b5e480a48677039e7179cf11fbc573f71118878b" and "46d1ad221f203872c7330b07735fb6c409b2c78d" have entirely different histories.

7 changed files with 26 additions and 92 deletions

View File

@ -183,8 +183,7 @@ interface SettingsInterface {
offsetX: number, // fed to translateX(offsetX + '%'). Valid range [-100, 0]
offsetY: number // fed to translateY(offsetY + '%'). Valid range [-100, 100]
},
},
devMode?: boolean,
}
}
restrictions?: RestrictionsSettings;

View File

@ -30,26 +30,22 @@
<div
v-for="tab of tabs"
:key="tab.id"
class="tab"
:class="{
'active': tab.id === selectedTab,
'highlight-tab': tab.highlight,
}"
@click="selectTab(tab.id)"
>
<div
v-if="!tab.hidden"
class="tab"
:class="{
'active': tab.id === selectedTab,
'highlight-tab': tab.highlight,
}"
@click="selectTab(tab.id)"
>
<div class="icon-container">
<mdicon
v-if="tab.icon"
:name="tab.icon"
:size="32"
/>
</div>
<div class="label">
{{tab.label}}
</div>
<div class="icon-container">
<mdicon
v-if="tab.icon"
:name="tab.icon"
:size="32"
/>
</div>
<div class="label">
{{tab.label}}
</div>
</div>
</div>
@ -175,7 +171,7 @@ export default {
// {id: 'advancedOptions', label: 'Advanced options', icon: 'cogs' },
{id: 'changelog', label: 'What\'s new', icon: 'alert-decagram' },
{id: 'about', label: 'About', icon: 'information-outline'},
{id: 'debugging', label: 'Debugging', icon: 'bug-outline', hidden: true},
{id: 'debugging', label: 'Debugging', icon: 'bug-outline' },
],
selectedTab: 'extensionSettings',
BrowserDetect: BrowserDetect,
@ -200,8 +196,6 @@ export default {
}
},
created() {
this.settings.listenAfterChange(this.setDebugTabVisibility);
if (this.defaultTab) {
this.selectedTab = this.defaultTab;
}
@ -219,10 +213,8 @@ export default {
},
}
)
this.setDebugTabVisibility();
},
destroyed() {
this.settings.removeListenerAfterChange(this.setDebugTabVisibility);
this.eventBus.unsubscribeAll(this);
},
methods: {
@ -238,12 +230,6 @@ export default {
setPreventClose(bool) {
this.preventClose = bool;
this.$emit('preventClose', bool);
},
setDebugTabVisibility() {
const debugTab = this.tabs.find( x => x.id === 'debugging');
if (debugTab) {
debugTab.hidden = !this.settings.active.ui.devMode;
}
}
}
}

View File

@ -90,15 +90,11 @@
<div v-if="enableSettingsEditor" class="field">
<div class="label">Show developer options</div>
<input
type="checkbox"
v-model="settings.active.ui.devMode"
@change="settings.saveWithoutReload"
>
<input v-model="showSettingsEditor" type="checkbox">
</div>
</div>
</div>
<div v-if="enableSettingsEditor && settings.active.ui.devMode" class="h-full grow">
<div v-if="enableSettingsEditor && showSettingsEditor" class="h-full grow">
<h2>Settings editor</h2>
<div class="flex flex-row w-full">
<div class="flex flex-row">
@ -148,6 +144,7 @@ export default {
return {
tab: 'siteSettings',
importSettingDialogConfig: {visible: false},
showSettingsEditor: false,
allowSettingsEditing: false,
editorSaveFinished: false,
settingsJson: {},
@ -209,6 +206,7 @@ export default {
},
handleImportedSettings(newSettings) {
console.log('new settings received:', newSettings)
this.importSettingDialogConfig = {
visible: true,
confirm: () => {
@ -237,12 +235,14 @@ export default {
},
saveSettingsChanges() {
console.log(' saving settings changes ...', this.allowSettingsEditing)
if (this.allowSettingsEditing) {
this.settings.active = this.settingsJson;
this.settings.saveWithoutReload();
this.resetSettingsEditor();
this.editorSaveFinished = true;
console.log('save finished ...')
setTimeout(() => {
this.editorSaveFinished = false;
}, 3000);

View File

@ -37,8 +37,8 @@ class Settings {
onSettingsChanged: any;
afterSettingsSaved: any;
onChangedCallbacks: (() => void)[] = [];
afterSettingsChangedCallbacks: (() => void)[] = [];
onChangedCallbacks: any[] = [];
afterSettingsChangedCallbacks: any[] = [];
//#endregion
constructor(options) {
@ -398,15 +398,9 @@ class Settings {
listenOnChange(fn: () => void): void {
this.onChangedCallbacks.push(fn);
}
removeOnChangeListener(fn: () => void): void {
this.onChangedCallbacks = this.afterSettingsChangedCallbacks.filter(x => x !== fn);
}
listenAfterChange(fn: () => void): void {
this.afterSettingsChangedCallbacks.push(fn);
}
removeAfterChangeListener(fn: () => void): void {
this.afterSettingsChangedCallbacks = this.afterSettingsChangedCallbacks.filter(x => x !== fn);
}
}
export default Settings;

View File

@ -1,14 +0,0 @@
import { log } from 'console';
export class LogAggregator {
history: any[];
log(message: any, originData: any) {
}
}

View File

@ -1,21 +0,0 @@
export default interface LogConfig {
outputs: {
console: boolean,
buffer: boolean,
},
components: {
settings?: boolean,
aard?: boolean,
videoData?: boolean,
resizer?: boolean,
comms?: boolean,
},
environments: {
page: boolean,
popup: boolean,
ui: boolean,
uwServer: boolean,
}
}

View File

@ -1,10 +0,0 @@
export interface LogMessageOrigin {
component: string,
environment: string,
}
export interface LogMessage {
time: Date;
message: any,
origin: LogMessageOrigin
}