mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Merge remote-tracking branch 'remote/master' into feature/merge_upstream
# Conflicts: # bbl/i18n/OrcaSlicer.pot # bbl/i18n/de/OrcaSlicer_de.po # bbl/i18n/en/OrcaSlicer_en.po # bbl/i18n/es/OrcaSlicer_es.po # bbl/i18n/fr/OrcaSlicer_fr.po # bbl/i18n/hu/OrcaSlicer_hu.po # bbl/i18n/it/OrcaSlicer_it.po # bbl/i18n/ja/OrcaSlicer_ja.po # bbl/i18n/nl/OrcaSlicer_nl.po # bbl/i18n/sv/OrcaSlicer_sv.po # bbl/i18n/zh_cn/OrcaSlicer_zh_CN.po # resources/config.json # resources/i18n/de/BambuStudio.mo # resources/i18n/en/BambuStudio.mo # resources/i18n/es/BambuStudio.mo # resources/i18n/fr/BambuStudio.mo # resources/i18n/hu/BambuStudio.mo # resources/i18n/it/BambuStudio.mo # resources/i18n/ja/OrcaSlicer.mo # resources/i18n/nl/BambuStudio.mo # resources/i18n/sv/BambuStudio.mo # resources/i18n/zh_cn/BambuStudio.mo # resources/images/ams_humidity_2.svg # resources/images/ams_humidity_3.svg # resources/images/ams_humidity_4.svg # resources/images/ams_humidity_tips.svg # resources/images/monitor_state_on.svg # resources/images/sdcard_state_normal.svg # resources/profiles/BBL.json # resources/profiles/BBL/filament/Bambu PETG-CF @base.json # resources/profiles/BBL/filament/Generic PETG-CF @base.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.4 nozzle.json # resources/web/data/text.js # resources/web/guide/3/index.html # resources/web/guide/31/index.html # src/BambuStudio.cpp # src/libslic3r/AABBTreeLines.hpp # src/libslic3r/Brim.cpp # src/libslic3r/CMakeLists.txt # src/libslic3r/ExPolygon.hpp # src/libslic3r/Fill/FillBase.hpp # src/libslic3r/Format/bbs_3mf.cpp # src/libslic3r/GCodeWriter.cpp # src/libslic3r/Line.hpp # src/libslic3r/PerimeterGenerator.cpp # src/libslic3r/Preset.cpp # src/libslic3r/Print.cpp # src/libslic3r/Print.hpp # src/libslic3r/PrintConfig.cpp # src/libslic3r/PrintConfig.hpp # src/libslic3r/TreeSupport.cpp # src/slic3r/GUI/AmsMappingPopup.cpp # src/slic3r/GUI/BackgroundSlicingProcess.cpp # src/slic3r/GUI/ConfigManipulation.cpp # src/slic3r/GUI/GCodeViewer.cpp # src/slic3r/GUI/GCodeViewer.hpp # src/slic3r/GUI/GLCanvas3D.cpp # src/slic3r/GUI/GUI_App.cpp # src/slic3r/GUI/MainFrame.cpp # src/slic3r/GUI/PartPlate.cpp # src/slic3r/GUI/Plater.cpp # src/slic3r/GUI/Preferences.cpp # src/slic3r/GUI/SelectMachine.cpp # src/slic3r/GUI/Widgets/AMSControl.cpp # src/slic3r/GUI/wxMediaCtrl2.cpp # src/slic3r/Utils/Process.cpp # version.inc
This commit is contained in:
commit
9f598046d1
658 changed files with 70312 additions and 4877 deletions
|
@ -1,340 +1,340 @@
|
|||
|
||||
/*------------------ Date Function ------------------------*/
|
||||
function GetFullToday( )
|
||||
{
|
||||
var d=new Date();
|
||||
|
||||
var nday=d.getDate();
|
||||
var nmonth=d.getMonth()+1;
|
||||
var nyear=d.getFullYear();
|
||||
|
||||
var strM=nmonth+'';
|
||||
if( nmonth<10 )
|
||||
strM='0'+nmonth;
|
||||
|
||||
var strD=nday+'';
|
||||
if( nday<10 )
|
||||
strD='0'+nday;
|
||||
|
||||
return nyear+'-'+strM+'-'+strD;
|
||||
}
|
||||
|
||||
function GetFullDate()
|
||||
{
|
||||
var d=new Date();
|
||||
|
||||
var tDate={};
|
||||
|
||||
tDate.nyear=d.getFullYear();
|
||||
tDate.nmonth=d.getMonth()+1;
|
||||
tDate.nday=d.getDate();
|
||||
|
||||
tDate.nhour=d.getHours();
|
||||
tDate.nminute=d.getMinutes();
|
||||
tDate.nsecond=d.getSeconds();
|
||||
|
||||
tDate.nweek=d.getDay();
|
||||
tDate.ndate=d.getDate();
|
||||
|
||||
var strM=tDate.nmonth+'';
|
||||
if( tDate.nmonth<10 )
|
||||
strM='0'+tDate.nmonth;
|
||||
|
||||
var strD=tDate.nday+'';
|
||||
if( tDate.nday<10 )
|
||||
strD='0'+tDate.nday;
|
||||
|
||||
var strH=tDate.nhour+'';
|
||||
if( tDate.nhour<10 )
|
||||
strH='0'+tDate.nhour;
|
||||
|
||||
var strMin=tDate.nminute+'';
|
||||
if( tDate.nminute<10 )
|
||||
strMin='0'+tDate.nminute;
|
||||
|
||||
var strS=tDate.nsecond+'';
|
||||
if( tDate.nsecond<10 )
|
||||
strS='0'+tDate.nsecond;
|
||||
|
||||
tDate.strdate=tDate.nyear+'-'+strM+'-'+strD;
|
||||
tDate.strFulldate=tDate.strdate+' '+strH+':'+strMin+':'+strS;
|
||||
|
||||
return tDate;
|
||||
}
|
||||
|
||||
|
||||
function Unixtimestamp2Date( nSecond )
|
||||
{
|
||||
var d=new Date(nSecond*1000);
|
||||
|
||||
var tDate={};
|
||||
|
||||
tDate.nyear=d.getFullYear();
|
||||
tDate.nmonth=d.getMonth()+1;
|
||||
tDate.nday=d.getDate();
|
||||
|
||||
tDate.nhour=d.getHours();
|
||||
tDate.nminute=d.getMinutes();
|
||||
tDate.nsecond=d.getSeconds();
|
||||
|
||||
tDate.nweek=d.getDay();
|
||||
tDate.ndate=d.getDate();
|
||||
|
||||
var strM=tDate.nmonth+'';
|
||||
if( tDate.nmonth<10 )
|
||||
strM='0'+tDate.nmonth;
|
||||
|
||||
var strD=tDate.nday+'';
|
||||
if( tDate.nday<10 )
|
||||
strD='0'+tDate.nday;
|
||||
|
||||
tDate.strdate=tDate.nyear+'-'+strM+'-'+strD;
|
||||
|
||||
return tDate.strdate;
|
||||
}
|
||||
|
||||
|
||||
//------------Array Function-------------
|
||||
Array.prototype.in_array = function (e) {
|
||||
let sArray= ',' + this.join(this.S) + ',';
|
||||
let skey=','+e+',';
|
||||
|
||||
if(sArray.indexOf(skey)>=0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------String Function------------------
|
||||
/**
|
||||
* Delete Left/Right Side Blank
|
||||
*/
|
||||
String.prototype.trim=function()
|
||||
{
|
||||
return this.replace(/(^\s*)|(\s*$)/g, '');
|
||||
}
|
||||
/**
|
||||
* Delete Left Side Blank
|
||||
*/
|
||||
String.prototype.ltrim=function()
|
||||
{
|
||||
return this.replace(/(^\s*)/g,'');
|
||||
}
|
||||
/**
|
||||
* Delete Right Side Blank
|
||||
*/
|
||||
String.prototype.rtrim=function()
|
||||
{
|
||||
return this.replace(/(\s*$)/g,'');
|
||||
}
|
||||
|
||||
|
||||
//----------------Get Param-------------
|
||||
function GetQueryString(name)
|
||||
{
|
||||
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r!=null)
|
||||
{
|
||||
return unescape(r[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function GetGetStr()
|
||||
{
|
||||
let strGet="";
|
||||
|
||||
//获取当前URL
|
||||
let url = document.location.href;
|
||||
|
||||
//获取?的位置
|
||||
let index = url.indexOf("?")
|
||||
if(index != -1) {
|
||||
//截取出?后面的字符串
|
||||
strGet = url.substr(index + 1);
|
||||
}
|
||||
|
||||
return strGet;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------JSON Function------------*/
|
||||
|
||||
/*
|
||||
功能:检查一个字符串是不是标准的JSON格式
|
||||
参数: strJson 被检查的字符串
|
||||
返回值: 如果字符串是一个标准的JSON格式,则返回JSON对象
|
||||
如果字符串不是标准JSON格式,则返回null
|
||||
*/
|
||||
function IsJson( strJson )
|
||||
{
|
||||
var tJson=null;
|
||||
try
|
||||
{
|
||||
tJson=JSON.parse(strJson);
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return tJson;
|
||||
}
|
||||
|
||||
/*-----------------------Ajax Function--------------------*/
|
||||
/*对JQuery的Ajax函数的封装,只支持异步
|
||||
参数说明:
|
||||
url 目标地址
|
||||
action post/get
|
||||
data 字符串格式的发送内容
|
||||
asyn true---异步模式;false-----同步模式;
|
||||
*/
|
||||
function HttpReq( url,action, data,callbackfunc)
|
||||
{
|
||||
var strAction=action.toLowerCase();
|
||||
|
||||
if( strAction=="post")
|
||||
{
|
||||
$.post(url,data,callbackfunc);
|
||||
}
|
||||
else if( strAction=="get")
|
||||
{
|
||||
$.get(url,callbackfunc);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------Cookie Function-------------------*/
|
||||
function setCookie(name, value, time='',path='') {
|
||||
if(time && path){
|
||||
var strsec = time * 1000;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + strsec * 1);
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path="+path;
|
||||
}else if(time){
|
||||
var strsec = time * 1000;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + strsec * 1);
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
|
||||
}else if(path){
|
||||
document.cookie = name + "=" + escape(value) + ";path="+path;
|
||||
}else{
|
||||
document.cookie = name + "=" + escape(value);
|
||||
}
|
||||
}
|
||||
|
||||
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;//如果是最后一个,结尾就是cookie字符串的结尾
|
||||
return decodeURI(document.cookie.substring(c_start, c_end));//截取字符串返回
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function checkCookie(c_name) {
|
||||
username = getCookie(c_name);
|
||||
console.log(username);
|
||||
if (username != null && username != "")
|
||||
{ return true; }
|
||||
else
|
||||
{ return false; }
|
||||
}
|
||||
|
||||
function clearCookie(name) {
|
||||
setCookie(name, "", -1);
|
||||
}
|
||||
|
||||
|
||||
/*--------Studio WX Message-------*/
|
||||
function IsInSlicer()
|
||||
{
|
||||
let bMatch=navigator.userAgent.match( RegExp('BBL-Slicer','i') );
|
||||
|
||||
return bMatch;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SendWXMessage( strMsg )
|
||||
{
|
||||
let bCheck=IsInSlicer();
|
||||
|
||||
if(bCheck!=null)
|
||||
{
|
||||
window.wx.postMessage(strMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------CSS Link Control----*/
|
||||
function RemoveCssLink( LinkPath )
|
||||
{
|
||||
let pNow=$("head link[href='"+LinkPath+"']");
|
||||
|
||||
let nTotal=pNow.length;
|
||||
for( let n=0;n<nTotal;n++ )
|
||||
{
|
||||
pNow[n].remove();
|
||||
}
|
||||
}
|
||||
|
||||
function AddCssLink( LinkPath )
|
||||
{
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var link = document.createElement('link');
|
||||
link.href = LinkPath;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
head.appendChild(link);
|
||||
}
|
||||
|
||||
function CheckCssLinkExist( LinkPath )
|
||||
{
|
||||
let pNow=$("head link[href='"+LinkPath+"']");
|
||||
let nTotal=pNow.length;
|
||||
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
|
||||
/*------Dark Mode------*/
|
||||
|
||||
function SwitchDarkMode( DarkCssPath )
|
||||
{
|
||||
ExecuteDarkMode( DarkCssPath );
|
||||
setInterval("ExecuteDarkMode('"+DarkCssPath+"')",1000);
|
||||
}
|
||||
|
||||
function ExecuteDarkMode( DarkCssPath )
|
||||
{
|
||||
let nMode=0;
|
||||
let bDarkMode=navigator.userAgent.match( RegExp('dark','i') );
|
||||
if( bDarkMode!=null )
|
||||
nMode=1;
|
||||
|
||||
let nNow=CheckCssLinkExist(DarkCssPath);
|
||||
if( nMode==0 )
|
||||
{
|
||||
if(nNow>0)
|
||||
RemoveCssLink(DarkCssPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nNow==0)
|
||||
AddCssLink(DarkCssPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------ Date Function ------------------------*/
|
||||
function GetFullToday( )
|
||||
{
|
||||
var d=new Date();
|
||||
|
||||
var nday=d.getDate();
|
||||
var nmonth=d.getMonth()+1;
|
||||
var nyear=d.getFullYear();
|
||||
|
||||
var strM=nmonth+'';
|
||||
if( nmonth<10 )
|
||||
strM='0'+nmonth;
|
||||
|
||||
var strD=nday+'';
|
||||
if( nday<10 )
|
||||
strD='0'+nday;
|
||||
|
||||
return nyear+'-'+strM+'-'+strD;
|
||||
}
|
||||
|
||||
function GetFullDate()
|
||||
{
|
||||
var d=new Date();
|
||||
|
||||
var tDate={};
|
||||
|
||||
tDate.nyear=d.getFullYear();
|
||||
tDate.nmonth=d.getMonth()+1;
|
||||
tDate.nday=d.getDate();
|
||||
|
||||
tDate.nhour=d.getHours();
|
||||
tDate.nminute=d.getMinutes();
|
||||
tDate.nsecond=d.getSeconds();
|
||||
|
||||
tDate.nweek=d.getDay();
|
||||
tDate.ndate=d.getDate();
|
||||
|
||||
var strM=tDate.nmonth+'';
|
||||
if( tDate.nmonth<10 )
|
||||
strM='0'+tDate.nmonth;
|
||||
|
||||
var strD=tDate.nday+'';
|
||||
if( tDate.nday<10 )
|
||||
strD='0'+tDate.nday;
|
||||
|
||||
var strH=tDate.nhour+'';
|
||||
if( tDate.nhour<10 )
|
||||
strH='0'+tDate.nhour;
|
||||
|
||||
var strMin=tDate.nminute+'';
|
||||
if( tDate.nminute<10 )
|
||||
strMin='0'+tDate.nminute;
|
||||
|
||||
var strS=tDate.nsecond+'';
|
||||
if( tDate.nsecond<10 )
|
||||
strS='0'+tDate.nsecond;
|
||||
|
||||
tDate.strdate=tDate.nyear+'-'+strM+'-'+strD;
|
||||
tDate.strFulldate=tDate.strdate+' '+strH+':'+strMin+':'+strS;
|
||||
|
||||
return tDate;
|
||||
}
|
||||
|
||||
|
||||
function Unixtimestamp2Date( nSecond )
|
||||
{
|
||||
var d=new Date(nSecond*1000);
|
||||
|
||||
var tDate={};
|
||||
|
||||
tDate.nyear=d.getFullYear();
|
||||
tDate.nmonth=d.getMonth()+1;
|
||||
tDate.nday=d.getDate();
|
||||
|
||||
tDate.nhour=d.getHours();
|
||||
tDate.nminute=d.getMinutes();
|
||||
tDate.nsecond=d.getSeconds();
|
||||
|
||||
tDate.nweek=d.getDay();
|
||||
tDate.ndate=d.getDate();
|
||||
|
||||
var strM=tDate.nmonth+'';
|
||||
if( tDate.nmonth<10 )
|
||||
strM='0'+tDate.nmonth;
|
||||
|
||||
var strD=tDate.nday+'';
|
||||
if( tDate.nday<10 )
|
||||
strD='0'+tDate.nday;
|
||||
|
||||
tDate.strdate=tDate.nyear+'-'+strM+'-'+strD;
|
||||
|
||||
return tDate.strdate;
|
||||
}
|
||||
|
||||
|
||||
//------------Array Function-------------
|
||||
Array.prototype.in_array = function (e) {
|
||||
let sArray= ',' + this.join(this.S) + ',';
|
||||
let skey=','+e+',';
|
||||
|
||||
if(sArray.indexOf(skey)>=0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------String Function------------------
|
||||
/**
|
||||
* Delete Left/Right Side Blank
|
||||
*/
|
||||
String.prototype.trim=function()
|
||||
{
|
||||
return this.replace(/(^\s*)|(\s*$)/g, '');
|
||||
}
|
||||
/**
|
||||
* Delete Left Side Blank
|
||||
*/
|
||||
String.prototype.ltrim=function()
|
||||
{
|
||||
return this.replace(/(^\s*)/g,'');
|
||||
}
|
||||
/**
|
||||
* Delete Right Side Blank
|
||||
*/
|
||||
String.prototype.rtrim=function()
|
||||
{
|
||||
return this.replace(/(\s*$)/g,'');
|
||||
}
|
||||
|
||||
|
||||
//----------------Get Param-------------
|
||||
function GetQueryString(name)
|
||||
{
|
||||
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r!=null)
|
||||
{
|
||||
return unescape(r[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function GetGetStr()
|
||||
{
|
||||
let strGet="";
|
||||
|
||||
//获取当前URL
|
||||
let url = document.location.href;
|
||||
|
||||
//获取?的位置
|
||||
let index = url.indexOf("?")
|
||||
if(index != -1) {
|
||||
//截取出?后面的字符串
|
||||
strGet = url.substr(index + 1);
|
||||
}
|
||||
|
||||
return strGet;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------JSON Function------------*/
|
||||
|
||||
/*
|
||||
功能:检查一个字符串是不是标准的JSON格式
|
||||
参数: strJson 被检查的字符串
|
||||
返回值: 如果字符串是一个标准的JSON格式,则返回JSON对象
|
||||
如果字符串不是标准JSON格式,则返回null
|
||||
*/
|
||||
function IsJson( strJson )
|
||||
{
|
||||
var tJson=null;
|
||||
try
|
||||
{
|
||||
tJson=JSON.parse(strJson);
|
||||
}
|
||||
catch(exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return tJson;
|
||||
}
|
||||
|
||||
/*-----------------------Ajax Function--------------------*/
|
||||
/*对JQuery的Ajax函数的封装,只支持异步
|
||||
参数说明:
|
||||
url 目标地址
|
||||
action post/get
|
||||
data 字符串格式的发送内容
|
||||
asyn true---异步模式;false-----同步模式;
|
||||
*/
|
||||
function HttpReq( url,action, data,callbackfunc)
|
||||
{
|
||||
var strAction=action.toLowerCase();
|
||||
|
||||
if( strAction=="post")
|
||||
{
|
||||
$.post(url,data,callbackfunc);
|
||||
}
|
||||
else if( strAction=="get")
|
||||
{
|
||||
$.get(url,callbackfunc);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------Cookie Function-------------------*/
|
||||
function setCookie(name, value, time='',path='') {
|
||||
if(time && path){
|
||||
var strsec = time * 1000;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + strsec * 1);
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path="+path;
|
||||
}else if(time){
|
||||
var strsec = time * 1000;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + strsec * 1);
|
||||
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
|
||||
}else if(path){
|
||||
document.cookie = name + "=" + escape(value) + ";path="+path;
|
||||
}else{
|
||||
document.cookie = name + "=" + escape(value);
|
||||
}
|
||||
}
|
||||
|
||||
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;//如果是最后一个,结尾就是cookie字符串的结尾
|
||||
return decodeURI(document.cookie.substring(c_start, c_end));//截取字符串返回
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function checkCookie(c_name) {
|
||||
username = getCookie(c_name);
|
||||
console.log(username);
|
||||
if (username != null && username != "")
|
||||
{ return true; }
|
||||
else
|
||||
{ return false; }
|
||||
}
|
||||
|
||||
function clearCookie(name) {
|
||||
setCookie(name, "", -1);
|
||||
}
|
||||
|
||||
|
||||
/*--------Studio WX Message-------*/
|
||||
function IsInSlicer()
|
||||
{
|
||||
let bMatch=navigator.userAgent.match( RegExp('BBL-Slicer','i') );
|
||||
|
||||
return bMatch;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SendWXMessage( strMsg )
|
||||
{
|
||||
let bCheck=IsInSlicer();
|
||||
|
||||
if(bCheck!=null)
|
||||
{
|
||||
window.wx.postMessage(strMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------CSS Link Control----*/
|
||||
function RemoveCssLink( LinkPath )
|
||||
{
|
||||
let pNow=$("head link[href='"+LinkPath+"']");
|
||||
|
||||
let nTotal=pNow.length;
|
||||
for( let n=0;n<nTotal;n++ )
|
||||
{
|
||||
pNow[n].remove();
|
||||
}
|
||||
}
|
||||
|
||||
function AddCssLink( LinkPath )
|
||||
{
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var link = document.createElement('link');
|
||||
link.href = LinkPath;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
head.appendChild(link);
|
||||
}
|
||||
|
||||
function CheckCssLinkExist( LinkPath )
|
||||
{
|
||||
let pNow=$("head link[href='"+LinkPath+"']");
|
||||
let nTotal=pNow.length;
|
||||
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
|
||||
/*------Dark Mode------*/
|
||||
|
||||
function SwitchDarkMode( DarkCssPath )
|
||||
{
|
||||
ExecuteDarkMode( DarkCssPath );
|
||||
setInterval("ExecuteDarkMode('"+DarkCssPath+"')",1000);
|
||||
}
|
||||
|
||||
function ExecuteDarkMode( DarkCssPath )
|
||||
{
|
||||
let nMode=0;
|
||||
let bDarkMode=navigator.userAgent.match( RegExp('dark','i') );
|
||||
if( bDarkMode!=null )
|
||||
nMode=1;
|
||||
|
||||
let nNow=CheckCssLinkExist(DarkCssPath);
|
||||
if( nMode==0 )
|
||||
{
|
||||
if(nNow>0)
|
||||
RemoveCssLink(DarkCssPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nNow==0)
|
||||
AddCssLink(DarkCssPath);
|
||||
}
|
||||
}
|
||||
|
||||
SwitchDarkMode("css/dark.css");
|
|
@ -1,185 +1,185 @@
|
|||
var JSON;
|
||||
if (!JSON) {
|
||||
JSON = {};
|
||||
}
|
||||
(function () {
|
||||
'use strict';
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
if (typeof Date.prototype.toJSON !== 'function') {
|
||||
Date.prototype.toJSON = function (key) {
|
||||
|
||||
return isFinite(this.valueOf())
|
||||
? this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z'
|
||||
: null;
|
||||
};
|
||||
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function (key) {
|
||||
return this.valueOf();
|
||||
};
|
||||
}
|
||||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
function quote(string) {
|
||||
escapable.lastIndex = 0;
|
||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string'
|
||||
? c
|
||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' : '"' + string + '"';
|
||||
}
|
||||
function str(key, holder) {
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
case 'number':
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
return String(value);
|
||||
case 'object':
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
gap += indent;
|
||||
partial = [];
|
||||
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
v = partial.length === 0
|
||||
? '[]'
|
||||
: gap
|
||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
||||
: '[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
if (rep && typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
if (typeof rep[i] === 'string') {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
v = partial.length === 0
|
||||
? '{}'
|
||||
: gap
|
||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
||||
: '{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
if (typeof JSON.stringify !== 'function') {
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== 'function' &&
|
||||
(typeof replacer !== 'object' ||
|
||||
typeof replacer.length !== 'number')) {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
return str('', {'': value});
|
||||
};
|
||||
}
|
||||
if (typeof JSON.parse !== 'function') {
|
||||
JSON.parse = function (text, reviver) {
|
||||
var j;
|
||||
function walk(holder, key) {
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
text = String(text);
|
||||
cx.lastIndex = 0;
|
||||
if (cx.test(text)) {
|
||||
text = text.replace(cx, function (a) {
|
||||
return '\\u' +
|
||||
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
});
|
||||
}
|
||||
if (/^[\],:{}\s]*$/
|
||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
j = eval('(' + text + ')');
|
||||
return typeof reviver === 'function'
|
||||
? walk({'': j}, '')
|
||||
: j;
|
||||
}
|
||||
throw new SyntaxError('JSON.parse');
|
||||
};
|
||||
}
|
||||
}());
|
||||
var JSON;
|
||||
if (!JSON) {
|
||||
JSON = {};
|
||||
}
|
||||
(function () {
|
||||
'use strict';
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
if (typeof Date.prototype.toJSON !== 'function') {
|
||||
Date.prototype.toJSON = function (key) {
|
||||
|
||||
return isFinite(this.valueOf())
|
||||
? this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z'
|
||||
: null;
|
||||
};
|
||||
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function (key) {
|
||||
return this.valueOf();
|
||||
};
|
||||
}
|
||||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
function quote(string) {
|
||||
escapable.lastIndex = 0;
|
||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string'
|
||||
? c
|
||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' : '"' + string + '"';
|
||||
}
|
||||
function str(key, holder) {
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
case 'number':
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
return String(value);
|
||||
case 'object':
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
gap += indent;
|
||||
partial = [];
|
||||
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
v = partial.length === 0
|
||||
? '[]'
|
||||
: gap
|
||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
||||
: '[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
if (rep && typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
if (typeof rep[i] === 'string') {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
v = partial.length === 0
|
||||
? '{}'
|
||||
: gap
|
||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
||||
: '{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
if (typeof JSON.stringify !== 'function') {
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== 'function' &&
|
||||
(typeof replacer !== 'object' ||
|
||||
typeof replacer.length !== 'number')) {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
return str('', {'': value});
|
||||
};
|
||||
}
|
||||
if (typeof JSON.parse !== 'function') {
|
||||
JSON.parse = function (text, reviver) {
|
||||
var j;
|
||||
function walk(holder, key) {
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
text = String(text);
|
||||
cx.lastIndex = 0;
|
||||
if (cx.test(text)) {
|
||||
text = text.replace(cx, function (a) {
|
||||
return '\\u' +
|
||||
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
});
|
||||
}
|
||||
if (/^[\],:{}\s]*$/
|
||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
j = eval('(' + text + ')');
|
||||
return typeof reviver === 'function'
|
||||
? walk({'': j}, '')
|
||||
: j;
|
||||
}
|
||||
throw new SyntaxError('JSON.parse');
|
||||
};
|
||||
}
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue