X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/43e921878b27d1b293819ed9dc4ea2b87b28ae58..f7e6bbc70c65db9f6f5da5abc4ae57bd689da91c:/Plugson/www/plugson_menu_tip.html diff --git a/Plugson/www/plugson_menu_tip.html b/Plugson/www/plugson_menu_tip.html index 4b12cd8..75ef808 100644 --- a/Plugson/www/plugson_menu_tip.html +++ b/Plugson/www/plugson_menu_tip.html @@ -1,10 +1,12 @@
-
+
  

- +
+ +
@@ -195,7 +197,7 @@ $('input:text[id=id_tip_text_top]').val(data.top); $('input:text[id=id_tip_text_color]').val(data.color); - FillTipTable(data); + FillTipTable(data.tips); } @@ -208,7 +210,7 @@ } current_tab_index = index; - VtoyFillCurrentPageItem(m_data_tip[index].tips); + VtoyFillCurrentPageItem(m_data_tip[index]); } //Main process @@ -242,9 +244,13 @@ tip: data.tip, type: type }, function(e) { - list.push(data); - FillTipTable(list); - Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + if (e.result === 'success') { + list.push(data); + FillTipTable(list); + Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + } else if (e.result === 'duplicate') { + Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH); + } }); } @@ -332,8 +338,9 @@ $('input:text[id=id_tip_text_left]').change(function() { var value = $('input:text[id=id_tip_text_left]').val(); - if (ventoy_check_percent(value)) { + if (ventoy_check_percent(value)) { VtoySaveCurrentPage(); + m_data_tip[current_tab_index].left = value; } else { Message.error(g_vtoy_cur_language.STR_INVALID_PERCENT); $('input:text[id=id_tip_text_left]').val(m_data_tip[current_tab_index].left); @@ -343,6 +350,7 @@ var value = $('input:text[id=id_tip_text_top]').val(); if (ventoy_check_percent(value)) { VtoySaveCurrentPage(); + m_data_tip[current_tab_index].top = value; } else { Message.error(g_vtoy_cur_language.STR_INVALID_PERCENT); $('input:text[id=id_tip_text_top]').val(m_data_tip[current_tab_index].top); @@ -353,6 +361,7 @@ if (value.length > 0) { if (ventoy_check_color(value)) { VtoySaveCurrentPage(); + m_data_tip[current_tab_index].color = value; } else { Message.error(g_vtoy_cur_language.STR_INVALID_COLOR); $('input:text[id=id_tip_text_color]').val(m_data_tip[current_tab_index].color); @@ -370,6 +379,30 @@ $('#id_tab_menu_tip a[href="#tab_4"]').click(OnClickMultiModeTab); $('#id_tab_menu_tip a[href="#tab_5"]').click(OnClickMultiModeTab); + function UpdateTabTitleIcon(data) { + CommonUpdateTabTitleIcon(data.exist_menu_tip, '#id_tab_menu_tip a[href="#tab_', 'menu_tip'); + } + $('#id_btn_reset').click(function() { + Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'menu_tip')}).on(function(e) { + if (e) { + callVtoySync({ + method : 'tip_del', + index: current_tab_index, + path: g_del_all_path + }, function(data) { + + }); + + m_data_tip[current_tab_index].left = m_data_tip[g_vtoy_data_default_index].left; + m_data_tip[current_tab_index].top = m_data_tip[g_vtoy_data_default_index].top; + m_data_tip[current_tab_index].color = m_data_tip[g_vtoy_data_default_index].color; + m_data_tip[current_tab_index].tips.length = 0; + VtoyFillCurrentPageItem(m_data_tip[g_vtoy_data_default_index]); + VtoySaveCurrentPage(); + } + }); + }); + $('#id_tab_menu_tip a[href="#tab_0"]').tab('show'); VtoyFillCurrentPageItem(m_data_tip[0]); VtoyPageLanguageChange(g_current_language);