mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-28 00:11:15 +00:00
VentoyPlugson Update:
1. Add preview json feature 2. Add reset button 3. Add configuration active identifier for each tab 4. Bug fix
This commit is contained in:
@@ -57,6 +57,14 @@
|
||||
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="javascript:void(0)" id="id_a_preview">
|
||||
<span class="fa fa-file-code-o"></span>
|
||||
<span id="id_span_preview" class="hidden-xs">Preview</span>
|
||||
<span class="hidden-xs"> </span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="javascript:void(0)" id="id_a_language">
|
||||
<span class="fa fa-language"></span>
|
||||
@@ -710,6 +718,32 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal" id="JsonPreviewModal">
|
||||
<div class="modal-dialog" style="width: 80%;">
|
||||
<div class="modal-content">
|
||||
<form id="JsonPeviewForm" class="form-horizontal">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4>
|
||||
<b id="JsonPreviewForm_lang_1">JSON</b>
|
||||
<button type="button" id="id_btn_json_copy" class="btn btn-primary"><span class="fa fa-copy"> </span><span id="id_span_copy">Copy</span></button>
|
||||
</h4>
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<textarea id="pre_json_preview" class="form-control" rows="30" style="font-family:Menlo,Monaco,Consolas,'Courier New',monospace"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="PrewForm_lang_2" type="button" class="btn btn-primary btn-flat" data-dismiss="modal">确定</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
@@ -723,7 +757,7 @@
|
||||
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b id="plugson_build_date">20220921 18:42:35</b>
|
||||
<b id="plugson_build_date">20221021 14:42:35</b>
|
||||
</div>
|
||||
<strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>
|
||||
</footer>
|
||||
@@ -745,8 +779,8 @@
|
||||
<script src="/static/js/jquery.validate.min.js"></script>
|
||||
<script src="/static/js/jquery.validate.vtoymethods.js?v=100"></script>
|
||||
|
||||
<script src="/static/js/vtoy.js?v=100"></script>
|
||||
<script src="/static/js/jquery.vtoy.alert.js?v=100"></script>
|
||||
<script src="/static/js/vtoy.js?v=100"></script>
|
||||
<script src="/static/js/md5.min.js"></script>
|
||||
|
||||
<!-- Bootstrap 3.3.5 -->
|
||||
@@ -760,6 +794,36 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function VtoyJsonCopyClick() {
|
||||
var copyText = document.getElementById("pre_json_preview");
|
||||
copyText.select();
|
||||
copyText.setSelectionRange(0, 99999); // For mobile devices
|
||||
|
||||
try {
|
||||
var successful = document.execCommand('copy');
|
||||
copyText.setSelectionRange(0, 0);
|
||||
if (successful) {
|
||||
Message.success(g_vtoy_cur_language.STR_JSON_COPY_SUCCESS);
|
||||
} else {
|
||||
Message.error(g_vtoy_cur_language.STR_JSON_COPY_FAILED);
|
||||
}
|
||||
} catch (err) {
|
||||
Message.error(g_vtoy_cur_language.STR_JSON_COPY_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
function VtoyPreviewClick() {
|
||||
callVtoySync({
|
||||
method : 'preview_json'
|
||||
}, function(data) {
|
||||
$('#JsonPeviewForm #JsonPreviewForm_lang_1').text(g_vtoy_cur_language.STR_JSON_PREVIEW);
|
||||
$('#JsonPeviewForm #PrewForm_lang_2').text(g_vtoy_cur_language.STR_BTN_OK);
|
||||
|
||||
$('#pre_json_preview').text(atob(data.json));
|
||||
$("#JsonPreviewModal").modal();
|
||||
});
|
||||
}
|
||||
|
||||
function VtoyLanguageClick() {
|
||||
var defaultPage = window.location.hash;
|
||||
|
||||
@@ -791,6 +855,8 @@
|
||||
|
||||
});
|
||||
|
||||
$('#id_btn_json_copy').click(VtoyJsonCopyClick);
|
||||
$('#id_a_preview').click(VtoyPreviewClick);
|
||||
$('#id_a_language').click(VtoyLanguageClick);
|
||||
|
||||
$("#plugson-menu a").click(function() {
|
||||
@@ -846,9 +912,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof(UpdateTabTitleIcon)==='function') {
|
||||
UpdateTabTitleIcon(data);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
ventoy_handshake();
|
||||
}, 1000);
|
||||
}, 200);
|
||||
},
|
||||
|
||||
function(xmlHttpRequest, textStatus, errorThrown) {
|
||||
|
Reference in New Issue
Block a user