From 6d6de0f88348d1412d80f4a76c20f32069b43549 Mon Sep 17 00:00:00 2001 From: Gerome Matilla Date: Wed, 17 Jun 2020 19:03:27 +0800 Subject: [PATCH] Improve JS Logic (#28) * theme engine fix ugly logic part 1 * remove new lines when gettings css value property * theme-engine: add process cssvalues * theme-engine: add getting inputfields value * theme-engine: validation * theme-engine: animspeed validation * theme-engine: animspeed validation 2 * fix #rgbaa validator * theme-engine:almost finish * theme-engine: fix codacy errors * theme-engine: fix missing semicolon * theme-engine: fix missing semicolon * weather-settings: use confirm() method * weather-settings: cleanup, remove some confirm() --- css/base/dummy-body-background.css | 2 +- css/screens/web-menu.css | 10 +- index.html | 12 +- js/search-engine-settings.js | 19 +- js/theme-engine.js | 347 +++++++++++++++++++++-------- js/weather-settings.js | 38 +--- 6 files changed, 289 insertions(+), 139 deletions(-) diff --git a/css/base/dummy-body-background.css b/css/base/dummy-body-background.css index f62c00a..f72c616 100644 --- a/css/base/dummy-body-background.css +++ b/css/base/dummy-body-background.css @@ -1,4 +1,4 @@ -/*Filter for body's lazy loaded background */ +/* Filter for body's lazy loaded background */ #dummyBodyBackground { background: var(--base-body-bg); diff --git a/css/screens/web-menu.css b/css/screens/web-menu.css index e8e1a2b..e2dcfee 100644 --- a/css/screens/web-menu.css +++ b/css/screens/web-menu.css @@ -189,7 +189,7 @@ /* mask-image: linear-gradient(to bottom, black 85%, transparent 100%); */ } -/*Stretch list item if screen width < 470px*/ +/* Stretch list item if screen width < 470px */ @media screen and (max-width: 470px) { #webMenuList { flex-grow: 1; @@ -221,18 +221,18 @@ } } -/*The a href container/main web menu button container*/ +/* The a href container/main web menu button container */ .webMenuLink { - /*Act as div*/ + /* Act as div */ display: block; - /*Remove outlines*/ + /* Remove outlines */ text-decoration: none; outline: 0; border: none; -moz-outline-style: none; - /*Disable dragging*/ + /* Disable dragging */ user-select: none; -webkit-user-drag: none; } diff --git a/index.html b/index.html index f06b183..e715d57 100644 --- a/index.html +++ b/index.html @@ -164,8 +164,8 @@
- - + +
@@ -173,21 +173,21 @@
- - + +
- +
- +
diff --git a/js/search-engine-settings.js b/js/search-engine-settings.js index 51d6b44..7ff2559 100644 --- a/js/search-engine-settings.js +++ b/js/search-engine-settings.js @@ -12,9 +12,6 @@ class SearchEngineSettings { this._searchEngines = config.getSearchEngines(); - this._onClickEvent = this._onClickEvent.bind(this); - this._onChangeEvent = this._onChangeEvent.bind(this); - this._init(); } @@ -22,8 +19,8 @@ class SearchEngineSettings { this._updateDefaultSearchEngine(); this._createSearchEngineOptions(); this._selectTheEngine(); - this._registerOnChangeEvent(); - this._registerOnClickEvent(); + this._registerSearchEngineSelectOnChangeEvent(); + this._registerApplyOnClickEvent(); } _updateDefaultSearchEngine = () => { @@ -74,18 +71,18 @@ class SearchEngineSettings { } // Execute this on change event of