mirror of
https://github.com/arch3rPro/1Panel-Appstore.git
synced 2026-04-16 01:07:11 +08:00
feat: update nps v0.29.36
This commit is contained in:
8
apps/nps/v0.29.36/web/static/js/bootstrap-select.min.js
vendored
Normal file
8
apps/nps/v0.29.36/web/static/js/bootstrap-select.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
apps/nps/v0.29.36/web/static/js/bootstrap-table-cookie.min.js
vendored
Normal file
10
apps/nps/v0.29.36/web/static/js/bootstrap-table-cookie.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
apps/nps/v0.29.36/web/static/js/bootstrap-table-locale-all.min.js
vendored
Normal file
10
apps/nps/v0.29.36/web/static/js/bootstrap-table-locale-all.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
apps/nps/v0.29.36/web/static/js/bootstrap-table.min.js
vendored
Normal file
10
apps/nps/v0.29.36/web/static/js/bootstrap-table.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
apps/nps/v0.29.36/web/static/js/bootstrap.min.js
vendored
Normal file
7
apps/nps/v0.29.36/web/static/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
apps/nps/v0.29.36/web/static/js/echarts.min.js
vendored
Normal file
1
apps/nps/v0.29.36/web/static/js/echarts.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
apps/nps/v0.29.36/web/static/js/fontawesome.min.js
vendored
Normal file
5
apps/nps/v0.29.36/web/static/js/fontawesome.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
275
apps/nps/v0.29.36/web/static/js/inspinia.js
Normal file
275
apps/nps/v0.29.36/web/static/js/inspinia.js
Normal file
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
*
|
||||
* INSPINIA - Responsive Admin Theme
|
||||
* version 2.9.3
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
// Fast fix bor position issue with Propper.js
|
||||
// Will be fixed in Bootstrap 4.1 - https://github.com/twbs/bootstrap/pull/24092
|
||||
//Popper.Defaults.modifiers.computeStyle.gpuAcceleration = false;
|
||||
|
||||
|
||||
// Add body-small class if window less than 768px
|
||||
if (window.innerWidth < 769) {
|
||||
$('body').addClass('body-small')
|
||||
} else {
|
||||
$('body').removeClass('body-small')
|
||||
}
|
||||
|
||||
// MetisMenu
|
||||
//var sideMenu = $('#side-menu').metisMenu();
|
||||
|
||||
// Collapse ibox function
|
||||
$('.collapse-link').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var ibox = $(this).closest('div.ibox');
|
||||
var button = $(this).find('i');
|
||||
var content = ibox.children('.ibox-content');
|
||||
content.slideToggle(200);
|
||||
button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
|
||||
ibox.toggleClass('').toggleClass('border-bottom');
|
||||
setTimeout(function () {
|
||||
ibox.resize();
|
||||
ibox.find('[id^=map-]').resize();
|
||||
}, 50);
|
||||
});
|
||||
|
||||
// Close ibox function
|
||||
$('.close-link').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var content = $(this).closest('div.ibox');
|
||||
content.remove();
|
||||
});
|
||||
|
||||
// Fullscreen ibox function
|
||||
$('.fullscreen-link').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var ibox = $(this).closest('div.ibox');
|
||||
var button = $(this).find('i');
|
||||
$('body').toggleClass('fullscreen-ibox-mode');
|
||||
button.toggleClass('fa-expand').toggleClass('fa-compress');
|
||||
ibox.toggleClass('fullscreen');
|
||||
setTimeout(function () {
|
||||
$(window).trigger('resize');
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// Close menu in canvas mode
|
||||
$('.close-canvas-menu').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$("body").toggleClass("mini-navbar");
|
||||
SmoothlyMenu();
|
||||
});
|
||||
|
||||
// Run menu of canvas
|
||||
//$('body.canvas-menu .sidebar-collapse').slimScroll({
|
||||
// height: '100%',
|
||||
// railOpacity: 0.9
|
||||
//});
|
||||
|
||||
// Open close right sidebar
|
||||
$('.right-sidebar-toggle').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#right-sidebar').toggleClass('sidebar-open');
|
||||
});
|
||||
|
||||
// Initialize slimscroll for right sidebar
|
||||
//$('.sidebar-container').slimScroll({
|
||||
// height: '100%',
|
||||
// railOpacity: 0.4,
|
||||
// wheelStep: 10
|
||||
//});
|
||||
|
||||
// Open close small chat
|
||||
$('.open-small-chat').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).children().toggleClass('fa-comments').toggleClass('fa-times');
|
||||
$('.small-chat-box').toggleClass('active');
|
||||
});
|
||||
|
||||
// Initialize slimscroll for small chat
|
||||
//$('.small-chat-box .content').slimScroll({
|
||||
// height: '234px',
|
||||
// railOpacity: 0.4
|
||||
//});
|
||||
|
||||
// Small todo handler
|
||||
$('.check-link').on('click', function () {
|
||||
var button = $(this).find('i');
|
||||
var label = $(this).next('span');
|
||||
button.toggleClass('fa-check-square').toggleClass('fa-square-o');
|
||||
label.toggleClass('todo-completed');
|
||||
return false;
|
||||
});
|
||||
|
||||
// Append config box / Only for demo purpose
|
||||
// Uncomment on server mode to enable XHR calls
|
||||
//$.get("skin-config2.html", function (data) {
|
||||
// if (!$('body').hasClass('no-skin-config'))
|
||||
// $('body').append(data);
|
||||
//});
|
||||
|
||||
// Minimalize menu
|
||||
$('.navbar-minimalize').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
$("body").toggleClass("mini-navbar");
|
||||
SmoothlyMenu();
|
||||
|
||||
});
|
||||
|
||||
// Tooltips demo
|
||||
//$('.tooltip-demo').tooltip({
|
||||
// selector: "[data-toggle=tooltip]",
|
||||
// container: "body"
|
||||
//});
|
||||
|
||||
|
||||
// Move right sidebar top after scroll
|
||||
$(window).scroll(function () {
|
||||
if ($(window).scrollTop() > 0 && !$('body').hasClass('fixed-nav')) {
|
||||
$('#right-sidebar').addClass('sidebar-top');
|
||||
} else {
|
||||
$('#right-sidebar').removeClass('sidebar-top');
|
||||
}
|
||||
});
|
||||
|
||||
//$("[data-toggle=popover]")
|
||||
// .popover();
|
||||
|
||||
// Add slimscroll to element
|
||||
//$('.full-height-scroll').slimscroll({
|
||||
// height: '100%'
|
||||
//})
|
||||
});
|
||||
|
||||
// Minimalize menu when screen is less than 768px
|
||||
$(window).bind("resize", function () {
|
||||
if (window.innerWidth < 769) {
|
||||
$('body').addClass('body-small')
|
||||
} else {
|
||||
$('body').removeClass('body-small')
|
||||
}
|
||||
});
|
||||
|
||||
// Fixed Sidebar
|
||||
$(window).bind("load", function () {
|
||||
if ($("body").hasClass('fixed-sidebar')) {
|
||||
$('.sidebar-collapse').slimScroll({
|
||||
height: '100%',
|
||||
railOpacity: 0.9
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// check if browser support HTML5 local storage
|
||||
function localStorageSupport() {
|
||||
return (('localStorage' in window) && window['localStorage'] !== null)
|
||||
}
|
||||
|
||||
// Local Storage functions
|
||||
// Set proper body class and plugins based on user configuration
|
||||
$(document).ready(function () {
|
||||
if (localStorageSupport()) {
|
||||
|
||||
var collapse = localStorage.getItem("collapse_menu");
|
||||
var fixedsidebar = localStorage.getItem("fixedsidebar");
|
||||
var fixednavbar = localStorage.getItem("fixednavbar");
|
||||
var boxedlayout = localStorage.getItem("boxedlayout");
|
||||
var fixedfooter = localStorage.getItem("fixedfooter");
|
||||
|
||||
var body = $('body');
|
||||
|
||||
if (fixedsidebar == 'on') {
|
||||
body.addClass('fixed-sidebar');
|
||||
$('.sidebar-collapse').slimScroll({
|
||||
height: '100%',
|
||||
railOpacity: 0.9
|
||||
});
|
||||
}
|
||||
|
||||
if (collapse == 'on') {
|
||||
if (body.hasClass('fixed-sidebar')) {
|
||||
if (!body.hasClass('body-small')) {
|
||||
body.addClass('mini-navbar');
|
||||
}
|
||||
} else {
|
||||
if (!body.hasClass('body-small')) {
|
||||
body.addClass('mini-navbar');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (fixednavbar == 'on') {
|
||||
$(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top');
|
||||
body.addClass('fixed-nav');
|
||||
}
|
||||
|
||||
if (boxedlayout == 'on') {
|
||||
body.addClass('boxed-layout');
|
||||
}
|
||||
|
||||
if (fixedfooter == 'on') {
|
||||
$(".footer").addClass('fixed');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// For demo purpose - animation css script
|
||||
//function animationHover(element, animation) {
|
||||
// element = $(element);
|
||||
// element.hover(
|
||||
// function () {
|
||||
// element.addClass('animated ' + animation);
|
||||
// },
|
||||
// function () {
|
||||
// //wait for animation to finish before removing classes
|
||||
// window.setTimeout(function () {
|
||||
// element.removeClass('animated ' + animation);
|
||||
// }, 2000);
|
||||
// });
|
||||
//}
|
||||
|
||||
function SmoothlyMenu() {
|
||||
if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) {
|
||||
// Hide menu in order to smoothly turn on when maximize menu
|
||||
$('#side-menu').hide();
|
||||
// For smoothly turn on menu
|
||||
setTimeout(
|
||||
function () {
|
||||
$('#side-menu').fadeIn(400);
|
||||
}, 200);
|
||||
} else if ($('body').hasClass('fixed-sidebar')) {
|
||||
$('#side-menu').hide();
|
||||
setTimeout(
|
||||
function () {
|
||||
$('#side-menu').fadeIn(400);
|
||||
}, 100);
|
||||
} else {
|
||||
// Remove all inline style from jquery fadeIn function to reset menu state
|
||||
$('#side-menu').removeAttr('style');
|
||||
}
|
||||
}
|
||||
|
||||
// Dragable panels
|
||||
function WinMove() {
|
||||
var element = "[class*=col]";
|
||||
var handle = ".ibox-title";
|
||||
var connect = "[class*=col]";
|
||||
$(element).sortable(
|
||||
{
|
||||
handle: handle,
|
||||
connectWith: connect,
|
||||
tolerance: 'pointer',
|
||||
forcePlaceholderSize: true,
|
||||
opacity: 0.8
|
||||
})
|
||||
.disableSelection();
|
||||
}
|
||||
|
||||
|
||||
2
apps/nps/v0.29.36/web/static/js/jquery-3.7.1.min.js
vendored
Normal file
2
apps/nps/v0.29.36/web/static/js/jquery-3.7.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
apps/nps/v0.29.36/web/static/js/jsencrypt.min.js
vendored
Normal file
2
apps/nps/v0.29.36/web/static/js/jsencrypt.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
327
apps/nps/v0.29.36/web/static/js/language.js
Normal file
327
apps/nps/v0.29.36/web/static/js/language.js
Normal file
@@ -0,0 +1,327 @@
|
||||
(function ($) {
|
||||
function xml2json(Xml) {
|
||||
var tempvalue, tempJson = {};
|
||||
$(Xml).each(function () {
|
||||
var tagName = ($(this).attr('id') || this.tagName);
|
||||
tempvalue = (this.childElementCount == 0) ? this.textContent : xml2json($(this).children());
|
||||
switch ($.type(tempJson[tagName])) {
|
||||
case 'undefined':
|
||||
tempJson[tagName] = tempvalue;
|
||||
break;
|
||||
case 'object':
|
||||
tempJson[tagName] = Array(tempJson[tagName]);
|
||||
case 'array':
|
||||
tempJson[tagName].push(tempvalue);
|
||||
}
|
||||
});
|
||||
return tempJson;
|
||||
}
|
||||
|
||||
function setCookie(c_name, value, expiredays) {
|
||||
var exdate = new Date();
|
||||
exdate.setDate(exdate.getDate() + expiredays);
|
||||
document.cookie = c_name + '=' + escape(value) + ((expiredays == null) ? '' : ';expires=' + exdate.toGMTString()) + '; path=' + window.nps.web_base_url + '/;';
|
||||
}
|
||||
|
||||
function getCookie(c_name) {
|
||||
if (document.cookie.length > 0) {
|
||||
c_start = document.cookie.indexOf(c_name + '=');
|
||||
if (c_start != -1) {
|
||||
c_start = c_start + c_name.length + 1;
|
||||
c_end = document.cookie.indexOf(';', c_start);
|
||||
if (c_end == -1) c_end = document.cookie.length;
|
||||
return unescape(document.cookie.substring(c_start, c_end));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function setchartlang(langobj, chartobj) {
|
||||
if ($.type(langobj) == 'string') return langobj;
|
||||
if ($.type(langobj) == 'chartobj') return false;
|
||||
var flag = true;
|
||||
for (key in langobj) {
|
||||
var item = key;
|
||||
children = (chartobj.hasOwnProperty(item)) ? setchartlang(langobj[item], chartobj[item]) : setchartlang(langobj[item], undefined);
|
||||
switch ($.type(children)) {
|
||||
case 'string':
|
||||
if ($.type(chartobj[item]) != 'string') continue;
|
||||
case 'object':
|
||||
chartobj[item] = (children['value'] || children);
|
||||
default:
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
return {'value': (langobj[languages['current']] || langobj[languages['default']] || 'N/A')}
|
||||
}
|
||||
}
|
||||
|
||||
$.fn.cloudLang = function () {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: window.nps.web_base_url + '/static/page/languages.xml?v=' + window.nps.version,
|
||||
dataType: 'xml',
|
||||
success: function (xml) {
|
||||
languages['content'] = xml2json($(xml).children())['content'];
|
||||
languages['menu'] = languages['content']['languages'];
|
||||
languages['default'] = languages['content']['default'];
|
||||
// languages['navigator'] = (getCookie('lang') || navigator.language || navigator.browserLanguage);
|
||||
var navLang = (getCookie('lang') || navigator.language || navigator.browserLanguage || '');
|
||||
languages['navigator'] = navLang.startsWith('zh') ? 'zh-CN' : navLang;
|
||||
for (var key in languages['menu']) {
|
||||
$('#languagemenu').next().append('<li lang="' + key + '"><a><img src="' + window.nps.web_base_url + '/static/img/flag/' + key + '.png"> ' + languages['menu'][key] + '</a></li>');
|
||||
if (key == languages['navigator']) languages['current'] = key;
|
||||
}
|
||||
$('#languagemenu').attr('lang', (languages['current'] || languages['default']));
|
||||
$('body').setLang('');
|
||||
|
||||
if ($.fn.selectpicker != null) {
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.setLang = function (dom) {
|
||||
languages['current'] = $('#languagemenu').attr('lang');
|
||||
if (dom == '') {
|
||||
$('#languagemenu span').text(' ' + languages['menu'][languages['current']]);
|
||||
if (languages['current'] != getCookie('lang')) setCookie('lang', languages['current']);
|
||||
if ($("#table").length > 0) $('#table').bootstrapTable('refreshOptions', {'locale': languages['current']});
|
||||
}
|
||||
$.each($(dom + ' [langtag]'), function (i, item) {
|
||||
var index = $(item).attr('langtag');
|
||||
string = languages['content'][index.toLowerCase()];
|
||||
switch ($.type(string)) {
|
||||
case 'string':
|
||||
break;
|
||||
case 'array':
|
||||
string = string[Math.floor((Math.random() * string.length))];
|
||||
case 'object':
|
||||
string = (string[languages['current']] || string[languages['default']] || null);
|
||||
break;
|
||||
default:
|
||||
string = 'Missing language string "' + index + '"';
|
||||
$(item).css('background-color', '#ffeeba');
|
||||
}
|
||||
if ($.type($(item).attr('placeholder')) == 'undefined') {
|
||||
$(item).text(string);
|
||||
} else {
|
||||
$(item).attr('placeholder', string);
|
||||
}
|
||||
});
|
||||
|
||||
if (!$.isEmptyObject(chartdatas)) {
|
||||
setchartlang(languages['content']['charts'], chartdatas);
|
||||
for (var key in chartdatas) {
|
||||
if ($('#' + key).length == 0) continue;
|
||||
if ($.type(chartdatas[key]) == 'object')
|
||||
charts[key] = echarts.init(document.getElementById(key));
|
||||
charts[key].setOption(chartdatas[key], true);
|
||||
}
|
||||
}
|
||||
|
||||
if(window.hasOwnProperty('internationalized')){
|
||||
internationalized(languages['current']);
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
const savedTheme = localStorage.getItem('nps-theme');
|
||||
const html = document.documentElement;
|
||||
const icon = document.querySelector('#theme-toggle i');
|
||||
|
||||
if (savedTheme === 'dark') {
|
||||
html.setAttribute('theme', 'dark-mode');
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
} else {
|
||||
html.removeAttribute('theme');
|
||||
icon.classList.remove('fa-sun');
|
||||
icon.classList.add('fa-moon');
|
||||
}
|
||||
$('body').cloudLang();
|
||||
$('body').on('click', 'li[lang]', function () {
|
||||
$('#languagemenu').attr('lang', $(this).attr('lang'));
|
||||
$('body').setLang('');
|
||||
});
|
||||
});
|
||||
|
||||
var languages = {};
|
||||
var charts = {};
|
||||
var chartdatas = {};
|
||||
var postsubmit;
|
||||
|
||||
function langreply(langstr) {
|
||||
var langobj = languages['content']['reply'][langstr.replace(/[\s,\.\?]*/g, "").toLowerCase()];
|
||||
if ($.type(langobj) == 'undefined') return langstr
|
||||
langobj = (langobj[languages['current']] || langobj[languages['default']] || langstr);
|
||||
return langobj
|
||||
}
|
||||
|
||||
function goback() {
|
||||
history.back();
|
||||
}
|
||||
|
||||
function submitform(action, url, postdata) {
|
||||
postsubmit = false;
|
||||
$.each(postdata, function (i, v) {
|
||||
if (v['value']) {
|
||||
v['value'] = v['value'].trim();
|
||||
}
|
||||
});
|
||||
switch (action) {
|
||||
case 'turn':
|
||||
case 'clear':
|
||||
case 'delete':
|
||||
var langobj = languages['content']['confirm'][action];
|
||||
action = (langobj[languages['current']] || langobj[languages['default']] || 'Are you sure you want to ' + action + ' it?');
|
||||
if (!confirm(action)) return;
|
||||
case 'start':
|
||||
case 'stop':
|
||||
postsubmit = true;
|
||||
case 'add':
|
||||
case 'edit':
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postdata,
|
||||
success: function (res) {
|
||||
if (res.status) {
|
||||
showMsg(langreply(res.msg), 'success', 1000, function() {
|
||||
if (postsubmit) {
|
||||
document.location.reload();
|
||||
} else {
|
||||
window.location.href = document.referrer;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
showMsg(langreply(res.msg), 'error', 5000);
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
case 'global':
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postdata,
|
||||
success: function (res) {
|
||||
if (res.status) {
|
||||
showMsg(langreply(res.msg), 'success', 1000, function() {
|
||||
document.location.reload();
|
||||
});
|
||||
} else {
|
||||
showMsg(langreply(res.msg), 'error', 5000);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function changeunit(limit) {
|
||||
var size = "";
|
||||
if (limit < 0.1 * 1024) {
|
||||
size = limit.toFixed(2) + "B";
|
||||
} else if (limit < 0.1 * 1024 * 1024) {
|
||||
size = (limit / 1024).toFixed(2) + "KB";
|
||||
} else if (limit < 0.1 * 1024 * 1024 * 1024) {
|
||||
size = (limit / (1024 * 1024)).toFixed(2) + "MB";
|
||||
} else {
|
||||
size = (limit / (1024 * 1024 * 1024)).toFixed(2) + "GB";
|
||||
}
|
||||
|
||||
var sizeStr = size + "";
|
||||
var index = sizeStr.indexOf(".");
|
||||
var dou = sizeStr.substr(index + 1, 2);
|
||||
if (dou == "00") {
|
||||
return sizeStr.substring(0, index) + sizeStr.substr(index + 3, 2);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
function oCopy(obj){
|
||||
var tempInput = document.createElement("input");
|
||||
document.body.appendChild(tempInput);
|
||||
tempInput.value = obj.innerText || obj.textContent;
|
||||
tempInput.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(tempInput);
|
||||
showMsg(langreply('Copied'));
|
||||
}
|
||||
|
||||
function copyText(text) {
|
||||
const textarea = document.createElement("textarea");
|
||||
textarea.value = text;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(textarea);
|
||||
showMsg(langreply('Copied'));
|
||||
}
|
||||
|
||||
function showMsg(text, type = 'success', dur = 1500, cb) {
|
||||
var old = document.getElementById('wangmarket_loading');
|
||||
if (old) old.parentNode.removeChild(old);
|
||||
var isLong = text && text.length > 5;
|
||||
var svg = type === 'error'
|
||||
? '<svg style="width:3rem;height:3rem;padding:1rem;box-sizing:content-box;" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M696.832 326.656c-12.8-12.8-33.28-12.8-46.08 0L512 465.92 373.248 327.168c-12.8-12.8-33.28-12.8-46.08 0s-12.8 33.28 0 46.08L466.432 512l-139.264 139.264c-12.8 12.8-12.8 33.28 0 46.08s33.28 12.8 46.08 0L512 558.08l138.752 139.264c12.288 12.8 32.768 12.8 45.568 0.512l0.512-0.512c12.8-12.8 12.8-33.28 0-45.568L557.568 512l139.264-139.264c12.8-12.8 12.8-33.28 0-46.08 0 0.512 0 0 0 0zM512 51.2c-254.464 0-460.8 206.336-460.8 460.8s206.336 460.8 460.8 460.8 460.8-206.336 460.8-460.8-206.336-460.8-460.8-460.8z m280.064 740.864c-74.24 74.24-175.104 116.224-280.064 115.712-104.96 0-205.824-41.472-280.064-115.712S115.712 616.96 115.712 512s41.472-205.824 116.224-280.064C306.176 157.696 407.04 115.712 512 116.224c104.96 0 205.824 41.472 280.064 116.224 74.24 74.24 116.224 175.104 115.712 280.064 0.512 104.448-41.472 205.312-115.712 279.552z" fill="#ffffff"></path></svg>'
|
||||
: '<svg style="width:3rem;height:3rem;padding:1rem;box-sizing:content-box;" viewBox="0 0 1024 1024"><path d="M384 887.456L25.6 529.056 145.056 409.6 384 648.544 878.944 153.6 998.4 273.056z" fill="#ffffff"/></svg>';
|
||||
var w = document.createElement('div');
|
||||
w.id = 'wangmarket_loading';
|
||||
w.style = 'position:fixed;top:0;z-index: 2147483647;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center';
|
||||
w.innerHTML =
|
||||
'<div id="loading">'
|
||||
+'<div style="background-color:#2e2d3c;border-radius:0.3rem;opacity:0.8;min-width:6rem;min-height:4.8rem;max-width:20rem;display:flex;flex-wrap:wrap;align-items:center;'+(!isLong? 'flex-direction:column;':'')+'">'
|
||||
+'<div style="display:flex;">'+svg+'</div>'
|
||||
+'<div style="font-size:1rem;box-sizing:border-box;color:white;flex:1;padding:1rem;'+(!isLong? 'padding-top:0;':'')+'">'
|
||||
+ text +
|
||||
'</div>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
document.body.appendChild(w);
|
||||
setTimeout(function(){
|
||||
w.parentNode.removeChild(w);
|
||||
if (typeof cb === 'function') cb();
|
||||
}, dur);
|
||||
}
|
||||
|
||||
function toggleTheme() {
|
||||
const html = document.documentElement;
|
||||
const icon = document.querySelector('#theme-toggle i');
|
||||
const isDark = html.getAttribute('theme') === 'dark-mode';
|
||||
|
||||
if (isDark) {
|
||||
html.removeAttribute('theme');
|
||||
icon.classList.remove('fa-sun');
|
||||
icon.classList.add('fa-moon');
|
||||
localStorage.setItem('nps-theme', 'light');
|
||||
} else {
|
||||
html.setAttribute('theme', 'dark-mode');
|
||||
icon.classList.remove('fa-moon');
|
||||
icon.classList.add('fa-sun');
|
||||
localStorage.setItem('nps-theme', 'dark');
|
||||
}
|
||||
}
|
||||
|
||||
function escapeHtml(str) {
|
||||
return String(str).replace(/[&<>"']/g, function (s) {
|
||||
return ({'&': '&', '<': '<', '>': '>', '"': '"', "'": '''})[s];
|
||||
});
|
||||
}
|
||||
|
||||
function getBridgeMode(data) {
|
||||
if (typeof data !== 'string') return '';
|
||||
const parts = data.split(',', 2);
|
||||
const first = parts[0] || '';
|
||||
const second = parts[1] || '';
|
||||
const escapedFirst = escapeHtml(first).toUpperCase();
|
||||
const escapedSecond = escapeHtml(second).toUpperCase();
|
||||
if (!second || first === second) {
|
||||
return escapedFirst;
|
||||
}
|
||||
return escapedSecond + ' → ' + escapedFirst;
|
||||
}
|
||||
5
apps/nps/v0.29.36/web/static/js/popper.min.js
vendored
Normal file
5
apps/nps/v0.29.36/web/static/js/popper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user