From 14941fae66d3aadd5c079bb2c3d51fb0bbc9bc66 Mon Sep 17 00:00:00 2001 From: unknown <2303063@ad.nchc.org.tw> Date: Wed, 10 Jan 2024 12:41:02 +0800 Subject: [PATCH] 2024-01-03, update for ibon. --- chrome_tixcraft.py | 2 +- config_launcher.py | 2 +- settings.py | 2 +- text_server.py | 2 +- webdriver/Maxbotplus_1.0.0/js/ibon_area.js | 53 ++++++++++++++++++- .../js/kktix_registrations_reload.js | 1 - webdriver/Maxbotplus_1.0.0/manifest.json | 2 +- 7 files changed, 57 insertions(+), 7 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index d8e40e8..cbf037d 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -54,7 +54,7 @@ import webbrowser import chromedriver_autoinstaller -CONST_APP_VERSION = "MaxBot (2024.01.02)" +CONST_APP_VERSION = "MaxBot (2024.01.03)" CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" diff --git a/config_launcher.py b/config_launcher.py index b9c8337..bcaed47 100644 --- a/config_launcher.py +++ b/config_launcher.py @@ -22,7 +22,7 @@ import sys import threading import webbrowser -CONST_APP_VERSION = "MaxBot (2024.01.02)" +CONST_APP_VERSION = "MaxBot (2024.01.03)" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/settings.py b/settings.py index 335657c..a6e372c 100644 --- a/settings.py +++ b/settings.py @@ -34,7 +34,7 @@ import ssl ssl._create_default_https_context = ssl._create_unverified_context -CONST_APP_VERSION = "MaxBot (2024.01.02)" +CONST_APP_VERSION = "MaxBot (2024.01.03)" CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" diff --git a/text_server.py b/text_server.py index 8750b0d..dd7eb2f 100644 --- a/text_server.py +++ b/text_server.py @@ -27,7 +27,7 @@ import pyperclip import tornado from tornado.web import Application -CONST_APP_VERSION = "MaxBot (2024.01.02)" +CONST_APP_VERSION = "MaxBot (2024.01.03)" CONST_MAXBOT_QUESTION_FILE = "MAXBOT_QUESTION.txt" diff --git a/webdriver/Maxbotplus_1.0.0/js/ibon_area.js b/webdriver/Maxbotplus_1.0.0/js/ibon_area.js index 7d34206..8c13825 100644 --- a/webdriver/Maxbotplus_1.0.0/js/ibon_area.js +++ b/webdriver/Maxbotplus_1.0.0/js/ibon_area.js @@ -1,5 +1,56 @@ +const storage = chrome.storage.local; +var settings = null; + // price row. $("table > tbody > tr.disabled").remove(); $("table > tbody > tr.sold-out").remove(); $("div.map > div > img").remove(); -$("footer").remove(); \ No newline at end of file +$("footer").remove(); +let $tr=$("table > tbody > tr[onclick]"); +//console.log("$tr.length:"+$tr.length); +if($tr.length==1) { + //console.log("$tr.html:"+$tr.html()); + $tr.click(); +} + +function ibon_area_main() { + let reload=false; + let $tr=$("table > tbody > tr[onclick]"); + if($tr.length==0) { + reload=true; + } + if(reload) { + let auto_reload_page_interval = 0.0; + if(settings) { + auto_reload_page_interval = settings.advanced.auto_reload_page_interval; + } + if(auto_reload_page_interval == 0) { + //console.log('Start to reload now.'); + location.reload(); + } else { + console.log('We are going to reload after few seconeds.'); + setTimeout(function () { + location.reload(); + }, auto_reload_page_interval * 1000); + } + } +} + + +storage.get('settings', function (items) +{ + if (items.settings) + { + settings = items.settings; + } +}); + +storage.get('status', function (items) +{ + if (items.status && items.status=='ON') + { + ibon_area_main(); + } else { + console.log('no status found'); + } +}); diff --git a/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js b/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js index 84fb1e4..2cdd060 100644 --- a/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js +++ b/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js @@ -1,5 +1,4 @@ const storage = chrome.storage.local; - var settings = null; var myInterval = null; diff --git a/webdriver/Maxbotplus_1.0.0/manifest.json b/webdriver/Maxbotplus_1.0.0/manifest.json index a060d8b..782665b 100644 --- a/webdriver/Maxbotplus_1.0.0/manifest.json +++ b/webdriver/Maxbotplus_1.0.0/manifest.json @@ -221,5 +221,5 @@ "js" : [ "jquery.min.js", "js/common.js", "js/kktix_registrations_reload.js" ] } ], - "version": "1.0.2" + "version": "1.0.3" } \ No newline at end of file