1 <div class=
"box box-primary" id=
"control">
2 <div class=
"box-header">
3 <div class=
"col-sm-10" style=
"padding-top:8px;">
4 <i class=
"fa fa-commenting"> </i>
5 <h1 class=
"box-title" style=
"font-weight:bold;" id=
"id_h1_page_title"></h1>
8 <div class=
"col-sm-2" style=
"font-size:16px;padding-top:8px;">
9 <a id=
"id_a_official_doc" target=
"_blank" href=
"https://www.ventoy.net/en/plugin_menutip.html"><span class=
"fa fa-link"></span><span id=
"id_span_official_doc">官网文档
</span></a>
14 <div class=
"box-body">
15 <div class=
"nav-tabs-custom">
16 <ul class=
"nav nav-tabs" id=
"id_tab_menu_tip">
17 <li class=
""><a href=
"#tab_0" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold" >menu_tip
</a></li>
18 <li class=
""><a href=
"#tab_1" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">menu_tip_legacy
</a></li>
19 <li class=
""><a href=
"#tab_2" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">menu_tip_uefi
</a></li>
20 <li class=
""><a href=
"#tab_3" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">menu_tip_ia32
</a></li>
21 <li class=
""><a href=
"#tab_4" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">menu_tip_aa64
</a></li>
22 <li class=
""><a href=
"#tab_5" data-toggle=
"tab" aria-expanded=
"false" style=
"font-weight:bold">menu_tip_mips
</a></li>
26 <div class=
"box box-primary box-solid">
27 <div class=
"box-header with-border">
28 <h3 class=
"box-title" style=
"font-size: 14px;font-weight: bold;">Menu Tips
29 <span id=
"id_span_desc_cn"> —— 菜单提示信息
</span></h3>
30 <div class=
"box-tools pull-right">
31 <button class=
"btn btn-box-tool" data-widget=
"collapse"><i class=
"fa fa-minus"></i></button>
32 </div><!-- /.box-tools -->
33 </div><!-- /.box-header -->
34 <div class=
"box-body no-padding">
35 <table id=
"id_tip_tbl" class=
"table table-bordered">
38 <th style=
"width: 2%;">#
</th>
39 <th id=
"id_th_tip_type" style=
"width: 5%;"></th>
40 <th id=
"id_th_tip_path" style=
"width: 35%;"></th>
41 <th id=
"id_th_status" style=
"width: 5%;"></th>
42 <th id=
"id_th_tip_tip" style=
"width: 40%;"></th>
43 <th id=
"id_th_operation" style=
"width: 5%;"></th>
53 <div class=
"box box-primary box-solid">
54 <div class=
"box-header with-border">
55 <h3 class=
"box-title" style=
"font-size: 14px;font-weight: bold;">Tip Style
56 <span id=
"id_span_desc_cn"> —— 提示信息显示位置
</span></h3>
57 <div class=
"box-tools pull-right">
58 <button class=
"btn btn-box-tool" data-widget=
"collapse"><i class=
"fa fa-minus"></i></button>
59 </div><!-- /.box-tools -->
60 </div><!-- /.box-header -->
61 <div class=
"box-body no-padding">
62 <table id=
"id_tip_style" class=
"table table-bordered">
65 <th id=
"id_th_tip_opt" style=
"width: 10%;"></th>
66 <th id=
"id_th_tip_set" style=
"width: 20%;"></th>
67 <th id=
"id_th_tip_notes" style=
"width: 70%;"></th>
74 <input type=
"text" class=
"form-control" id=
"id_tip_text_left"/>
77 <span id=
"id_span_desc_cn">提示信息显示的 X 坐标百分比(相对于左上角)
</span>
78 <span id=
"id_span_desc_en">X position of the tip message. (Percentage form relative to the upper left corner)
</span>
84 <input type=
"text" class=
"form-control" id=
"id_tip_text_top"/>
87 <span id=
"id_span_desc_cn">提示信息显示的 Y 坐标百分比(相对于左上角)
</span>
88 <span id=
"id_span_desc_en">Y position of the tip message. (Percentage form relative to the upper left corner)
</span>
94 <input type=
"text" class=
"form-control" id=
"id_tip_text_color"/>
97 <span id=
"id_span_desc_cn">提示信息的颜色。可以是
<code>blue/red/green/...
</code> 等这种格式,也可以设置为
<code>#
00ff00
</code> 这种格式。
</span>
98 <span id=
"id_span_desc_en">Color of the tip message. Can be in
<code>blue/red/green/...
</code> or
<code>#
00ff00
</code> format.
</span>
109 <script type=
"text/javascript">
111 function VtoyPageLanguageChange(newlang) {
112 VtoyCommonChangeLanguage(newlang);
113 $('h1[id=id_h1_page_title]').text(g_vtoy_cur_language.STR_PLUG_TIP);
115 $("span[id=id_span_file_exist]").each(function(){
116 $(this).text(g_vtoy_cur_language.STR_FILE_EXIST);
118 $("span[id=id_span_file_nonexist]").each(function(){
119 $(this).text(g_vtoy_cur_language.STR_FILE_NONEXIST);
121 $("span[id=id_span_file_fuzzy]").each(function(){
122 $(this).text(g_vtoy_cur_language.STR_FILE_FUZZY);
125 $("span[id=id_span_dir_exist]").each(function(){
126 $(this).text(g_vtoy_cur_language.STR_DIR_EXIST);
129 $("span[id=id_span_dir_nonexist]").each(function(){
130 $(this).text(g_vtoy_cur_language.STR_DIR_NONEXIST);
135 if (newlang === 'en') {
136 $('#id_th_tip_path').text('Absolute Path');
137 $('#id_th_tip_tip').text('Tip');
138 $('#id_th_tip_type').text('Type');
139 $("th[id=id_th_tip_opt]").text('Option');
140 $("th[id=id_th_tip_set]").text('Setting');
141 $("th[id=id_th_tip_notes]").text('Notes');
143 $("span[id=id_span_desc_cn]").each(function(){
146 $("span[id=id_span_desc_en]").each(function(){
150 $('#id_th_tip_path').text('绝对路径');
151 $('#id_th_tip_tip').text('提示');
152 $('#id_th_tip_type').text('类型');
153 $("th[id=id_th_tip_opt]").text('选项');
154 $("th[id=id_th_tip_set]").text('设置');
155 $("th[id=id_th_tip_notes]").text('说明');
156 $("span[id=id_span_desc_en]").each(function(){
159 $("span[id=id_span_desc_cn]").each(function(){
165 function FillTipTable(data) {
166 var addbtn = ventoy_get_xslg_addbtn('TipAddBtn');
167 var delbtn = ventoy_get_xslg_delbtn('TipDelBtn');
169 var td1, td2, td3, td4, td5, td6;
170 var $tbl = $("#id_tip_tbl tbody");
173 for (var i =
0; i < data.length; i++) {
175 td1 = '
<td>' + (i +
1) + '
</td>';
176 td2 = (data[i].type ===
0) ? '
<td>image
</td>' : '
<td>dir
</td>';
177 td3 = '
<td>' + data[i].path + '
</td>';
178 td4 = '
<td>' + ventoy_get_status_line(data[i].type, data[i].valid) + '
</td>';
179 td5 = '
<td>' + data[i].tip + '
</td>';
180 td6 = '
<td>' + delbtn + '
</td>';
182 $tr = $('
<tr>' + td1 + td2 + td3 + td4 + td5 + td6 + '
</tr>');
184 $tr.data('path', data[i].path);
185 $tr.data('index', i);
189 $tbl.append('
<tr><td></td><td></td><td></td><td></td><td></td><td>' + addbtn + '
</td></tr>');
192 function VtoyFillCurrentPageItem(data) {
194 $('input:text[id=id_tip_text_left]').val(data.left);
195 $('input:text[id=id_tip_text_top]').val(data.top);
196 $('input:text[id=id_tip_text_color]').val(data.color);
202 function OnClickMultiModeTab() {
203 var href = $(this).attr('href');
204 var index = parseInt(href.substr(
5,
1));
206 if (index <
0 || index
>= g_vtoy_data_default_index || current_tab_index === index) {
210 current_tab_index = index;
211 VtoyFillCurrentPageItem(m_data_tip[index].tips);
216 var current_tab_index =
0;
217 callVtoySync({method : 'get_tip'}, function(data) {
222 function AddTipEntry(root, type, valid, extra) {
223 var list = m_data_tip[current_tab_index].tips;
225 "path": root.substr(g_current_dir.length),
231 for (var i =
0; i < list.length; i++) {
232 if (list[i].path === data.path) {
233 Message.error(g_vtoy_cur_language.STR_DUPLICATE_PATH);
240 index: current_tab_index,
247 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
251 function OnAddImageTip(root, valid, extra) {
252 AddTipEntry(root,
0, valid, extra);
255 function OnAddDirTip(root, extra) {
256 AddTipEntry(root,
1,
1, extra);
259 function OnAddTipBtnClick(sel) {
261 var tip1 = (g_current_os === 'windows') ? '\\ISO\\Windows11.iso' : "/ISO/Ubuntu-
20.04-desktop-amd64.iso";
262 var tip2 = (g_current_os === 'windows') ? '\\ISO\\Windows**.iso' : "/ISO/Ubuntu-*****-desktop-amd64.iso";
264 "title": g_vtoy_cur_language.STR_SET_TIP,
266 "tip1": g_current_dir + tip1,
267 "tip2": g_current_dir + tip2,
270 "extra_title": g_vtoy_cur_language.STR_TIP
272 VtoySelectFilePath(OnAddImageTip, para);
274 var tip = (g_current_os === 'windows') ? '\\ISO\\Windows' : "/ISO/Linux";
276 "title": g_vtoy_cur_language.STR_SET_TIP,
277 "tip": g_current_dir + tip,
280 "extra_title": g_vtoy_cur_language.STR_TIP
282 VtoySelectDirPath(OnAddDirTip, para);
286 $("#id_tip_tbl").on('click', '.TipAddBtn', function() {
290 "tip": g_vtoy_cur_language.STR_SET_TIP_FOR_FILE
294 "tip": g_vtoy_cur_language.STR_SET_TIP_FOR_DIR
298 VtoySelectType(OnAddTipBtnClick, para);
301 $("#id_tip_tbl").on('click', '.TipDelBtn', function() {
302 var $tr = $(this).closest('tr');
303 var path = $tr.data('path');
304 var index = $tr.data('index');
308 index: current_tab_index,
311 m_data_tip[current_tab_index].tips.splice(index,
1);
312 FillTipTable(m_data_tip[current_tab_index].tips);
313 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
317 function VtoySaveCurrentPage() {
318 var left = $('input:text[id=id_tip_text_left]').val();
319 var top = $('input:text[id=id_tip_text_top]').val();
320 var color = $('input:text[id=id_tip_text_color]').val();
324 index: current_tab_index,
329 Message.success(g_vtoy_cur_language.STR_SAVE_SUCCESS);
333 $('input:text[id=id_tip_text_left]').change(function() {
334 var value = $('input:text[id=id_tip_text_left]').val();
335 if (ventoy_check_percent(value)) {
336 VtoySaveCurrentPage();
338 Message.error(g_vtoy_cur_language.STR_INVALID_PERCENT);
339 $('input:text[id=id_tip_text_left]').val(m_data_tip[current_tab_index].left);
342 $('input:text[id=id_tip_text_top]').change(function() {
343 var value = $('input:text[id=id_tip_text_top]').val();
344 if (ventoy_check_percent(value)) {
345 VtoySaveCurrentPage();
347 Message.error(g_vtoy_cur_language.STR_INVALID_PERCENT);
348 $('input:text[id=id_tip_text_top]').val(m_data_tip[current_tab_index].top);
351 $('input:text[id=id_tip_text_color]').change(function() {
352 var value = $('input:text[id=id_tip_text_color]').val();
353 if (value.length
> 0) {
354 if (ventoy_check_color(value)) {
355 VtoySaveCurrentPage();
357 Message.error(g_vtoy_cur_language.STR_INVALID_COLOR);
358 $('input:text[id=id_tip_text_color]').val(m_data_tip[current_tab_index].color);
361 $('input:text[id=id_tip_text_color]').val(m_data_tip[current_tab_index].color);
366 $('#id_tab_menu_tip a[
href=
"#tab_0"]').click(OnClickMultiModeTab);
367 $('#id_tab_menu_tip a[
href=
"#tab_1"]').click(OnClickMultiModeTab);
368 $('#id_tab_menu_tip a[
href=
"#tab_2"]').click(OnClickMultiModeTab);
369 $('#id_tab_menu_tip a[
href=
"#tab_3"]').click(OnClickMultiModeTab);
370 $('#id_tab_menu_tip a[
href=
"#tab_4"]').click(OnClickMultiModeTab);
371 $('#id_tab_menu_tip a[
href=
"#tab_5"]').click(OnClickMultiModeTab);
373 $('#id_tab_menu_tip a[
href=
"#tab_0"]').tab('show');
374 VtoyFillCurrentPageItem(m_data_tip[
0]);
375 VtoyPageLanguageChange(g_current_language);