Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ibakaidov committed Dec 18, 2023
1 parent 39363a1 commit e077ba6
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 72 deletions.
8 changes: 4 additions & 4 deletions src/electron/tobii/backWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class BackWatch {
window?: BrowserWindow;
hid = "";
multiplyScale = false;
constructor(win: BrowserWindow) {
constructor (win: BrowserWindow) {
this.window = win;
if (platform() === "win32") {
try {
Expand Down Expand Up @@ -44,7 +44,7 @@ export class BackWatch {
}
}

onClick(index: number, count: number) {
onClick (index: number, count: number) {
if (!this.window?.isFocused()) return;
this.window?.webContents.send("eye-click", {
elementIndex: index,
Expand All @@ -53,13 +53,13 @@ export class BackWatch {
});
}

onExit() {
onExit () {
this.window?.webContents.send("eye-exit", {
id: this.hid
});
}

onEnter(index: number) {
onEnter (index: number) {
this.window?.webContents.send("eye-enter", {
elementIndex: index,
id: this.hid
Expand Down
1 change: 0 additions & 1 deletion src/electron/tobii/pageWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export class PageWatcher {
}

watchElementsChange (force = false) {

const eyes = [...document.getElementsByClassName(PageWatcher.CLASS)];
const bounds = eyes.map((el) => el.getBoundingClientRect());
if (!force) {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const routes: Array<RouteRecordRaw> = [
},
{
path: "/calibration",
components:{
components: {
default: CalibrationView
}
}
Expand Down
110 changes: 55 additions & 55 deletions src/frontend/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,186 +87,186 @@ const store = createStore<LINKaStore>({
}
},
mutations: {
enable_ui(state) {
enable_ui (state) {
state.ui.disabled = false;
},
disable_ui(state) {
disable_ui (state) {
state.ui.disabled = true;
},
popupVersion(state, value) {
popupVersion (state, value) {
state.popupVersion = value;
},
selectedKey(state, value) {
selectedKey (state, value) {
state.selectedKey = value;
},
defaultSetsDownloaded(state, value) {
defaultSetsDownloaded (state, value) {
state.defaultSetsDownloaded = value;
},
ui_exitButton(state, value) {
ui_exitButton (state, value) {
state.ui.exitButton = value;
Metric.registerEvent(state.pcHash, "settingsToggleEyeExit", { value });
},
keyMapping_up({ keyMapping }, value) {
keyMapping_up ({ keyMapping }, value) {
keyMapping.up = value;
},
keyMapping_down({ keyMapping }, value) {
keyMapping_down ({ keyMapping }, value) {
keyMapping.down = value;
},
keyMapping_left({ keyMapping }, value) {
keyMapping_left ({ keyMapping }, value) {
keyMapping.left = value;
},
keyMapping_right({ keyMapping }, value) {
keyMapping_right ({ keyMapping }, value) {
keyMapping.right = value;
},
keyMapping_enter({ keyMapping }, value) {
keyMapping_enter ({ keyMapping }, value) {
keyMapping.enter = value;
},
colors_primary({ colors }, value) {
colors_primary ({ colors }, value) {
colors.primary = value;
},
colors_accent({ colors }, value) {
colors_accent ({ colors }, value) {
colors.accent = value;
},
colors_secondary({ colors }, value) {
colors_secondary ({ colors }, value) {
colors.secondary = value;
},
voice({ voice }, value) {
voice ({ voice }, value) {
voice = value;
},
editor_current({ editor }, value) {
editor_current ({ editor }, value) {
editor.current = value;
},
editor_temp({ editor }, value) {
editor_temp ({ editor }, value) {
editor.temp = value;
},
editor_cards({ editor }, value) {
editor_cards ({ editor }, value) {
editor.cards = value;
},
editor_columns({ editor }, value) {
editor_columns ({ editor }, value) {
editor.columns = value;
},
editor_rows({ editor }, value) {
editor_rows ({ editor }, value) {
editor.rows = value;
},
editor_isDirectSet({ editor }, value) {
editor_isDirectSet ({ editor }, value) {
editor.isDirectSet = value;
},
editor_isWithoutSpace({ editor }, value) {
editor_isWithoutSpace ({ editor }, value) {
editor.isWithoutSpace = value;
},
editor_isQuiz({ editor }, value) {
editor_isQuiz ({ editor }, value) {
editor.quiz = value;
},
editor_questions({ editor }, value) {
editor_questions ({ editor }, value) {
editor.questions = value;
},
editor_quizAutoNext({ editor }, value) {
editor_quizAutoNext ({ editor }, value) {
editor.quizAutoNext = value;
},
editor_quizReadQuestion({ editor }, value) {
editor_quizReadQuestion ({ editor }, value) {
editor.quizReadQuestion = value;
},
editor_description({ editor }, value) {
editor_description ({ editor }, value) {
editor.description = value;
},
button_timeout({ button }, value) {
button_timeout ({ button }, value) {
ipcRenderer.send("button_timeout", value);
button.timeout = value;
},
button_enabled({ button, pcHash }, value) {
button_enabled ({ button, pcHash }, value) {
button.enabled = value;
Metric.registerEvent(pcHash, "toggleGazeLock", { value });
},
button_eyeSelect({ button, pcHash }, value) {
button_eyeSelect ({ button, pcHash }, value) {
button.eyeSelect = value;
Metric.registerEvent(pcHash, "settingsToggleEyeChoose", { value });
},
button_eyeActivation({ button, pcHash }, value) {
button_eyeActivation ({ button, pcHash }, value) {
button.eyeActivation = value;
Metric.registerEvent(pcHash, "settingsToggleEyeActivation", { value });
},
button_joystickActivation({ button, pcHash }, value) {
button_joystickActivation ({ button, pcHash }, value) {
Metric.registerEvent(pcHash, "settingsToggleJoystickActivation", { value });

button.joystickActivation = value;
},
button_keyboardActivation({ button, pcHash }, value) {
button_keyboardActivation ({ button, pcHash }, value) {
Metric.registerEvent(pcHash, "settingsToggleKeyboardActivation", { value });

button.keyboardActivation = value;
},
button_mouseActivation({ button }, value) {
button_mouseActivation ({ button }, value) {
button.mouseActivation = value;
},
button_borders({ button }, value) {
button_borders ({ button }, value) {
button.borders = value;
},
button_animation({ button }, value) {
button_animation ({ button }, value) {
button.animation = value;
},
button_clickSound({ button, pcHash }, value) {
button_clickSound ({ button, pcHash }, value) {
button.clickSound = value;
Metric.registerEvent(pcHash, "settingsToggleTypeSound", { value });
},
button_multiply_scale({ button }, value) {
button.multiplyScale = value
button_multiply_scale ({ button }, value) {
button.multiplyScale = value;
},
interface_outputLine({ ui, pcHash }, value) {
interface_outputLine ({ ui, pcHash }, value) {
ui.outputLine = value;
Metric.registerEvent(pcHash, "toggleOutputLine", value);
},
pcHash(state, hash) {
pcHash (state, hash) {
state.pcHash = hash;
}
},

actions: {
enable_ui({ commit }) {
enable_ui ({ commit }) {
commit("enable_ui");
},
disable_ui({ commit }) {
disable_ui ({ commit }) {
commit("disable_ui");
},
keymap_push({ state, commit }, { side, code }: { side: Side, code: string }) {
keymap_push ({ state, commit }, { side, code }: { side: Side, code: string }) {
if (!Object.values(state.keyMapping).find((sides) => sides.includes(code))) {
state.keyMapping[side].push(code);
}
commit("keyMapping_" + side, state.keyMapping[side]);
state.selectedKey = undefined;
},
keymap_remove({ state, commit }, { side, code }: { side: Side, code: string }) {
keymap_remove ({ state, commit }, { side, code }: { side: Side, code: string }) {
commit("keyMapping_" + side, state.keyMapping[side].filter((c) => c !== code));
state.selectedKey = undefined;
},
voice_change({ state }, voice: string) {
voice_change ({ state }, voice: string) {
state.voice = voice;
},

interface_outputLine({ state, commit }) {
interface_outputLine ({ state, commit }) {
commit("interface_outputLine", !state.ui.outputLine);
},

button_enabled({ state }) {
button_enabled ({ state }) {
state.button.enabled = !state.button.enabled;
},

button_animation_toggle({ state, commit }) {
button_animation_toggle ({ state, commit }) {
commit("button_animation", !state.button.animation);
},

async editor_new_file({ state, dispatch }, file: string) {
async editor_new_file ({ state, dispatch }, file: string) {
file += ".linka";
state.editor.current = file;
state.editor.temp = await storageService.defaultToTemp(file);
dispatch("editor_load_set");
},

async editor_current({ state, dispatch }, file: string) {
async editor_current ({ state, dispatch }, file: string) {
state.editor.current = file;
state.editor.temp = await storageService.copyToTemp(file);
await dispatch("editor_load_set");
},
async editor_load_set({ state, commit }) {
async editor_load_set ({ state, commit }) {
const config = await storageService.getConfigFile(state.editor.temp!);

if (config != undefined) {
Expand All @@ -280,7 +280,7 @@ const store = createStore<LINKaStore>({
commit("editor_questions", config.questions ?? []);
}
},
async editor_save({ state }) {
async editor_save ({ state }) {
await storageService.saveSet(state.editor.temp, state.editor.current, {
cards: JSON.parse(JSON.stringify(state.editor.cards)),
columns: state.editor.columns,
Expand All @@ -295,7 +295,7 @@ const store = createStore<LINKaStore>({
version: "2.0"
});
},
async editor_save_as({ state, commit }, title) {
async editor_save_as ({ state, commit }, title) {
const parts = state.editor.current.split("§");
parts[parts.length - 1] = title;
const current = parts.join("§");
Expand All @@ -314,7 +314,7 @@ const store = createStore<LINKaStore>({
});
return current;
},
async open_file({ state, commit }, filename) {
async open_file ({ state, commit }, filename) {
const config = await storageService.getConfigFile(filename);

if (config) {
Expand Down
22 changes: 11 additions & 11 deletions src/frontend/views/CalibrationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
</template>

<script setup lang="ts">
import { computed } from 'vue';
import EyeButton from '../components/EyeButton.vue';
import store from '../store';
import { computed } from "vue";
import EyeButton from "../components/EyeButton.vue";
import store from "../store";
const multiplyScale = computed({
get(){
return store.state.button.multiplyScale
},
set(v){
store.commit('button_multiply_scale', v)
}
})
get () {
return store.state.button.multiplyScale;
},
set (v) {
store.commit("button_multiply_scale", v);
}
});
</script>

Expand All @@ -55,4 +55,4 @@ const multiplyScale = computed({
right: 0;
position: absolute;
}
</style>
</style>

0 comments on commit e077ba6

Please sign in to comment.