sector performance backend

This commit is contained in:
Justin 2023-08-14 17:59:08 +08:00 committed by GitHub
parent acf5616e3c
commit 62ac8bcf56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,7 @@ var ipoFeatures = document.querySelectorAll("#ipo-features li");
var economicFeatures = document.querySelectorAll("#economic-list li"); var economicFeatures = document.querySelectorAll("#economic-list li");
var jokesFeatures = document.querySelectorAll("#jokes-list li"); var jokesFeatures = document.querySelectorAll("#jokes-list li");
var marketFeatures = document.querySelectorAll("#market-list li"); var marketFeatures = document.querySelectorAll("#market-list li");
var sectorFeatures = document.querySelectorAll("#sector-list li");
var allFeaturesList = [ var allFeaturesList = [
stocksFeatures, stocksFeatures,
@ -73,6 +74,7 @@ var allFeaturesList = [
economicFeatures, economicFeatures,
jokesFeatures, jokesFeatures,
marketFeatures, marketFeatures,
sectorFeatures,
]; ];
// features remove buttons // features remove buttons
@ -102,6 +104,7 @@ var ipoRemoveBtn = document.getElementById("ipo-remove-btn");
var economicRemoveBtn = document.getElementById("economic-remove-btn"); var economicRemoveBtn = document.getElementById("economic-remove-btn");
var jokesRemoveBtn = document.getElementById("jokes-remove-btn"); var jokesRemoveBtn = document.getElementById("jokes-remove-btn");
var marketRemoveBtn = document.getElementById("market-remove-btn"); var marketRemoveBtn = document.getElementById("market-remove-btn");
var sectorRemoveBtn = document.getElementById("sector-remove-btn");
var allFeaturesRemoveBtns = [ var allFeaturesRemoveBtns = [
stocksRemoveBtn, stocksRemoveBtn,
@ -124,6 +127,7 @@ var allFeaturesRemoveBtns = [
economicRemoveBtn, economicRemoveBtn,
jokesRemoveBtn, jokesRemoveBtn,
marketRemoveBtn, marketRemoveBtn,
sectorRemoveBtn,
]; ];
// features increase buttons // features increase buttons
var stocksincreaseBtn = document.getElementById("stocks-increase-btn"); var stocksincreaseBtn = document.getElementById("stocks-increase-btn");
@ -152,6 +156,7 @@ var ipoincreaseBtn = document.getElementById("ipo-increase-btn");
var economicincreaseBtn = document.getElementById("economic-increase-btn"); var economicincreaseBtn = document.getElementById("economic-increase-btn");
var jokesincreaseBtn = document.getElementById("jokes-increase-btn"); var jokesincreaseBtn = document.getElementById("jokes-increase-btn");
var marketincreaseBtn = document.getElementById("market-increase-btn"); var marketincreaseBtn = document.getElementById("market-increase-btn");
var sectorincreaseBtn = document.getElementById("sector-increase-btn");
var allFeaturesIncreaseBtns = [ var allFeaturesIncreaseBtns = [
stocksincreaseBtn, stocksincreaseBtn,
@ -174,6 +179,7 @@ var allFeaturesIncreaseBtns = [
economicincreaseBtn, economicincreaseBtn,
jokesincreaseBtn, jokesincreaseBtn,
marketincreaseBtn, marketincreaseBtn,
sectorincreaseBtn,
]; ];
// features decrease buttons // features decrease buttons
@ -203,6 +209,7 @@ var ipoDecreaseBtn = document.getElementById("ipo-decrease-btn");
var economicDecreaseBtn = document.getElementById("economic-decrease-btn"); var economicDecreaseBtn = document.getElementById("economic-decrease-btn");
var jokesDecreaseBtn = document.getElementById("jokes-decrease-btn"); var jokesDecreaseBtn = document.getElementById("jokes-decrease-btn");
var marketDecreaseBtn = document.getElementById("market-decrease-btn"); var marketDecreaseBtn = document.getElementById("market-decrease-btn");
var sectorDecreaseBtn = document.getElementById("sector-decrease-btn");
var allFeaturesDecreaseBtns = [ var allFeaturesDecreaseBtns = [
stocksDecreaseBtn, stocksDecreaseBtn,
@ -225,6 +232,7 @@ var allFeaturesDecreaseBtns = [
economicDecreaseBtn, economicDecreaseBtn,
jokesDecreaseBtn, jokesDecreaseBtn,
marketDecreaseBtn, marketDecreaseBtn,
sectorDecreaseBtn,
]; ];
const changeVarValue = () => { const changeVarValue = () => {
@ -254,6 +262,7 @@ const changeVarValue = () => {
economicFeatures = document.querySelectorAll("#economic-list li"); economicFeatures = document.querySelectorAll("#economic-list li");
jokesFeatures = document.querySelectorAll("#jokes-list li"); jokesFeatures = document.querySelectorAll("#jokes-list li");
marketFeatures = document.querySelectorAll("#market-list li"); marketFeatures = document.querySelectorAll("#market-list li");
sectorFeatures = document.querySelectorAll("#sector-list li");
allFeaturesList = [ allFeaturesList = [
stocksFeatures, stocksFeatures,
@ -276,6 +285,7 @@ const changeVarValue = () => {
economicFeatures, economicFeatures,
jokesFeatures, jokesFeatures,
marketFeatures, marketFeatures,
sectorFeatures,
]; ];
}; };
@ -656,6 +666,7 @@ var ipos = document.getElementById("ipo-features");
var economics = document.getElementById("economic-list"); var economics = document.getElementById("economic-list");
var jokes = document.getElementById("jokes-list"); var jokes = document.getElementById("jokes-list");
var market = document.getElementById("market-list"); var market = document.getElementById("market-list");
var sector = document.getElementById("sector-list");
var allFeatures = [ var allFeatures = [
stocks, stocks,
@ -678,6 +689,7 @@ var allFeatures = [
economics, economics,
jokes, jokes,
market, market,
sector,
]; ];
// features select box // features select box
@ -690,6 +702,7 @@ var moviesSelect = document.getElementById("inputTransition64");
var economicSelect = document.getElementById("inputTransition2222"); var economicSelect = document.getElementById("inputTransition2222");
var jokesSelect = document.getElementById("jokes-categories"); var jokesSelect = document.getElementById("jokes-categories");
var marketSelect = document.getElementById("market-categories"); var marketSelect = document.getElementById("market-categories");
var sectorSelect = document.getElementById("sector-categories");
var allFeaturesSelectBox = [ var allFeaturesSelectBox = [
null, null,
null, null,
@ -711,6 +724,7 @@ var allFeaturesSelectBox = [
economicSelect, economicSelect,
jokesSelect, jokesSelect,
marketSelect, marketSelect,
sectorSelect,
]; ];
// features select add buttons // features select add buttons
@ -722,6 +736,7 @@ var teamStatsAddBtn = document.getElementById("inputTransitionBtn103");
var economicAddBtn = document.getElementById("economic-countries-btn"); var economicAddBtn = document.getElementById("economic-countries-btn");
var jokesAddBtn = document.getElementById("jokes-categories-btn"); var jokesAddBtn = document.getElementById("jokes-categories-btn");
var marketAddBtn = document.getElementById("market-categories-btn"); var marketAddBtn = document.getElementById("market-categories-btn");
var sectorAddBtn = document.getElementById("sector-categories-btn");
var allFeaturesSelectAddBtn = [ var allFeaturesSelectAddBtn = [
null, null,
@ -744,6 +759,7 @@ var allFeaturesSelectAddBtn = [
economicAddBtn, economicAddBtn,
jokesAddBtn, jokesAddBtn,
marketAddBtn, marketAddBtn,
sectorAddBtn,
]; ];
allFeaturesSelectAddBtn.map((value, index) => { allFeaturesSelectAddBtn.map((value, index) => {
@ -784,6 +800,7 @@ var allFeaturesFile = [
null, null,
null, null,
null, null,
null,
]; ];
// features file add button // features file add button
var imagesFileAddBtn = document.getElementById("inputTextBtn11"); var imagesFileAddBtn = document.getElementById("inputTextBtn11");
@ -810,6 +827,7 @@ var allFeaturesFileAddBtn = [
null, null,
null, null,
null, null,
null,
]; ];
// features input text // features input text
@ -843,6 +861,7 @@ var allFeaturesText = [
null, null,
null, null,
null, null,
null,
]; ];
// features text add button // features text add button
@ -876,6 +895,7 @@ var allFeaturesTextAddBtn = [
null, null,
null, null,
null, null,
null,
]; ];
@ -900,6 +920,7 @@ var allFeaturesLimit = [
null, null,
null, null,
null, null,
null,
]; ];
@ -1175,6 +1196,7 @@ function getFeatureSettings() {
"Economic Calendar", "Economic Calendar",
"Jokes", "Jokes",
"Gainers, Losers, Active", "Gainers, Losers, Active",
"Sector Performance",
]; ];
let pageNum = features.indexOf(feature) + 1; let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString(); let pageSelector = "Page" + pageNum.toString();
@ -1246,6 +1268,9 @@ function getFeatureSettings() {
case 20: case 20:
s = getMarketSettings(page); s = getMarketSettings(page);
break; break;
case 21:
s = getSectorSettings(page);
break;
} }
settings = { ...settings, ...s }; // merge both sets of settings settings = { ...settings, ...s }; // merge both sets of settings
@ -1444,6 +1469,7 @@ function saveMovieAPIKey(){
"Economic Calendar", "Economic Calendar",
"Jokes", "Jokes",
"Gainers, Losers, Active", "Gainers, Losers, Active",
"Sector Performance",
]; ];
let pageNum = features.indexOf(feature) + 1; let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString(); let pageSelector = "Page" + pageNum.toString();
@ -1488,6 +1514,7 @@ function saveIpoAPIKey(){
"Economic Calendar", "Economic Calendar",
"Jokes", "Jokes",
"Gainers, Losers, Active", "Gainers, Losers, Active",
"Sector Performance",
]; ];
let pageNum = features.indexOf(feature) + 1; let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString(); let pageSelector = "Page" + pageNum.toString();
@ -1945,7 +1972,7 @@ inputAnimationBtn.addEventListener("click", () => {
// scroll speed row two // scroll speed row two
let inputScrollSpeedRow = []; let inputScrollSpeedRow = [];
for (let i = 1; i <= 20; i++) { for (let i = 1; i <= 21; i++) {
inputScrollSpeedRow.push( inputScrollSpeedRow.push(
document.getElementById( document.getElementById(
i === 1 ? "inputScrollSpeedRow" : `inputScrollSpeedRow${i}` i === 1 ? "inputScrollSpeedRow" : `inputScrollSpeedRow${i}`
@ -3313,7 +3340,7 @@ function featureSavePrompt() {
const pageIDs = ['Page1', 'Page2', 'Page3', 'Page4', 'Page5', 'Page6', 'Page7', 'Page8', 'Page9', 'Page10', 'Page11', 'Page12', 'Page13', const pageIDs = ['Page1', 'Page2', 'Page3', 'Page4', 'Page5', 'Page6', 'Page7', 'Page8', 'Page9', 'Page10', 'Page11', 'Page12', 'Page13',
'Page14', 'Page15', 'Page16', 'Page17', 'Page18', 'Page19', 'Page20']; 'Page14', 'Page15', 'Page16', 'Page17', 'Page18', 'Page19', 'Page20', 'Page21'];
for (const pageID of pageIDs) { for (const pageID of pageIDs) {
// Select the parent div // Select the parent div
@ -3321,7 +3348,7 @@ for (const pageID of pageIDs) {
// Add event listeners to select menus // Add event listeners to select menus
const excludedIds = ['base-select', 'quote-select', 'commodities-items', 'indices-items', 'inputTransition73', const excludedIds = ['base-select', 'quote-select', 'commodities-items', 'indices-items', 'inputTransition73',
'inputTransition83', 'inputTransition93', 'inputTransition103', 'inputTransition2222', 'jokes-categories', 'golf-ranking-number', 'inputTransition83', 'inputTransition93', 'inputTransition103', 'inputTransition2222', 'jokes-categories', 'golf-ranking-number',
'inputScrollSpeed16', 'inputScrollSpeed17', 'inputScrollSpeed19BG', 'market-categories']; 'inputScrollSpeed16', 'inputScrollSpeed17', 'inputScrollSpeed19BG', 'market-categories', 'sector-categories'];
const selectMenus = parentDiv.querySelectorAll('select'); const selectMenus = parentDiv.querySelectorAll('select');
selectMenus.forEach(selectMenu => { selectMenus.forEach(selectMenu => {