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