kktix support not auto press next button.

master
Your Name 2024-04-12 16:35:46 +08:00
parent a4382e4f71
commit 2371d8b751
6 changed files with 36 additions and 17 deletions

View File

@ -117,7 +117,7 @@ def load_translate():
en_us["enable"] = 'Enable' en_us["enable"] = 'Enable'
en_us["recommand_enable"] = "Recommended to enable" en_us["recommand_enable"] = "Recommended to enable"
en_us["auto_press_next_step_button"] = 'Auto Press Next Step Button' en_us["auto_press_next_step_button"] = 'KKTIX Press Next Step Button'
en_us["auto_fill_ticket_number"] = 'Auto Fill Ticket Number' en_us["auto_fill_ticket_number"] = 'Auto Fill Ticket Number'
en_us["and"] = 'And with' en_us["and"] = 'And with'
@ -237,7 +237,7 @@ def load_translate():
zh_tw["enable"] = '啟用' zh_tw["enable"] = '啟用'
zh_tw["recommand_enable"] = "建議啟用" zh_tw["recommand_enable"] = "建議啟用"
zh_tw["auto_press_next_step_button"] = '自動點選下一步按鈕' zh_tw["auto_press_next_step_button"] = 'KKTIX點選下一步按鈕'
zh_tw["auto_fill_ticket_number"] = '自動輸入張數' zh_tw["auto_fill_ticket_number"] = '自動輸入張數'
zh_tw["and"] = '而且(同列)' zh_tw["and"] = '而且(同列)'
@ -357,7 +357,7 @@ def load_translate():
zh_cn["enable"] = '启用' zh_cn["enable"] = '启用'
zh_cn["recommand_enable"] = "建议启用" zh_cn["recommand_enable"] = "建议启用"
zh_cn["auto_press_next_step_button"] = '自动点选下一步按钮' zh_cn["auto_press_next_step_button"] = 'KKTIX自动点选下一步按钮'
zh_cn["auto_fill_ticket_number"] = '自动输入张数' zh_cn["auto_fill_ticket_number"] = '自动输入张数'
zh_cn["and"] = '而且(同列)' zh_cn["and"] = '而且(同列)'
@ -478,7 +478,7 @@ def load_translate():
ja_jp["enable"] = '有効' ja_jp["enable"] = '有効'
ja_jp["recommand_enable"] = "有効化を推奨" ja_jp["recommand_enable"] = "有効化を推奨"
ja_jp["auto_press_next_step_button"] = '次を自動で押す' ja_jp["auto_press_next_step_button"] = 'KKTIX次を自動で押す'
ja_jp["auto_fill_ticket_number"] = '枚数自動入力' ja_jp["auto_fill_ticket_number"] = '枚数自動入力'
ja_jp["and"] = 'そして(同列)' ja_jp["and"] = 'そして(同列)'

View File

@ -139,13 +139,15 @@ function kktix_area_keyword(settings, base_info, register_info)
add_button.click(); add_button.click();
} }
let auto_click_next_btn = true; let auto_click_next_btn = settings.kktix.auto_press_next_step_button;
if(is_verification_conditions_popup) { if(auto_click_next_btn) {
auto_click_next_btn = false; if(is_verification_conditions_popup) {
let is_text_sent = kktix_verification_conditions(settings); auto_click_next_btn = false;
if(is_text_sent) { let is_text_sent = kktix_verification_conditions(settings);
auto_click_next_btn = true; if(is_text_sent) {
auto_click_next_btn = true;
}
} }
} }

View File

