mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-01-30 23:48:44 +03:00
User Guide
This commit is contained in:
57
resources/web/data/text.js
Normal file
57
resources/web/data/text.js
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
var LangText={
|
||||||
|
"en": {
|
||||||
|
"t1": "Welcome to QIDISlicer",
|
||||||
|
"t2": "User Guide",
|
||||||
|
"t3": "First Print",
|
||||||
|
"t4": "Support Generate",
|
||||||
|
"t5": "Issue Report",
|
||||||
|
},
|
||||||
|
"zh_CN": {
|
||||||
|
"t1": "欢迎使用QIDISlicer",
|
||||||
|
"t2": "用户指南",
|
||||||
|
"t3": "首次打印",
|
||||||
|
"t4": "支撑生成",
|
||||||
|
"t5": "错误报告",
|
||||||
|
},
|
||||||
|
"ja_JP": {
|
||||||
|
"t1": "QIDISlicerへようこそ",
|
||||||
|
"t2": "ユーザーガイド",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var LANG_COOKIE_NAME="QIDIWebLang";
|
||||||
|
var LANG_COOKIE_EXPIRESECOND= 365*86400;
|
||||||
|
|
||||||
|
function TranslatePage()
|
||||||
|
{
|
||||||
|
let strLang=GetQueryString("lang");
|
||||||
|
if(strLang!=null)
|
||||||
|
{
|
||||||
|
//setCookie(LANG_COOKIE_NAME,strLang,LANG_COOKIE_EXPIRESECOND,'/');
|
||||||
|
localStorage.setItem(LANG_COOKIE_NAME,strLang);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//strLang=getCookie(LANG_COOKIE_NAME);
|
||||||
|
strLang=localStorage.getItem(LANG_COOKIE_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
//alert(strLang);
|
||||||
|
|
||||||
|
if( !LangText.hasOwnProperty(strLang) )
|
||||||
|
strLang="en";
|
||||||
|
|
||||||
|
let AllNode=$(".trans");
|
||||||
|
let nTotal=AllNode.length;
|
||||||
|
for(let n=0;n<nTotal;n++)
|
||||||
|
{
|
||||||
|
let OneNode=AllNode[n];
|
||||||
|
|
||||||
|
let tid=$(OneNode).attr("tid");
|
||||||
|
if( LangText[strLang].hasOwnProperty(tid) )
|
||||||
|
{
|
||||||
|
$(OneNode).html(LangText[strLang][tid]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
66
resources/web/guide/css/dark.css
Normal file
66
resources/web/guide/css/dark.css
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
body
|
||||||
|
{
|
||||||
|
background-color:#242428;
|
||||||
|
}
|
||||||
|
|
||||||
|
*
|
||||||
|
{
|
||||||
|
border-color: #3E3E45;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.TextS1
|
||||||
|
{
|
||||||
|
color:#efeff0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ZScrol::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||||
|
background-color: #939594;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ZScrol::-webkit-scrollbar-track {/*滚动条里面轨道*/
|
||||||
|
background: #161817;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*----Left Menu Button----*/
|
||||||
|
.BtnItem
|
||||||
|
{
|
||||||
|
color:#B3B3B5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.BtnItem:hover
|
||||||
|
{
|
||||||
|
color: #efeff0;
|
||||||
|
background-color: #243E30;
|
||||||
|
}
|
||||||
|
|
||||||
|
.BtnItem:hover .LeftIcon
|
||||||
|
{
|
||||||
|
filter: brightness(300%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.BtnItemSelected
|
||||||
|
{
|
||||||
|
color: #efeff0;
|
||||||
|
background-color: #243E30;
|
||||||
|
}
|
||||||
|
|
||||||
|
.BtnItemSelected .LeftIcon
|
||||||
|
{
|
||||||
|
filter: brightness(300%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*-----Right Top MenuBtn-----*/
|
||||||
|
#RecentClearAllBtn:hover
|
||||||
|
{
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----User Manual------*/
|
||||||
|
.UG_DESC
|
||||||
|
{
|
||||||
|
color:#818183;
|
||||||
|
}
|
||||||
399
resources/web/guide/css/home.css
Normal file
399
resources/web/guide/css/home.css
Normal file
@@ -0,0 +1,399 @@
|
|||||||
|
*
|
||||||
|
{
|
||||||
|
padding:0px;
|
||||||
|
border: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
font-family: "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-sans;
|
||||||
|
border-color: #4479FB;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
background-color:#F4F7FE;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ZScrol::-webkit-scrollbar {/*滚动条整体样式*/
|
||||||
|
width: 12px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||||
|
height: 1px;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ZScrol::-webkit-scrollbar:hover {
|
||||||
|
color: #4479FB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ZScrol::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||||
|
border-radius: 6px;
|
||||||
|
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||||
|
box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||||
|
background-color: #AAAAAA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ZScrol::-webkit-scrollbar-track {/*滚动条里面轨道*/
|
||||||
|
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||||
|
box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #EDEDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.RedFont
|
||||||
|
{
|
||||||
|
font-size:12px;
|
||||||
|
color: #F07E4A;
|
||||||
|
}
|
||||||
|
|
||||||
|
.LinkBtn
|
||||||
|
{
|
||||||
|
font-size:12px;
|
||||||
|
color: #1200FF;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.LinkBtn:hover
|
||||||
|
{
|
||||||
|
text-decoration:underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------*/
|
||||||
|
body
|
||||||
|
{
|
||||||
|
display:flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
#LeftBoard
|
||||||
|
{
|
||||||
|
/*border-right-width: 1px;
|
||||||
|
border-right-style: solid;*/
|
||||||
|
background:#9B9DA3;
|
||||||
|
width: 248px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#GuideArea
|
||||||
|
{
|
||||||
|
border-bottom-width:1px;
|
||||||
|
border-bottom-style:inset;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
position: relative;
|
||||||
|
width:248px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#Guide1
|
||||||
|
{
|
||||||
|
height:36px;
|
||||||
|
line-height: 36px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#GuideBtn
|
||||||
|
{
|
||||||
|
cursor: pointer;
|
||||||
|
color: #4479FB;
|
||||||
|
}
|
||||||
|
.TbItem {
|
||||||
|
font-size: 24px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #4479FB
|
||||||
|
}
|
||||||
|
|
||||||
|
.TbItem:hover {
|
||||||
|
font-size:25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.TbItemSelected {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#Icon1
|
||||||
|
{
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#QDIcon
|
||||||
|
{
|
||||||
|
height:36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------*/
|
||||||
|
#BtnArea
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.BtnItem
|
||||||
|
{
|
||||||
|
border-bottom-width:1px;
|
||||||
|
border-bottom-style:inset;
|
||||||
|
padding-left:30px;
|
||||||
|
height:50px;
|
||||||
|
line-height: 50px;
|
||||||
|
display: flex;
|
||||||
|
justify-content:flex-start;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.BtnItem:hover
|
||||||
|
{
|
||||||
|
color:#4479FB
|
||||||
|
}
|
||||||
|
|
||||||
|
.BtnItemSelected
|
||||||
|
{
|
||||||
|
background-color: #CED1D9;
|
||||||
|
color:#4479FB
|
||||||
|
}
|
||||||
|
|
||||||
|
.BtnIcon
|
||||||
|
{
|
||||||
|
margin-right:6px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.LeftIcon
|
||||||
|
{
|
||||||
|
width:20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------------------*/
|
||||||
|
#RightBoard
|
||||||
|
{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
min-width: 835px;
|
||||||
|
overflow-y:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ThumbBoard
|
||||||
|
{
|
||||||
|
overflow-y:auto;
|
||||||
|
padding: 0px 40px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: flex-start;
|
||||||
|
margin: 30px 40px;
|
||||||
|
position: relative;
|
||||||
|
top: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
right: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1100px) {
|
||||||
|
.GuideBlock {
|
||||||
|
width: calc(50% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and ( min-width:1101px) and ( max-width:1680px ) {
|
||||||
|
.GuideBlock {
|
||||||
|
width: calc(33% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and ( min-width:1681px) and (max-width:2120px ) {
|
||||||
|
.GuideBlock {
|
||||||
|
width: calc(25% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and ( min-width:2121px) and (max-width:2620px ) {
|
||||||
|
.GuideBlock {
|
||||||
|
width: calc(20% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width:2621px ) and (max-width:3120px ) {
|
||||||
|
.GuideBlock {
|
||||||
|
width: calc(16.6% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width:3121px ) {
|
||||||
|
.GuideBlock {
|
||||||
|
width: calc(14.2% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#HotspotWEB
|
||||||
|
{
|
||||||
|
width:100%;
|
||||||
|
height: 420px;
|
||||||
|
}
|
||||||
|
/*------Thumbnail------*/
|
||||||
|
#WikiGuideBigBoard
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#WikiGuideBoard
|
||||||
|
{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: flex-start;
|
||||||
|
overflow-y: auto;
|
||||||
|
margin: 30px 40px;
|
||||||
|
position: relative;
|
||||||
|
top: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
right: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media screen and (max-width: 1100px) {
|
||||||
|
.GuideBlock
|
||||||
|
{
|
||||||
|
width: calc(50% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and ( min-width:1101px) and ( max-width:1680px )
|
||||||
|
{
|
||||||
|
.GuideBlock
|
||||||
|
{
|
||||||
|
width: calc(33% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and ( min-width:1681px) and (max-width:2120px ) {
|
||||||
|
.GuideBlock
|
||||||
|
{
|
||||||
|
width: calc(25% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and ( min-width:2121px) and (max-width:2620px ) {
|
||||||
|
.GuideBlock
|
||||||
|
{
|
||||||
|
width: calc(20% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width:2621px ) and (max-width:3120px ) {
|
||||||
|
.GuideBlock
|
||||||
|
{
|
||||||
|
width: calc(16.6% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width:3121px ) {
|
||||||
|
.GuideBlock
|
||||||
|
{
|
||||||
|
width: calc(14.2% - 20px);
|
||||||
|
margin: 0px 10px 40px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*------Gif------*/
|
||||||
|
#GifBigBoard
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#GifBoard
|
||||||
|
{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
overflow-y: auto;
|
||||||
|
margin: 30px 40px;
|
||||||
|
position: relative;
|
||||||
|
top: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
right: 0px;
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen {
|
||||||
|
.GifBlock
|
||||||
|
{
|
||||||
|
margin: 0px 0px 0px 0px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.UG_PRINTER
|
||||||
|
{
|
||||||
|
text-align:center;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.UG_PRINTER img
|
||||||
|
{
|
||||||
|
width:15%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.UG_IMG
|
||||||
|
{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.UG_IMG img
|
||||||
|
{
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 5px 5px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.UG_TITLE
|
||||||
|
{
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 25px;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
color: #4479FB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.UG_DESC
|
||||||
|
{
|
||||||
|
width: 100%;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
BIN
resources/web/guide/img/X-MAX3.png
Normal file
BIN
resources/web/guide/img/X-MAX3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
BIN
resources/web/guide/img/X-Plus3.png
Normal file
BIN
resources/web/guide/img/X-Plus3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
resources/web/guide/img/X-Smart3.png
Normal file
BIN
resources/web/guide/img/X-Smart3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
1
resources/web/guide/img/i1.svg
Normal file
1
resources/web/guide/img/i1.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1687832492956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10887" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M972.146238 0.005962h-3.629346c-15.683959 0.907336-246.277047 15.683959-374.341111 93.714898-27.479334 16.850535-36.16384 49.12579-41.867098 104.602935a94.362995 94.362995 0 0 0-67.920617-31.627158 85.16001 85.16001 0 0 0-52.625517 18.924447c-47.051878 37.330416-207.391197 171.356977-277.256107 332.862872C68.698334 717.320267 82.826859 863.66068 83.474957 869.752797c0 1.555434 0.907336 2.981248 1.166575 4.536682-47.959214 61.439642-77.123602 104.732555-80.364089 109.398857a25.9239 25.9239 0 0 0 7.129073 35.515743A25.9239 25.9239 0 0 0 25.9239 1024a25.9239 25.9239 0 0 0 21.387217-11.406516c0-1.036956 27.479334-40.830142 72.716539-98.899677h1.685053A250.295251 250.295251 0 0 0 181.467298 920.304401c99.547775 0 305.902016-38.88585 570.325793-296.958271C987.570958 393.012282 1019.716594 99.294498 1023.086701 58.723595A47.829595 47.829595 0 0 0 1023.994038 51.853762a51.070082 51.070082 0 0 0-51.8478-51.8478zM716.406968 586.404573C461.575034 835.533249 267.405025 868.456602 181.467298 868.456602c-10.499179 0-18.794827 0-25.9239-1.166576 87.363542-107.195325 220.353147-251.202588 368.378615-349.972645a25.9239 25.9239 0 0 0-28.51629-42.644815c-145.173838 97.214624-272.200947 232.148522-361.89764 338.825369a795.215623 795.215623 0 0 1 67.531759-274.274859c64.809749-151.136335 221.001245-280.626214 262.220245-312.901469a33.182592 33.182592 0 0 1 20.998359-8.166029c45.237205 0 81.401045 108.750759 100.195872 108.75076h1.944293c16.202437-7.517931 9.591843-173.560508 34.349167-188.72599C741.034672 64.815712 972.146238 51.853762 972.146238 51.853762s-19.054066 303.180007-255.73927 534.550811z" fill="#4479FB" p-id="10888"></path></svg>
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
BIN
resources/web/guide/img/logo.png
Normal file
BIN
resources/web/guide/img/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
133
resources/web/guide/index.html
Normal file
133
resources/web/guide/index.html
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||||
|
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
|
||||||
|
<title>homepage</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/home.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/dark.css" />
|
||||||
|
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../data/text.js"></script>
|
||||||
|
<script type="text/javascript" src="js/json2.js"></script>
|
||||||
|
<script type="text/javascript" src="js/globalapi.js"></script>
|
||||||
|
<script type="text/javascript" src="js/home.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="ZScrol" onLoad="OnInit()">
|
||||||
|
<div id="LeftBoard">
|
||||||
|
<div id="GuideArea">
|
||||||
|
<!--<div menu="userguide" class="BtnItem" onClick="GotoMenu('userguide')">
|
||||||
|
<div class="BtnIcon "><img class="LeftIcon" src="img/logo2.png" /></div>
|
||||||
|
<div class="trans" tid="t2">UserGuide</div>
|
||||||
|
</div>-->
|
||||||
|
<div id="Guide1">
|
||||||
|
<div id="Icon1"><img id="QDIcon" src="img/logo.png" /></div>
|
||||||
|
<div menu="userguide" class="TbItem" onClick="GotoMain('userguide')">
|
||||||
|
<div class="trans" tid="t2">UserGuide</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="BtnArea">
|
||||||
|
<div menu="firstprint" class="BtnItem" onClick="GotoMenu('firstprint')">
|
||||||
|
<div class="BtnIcon "><img class="LeftIcon" src="img/i1.svg" /></div>
|
||||||
|
<div class="trans" tid="t3">UserGuide</div>
|
||||||
|
</div>
|
||||||
|
<div menu="supportgenerate" class="BtnItem" onClick="GotoMenu('supportgenerate')">
|
||||||
|
<div class="BtnIcon "><img class="LeftIcon" src="img/i1.svg" /></div>
|
||||||
|
<div class="trans" tid="t4">UserGuide</div>
|
||||||
|
</div>
|
||||||
|
<div menu="issuereport" class="BtnItem" onClick="GotoMenu('issuereport')">
|
||||||
|
<div class="BtnIcon "><img class="LeftIcon" src="img/i1.svg" /></div>
|
||||||
|
<div class="trans" tid="t5">UserGuide</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="RightBoard">
|
||||||
|
<div id="ThumbBoard" class="ZScrol" board="userguide">
|
||||||
|
<div class="GuideBlock" onClick="GotoMenu('firstprint')">
|
||||||
|
<div class="UG_IMG"><img src="img/FirstPrint.gif" /></div>
|
||||||
|
<div class="UG_TITLE trans TextS1" tid="t3">FP</div>
|
||||||
|
<div class="UG_DESC trans" tid="wk2">This gif introduces the most basic usage of QIDISlicer. It guides users to configure software, create projects, and complete the first printing task step by step. </div>
|
||||||
|
</div>
|
||||||
|
<div class="GuideBlock" onClick="GotoMenu('supportgenerate')">
|
||||||
|
<div class="UG_IMG"><img src="img/SupportGenerate.gif" /></div>
|
||||||
|
<div class="UG_TITLE trans TextS1" tid="t4">SG</div>
|
||||||
|
<div class="UG_DESC trans" tid="wk4">When your model of choice has overhangs, the printed product is terrible, and this gif will teach you how to use support generation.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="GifBigBoard" board="firstprint">
|
||||||
|
<div id="GifBoard" >
|
||||||
|
<div class="GifBlock">
|
||||||
|
<div class="UG_IMG"><img src="img/FirstPrint.gif" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="GifBigBoard" board="supportgenerate">
|
||||||
|
<div id="GifBoard" >
|
||||||
|
<div class="GifBlock">
|
||||||
|
<div class="UG_IMG"><img src="img/SupportGenerate.gif" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="GifBigBoard" board="issuereport">
|
||||||
|
<div id="GifBoard" >
|
||||||
|
<div class="GifBlock">
|
||||||
|
<div class="UG_PRINTER"><img src="img/X-MAX3.png" /><img /><img src="img/X-Plus3.png" /><img /><img src="img/X-Smart3.png" /></div>
|
||||||
|
<div class="UG_TITLE trans TextS1" tid="wk1">Issue Report</div>
|
||||||
|
<div class="UG_DESC trans" tid="wk2">You can copy the email address or skype to get in touch with us by clicking Help - Requirements Report. Please try to tell us your requirements in the form of video or pictures, and provide 3MF file, G-code file, machine number and other necessary information. </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//HandleStudio(TestData);
|
||||||
|
document.onkeydown = function (event) {
|
||||||
|
var e = event || window.event || arguments.callee.caller.arguments[0];
|
||||||
|
|
||||||
|
if (e.ctrlKey && e.metaKey)
|
||||||
|
OutputKey(e.keyCode, true, false, true);
|
||||||
|
else if (e.ctrlKey)
|
||||||
|
OutputKey(e.keyCode, true, false, false);
|
||||||
|
else if (e.metaKey)
|
||||||
|
OutputKey(e.keyCode, false, false, true);
|
||||||
|
|
||||||
|
if (e.shiftKey && e.ctrlKey)
|
||||||
|
OutputKey(e.keyCode, true, true, false);
|
||||||
|
|
||||||
|
if (e.shiftKey && e.metaKey)
|
||||||
|
OutputKey(e.keyCode, false, true, true);
|
||||||
|
|
||||||
|
if (window.event) {
|
||||||
|
try { e.keyCode = 0; } catch (e) { }
|
||||||
|
e.returnValue = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('mousewheel', function (event) {
|
||||||
|
if (event.ctrlKey === true || event.metaKey) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
}, { passive: false });
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
292
resources/web/guide/js/globalapi.js
Normal file
292
resources/web/guide/js/globalapi.js
Normal file
@@ -0,0 +1,292 @@
|
|||||||
|
|
||||||
|
/*------------------ 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--------Studio WX Message-------*/
|
||||||
|
function IsInSlicer()
|
||||||
|
{
|
||||||
|
let bMatch=navigator.userAgent.match( RegExp('QIDISlicer','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");
|
||||||
56
resources/web/guide/js/home.js
Normal file
56
resources/web/guide/js/home.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
function OnInit()
|
||||||
|
{
|
||||||
|
//-----Test-----
|
||||||
|
//Set_RecentFile_MouseRightBtn_Event();
|
||||||
|
|
||||||
|
|
||||||
|
//-----Official-----
|
||||||
|
TranslatePage();
|
||||||
|
|
||||||
|
SendMsg_GetLoginInfo();
|
||||||
|
SendMsg_GetRecentFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
function GotoMenu( strMenu )
|
||||||
|
{
|
||||||
|
let MenuList = $(".BtnItem");
|
||||||
|
let nAll=MenuList.length;
|
||||||
|
|
||||||
|
for(let n=0;n<nAll;n++)
|
||||||
|
{
|
||||||
|
let OneBtn=MenuList[n];
|
||||||
|
|
||||||
|
if( $(OneBtn).attr("menu")==strMenu )
|
||||||
|
{
|
||||||
|
$(".BtnItem").removeClass("BtnItemSelected");
|
||||||
|
|
||||||
|
$(OneBtn).addClass("BtnItemSelected");
|
||||||
|
|
||||||
|
$("div[board]").hide();
|
||||||
|
$("div[board=\'"+strMenu+"\']").show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function GotoMain(strMenu) {
|
||||||
|
let MenuList = $(".TbItem")
|
||||||
|
let nAll = MenuList.length;
|
||||||
|
|
||||||
|
for (let n = 0; n < nAll; n++) {
|
||||||
|
let OneBtn = MenuList[n];
|
||||||
|
|
||||||
|
if ($(OneBtn).attr("menu") == strMenu) {
|
||||||
|
$(".TbItem").removeClass("TbItemSelected");
|
||||||
|
|
||||||
|
$(OneBtn).addClass("TbItemSelected");
|
||||||
|
$(".BtnItem").removeClass("BtnItemSelected");
|
||||||
|
|
||||||
|
$("div[board]").hide();
|
||||||
|
$("div[board=\'" + strMenu + "\']").show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------Global-----------------
|
||||||
|
window.postMessage = HandleStudio;
|
||||||
|
|
||||||
2
resources/web/guide/js/jquery-3.6.0.min.js
vendored
Normal file
2
resources/web/guide/js/jquery-3.6.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
185
resources/web/guide/js/json2.js
Normal file
185
resources/web/guide/js/json2.js
Normal file
@@ -0,0 +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');
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}());
|
||||||
Reference in New Issue
Block a user