X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/4bf43ab9d4e6b724836724c1d514760d164df79a..b4bb6efd3c36b1eaaa243cf63d1030001c7079d2:/Plugson/www/plugson_theme.html diff --git a/Plugson/www/plugson_theme.html b/Plugson/www/plugson_theme.html index 16bc973..89f069f 100644 --- a/Plugson/www/plugson_theme.html +++ b/Plugson/www/plugson_theme.html @@ -1,10 +1,12 @@
-
+
  

主题插件

- +
+ +
@@ -69,6 +71,50 @@
+ +
+
+

resolution_fit + —— 按照分辨率过滤

+
+ +
+
+
+ + + + + + + + + + + + + +
选项设置 +      + +
选项说明当设置多个主题时,在随机选择时是否按照当前分辨率过滤。   + 0 不过滤    + 1 过滤
+ 注意,这个选项必须在上面设置了多个主题配置文件,同时 "默认" 设置为 “随机选择” 时才有效,其他情况下均无效。
+ 关于这个选项的详细解释,请参考 resolution_fit 选项说明 +
Option Description + Filter by current resolution when you set more than one themes.    + 0 No filter    + 1 Filter
+ You can refer About resolution_fit for details about this option. +
+
+
+
@@ -237,6 +283,8 @@ } else { data.display_mode = 0; } + + data.resolution_fit = parseInt($('input:radio[name=id_ctrl_radio_res_fit]:checked').val()); } function VtoySaveCurrentPage() { @@ -247,6 +295,7 @@ method : 'save_theme', index: current_tab_index, display_mode: data.display_mode, + resolution_fit: data.resolution_fit, gfxmode: data.gfxmode, default_file: data.default_file }, function(e) { @@ -267,6 +316,12 @@ var $tbl = $("#id_theme_tbl_file tbody"); $tbl.empty(); + if (list.length > 1) { + $('#resolution_fit_div').show(); + } else { + $('#resolution_fit_div').hide(); + } + for (var i = 0; i < list.length; i++) { var $tr; td1 = '' + (i + 1) + ''; @@ -299,7 +354,7 @@ $('input[type=radio]').each(function(){ var id = $(this).attr('id'); - if (id.startsWith('id_theme_file')) { + if (typeof(id) != 'undefined' && id.startsWith('id_theme_file')) { $(this).change(function() { m_data_theme[current_tab_index].default_file =parseInt(id.substr(id.length - 1)); VtoySaveCurrentPage(); @@ -363,6 +418,8 @@ $('select[id=id_theme_sel_dismode').val('GUI'); } + $('input:radio[name=id_ctrl_radio_res_fit]')[data.resolution_fit].checked = true; + FillThemeFileTable(data.filelist, data.default_file); FillThemeFontTable(data.fontslist); } @@ -401,9 +458,13 @@ index: current_tab_index, path: data.path }, function(e) { - list.push(data); - FillThemeFileTable(list, m_data_theme[current_tab_index].default_file); - Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + if (e.result === 'success') { + list.push(data); + FillThemeFileTable(list, m_data_theme[current_tab_index].default_file); + Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + } else if (e.result === 'duplicate') { + Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH); + } }); } @@ -426,9 +487,13 @@ index: current_tab_index, path: data.path }, function(e) { - list.push(data); - FillThemeFontTable(list); - Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + if (e.result === 'success') { + list.push(data); + FillThemeFontTable(list); + Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS); + } else if (e.result === 'duplicate') { + Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH); + } }); } @@ -505,6 +570,8 @@ $('select[id=id_theme_sel_gfxmode]').change(VtoySaveCurrentPage); $('select[id=id_theme_sel_dismode]').change(VtoySaveCurrentPage); + $('#id_ctrl_radio_res_fit0').change(VtoySaveCurrentPage); + $('#id_ctrl_radio_res_fit1').change(VtoySaveCurrentPage); $('#id_tab_theme a[href="#tab_0"]').click(OnClickMultiModeTab); $('#id_tab_theme a[href="#tab_1"]').click(OnClickMultiModeTab); @@ -513,6 +580,36 @@ $('#id_tab_theme a[href="#tab_4"]').click(OnClickMultiModeTab); $('#id_tab_theme a[href="#tab_5"]').click(OnClickMultiModeTab); + function UpdateTabTitleIcon(data) { + CommonUpdateTabTitleIcon(data.exist_theme, '#id_tab_theme a[href="#tab_', 'theme'); + } + $('#id_btn_reset').click(function() { + Modal.confirm({msg:GetResetTabConfigTipMsg(current_tab_index, 'theme')}).on(function(e) { + if (e) { + callVtoySync({ + method : 'theme_del_file', + index: current_tab_index, + path: g_del_all_path + }, function(data) { + + }); + + callVtoySync({ + method : 'theme_del_font', + index: current_tab_index, + path: g_del_all_path + }, function(data) { + + }); + + m_data_theme[current_tab_index].filelist.length = 0; + m_data_theme[current_tab_index].fontslist.length = 0; + VtoyFillCurrentPageItem(m_data_theme[g_vtoy_data_default_index]); + VtoySaveCurrentPage(); + } + }); + }); + $('#id_tab_theme a[href="#tab_0"]').tab('show'); VtoyFillCurrentPageItem(m_data_theme[0]); VtoyPageLanguageChange(g_current_language);