@ -6,11 +6,14 @@ async function ajax_return_done(data, event_id)
{ {
//console.log(data); //console.log(data);
if(settings) { if(settings) {
if(data.sessions.length==1) { if(data.sessions) {
let session_id=data.sessions[0].sessionId; // if, only one event, auto redirect.
if(session_id) { if(data.sessions.length==1) {
let new_url = "https://ticketplus.com.tw/order/"+ event_id +"/" + session_id; let session_id=data.sessions[0].sessionId;
location.href = new_url; if(session_id) {
let new_url = "https://ticketplus.com.tw/order/"+ event_id +"/" + session_id;
location.href = new_url;
}
} }
} }
} }
@ -27,7 +30,9 @@ async function wait_function_ready() {
}) })
.done(function(data) { .done(function(data) {
//alert( "second success" ); //alert( "second success" );
ajax_return_done(data, event_id); if(data) {
ajax_return_done(data, event_id);
}
}) })
.fail(function() { .fail(function() {
//alert( "error" ); //alert( "error" );

View File

@ -69,7 +69,9 @@ function get_event_status_core(real_event_id, real_session_id) {
}) })
.done(function(data) { .done(function(data) {
//alert( "second success" ); //alert( "second success" );
ajax_return_done(data, real_event_id, real_session_id); if(data) {
ajax_return_done(data, real_event_id, real_session_id);
}
}) })
.fail(function() { .fail(function() {
//alert( "error" ); //alert( "error" );

View File

@ -130,6 +130,13 @@
<input class="form-control" id="auto_reload_page_interval" value="" /> <input class="form-control" id="auto_reload_page_interval" value="" />
</div> </div>
</div> </div>
<div class="row mb-3">
<label class="col-sm-2 col-form-label form-check-label" for="auto_press_next_step_button">KKTIX Press Next Step Button</label>
<div class="col-sm-10">
<input class="form-check-input" type="checkbox" id="auto_press_next_step_button" />
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<label class="col-sm-2 col-form-label form-check-label" for="kktix_status_api">KKTIX Status API</label> <label class="col-sm-2 col-form-label form-check-label" for="kktix_status_api">KKTIX Status API</label>
<div class="col-sm-10"> <div class="col-sm-10">

View File

@ -8,6 +8,7 @@ const area_select_mode = document.querySelector('#area_select_mode');
const area_keyword = document.querySelector('#area_keyword'); const area_keyword = document.querySelector('#area_keyword');
const keyword_exclude = document.querySelector('#keyword_exclude'); const keyword_exclude = document.querySelector('#keyword_exclude');
const auto_reload_page_interval = document.querySelector('#auto_reload_page_interval'); const auto_reload_page_interval = document.querySelector('#auto_reload_page_interval');
const auto_press_next_step_button = document.querySelector('#auto_press_next_step_button');
const kktix_status_api = document.querySelector('#kktix_status_api'); const kktix_status_api = document.querySelector('#kktix_status_api');
const max_dwell_time = document.querySelector('#max_dwell_time'); const max_dwell_time = document.querySelector('#max_dwell_time');
const disable_adjacent_seat = document.querySelector('#disable_adjacent_seat'); const disable_adjacent_seat = document.querySelector('#disable_adjacent_seat');
@ -60,6 +61,7 @@ async function saveChanges()
settings.keyword_exclude = keyword_exclude.value; settings.keyword_exclude = keyword_exclude.value;
settings.advanced.auto_reload_page_interval = auto_reload_page_interval.value; settings.advanced.auto_reload_page_interval = auto_reload_page_interval.value;
settings.kktix.auto_press_next_step_button = auto_press_next_step_button.checked;
settings.advanced.kktix_status_api = kktix_status_api.checked; settings.advanced.kktix_status_api = kktix_status_api.checked;
settings.advanced.max_dwell_time = max_dwell_time.value; settings.advanced.max_dwell_time = max_dwell_time.value;
settings.advanced.disable_adjacent_seat = disable_adjacent_seat.checked; settings.advanced.disable_adjacent_seat = disable_adjacent_seat.checked;
@ -112,6 +114,7 @@ function loadChanges()
keyword_exclude.value = settings.keyword_exclude; keyword_exclude.value = settings.keyword_exclude;
auto_reload_page_interval.value = settings.advanced.auto_reload_page_interval; auto_reload_page_interval.value = settings.advanced.auto_reload_page_interval;
auto_press_next_step_button.checked = settings.kktix.auto_press_next_step_button;
kktix_status_api.checked = settings.advanced.kktix_status_api; kktix_status_api.checked = settings.advanced.kktix_status_api;
max_dwell_time.value = settings.advanced.max_dwell_time; max_dwell_time.value = settings.advanced.max_dwell_time;
disable_adjacent_seat.checked = settings.advanced.disable_adjacent_seat; disable_adjacent_seat.checked = settings.advanced.disable_adjacent_seat;