basic jokes feature backend

This commit is contained in:
Justin 2023-07-12 16:06:32 +08:00 committed by GitHub
parent e245e3734f
commit d87e2b556f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,7 @@ var indicesFeatures = document.querySelectorAll("#indices-features li");
var moviesFeatures = document.querySelectorAll("#movies-features li");
var ipoFeatures = document.querySelectorAll("#ipo-features li");
var economicFeatures = document.querySelectorAll("#economic-list li");
var jokesFeatures = document.querySelectorAll("#jokes-list li");
var allFeaturesList = [
stocksFeatures,
@ -69,6 +70,7 @@ var allFeaturesList = [
moviesFeatures,
ipoFeatures,
economicFeatures,
jokesFeatures,
];
// features remove buttons
@ -96,6 +98,7 @@ var indicesRemoveBtn = document.getElementById("indices-remove-btn");
var moviesRemoveBtn = document.getElementById("movies-remove-btn");
var ipoRemoveBtn = document.getElementById("ipo-remove-btn");
var economicRemoveBtn = document.getElementById("economic-remove-btn");
var jokesRemoveBtn = document.getElementById("jokes-remove-btn");
var allFeaturesRemoveBtns = [
stocksRemoveBtn,
@ -116,6 +119,7 @@ var allFeaturesRemoveBtns = [
moviesRemoveBtn,
ipoRemoveBtn,
economicRemoveBtn,
jokesRemoveBtn,
];
// features increase buttons
var stocksincreaseBtn = document.getElementById("stocks-increase-btn");
@ -142,6 +146,7 @@ var indicesincreaseBtn = document.getElementById("indices-increase-btn");
var moviesincreaseBtn = document.getElementById("movies-increase-btn");
var ipoincreaseBtn = document.getElementById("ipo-increase-btn");
var economicincreaseBtn = document.getElementById("economic-increase-btn");
var jokesincreaseBtn = document.getElementById("jokes-increase-btn");
var allFeaturesIncreaseBtns = [
stocksincreaseBtn,
@ -162,6 +167,7 @@ var allFeaturesIncreaseBtns = [
moviesincreaseBtn,
ipoincreaseBtn,
economicincreaseBtn,
jokesincreaseBtn,
];
// features decrease buttons
@ -189,6 +195,7 @@ var indicesDecreaseBtn = document.getElementById("indices-decrease-btn");
var moviesDecreaseBtn = document.getElementById("movies-decrease-btn");
var ipoDecreaseBtn = document.getElementById("ipo-decrease-btn");
var economicDecreaseBtn = document.getElementById("economic-decrease-btn");
var jokesDecreaseBtn = document.getElementById("jokes-decrease-btn");
var allFeaturesDecreaseBtns = [
stocksDecreaseBtn,
@ -209,6 +216,7 @@ var allFeaturesDecreaseBtns = [
moviesDecreaseBtn,
ipoDecreaseBtn,
economicDecreaseBtn,
jokesDecreaseBtn,
];
const changeVarValue = () => {
@ -236,6 +244,7 @@ const changeVarValue = () => {
moviesFeatures = document.querySelectorAll("#movies-features li");
ipoFeatures = document.querySelectorAll("#ipo-features li");
economicFeatures = document.querySelectorAll("#economic-list li");
jokesFeatures = document.querySelectorAll("#jokes-list li");
allFeaturesList = [
stocksFeatures,
@ -256,6 +265,7 @@ const changeVarValue = () => {
moviesFeatures,
ipoFeatures,
economicFeatures,
jokesFeatures,
];
};
@ -621,6 +631,7 @@ var indices = document.getElementById("indices-features");
var movies = document.getElementById("movies-features");
var ipos = document.getElementById("ipo-features");
var economics = document.getElementById("economic-list");
var jokes = document.getElementById("jokes-list");
var allFeatures = [
stocks,
@ -641,6 +652,7 @@ var allFeatures = [
movies,
ipos,
economics,
jokes,
];
// features select box
@ -651,6 +663,7 @@ var liveGamesSelect = document.getElementById("inputTransition93");
var teamStatsSelect = document.getElementById("inputTransition103");
var moviesSelect = document.getElementById("inputTransition64");
var economicSelect = document.getElementById("inputTransition2222");
var jokesSelect = document.getElementById("jokes-categories");
var allFeaturesSelectBox = [
null,
null,
@ -670,6 +683,7 @@ var allFeaturesSelectBox = [
moviesSelect,
null,
economicSelect,
jokesSelect,
];
// features select add buttons
@ -679,6 +693,7 @@ var pastGamesAddBtn = document.getElementById("inputTransitionBtn83");
var liveGamesAddBtn = document.getElementById("inputTransitionBtn93");
var teamStatsAddBtn = document.getElementById("inputTransitionBtn103");
var economicAddBtn = document.getElementById("economic-countries-btn");
var jokesAddBtn = document.getElementById("jokes-categories-btn");
var allFeaturesSelectAddBtn = [
null,
@ -699,6 +714,7 @@ var allFeaturesSelectAddBtn = [
null,
null,
economicAddBtn,
jokesAddBtn,
];
allFeaturesSelectAddBtn.map((value, index) => {
@ -736,6 +752,7 @@ var allFeaturesFile = [
null,
null,
null,
null,
];
// features file add button
var imagesFileAddBtn = document.getElementById("inputTextBtn11");
@ -760,6 +777,7 @@ var allFeaturesFileAddBtn = [
null,
null,
null,
null,
];
// features input text
@ -791,6 +809,7 @@ var allFeaturesText = [
null,
null,
null,
null,
];
// features text add button
@ -822,6 +841,7 @@ var allFeaturesTextAddBtn = [
null,
null,
null,
null,
];
@ -844,6 +864,7 @@ var allFeaturesLimit = [
null,
null,
null,
null,
];
@ -1115,6 +1136,7 @@ function getFeatureSettings() {
"Movies",
"IPO Calendar",
"Economic Calendar",
"Jokes",
];
let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString();
@ -1180,6 +1202,9 @@ function getFeatureSettings() {
case 18:
s = getEconomicSettings(page);
break;
case 19:
s = getJokesSettings(page);
break;
}
settings = { ...settings, ...s }; // merge both sets of settings
@ -1372,6 +1397,7 @@ function saveMovieAPIKey(){
"Movies",
"IPO Calendar",
"Economic Calendar",
"Jokes",
];
let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString();
@ -1414,6 +1440,7 @@ function saveIpoAPIKey(){
"Movies",
"IPO Calendar",
"Economic Calendar",
"Jokes",
];
let pageNum = features.indexOf(feature) + 1;
let pageSelector = "Page" + pageNum.toString();
@ -1819,7 +1846,7 @@ inputAnimationBtn.addEventListener("click", () => {
// scroll speed row two
let inputScrollSpeedRow = [];
for (let i = 1; i <= 18; i++) {
for (let i = 1; i <= 19; i++) {
inputScrollSpeedRow.push(
document.getElementById(
i === 1 ? "inputScrollSpeedRow" : `inputScrollSpeedRow${i}`