tick bosxes populate from saved settings

This commit is contained in:
Neythen 2021-09-21 20:31:47 +01:00
parent 7117947b23
commit 43d9ea7cca
6 changed files with 85 additions and 26 deletions

View File

@ -1 +1 @@
{"feature": "Stocks", "speed": "medium", "animation": "continuous", "percent": false, "point": true, "no_logos": true, "chart": false, "title": true, "symbols": {"NEO,USD": -1, "BTC,USD": -1, "ETH,BTC": -1, "ADA,GBP": -1}} {"feature": "Stocks", "speed": "medium", "animation": "continuous", "percent": false, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"NEO,USD": -1, "BTC,USD": -1, "ETH,BTC": -1, "ADA,GBP": -1}}

View File

@ -1 +1 @@
{"feature": "Stocks", "speed": "medium", "animation": "continuous", "percent": false, "point": true, "no_logos": true, "chart": false, "title": true, "symbols": {"NZD,USD": -1, "CAD,USD": -1, "GBP,BTC": -1}} {"feature": "Stocks", "speed": "medium", "animation": "continuous", "percent": false, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"NZD,USD": -1, "CAD,USD": -1, "GBP,BTC": -1}}

View File

@ -1 +1 @@
{"feature": "News", "speed": "medium", "animation": "continuous", "country": "USA", "category": "general", "title": true, "sources": {"Bloomberg": -1, "ABC News": -1, "Yahoo": -1}} {"feature": "News", "speed": "medium", "animation": "continuous", "country": "USA", "category": "general", "title": true, "use_sources":true, "sources": {"Bloomberg": -1, "ABC News": -1, "Yahoo": -1}}

View File

@ -1 +1 @@
{"feature": "Stocks", "speed": "medium", "animation": "continuous", "percent": false, "point": true, "no_logos": true, "chart": false, "title": true, "symbols": {"APL": 0.0, "GOOG": 0.0, "FB": -1, "ROKU": -1, "TGT": -1, "TSLA": -1, "SNAP": -1, "NFLX": -1, "MSFT": -1}} {"feature": "Stocks", "speed": "slow", "animation": "continuous", "percent": true, "point": false, "logos": true, "chart": false, "title": true, "symbols": {"APL": 0.0, "GOOG": 0.0, "FB": -1, "ROKU": -1, "TGT": -1, "TSLA": -1, "SNAP": -1, "NFLX": -1, "MSFT": -1}}

View File

@ -603,6 +603,7 @@ function getSelected(selector) {
var opt; var opt;
for ( var i = 0, len = selector.options.length; i < len; i++ ) { for ( var i = 0, len = selector.options.length; i < len; i++ ) {
opt = selector.options[i]; opt = selector.options[i];
if ( opt.selected === true ) { if ( opt.selected === true ) {
break; break;
} }
@ -702,7 +703,7 @@ function getTradingSettings(page) {
let symbols_el = page.querySelectorAll(".symbol-list")[0]; let symbols_el = page.querySelectorAll(".symbol-list")[0];
let symbols = getListItems(symbols_el); let symbols = getListItems(symbols_el);
let settings = {'percent': percent, 'point':point, 'no_logos':no_logos, 'chart':chart, 'title': title, 'symbols': symbols} let settings = {'percent': percent, 'point':point, 'logos':no_logos, 'chart':chart, 'title': title, 'symbols': symbols}
return settings; return settings;
} }
@ -741,10 +742,11 @@ function getNewsSettings(page){
let country = getSelected(page.querySelectorAll(".country-select")[0]); let country = getSelected(page.querySelectorAll(".country-select")[0]);
let category = getSelected(page.querySelectorAll(".category-select")[0]); let category = getSelected(page.querySelectorAll(".category-select")[0]);
let title = page.querySelectorAll(".title-select")[0].checked; let title = page.querySelectorAll(".title-select")[0].checked;
let use_sources = page.querySelectorAll(".sources-select")[0].checked;
let sources_el = page.querySelectorAll(".sources-list")[0]; let sources_el = page.querySelectorAll(".sources-list")[0];
let sources = getListItems(sources_el); let sources = getListItems(sources_el);
settings = {'country':country, 'category': category, 'title':title, 'sources': sources}; settings = {'country':country, 'category': category, 'title':title, 'use_sources':use_sources, 'sources': sources};
return settings; return settings;
} }

View File

@ -321,6 +321,10 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked" id="flexCheckChecked"
{% if stocks_settings.percent%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -337,7 +341,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked2" id="flexCheckChecked2"
checked {% if stocks_settings.point%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -354,7 +360,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked3" id="flexCheckChecked3"
checked {% if stocks_settings.logos%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -371,6 +379,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked4" id="flexCheckChecked4"
{% if stocks_settings.chart%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -387,7 +398,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked5" id="flexCheckChecked5"
checked {% if stocks_settings.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -511,6 +524,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked6" id="flexCheckChecked6"
{% if crypto_settings.percent%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -527,7 +543,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked7" id="flexCheckChecked7"
checked {% if crypto_settings.point%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -544,7 +562,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked8" id="flexCheckChecked8"
checked {% if crypto_settings.logos%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -561,6 +581,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked9" id="flexCheckChecked9"
{% if crypto_settings.chart%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -577,7 +600,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked10" id="flexCheckChecked10"
checked {% if crypto_settings.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -701,6 +726,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked11" id="flexCheckChecked11"
{% if forex_settings.percent%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -717,7 +745,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked12" id="flexCheckChecked12"
checked {% if forex_settings.point%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -734,7 +764,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked13" id="flexCheckChecked13"
checked {% if forex_settings.logos%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -751,6 +783,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked14" id="flexCheckChecked14"
{% if forex_settings.chart%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -767,7 +802,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked15" id="flexCheckChecked15"
checked {% if forex_settings.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -951,7 +988,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked16" id="flexCheckChecked16"
checked {% if current_weather.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -1153,7 +1192,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked18" id="flexCheckChecked18"
checked {% if daily_weather.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -1282,11 +1323,13 @@
<div class="row g-3 align-items-center mt-3"> <div class="row g-3 align-items-center mt-3">
<div class="col-auto"> <div class="col-auto">
<input <input
class="form-check-input" class="form-check-input sources-select"
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked20" id="flexCheckChecked20"
checked {% if news_settings.use_sources%}
checked
{%endif%}
/> />
</div> </div>
<div class="col-auto"> <div class="col-auto">
@ -1322,7 +1365,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked19" id="flexCheckChecked19"
checked {% if news_settings.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -1447,7 +1492,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked21" id="flexCheckChecked21"
checked {% if upcoming_games.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -1572,7 +1619,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked22" id="flexCheckChecked22"
checked {% if past_games.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -1697,7 +1746,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked23" id="flexCheckChecked23"
checked {% if live_games.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -1821,7 +1872,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked24" id="flexCheckChecked24"
checked {% if team_stats.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -1970,7 +2023,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked25" id="flexCheckChecked25"
checked {% if image_settings.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>
@ -2121,7 +2176,9 @@
type="checkbox" type="checkbox"
value="" value=""
id="flexCheckChecked28" id="flexCheckChecked28"
checked {% if GIF_settings.title%}
checked
{%endif%}
/> />
</div> </div>
</div> </div>