added gainers losers active backend

This commit is contained in:
Justin 2023-08-08 17:14:50 +08:00 committed by GitHub
parent 2454dea296
commit b7926b7d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,7 @@ var moviesFeatures = document.querySelectorAll("#movies-features li");
var ipoFeatures = document.querySelectorAll("#ipo-features li"); 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 allFeaturesList = [ var allFeaturesList = [
stocksFeatures, stocksFeatures,
@ -71,6 +72,7 @@ var allFeaturesList = [
ipoFeatures, ipoFeatures,
economicFeatures, economicFeatures,
jokesFeatures, jokesFeatures,
marketFeatures,
]; ];
// features remove buttons // features remove buttons
@ -99,6 +101,7 @@ var moviesRemoveBtn = document.getElementById("movies-remove-btn");
var ipoRemoveBtn = document.getElementById("ipo-remove-btn"); 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 allFeaturesRemoveBtns = [ var allFeaturesRemoveBtns = [
stocksRemoveBtn, stocksRemoveBtn,
@ -120,6 +123,7 @@ var allFeaturesRemoveBtns = [
ipoRemoveBtn, ipoRemoveBtn,
economicRemoveBtn, economicRemoveBtn,
jokesRemoveBtn, jokesRemoveBtn,
marketRemoveBtn,
]; ];
// features increase buttons // features increase buttons
var stocksincreaseBtn = document.getElementById("stocks-increase-btn"); var stocksincreaseBtn = document.getElementById("stocks-increase-btn");
@ -147,6 +151,7 @@ var moviesincreaseBtn = document.getElementById("movies-increase-btn");
var ipoincreaseBtn = document.getElementById("ipo-increase-btn"); 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 allFeaturesIncreaseBtns = [ var allFeaturesIncreaseBtns = [
stocksincreaseBtn, stocksincreaseBtn,
@ -168,6 +173,7 @@ var allFeaturesIncreaseBtns = [
ipoincreaseBtn, ipoincreaseBtn,
economicincreaseBtn, economicincreaseBtn,
jokesincreaseBtn, jokesincreaseBtn,
marketincreaseBtn,
]; ];
// features decrease buttons // features decrease buttons
@ -196,6 +202,7 @@ var moviesDecreaseBtn = document.getElementById("movies-decrease-btn");
var ipoDecreaseBtn = document.getElementById("ipo-decrease-btn"); 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 allFeaturesDecreaseBtns = [ var allFeaturesDecreaseBtns = [
stocksDecreaseBtn, stocksDecreaseBtn,
@ -217,6 +224,7 @@ var allFeaturesDecreaseBtns = [
ipoDecreaseBtn, ipoDecreaseBtn,
economicDecreaseBtn, economicDecreaseBtn,
jokesDecreaseBtn, jokesDecreaseBtn,
marketDecreaseBtn,
]; ];
const changeVarValue = () => { const changeVarValue = () => {
@ -245,6 +253,7 @@ const changeVarValue = () => {
ipoFeatures = document.querySelectorAll("#ipo-features li"); ipoFeatures = document.querySelectorAll("#ipo-features li");
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");
allFeaturesList = [ allFeaturesList = [
stocksFeatures, stocksFeatures,
@ -266,6 +275,7 @@ const changeVarValue = () => {
ipoFeatures, ipoFeatures,
economicFeatures, economicFeatures,
jokesFeatures, jokesFeatures,
marketFeatures,
]; ];
}; };
@ -645,6 +655,7 @@ var movies = document.getElementById("movies-features");
var ipos = document.getElementById("ipo-features"); 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 allFeatures = [ var allFeatures = [
stocks, stocks,
@ -666,6 +677,7 @@ var allFeatures = [
ipos, ipos,
economics, economics,
jokes, jokes,
market,
]; ];
// features select box // features select box
@ -677,6 +689,7 @@ var teamStatsSelect = document.getElementById("inputTransition103");
var moviesSelect = document.getElementById("inputTransition64"); 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 allFeaturesSelectBox = [ var allFeaturesSelectBox = [
null, null,
null, null,
@ -697,6 +710,7 @@ var allFeaturesSelectBox = [
null, null,
economicSelect, economicSelect,
jokesSelect, jokesSelect,
marketSelect,
]; ];
// features select add buttons // features select add buttons
@ -707,6 +721,7 @@ var liveGamesAddBtn = document.getElementById("inputTransitionBtn93");
var teamStatsAddBtn = document.getElementById("inputTransitionBtn103"); 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 allFeaturesSelectAddBtn = [ var allFeaturesSelectAddBtn = [
null, null,
@ -728,6 +743,7 @@ var allFeaturesSelectAddBtn = [
null, null,
economicAddBtn, economicAddBtn,
jokesAddBtn, jokesAddBtn,
marketAddBtn,
]; ];
allFeaturesSelectAddBtn.map((value, index) => { allFeaturesSelectAddBtn.map((value, index) => {
@ -767,6 +783,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");
@ -792,6 +809,7 @@ var allFeaturesFileAddBtn = [
null, null,
null, null,
null, null,
null,
]; ];
// features input text // features input text
@ -824,6 +842,7 @@ var allFeaturesText = [
null, null,
null, null,
null, null,
null,
]; ];
// features text add button // features text add button
@ -856,6 +875,7 @@ var allFeaturesTextAddBtn = [
null, null,
null, null,
null, null,
null,
]; ];
@ -879,6 +899,7 @@ var allFeaturesLimit = [
null, null,
null, null,
null, null,
null,
]; ];
@ -1153,6 +1174,7 @@ function getFeatureSettings() {
"IPO Calendar", "IPO Calendar",
"Economic Calendar", "Economic Calendar",
"Jokes", "Jokes",
"Gainers, Losers, Active",
]; ];
let pageNum = features.indexOf(feature) + 1; let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString(); let pageSelector = "Page" + pageNum.toString();
@ -1221,6 +1243,9 @@ function getFeatureSettings() {
case 19: case 19:
s = getJokesSettings(page); s = getJokesSettings(page);
break; break;
case 20:
s = getMarketSettings(page);
break;
} }
settings = { ...settings, ...s }; // merge both sets of settings settings = { ...settings, ...s }; // merge both sets of settings
@ -1418,6 +1443,7 @@ function saveMovieAPIKey(){
"IPO Calendar", "IPO Calendar",
"Economic Calendar", "Economic Calendar",
"Jokes", "Jokes",
"Gainers, Losers, Active",
]; ];
let pageNum = features.indexOf(feature) + 1; let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString(); let pageSelector = "Page" + pageNum.toString();
@ -1461,6 +1487,7 @@ function saveIpoAPIKey(){
"IPO Calendar", "IPO Calendar",
"Economic Calendar", "Economic Calendar",
"Jokes", "Jokes",
"Gainers, Losers, Active",
]; ];
let pageNum = features.indexOf(feature) + 1; let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString(); let pageSelector = "Page" + pageNum.toString();
@ -1896,7 +1923,7 @@ inputAnimationBtn.addEventListener("click", () => {
// scroll speed row two // scroll speed row two
let inputScrollSpeedRow = []; let inputScrollSpeedRow = [];
for (let i = 1; i <= 19; i++) { for (let i = 1; i <= 20; i++) {
inputScrollSpeedRow.push( inputScrollSpeedRow.push(
document.getElementById( document.getElementById(
i === 1 ? "inputScrollSpeedRow" : `inputScrollSpeedRow${i}` i === 1 ? "inputScrollSpeedRow" : `inputScrollSpeedRow${i}`
@ -3264,7 +3291,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']; 'Page14', 'Page15', 'Page16', 'Page17', 'Page18', 'Page19', 'Page20'];
for (const pageID of pageIDs) { for (const pageID of pageIDs) {
// Select the parent div // Select the parent div
@ -3272,7 +3299,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']; 'inputScrollSpeed16', 'inputScrollSpeed17', 'inputScrollSpeed19BG', 'market-categories'];
const selectMenus = parentDiv.querySelectorAll('select'); const selectMenus = parentDiv.querySelectorAll('select');
selectMenus.forEach(selectMenu => { selectMenus.forEach(selectMenu => {