mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 22:14:00 -06:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
parent
30bcadab3e
commit
1555904bef
3771 changed files with 1251328 additions and 0 deletions
40
resources/web/guide/1/1.css
Normal file
40
resources/web/guide/1/1.css
Normal file
|
@ -0,0 +1,40 @@
|
|||
html
|
||||
{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
text-align:center;
|
||||
padding-top: 10%;
|
||||
}
|
||||
|
||||
#SlicerIcon
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#Title
|
||||
{
|
||||
height:20mm;
|
||||
line-height: 20mm;
|
||||
font-size: 6mm;
|
||||
color: #00AE42;
|
||||
}
|
||||
|
||||
#STip
|
||||
{
|
||||
padding:0mm 20mm;
|
||||
height: 15%;
|
||||
}
|
||||
|
||||
#BtnArea
|
||||
{
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#StartBtn
|
||||
{
|
||||
display: inline-block;
|
||||
text-decoration:none;
|
||||
}
|
5
resources/web/guide/1/1.js
Normal file
5
resources/web/guide/1/1.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
function OnStart()
|
||||
{
|
||||
window.location.href="../2/index.html"+"?"+GetGetStr();
|
||||
}
|
24
resources/web/guide/1/index.html
Normal file
24
resources/web/guide/1/index.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<title>引导_P1</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="1.css" />
|
||||
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
</head>
|
||||
<body onLoad="TranslatePage()">
|
||||
<div id="SlicerIcon" style="text-align: center;">
|
||||
<img src="../../image/logo.png"/>
|
||||
</div>
|
||||
<div id="Title" class="trans" tid="t1">Welcome to Bambu Studio</div>
|
||||
<div id="STip" class="trans" tid="t2">Bambu Studio will be setup in several steps. Let's start!</div>
|
||||
<div id="BtnArea">
|
||||
<a id="StartBtn" class="NormalBtn swiper-button-next trans" tid="t24" href="../11/index.html">Get Started</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
68
resources/web/guide/11/11.css
Normal file
68
resources/web/guide/11/11.css
Normal file
|
@ -0,0 +1,68 @@
|
|||
|
||||
#Content
|
||||
{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content:flex-start;
|
||||
align-items:center;
|
||||
}
|
||||
|
||||
|
||||
#EarthIcon img
|
||||
{
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#EarthIcon
|
||||
{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#RegionList
|
||||
{
|
||||
border: 3px solid #C7C7C7;
|
||||
width: 400px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.RegionItem
|
||||
{
|
||||
line-height: 40px;
|
||||
height: 40px;
|
||||
padding-left: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.RegionItem:hover
|
||||
{
|
||||
background-color: #ECECEC;
|
||||
}
|
||||
|
||||
|
||||
.RegionSelected
|
||||
{
|
||||
background-color:#00AE42;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.RegionSelected:hover
|
||||
{
|
||||
background-color:#00AE42;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#ChangeTip
|
||||
{
|
||||
margin-top: 15px;
|
||||
line-height:20px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.TipIcon
|
||||
{
|
||||
width:24px;
|
||||
height: 24px;
|
||||
margin-right: 5px;
|
||||
}
|
68
resources/web/guide/11/11.js
Normal file
68
resources/web/guide/11/11.js
Normal file
|
@ -0,0 +1,68 @@
|
|||
var m_OldRegion='';
|
||||
var m_Region='';
|
||||
|
||||
function OnInit()
|
||||
{
|
||||
//let strInput=JSON.stringify(cData);
|
||||
//HandleStudio(strInput);
|
||||
|
||||
TranslatePage();
|
||||
|
||||
RequestProfile();
|
||||
}
|
||||
|
||||
|
||||
function RequestProfile()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="request_userguide_profile";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
function HandleStudio( pVal )
|
||||
{
|
||||
let strCmd=pVal['command'];
|
||||
//alert(strCmd);
|
||||
|
||||
if(strCmd=='response_userguide_profile')
|
||||
{
|
||||
HandleRegionlList(pVal['response']);
|
||||
}
|
||||
}
|
||||
|
||||
function HandleRegionlList( pItem )
|
||||
{
|
||||
m_OldRegion=pItem['region'];
|
||||
|
||||
let nNum=$(".RegionItem[region='"+m_OldRegion+"']").length;
|
||||
if( nNum==1 )
|
||||
ChooseRegion(m_OldRegion);
|
||||
}
|
||||
|
||||
|
||||
function ChooseRegion( strRegion )
|
||||
{
|
||||
m_Region=strRegion;
|
||||
|
||||
$('.RegionItem').removeClass('RegionSelected');
|
||||
$(".RegionItem[region='"+strRegion+"']").addClass('RegionSelected');
|
||||
}
|
||||
|
||||
function GotoPolicyPage()
|
||||
{
|
||||
let ItemSelected=$('.RegionSelected')[0];
|
||||
let RegionFinal=$(ItemSelected).attr("region");
|
||||
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="save_region";
|
||||
tSend['region']=RegionFinal;
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
window.location.href="../3/index.html";
|
||||
}
|
||||
|
||||
|
BIN
resources/web/guide/11/earth.png
Normal file
BIN
resources/web/guide/11/earth.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
38
resources/web/guide/11/index.html
Normal file
38
resources/web/guide/11/index.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<title>引导_P21</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="11.css" />
|
||||
<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../js/json2.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript" src="11.js"></script>
|
||||
</head>
|
||||
<body onLoad="OnInit()">
|
||||
<div id="Title">
|
||||
<div class="trans" tid="t47">Please select your login region</div>
|
||||
</div>
|
||||
<div id="Content">
|
||||
<div id="EarthIcon"><img src="earth.png"/></div>
|
||||
<div id="RegionList">
|
||||
<div class="trans RegionItem RegionSelected" tid="t48" region="Asia-Pacific" onclick="ChooseRegion('Asia-Pacific')">Asia-Pacific</div>
|
||||
<div class="trans RegionItem" tid="t49" region="China" onclick="ChooseRegion('China')">China</div>
|
||||
<div class="trans RegionItem" tid="t60" region="Europe" onclick="ChooseRegion('Europe')">Europe</div>
|
||||
<div class="trans RegionItem" tid="t61" region="North America" onclick="ChooseRegion('North America')">North America</div>
|
||||
<div class="trans RegionItem" tid="t62" region="Others" onclick="ChooseRegion('Others')">Others</div>
|
||||
</div>
|
||||
<!-- <div id="ChangeTip">
|
||||
<div><img class="TipIcon" src="tip.png" /></div>
|
||||
<div tid="t63">After changing the region, your account will be logged out. Please log in again later.</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="NormalBtn trans" id="AcceptBtn" tid="t9" onclick="GotoPolicyPage()">Next</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
resources/web/guide/11/tip.png
Normal file
BIN
resources/web/guide/11/tip.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
144
resources/web/guide/21/21.css
Normal file
144
resources/web/guide/21/21.css
Normal file
|
@ -0,0 +1,144 @@
|
|||
|
||||
#Content
|
||||
{
|
||||
overflow-y:auto;
|
||||
}
|
||||
|
||||
#Content::-webkit-scrollbar {/*滚动条整体样式*/
|
||||
width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
#Content::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
-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;
|
||||
}
|
||||
|
||||
#Content::-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;
|
||||
}
|
||||
|
||||
|
||||
.BlockBanner
|
||||
{
|
||||
padding: 0px;
|
||||
border-bottom:#00AE42 1px solid;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.BannerBtns
|
||||
{
|
||||
float: right;
|
||||
display: flex;
|
||||
width: 140px;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.BlockBanner a
|
||||
{
|
||||
display: inline-block;
|
||||
background-color:#00AE42;
|
||||
line-height: 40px;
|
||||
height: 40px;
|
||||
padding: 0px 24px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.PrinterArea
|
||||
{
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.PrinterBlock
|
||||
{
|
||||
width: 160px;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.PrinterBlock img
|
||||
{
|
||||
width:160px;
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.PName
|
||||
{
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.pNozzel
|
||||
{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content:flex-start;
|
||||
color: #5A5A5A;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.pNozzel input
|
||||
{
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
/*-----Notice-----*/
|
||||
#NoticeMask
|
||||
{
|
||||
background-color: #000;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
opacity: 0.05;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#NoticeBody
|
||||
{
|
||||
display: none;
|
||||
width: 400px;
|
||||
border: 1px solid #000;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 200px;
|
||||
margin-left: -200px;
|
||||
}
|
||||
|
||||
#NoticeBar
|
||||
{
|
||||
background-color:#00B35C;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#NoticeContent
|
||||
{
|
||||
padding: 4mm 10mm;
|
||||
}
|
||||
|
||||
|
||||
#NoticeBtns
|
||||
{
|
||||
margin-top: 4mm;
|
||||
display: flex;
|
||||
justify-content:space-around;
|
||||
}
|
225
resources/web/guide/21/21.js
Normal file
225
resources/web/guide/21/21.js
Normal file
|
@ -0,0 +1,225 @@
|
|||
function OnInit()
|
||||
{
|
||||
//let strInput=JSON.stringify(cData);
|
||||
//HandleStudio(strInput);
|
||||
|
||||
TranslatePage();
|
||||
|
||||
RequestProfile();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function RequestProfile()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="request_userguide_profile";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
function HandleStudio( pVal )
|
||||
{
|
||||
// alert(strInput);
|
||||
// alert(JSON.stringify(strInput));
|
||||
//
|
||||
// let pVal=IsJson(strInput);
|
||||
// if(pVal==null)
|
||||
// {
|
||||
// alert("Msg Format Error is not Json");
|
||||
// return;
|
||||
// }
|
||||
|
||||
let strCmd=pVal['command'];
|
||||
//alert(strCmd);
|
||||
|
||||
if(strCmd=='response_userguide_profile')
|
||||
{
|
||||
HandleModelList(pVal['response']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function HandleModelList( pVal )
|
||||
{
|
||||
if( !pVal.hasOwnProperty("model") )
|
||||
return;
|
||||
|
||||
let pModel=pVal['model'];
|
||||
|
||||
let nTotal=pModel.length;
|
||||
let ModelHtml={};
|
||||
for(let n=0;n<nTotal;n++)
|
||||
{
|
||||
let OneModel=pModel[n];
|
||||
|
||||
let strVendor=OneModel['vendor'];
|
||||
|
||||
//Add Vendor Html Node
|
||||
if($(".OneVendorBlock[vendor='"+strVendor+"']").length==0)
|
||||
{
|
||||
let HtmlNewVendor='<div class="OneVendorBlock" Vendor="'+strVendor+'">'+
|
||||
'<div class="BlockBanner">'+
|
||||
' <div class="BannerBtns">'+
|
||||
' <div class="SmallBtn_Green trans" tid="t11" onClick="SelectPrinterAll('+"\'"+strVendor+"\'"+')">all</div>'+
|
||||
' <div class="SmallBtn trans" tid="t12" onClick="SelectPrinterNone('+"\'"+strVendor+"\'"+')">none</div>'+
|
||||
' </div>'+
|
||||
' <a>Bambu Lab</a>'+
|
||||
'</div>'+
|
||||
'<div class="PrinterArea"> '+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
$('#Content').append(HtmlNewVendor);
|
||||
}
|
||||
|
||||
let ModelName=OneModel['model'];
|
||||
|
||||
//Collect Html Node Nozzel Html
|
||||
if( !ModelHtml.hasOwnProperty(strVendor))
|
||||
ModelHtml[strVendor]='';
|
||||
|
||||
let NozzleArray=OneModel['nozzle_diameter'].split(';');
|
||||
let HtmlNozzel='';
|
||||
for(let m=0;m<NozzleArray.length;m++)
|
||||
{
|
||||
let nNozzel=NozzleArray[m];
|
||||
HtmlNozzel+='<div class="pNozzel"><input type="checkbox" model="'+OneModel['model']+'" nozzel="'+nNozzel+'" vendor="'+strVendor+'" /><span>'+nNozzel+'</span><span class="trans" tid="t13">mm nozzle</span></div>';
|
||||
}
|
||||
|
||||
let CoverImage="../../image/printer/"+OneModel['model']+"_cover.png";
|
||||
ModelHtml[strVendor]+='<div class="PrinterBlock">'+
|
||||
' <div class="PImg"><img src="'+CoverImage+'" /></div>'+
|
||||
' <div class="PName">'+OneModel['model']+'</div>'+ HtmlNozzel +'</div>';
|
||||
}
|
||||
|
||||
//Update Nozzel Html Append
|
||||
for( let key in ModelHtml )
|
||||
{
|
||||
$(".OneVendorBlock[vendor='"+key+"'] .PrinterArea").append( ModelHtml[key] );
|
||||
}
|
||||
|
||||
|
||||
//Update Checkbox
|
||||
$('input').prop("checked", false);
|
||||
for(let m=0;m<nTotal;m++)
|
||||
{
|
||||
let OneModel=pModel[m];
|
||||
|
||||
let SelectList=OneModel['nozzle_selected'];
|
||||
if(SelectList!='')
|
||||
{
|
||||
SelectList=OneModel['nozzle_selected'].split(';');
|
||||
let nLen=SelectList.length;
|
||||
|
||||
for(let a=0;a<nLen;a++)
|
||||
{
|
||||
let nNozzel=SelectList[a];
|
||||
$("input[vendor='"+OneModel['vendor']+"'][model='"+OneModel['model']+"'][nozzel='"+nNozzel+"']").prop("checked", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$("input[vendor='"+OneModel['vendor']+"'][model='"+OneModel['model']+"']").prop("checked", false);
|
||||
}
|
||||
}
|
||||
|
||||
let AlreadySelect=$("input:checked");
|
||||
let nSelect=AlreadySelect.length;
|
||||
if(nSelect==0)
|
||||
{
|
||||
$("input[nozzel='0.4']").prop("checked", true);
|
||||
}
|
||||
|
||||
TranslatePage();
|
||||
}
|
||||
|
||||
|
||||
function SelectPrinterAll( sVendor )
|
||||
{
|
||||
$("input[vendor='"+sVendor+"']").prop("checked", true);
|
||||
}
|
||||
|
||||
|
||||
function SelectPrinterNone( sVendor )
|
||||
{
|
||||
$("input[vendor='"+sVendor+"']").prop("checked", false);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
function GotoFilamentPage()
|
||||
{
|
||||
let nChoose=OnExit();
|
||||
|
||||
if(nChoose>0)
|
||||
window.open('../22/index.html','_self');
|
||||
}
|
||||
|
||||
function OnExit()
|
||||
{
|
||||
let ModelAll={};
|
||||
|
||||
let ModelSelect=$("input:checked");
|
||||
let nTotal=ModelSelect.length;
|
||||
|
||||
if( nTotal==0 )
|
||||
{
|
||||
ShowNotice(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
for(let n=0;n<nTotal;n++)
|
||||
{
|
||||
let OneItem=ModelSelect[n];
|
||||
|
||||
let strModel=OneItem.getAttribute("model");
|
||||
let strVendor=OneItem.getAttribute("vendor");
|
||||
let strNozzel=OneItem.getAttribute("nozzel");
|
||||
|
||||
//alert(strModel+strVendor+strNozzel);
|
||||
|
||||
if(!ModelAll.hasOwnProperty(strModel))
|
||||
{
|
||||
//alert("ADD: "+strModel);
|
||||
|
||||
ModelAll[strModel]={};
|
||||
|
||||
ModelAll[strModel]["model"]=strModel;
|
||||
ModelAll[strModel]["nozzle_diameter"]='';
|
||||
ModelAll[strModel]["vendor"]=strVendor;
|
||||
}
|
||||
|
||||
ModelAll[strModel]["nozzle_diameter"]+=ModelAll[strModel]["nozzle_diameter"]==''?strNozzel:';'+strNozzel;
|
||||
}
|
||||
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="save_userguide_models";
|
||||
tSend['data']=ModelAll;
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
|
||||
function ShowNotice( nShow )
|
||||
{
|
||||
if(nShow==0)
|
||||
{
|
||||
$("#NoticeMask").hide();
|
||||
$("#NoticeBody").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#NoticeMask").show();
|
||||
$("#NoticeBody").show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
114
resources/web/guide/21/index.html
Normal file
114
resources/web/guide/21/index.html
Normal file
|
@ -0,0 +1,114 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<title>引导_P21</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="21.css" />
|
||||
<script type="text/javascript" src="test.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../js/json2.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript" src="21.js"></script>
|
||||
</head>
|
||||
<body onLoad="OnInit()">
|
||||
<div id="Title">
|
||||
<div class="trans" tid="t10">Printer Selection</div>
|
||||
</div>
|
||||
<div id="Content">
|
||||
|
||||
<!--<div class="OneVendorBlock" Vendor="BBL">
|
||||
<div class="BlockBanner">
|
||||
<div class="BannerBtns">
|
||||
<div class="SmallBtn_Green trans" onClick="SelectPrinterAll('BBL')">所有</div>
|
||||
<div class="SmallBtn trans" onClick="SelectPrinterNone('BBL')">无</div>
|
||||
</div>
|
||||
|
||||
<a>BBL-3DP</a>
|
||||
</div>
|
||||
|
||||
<div class="PrinterArea">
|
||||
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p2.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input id="ZZ" type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.4" vendor="BBL" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.1" vendor="BBL" />0.1mm nozzle</div>
|
||||
</div>
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p1.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.4" vendor="BBL" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.2" vendor="BBL" />0.22mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.1" vendor="BBL" />0.1mm nozzle</div>
|
||||
</div>
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p2.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input id="ZZ" type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.4" vendor="BBL" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.1" vendor="BBL" />0.11mm nozzle</div>
|
||||
</div>
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p1.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.4" vendor="BBL" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.2" vendor="BBL" />0.22mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.1" vendor="BBL" />0.1mm nozzle</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="OneVendorBlock" Vendor="BAMBU">
|
||||
<div class="BlockBanner">
|
||||
<div class="BannerBtns">
|
||||
<div class="Banner-Btn" onClick="SelectPrinterAll('BAMBU')">所有</div>
|
||||
<div class="Banner-Btn" onClick="SelectPrinterNone('BAMBU')">无</div>
|
||||
</div>
|
||||
|
||||
<a>BBL-3DP</a>
|
||||
</div>
|
||||
|
||||
<div class="PrinterArea">
|
||||
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p2.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.4" vendor="BAMBU" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.1" vendor="BAMBU" />0.1mm nozzle</div>
|
||||
</div>
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p1.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.4" vendor="BAMBU" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.2" vendor="BAMBU" />0.2mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.1" vendor="BAMBU" />0.1mm nozzle</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>-->
|
||||
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="GrayBtn trans" id="PreBtn" tid="t8" onclick="window.open('../3/index.html','_self')">Back</div>
|
||||
<div class="NormalBtn trans" id="AcceptBtn" tid="t9" onclick="GotoFilamentPage()">Next</div>
|
||||
</div>
|
||||
|
||||
<div id="NoticeMask"></div>
|
||||
<div id="NoticeBody">
|
||||
<div id="NoticeBar" class="trans" tid="t18">error</div>
|
||||
<div id="NoticeContent">
|
||||
<div id="NoticeText" class="trans" tid="t37">At least one printer must be selected.</div>
|
||||
<div id="NoticeBtns">
|
||||
<div class="SmallBtn trans" tid="t36" onClick="ShowNotice(0)">ok</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
472
resources/web/guide/21/test.js
Normal file
472
resources/web/guide/21/test.js
Normal file
|
@ -0,0 +1,472 @@
|
|||
var cData={
|
||||
"filament": {
|
||||
"BBL PA-CF @BBL": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "BBL PA-CF @BBL",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/BBL PA-CF @BBL.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "BBL"
|
||||
},
|
||||
"Generic ABS": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic ABS",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic ABS.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic PETG": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic PETG",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic PETG.json",
|
||||
"type": "PET",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic PLA": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic PLA",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic PLA.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU83": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU83",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU83.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU87": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU87",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU87.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU90": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU90",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU90.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU95": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU95",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU95.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"K5 ABS @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 ABS @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5 ABS @Kexcelled.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 ASA @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 ASA @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5 ASA @Kexcelled.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 PETG @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 PETG @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5 PETG @Kexcelled.json",
|
||||
"type": "PET",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 PLA~ @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5 PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 Silk PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 Silk PLA~ @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5 Silk PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 Sparkle PLA @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 Sparkle PLA @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5 Sparkle PLA @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5M PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5M PLA~ @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5M PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5P PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5P PLA~ @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5P PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5T ABS @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K5T ABS @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K5T ABS @Kexcelled.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K6 PETG @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K6 PETG @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K6 PETG @Kexcelled.json",
|
||||
"type": "PET",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K6 PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K6 PLA~ @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K6 PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K6CF PLA~ @Kexcelled ": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K6CF PLA~ @Kexcelled ",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K6CF PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K7 PC @Kexcelled ": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K7 PC @Kexcelled ",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K7 PC @Kexcelled.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K7CF PETG @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K7CF PETG @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K7CF PETG @Kexcelled.json",
|
||||
"type": "PET",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K7CFLM PAHT @Kexcelled": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "K7CFLM PAHT @Kexcelled",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/K7CFLM PAHT @Kexcelled.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"PLA Silk with Glue @ALL": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PLA Silk with Glue @ALL",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PLA Silk with Glue @ALL.json",
|
||||
"type": "PLA",
|
||||
"vendor": "ALL"
|
||||
},
|
||||
"PLA with Glue except Silk @ALL": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PLA with Glue except Silk @ALL",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PLA with Glue except Silk @ALL.json",
|
||||
"type": "PLA",
|
||||
"vendor": "ALL"
|
||||
},
|
||||
"PolyDissolve @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyDissolve @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyDissolve @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyFlex TPU95HF @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyFlex TPU95HF @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyFlex TPU95HF @Polymaker.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite ABS @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite ABS @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyLite ABS @Polymaker.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite ASA @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite ASA @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyLite ASA @Polymaker.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PC @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PC @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyLite PC @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PETG @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PETG @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyLite PETG @Polymaker.json",
|
||||
"type": "PET",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PLA Pro~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PLA Pro~ @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyLite PLA Pro~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PLA Silk~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PLA Silk~ @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyLite PLA Silk~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PLA~ @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyLite PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMax PC @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMax PC @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyMax PC @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMax PETG @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMax PETG @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyMax PETG @Polymaker.json",
|
||||
"type": "PET",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMax PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMax PLA~ @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyMax PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide CoPA @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide CoPA @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyMide CoPA @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide PA12-CF @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide PA12-CF @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyMide PA12-CF @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide PA6-CF @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide PA6-CF @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyMide PA6-CF @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide PA6-GF @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide PA6-GF @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyMide PA6-GF @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolySupport @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolySupport @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolySupport @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyTerra PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyTerra PLA~ @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyTerra PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyWood PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyWood PLA~ @Polymaker",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/PolyWood PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"eSUN ABS @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN ABS @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN ABS @eSUN.json",
|
||||
"type": "ABS",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN ABS+ @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN ABS+ @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN ABS+ @eSUN.json",
|
||||
"type": "ABS",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PETG @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PETG @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN PETG @eSUN.json",
|
||||
"type": "PET",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN PLA @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA Matte~ @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA Matte~ @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN PLA Matte~ @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA ST @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA ST @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN PLA ST @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA Silk~ @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA Silk~ @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN PLA Silk~ @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA+~ @eSUN": {
|
||||
"models": "[BBL-3DP-V4NORMAL][BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA+~ @eSUN",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/eSUN PLA+~ @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
}
|
||||
},
|
||||
"machine": [{
|
||||
"model": "BBL-3DP-V4NORMAL",
|
||||
"name": "Bambulab BBL-3DP-001-V4-normal",
|
||||
"sub_path": "machine/Bambulab BBL-3DP-001-V4-normal.json"
|
||||
},
|
||||
{
|
||||
"model": "BBL-3DP-V5NORMAL",
|
||||
"name": "Bambulab BBL-3DP-001-V5-normal",
|
||||
"sub_path": "machine/Bambulab BBL-3DP-001-V5-normal.json"
|
||||
}
|
||||
],
|
||||
"model": [{
|
||||
"cover": "D:\\Document\\Bambu\\DevCode\\Slicer\\bamboo_slicer\\build\\src\\Debug\\resources\\profiles\\BBL\\BBL-3DP-V4NORMAL_cover.png",
|
||||
"materials": "Generic PLA;PolyDissolve @Polymaker;PolyFlex TPU95HF @Polymaker;K5 Sparkle PLA @Kexcelled;Rock PLA @Polymaker;Generic TPU95;Generic TPU90;Generic TPU87;Generic TPU83;PolyMide CoPA @Polymaker;PolyMide PA6-GF @Polymaker;PolyMide PA12-CF @Polymaker;PolyMide PA6-CF @Polymaker;PolyLite ASA @Polymaker;K5 ASA @Kexcelled;K5T ABS @Kexcelled;PLA with Glue except Silk @ALL;PLA Silk with Glue @ALL;PolyTerra PLA~ @Polymaker; PolyLite PLA~ @Polymaker; PolyLite PLA Pro~ @Polymaker; PolyLite PLA Silk~ @Polymaker; PolyMax PLA~ @Polymaker; PolyWood PLA~ @Polymaker;K5 Silk PLA~ @Kexcelled;K5 PLA~ @Kexcelled;K6 PLA~ @Kexcelled;K6CF PLA~ @Kexcelled;K5M PLA~ @Kexcelled;K5P PLA~ @Kexcelled;eSUN PLA @eSUN; eSUN PLA+~ @eSUN; eSUN PLA Matte~ @eSUN; eSUN PLA Silk~ @eSUN; eSUN PLA ST @eSUN; PolyLite ABS @Polymaker; K5 ABS @Kexcelled; eSUN ABS @eSUN; eSUN ABS+ @eSUN; K5 PETG @Kexcelled; K6 PETG @Kexcelled; PolyMax PETG @Polymaker; PolyLite PETG @Polymaker; eSUN PETG @eSUN; PolySupport @Polymaker;K7CF PETG @Kexcelled;K7CFLM PAHT @Kexcelled; K7LM PAHT @Kexcelled; BBL PA-CF @BBL;K7 PC @Kexcelled; PolyLite PC @Polymaker; PolyMax PC @Polymaker;",
|
||||
"model": "BBL-3DP-V4NORMAL",
|
||||
"nozzle_diameter": "0.4;0.2",
|
||||
"nozzle_selected": "0.4",
|
||||
"sub_path": "machine/BBL-3DP-V4NORMAL.json",
|
||||
"vendor": "BBL"
|
||||
},
|
||||
{
|
||||
"cover": "D:\\Document\\Bambu\\DevCode\\Slicer\\bamboo_slicer\\build\\src\\Debug\\resources\\profiles\\BBL\\BBL-3DP-V5NORMAL_cover.png",
|
||||
"materials": "Generic PLA;PolyDissolve @Polymaker;PolyFlex TPU95HF @Polymaker;K5 Sparkle PLA @Kexcelled;Rock PLA @Polymaker;Generic TPU95;Generic TPU90;Generic TPU87;Generic TPU83;PolyMide CoPA @Polymaker;PolyMide PA6-GF @Polymaker;PolyMide PA12-CF @Polymaker;PolyMide PA6-CF @Polymaker;PolyLite ASA @Polymaker;K5 ASA @Kexcelled;K5T ABS @Kexcelled;PLA with Glue except Silk @ALL;PLA Silk with Glue @ALL;PolyTerra PLA~ @Polymaker; PolyLite PLA~ @Polymaker; PolyLite PLA Pro~ @Polymaker; PolyLite PLA Silk~ @Polymaker; PolyMax PLA~ @Polymaker; PolyWood PLA~ @Polymaker;K5 Silk PLA~ @Kexcelled;K5 PLA~ @Kexcelled;K6 PLA~ @Kexcelled;K6CF PLA~ @Kexcelled;K5M PLA~ @Kexcelled;K5P PLA~ @Kexcelled;eSUN PLA @eSUN; eSUN PLA+~ @eSUN; eSUN PLA Matte~ @eSUN; eSUN PLA Silk~ @eSUN; eSUN PLA ST @eSUN; PolyLite ABS @Polymaker; K5 ABS @Kexcelled; eSUN ABS @eSUN; eSUN ABS+ @eSUN; K5 PETG @Kexcelled; K6 PETG @Kexcelled; PolyMax PETG @Polymaker; PolyLite PETG @Polymaker; eSUN PETG @eSUN; PolySupport @Polymaker;K7CF PETG @Kexcelled;K7CFLM PAHT @Kexcelled; K7LM PAHT @Kexcelled; BBL PA-CF @BBL;K7 PC @Kexcelled; PolyLite PC @Polymaker; PolyMax PC @Polymaker;",
|
||||
"model": "BBL-3DP-V5NORMAL",
|
||||
"nozzle_diameter": "0.4;0.2;0.1",
|
||||
"nozzle_selected": "0.4",
|
||||
"sub_path": "machine/BBL-3DP-V5NORMAL.json",
|
||||
"vendor": "BBL"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
var MData={
|
||||
"BBL-3DP-V4NORMAL": {
|
||||
"model": "BBL-3DP-V4NORMAL",
|
||||
"nozzle_diameter": "0.4",
|
||||
"vendor": "BBL"
|
||||
},
|
||||
"BBL-3DP-V5NORMAL": {
|
||||
"model": "BBL-3DP-V5NORMAL",
|
||||
"nozzle_diameter": "0.4;0.2",
|
||||
"vendor": "BBL"
|
||||
}
|
||||
};
|
111
resources/web/guide/22/22.css
Normal file
111
resources/web/guide/22/22.css
Normal file
|
@ -0,0 +1,111 @@
|
|||
|
||||
.ChooseBlock
|
||||
{
|
||||
display:flex;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.CName
|
||||
{
|
||||
width:130px;
|
||||
min-width: 80px;
|
||||
font-weight: 700;
|
||||
height: 100%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.CValues
|
||||
{
|
||||
display:flex;
|
||||
justify-content: flex-start;
|
||||
align-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
input
|
||||
{
|
||||
margin-left: 20px;
|
||||
margin-right: 6px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#ItemSelectArea
|
||||
{
|
||||
height:40px;
|
||||
border-top: 1px solid #00AE42;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#ItemSelectArea .SmallBtn
|
||||
{
|
||||
margin-left:5px;
|
||||
}
|
||||
|
||||
|
||||
#ItemBlockArea
|
||||
{
|
||||
flex: 1;
|
||||
display:flex;
|
||||
overflow-x:auto;
|
||||
flex-wrap:wrap;
|
||||
flex-direction: column;
|
||||
justify-content:flex-start;
|
||||
align-items: flex-start;
|
||||
align-content:flex-start;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.MItem
|
||||
{
|
||||
width: 220px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
|
||||
#NoticeMask
|
||||
{
|
||||
background-color: #000;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
opacity: 0.05;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#NoticeBody
|
||||
{
|
||||
display: none;
|
||||
width: 500px;
|
||||
border: 1px solid #000;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 200px;
|
||||
margin-left: -250px;
|
||||
}
|
||||
|
||||
#NoticeBar
|
||||
{
|
||||
background-color:#00B35C;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#NoticeContent
|
||||
{
|
||||
padding: 4mm 10mm;
|
||||
}
|
||||
|
||||
|
||||
#NoticeBtns
|
||||
{
|
||||
margin-top: 4mm;
|
||||
display: flex;
|
||||
justify-content:space-around;
|
||||
}
|
534
resources/web/guide/22/22.js
Normal file
534
resources/web/guide/22/22.js
Normal file
|
@ -0,0 +1,534 @@
|
|||
|
||||
var m_ProfileItem;
|
||||
|
||||
var FilamentPriority=new Array( "pla","abs","pet","tpu","pc");
|
||||
var VendorPriority=new Array("bambu lab","bambulab","bbl","kexcelled","polymaker","esun","generic");
|
||||
|
||||
function OnInit()
|
||||
{
|
||||
TranslatePage();
|
||||
|
||||
RequestProfile();
|
||||
|
||||
//m_ProfileItem=cData;
|
||||
//SortUI();
|
||||
}
|
||||
|
||||
function RequestProfile()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="request_userguide_profile";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
//function RequestModelSelect()
|
||||
//{
|
||||
// var tSend={};
|
||||
// tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
// tSend['command']="request_userguide_modelselected";
|
||||
//
|
||||
// SendWXMessage( JSON.stringify(tSend) );
|
||||
//}
|
||||
|
||||
function HandleStudio(pVal)
|
||||
{
|
||||
let strCmd=pVal['command'];
|
||||
//alert(strCmd);
|
||||
|
||||
if(strCmd=='response_userguide_profile')
|
||||
{
|
||||
m_ProfileItem=pVal['response'];
|
||||
SortUI();
|
||||
}
|
||||
}
|
||||
|
||||
function GetFilamentShortname( sName )
|
||||
{
|
||||
let sShort=sName.split('@')[0].trim();
|
||||
|
||||
return sShort;
|
||||
}
|
||||
|
||||
|
||||
function SortUI()
|
||||
{
|
||||
var ModelList=new Array();
|
||||
|
||||
let nMode=m_ProfileItem["model"].length;
|
||||
for(let n=0;n<nMode;n++)
|
||||
{
|
||||
let OneMode=m_ProfileItem["model"][n];
|
||||
|
||||
if( OneMode["nozzle_selected"]!="" )
|
||||
ModelList.push(OneMode["model"]);
|
||||
}
|
||||
|
||||
//machine
|
||||
// let HtmlMachine='';
|
||||
//
|
||||
// let nMachine=m_ProfileItem['machine'].length;
|
||||
// for(let n=0;n<nMachine;n++)
|
||||
// {
|
||||
// let OneMachine=m_ProfileItem['machine'][n];
|
||||
//
|
||||
// let sName=OneMachine['name'];
|
||||
// let sModel=OneMachine['model'];
|
||||
//
|
||||
// if( ModelList.in_array(sModel) )
|
||||
// {
|
||||
// HtmlMachine+='<div><input type="checkbox" mode="'+sModel+'" onChange="MachineClick()" />'+sName+'</div>';
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $('#MachineList .CValues').append(HtmlMachine);
|
||||
// $('#MachineList .CValues input').prop("checked",true);
|
||||
// if(nMachine<=1)
|
||||
// {
|
||||
// $('#MachineList').hide();
|
||||
// }
|
||||
|
||||
//machine
|
||||
let HtmlMode='';
|
||||
nMode=ModelList.length;
|
||||
for(let n=0;n<nMode;n++)
|
||||
{
|
||||
let sModel=ModelList[n];
|
||||
|
||||
HtmlMode+='<div><input type="checkbox" mode="'+sModel+'" onChange="MachineClick()" />'+sModel+'</div>';
|
||||
}
|
||||
|
||||
$('#MachineList .CValues').append(HtmlMode);
|
||||
$('#MachineList .CValues input').prop("checked",true);
|
||||
if(nMode<=1)
|
||||
{
|
||||
$('#MachineList').hide();
|
||||
}
|
||||
|
||||
//Filament
|
||||
let HtmlFilament='';
|
||||
let SelectNumber=0;
|
||||
|
||||
var TypeHtmlArray={};
|
||||
var VendorHtmlArray={};
|
||||
for( let key in m_ProfileItem['filament'] )
|
||||
{
|
||||
let OneFila=m_ProfileItem['filament'][key];
|
||||
|
||||
let fShortName=GetFilamentShortname( OneFila['name'] );
|
||||
let fVendor=OneFila['vendor'];
|
||||
let fType=OneFila['type'];
|
||||
let fSelect=OneFila['selected'];
|
||||
let fModel=OneFila['models']
|
||||
|
||||
// if(OneFila['name'].indexOf("K5 PLA Wood")>0)
|
||||
// {
|
||||
// let b=1+2;
|
||||
// }
|
||||
|
||||
let bFind=false;
|
||||
let bCheck=$("#MachineList input:first").prop("checked");
|
||||
if(bCheck)
|
||||
{
|
||||
bFind=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//check in modellist
|
||||
let nModelAll=ModelList.length;
|
||||
for(let m=0;m<nModelAll;m++)
|
||||
{
|
||||
let sOne=ModelList[m];
|
||||
|
||||
if(fModel.indexOf(sOne)>=0)
|
||||
{
|
||||
bFind=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(bFind)
|
||||
{
|
||||
//Type
|
||||
let LowType=fType.toLowerCase();
|
||||
if(!TypeHtmlArray.hasOwnProperty(LowType))
|
||||
{
|
||||
let HtmlType='<div><input type="checkbox" filatype="'+fType+'" onChange="FilaClick()" />'+fType+'</div>';
|
||||
|
||||
TypeHtmlArray[LowType]=HtmlType;
|
||||
}
|
||||
|
||||
//Vendor
|
||||
let lowVendor=fVendor.toLowerCase();
|
||||
if(!VendorHtmlArray.hasOwnProperty(lowVendor))
|
||||
{
|
||||
let HtmlVendor='<div><input type="checkbox" vendor="'+fVendor+'" onChange="VendorClick()" />'+fVendor+'</div>';
|
||||
|
||||
VendorHtmlArray[lowVendor]=HtmlVendor;
|
||||
}
|
||||
|
||||
//Filament
|
||||
let pFila=$("#ItemBlockArea input[vendor='"+fVendor+"'][filatype='"+fType+"'][name='"+fShortName+"']");
|
||||
if(pFila.length==0)
|
||||
{
|
||||
let HtmlFila='<div class="MItem"><input type="checkbox" vendor="'+fVendor+'" filatype="'+fType+'" model="'+fModel+'" name="'+fShortName+'" />'+fShortName+'</div>';
|
||||
|
||||
$("#ItemBlockArea").append(HtmlFila);
|
||||
|
||||
if(fSelect==1)
|
||||
{
|
||||
$("#ItemBlockArea input[vendor='"+fVendor+"'][filatype='"+fType+"'][name='"+fShortName+"']").prop("checked",true);
|
||||
|
||||
SelectNumber++;
|
||||
}
|
||||
// else
|
||||
// $("#ItemBlockArea input[vendor='"+fVendor+"'][model='"+fModel+"'][filatype='"+fType+"'][name='"+key+"']").prop("checked",false);
|
||||
}
|
||||
else
|
||||
{
|
||||
let strModel=pFila.attr("model");
|
||||
|
||||
pFila.attr("model", strModel+fModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Sort TypeArray
|
||||
let TypeAdvNum=FilamentPriority.length;
|
||||
for( let n=0;n<TypeAdvNum;n++ )
|
||||
{
|
||||
let strType=FilamentPriority[n];
|
||||
|
||||
if( TypeHtmlArray.hasOwnProperty( strType ) )
|
||||
{
|
||||
$("#FilatypeList .CValues").append( TypeHtmlArray[strType] );
|
||||
delete( TypeHtmlArray[strType] );
|
||||
}
|
||||
}
|
||||
for(let key in TypeHtmlArray )
|
||||
{
|
||||
$("#FilatypeList .CValues").append( TypeHtmlArray[key] );
|
||||
}
|
||||
$("#FilatypeList .CValues input").prop("checked",true);
|
||||
|
||||
//Sort VendorArray
|
||||
let VendorAdvNum=VendorPriority.length;
|
||||
for( let n=0;n<VendorAdvNum;n++ )
|
||||
{
|
||||
let strVendor=VendorPriority[n];
|
||||
|
||||
if( VendorHtmlArray.hasOwnProperty( strVendor ) )
|
||||
{
|
||||
$("#VendorList .CValues").append( VendorHtmlArray[strVendor] );
|
||||
delete( VendorHtmlArray[strVendor] );
|
||||
}
|
||||
}
|
||||
for(let key in VendorHtmlArray )
|
||||
{
|
||||
$("#VendorList .CValues").append( VendorHtmlArray[key] );
|
||||
}
|
||||
$("#VendorList .CValues input").prop("checked",true);
|
||||
|
||||
//------
|
||||
if(SelectNumber==0)
|
||||
ChooseDefaultFilament();
|
||||
}
|
||||
|
||||
|
||||
function ChooseAllMachine()
|
||||
{
|
||||
let bCheck=$("#MachineList input:first").prop("checked");
|
||||
|
||||
$("#MachineList input").prop("checked",bCheck);
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function MachineClick()
|
||||
{
|
||||
let nChecked=$("#MachineList input:gt(0):checked").length
|
||||
let nAll =$("#MachineList input:gt(0)").length
|
||||
|
||||
if(nAll==nChecked)
|
||||
{
|
||||
$("#MachineList input:first").prop("checked",true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#MachineList input:first").prop("checked",false);
|
||||
}
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function ChooseAllFilament()
|
||||
{
|
||||
let bCheck=$("#FilatypeList input:first").prop("checked");
|
||||
$("#FilatypeList input").prop("checked",bCheck);
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function FilaClick()
|
||||
{
|
||||
let nChecked=$("#FilatypeList input:gt(0):checked").length
|
||||
let nAll =$("#FilatypeList input:gt(0)").length
|
||||
|
||||
if(nAll==nChecked)
|
||||
{
|
||||
$("#FilatypeList input:first").prop("checked",true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#FilatypeList input:first").prop("checked",false);
|
||||
}
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function ChooseAllVendor()
|
||||
{
|
||||
let bCheck=$("#VendorList input:first").prop("checked");
|
||||
$("#VendorList input").prop("checked",bCheck);
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function VendorClick()
|
||||
{
|
||||
let nChecked=$("#VendorList input:gt(0):checked").length
|
||||
let nAll =$("#VendorList input:gt(0)").length
|
||||
|
||||
if(nAll==nChecked)
|
||||
{
|
||||
$("#VendorList input:first").prop("checked",true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#VendorList input:first").prop("checked",false);
|
||||
}
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SortFilament()
|
||||
{
|
||||
let FilaNodes=$("#ItemBlockArea .MItem");
|
||||
let nFilament=FilaNodes.length;
|
||||
//$("#ItemBlockArea .MItem").hide();
|
||||
|
||||
//ModelList
|
||||
let pModel=$("#MachineList input:checked");
|
||||
let nModel=pModel.length;
|
||||
let ModelList=new Array();
|
||||
for(let n=0;n<nModel;n++)
|
||||
{
|
||||
let OneModel=pModel[n];
|
||||
ModelList.push( OneModel.getAttribute("mode") );
|
||||
}
|
||||
|
||||
//TypeList
|
||||
let pType=$("#FilatypeList input:gt(0):checked");
|
||||
let nType=pType.length;
|
||||
let TypeList=new Array();
|
||||
for(let n=0;n<nType;n++)
|
||||
{
|
||||
let OneType=pType[n];
|
||||
TypeList.push( OneType.getAttribute("filatype") );
|
||||
}
|
||||
|
||||
//VendorList
|
||||
let pVendor=$("#VendorList input:gt(0):checked");
|
||||
let nVendor=pVendor.length;
|
||||
let VendorList=new Array();
|
||||
for(let n=0;n<nVendor;n++)
|
||||
{
|
||||
let OneVendor=pVendor[n];
|
||||
VendorList.push( OneVendor.getAttribute("vendor") );
|
||||
}
|
||||
|
||||
|
||||
//Update Filament UI
|
||||
for(let m=0;m<nFilament;m++)
|
||||
{
|
||||
let OneNode=FilaNodes[m];
|
||||
let OneFF=OneNode.getElementsByTagName("input")[0];
|
||||
|
||||
let fModel=OneFF.getAttribute("model");
|
||||
let fVendor=OneFF.getAttribute("vendor");
|
||||
let fType=OneFF.getAttribute("filatype");
|
||||
let fName=OneFF.getAttribute("name");
|
||||
|
||||
if(TypeList.in_array(fType) && VendorList.in_array(fVendor))
|
||||
{
|
||||
let HasModel=false;
|
||||
for(let m=0;m<nModel;m++)
|
||||
{
|
||||
let ModelSrc=ModelList[m];
|
||||
|
||||
if( ModelSrc=="all" || fModel.indexOf(ModelSrc)>=0)
|
||||
{
|
||||
HasModel=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(HasModel || fModel=='')
|
||||
$(OneNode).show();
|
||||
else
|
||||
$(OneNode).hide();
|
||||
}
|
||||
else
|
||||
$(OneNode).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function ChooseDefaultFilament()
|
||||
{
|
||||
//ModelList
|
||||
let pModel=$("#MachineList input:gt(0):checked");
|
||||
let nModel=pModel.length;
|
||||
let ModelList=new Array();
|
||||
for(let n=0;n<nModel;n++)
|
||||
{
|
||||
let OneModel=pModel[n];
|
||||
ModelList.push( OneModel.getAttribute("mode") );
|
||||
}
|
||||
|
||||
//Filament
|
||||
let FilaNodes=$("#ItemBlockArea .MItem");
|
||||
let nFilament=FilaNodes.length;
|
||||
for(let m=0;m<nFilament;m++)
|
||||
{
|
||||
let OneNode=FilaNodes[m];
|
||||
let OneFF=OneNode.getElementsByTagName("input")[0];
|
||||
$(OneFF).prop("checked",false);
|
||||
|
||||
let fModel=OneFF.getAttribute("model");
|
||||
|
||||
let HasModel=false;
|
||||
for(let m=0;m<nModel;m++)
|
||||
{
|
||||
let ModelSrc=ModelList[m];
|
||||
|
||||
if( fModel.indexOf(ModelSrc)>=0)
|
||||
{
|
||||
HasModel=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(HasModel)
|
||||
$(OneFF).prop("checked",true);
|
||||
}
|
||||
|
||||
ShowNotice(0);
|
||||
}
|
||||
|
||||
function SelectAllFilament( nShow )
|
||||
{
|
||||
if( nShow==0 )
|
||||
{
|
||||
$('#ItemBlockArea input').prop("checked",false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#ItemBlockArea input').prop("checked",true);
|
||||
}
|
||||
}
|
||||
|
||||
function ShowNotice( nShow )
|
||||
{
|
||||
if(nShow==0)
|
||||
{
|
||||
$("#NoticeMask").hide();
|
||||
$("#NoticeBody").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#NoticeMask").show();
|
||||
$("#NoticeBody").show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ResponseFilamentResult()
|
||||
{
|
||||
let FilaSelectedList= $("#ItemBlockArea input:checked");
|
||||
let nAll=FilaSelectedList.length;
|
||||
|
||||
if( nAll==0 )
|
||||
{
|
||||
ShowNotice(1);
|
||||
return false;
|
||||
}
|
||||
|
||||
let FilaArray=new Array();
|
||||
for(let n=0;n<nAll;n++)
|
||||
{
|
||||
let sName=FilaSelectedList[n].getAttribute("name");
|
||||
|
||||
for( let key in m_ProfileItem['filament'] )
|
||||
{
|
||||
let FName=GetFilamentShortname(key);
|
||||
|
||||
if(FName==sName)
|
||||
FilaArray.push(key);
|
||||
}
|
||||
}
|
||||
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="save_userguide_filaments";
|
||||
tSend['data']={};
|
||||
tSend['data']['filament']=FilaArray;
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function ReturnPreviewPage()
|
||||
{
|
||||
let nMode=m_ProfileItem["model"].length;
|
||||
|
||||
if( nMode==1)
|
||||
document.location.href="../3/index.html";
|
||||
else
|
||||
document.location.href="../21/index.html";
|
||||
}
|
||||
|
||||
|
||||
function GotoNewFeature()
|
||||
{
|
||||
let bRet=ResponseFilamentResult();
|
||||
|
||||
if(bRet)
|
||||
window.location.href="../5/index.html";
|
||||
}
|
||||
|
||||
function FinishGuide()
|
||||
{
|
||||
let bRet=ResponseFilamentResult();
|
||||
|
||||
if(bRet)
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="user_guide_finish";
|
||||
tSend['data']={};
|
||||
tSend['data']['action']="finish";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
//window.location.href="../6/index.html";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
146
resources/web/guide/22/index.html
Normal file
146
resources/web/guide/22/index.html
Normal file
|
@ -0,0 +1,146 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=0" />
|
||||
<title>引导_P21</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="22.css" />
|
||||
<script type="text/javascript" src="test.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../js/json2.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript" src="./22.js"></script>
|
||||
</head>
|
||||
<body onLoad="OnInit()">
|
||||
<div id="Title">
|
||||
<div class="trans" tid="t14">Filament Selection</div>
|
||||
</div>
|
||||
<div id="Content">
|
||||
|
||||
<div id="MachineList" class="ChooseBlock">
|
||||
<div class="CName"><span class="trans" tid="t15">printer</span>:</div>
|
||||
<div class="CValues">
|
||||
<div><input type="checkbox" mode="all" onClick="ChooseAllMachine()" /><span class="trans" tid="t11">all</span></div>
|
||||
<!-- <div><input type="checkbox" mode="-normal" onChange="SortFilament()" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V5-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V5-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V5-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="FilatypeList" class="ChooseBlock">
|
||||
<div class="CName"><span class="trans" tid="t16">filament type</span>:</div>
|
||||
<div class="CValues">
|
||||
<div><input type="checkbox" class="trans" tid="t11" onClick="ChooseAllFilament()" /><span class="trans" tid="t11">all</span></div>
|
||||
<!-- <div><input type="checkbox" filatype="PLA" />PLA</div>
|
||||
<div><input type="checkbox" />PET</div>
|
||||
<div><input type="checkbox" />ABS</div>
|
||||
<div><input type="checkbox" />TPU</div>
|
||||
<div><input type="checkbox" />PA6+CF</div>
|
||||
<div><input type="checkbox" />N/A</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="VendorList" class="ChooseBlock">
|
||||
<div class="CName"><span class="trans" tid="t17">vendor</span>:</div>
|
||||
<div class="CValues">
|
||||
<div><input type="checkbox" class="trans" tid="t11" onClick="ChooseAllVendor()" /><span class="trans" tid="t11">all</span></div>
|
||||
<!-- <div><input type="checkbox" vendor="Unknow" />Unknown</div>
|
||||
<div><input type="checkbox" />BBL</div>
|
||||
<div><input type="checkbox" />eSUN</div>
|
||||
<div><input type="checkbox" />Kexcelled</div>
|
||||
<div><input type="checkbox" />Polymaker</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="ItemSelectArea">
|
||||
<div class="SmallBtn_Green trans" tid="t11" onClick="SelectAllFilament(1)">All</div>
|
||||
<div class="SmallBtn trans" tid="t12" onClick="SelectAllFilament(0)">Clear all</div>
|
||||
</div>
|
||||
<div id="ItemBlockArea">
|
||||
<!-- <div class="MItem"><input type="checkbox" vendor="" filatype="" model="ALL PLA EXPSilk" name="" />ALL PLA EXPSilk</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA Silk</div>
|
||||
<div class="MItem"><input type="checkbox" />BBL PA-CF</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU83</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU87</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU90</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU95</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ASA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Silk PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Sparkle PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5M PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5P PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5P PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA EXPSilk</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA Silk</div>
|
||||
<div class="MItem"><input type="checkbox" />BBL PA-CF</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU83</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU87</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU90</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU95</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ASA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Silk PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Sparkle PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5M PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU83</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU87</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU90</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU95</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ASA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Silk PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Sparkle PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5M PLA~</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="ReturnPreviewPage()">Back</div>
|
||||
<!-- <div class="NormalBtn trans" tid="t9" id="AcceptBtn" onclick="GotoNewFeature()">Next</div>-->
|
||||
<div class="NormalBtn trans" tid="t25" id="AcceptBtn" onclick="FinishGuide()">finish</div>
|
||||
</div>
|
||||
<div id="NoticeMask">
|
||||
</div>
|
||||
<div id="NoticeBody">
|
||||
<div id="NoticeBar" class="trans" tid="t18">error</div>
|
||||
<div id="NoticeContent">
|
||||
<div id="NoticeText" class="trans" tid="t19">At least one filament must be selected. </div>
|
||||
<div id="NoticeText" class="trans" tid="t20">Do you want to use default filament ?</div>
|
||||
<div id="NoticeBtns">
|
||||
<div class="SmallBtn trans" tid="t21" onClick="ChooseDefaultFilament()">Yes</div>
|
||||
<div class="SmallBtn trans" tid="t22" onClick="ShowNotice(0)">No</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
522
resources/web/guide/22/test.js
Normal file
522
resources/web/guide/22/test.js
Normal file
|
@ -0,0 +1,522 @@
|
|||
var cData={
|
||||
"filament": {
|
||||
"BBL PA-CF @BBL": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "BBL PA-CF @BBL",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/BBL PA-CF @BBL.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "BBL"
|
||||
},
|
||||
"Generic ABS": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic ABS",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic ABS.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic PETG": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic PETG",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic PETG.json",
|
||||
"type": "PET",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic PLA": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic PLA",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic PLA.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/Generic TPU.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU83": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU83",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU83.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU87": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU87",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU87.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU90": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU90",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/Generic TPU90.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"Generic TPU95": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "Generic TPU95",
|
||||
"selected": 1,
|
||||
"sub_path": "filament/Generic TPU95.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Unknow"
|
||||
},
|
||||
"K5 ABS @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 ABS @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 ABS @Kexcelled.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 ASA @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 ASA @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 ASA @Kexcelled.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 PETG @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 PETG @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 PETG @Kexcelled.json",
|
||||
"type": "PET",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 PLA Magic @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 PLA Magic @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 PLA Magic @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 PLA Wood @Kexcelled": {
|
||||
"models": "",
|
||||
"name": "K5 PLA Wood @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 PLA Wood @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 PLA~ @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 Silk PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 Silk PLA~ @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 Silk PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5 Sparkle PLA @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5 Sparkle PLA @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5 Sparkle PLA @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5M PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5M PLA~ @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5M PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5P PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5P PLA~ @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5P PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K5T ABS @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K5T ABS @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K5T ABS @Kexcelled.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K6 PETG @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K6 PETG @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K6 PETG @Kexcelled.json",
|
||||
"type": "PET",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K6 PLA~ @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K6 PLA~ @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K6 PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K6CF PLA~ @Kexcelled ": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K6CF PLA~ @Kexcelled ",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K6CF PLA~ @Kexcelled.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K7 PC @Kexcelled ": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K7 PC @Kexcelled ",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K7 PC @Kexcelled.json",
|
||||
"type": "PC",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K7CF PAHT @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K7CF PAHT @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K7CF PAHT @Kexcelled.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K7CF PET @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K7CF PET @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K7CF PET @Kexcelled.json",
|
||||
"type": "PET",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"K7CFLM PAHT @Kexcelled": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "K7CFLM PAHT @Kexcelled",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/K7CFLM PAHT @Kexcelled.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Kexcelled"
|
||||
},
|
||||
"PLA Silk with Glue @ALL": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PLA Silk with Glue @ALL",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PLA Silk with Glue @ALL.json",
|
||||
"type": "PLA",
|
||||
"vendor": "ALL"
|
||||
},
|
||||
"PLA with Glue except Silk @ALL": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PLA with Glue except Silk @ALL",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PLA with Glue except Silk @ALL.json",
|
||||
"type": "PLA",
|
||||
"vendor": "ALL"
|
||||
},
|
||||
"PolyDissolve @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyDissolve @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyDissolve @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyFlex TPU95HF @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyFlex TPU95HF @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyFlex TPU95HF @Polymaker.json",
|
||||
"type": "TPU",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite ABS @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite ABS @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyLite ABS @Polymaker.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite ASA @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite ASA @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyLite ASA @Polymaker.json",
|
||||
"type": "ABS",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PC @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PC @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyLite PC @Polymaker.json",
|
||||
"type": "PC",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PETG @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PETG @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyLite PETG @Polymaker.json",
|
||||
"type": "PET",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PLA Pro~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PLA Pro~ @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyLite PLA Pro~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PLA Silk~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PLA Silk~ @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyLite PLA Silk~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyLite PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyLite PLA~ @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyLite PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMax PC @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMax PC @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyMax PC @Polymaker.json",
|
||||
"type": "PC",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMax PETG @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMax PETG @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyMax PETG @Polymaker.json",
|
||||
"type": "PET",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMax PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMax PLA~ @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyMax PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide CoPA @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide CoPA @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyMide CoPA @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide PA12-CF @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide PA12-CF @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyMide PA12-CF @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide PA6-CF @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide PA6-CF @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyMide PA6-CF @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyMide PA6-GF @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyMide PA6-GF @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyMide PA6-GF @Polymaker.json",
|
||||
"type": "PA6+CF",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolySupport @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolySupport @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolySupport @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyTerra PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyTerra PLA~ @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyTerra PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"PolyWood PLA~ @Polymaker": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "PolyWood PLA~ @Polymaker",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/PolyWood PLA~ @Polymaker.json",
|
||||
"type": "PLA",
|
||||
"vendor": "Polymaker"
|
||||
},
|
||||
"eSUN ABS @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN ABS @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN ABS @eSUN.json",
|
||||
"type": "ABS",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN ABS+ @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN ABS+ @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN ABS+ @eSUN.json",
|
||||
"type": "ABS",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PETG @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PETG @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN PETG @eSUN.json",
|
||||
"type": "PET",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN PLA @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA Matte~ @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA Matte~ @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN PLA Matte~ @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA ST @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA ST @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN PLA ST @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA Silk~ @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA Silk~ @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN PLA Silk~ @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
},
|
||||
"eSUN PLA+~ @eSUN": {
|
||||
"models": "[BBL-3DP-V5NORMAL]",
|
||||
"name": "eSUN PLA+~ @eSUN",
|
||||
"selected": 0,
|
||||
"sub_path": "filament/eSUN PLA+~ @eSUN.json",
|
||||
"type": "PLA",
|
||||
"vendor": "eSUN"
|
||||
}
|
||||
},
|
||||
"machine": [
|
||||
{
|
||||
"model": "BBL-3DP-V5NORMAL",
|
||||
"name": "Bambulab BBL-3DP-001-V5-normal",
|
||||
"sub_path": "machine/Bambulab BBL-3DP-001-V5-normal.json"
|
||||
}
|
||||
],
|
||||
"model": [
|
||||
{
|
||||
"cover": "E:\\Document\\DevCode\\Slicer2\\bamboo_slicer\\build\\src\\Debug\\resources\\profiles\\BBL\\BBL-3DP-V5NORMAL_cover.png",
|
||||
"materials": "Generic PLA;PolyDissolve @Polymaker;PolyFlex TPU95HF @Polymaker;K5 Sparkle PLA @Kexcelled;Rock PLA @Polymaker;Generic TPU95;Generic TPU90;Generic TPU87;Generic TPU83;PolyMide CoPA @Polymaker;PolyMide PA6-GF @Polymaker;PolyMide PA12-CF @Polymaker;PolyMide PA6-CF @Polymaker;PolyLite ASA @Polymaker;K5 ASA @Kexcelled;K5T ABS @Kexcelled;PLA with Glue except Silk @ALL;PLA Silk with Glue @ALL;PolyTerra PLA~ @Polymaker; PolyLite PLA~ @Polymaker; PolyLite PLA Pro~ @Polymaker; PolyLite PLA Silk~ @Polymaker; PolyMax PLA~ @Polymaker; PolyWood PLA~ @Polymaker;K5 Silk PLA~ @Kexcelled;K5 PLA~ @Kexcelled;K6 PLA~ @Kexcelled;K6CF PLA~ @Kexcelled;K5M PLA~ @Kexcelled;K5P PLA~ @Kexcelled;eSUN PLA @eSUN; eSUN PLA+~ @eSUN; eSUN PLA Matte~ @eSUN; eSUN PLA Silk~ @eSUN; eSUN PLA ST @eSUN; PolyLite ABS @Polymaker; K5 ABS @Kexcelled; eSUN ABS @eSUN; eSUN ABS+ @eSUN; K5 PETG @Kexcelled; K6 PETG @Kexcelled; PolyMax PETG @Polymaker; PolyLite PETG @Polymaker; eSUN PETG @eSUN; PolySupport @Polymaker;K7CF PET @Kexcelled;K7CFLM PAHT @Kexcelled;K7CF PAHT @Kexcelled; K7LM PAHT @Kexcelled; BBL PA-CF @BBL;K7 PC @Kexcelled; PolyLite PC @Polymaker; PolyMax PC @Polymaker;K5 PLA Magic @Kexcelled;",
|
||||
"model": "BBL-3DP-V5NORMAL",
|
||||
"nozzle_diameter": "0.4;0.2",
|
||||
"nozzle_selected": "0.4",
|
||||
"sub_path": "machine/BBL-3DP-V5NORMAL.json",
|
||||
"vendor": "BBL"
|
||||
}
|
||||
],
|
||||
"process": [
|
||||
{
|
||||
"name": "0.08mm SUPERDETAIL @BBL-3DP",
|
||||
"sub_path": "process/0.08mm SUPERDETAIL @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.10mm HIGHDETAIL @BBL-3DP",
|
||||
"sub_path": "process/0.10mm HIGHDETAIL @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.12mm DETAIL @BBL-3DP",
|
||||
"sub_path": "process/0.12mm DETAIL @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.16mm OPTIMAL @BBL-3DP",
|
||||
"sub_path": "process/0.16mm OPTIMAL @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.20mm NORMAL @BBL-3DP",
|
||||
"sub_path": "process/0.20mm NORMAL @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.24mm DRAFT @BBL-3DP",
|
||||
"sub_path": "process/0.24mm DRAFT @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.28mm SUPERDRAFT @BBL-3DP",
|
||||
"sub_path": "process/0.28mm SUPERDRAFT @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.20mm TreeSupport @BBL-3DP",
|
||||
"sub_path": "process/0.20mm TreeSupport @BBL-3DP.json"
|
||||
},
|
||||
{
|
||||
"name": "0.20mm PolySupport @BBL-3DP",
|
||||
"sub_path": "process/0.20mm PolySupport @BBL-3DP.json"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
var mData={
|
||||
"BBL-3DP-V4NORMAL": {
|
||||
"model": "BBL-3DP-V4NORMAL",
|
||||
"nozzle_diameter": "0.4",
|
||||
"vendor": "BBL"
|
||||
},
|
||||
"BBL-3DP-V5NORMAL": {
|
||||
"model": "BBL-3DP-V5NORMAL",
|
||||
"nozzle_diameter": "0.4;0.2",
|
||||
"vendor": "BBL"
|
||||
}
|
||||
};
|
111
resources/web/guide/23/23.css
Normal file
111
resources/web/guide/23/23.css
Normal file
|
@ -0,0 +1,111 @@
|
|||
|
||||
.ChooseBlock
|
||||
{
|
||||
display:flex;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.CName
|
||||
{
|
||||
width:130px;
|
||||
min-width: 80px;
|
||||
font-weight: 700;
|
||||
height: 100%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.CValues
|
||||
{
|
||||
display:flex;
|
||||
justify-content: flex-start;
|
||||
align-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
input
|
||||
{
|
||||
margin-left: 20px;
|
||||
margin-right: 6px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#ItemSelectArea
|
||||
{
|
||||
height:40px;
|
||||
border-top: 1px solid #00AE42;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#ItemSelectArea .SmallBtn
|
||||
{
|
||||
margin-left:5px;
|
||||
}
|
||||
|
||||
|
||||
#ItemBlockArea
|
||||
{
|
||||
flex: 1;
|
||||
display:flex;
|
||||
overflow-x:auto;
|
||||
flex-wrap:wrap;
|
||||
flex-direction: column;
|
||||
justify-content:flex-start;
|
||||
align-items: flex-start;
|
||||
align-content:flex-start;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.MItem
|
||||
{
|
||||
width: 220px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
|
||||
#NoticeMask
|
||||
{
|
||||
background-color: #000;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
opacity: 0.05;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#NoticeBody
|
||||
{
|
||||
display: none;
|
||||
width: 500px;
|
||||
border: 1px solid #000;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 200px;
|
||||
margin-left: -250px;
|
||||
}
|
||||
|
||||
#NoticeBar
|
||||
{
|
||||
background-color:#00B35C;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#NoticeContent
|
||||
{
|
||||
padding: 4mm 10mm;
|
||||
}
|
||||
|
||||
|
||||
#NoticeBtns
|
||||
{
|
||||
margin-top: 4mm;
|
||||
display: flex;
|
||||
justify-content:space-around;
|
||||
}
|
522
resources/web/guide/23/23.js
Normal file
522
resources/web/guide/23/23.js
Normal file
|
@ -0,0 +1,522 @@
|
|||
|
||||
var m_ProfileItem;
|
||||
|
||||
var FilamentPriority=new Array( "pla","abs","pet","tpu","pc");
|
||||
var VendorPriority=new Array("bambu lab","bambulab","bbl","kexcelled","polymaker","esun","generic");
|
||||
|
||||
function OnInit()
|
||||
{
|
||||
TranslatePage();
|
||||
|
||||
RequestProfile();
|
||||
}
|
||||
|
||||
function RequestProfile()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="request_userguide_profile";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
//function RequestModelSelect()
|
||||
//{
|
||||
// var tSend={};
|
||||
// tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
// tSend['command']="request_userguide_modelselected";
|
||||
//
|
||||
// SendWXMessage( JSON.stringify(tSend) );
|
||||
//}
|
||||
|
||||
function HandleStudio(pVal)
|
||||
{
|
||||
let strCmd=pVal['command'];
|
||||
//alert(strCmd);
|
||||
|
||||
if(strCmd=='response_userguide_profile')
|
||||
{
|
||||
m_ProfileItem=pVal['response'];
|
||||
SortUI();
|
||||
}
|
||||
}
|
||||
|
||||
function GetFilamentShortname( sName )
|
||||
{
|
||||
let sShort=sName.split('@')[0].trim();
|
||||
|
||||
return sShort;
|
||||
}
|
||||
|
||||
|
||||
function SortUI()
|
||||
{
|
||||
var ModelList=new Array();
|
||||
|
||||
let nMode=m_ProfileItem["model"].length;
|
||||
for(let n=0;n<nMode;n++)
|
||||
{
|
||||
let OneMode=m_ProfileItem["model"][n];
|
||||
|
||||
if( OneMode["nozzle_selected"]!="" )
|
||||
ModelList.push(OneMode["model"]);
|
||||
}
|
||||
|
||||
//machine
|
||||
// let HtmlMachine='';
|
||||
//
|
||||
// let nMachine=m_ProfileItem['machine'].length;
|
||||
// for(let n=0;n<nMachine;n++)
|
||||
// {
|
||||
// let OneMachine=m_ProfileItem['machine'][n];
|
||||
//
|
||||
// let sName=OneMachine['name'];
|
||||
// let sModel=OneMachine['model'];
|
||||
//
|
||||
// if( ModelList.in_array(sModel) )
|
||||
// {
|
||||
// HtmlMachine+='<div><input type="checkbox" mode="'+sModel+'" onChange="MachineClick()" />'+sName+'</div>';
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $('#MachineList .CValues').append(HtmlMachine);
|
||||
// $('#MachineList .CValues input').prop("checked",true);
|
||||
// if(nMachine<=1)
|
||||
// {
|
||||
// $('#MachineList').hide();
|
||||
// }
|
||||
|
||||
//machine
|
||||
let HtmlMode='';
|
||||
nMode=ModelList.length;
|
||||
for(let n=0;n<nMode;n++)
|
||||
{
|
||||
let sModel=ModelList[n];
|
||||
|
||||
HtmlMode+='<div><input type="checkbox" mode="'+sModel+'" onChange="MachineClick()" />'+sModel+'</div>';
|
||||
}
|
||||
|
||||
$('#MachineList .CValues').append(HtmlMode);
|
||||
$('#MachineList .CValues input').prop("checked",true);
|
||||
if(nMode<=1)
|
||||
{
|
||||
$('#MachineList').hide();
|
||||
}
|
||||
|
||||
//Filament
|
||||
let HtmlFilament='';
|
||||
let SelectNumber=0;
|
||||
|
||||
var TypeHtmlArray={};
|
||||
var VendorHtmlArray={};
|
||||
for( let key in m_ProfileItem['filament'] )
|
||||
{
|
||||
let OneFila=m_ProfileItem['filament'][key];
|
||||
|
||||
let fShortName=GetFilamentShortname( OneFila['name'] );
|
||||
let fVendor=OneFila['vendor'];
|
||||
let fType=OneFila['type'];
|
||||
let fSelect=OneFila['selected'];
|
||||
let fModel=OneFila['models']
|
||||
|
||||
// if(OneFila['name'].indexOf("K5 PLA Wood")>0)
|
||||
// {
|
||||
// let b=1+2;
|
||||
// }
|
||||
|
||||
let bFind=false;
|
||||
let bCheck=$("#MachineList input:first").prop("checked");
|
||||
if(bCheck)
|
||||
{
|
||||
bFind=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//check in modellist
|
||||
let nModelAll=ModelList.length;
|
||||
for(let m=0;m<nModelAll;m++)
|
||||
{
|
||||
let sOne=ModelList[m];
|
||||
|
||||
if(fModel.indexOf(sOne)>=0)
|
||||
{
|
||||
bFind=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(bFind)
|
||||
{
|
||||
//Type
|
||||
let LowType=fType.toLowerCase();
|
||||
if(!TypeHtmlArray.hasOwnProperty(LowType))
|
||||
{
|
||||
let HtmlType='<div><input type="checkbox" filatype="'+fType+'" onChange="FilaClick()" />'+fType+'</div>';
|
||||
|
||||
TypeHtmlArray[LowType]=HtmlType;
|
||||
}
|
||||
|
||||
//Vendor
|
||||
let lowVendor=fVendor.toLowerCase();
|
||||
if(!VendorHtmlArray.hasOwnProperty(lowVendor))
|
||||
{
|
||||
let HtmlVendor='<div><input type="checkbox" vendor="'+fVendor+'" onChange="VendorClick()" />'+fVendor+'</div>';
|
||||
|
||||
VendorHtmlArray[lowVendor]=HtmlVendor;
|
||||
}
|
||||
|
||||
//Filament
|
||||
let pFila=$("#ItemBlockArea input[vendor='"+fVendor+"'][filatype='"+fType+"'][name='"+fShortName+"']");
|
||||
if(pFila.length==0)
|
||||
{
|
||||
let HtmlFila='<div class="MItem"><input type="checkbox" vendor="'+fVendor+'" filatype="'+fType+'" model="'+fModel+'" name="'+fShortName+'" />'+fShortName+'</div>';
|
||||
|
||||
$("#ItemBlockArea").append(HtmlFila);
|
||||
|
||||
if(fSelect==1)
|
||||
{
|
||||
$("#ItemBlockArea input[vendor='"+fVendor+"'][filatype='"+fType+"'][name='"+fShortName+"']").prop("checked",true);
|
||||
|
||||
SelectNumber++;
|
||||
}
|
||||
// else
|
||||
// $("#ItemBlockArea input[vendor='"+fVendor+"'][model='"+fModel+"'][filatype='"+fType+"'][name='"+key+"']").prop("checked",false);
|
||||
}
|
||||
else
|
||||
{
|
||||
let strModel=pFila.attr("model");
|
||||
|
||||
pFila.attr("model", strModel+fModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Sort TypeArray
|
||||
let TypeAdvNum=FilamentPriority.length;
|
||||
for( let n=0;n<TypeAdvNum;n++ )
|
||||
{
|
||||
let strType=FilamentPriority[n];
|
||||
|
||||
if( TypeHtmlArray.hasOwnProperty( strType ) )
|
||||
{
|
||||
$("#FilatypeList .CValues").append( TypeHtmlArray[strType] );
|
||||
delete( TypeHtmlArray[strType] );
|
||||
}
|
||||
}
|
||||
for(let key in TypeHtmlArray )
|
||||
{
|
||||
$("#FilatypeList .CValues").append( TypeHtmlArray[key] );
|
||||
}
|
||||
$("#FilatypeList .CValues input").prop("checked",true);
|
||||
|
||||
//Sort VendorArray
|
||||
let VendorAdvNum=VendorPriority.length;
|
||||
for( let n=0;n<VendorAdvNum;n++ )
|
||||
{
|
||||
let strVendor=VendorPriority[n];
|
||||
|
||||
if( VendorHtmlArray.hasOwnProperty( strVendor ) )
|
||||
{
|
||||
$("#VendorList .CValues").append( VendorHtmlArray[strVendor] );
|
||||
delete( VendorHtmlArray[strVendor] );
|
||||
}
|
||||
}
|
||||
for(let key in VendorHtmlArray )
|
||||
{
|
||||
$("#VendorList .CValues").append( VendorHtmlArray[key] );
|
||||
}
|
||||
$("#VendorList .CValues input").prop("checked",true);
|
||||
|
||||
//------
|
||||
if(SelectNumber==0)
|
||||
ChooseDefaultFilament();
|
||||
}
|
||||
|
||||
|
||||
function ChooseAllMachine()
|
||||
{
|
||||
let bCheck=$("#MachineList input:first").prop("checked");
|
||||
|
||||
$("#MachineList input").prop("checked",bCheck);
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function MachineClick()
|
||||
{
|
||||
let nChecked=$("#MachineList input:gt(0):checked").length
|
||||
let nAll =$("#MachineList input:gt(0)").length
|
||||
|
||||
if(nAll==nChecked)
|
||||
{
|
||||
$("#MachineList input:first").prop("checked",true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#MachineList input:first").prop("checked",false);
|
||||
}
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function ChooseAllFilament()
|
||||
{
|
||||
let bCheck=$("#FilatypeList input:first").prop("checked");
|
||||
$("#FilatypeList input").prop("checked",bCheck);
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function FilaClick()
|
||||
{
|
||||
let nChecked=$("#FilatypeList input:gt(0):checked").length
|
||||
let nAll =$("#FilatypeList input:gt(0)").length
|
||||
|
||||
if(nAll==nChecked)
|
||||
{
|
||||
$("#FilatypeList input:first").prop("checked",true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#FilatypeList input:first").prop("checked",false);
|
||||
}
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function ChooseAllVendor()
|
||||
{
|
||||
let bCheck=$("#VendorList input:first").prop("checked");
|
||||
$("#VendorList input").prop("checked",bCheck);
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
function VendorClick()
|
||||
{
|
||||
let nChecked=$("#VendorList input:gt(0):checked").length
|
||||
let nAll =$("#VendorList input:gt(0)").length
|
||||
|
||||
if(nAll==nChecked)
|
||||
{
|
||||
$("#VendorList input:first").prop("checked",true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#VendorList input:first").prop("checked",false);
|
||||
}
|
||||
|
||||
SortFilament();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function SortFilament()
|
||||
{
|
||||
let FilaNodes=$("#ItemBlockArea .MItem");
|
||||
let nFilament=FilaNodes.length;
|
||||
//$("#ItemBlockArea .MItem").hide();
|
||||
|
||||
//ModelList
|
||||
let pModel=$("#MachineList input:checked");
|
||||
let nModel=pModel.length;
|
||||
let ModelList=new Array();
|
||||
for(let n=0;n<nModel;n++)
|
||||
{
|
||||
let OneModel=pModel[n];
|
||||
ModelList.push( OneModel.getAttribute("mode") );
|
||||
}
|
||||
|
||||
//TypeList
|
||||
let pType=$("#FilatypeList input:gt(0):checked");
|
||||
let nType=pType.length;
|
||||
let TypeList=new Array();
|
||||
for(let n=0;n<nType;n++)
|
||||
{
|
||||
let OneType=pType[n];
|
||||
TypeList.push( OneType.getAttribute("filatype") );
|
||||
}
|
||||
|
||||
//VendorList
|
||||
let pVendor=$("#VendorList input:gt(0):checked");
|
||||
let nVendor=pVendor.length;
|
||||
let VendorList=new Array();
|
||||
for(let n=0;n<nVendor;n++)
|
||||
{
|
||||
let OneVendor=pVendor[n];
|
||||
VendorList.push( OneVendor.getAttribute("vendor") );
|
||||
}
|
||||
|
||||
|
||||
//Update Filament UI
|
||||
for(let m=0;m<nFilament;m++)
|
||||
{
|
||||
let OneNode=FilaNodes[m];
|
||||
let OneFF=OneNode.getElementsByTagName("input")[0];
|
||||
|
||||
let fModel=OneFF.getAttribute("model");
|
||||
let fVendor=OneFF.getAttribute("vendor");
|
||||
let fType=OneFF.getAttribute("filatype");
|
||||
let fName=OneFF.getAttribute("name");
|
||||
|
||||
if(TypeList.in_array(fType) && VendorList.in_array(fVendor))
|
||||
{
|
||||
let HasModel=false;
|
||||
for(let m=0;m<nModel;m++)
|
||||
{
|
||||
let ModelSrc=ModelList[m];
|
||||
|
||||
if( ModelSrc=="all" || fModel.indexOf(ModelSrc)>=0)
|
||||
{
|
||||
HasModel=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(HasModel || fModel=='')
|
||||
$(OneNode).show();
|
||||
else
|
||||
$(OneNode).hide();
|
||||
}
|
||||
else
|
||||
$(OneNode).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function ChooseDefaultFilament()
|
||||
{
|
||||
//ModelList
|
||||
let pModel=$("#MachineList input:gt(0):checked");
|
||||
let nModel=pModel.length;
|
||||
let ModelList=new Array();
|
||||
for(let n=0;n<nModel;n++)
|
||||
{
|
||||
let OneModel=pModel[n];
|
||||
ModelList.push( OneModel.getAttribute("mode") );
|
||||
}
|
||||
|
||||
//Filament
|
||||
let FilaNodes=$("#ItemBlockArea .MItem");
|
||||
let nFilament=FilaNodes.length;
|
||||
for(let m=0;m<nFilament;m++)
|
||||
{
|
||||
let OneNode=FilaNodes[m];
|
||||
let OneFF=OneNode.getElementsByTagName("input")[0];
|
||||
$(OneFF).prop("checked",false);
|
||||
|
||||
let fModel=OneFF.getAttribute("model");
|
||||
|
||||
let HasModel=false;
|
||||
for(let m=0;m<nModel;m++)
|
||||
{
|
||||
let ModelSrc=ModelList[m];
|
||||
|
||||
if( fModel.indexOf(ModelSrc)>=0)
|
||||
{
|
||||
HasModel=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(HasModel)
|
||||
$(OneFF).prop("checked",true);
|
||||
}
|
||||
|
||||
ShowNotice(0);
|
||||
}
|
||||
|
||||
function SelectAllFilament( nShow )
|
||||
{
|
||||
if( nShow==0 )
|
||||
{
|
||||
$('#ItemBlockArea input').prop("checked",false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#ItemBlockArea input').prop("checked",true);
|
||||
}
|
||||
}
|
||||
|
||||
function ShowNotice( nShow )
|
||||
{
|
||||
if(nShow==0)
|
||||
{
|
||||
$("#NoticeMask").hide();
|
||||
$("#NoticeBody").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#NoticeMask").show();
|
||||
$("#NoticeBody").show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ResponseFilamentResult()
|
||||
{
|
||||
let FilaSelectedList= $("#ItemBlockArea input:checked");
|
||||
let nAll=FilaSelectedList.length;
|
||||
|
||||
if( nAll==0 )
|
||||
{
|
||||
ShowNotice(1);
|
||||
return false;
|
||||
}
|
||||
|
||||
let FilaArray=new Array();
|
||||
for(let n=0;n<nAll;n++)
|
||||
{
|
||||
let sName=FilaSelectedList[n].getAttribute("name");
|
||||
|
||||
for( let key in m_ProfileItem['filament'] )
|
||||
{
|
||||
let FName=GetFilamentShortname(key);
|
||||
|
||||
if(FName==sName)
|
||||
FilaArray.push(key);
|
||||
}
|
||||
}
|
||||
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="save_userguide_filaments";
|
||||
tSend['data']={};
|
||||
tSend['data']['filament']=FilaArray;
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function CancelSelect()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="user_guide_cancel";
|
||||
tSend['data']={};
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
|
||||
function ConfirmSelect()
|
||||
{
|
||||
let bRet=ResponseFilamentResult();
|
||||
|
||||
if(bRet)
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="user_guide_finish";
|
||||
tSend['data']={};
|
||||
tSend['data']['action']="finish";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
149
resources/web/guide/23/index.html
Normal file
149
resources/web/guide/23/index.html
Normal file
|
@ -0,0 +1,149 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=0" />
|
||||
<title>引导_P21</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="23.css" />
|
||||
<script type="text/javascript" src="test.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../js/json2.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript" src="./23.js"></script>
|
||||
</head>
|
||||
<body onLoad="OnInit()">
|
||||
<div id="Title">
|
||||
<div class="trans" tid="t14">Filament Selection</div>
|
||||
</div>
|
||||
<div id="Content">
|
||||
|
||||
<div id="MachineList" class="ChooseBlock">
|
||||
<div class="CName"><span class="trans" tid="t15">printer</span>:</div>
|
||||
<div class="CValues">
|
||||
<div><input type="checkbox" mode="all" onClick="ChooseAllMachine()" /><span class="trans" tid="t11">all</span></div>
|
||||
<!-- <div><input type="checkbox" mode="-normal" onChange="SortFilament()" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V5-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V5-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V5-normal</div>
|
||||
<div><input type="checkbox" />Bambulab BBL-3DP-001-V4-normal</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="FilatypeList" class="ChooseBlock">
|
||||
<div class="CName"><span class="trans" tid="t16">filament type</span>:</div>
|
||||
<div class="CValues">
|
||||
<div><input type="checkbox" class="trans" tid="t11" onClick="ChooseAllFilament()" /><span class="trans" tid="t11">all</span></div>
|
||||
<!-- <div><input type="checkbox" filatype="PLA" />PLA</div>
|
||||
<div><input type="checkbox" />PET</div>
|
||||
<div><input type="checkbox" />ABS</div>
|
||||
<div><input type="checkbox" />TPU</div>
|
||||
<div><input type="checkbox" />PA6+CF</div>
|
||||
<div><input type="checkbox" />N/A</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="VendorList" class="ChooseBlock">
|
||||
<div class="CName"><span class="trans" tid="t17">vendor</span>:</div>
|
||||
<div class="CValues">
|
||||
<div><input type="checkbox" class="trans" tid="t11" onClick="ChooseAllVendor()" /><span class="trans" tid="t11">all</span></div>
|
||||
<!-- <div><input type="checkbox" vendor="Unknow" />Unknown</div>
|
||||
<div><input type="checkbox" />BBL</div>
|
||||
<div><input type="checkbox" />eSUN</div>
|
||||
<div><input type="checkbox" />Kexcelled</div>
|
||||
<div><input type="checkbox" />Polymaker</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ItemSelectArea">
|
||||
<div class="SmallBtn_Green trans" tid="t11" onClick="SelectAllFilament(1)">all</div>
|
||||
<div class="SmallBtn trans" tid="t12" onClick="SelectAllFilament(0)">Clear all</div>
|
||||
</div>
|
||||
|
||||
<div id="ItemBlockArea">
|
||||
<!-- <div class="MItem"><input type="checkbox" vendor="" filatype="" model="ALL PLA EXPSilk" name="" />ALL PLA EXPSilk</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA Silk</div>
|
||||
<div class="MItem"><input type="checkbox" />BBL PA-CF</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU83</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU87</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU90</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU95</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ASA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Silk PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Sparkle PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5M PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5P PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5P PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA EXPSilk</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA Silk</div>
|
||||
<div class="MItem"><input type="checkbox" />BBL PA-CF</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU83</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU87</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA Silk</div>
|
||||
<div class="MItem"><input type="checkbox" />BBL PA-CF</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU83</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU87</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU90</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU95</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 ASA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Silk PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5 Sparkle PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />K5M PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5P PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />K5P PLA~</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA EXPSilk</div>
|
||||
<div class="MItem"><input type="checkbox" />ALL PLA Silk</div>
|
||||
<div class="MItem"><input type="checkbox" />BBL PA-CF</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic ABS</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PETG</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic PLA</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU83</div>
|
||||
<div class="MItem"><input type="checkbox" />Geneic TPU87</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="NormalBtn trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div>
|
||||
<div class="GrayBtn trans" tid="t38" id="PreBtn" onclick="CancelSelect()">Cancel</div>
|
||||
</div>
|
||||
<div id="NoticeMask">
|
||||
</div>
|
||||
<div id="NoticeBody">
|
||||
<div id="NoticeBar" class="trans" tid="t18">error</div>
|
||||
<div id="NoticeContent">
|
||||
<div id="NoticeText" class="trans" tid="t19">At least one filament must be selected. </div>
|
||||
<div id="NoticeText" class="trans" tid="t20">Do you want to use default filament ?</div>
|
||||
<div id="NoticeBtns">
|
||||
<div class="SmallBtn trans" tid="t21" onClick="ChooseDefaultFilament()">yes</div>
|
||||
<div class="SmallBtn trans" tid="t22" onClick="ShowNotice(0)">no</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
166
resources/web/guide/24/24.css
Normal file
166
resources/web/guide/24/24.css
Normal file
|
@ -0,0 +1,166 @@
|
|||
#Content
|
||||
{
|
||||
overflow-y:auto;
|
||||
}
|
||||
|
||||
#Content::-webkit-scrollbar {/*滚动条整体样式*/
|
||||
width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
#Content::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
-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;
|
||||
}
|
||||
|
||||
#Content::-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;
|
||||
}
|
||||
|
||||
.BlockBanner
|
||||
{
|
||||
padding: 0px;
|
||||
border-bottom:#00AE42 1px solid;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.BannerBtns
|
||||
{
|
||||
float: right;
|
||||
display: flex;
|
||||
width: 140px;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/*.Banner-Btn
|
||||
{
|
||||
background-color: #C0C0C0;
|
||||
color: #000;
|
||||
padding: 0px 6px;
|
||||
min-width: 50px;
|
||||
border-radius: 4px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.Banner-Btn-green
|
||||
{
|
||||
background-color: #00AE42;
|
||||
color: #fff;
|
||||
padding: 0px 6px;
|
||||
min-width: 50px;
|
||||
border-radius: 8px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
cursor: pointer;
|
||||
}*/
|
||||
|
||||
.BlockBanner a
|
||||
{
|
||||
display: inline-block;
|
||||
background-color:#00AE42;
|
||||
line-height: 40px;
|
||||
height: 40px;
|
||||
padding: 0px 24px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.PrinterArea
|
||||
{
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.PrinterBlock
|
||||
{
|
||||
width: 160px;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.PrinterBlock img
|
||||
{
|
||||
width:160px;
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.PName
|
||||
{
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.pNozzel
|
||||
{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content:flex-start;
|
||||
color: #5A5A5A;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.pNozzel input
|
||||
{
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
|
||||
/*-----Notice-----*/
|
||||
#NoticeMask
|
||||
{
|
||||
background-color: #000;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
opacity: 0.05;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#NoticeBody
|
||||
{
|
||||
display: none;
|
||||
width: 400px;
|
||||
border: 1px solid #000;
|
||||
border-radius: 4px;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 200px;
|
||||
margin-left: -200px;
|
||||
}
|
||||
|
||||
#NoticeBar
|
||||
{
|
||||
background-color:#00B35C;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#NoticeContent
|
||||
{
|
||||
padding: 4mm 10mm;
|
||||
}
|
||||
|
||||
|
||||
#NoticeBtns
|
||||
{
|
||||
margin-top: 4mm;
|
||||
display: flex;
|
||||
justify-content:space-around;
|
||||
}
|
244
resources/web/guide/24/24.js
Normal file
244
resources/web/guide/24/24.js
Normal file
|
@ -0,0 +1,244 @@
|
|||
function OnInit()
|
||||
{
|
||||
//let strInput=JSON.stringify(cData);
|
||||
//HandleStudio(strInput);
|
||||
|
||||
TranslatePage();
|
||||
|
||||
RequestProfile();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function RequestProfile()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="request_userguide_profile";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
function HandleStudio( pVal )
|
||||
{
|
||||
// alert(strInput);
|
||||
// alert(JSON.stringify(strInput));
|
||||
//
|
||||
// let pVal=IsJson(strInput);
|
||||
// if(pVal==null)
|
||||
// {
|
||||
// alert("Msg Format Error is not Json");
|
||||
// return;
|
||||
// }
|
||||
|
||||
let strCmd=pVal['command'];
|
||||
//alert(strCmd);
|
||||
|
||||
if(strCmd=='response_userguide_profile')
|
||||
{
|
||||
HandleModelList(pVal['response']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function HandleModelList( pVal )
|
||||
{
|
||||
if( !pVal.hasOwnProperty("model") )
|
||||
return;
|
||||
|
||||
let pModel=pVal['model'];
|
||||
|
||||
let nTotal=pModel.length;
|
||||
let ModelHtml={};
|
||||
for(let n=0;n<nTotal;n++)
|
||||
{
|
||||
let OneModel=pModel[n];
|
||||
|
||||
let strVendor=OneModel['vendor'];
|
||||
|
||||
//Add Vendor Html Node
|
||||
if($(".OneVendorBlock[vendor='"+strVendor+"']").length==0)
|
||||
{
|
||||
let HtmlNewVendor='<div class="OneVendorBlock" Vendor="'+strVendor+'">'+
|
||||
'<div class="BlockBanner">'+
|
||||
' <div class="BannerBtns">'+
|
||||
' <div class="SmallBtn_Green trans" tid="t11" onClick="SelectPrinterAll('+"\'"+strVendor+"\'"+')">all</div>'+
|
||||
' <div class="SmallBtn trans" tid="t12" onClick="SelectPrinterNone('+"\'"+strVendor+"\'"+')">none</div>'+
|
||||
' </div>'+
|
||||
' <a>Bambu Lab</a>'+
|
||||
'</div>'+
|
||||
'<div class="PrinterArea"> '+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
$('#Content').append(HtmlNewVendor);
|
||||
}
|
||||
|
||||
let ModelName=OneModel['model'];
|
||||
|
||||
//Collect Html Node Nozzel Html
|
||||
if( !ModelHtml.hasOwnProperty(strVendor))
|
||||
ModelHtml[strVendor]='';
|
||||
|
||||
let NozzleArray=OneModel['nozzle_diameter'].split(';');
|
||||
let HtmlNozzel='';
|
||||
for(let m=0;m<NozzleArray.length;m++)
|
||||
{
|
||||
let nNozzel=NozzleArray[m];
|
||||
HtmlNozzel+='<div class="pNozzel"><input type="checkbox" model="'+OneModel['model']+'" nozzel="'+nNozzel+'" vendor="'+strVendor+'" /><span>'+nNozzel+'</span><span class="trans" tid="t13">mm nozzle</span></div>';
|
||||
}
|
||||
|
||||
let CoverImage="../../image/printer/"+OneModel['model']+"_cover.png";
|
||||
ModelHtml[strVendor]+='<div class="PrinterBlock">'+
|
||||
' <div class="PImg"><img src="'+CoverImage+'" /></div>'+
|
||||
' <div class="PName">'+OneModel['model']+'</div>'+ HtmlNozzel +'</div>';
|
||||
}
|
||||
|
||||
//Update Nozzel Html Append
|
||||
for( let key in ModelHtml )
|
||||
{
|
||||
$(".OneVendorBlock[vendor='"+key+"'] .PrinterArea").append( ModelHtml[key] );
|
||||
}
|
||||
|
||||
|
||||
//Update Checkbox
|
||||
$('input').prop("checked", false);
|
||||
for(let m=0;m<nTotal;m++)
|
||||
{
|
||||
let OneModel=pModel[m];
|
||||
|
||||
let SelectList=OneModel['nozzle_selected'];
|
||||
if(SelectList!='')
|
||||
{
|
||||
SelectList=OneModel['nozzle_selected'].split(';');
|
||||
let nLen=SelectList.length;
|
||||
|
||||
for(let a=0;a<nLen;a++)
|
||||
{
|
||||
let nNozzel=SelectList[a];
|
||||
$("input[vendor='"+OneModel['vendor']+"'][model='"+OneModel['model']+"'][nozzel='"+nNozzel+"']").prop("checked", true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$("input[vendor='"+OneModel['vendor']+"'][model='"+OneModel['model']+"']").prop("checked", false);
|
||||
}
|
||||
}
|
||||
|
||||
let AlreadySelect=$("input:checked");
|
||||
let nSelect=AlreadySelect.length;
|
||||
if(nSelect==0)
|
||||
{
|
||||
$("input[nozzel='0.4']").prop("checked", true);
|
||||
}
|
||||
|
||||
TranslatePage();
|
||||
}
|
||||
|
||||
|
||||
function SelectPrinterAll( sVendor )
|
||||
{
|
||||
$("input[vendor='"+sVendor+"']").prop("checked", true);
|
||||
}
|
||||
|
||||
|
||||
function SelectPrinterNone( sVendor )
|
||||
{
|
||||
$("input[vendor='"+sVendor+"']").prop("checked", false);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
function OnExit()
|
||||
{
|
||||
let ModelAll={};
|
||||
|
||||
let ModelSelect=$("input:checked");
|
||||
let nTotal=ModelSelect.length;
|
||||
|
||||
if( nTotal==0 )
|
||||
{
|
||||
ShowNotice(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
for(let n=0;n<nTotal;n++)
|
||||
{
|
||||
let OneItem=ModelSelect[n];
|
||||
|
||||
let strModel=OneItem.getAttribute("model");
|
||||
let strVendor=OneItem.getAttribute("vendor");
|
||||
let strNozzel=OneItem.getAttribute("nozzel");
|
||||
|
||||
//alert(strModel+strVendor+strNozzel);
|
||||
|
||||
if(!ModelAll.hasOwnProperty(strModel))
|
||||
{
|
||||
//alert("ADD: "+strModel);
|
||||
|
||||
ModelAll[strModel]={};
|
||||
|
||||
ModelAll[strModel]["model"]=strModel;
|
||||
ModelAll[strModel]["nozzle_diameter"]='';
|
||||
ModelAll[strModel]["vendor"]=strVendor;
|
||||
}
|
||||
|
||||
ModelAll[strModel]["nozzle_diameter"]+=ModelAll[strModel]["nozzle_diameter"]==''?strNozzel:';'+strNozzel;
|
||||
}
|
||||
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="save_userguide_models";
|
||||
tSend['data']=ModelAll;
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
return nTotal;
|
||||
}
|
||||
|
||||
|
||||
function ShowNotice( nShow )
|
||||
{
|
||||
if(nShow==0)
|
||||
{
|
||||
$("#NoticeMask").hide();
|
||||
$("#NoticeBody").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#NoticeMask").show();
|
||||
$("#NoticeBody").show();
|
||||
}
|
||||
}
|
||||
|
||||
function CancelSelect()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="user_guide_cancel";
|
||||
tSend['data']={};
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
|
||||
function ConfirmSelect()
|
||||
{
|
||||
let nChoose=OnExit();
|
||||
|
||||
if(nChoose>0)
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="user_guide_finish";
|
||||
tSend['data']={};
|
||||
tSend['data']['action']="finish";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
102
resources/web/guide/24/index.html
Normal file
102
resources/web/guide/24/index.html
Normal file
|
@ -0,0 +1,102 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<title>引导_P21</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="24.css" />
|
||||
<script type="text/javascript" src="test.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery-3.6.0.min.js"></script>
|
||||
<script type="text/javascript" src="../js/json2.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript" src="24.js"></script>
|
||||
</head>
|
||||
<body onLoad="OnInit()">
|
||||
<div id="Title">
|
||||
<div class="trans" tid="t10">Printer Selection</div>
|
||||
</div>
|
||||
<div id="Content">
|
||||
|
||||
<!--<div class="OneVendorBlock" Vendor="BBL">
|
||||
<div class="BlockBanner">
|
||||
<div class="BannerBtns">
|
||||
<div class="SmallBtn_Green" onClick="SelectPrinterAll('BBL')">所有</div>
|
||||
<div class="SmallBtn" onClick="SelectPrinterNone('BBL')">无</div>
|
||||
</div>
|
||||
|
||||
<a>BBL-3DP</a>
|
||||
</div>
|
||||
|
||||
<div class="PrinterArea">
|
||||
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p2.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input id="ZZ" type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.4" vendor="BBL" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.1" vendor="BBL" />0.1mm nozzle</div>
|
||||
</div>
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p1.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.4" vendor="BBL" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.2" vendor="BBL" />0.2mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.1" vendor="BBL" />0.1mm nozzle</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="OneVendorBlock" Vendor="BAMBU">
|
||||
<div class="BlockBanner">
|
||||
<div class="BannerBtns">
|
||||
<div class="Banner-Btn-green" onClick="SelectPrinterAll('BAMBU')">所有</div>
|
||||
<div class="Banner-Btn" onClick="SelectPrinterNone('BAMBU')">无</div>
|
||||
</div>
|
||||
|
||||
<a>BBL-3DP</a>
|
||||
</div>
|
||||
|
||||
<div class="PrinterArea">
|
||||
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p2.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.4" vendor="BAMBU" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V4NORMAL" nozzel="0.1" vendor="BAMBU" />0.1mm nozzle</div>
|
||||
</div>
|
||||
<div class="PrinterBlock">
|
||||
<div class="PImg"><img src="p1.jpg" /></div>
|
||||
<div class="PName">BBL-3DP-V4NORMAL</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.4" vendor="BAMBU" />0.4mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.2" vendor="BAMBU" />0.2mm nozzle</div>
|
||||
<div class="pNozzel"><input type="checkbox" model="BBL-3DP-V5NORMAL" nozzel="0.1" vendor="BAMBU" />0.1mm nozzle</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>-->
|
||||
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="NormalBtn trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div>
|
||||
<div class="GrayBtn trans" tid="t38" id="PreBtn" onclick="CancelSelect()">Cancel</div>
|
||||
</div>
|
||||
|
||||
<div id="NoticeMask"></div>
|
||||
<div id="NoticeBody">
|
||||
<div id="NoticeBar" class="trans" tid="t18">error</div>
|
||||
<div id="NoticeContent">
|
||||
<div id="NoticeText" class="trans" tid="t37">At least one printer must be selected.</div>
|
||||
<div id="NoticeBtns">
|
||||
<div class="SmallBtn trans" tid="t36" onClick="ShowNotice(0)">ok</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
40
resources/web/guide/3/3.css
Normal file
40
resources/web/guide/3/3.css
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
#PolicyTxt
|
||||
{
|
||||
background-color: #EBEBEB;
|
||||
padding: 12px;
|
||||
word-wrap:break-word;
|
||||
overflow-y: scroll;
|
||||
min-height: 200px;
|
||||
text-indent: 2em;
|
||||
}
|
||||
|
||||
#PolicyTxt::-webkit-scrollbar {/*滚动条整体样式*/
|
||||
width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
#PolicyTxt::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
-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;
|
||||
}
|
||||
|
||||
#PolicyTxt::-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;
|
||||
}
|
||||
|
||||
#C_List li
|
||||
{
|
||||
margin-left: 4em;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
text-indent:2em;
|
||||
margin-bottom: 2px;
|
||||
}
|
80
resources/web/guide/3/3.js
Normal file
80
resources/web/guide/3/3.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
|
||||
function OnInit()
|
||||
{
|
||||
TranslatePage();
|
||||
|
||||
SendPrivacySelect();
|
||||
}
|
||||
|
||||
|
||||
function SendPrivacySelect()
|
||||
{
|
||||
let nVal="refuse";
|
||||
if( $('#ChoosePrivacy').is(':checked') )
|
||||
nVal="agree";
|
||||
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="user_private_choice";
|
||||
tSend['data']={};
|
||||
tSend['data']['action']=nVal;
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
|
||||
function GotoNextPage()
|
||||
{
|
||||
RequestProfile();
|
||||
}
|
||||
|
||||
function RequestProfile()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="request_userguide_profile";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
function HandleStudio( pVal )
|
||||
{
|
||||
let strCmd=pVal['command'];
|
||||
//alert(strCmd);
|
||||
|
||||
if(strCmd=='response_userguide_profile')
|
||||
{
|
||||
HandleModelInfo(pVal['response']);
|
||||
}
|
||||
}
|
||||
|
||||
function HandleModelInfo( pVal )
|
||||
{
|
||||
let Modellist=pVal["model"];
|
||||
let nModel=Modellist.length;
|
||||
|
||||
if(nModel==1)
|
||||
{
|
||||
// let pModel=Modellist[0];
|
||||
//
|
||||
// var tSend={};
|
||||
// tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
// tSend['command']="save_userguide_models";
|
||||
// tSend['data']={};
|
||||
//
|
||||
// let ModelName=pModel['model'];
|
||||
//
|
||||
// tSend['data'][ModelName]={};
|
||||
// tSend['data'][ModelName]['model']=pModel['model'];
|
||||
// tSend['data'][ModelName]['nozzle_diameter']=pModel['nozzle_diameter'];
|
||||
// tSend['data'][ModelName]['vendor']=pModel['vendor'];
|
||||
//
|
||||
// SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
window.location.href="../22/index.html";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href="../21/index.html";
|
||||
}
|
38
resources/web/guide/3/index.html
Normal file
38
resources/web/guide/3/index.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<title>引导_P1</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="3.css" />
|
||||
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="../js/json2.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript" src="./3.js"></script>
|
||||
</head>
|
||||
<body onLoad="OnInit()">
|
||||
<div id="Title">
|
||||
<div class="trans" tid="t6">We kindly request your help to improve<br/> everyone's printing</div>
|
||||
</div>
|
||||
<div id="Content">
|
||||
<div id="PolicyTxt">
|
||||
<a class="trans" tid="t54">In the 3D Printing community, we learn from each other’s successes and failures to adjust our own slicing parameters and settings. Bambu Studio follows the same principle and uses machine learning to improve its performance from the successes and failures of the vast number of prints by our users. We are training Bambu Studio to be smarter by feeding them the real-world data. If you are willing, this service will access information from your error logs and usage logs, which may include information described in </a><a class="HyperLink trans" tid="t55" href="https://bambulab.com/policies/privacy" target="_blank">Privacy Policy</a><a class="trans" tid="t56">
|
||||
. We will not collect any Personal Data by which an individual can be identified directly or indirectly, including without limitation names, addresses, payment information, or phone numbers. By enabling this service, you agree to these terms and the statement about Privacy Policy.
|
||||
</a>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<input id="ChoosePrivacy" type="checkbox" checked onClick="SendPrivacySelect()" onChange="SendPrivacySelect()" />
|
||||
<span class="trans" tid="t7">Allow sending anonymous data</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="window.open('../11/index.html','_self')">Back</div>
|
||||
<div class="NormalBtn trans" tid="t9" id="AcceptBtn" onclick="GotoNextPage()">Next</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
resources/web/guide/5/5.css
Normal file
41
resources/web/guide/5/5.css
Normal file
|
@ -0,0 +1,41 @@
|
|||
#NoteText
|
||||
{
|
||||
border:0px solid #787878;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
height: 90%;
|
||||
color: #535353;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
margin: 10mm 30mm;
|
||||
}
|
||||
|
||||
#NoteText h
|
||||
{
|
||||
font-size:22px;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
#NoteText::-webkit-scrollbar {/*滚动条整体样式*/
|
||||
width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
#NoteText::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
|
||||
border-radius: 10px;
|
||||
-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;
|
||||
}
|
||||
|
||||
#NoteText::-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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
15
resources/web/guide/5/5.js
Normal file
15
resources/web/guide/5/5.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
|
||||
|
||||
|
||||
function FinishGuide()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="user_guide_finish";
|
||||
tSend['data']={};
|
||||
tSend['data']['action']="finish";
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
|
||||
//window.location.href="../6/index.html";
|
||||
}
|
65
resources/web/guide/5/index.html
Normal file
65
resources/web/guide/5/index.html
Normal file
|
@ -0,0 +1,65 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<title>引导_P1</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="5.css" />
|
||||
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="../js/json2.js"></script>
|
||||
<script type="text/javascript" src="../../data/text.js"></script>
|
||||
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||
<script type="text/javascript" src="../js/common.js"></script>
|
||||
<script type="text/javascript" src="5.js"></script>
|
||||
</head>
|
||||
<body onLoad="TranslatePage()">
|
||||
<div id="Title">
|
||||
<div class="trans" tid="t23">Release note</div>
|
||||
</div>
|
||||
<div id="Content">
|
||||
<div id="NoteText">
|
||||
<h>7.5.0</h>
|
||||
<p>更新日志:</p>
|
||||
<p>1.新增关联内容设置</p>
|
||||
<p>2.优化编辑器里的图片上传组件中的在线图片列表和后台默认上传组件中的图片库列表增加图片预览图标和链接;</p>
|
||||
<p>3.新增对国产达梦数据库的兼容</p>
|
||||
<p>4.新增免费模板metv75一套</p>
|
||||
<p>5.优化管理员内容权限控制</p>
|
||||
<p>6.优化编辑器里的图片上传组件中的在线图片列表和后台默认上传组件中的图片库列表增加图片预览图标和链接;</p>
|
||||
<p>7.优化数据备份与导入功能</p>
|
||||
<p>8.修复XSS漏洞</p>
|
||||
|
||||
<br/><br/>
|
||||
<h>7.4.0</h>
|
||||
<p>更新日志:</p>
|
||||
<p>1.新增关联内容设置</p>
|
||||
<p>2.优化编辑器里的图片上传组件中的在线图片列表和后台默认上传组件中的图片库列表增加图片预览图标和链接;</p>
|
||||
<p>3.新增对国产达梦数据库的兼容</p>
|
||||
<p>4.新增免费模板metv75一套</p>
|
||||
<p>5.优化管理员内容权限控制</p>
|
||||
<p>6.优化前台内容限控制</p>
|
||||
<p>7.优化数据备份与导入功能</p>
|
||||
<p>8.修复XSS漏洞</p>
|
||||
|
||||
<br/><br/>
|
||||
<h>7.3.0</h>
|
||||
<p>更新日志:</p>
|
||||
<p>1.新增关联内容设置</p>
|
||||
<p>2.优化编辑器里的图片上传组件中的在线图片列表和后台默认上传组件中的图片库列表增加图片预览图标和链接;</p>
|
||||
<p>3.新增对国产达梦数据库的兼容</p>
|
||||
<p>4.新增免费模板metv75一套</p>
|
||||
<p>5.优化管理员内容权限控制</p>
|
||||
<p>6.优化编辑器里的图片上传组件中的在线图片列表和后台默认上传组件中的图片库列表增加图片预览图标和链接;</p>
|
||||
<p>7.优化数据备份与导入功能</p>
|
||||
<p>8.修复XSS漏洞</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="window.history.back()">Back</div>
|
||||
<div class="NormalBtn trans" tid="t25" id="AcceptBtn" onclick="FinishGuide()">Finish</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
164
resources/web/guide/css/common.css
Normal file
164
resources/web/guide/css/common.css
Normal file
|
@ -0,0 +1,164 @@
|
|||
*
|
||||
{
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html
|
||||
{
|
||||
height:100%;
|
||||
background-color: #626262;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
height:100%;
|
||||
max-height: 660px;
|
||||
max-width: 820px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
/*----Three Part----*/
|
||||
body
|
||||
{
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
#Title
|
||||
{
|
||||
height: 12%;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
flex-direction:column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#Title div
|
||||
{
|
||||
font-size:28px;
|
||||
line-height: 28px;
|
||||
color: #00AE42;
|
||||
padding: 0px 10mm;
|
||||
}
|
||||
|
||||
|
||||
#Content
|
||||
{
|
||||
height: 76%;
|
||||
padding: 20px 40px;
|
||||
overflow-x: hidden;
|
||||
overflow-y:hidden;
|
||||
text-align: left;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
color: #464646;
|
||||
position: relative;
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#Content div
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
#AcceptArea
|
||||
{
|
||||
height:12%;
|
||||
padding: 0mm 10mm;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
justify-content:flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
/*--Btn--*/
|
||||
.NormalBtn
|
||||
{
|
||||
padding: 3mm 9mm;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
background-color: #00AE42;
|
||||
border-radius: 16px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.NormalBtn:hover
|
||||
{
|
||||
background-color:#009638;
|
||||
}
|
||||
|
||||
.GrayBtn
|
||||
{
|
||||
padding: 3mm 9mm;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
border: 1px solid #575757;
|
||||
border-radius: 18px;
|
||||
color: #575757;
|
||||
cursor: pointer;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.GrayBtn:hover
|
||||
{
|
||||
background-color:#E8E8E8;
|
||||
}
|
||||
|
||||
.SmallBtn
|
||||
{
|
||||
padding: 2px 4mm;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
background-color: #D9D9D9;
|
||||
border-radius: 6px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.SmallBtn:hover
|
||||
{
|
||||
background-color: #CCCCCC;
|
||||
}
|
||||
|
||||
|
||||
.SmallBtn_Green
|
||||
{
|
||||
padding: 2px 4mm;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
background-color: #00AE42;
|
||||
border-radius: 6px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.SmallBtn_Green:hover
|
||||
{
|
||||
background-color: #009638;
|
||||
}
|
||||
|
||||
/*---HyperLink---*/
|
||||
.HyperLink
|
||||
{
|
||||
color: #00AE42;
|
||||
text-decoration: underline;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
35
resources/web/guide/css/home.css
Normal file
35
resources/web/guide/css/home.css
Normal file
|
@ -0,0 +1,35 @@
|
|||
#FullArea
|
||||
{
|
||||
height:100%;
|
||||
}
|
||||
|
||||
|
||||
#LoadProgress
|
||||
{
|
||||
position:fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 3mm;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#PercentTip
|
||||
{
|
||||
width:70%;
|
||||
height: 100%;
|
||||
background-color: #335DFC;
|
||||
}
|
||||
|
||||
|
||||
#PageArea
|
||||
{
|
||||
width:100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#IEPage
|
||||
{
|
||||
height:100%;
|
||||
width: 100%;
|
||||
}
|
58
resources/web/guide/css/test.css
Normal file
58
resources/web/guide/css/test.css
Normal file
|
@ -0,0 +1,58 @@
|
|||
*
|
||||
{
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
html,body
|
||||
{
|
||||
height:100%;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#PageArea
|
||||
{
|
||||
height:100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.swiper {
|
||||
height: 100%;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
bottom: 35px;
|
||||
}
|
||||
|
||||
.swiper-slide {
|
||||
font-size: 18px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.swiper-slide iframe
|
||||
{
|
||||
width:100%;
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.CBtn
|
||||
{
|
||||
padding: 3mm 100m;
|
||||
background-color: #77EFF9;
|
||||
display: inline-block;
|
||||
height: 30px;
|
||||
width: 150px;
|
||||
text-align: center;
|
||||
z-index: 99;
|
||||
position: absolute;
|
||||
top:30px;
|
||||
}
|
20
resources/web/guide/index.html
Normal file
20
resources/web/guide/index.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<title>Slicer新手引导</title>
|
||||
<link rel="stylesheet" type="text/css" href="./css/common.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./css/home.css" />
|
||||
<script type="text/javascript" src="./js/jquery-2.1.1.min.js"></script>
|
||||
</head>
|
||||
<body onLoad="OnInit()">
|
||||
<div id="LoadProgress">
|
||||
<div id="PercentTip"></div>
|
||||
</div>
|
||||
|
||||
<div id="PageArea">
|
||||
<iframe id="IEPage" src="1/index.html"></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
0
resources/web/guide/js/common.js
Normal file
0
resources/web/guide/js/common.js
Normal file
279
resources/web/guide/js/globalapi.js
Normal file
279
resources/web/guide/js/globalapi.js
Normal file
|
@ -0,0 +1,279 @@
|
|||
|
||||
/*------------------ 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);
|
||||
}
|
||||
}
|
||||
|
12
resources/web/guide/js/home.js
Normal file
12
resources/web/guide/js/home.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
|
||||
|
||||
function NextSlide()
|
||||
{
|
||||
$('.swiper-button-next').click();
|
||||
}
|
||||
|
||||
function PreSlide()
|
||||
{
|
||||
$('.swiper-button-prev').click();
|
||||
}
|
4
resources/web/guide/js/jquery-2.1.1.min.js
vendored
Normal file
4
resources/web/guide/js/jquery-2.1.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
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');
|
||||
};
|
||||
}
|
||||
}());
|
20
resources/web/guide/swiper/LICENSE
Normal file
20
resources/web/guide/swiper/LICENSE
Normal file
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 Vladimir Kharlampidi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
11
resources/web/guide/swiper/README.md
Normal file
11
resources/web/guide/swiper/README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
Swiper
|
||||
==========
|
||||
|
||||
Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps.
|
||||
|
||||
Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the best experience and simplicity.
|
||||
|
||||
# Getting Started
|
||||
* [Getting Started Guide](https://swiperjs.com/get-started/)
|
||||
* [API](https://swiperjs.com/swiper-api/)
|
||||
* [Demos](https://swiperjs.com/demos/)
|
3
resources/web/guide/swiper/angular/angular/src/public-api.d.ts
vendored
Normal file
3
resources/web/guide/swiper/angular/angular/src/public-api.d.ts
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
export * from './swiper.module';
|
||||
export * from './swiper.component';
|
||||
export * from './swiper-slide.directive';
|
26
resources/web/guide/swiper/angular/angular/src/swiper-slide.directive.d.ts
vendored
Normal file
26
resources/web/guide/swiper/angular/angular/src/swiper-slide.directive.d.ts
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { TemplateRef } from '@angular/core';
|
||||
import * as i0 from "@angular/core";
|
||||
export declare class SwiperSlideDirective {
|
||||
template: TemplateRef<any>;
|
||||
virtualIndex: number;
|
||||
class: string;
|
||||
autoplayDelay: string | null;
|
||||
set zoom(val: boolean);
|
||||
get zoom(): boolean;
|
||||
private _zoom;
|
||||
slideIndex: number;
|
||||
get classNames(): string;
|
||||
set classNames(val: string);
|
||||
private _hasClass;
|
||||
slideData: {
|
||||
isActive: boolean;
|
||||
isPrev: boolean;
|
||||
isNext: boolean;
|
||||
isVisible: boolean;
|
||||
isDuplicate: boolean;
|
||||
};
|
||||
private _classNames;
|
||||
constructor(template: TemplateRef<any>);
|
||||
static ɵfac: i0.ɵɵFactoryDeclaration<SwiperSlideDirective, never>;
|
||||
static ɵdir: i0.ɵɵDirectiveDeclaration<SwiperSlideDirective, "ng-template[swiperSlide]", never, { "virtualIndex": "virtualIndex"; "class": "class"; "autoplayDelay": "data-swiper-autoplay"; "zoom": "zoom"; }, {}, never>;
|
||||
}
|
252
resources/web/guide/swiper/angular/angular/src/swiper.component.d.ts
vendored
Normal file
252
resources/web/guide/swiper/angular/angular/src/swiper.component.d.ts
vendored
Normal file
File diff suppressed because one or more lines are too long
9
resources/web/guide/swiper/angular/angular/src/swiper.module.d.ts
vendored
Normal file
9
resources/web/guide/swiper/angular/angular/src/swiper.module.d.ts
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
import * as i0 from "@angular/core";
|
||||
import * as i1 from "./swiper.component";
|
||||
import * as i2 from "./swiper-slide.directive";
|
||||
import * as i3 from "@angular/common";
|
||||
export declare class SwiperModule {
|
||||
static ɵfac: i0.ɵɵFactoryDeclaration<SwiperModule, never>;
|
||||
static ɵmod: i0.ɵɵNgModuleDeclaration<SwiperModule, [typeof i1.SwiperComponent, typeof i2.SwiperSlideDirective], [typeof i3.CommonModule], [typeof i1.SwiperComponent, typeof i2.SwiperSlideDirective]>;
|
||||
static ɵinj: i0.ɵɵInjectorDeclaration<SwiperModule>;
|
||||
}
|
6
resources/web/guide/swiper/angular/angular/src/utils/get-params.d.ts
vendored
Normal file
6
resources/web/guide/swiper/angular/angular/src/utils/get-params.d.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
export declare const allowedParams: string[];
|
||||
export declare function getParams(obj?: any): {
|
||||
params: any;
|
||||
passedParams: any;
|
||||
rest: any;
|
||||
};
|
1
resources/web/guide/swiper/angular/angular/src/utils/params-list.d.ts
vendored
Normal file
1
resources/web/guide/swiper/angular/angular/src/utils/params-list.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export declare const paramsList: string[];
|
6
resources/web/guide/swiper/angular/angular/src/utils/utils.d.ts
vendored
Normal file
6
resources/web/guide/swiper/angular/angular/src/utils/utils.d.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
export declare function isObject(o: any): boolean;
|
||||
export declare function isShowEl(val: any, obj: any, el: any): boolean;
|
||||
export declare function extend(target: any, src: any): void;
|
||||
export declare function coerceBooleanProperty(value: any): boolean;
|
||||
export declare const ignoreNgOnChanges: string[];
|
||||
export declare function setProperty(val: any, obj?: {}): {} | false;
|
1830
resources/web/guide/swiper/angular/bundles/swiper_angular.umd.js
Normal file
1830
resources/web/guide/swiper/angular/bundles/swiper_angular.umd.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
resources/web/guide/swiper/angular/esm2015/angular/src/public-api.js
vendored
Normal file
7
resources/web/guide/swiper/angular/esm2015/angular/src/public-api.js
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Public API Surface of angular
|
||||
*/
|
||||
export * from './swiper.module';
|
||||
export * from './swiper.component';
|
||||
export * from './swiper-slide.directive';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hbmd1bGFyL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsMEJBQTBCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIGFuZ3VsYXJcbiAqL1xuZXhwb3J0ICogZnJvbSAnLi9zd2lwZXIubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vc3dpcGVyLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL3N3aXBlci1zbGlkZS5kaXJlY3RpdmUnO1xuIl19
|
|
@ -0,0 +1,60 @@
|
|||
import { Directive, Input } from '@angular/core';
|
||||
import { coerceBooleanProperty } from './utils/utils';
|
||||
import * as i0 from "@angular/core";
|
||||
export class SwiperSlideDirective {
|
||||
constructor(template) {
|
||||
this.template = template;
|
||||
this.class = '';
|
||||
this.autoplayDelay = null;
|
||||
this.slideData = {
|
||||
isActive: false,
|
||||
isPrev: false,
|
||||
isNext: false,
|
||||
isVisible: false,
|
||||
isDuplicate: false,
|
||||
};
|
||||
}
|
||||
set zoom(val) {
|
||||
this._zoom = coerceBooleanProperty(val);
|
||||
}
|
||||
get zoom() {
|
||||
return this._zoom;
|
||||
}
|
||||
get classNames() {
|
||||
return this._classNames;
|
||||
}
|
||||
set classNames(val) {
|
||||
if (this._classNames === val) {
|
||||
return;
|
||||
}
|
||||
this._classNames = val;
|
||||
this.slideData = {
|
||||
isActive: this._hasClass(['swiper-slide-active', 'swiper-slide-duplicate-active']),
|
||||
isVisible: this._hasClass(['swiper-slide-visible']),
|
||||
isDuplicate: this._hasClass(['swiper-slide-duplicate']),
|
||||
isPrev: this._hasClass(['swiper-slide-prev', 'swiper-slide-duplicate-prev']),
|
||||
isNext: this._hasClass(['swiper-slide-next', 'swiper-slide-duplicate-next']),
|
||||
};
|
||||
}
|
||||
_hasClass(classNames) {
|
||||
return classNames.some((className) => this._classNames.indexOf(className) >= 0);
|
||||
}
|
||||
}
|
||||
SwiperSlideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.2", ngImport: i0, type: SwiperSlideDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
||||
SwiperSlideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.2", type: SwiperSlideDirective, selector: "ng-template[swiperSlide]", inputs: { virtualIndex: "virtualIndex", class: "class", autoplayDelay: ["data-swiper-autoplay", "autoplayDelay"], zoom: "zoom" }, ngImport: i0 });
|
||||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.2", ngImport: i0, type: SwiperSlideDirective, decorators: [{
|
||||
type: Directive,
|
||||
args: [{
|
||||
selector: 'ng-template[swiperSlide]',
|
||||
}]
|
||||
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { virtualIndex: [{
|
||||
type: Input
|
||||
}], class: [{
|
||||
type: Input
|
||||
}], autoplayDelay: [{
|
||||
type: Input,
|
||||
args: ['data-swiper-autoplay']
|
||||
}], zoom: [{
|
||||
type: Input
|
||||
}] } });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpcGVyLXNsaWRlLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hbmd1bGFyL3NyYy9zd2lwZXItc2xpZGUuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFlLE1BQU0sZUFBZSxDQUFDO0FBQzlELE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFJdEQsTUFBTSxPQUFPLG9CQUFvQjtJQTBDL0IsWUFBbUIsUUFBMEI7UUFBMUIsYUFBUSxHQUFSLFFBQVEsQ0FBa0I7UUF4Q3BDLFVBQUssR0FBVyxFQUFFLENBQUM7UUFDRyxrQkFBYSxHQUFrQixJQUFJLENBQUM7UUE4Qm5FLGNBQVMsR0FBRztZQUNWLFFBQVEsRUFBRSxLQUFLO1lBQ2YsTUFBTSxFQUFFLEtBQUs7WUFDYixNQUFNLEVBQUUsS0FBSztZQUNiLFNBQVMsRUFBRSxLQUFLO1lBQ2hCLFdBQVcsRUFBRSxLQUFLO1NBQ25CLENBQUM7SUFHOEMsQ0FBQztJQXRDakQsSUFDSSxJQUFJLENBQUMsR0FBWTtRQUNuQixJQUFJLENBQUMsS0FBSyxHQUFHLHFCQUFxQixDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQzFDLENBQUM7SUFDRCxJQUFJLElBQUk7UUFDTixPQUFPLElBQUksQ0FBQyxLQUFLLENBQUM7SUFDcEIsQ0FBQztJQUdELElBQUksVUFBVTtRQUNaLE9BQU8sSUFBSSxDQUFDLFdBQVcsQ0FBQztJQUMxQixDQUFDO0lBQ0QsSUFBSSxVQUFVLENBQUMsR0FBRztRQUNoQixJQUFJLElBQUksQ0FBQyxXQUFXLEtBQUssR0FBRyxFQUFFO1lBQzVCLE9BQU87U0FDUjtRQUNELElBQUksQ0FBQyxXQUFXLEdBQUcsR0FBRyxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxTQUFTLEdBQUc7WUFDZixRQUFRLEVBQUUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLHFCQUFxQixFQUFFLCtCQUErQixDQUFDLENBQUM7WUFDbEYsU0FBUyxFQUFFLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxzQkFBc0IsQ0FBQyxDQUFDO1lBQ25ELFdBQVcsRUFBRSxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUMsd0JBQXdCLENBQUMsQ0FBQztZQUN2RCxNQUFNLEVBQUUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLG1CQUFtQixFQUFFLDZCQUE2QixDQUFDLENBQUM7WUFDNUUsTUFBTSxFQUFFLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxtQkFBbUIsRUFBRSw2QkFBNkIsQ0FBQyxDQUFDO1NBQzdFLENBQUM7SUFDSixDQUFDO0lBRU8sU0FBUyxDQUFDLFVBQW9CO1FBQ3BDLE9BQU8sVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDLFNBQVMsRUFBRSxFQUFFLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7SUFDbEYsQ0FBQzs7aUhBaENVLG9CQUFvQjtxR0FBcEIsb0JBQW9COzJGQUFwQixvQkFBb0I7a0JBSGhDLFNBQVM7bUJBQUM7b0JBQ1QsUUFBUSxFQUFFLDBCQUEwQjtpQkFDckM7a0dBRVUsWUFBWTtzQkFBcEIsS0FBSztnQkFDRyxLQUFLO3NCQUFiLEtBQUs7Z0JBQ3lCLGFBQWE7c0JBQTNDLEtBQUs7dUJBQUMsc0JBQXNCO2dCQUV6QixJQUFJO3NCQURQLEtBQUsiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEaXJlY3RpdmUsIElucHV0LCBUZW1wbGF0ZVJlZiB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgY29lcmNlQm9vbGVhblByb3BlcnR5IH0gZnJvbSAnLi91dGlscy91dGlscyc7XG5ARGlyZWN0aXZlKHtcbiAgc2VsZWN0b3I6ICduZy10ZW1wbGF0ZVtzd2lwZXJTbGlkZV0nLFxufSlcbmV4cG9ydCBjbGFzcyBTd2lwZXJTbGlkZURpcmVjdGl2ZSB7XG4gIEBJbnB1dCgpIHZpcnR1YWxJbmRleDogbnVtYmVyO1xuICBASW5wdXQoKSBjbGFzczogc3RyaW5nID0gJyc7XG4gIEBJbnB1dCgnZGF0YS1zd2lwZXItYXV0b3BsYXknKSBhdXRvcGxheURlbGF5OiBzdHJpbmcgfCBudWxsID0gbnVsbDtcbiAgQElucHV0KClcbiAgc2V0IHpvb20odmFsOiBib29sZWFuKSB7XG4gICAgdGhpcy5fem9vbSA9IGNvZXJjZUJvb2xlYW5Qcm9wZXJ0eSh2YWwpO1xuICB9XG4gIGdldCB6b29tKCkge1xuICAgIHJldHVybiB0aGlzLl96b29tO1xuICB9XG4gIHByaXZhdGUgX3pvb206IGJvb2xlYW47XG4gIHNsaWRlSW5kZXg6IG51bWJlcjtcbiAgZ2V0IGNsYXNzTmFtZXMoKSB7XG4gICAgcmV0dXJuIHRoaXMuX2NsYXNzTmFtZXM7XG4gIH1cbiAgc2V0IGNsYXNzTmFtZXModmFsKSB7XG4gICAgaWYgKHRoaXMuX2NsYXNzTmFtZXMgPT09IHZhbCkge1xuICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICB0aGlzLl9jbGFzc05hbWVzID0gdmFsO1xuICAgIHRoaXMuc2xpZGVEYXRhID0ge1xuICAgICAgaXNBY3RpdmU6IHRoaXMuX2hhc0NsYXNzKFsnc3dpcGVyLXNsaWRlLWFjdGl2ZScsICdzd2lwZXItc2xpZGUtZHVwbGljYXRlLWFjdGl2ZSddKSxcbiAgICAgIGlzVmlzaWJsZTogdGhpcy5faGFzQ2xhc3MoWydzd2lwZXItc2xpZGUtdmlzaWJsZSddKSxcbiAgICAgIGlzRHVwbGljYXRlOiB0aGlzLl9oYXNDbGFzcyhbJ3N3aXBlci1zbGlkZS1kdXBsaWNhdGUnXSksXG4gICAgICBpc1ByZXY6IHRoaXMuX2hhc0NsYXNzKFsnc3dpcGVyLXNsaWRlLXByZXYnLCAnc3dpcGVyLXNsaWRlLWR1cGxpY2F0ZS1wcmV2J10pLFxuICAgICAgaXNOZXh0OiB0aGlzLl9oYXNDbGFzcyhbJ3N3aXBlci1zbGlkZS1uZXh0JywgJ3N3aXBlci1zbGlkZS1kdXBsaWNhdGUtbmV4dCddKSxcbiAgICB9O1xuICB9XG5cbiAgcHJpdmF0ZSBfaGFzQ2xhc3MoY2xhc3NOYW1lczogc3RyaW5nW10pIHtcbiAgICByZXR1cm4gY2xhc3NOYW1lcy5zb21lKChjbGFzc05hbWUpID0+IHRoaXMuX2NsYXNzTmFtZXMuaW5kZXhPZihjbGFzc05hbWUpID49IDApO1xuICB9XG4gIHNsaWRlRGF0YSA9IHtcbiAgICBpc0FjdGl2ZTogZmFsc2UsXG4gICAgaXNQcmV2OiBmYWxzZSxcbiAgICBpc05leHQ6IGZhbHNlLFxuICAgIGlzVmlzaWJsZTogZmFsc2UsXG4gICAgaXNEdXBsaWNhdGU6IGZhbHNlLFxuICB9O1xuXG4gIHByaXZhdGUgX2NsYXNzTmFtZXM6IHN0cmluZztcbiAgY29uc3RydWN0b3IocHVibGljIHRlbXBsYXRlOiBUZW1wbGF0ZVJlZjxhbnk+KSB7fVxufVxuIl19
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SwiperComponent } from './swiper.component';
|
||||
import { SwiperSlideDirective } from './swiper-slide.directive';
|
||||
import * as i0 from "@angular/core";
|
||||
export class SwiperModule {
|
||||
}
|
||||
SwiperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.2", ngImport: i0, type: SwiperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
||||
SwiperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.2", ngImport: i0, type: SwiperModule, declarations: [SwiperComponent, SwiperSlideDirective], imports: [CommonModule], exports: [SwiperComponent, SwiperSlideDirective] });
|
||||
SwiperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.2", ngImport: i0, type: SwiperModule, imports: [[CommonModule]] });
|
||||
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.2", ngImport: i0, type: SwiperModule, decorators: [{
|
||||
type: NgModule,
|
||||
args: [{
|
||||
declarations: [SwiperComponent, SwiperSlideDirective],
|
||||
exports: [SwiperComponent, SwiperSlideDirective],
|
||||
imports: [CommonModule],
|
||||
}]
|
||||
}] });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpcGVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hbmd1bGFyL3NyYy9zd2lwZXIubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNyRCxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQzs7QUFNaEUsTUFBTSxPQUFPLFlBQVk7O3lHQUFaLFlBQVk7MEdBQVosWUFBWSxpQkFKUixlQUFlLEVBQUUsb0JBQW9CLGFBRTFDLFlBQVksYUFEWixlQUFlLEVBQUUsb0JBQW9COzBHQUdwQyxZQUFZLFlBRmQsQ0FBQyxZQUFZLENBQUM7MkZBRVosWUFBWTtrQkFMeEIsUUFBUTttQkFBQztvQkFDUixZQUFZLEVBQUUsQ0FBQyxlQUFlLEVBQUUsb0JBQW9CLENBQUM7b0JBQ3JELE9BQU8sRUFBRSxDQUFDLGVBQWUsRUFBRSxvQkFBb0IsQ0FBQztvQkFDaEQsT0FBTyxFQUFFLENBQUMsWUFBWSxDQUFDO2lCQUN4QiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBDb21tb25Nb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuaW1wb3J0IHsgU3dpcGVyQ29tcG9uZW50IH0gZnJvbSAnLi9zd2lwZXIuY29tcG9uZW50JztcbmltcG9ydCB7IFN3aXBlclNsaWRlRGlyZWN0aXZlIH0gZnJvbSAnLi9zd2lwZXItc2xpZGUuZGlyZWN0aXZlJztcbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogW1N3aXBlckNvbXBvbmVudCwgU3dpcGVyU2xpZGVEaXJlY3RpdmVdLFxuICBleHBvcnRzOiBbU3dpcGVyQ29tcG9uZW50LCBTd2lwZXJTbGlkZURpcmVjdGl2ZV0sXG4gIGltcG9ydHM6IFtDb21tb25Nb2R1bGVdLFxufSlcbmV4cG9ydCBjbGFzcyBTd2lwZXJNb2R1bGUge31cbiJdfQ==
|
38
resources/web/guide/swiper/angular/esm2015/angular/src/utils/get-params.js
vendored
Normal file
38
resources/web/guide/swiper/angular/esm2015/angular/src/utils/get-params.js
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
// eslint-disable-next-line
|
||||
import { isObject, extend } from './utils';
|
||||
import { paramsList } from './params-list';
|
||||
// @ts-ignore
|
||||
import Swiper from 'swiper';
|
||||
export const allowedParams = paramsList.map((key) => key.replace(/_/, ''));
|
||||
export function getParams(obj = {}) {
|
||||
const params = {
|
||||
on: {},
|
||||
};
|
||||
const passedParams = {};
|
||||
extend(params, Swiper.defaults);
|
||||
extend(params, Swiper.extendedDefaults);
|
||||
params._emitClasses = true;
|
||||
const rest = {};
|
||||
Object.keys(obj).forEach((key) => {
|
||||
const _key = key.replace(/^_/, '');
|
||||
if (typeof obj[_key] === 'undefined')
|
||||
return;
|
||||
if (allowedParams.indexOf(_key) >= 0) {
|
||||
if (isObject(obj[_key])) {
|
||||
params[_key] = {};
|
||||
passedParams[_key] = {};
|
||||
extend(params[_key], obj[_key]);
|
||||
extend(passedParams[_key], obj[_key]);
|
||||
}
|
||||
else {
|
||||
params[_key] = obj[_key];
|
||||
passedParams[_key] = obj[_key];
|
||||
}
|
||||
}
|
||||
else {
|
||||
rest[_key] = obj[_key];
|
||||
}
|
||||
});
|
||||
return { params, passedParams, rest };
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXBhcmFtcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9hbmd1bGFyL3NyYy91dGlscy9nZXQtcGFyYW1zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDJCQUEyQjtBQUMzQixPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBRSxNQUFNLFNBQVMsQ0FBQztBQUMzQyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLGFBQWE7QUFDYixPQUFPLE1BQU0sTUFBTSxRQUFRLENBQUM7QUFFNUIsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRSxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDM0UsTUFBTSxVQUFVLFNBQVMsQ0FBQyxNQUFXLEVBQUU7SUFDckMsTUFBTSxNQUFNLEdBQVE7UUFDbEIsRUFBRSxFQUFFLEVBQUU7S0FDUCxDQUFDO0lBQ0YsTUFBTSxZQUFZLEdBQVEsRUFBRSxDQUFDO0lBQzdCLE1BQU0sQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDO0lBQ2hDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsTUFBTSxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFDeEMsTUFBTSxDQUFDLFlBQVksR0FBRyxJQUFJLENBQUM7SUFFM0IsTUFBTSxJQUFJLEdBQVEsRUFBRSxDQUFDO0lBQ3JCLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsR0FBVyxFQUFFLEVBQUU7UUFDdkMsTUFBTSxJQUFJLEdBQUcsR0FBRyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFDbkMsSUFBSSxPQUFPLEdBQUcsQ0FBQyxJQUFJLENBQUMsS0FBSyxXQUFXO1lBQUUsT0FBTztRQUM3QyxJQUFJLGFBQWEsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFO1lBQ3BDLElBQUksUUFBUSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFO2dCQUN2QixNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDO2dCQUNsQixZQUFZLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDO2dCQUN4QixNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxFQUFFLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO2dCQUNoQyxNQUFNLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxFQUFFLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO2FBQ3ZDO2lCQUFNO2dCQUNMLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7Z0JBQ3pCLFlBQVksQ0FBQyxJQUFJLENBQUMsR0FBRyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDaEM7U0FDRjthQUFNO1lBQ0wsSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQztTQUN4QjtJQUNILENBQUMsQ0FBQyxDQUFDO0lBRUgsT0FBTyxFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUUsSUFBSSxFQUFFLENBQUM7QUFDeEMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZVxuaW1wb3J0IHsgaXNPYmplY3QsIGV4dGVuZCB9IGZyb20gJy4vdXRpbHMnO1xuaW1wb3J0IHsgcGFyYW1zTGlzdCB9IGZyb20gJy4vcGFyYW1zLWxpc3QnO1xuLy8gQHRzLWlnbm9yZVxuaW1wb3J0IFN3aXBlciBmcm9tICdzd2lwZXInO1xuXG5leHBvcnQgY29uc3QgYWxsb3dlZFBhcmFtcyA9IHBhcmFtc0xpc3QubWFwKChrZXkpID0+IGtleS5yZXBsYWNlKC9fLywgJycpKTtcbmV4cG9ydCBmdW5jdGlvbiBnZXRQYXJhbXMob2JqOiBhbnkgPSB7fSkge1xuICBjb25zdCBwYXJhbXM6IGFueSA9IHtcbiAgICBvbjoge30sXG4gIH07XG4gIGNvbnN0IHBhc3NlZFBhcmFtczogYW55ID0ge307XG4gIGV4dGVuZChwYXJhbXMsIFN3aXBlci5kZWZhdWx0cyk7XG4gIGV4dGVuZChwYXJhbXMsIFN3aXBlci5leHRlbmRlZERlZmF1bHRzKTtcbiAgcGFyYW1zLl9lbWl0Q2xhc3NlcyA9IHRydWU7XG5cbiAgY29uc3QgcmVzdDogYW55ID0ge307XG4gIE9iamVjdC5rZXlzKG9iaikuZm9yRWFjaCgoa2V5OiBzdHJpbmcpID0+IHtcbiAgICBjb25zdCBfa2V5ID0ga2V5LnJlcGxhY2UoL15fLywgJycpO1xuICAgIGlmICh0eXBlb2Ygb2JqW19rZXldID09PSAndW5kZWZpbmVkJykgcmV0dXJuO1xuICAgIGlmIChhbGxvd2VkUGFyYW1zLmluZGV4T2YoX2tleSkgPj0gMCkge1xuICAgICAgaWYgKGlzT2JqZWN0KG9ialtfa2V5XSkpIHtcbiAgICAgICAgcGFyYW1zW19rZXldID0ge307XG4gICAgICAgIHBhc3NlZFBhcmFtc1tfa2V5XSA9IHt9O1xuICAgICAgICBleHRlbmQocGFyYW1zW19rZXldLCBvYmpbX2tleV0pO1xuICAgICAgICBleHRlbmQocGFzc2VkUGFyYW1zW19rZXldLCBvYmpbX2tleV0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcGFyYW1zW19rZXldID0gb2JqW19rZXldO1xuICAgICAgICBwYXNzZWRQYXJhbXNbX2tleV0gPSBvYmpbX2tleV07XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3RbX2tleV0gPSBvYmpbX2tleV07XG4gICAgfVxuICB9KTtcblxuICByZXR1cm4geyBwYXJhbXMsIHBhc3NlZFBhcmFtcywgcmVzdCB9O1xufVxuIl19
|
115
resources/web/guide/swiper/angular/esm2015/angular/src/utils/params-list.js
vendored
Normal file
115
resources/web/guide/swiper/angular/esm2015/angular/src/utils/params-list.js
vendored
Normal file
File diff suppressed because one or more lines are too long
49
resources/web/guide/swiper/angular/esm2015/angular/src/utils/utils.js
vendored
Normal file
49
resources/web/guide/swiper/angular/esm2015/angular/src/utils/utils.js
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
export function isObject(o) {
|
||||
return (typeof o === 'object' &&
|
||||
o !== null &&
|
||||
o.constructor &&
|
||||
Object.prototype.toString.call(o).slice(8, -1) === 'Object');
|
||||
}
|
||||
export function isShowEl(val, obj, el) {
|
||||
return ((coerceBooleanProperty(val) === true && obj && !obj.el) ||
|
||||
!(typeof obj !== 'boolean' &&
|
||||
obj.el !== (el === null || el === void 0 ? void 0 : el.nativeElement) &&
|
||||
(typeof obj.el === 'string' || typeof obj.el === 'object')));
|
||||
}
|
||||
export function extend(target, src) {
|
||||
const noExtend = ['__proto__', 'constructor', 'prototype'];
|
||||
Object.keys(src)
|
||||
.filter((key) => noExtend.indexOf(key) < 0)
|
||||
.forEach((key) => {
|
||||
if (typeof target[key] === 'undefined') {
|
||||
target[key] = src[key];
|
||||
return;
|
||||
}
|
||||
if (target[key] && !src[key]) {
|
||||
return;
|
||||
}
|
||||
if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {
|
||||
if (src[key].__swiper__)
|
||||
target[key] = src[key];
|
||||
else
|
||||
extend(target[key], src[key]);
|
||||
}
|
||||
else {
|
||||
target[key] = src[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
export function coerceBooleanProperty(value) {
|
||||
return value != null && `${value}` !== 'false';
|
||||
}
|
||||
export const ignoreNgOnChanges = ['pagination', 'navigation', 'scrollbar', 'virtual'];
|
||||
export function setProperty(val, obj = {}) {
|
||||
if (isObject(val)) {
|
||||
return val;
|
||||
}
|
||||
if (coerceBooleanProperty(val) === true) {
|
||||
return obj;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYW5ndWxhci9zcmMvdXRpbHMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxVQUFVLFFBQVEsQ0FBQyxDQUFNO0lBQzdCLE9BQU8sQ0FDTCxPQUFPLENBQUMsS0FBSyxRQUFRO1FBQ3JCLENBQUMsS0FBSyxJQUFJO1FBQ1YsQ0FBQyxDQUFDLFdBQVc7UUFDYixNQUFNLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxLQUFLLFFBQVEsQ0FDNUQsQ0FBQztBQUNKLENBQUM7QUFFRCxNQUFNLFVBQVUsUUFBUSxDQUFDLEdBQVEsRUFBRSxHQUFRLEVBQUUsRUFBTztJQUNsRCxPQUFPLENBQ0wsQ0FBQyxxQkFBcUIsQ0FBQyxHQUFHLENBQUMsS0FBSyxJQUFJLElBQUksR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQztRQUN2RCxDQUFDLENBQ0MsT0FBTyxHQUFHLEtBQUssU0FBUztZQUN4QixHQUFHLENBQUMsRUFBRSxNQUFLLEVBQUUsYUFBRixFQUFFLHVCQUFGLEVBQUUsQ0FBRSxhQUFhLENBQUE7WUFDNUIsQ0FBQyxPQUFPLEdBQUcsQ0FBQyxFQUFFLEtBQUssUUFBUSxJQUFJLE9BQU8sR0FBRyxDQUFDLEVBQUUsS0FBSyxRQUFRLENBQUMsQ0FDM0QsQ0FDRixDQUFDO0FBQ0osQ0FBQztBQUVELE1BQU0sVUFBVSxNQUFNLENBQUMsTUFBVyxFQUFFLEdBQVE7SUFDMUMsTUFBTSxRQUFRLEdBQUcsQ0FBQyxXQUFXLEVBQUUsYUFBYSxFQUFFLFdBQVcsQ0FBQyxDQUFDO0lBQzNELE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDO1NBQ2IsTUFBTSxDQUFDLENBQUMsR0FBRyxFQUFFLEVBQUUsQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQztTQUMxQyxPQUFPLENBQUMsQ0FBQyxHQUFHLEVBQUUsRUFBRTtRQUNmLElBQUksT0FBTyxNQUFNLENBQUMsR0FBRyxDQUFDLEtBQUssV0FBVyxFQUFFO1lBQ3RDLE1BQU0sQ0FBQyxHQUFHLENBQUMsR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUM7WUFDdkIsT0FBTztTQUNSO1FBQ0QsSUFBSSxNQUFNLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDNUIsT0FBTztTQUNSO1FBQ0QsSUFBSSxRQUFRLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksUUFBUSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxJQUFJLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRTtZQUNuRixJQUFJLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQyxVQUFVO2dCQUFFLE1BQU0sQ0FBQyxHQUFHLENBQUMsR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUM7O2dCQUMzQyxNQUFNLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO1NBQ3BDO2FBQU07WUFDTCxNQUFNLENBQUMsR0FBRyxDQUFDLEdBQUcsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1NBQ3hCO0lBQ0gsQ0FBQyxDQUFDLENBQUM7QUFDUCxDQUFDO0FBRUQsTUFBTSxVQUFVLHFCQUFxQixDQUFDLEtBQVU7SUFDOUMsT0FBTyxLQUFLLElBQUksSUFBSSxJQUFJLEdBQUcsS0FBSyxFQUFFLEtBQUssT0FBTyxDQUFDO0FBQ2pELENBQUM7QUFFRCxNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FBRyxDQUFDLFlBQVksRUFBRSxZQUFZLEVBQUUsV0FBVyxFQUFFLFNBQVMsQ0FBQyxDQUFDO0FBRXRGLE1BQU0sVUFBVSxXQUFXLENBQUMsR0FBUSxFQUFFLEdBQUcsR0FBRyxFQUFFO0lBQzVDLElBQUksUUFBUSxDQUFDLEdBQUcsQ0FBQyxFQUFFO1FBQ2pCLE9BQU8sR0FBRyxDQUFDO0tBQ1o7SUFFRCxJQUFJLHFCQUFxQixDQUFDLEdBQUcsQ0FBQyxLQUFLLElBQUksRUFBRTtRQUN2QyxPQUFPLEdBQUcsQ0FBQztLQUNaO0lBRUQsT0FBTyxLQUFLLENBQUM7QUFDZixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGlzT2JqZWN0KG86IGFueSk6IGJvb2xlYW4ge1xuICByZXR1cm4gKFxuICAgIHR5cGVvZiBvID09PSAnb2JqZWN0JyAmJlxuICAgIG8gIT09IG51bGwgJiZcbiAgICBvLmNvbnN0cnVjdG9yICYmXG4gICAgT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKG8pLnNsaWNlKDgsIC0xKSA9PT0gJ09iamVjdCdcbiAgKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzU2hvd0VsKHZhbDogYW55LCBvYmo6IGFueSwgZWw6IGFueSk6IGJvb2xlYW4ge1xuICByZXR1cm4gKFxuICAgIChjb2VyY2VCb29sZWFuUHJvcGVydHkodmFsKSA9PT0gdHJ1ZSAmJiBvYmogJiYgIW9iai5lbCkgfHxcbiAgICAhKFxuICAgICAgdHlwZW9mIG9iaiAhPT0gJ2Jvb2xlYW4nICYmXG4gICAgICBvYmouZWwgIT09IGVsPy5uYXRpdmVFbGVtZW50ICYmXG4gICAgICAodHlwZW9mIG9iai5lbCA9PT0gJ3N0cmluZycgfHwgdHlwZW9mIG9iai5lbCA9PT0gJ29iamVjdCcpXG4gICAgKVxuICApO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZXh0ZW5kKHRhcmdldDogYW55LCBzcmM6IGFueSkge1xuICBjb25zdCBub0V4dGVuZCA9IFsnX19wcm90b19fJywgJ2NvbnN0cnVjdG9yJywgJ3Byb3RvdHlwZSddO1xuICBPYmplY3Qua2V5cyhzcmMpXG4gICAgLmZpbHRlcigoa2V5KSA9PiBub0V4dGVuZC5pbmRleE9mKGtleSkgPCAwKVxuICAgIC5mb3JFYWNoKChrZXkpID0+IHtcbiAgICAgIGlmICh0eXBlb2YgdGFyZ2V0W2tleV0gPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHRhcmdldFtrZXldID0gc3JjW2tleV07XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGlmICh0YXJnZXRba2V5XSAmJiAhc3JjW2tleV0pIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgaWYgKGlzT2JqZWN0KHNyY1trZXldKSAmJiBpc09iamVjdCh0YXJnZXRba2V5XSkgJiYgT2JqZWN0LmtleXMoc3JjW2tleV0pLmxlbmd0aCA+IDApIHtcbiAgICAgICAgaWYgKHNyY1trZXldLl9fc3dpcGVyX18pIHRhcmdldFtrZXldID0gc3JjW2tleV07XG4gICAgICAgIGVsc2UgZXh0ZW5kKHRhcmdldFtrZXldLCBzcmNba2V5XSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0YXJnZXRba2V5XSA9IHNyY1trZXldO1xuICAgICAgfVxuICAgIH0pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gY29lcmNlQm9vbGVhblByb3BlcnR5KHZhbHVlOiBhbnkpOiBib29sZWFuIHtcbiAgcmV0dXJuIHZhbHVlICE9IG51bGwgJiYgYCR7dmFsdWV9YCAhPT0gJ2ZhbHNlJztcbn1cblxuZXhwb3J0IGNvbnN0IGlnbm9yZU5nT25DaGFuZ2VzID0gWydwYWdpbmF0aW9uJywgJ25hdmlnYXRpb24nLCAnc2Nyb2xsYmFyJywgJ3ZpcnR1YWwnXTtcblxuZXhwb3J0IGZ1bmN0aW9uIHNldFByb3BlcnR5KHZhbDogYW55LCBvYmogPSB7fSk6IHt9IHwgZmFsc2Uge1xuICBpZiAoaXNPYmplY3QodmFsKSkge1xuICAgIHJldHVybiB2YWw7XG4gIH1cblxuICBpZiAoY29lcmNlQm9vbGVhblByb3BlcnR5KHZhbCkgPT09IHRydWUpIHtcbiAgICByZXR1cm4gb2JqO1xuICB9XG5cbiAgcmV0dXJuIGZhbHNlO1xufVxuIl19
|
2
resources/web/guide/swiper/angular/esm2015/swiper-angular.js
vendored
Normal file
2
resources/web/guide/swiper/angular/esm2015/swiper-angular.js
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
export * from './angular/src/public-api';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpcGVyLWFuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3dpcGVyLWFuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYywwQkFBMEIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vYW5ndWxhci9zcmMvcHVibGljLWFwaSc7XG4iXX0=
|
5
resources/web/guide/swiper/angular/esm2015/swiper_angular.js
vendored
Normal file
5
resources/web/guide/swiper/angular/esm2015/swiper_angular.js
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* Generated bundle index. Do not edit.
|
||||
*/
|
||||
export * from './swiper-angular';
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpcGVyX2FuZ3VsYXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3dpcGVyX2FuZ3VsYXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGtCQUFrQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3N3aXBlci1hbmd1bGFyJztcbiJdfQ==
|
1402
resources/web/guide/swiper/angular/fesm2015/swiper_angular.js
vendored
Normal file
1402
resources/web/guide/swiper/angular/fesm2015/swiper_angular.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
19
resources/web/guide/swiper/angular/package.json
Normal file
19
resources/web/guide/swiper/angular/package.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "swiper_angular",
|
||||
"version": "0.0.1",
|
||||
"private": "true",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^12.2.0",
|
||||
"@angular/core": "^12.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"main": "bundles/swiper_angular.umd.js",
|
||||
"module": "fesm2015/swiper_angular.js",
|
||||
"es2015": "fesm2015/swiper_angular.js",
|
||||
"esm2015": "esm2015/swiper_angular.js",
|
||||
"fesm2015": "fesm2015/swiper_angular.js",
|
||||
"typings": "swiper_angular.d.ts",
|
||||
"sideEffects": false
|
||||
}
|
1
resources/web/guide/swiper/angular/swiper-angular.d.ts
vendored
Normal file
1
resources/web/guide/swiper/angular/swiper-angular.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export * from './angular/src/public-api';
|
5
resources/web/guide/swiper/angular/swiper_angular.d.ts
vendored
Normal file
5
resources/web/guide/swiper/angular/swiper_angular.d.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* Generated bundle index. Do not edit.
|
||||
*/
|
||||
/// <amd-module name="swiper_angular" />
|
||||
export * from './swiper-angular';
|
40
resources/web/guide/swiper/core/breakpoints/getBreakpoint.js
Normal file
40
resources/web/guide/swiper/core/breakpoints/getBreakpoint.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
import { getWindow } from 'ssr-window';
|
||||
export default function getBreakpoint(breakpoints, base = 'window', containerEl) {
|
||||
if (!breakpoints || base === 'container' && !containerEl) return undefined;
|
||||
let breakpoint = false;
|
||||
const window = getWindow();
|
||||
const currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;
|
||||
const points = Object.keys(breakpoints).map(point => {
|
||||
if (typeof point === 'string' && point.indexOf('@') === 0) {
|
||||
const minRatio = parseFloat(point.substr(1));
|
||||
const value = currentHeight * minRatio;
|
||||
return {
|
||||
value,
|
||||
point
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
value: point,
|
||||
point
|
||||
};
|
||||
});
|
||||
points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
|
||||
|
||||
for (let i = 0; i < points.length; i += 1) {
|
||||
const {
|
||||
point,
|
||||
value
|
||||
} = points[i];
|
||||
|
||||
if (base === 'window') {
|
||||
if (window.matchMedia(`(min-width: ${value}px)`).matches) {
|
||||
breakpoint = point;
|
||||
}
|
||||
} else if (value <= containerEl.clientWidth) {
|
||||
breakpoint = point;
|
||||
}
|
||||
}
|
||||
|
||||
return breakpoint || 'max';
|
||||
}
|
6
resources/web/guide/swiper/core/breakpoints/index.js
Normal file
6
resources/web/guide/swiper/core/breakpoints/index.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import setBreakpoint from './setBreakpoint.js';
|
||||
import getBreakpoint from './getBreakpoint.js';
|
||||
export default {
|
||||
setBreakpoint,
|
||||
getBreakpoint
|
||||
};
|
72
resources/web/guide/swiper/core/breakpoints/setBreakpoint.js
Normal file
72
resources/web/guide/swiper/core/breakpoints/setBreakpoint.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
import { extend } from '../../shared/utils.js';
|
||||
|
||||
const isGridEnabled = (swiper, params) => {
|
||||
return swiper.grid && params.grid && params.grid.rows > 1;
|
||||
};
|
||||
|
||||
export default function setBreakpoint() {
|
||||
const swiper = this;
|
||||
const {
|
||||
activeIndex,
|
||||
initialized,
|
||||
loopedSlides = 0,
|
||||
params,
|
||||
$el
|
||||
} = swiper;
|
||||
const breakpoints = params.breakpoints;
|
||||
if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters
|
||||
|
||||
const breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);
|
||||
if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
|
||||
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
||||
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
||||
const wasMultiRow = isGridEnabled(swiper, params);
|
||||
const isMultiRow = isGridEnabled(swiper, breakpointParams);
|
||||
const wasEnabled = params.enabled;
|
||||
|
||||
if (wasMultiRow && !isMultiRow) {
|
||||
$el.removeClass(`${params.containerModifierClass}grid ${params.containerModifierClass}grid-column`);
|
||||
swiper.emitContainerClasses();
|
||||
} else if (!wasMultiRow && isMultiRow) {
|
||||
$el.addClass(`${params.containerModifierClass}grid`);
|
||||
|
||||
if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') {
|
||||
$el.addClass(`${params.containerModifierClass}grid-column`);
|
||||
}
|
||||
|
||||
swiper.emitContainerClasses();
|
||||
}
|
||||
|
||||
const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
|
||||
const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
|
||||
|
||||
if (directionChanged && initialized) {
|
||||
swiper.changeDirection();
|
||||
}
|
||||
|
||||
extend(swiper.params, breakpointParams);
|
||||
const isEnabled = swiper.params.enabled;
|
||||
Object.assign(swiper, {
|
||||
allowTouchMove: swiper.params.allowTouchMove,
|
||||
allowSlideNext: swiper.params.allowSlideNext,
|
||||
allowSlidePrev: swiper.params.allowSlidePrev
|
||||
});
|
||||
|
||||
if (wasEnabled && !isEnabled) {
|
||||
swiper.disable();
|
||||
} else if (!wasEnabled && isEnabled) {
|
||||
swiper.enable();
|
||||
}
|
||||
|
||||
swiper.currentBreakpoint = breakpoint;
|
||||
swiper.emit('_beforeBreakpoint', breakpointParams);
|
||||
|
||||
if (needsReLoop && initialized) {
|
||||
swiper.loopDestroy();
|
||||
swiper.loopCreate();
|
||||
swiper.updateSlides();
|
||||
swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false);
|
||||
}
|
||||
|
||||
swiper.emit('breakpoint', breakpointParams);
|
||||
}
|
38
resources/web/guide/swiper/core/check-overflow/index.js
Normal file
38
resources/web/guide/swiper/core/check-overflow/index.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
function checkOverflow() {
|
||||
const swiper = this;
|
||||
const {
|
||||
isLocked: wasLocked,
|
||||
params
|
||||
} = swiper;
|
||||
const {
|
||||
slidesOffsetBefore
|
||||
} = params;
|
||||
|
||||
if (slidesOffsetBefore) {
|
||||
const lastSlideIndex = swiper.slides.length - 1;
|
||||
const lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2;
|
||||
swiper.isLocked = swiper.size > lastSlideRightEdge;
|
||||
} else {
|
||||
swiper.isLocked = swiper.snapGrid.length === 1;
|
||||
}
|
||||
|
||||
if (params.allowSlideNext === true) {
|
||||
swiper.allowSlideNext = !swiper.isLocked;
|
||||
}
|
||||
|
||||
if (params.allowSlidePrev === true) {
|
||||
swiper.allowSlidePrev = !swiper.isLocked;
|
||||
}
|
||||
|
||||
if (wasLocked && wasLocked !== swiper.isLocked) {
|
||||
swiper.isEnd = false;
|
||||
}
|
||||
|
||||
if (wasLocked !== swiper.isLocked) {
|
||||
swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
checkOverflow
|
||||
};
|
52
resources/web/guide/swiper/core/classes/addClasses.js
Normal file
52
resources/web/guide/swiper/core/classes/addClasses.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
function prepareClasses(entries, prefix) {
|
||||
const resultClasses = [];
|
||||
entries.forEach(item => {
|
||||
if (typeof item === 'object') {
|
||||
Object.keys(item).forEach(classNames => {
|
||||
if (item[classNames]) {
|
||||
resultClasses.push(prefix + classNames);
|
||||
}
|
||||
});
|
||||
} else if (typeof item === 'string') {
|
||||
resultClasses.push(prefix + item);
|
||||
}
|
||||
});
|
||||
return resultClasses;
|
||||
}
|
||||
|
||||
export default function addClasses() {
|
||||
const swiper = this;
|
||||
const {
|
||||
classNames,
|
||||
params,
|
||||
rtl,
|
||||
$el,
|
||||
device,
|
||||
support
|
||||
} = swiper; // prettier-ignore
|
||||
|
||||
const suffixes = prepareClasses(['initialized', params.direction, {
|
||||
'pointer-events': !support.touch
|
||||
}, {
|
||||
'free-mode': swiper.params.freeMode && params.freeMode.enabled
|
||||
}, {
|
||||
'autoheight': params.autoHeight
|
||||
}, {
|
||||
'rtl': rtl
|
||||
}, {
|
||||
'grid': params.grid && params.grid.rows > 1
|
||||
}, {
|
||||
'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column'
|
||||
}, {
|
||||
'android': device.android
|
||||
}, {
|
||||
'ios': device.ios
|
||||
}, {
|
||||
'css-mode': params.cssMode
|
||||
}, {
|
||||
'centered': params.cssMode && params.centeredSlides
|
||||
}], params.containerModifierClass);
|
||||
classNames.push(...suffixes);
|
||||
$el.addClass([...classNames].join(' '));
|
||||
swiper.emitContainerClasses();
|
||||
}
|
6
resources/web/guide/swiper/core/classes/index.js
Normal file
6
resources/web/guide/swiper/core/classes/index.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import addClasses from './addClasses.js';
|
||||
import removeClasses from './removeClasses.js';
|
||||
export default {
|
||||
addClasses,
|
||||
removeClasses
|
||||
};
|
9
resources/web/guide/swiper/core/classes/removeClasses.js
Normal file
9
resources/web/guide/swiper/core/classes/removeClasses.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
export default function removeClasses() {
|
||||
const swiper = this;
|
||||
const {
|
||||
$el,
|
||||
classNames
|
||||
} = swiper;
|
||||
$el.removeClass(classNames.join(' '));
|
||||
swiper.emitContainerClasses();
|
||||
}
|
610
resources/web/guide/swiper/core/core.js
Normal file
610
resources/web/guide/swiper/core/core.js
Normal file
|
@ -0,0 +1,610 @@
|
|||
/* eslint no-param-reassign: "off" */
|
||||
import { getDocument } from 'ssr-window';
|
||||
import $ from '../shared/dom.js';
|
||||
import { extend, now, deleteProps } from '../shared/utils.js';
|
||||
import { getSupport } from '../shared/get-support.js';
|
||||
import { getDevice } from '../shared/get-device.js';
|
||||
import { getBrowser } from '../shared/get-browser.js';
|
||||
import Resize from './modules/resize/resize.js';
|
||||
import Observer from './modules/observer/observer.js';
|
||||
import eventsEmitter from './events-emitter.js';
|
||||
import update from './update/index.js';
|
||||
import translate from './translate/index.js';
|
||||
import transition from './transition/index.js';
|
||||
import slide from './slide/index.js';
|
||||
import loop from './loop/index.js';
|
||||
import grabCursor from './grab-cursor/index.js';
|
||||
import events from './events/index.js';
|
||||
import breakpoints from './breakpoints/index.js';
|
||||
import classes from './classes/index.js';
|
||||
import images from './images/index.js';
|
||||
import checkOverflow from './check-overflow/index.js';
|
||||
import defaults from './defaults.js';
|
||||
import moduleExtendParams from './moduleExtendParams.js';
|
||||
const prototypes = {
|
||||
eventsEmitter,
|
||||
update,
|
||||
translate,
|
||||
transition,
|
||||
slide,
|
||||
loop,
|
||||
grabCursor,
|
||||
events,
|
||||
breakpoints,
|
||||
checkOverflow,
|
||||
classes,
|
||||
images
|
||||
};
|
||||
const extendedDefaults = {};
|
||||
|
||||
class Swiper {
|
||||
constructor(...args) {
|
||||
let el;
|
||||
let params;
|
||||
|
||||
if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {
|
||||
params = args[0];
|
||||
} else {
|
||||
[el, params] = args;
|
||||
}
|
||||
|
||||
if (!params) params = {};
|
||||
params = extend({}, params);
|
||||
if (el && !params.el) params.el = el;
|
||||
|
||||
if (params.el && $(params.el).length > 1) {
|
||||
const swipers = [];
|
||||
$(params.el).each(containerEl => {
|
||||
const newParams = extend({}, params, {
|
||||
el: containerEl
|
||||
});
|
||||
swipers.push(new Swiper(newParams));
|
||||
});
|
||||
return swipers;
|
||||
} // Swiper Instance
|
||||
|
||||
|
||||
const swiper = this;
|
||||
swiper.__swiper__ = true;
|
||||
swiper.support = getSupport();
|
||||
swiper.device = getDevice({
|
||||
userAgent: params.userAgent
|
||||
});
|
||||
swiper.browser = getBrowser();
|
||||
swiper.eventsListeners = {};
|
||||
swiper.eventsAnyListeners = [];
|
||||
swiper.modules = [...swiper.__modules__];
|
||||
|
||||
if (params.modules && Array.isArray(params.modules)) {
|
||||
swiper.modules.push(...params.modules);
|
||||
}
|
||||
|
||||
const allModulesParams = {};
|
||||
swiper.modules.forEach(mod => {
|
||||
mod({
|
||||
swiper,
|
||||
extendParams: moduleExtendParams(params, allModulesParams),
|
||||
on: swiper.on.bind(swiper),
|
||||
once: swiper.once.bind(swiper),
|
||||
off: swiper.off.bind(swiper),
|
||||
emit: swiper.emit.bind(swiper)
|
||||
});
|
||||
}); // Extend defaults with modules params
|
||||
|
||||
const swiperParams = extend({}, defaults, allModulesParams); // Extend defaults with passed params
|
||||
|
||||
swiper.params = extend({}, swiperParams, extendedDefaults, params);
|
||||
swiper.originalParams = extend({}, swiper.params);
|
||||
swiper.passedParams = extend({}, params); // add event listeners
|
||||
|
||||
if (swiper.params && swiper.params.on) {
|
||||
Object.keys(swiper.params.on).forEach(eventName => {
|
||||
swiper.on(eventName, swiper.params.on[eventName]);
|
||||
});
|
||||
}
|
||||
|
||||
if (swiper.params && swiper.params.onAny) {
|
||||
swiper.onAny(swiper.params.onAny);
|
||||
} // Save Dom lib
|
||||
|
||||
|
||||
swiper.$ = $; // Extend Swiper
|
||||
|
||||
Object.assign(swiper, {
|
||||
enabled: swiper.params.enabled,
|
||||
el,
|
||||
// Classes
|
||||
classNames: [],
|
||||
// Slides
|
||||
slides: $(),
|
||||
slidesGrid: [],
|
||||
snapGrid: [],
|
||||
slidesSizesGrid: [],
|
||||
|
||||
// isDirection
|
||||
isHorizontal() {
|
||||
return swiper.params.direction === 'horizontal';
|
||||
},
|
||||
|
||||
isVertical() {
|
||||
return swiper.params.direction === 'vertical';
|
||||
},
|
||||
|
||||
// Indexes
|
||||
activeIndex: 0,
|
||||
realIndex: 0,
|
||||
//
|
||||
isBeginning: true,
|
||||
isEnd: false,
|
||||
// Props
|
||||
translate: 0,
|
||||
previousTranslate: 0,
|
||||
progress: 0,
|
||||
velocity: 0,
|
||||
animating: false,
|
||||
// Locks
|
||||
allowSlideNext: swiper.params.allowSlideNext,
|
||||
allowSlidePrev: swiper.params.allowSlidePrev,
|
||||
// Touch Events
|
||||
touchEvents: function touchEvents() {
|
||||
const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
|
||||
const desktop = ['pointerdown', 'pointermove', 'pointerup'];
|
||||
swiper.touchEventsTouch = {
|
||||
start: touch[0],
|
||||
move: touch[1],
|
||||
end: touch[2],
|
||||
cancel: touch[3]
|
||||
};
|
||||
swiper.touchEventsDesktop = {
|
||||
start: desktop[0],
|
||||
move: desktop[1],
|
||||
end: desktop[2]
|
||||
};
|
||||
return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
|
||||
}(),
|
||||
touchEventsData: {
|
||||
isTouched: undefined,
|
||||
isMoved: undefined,
|
||||
allowTouchCallbacks: undefined,
|
||||
touchStartTime: undefined,
|
||||
isScrolling: undefined,
|
||||
currentTranslate: undefined,
|
||||
startTranslate: undefined,
|
||||
allowThresholdMove: undefined,
|
||||
// Form elements to match
|
||||
focusableElements: swiper.params.focusableElements,
|
||||
// Last click time
|
||||
lastClickTime: now(),
|
||||
clickTimeout: undefined,
|
||||
// Velocities
|
||||
velocities: [],
|
||||
allowMomentumBounce: undefined,
|
||||
isTouchEvent: undefined,
|
||||
startMoving: undefined
|
||||
},
|
||||
// Clicks
|
||||
allowClick: true,
|
||||
// Touches
|
||||
allowTouchMove: swiper.params.allowTouchMove,
|
||||
touches: {
|
||||
startX: 0,
|
||||
startY: 0,
|
||||
currentX: 0,
|
||||
currentY: 0,
|
||||
diff: 0
|
||||
},
|
||||
// Images
|
||||
imagesToLoad: [],
|
||||
imagesLoaded: 0
|
||||
});
|
||||
swiper.emit('_swiper'); // Init
|
||||
|
||||
if (swiper.params.init) {
|
||||
swiper.init();
|
||||
} // Return app instance
|
||||
|
||||
|
||||
return swiper;
|
||||
}
|
||||
|
||||
enable() {
|
||||
const swiper = this;
|
||||
if (swiper.enabled) return;
|
||||
swiper.enabled = true;
|
||||
|
||||
if (swiper.params.grabCursor) {
|
||||
swiper.setGrabCursor();
|
||||
}
|
||||
|
||||
swiper.emit('enable');
|
||||
}
|
||||
|
||||
disable() {
|
||||
const swiper = this;
|
||||
if (!swiper.enabled) return;
|
||||
swiper.enabled = false;
|
||||
|
||||
if (swiper.params.grabCursor) {
|
||||
swiper.unsetGrabCursor();
|
||||
}
|
||||
|
||||
swiper.emit('disable');
|
||||
}
|
||||
|
||||
setProgress(progress, speed) {
|
||||
const swiper = this;
|
||||
progress = Math.min(Math.max(progress, 0), 1);
|
||||
const min = swiper.minTranslate();
|
||||
const max = swiper.maxTranslate();
|
||||
const current = (max - min) * progress + min;
|
||||
swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
}
|
||||
|
||||
emitContainerClasses() {
|
||||
const swiper = this;
|
||||
if (!swiper.params._emitClasses || !swiper.el) return;
|
||||
const cls = swiper.el.className.split(' ').filter(className => {
|
||||
return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;
|
||||
});
|
||||
swiper.emit('_containerClasses', cls.join(' '));
|
||||
}
|
||||
|
||||
getSlideClasses(slideEl) {
|
||||
const swiper = this;
|
||||
return slideEl.className.split(' ').filter(className => {
|
||||
return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;
|
||||
}).join(' ');
|
||||
}
|
||||
|
||||
emitSlidesClasses() {
|
||||
const swiper = this;
|
||||
if (!swiper.params._emitClasses || !swiper.el) return;
|
||||
const updates = [];
|
||||
swiper.slides.each(slideEl => {
|
||||
const classNames = swiper.getSlideClasses(slideEl);
|
||||
updates.push({
|
||||
slideEl,
|
||||
classNames
|
||||
});
|
||||
swiper.emit('_slideClass', slideEl, classNames);
|
||||
});
|
||||
swiper.emit('_slideClasses', updates);
|
||||
}
|
||||
|
||||
slidesPerViewDynamic(view = 'current', exact = false) {
|
||||
const swiper = this;
|
||||
const {
|
||||
params,
|
||||
slides,
|
||||
slidesGrid,
|
||||
slidesSizesGrid,
|
||||
size: swiperSize,
|
||||
activeIndex
|
||||
} = swiper;
|
||||
let spv = 1;
|
||||
|
||||
if (params.centeredSlides) {
|
||||
let slideSize = slides[activeIndex].swiperSlideSize;
|
||||
let breakLoop;
|
||||
|
||||
for (let i = activeIndex + 1; i < slides.length; i += 1) {
|
||||
if (slides[i] && !breakLoop) {
|
||||
slideSize += slides[i].swiperSlideSize;
|
||||
spv += 1;
|
||||
if (slideSize > swiperSize) breakLoop = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = activeIndex - 1; i >= 0; i -= 1) {
|
||||
if (slides[i] && !breakLoop) {
|
||||
slideSize += slides[i].swiperSlideSize;
|
||||
spv += 1;
|
||||
if (slideSize > swiperSize) breakLoop = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
if (view === 'current') {
|
||||
for (let i = activeIndex + 1; i < slides.length; i += 1) {
|
||||
const slideInView = exact ? slidesGrid[i] + slidesSizesGrid[i] - slidesGrid[activeIndex] < swiperSize : slidesGrid[i] - slidesGrid[activeIndex] < swiperSize;
|
||||
|
||||
if (slideInView) {
|
||||
spv += 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// previous
|
||||
for (let i = activeIndex - 1; i >= 0; i -= 1) {
|
||||
const slideInView = slidesGrid[activeIndex] - slidesGrid[i] < swiperSize;
|
||||
|
||||
if (slideInView) {
|
||||
spv += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return spv;
|
||||
}
|
||||
|
||||
update() {
|
||||
const swiper = this;
|
||||
if (!swiper || swiper.destroyed) return;
|
||||
const {
|
||||
snapGrid,
|
||||
params
|
||||
} = swiper; // Breakpoints
|
||||
|
||||
if (params.breakpoints) {
|
||||
swiper.setBreakpoint();
|
||||
}
|
||||
|
||||
swiper.updateSize();
|
||||
swiper.updateSlides();
|
||||
swiper.updateProgress();
|
||||
swiper.updateSlidesClasses();
|
||||
|
||||
function setTranslate() {
|
||||
const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
|
||||
const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
|
||||
swiper.setTranslate(newTranslate);
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
}
|
||||
|
||||
let translated;
|
||||
|
||||
if (swiper.params.freeMode && swiper.params.freeMode.enabled) {
|
||||
setTranslate();
|
||||
|
||||
if (swiper.params.autoHeight) {
|
||||
swiper.updateAutoHeight();
|
||||
}
|
||||
} else {
|
||||
if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
|
||||
translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
||||
} else {
|
||||
translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
|
||||
}
|
||||
|
||||
if (!translated) {
|
||||
setTranslate();
|
||||
}
|
||||
}
|
||||
|
||||
if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
||||
swiper.checkOverflow();
|
||||
}
|
||||
|
||||
swiper.emit('update');
|
||||
}
|
||||
|
||||
changeDirection(newDirection, needUpdate = true) {
|
||||
const swiper = this;
|
||||
const currentDirection = swiper.params.direction;
|
||||
|
||||
if (!newDirection) {
|
||||
// eslint-disable-next-line
|
||||
newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
|
||||
}
|
||||
|
||||
if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {
|
||||
return swiper;
|
||||
}
|
||||
|
||||
swiper.$el.removeClass(`${swiper.params.containerModifierClass}${currentDirection}`).addClass(`${swiper.params.containerModifierClass}${newDirection}`);
|
||||
swiper.emitContainerClasses();
|
||||
swiper.params.direction = newDirection;
|
||||
swiper.slides.each(slideEl => {
|
||||
if (newDirection === 'vertical') {
|
||||
slideEl.style.width = '';
|
||||
} else {
|
||||
slideEl.style.height = '';
|
||||
}
|
||||
});
|
||||
swiper.emit('changeDirection');
|
||||
if (needUpdate) swiper.update();
|
||||
return swiper;
|
||||
}
|
||||
|
||||
mount(el) {
|
||||
const swiper = this;
|
||||
if (swiper.mounted) return true; // Find el
|
||||
|
||||
const $el = $(el || swiper.params.el);
|
||||
el = $el[0];
|
||||
|
||||
if (!el) {
|
||||
return false;
|
||||
}
|
||||
|
||||
el.swiper = swiper;
|
||||
|
||||
const getWrapperSelector = () => {
|
||||
return `.${(swiper.params.wrapperClass || '').trim().split(' ').join('.')}`;
|
||||
};
|
||||
|
||||
const getWrapper = () => {
|
||||
if (el && el.shadowRoot && el.shadowRoot.querySelector) {
|
||||
const res = $(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items
|
||||
|
||||
res.children = options => $el.children(options);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
return $el.children(getWrapperSelector());
|
||||
}; // Find Wrapper
|
||||
|
||||
|
||||
let $wrapperEl = getWrapper();
|
||||
|
||||
if ($wrapperEl.length === 0 && swiper.params.createElements) {
|
||||
const document = getDocument();
|
||||
const wrapper = document.createElement('div');
|
||||
$wrapperEl = $(wrapper);
|
||||
wrapper.className = swiper.params.wrapperClass;
|
||||
$el.append(wrapper);
|
||||
$el.children(`.${swiper.params.slideClass}`).each(slideEl => {
|
||||
$wrapperEl.append(slideEl);
|
||||
});
|
||||
}
|
||||
|
||||
Object.assign(swiper, {
|
||||
$el,
|
||||
el,
|
||||
$wrapperEl,
|
||||
wrapperEl: $wrapperEl[0],
|
||||
mounted: true,
|
||||
// RTL
|
||||
rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl',
|
||||
rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
|
||||
wrongRTL: $wrapperEl.css('display') === '-webkit-box'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
init(el) {
|
||||
const swiper = this;
|
||||
if (swiper.initialized) return swiper;
|
||||
const mounted = swiper.mount(el);
|
||||
if (mounted === false) return swiper;
|
||||
swiper.emit('beforeInit'); // Set breakpoint
|
||||
|
||||
if (swiper.params.breakpoints) {
|
||||
swiper.setBreakpoint();
|
||||
} // Add Classes
|
||||
|
||||
|
||||
swiper.addClasses(); // Create loop
|
||||
|
||||
if (swiper.params.loop) {
|
||||
swiper.loopCreate();
|
||||
} // Update size
|
||||
|
||||
|
||||
swiper.updateSize(); // Update slides
|
||||
|
||||
swiper.updateSlides();
|
||||
|
||||
if (swiper.params.watchOverflow) {
|
||||
swiper.checkOverflow();
|
||||
} // Set Grab Cursor
|
||||
|
||||
|
||||
if (swiper.params.grabCursor && swiper.enabled) {
|
||||
swiper.setGrabCursor();
|
||||
}
|
||||
|
||||
if (swiper.params.preloadImages) {
|
||||
swiper.preloadImages();
|
||||
} // Slide To Initial Slide
|
||||
|
||||
|
||||
if (swiper.params.loop) {
|
||||
swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true);
|
||||
} else {
|
||||
swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
|
||||
} // Attach events
|
||||
|
||||
|
||||
swiper.attachEvents(); // Init Flag
|
||||
|
||||
swiper.initialized = true; // Emit
|
||||
|
||||
swiper.emit('init');
|
||||
swiper.emit('afterInit');
|
||||
return swiper;
|
||||
}
|
||||
|
||||
destroy(deleteInstance = true, cleanStyles = true) {
|
||||
const swiper = this;
|
||||
const {
|
||||
params,
|
||||
$el,
|
||||
$wrapperEl,
|
||||
slides
|
||||
} = swiper;
|
||||
|
||||
if (typeof swiper.params === 'undefined' || swiper.destroyed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
swiper.emit('beforeDestroy'); // Init Flag
|
||||
|
||||
swiper.initialized = false; // Detach events
|
||||
|
||||
swiper.detachEvents(); // Destroy loop
|
||||
|
||||
if (params.loop) {
|
||||
swiper.loopDestroy();
|
||||
} // Cleanup styles
|
||||
|
||||
|
||||
if (cleanStyles) {
|
||||
swiper.removeClasses();
|
||||
$el.removeAttr('style');
|
||||
$wrapperEl.removeAttr('style');
|
||||
|
||||
if (slides && slides.length) {
|
||||
slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index');
|
||||
}
|
||||
}
|
||||
|
||||
swiper.emit('destroy'); // Detach emitter events
|
||||
|
||||
Object.keys(swiper.eventsListeners).forEach(eventName => {
|
||||
swiper.off(eventName);
|
||||
});
|
||||
|
||||
if (deleteInstance !== false) {
|
||||
swiper.$el[0].swiper = null;
|
||||
deleteProps(swiper);
|
||||
}
|
||||
|
||||
swiper.destroyed = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
static extendDefaults(newDefaults) {
|
||||
extend(extendedDefaults, newDefaults);
|
||||
}
|
||||
|
||||
static get extendedDefaults() {
|
||||
return extendedDefaults;
|
||||
}
|
||||
|
||||
static get defaults() {
|
||||
return defaults;
|
||||
}
|
||||
|
||||
static installModule(mod) {
|
||||
if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = [];
|
||||
const modules = Swiper.prototype.__modules__;
|
||||
|
||||
if (typeof mod === 'function' && modules.indexOf(mod) < 0) {
|
||||
modules.push(mod);
|
||||
}
|
||||
}
|
||||
|
||||
static use(module) {
|
||||
if (Array.isArray(module)) {
|
||||
module.forEach(m => Swiper.installModule(m));
|
||||
return Swiper;
|
||||
}
|
||||
|
||||
Swiper.installModule(module);
|
||||
return Swiper;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Object.keys(prototypes).forEach(prototypeGroup => {
|
||||
Object.keys(prototypes[prototypeGroup]).forEach(protoMethod => {
|
||||
Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
|
||||
});
|
||||
});
|
||||
Swiper.use([Resize, Observer]);
|
||||
export default Swiper;
|
120
resources/web/guide/swiper/core/defaults.js
Normal file
120
resources/web/guide/swiper/core/defaults.js
Normal file
|
@ -0,0 +1,120 @@
|
|||
export default {
|
||||
init: true,
|
||||
direction: 'horizontal',
|
||||
touchEventsTarget: 'wrapper',
|
||||
initialSlide: 0,
|
||||
speed: 300,
|
||||
cssMode: false,
|
||||
updateOnWindowResize: true,
|
||||
resizeObserver: true,
|
||||
nested: false,
|
||||
createElements: false,
|
||||
enabled: true,
|
||||
focusableElements: 'input, select, option, textarea, button, video, label',
|
||||
// Overrides
|
||||
width: null,
|
||||
height: null,
|
||||
//
|
||||
preventInteractionOnTransition: false,
|
||||
// ssr
|
||||
userAgent: null,
|
||||
url: null,
|
||||
// To support iOS's swipe-to-go-back gesture (when being used in-app).
|
||||
edgeSwipeDetection: false,
|
||||
edgeSwipeThreshold: 20,
|
||||
// Autoheight
|
||||
autoHeight: false,
|
||||
// Set wrapper width
|
||||
setWrapperSize: false,
|
||||
// Virtual Translate
|
||||
virtualTranslate: false,
|
||||
// Effects
|
||||
effect: 'slide',
|
||||
// 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'
|
||||
// Breakpoints
|
||||
breakpoints: undefined,
|
||||
breakpointsBase: 'window',
|
||||
// Slides grid
|
||||
spaceBetween: 0,
|
||||
slidesPerView: 1,
|
||||
slidesPerGroup: 1,
|
||||
slidesPerGroupSkip: 0,
|
||||
slidesPerGroupAuto: false,
|
||||
centeredSlides: false,
|
||||
centeredSlidesBounds: false,
|
||||
slidesOffsetBefore: 0,
|
||||
// in px
|
||||
slidesOffsetAfter: 0,
|
||||
// in px
|
||||
normalizeSlideIndex: true,
|
||||
centerInsufficientSlides: false,
|
||||
// Disable swiper and hide navigation when container not overflow
|
||||
watchOverflow: true,
|
||||
// Round length
|
||||
roundLengths: false,
|
||||
// Touches
|
||||
touchRatio: 1,
|
||||
touchAngle: 45,
|
||||
simulateTouch: true,
|
||||
shortSwipes: true,
|
||||
longSwipes: true,
|
||||
longSwipesRatio: 0.5,
|
||||
longSwipesMs: 300,
|
||||
followFinger: true,
|
||||
allowTouchMove: true,
|
||||
threshold: 0,
|
||||
touchMoveStopPropagation: false,
|
||||
touchStartPreventDefault: true,
|
||||
touchStartForcePreventDefault: false,
|
||||
touchReleaseOnEdges: false,
|
||||
// Unique Navigation Elements
|
||||
uniqueNavElements: true,
|
||||
// Resistance
|
||||
resistance: true,
|
||||
resistanceRatio: 0.85,
|
||||
// Progress
|
||||
watchSlidesProgress: false,
|
||||
// Cursor
|
||||
grabCursor: false,
|
||||
// Clicks
|
||||
preventClicks: true,
|
||||
preventClicksPropagation: true,
|
||||
slideToClickedSlide: false,
|
||||
// Images
|
||||
preloadImages: true,
|
||||
updateOnImagesReady: true,
|
||||
// loop
|
||||
loop: false,
|
||||
loopAdditionalSlides: 0,
|
||||
loopedSlides: null,
|
||||
loopFillGroupWithBlank: false,
|
||||
loopPreventsSlide: true,
|
||||
// Swiping/no swiping
|
||||
allowSlidePrev: true,
|
||||
allowSlideNext: true,
|
||||
swipeHandler: null,
|
||||
// '.swipe-handler',
|
||||
noSwiping: true,
|
||||
noSwipingClass: 'swiper-no-swiping',
|
||||
noSwipingSelector: null,
|
||||
// Passive Listeners
|
||||
passiveListeners: true,
|
||||
// NS
|
||||
containerModifierClass: 'swiper-',
|
||||
// NEW
|
||||
slideClass: 'swiper-slide',
|
||||
slideBlankClass: 'swiper-slide-invisible-blank',
|
||||
slideActiveClass: 'swiper-slide-active',
|
||||
slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
|
||||
slideVisibleClass: 'swiper-slide-visible',
|
||||
slideDuplicateClass: 'swiper-slide-duplicate',
|
||||
slideNextClass: 'swiper-slide-next',
|
||||
slideDuplicateNextClass: 'swiper-slide-duplicate-next',
|
||||
slidePrevClass: 'swiper-slide-prev',
|
||||
slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
|
||||
wrapperClass: 'swiper-wrapper',
|
||||
// Callbacks
|
||||
runCallbacksOnInit: true,
|
||||
// Internals
|
||||
_emitClasses: false
|
||||
};
|
108
resources/web/guide/swiper/core/events-emitter.js
Normal file
108
resources/web/guide/swiper/core/events-emitter.js
Normal file
|
@ -0,0 +1,108 @@
|
|||
/* eslint-disable no-underscore-dangle */
|
||||
export default {
|
||||
on(events, handler, priority) {
|
||||
const self = this;
|
||||
if (typeof handler !== 'function') return self;
|
||||
const method = priority ? 'unshift' : 'push';
|
||||
events.split(' ').forEach(event => {
|
||||
if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
|
||||
self.eventsListeners[event][method](handler);
|
||||
});
|
||||
return self;
|
||||
},
|
||||
|
||||
once(events, handler, priority) {
|
||||
const self = this;
|
||||
if (typeof handler !== 'function') return self;
|
||||
|
||||
function onceHandler(...args) {
|
||||
self.off(events, onceHandler);
|
||||
|
||||
if (onceHandler.__emitterProxy) {
|
||||
delete onceHandler.__emitterProxy;
|
||||
}
|
||||
|
||||
handler.apply(self, args);
|
||||
}
|
||||
|
||||
onceHandler.__emitterProxy = handler;
|
||||
return self.on(events, onceHandler, priority);
|
||||
},
|
||||
|
||||
onAny(handler, priority) {
|
||||
const self = this;
|
||||
if (typeof handler !== 'function') return self;
|
||||
const method = priority ? 'unshift' : 'push';
|
||||
|
||||
if (self.eventsAnyListeners.indexOf(handler) < 0) {
|
||||
self.eventsAnyListeners[method](handler);
|
||||
}
|
||||
|
||||
return self;
|
||||
},
|
||||
|
||||
offAny(handler) {
|
||||
const self = this;
|
||||
if (!self.eventsAnyListeners) return self;
|
||||
const index = self.eventsAnyListeners.indexOf(handler);
|
||||
|
||||
if (index >= 0) {
|
||||
self.eventsAnyListeners.splice(index, 1);
|
||||
}
|
||||
|
||||
return self;
|
||||
},
|
||||
|
||||
off(events, handler) {
|
||||
const self = this;
|
||||
if (!self.eventsListeners) return self;
|
||||
events.split(' ').forEach(event => {
|
||||
if (typeof handler === 'undefined') {
|
||||
self.eventsListeners[event] = [];
|
||||
} else if (self.eventsListeners[event]) {
|
||||
self.eventsListeners[event].forEach((eventHandler, index) => {
|
||||
if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {
|
||||
self.eventsListeners[event].splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return self;
|
||||
},
|
||||
|
||||
emit(...args) {
|
||||
const self = this;
|
||||
if (!self.eventsListeners) return self;
|
||||
let events;
|
||||
let data;
|
||||
let context;
|
||||
|
||||
if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
||||
events = args[0];
|
||||
data = args.slice(1, args.length);
|
||||
context = self;
|
||||
} else {
|
||||
events = args[0].events;
|
||||
data = args[0].data;
|
||||
context = args[0].context || self;
|
||||
}
|
||||
|
||||
data.unshift(context);
|
||||
const eventsArray = Array.isArray(events) ? events : events.split(' ');
|
||||
eventsArray.forEach(event => {
|
||||
if (self.eventsAnyListeners && self.eventsAnyListeners.length) {
|
||||
self.eventsAnyListeners.forEach(eventHandler => {
|
||||
eventHandler.apply(context, [event, ...data]);
|
||||
});
|
||||
}
|
||||
|
||||
if (self.eventsListeners && self.eventsListeners[event]) {
|
||||
self.eventsListeners[event].forEach(eventHandler => {
|
||||
eventHandler.apply(context, data);
|
||||
});
|
||||
}
|
||||
});
|
||||
return self;
|
||||
}
|
||||
|
||||
};
|
97
resources/web/guide/swiper/core/events/index.js
Normal file
97
resources/web/guide/swiper/core/events/index.js
Normal file
|
@ -0,0 +1,97 @@
|
|||
import { getDocument } from 'ssr-window';
|
||||
import onTouchStart from './onTouchStart.js';
|
||||
import onTouchMove from './onTouchMove.js';
|
||||
import onTouchEnd from './onTouchEnd.js';
|
||||
import onResize from './onResize.js';
|
||||
import onClick from './onClick.js';
|
||||
import onScroll from './onScroll.js';
|
||||
let dummyEventAttached = false;
|
||||
|
||||
function dummyEventListener() {}
|
||||
|
||||
const events = (swiper, method) => {
|
||||
const document = getDocument();
|
||||
const {
|
||||
params,
|
||||
touchEvents,
|
||||
el,
|
||||
wrapperEl,
|
||||
device,
|
||||
support
|
||||
} = swiper;
|
||||
const capture = !!params.nested;
|
||||
const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
|
||||
const swiperMethod = method; // Touch Events
|
||||
|
||||
if (!support.touch) {
|
||||
el[domMethod](touchEvents.start, swiper.onTouchStart, false);
|
||||
document[domMethod](touchEvents.move, swiper.onTouchMove, capture);
|
||||
document[domMethod](touchEvents.end, swiper.onTouchEnd, false);
|
||||
} else {
|
||||
const passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? {
|
||||
passive: true,
|
||||
capture: false
|
||||
} : false;
|
||||
el[domMethod](touchEvents.start, swiper.onTouchStart, passiveListener);
|
||||
el[domMethod](touchEvents.move, swiper.onTouchMove, support.passiveListener ? {
|
||||
passive: false,
|
||||
capture
|
||||
} : capture);
|
||||
el[domMethod](touchEvents.end, swiper.onTouchEnd, passiveListener);
|
||||
|
||||
if (touchEvents.cancel) {
|
||||
el[domMethod](touchEvents.cancel, swiper.onTouchEnd, passiveListener);
|
||||
}
|
||||
} // Prevent Links Clicks
|
||||
|
||||
|
||||
if (params.preventClicks || params.preventClicksPropagation) {
|
||||
el[domMethod]('click', swiper.onClick, true);
|
||||
}
|
||||
|
||||
if (params.cssMode) {
|
||||
wrapperEl[domMethod]('scroll', swiper.onScroll);
|
||||
} // Resize handler
|
||||
|
||||
|
||||
if (params.updateOnWindowResize) {
|
||||
swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);
|
||||
} else {
|
||||
swiper[swiperMethod]('observerUpdate', onResize, true);
|
||||
}
|
||||
};
|
||||
|
||||
function attachEvents() {
|
||||
const swiper = this;
|
||||
const document = getDocument();
|
||||
const {
|
||||
params,
|
||||
support
|
||||
} = swiper;
|
||||
swiper.onTouchStart = onTouchStart.bind(swiper);
|
||||
swiper.onTouchMove = onTouchMove.bind(swiper);
|
||||
swiper.onTouchEnd = onTouchEnd.bind(swiper);
|
||||
|
||||
if (params.cssMode) {
|
||||
swiper.onScroll = onScroll.bind(swiper);
|
||||
}
|
||||
|
||||
swiper.onClick = onClick.bind(swiper);
|
||||
|
||||
if (support.touch && !dummyEventAttached) {
|
||||
document.addEventListener('touchstart', dummyEventListener);
|
||||
dummyEventAttached = true;
|
||||
}
|
||||
|
||||
events(swiper, 'on');
|
||||
}
|
||||
|
||||
function detachEvents() {
|
||||
const swiper = this;
|
||||
events(swiper, 'off');
|
||||
}
|
||||
|
||||
export default {
|
||||
attachEvents,
|
||||
detachEvents
|
||||
};
|
13
resources/web/guide/swiper/core/events/onClick.js
Normal file
13
resources/web/guide/swiper/core/events/onClick.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
export default function onClick(e) {
|
||||
const swiper = this;
|
||||
if (!swiper.enabled) return;
|
||||
|
||||
if (!swiper.allowClick) {
|
||||
if (swiper.params.preventClicks) e.preventDefault();
|
||||
|
||||
if (swiper.params.preventClicksPropagation && swiper.animating) {
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
}
|
||||
}
|
43
resources/web/guide/swiper/core/events/onResize.js
Normal file
43
resources/web/guide/swiper/core/events/onResize.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
export default function onResize() {
|
||||
const swiper = this;
|
||||
const {
|
||||
params,
|
||||
el
|
||||
} = swiper;
|
||||
if (el && el.offsetWidth === 0) return; // Breakpoints
|
||||
|
||||
if (params.breakpoints) {
|
||||
swiper.setBreakpoint();
|
||||
} // Save locks
|
||||
|
||||
|
||||
const {
|
||||
allowSlideNext,
|
||||
allowSlidePrev,
|
||||
snapGrid
|
||||
} = swiper; // Disable locks on resize
|
||||
|
||||
swiper.allowSlideNext = true;
|
||||
swiper.allowSlidePrev = true;
|
||||
swiper.updateSize();
|
||||
swiper.updateSlides();
|
||||
swiper.updateSlidesClasses();
|
||||
|
||||
if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) {
|
||||
swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
||||
} else {
|
||||
swiper.slideTo(swiper.activeIndex, 0, false, true);
|
||||
}
|
||||
|
||||
if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
|
||||
swiper.autoplay.run();
|
||||
} // Return locks after resize
|
||||
|
||||
|
||||
swiper.allowSlidePrev = allowSlidePrev;
|
||||
swiper.allowSlideNext = allowSlideNext;
|
||||
|
||||
if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
||||
swiper.checkOverflow();
|
||||
}
|
||||
}
|
35
resources/web/guide/swiper/core/events/onScroll.js
Normal file
35
resources/web/guide/swiper/core/events/onScroll.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
export default function onScroll() {
|
||||
const swiper = this;
|
||||
const {
|
||||
wrapperEl,
|
||||
rtlTranslate,
|
||||
enabled
|
||||
} = swiper;
|
||||
if (!enabled) return;
|
||||
swiper.previousTranslate = swiper.translate;
|
||||
|
||||
if (swiper.isHorizontal()) {
|
||||
swiper.translate = -wrapperEl.scrollLeft;
|
||||
} else {
|
||||
swiper.translate = -wrapperEl.scrollTop;
|
||||
} // eslint-disable-next-line
|
||||
|
||||
|
||||
if (swiper.translate === -0) swiper.translate = 0;
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
let newProgress;
|
||||
const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
||||
|
||||
if (translatesDiff === 0) {
|
||||
newProgress = 0;
|
||||
} else {
|
||||
newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;
|
||||
}
|
||||
|
||||
if (newProgress !== swiper.progress) {
|
||||
swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
|
||||
}
|
||||
|
||||
swiper.emit('setTranslate', swiper.translate, false);
|
||||
}
|
143
resources/web/guide/swiper/core/events/onTouchEnd.js
Normal file
143
resources/web/guide/swiper/core/events/onTouchEnd.js
Normal file
|
@ -0,0 +1,143 @@
|
|||
import { now, nextTick } from '../../shared/utils.js';
|
||||
export default function onTouchEnd(event) {
|
||||
const swiper = this;
|
||||
const data = swiper.touchEventsData;
|
||||
const {
|
||||
params,
|
||||
touches,
|
||||
rtlTranslate: rtl,
|
||||
slidesGrid,
|
||||
enabled
|
||||
} = swiper;
|
||||
if (!enabled) return;
|
||||
let e = event;
|
||||
if (e.originalEvent) e = e.originalEvent;
|
||||
|
||||
if (data.allowTouchCallbacks) {
|
||||
swiper.emit('touchEnd', e);
|
||||
}
|
||||
|
||||
data.allowTouchCallbacks = false;
|
||||
|
||||
if (!data.isTouched) {
|
||||
if (data.isMoved && params.grabCursor) {
|
||||
swiper.setGrabCursor(false);
|
||||
}
|
||||
|
||||
data.isMoved = false;
|
||||
data.startMoving = false;
|
||||
return;
|
||||
} // Return Grab Cursor
|
||||
|
||||
|
||||
if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
||||
swiper.setGrabCursor(false);
|
||||
} // Time diff
|
||||
|
||||
|
||||
const touchEndTime = now();
|
||||
const timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click
|
||||
|
||||
if (swiper.allowClick) {
|
||||
swiper.updateClickedSlide(e);
|
||||
swiper.emit('tap click', e);
|
||||
|
||||
if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {
|
||||
swiper.emit('doubleTap doubleClick', e);
|
||||
}
|
||||
}
|
||||
|
||||
data.lastClickTime = now();
|
||||
nextTick(() => {
|
||||
if (!swiper.destroyed) swiper.allowClick = true;
|
||||
});
|
||||
|
||||
if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
|
||||
data.isTouched = false;
|
||||
data.isMoved = false;
|
||||
data.startMoving = false;
|
||||
return;
|
||||
}
|
||||
|
||||
data.isTouched = false;
|
||||
data.isMoved = false;
|
||||
data.startMoving = false;
|
||||
let currentPos;
|
||||
|
||||
if (params.followFinger) {
|
||||
currentPos = rtl ? swiper.translate : -swiper.translate;
|
||||
} else {
|
||||
currentPos = -data.currentTranslate;
|
||||
}
|
||||
|
||||
if (params.cssMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (swiper.params.freeMode && params.freeMode.enabled) {
|
||||
swiper.freeMode.onTouchEnd({
|
||||
currentPos
|
||||
});
|
||||
return;
|
||||
} // Find current slide
|
||||
|
||||
|
||||
let stopIndex = 0;
|
||||
let groupSize = swiper.slidesSizesGrid[0];
|
||||
|
||||
for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
|
||||
const increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
|
||||
|
||||
if (typeof slidesGrid[i + increment] !== 'undefined') {
|
||||
if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
|
||||
stopIndex = i;
|
||||
groupSize = slidesGrid[i + increment] - slidesGrid[i];
|
||||
}
|
||||
} else if (currentPos >= slidesGrid[i]) {
|
||||
stopIndex = i;
|
||||
groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
|
||||
}
|
||||
} // Find current slide size
|
||||
|
||||
|
||||
const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
|
||||
const increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
|
||||
|
||||
if (timeDiff > params.longSwipesMs) {
|
||||
// Long touches
|
||||
if (!params.longSwipes) {
|
||||
swiper.slideTo(swiper.activeIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
if (swiper.swipeDirection === 'next') {
|
||||
if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);
|
||||
}
|
||||
|
||||
if (swiper.swipeDirection === 'prev') {
|
||||
if (ratio > 1 - params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);
|
||||
}
|
||||
} else {
|
||||
// Short swipes
|
||||
if (!params.shortSwipes) {
|
||||
swiper.slideTo(swiper.activeIndex);
|
||||
return;
|
||||
}
|
||||
|
||||
const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
|
||||
|
||||
if (!isNavButtonTarget) {
|
||||
if (swiper.swipeDirection === 'next') {
|
||||
swiper.slideTo(stopIndex + increment);
|
||||
}
|
||||
|
||||
if (swiper.swipeDirection === 'prev') {
|
||||
swiper.slideTo(stopIndex);
|
||||
}
|
||||
} else if (e.target === swiper.navigation.nextEl) {
|
||||
swiper.slideTo(stopIndex + increment);
|
||||
} else {
|
||||
swiper.slideTo(stopIndex);
|
||||
}
|
||||
}
|
||||
}
|
222
resources/web/guide/swiper/core/events/onTouchMove.js
Normal file
222
resources/web/guide/swiper/core/events/onTouchMove.js
Normal file
|
@ -0,0 +1,222 @@
|
|||
import { getDocument } from 'ssr-window';
|
||||
import $ from '../../shared/dom.js';
|
||||
import { now } from '../../shared/utils.js';
|
||||
export default function onTouchMove(event) {
|
||||
const document = getDocument();
|
||||
const swiper = this;
|
||||
const data = swiper.touchEventsData;
|
||||
const {
|
||||
params,
|
||||
touches,
|
||||
rtlTranslate: rtl,
|
||||
enabled
|
||||
} = swiper;
|
||||
if (!enabled) return;
|
||||
let e = event;
|
||||
if (e.originalEvent) e = e.originalEvent;
|
||||
|
||||
if (!data.isTouched) {
|
||||
if (data.startMoving && data.isScrolling) {
|
||||
swiper.emit('touchMoveOpposite', e);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.isTouchEvent && e.type !== 'touchmove') return;
|
||||
const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);
|
||||
const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;
|
||||
const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;
|
||||
|
||||
if (e.preventedByNestedSwiper) {
|
||||
touches.startX = pageX;
|
||||
touches.startY = pageY;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!swiper.allowTouchMove) {
|
||||
// isMoved = true;
|
||||
swiper.allowClick = false;
|
||||
|
||||
if (data.isTouched) {
|
||||
Object.assign(touches, {
|
||||
startX: pageX,
|
||||
startY: pageY,
|
||||
currentX: pageX,
|
||||
currentY: pageY
|
||||
});
|
||||
data.touchStartTime = now();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
|
||||
if (swiper.isVertical()) {
|
||||
// Vertical
|
||||
if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {
|
||||
data.isTouched = false;
|
||||
data.isMoved = false;
|
||||
return;
|
||||
}
|
||||
} else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (data.isTouchEvent && document.activeElement) {
|
||||
if (e.target === document.activeElement && $(e.target).is(data.focusableElements)) {
|
||||
data.isMoved = true;
|
||||
swiper.allowClick = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (data.allowTouchCallbacks) {
|
||||
swiper.emit('touchMove', e);
|
||||
}
|
||||
|
||||
if (e.targetTouches && e.targetTouches.length > 1) return;
|
||||
touches.currentX = pageX;
|
||||
touches.currentY = pageY;
|
||||
const diffX = touches.currentX - touches.startX;
|
||||
const diffY = touches.currentY - touches.startY;
|
||||
if (swiper.params.threshold && Math.sqrt(diffX ** 2 + diffY ** 2) < swiper.params.threshold) return;
|
||||
|
||||
if (typeof data.isScrolling === 'undefined') {
|
||||
let touchAngle;
|
||||
|
||||
if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {
|
||||
data.isScrolling = false;
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
if (diffX * diffX + diffY * diffY >= 25) {
|
||||
touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;
|
||||
data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.isScrolling) {
|
||||
swiper.emit('touchMoveOpposite', e);
|
||||
}
|
||||
|
||||
if (typeof data.startMoving === 'undefined') {
|
||||
if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
|
||||
data.startMoving = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (data.isScrolling) {
|
||||
data.isTouched = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.startMoving) {
|
||||
return;
|
||||
}
|
||||
|
||||
swiper.allowClick = false;
|
||||
|
||||
if (!params.cssMode && e.cancelable) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if (params.touchMoveStopPropagation && !params.nested) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
if (!data.isMoved) {
|
||||
if (params.loop && !params.cssMode) {
|
||||
swiper.loopFix();
|
||||
}
|
||||
|
||||
data.startTranslate = swiper.getTranslate();
|
||||
swiper.setTransition(0);
|
||||
|
||||
if (swiper.animating) {
|
||||
swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
|
||||
}
|
||||
|
||||
data.allowMomentumBounce = false; // Grab Cursor
|
||||
|
||||
if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
||||
swiper.setGrabCursor(true);
|
||||
}
|
||||
|
||||
swiper.emit('sliderFirstMove', e);
|
||||
}
|
||||
|
||||
swiper.emit('sliderMove', e);
|
||||
data.isMoved = true;
|
||||
let diff = swiper.isHorizontal() ? diffX : diffY;
|
||||
touches.diff = diff;
|
||||
diff *= params.touchRatio;
|
||||
if (rtl) diff = -diff;
|
||||
swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
|
||||
data.currentTranslate = diff + data.startTranslate;
|
||||
let disableParentSwiper = true;
|
||||
let resistanceRatio = params.resistanceRatio;
|
||||
|
||||
if (params.touchReleaseOnEdges) {
|
||||
resistanceRatio = 0;
|
||||
}
|
||||
|
||||
if (diff > 0 && data.currentTranslate > swiper.minTranslate()) {
|
||||
disableParentSwiper = false;
|
||||
if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + (-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio;
|
||||
} else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
|
||||
disableParentSwiper = false;
|
||||
if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - (swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio;
|
||||
}
|
||||
|
||||
if (disableParentSwiper) {
|
||||
e.preventedByNestedSwiper = true;
|
||||
} // Directions locks
|
||||
|
||||
|
||||
if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
|
||||
data.currentTranslate = data.startTranslate;
|
||||
}
|
||||
|
||||
if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
|
||||
data.currentTranslate = data.startTranslate;
|
||||
}
|
||||
|
||||
if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {
|
||||
data.currentTranslate = data.startTranslate;
|
||||
} // Threshold
|
||||
|
||||
|
||||
if (params.threshold > 0) {
|
||||
if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
|
||||
if (!data.allowThresholdMove) {
|
||||
data.allowThresholdMove = true;
|
||||
touches.startX = touches.currentX;
|
||||
touches.startY = touches.currentY;
|
||||
data.currentTranslate = data.startTranslate;
|
||||
touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
data.currentTranslate = data.startTranslate;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!params.followFinger || params.cssMode) return; // Update active index in free mode
|
||||
|
||||
if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) {
|
||||
swiper.updateActiveIndex();
|
||||
swiper.updateSlidesClasses();
|
||||
}
|
||||
|
||||
if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) {
|
||||
swiper.freeMode.onTouchMove();
|
||||
} // Update progress
|
||||
|
||||
|
||||
swiper.updateProgress(data.currentTranslate); // Update translate
|
||||
|
||||
swiper.setTranslate(data.currentTranslate);
|
||||
}
|
114
resources/web/guide/swiper/core/events/onTouchStart.js
Normal file
114
resources/web/guide/swiper/core/events/onTouchStart.js
Normal file
|
@ -0,0 +1,114 @@
|
|||
import { getWindow, getDocument } from 'ssr-window';
|
||||
import $ from '../../shared/dom.js';
|
||||
import { now } from '../../shared/utils.js'; // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd
|
||||
|
||||
function closestElement(selector, base = this) {
|
||||
function __closestFrom(el) {
|
||||
if (!el || el === getDocument() || el === getWindow()) return null;
|
||||
if (el.assignedSlot) el = el.assignedSlot;
|
||||
const found = el.closest(selector);
|
||||
return found || __closestFrom(el.getRootNode().host);
|
||||
}
|
||||
|
||||
return __closestFrom(base);
|
||||
}
|
||||
|
||||
export default function onTouchStart(event) {
|
||||
const swiper = this;
|
||||
const document = getDocument();
|
||||
const window = getWindow();
|
||||
const data = swiper.touchEventsData;
|
||||
const {
|
||||
params,
|
||||
touches,
|
||||
enabled
|
||||
} = swiper;
|
||||
if (!enabled) return;
|
||||
|
||||
if (swiper.animating && params.preventInteractionOnTransition) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!swiper.animating && params.cssMode && params.loop) {
|
||||
swiper.loopFix();
|
||||
}
|
||||
|
||||
let e = event;
|
||||
if (e.originalEvent) e = e.originalEvent;
|
||||
let $targetEl = $(e.target);
|
||||
|
||||
if (params.touchEventsTarget === 'wrapper') {
|
||||
if (!$targetEl.closest(swiper.wrapperEl).length) return;
|
||||
}
|
||||
|
||||
data.isTouchEvent = e.type === 'touchstart';
|
||||
if (!data.isTouchEvent && 'which' in e && e.which === 3) return;
|
||||
if (!data.isTouchEvent && 'button' in e && e.button > 0) return;
|
||||
if (data.isTouched && data.isMoved) return; // change target el for shadow root component
|
||||
|
||||
const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';
|
||||
|
||||
if (swipingClassHasValue && e.target && e.target.shadowRoot && event.path && event.path[0]) {
|
||||
$targetEl = $(event.path[0]);
|
||||
}
|
||||
|
||||
const noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`;
|
||||
const isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element
|
||||
|
||||
if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, e.target) : $targetEl.closest(noSwipingSelector)[0])) {
|
||||
swiper.allowClick = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.swipeHandler) {
|
||||
if (!$targetEl.closest(params.swipeHandler)[0]) return;
|
||||
}
|
||||
|
||||
touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
||||
touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
||||
const startX = touches.currentX;
|
||||
const startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore
|
||||
|
||||
const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
|
||||
const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
|
||||
|
||||
if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {
|
||||
if (edgeSwipeDetection === 'prevent') {
|
||||
event.preventDefault();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(data, {
|
||||
isTouched: true,
|
||||
isMoved: false,
|
||||
allowTouchCallbacks: true,
|
||||
isScrolling: undefined,
|
||||
startMoving: undefined
|
||||
});
|
||||
touches.startX = startX;
|
||||
touches.startY = startY;
|
||||
data.touchStartTime = now();
|
||||
swiper.allowClick = true;
|
||||
swiper.updateSize();
|
||||
swiper.swipeDirection = undefined;
|
||||
if (params.threshold > 0) data.allowThresholdMove = false;
|
||||
|
||||
if (e.type !== 'touchstart') {
|
||||
let preventDefault = true;
|
||||
if ($targetEl.is(data.focusableElements)) preventDefault = false;
|
||||
|
||||
if (document.activeElement && $(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) {
|
||||
document.activeElement.blur();
|
||||
}
|
||||
|
||||
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
||||
|
||||
if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
swiper.emit('touchStart', e);
|
||||
}
|
6
resources/web/guide/swiper/core/grab-cursor/index.js
Normal file
6
resources/web/guide/swiper/core/grab-cursor/index.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import setGrabCursor from './setGrabCursor.js';
|
||||
import unsetGrabCursor from './unsetGrabCursor.js';
|
||||
export default {
|
||||
setGrabCursor,
|
||||
unsetGrabCursor
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
export default function setGrabCursor(moving) {
|
||||
const swiper = this;
|
||||
if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;
|
||||
const el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl;
|
||||
el.style.cursor = 'move';
|
||||
el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
|
||||
el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
|
||||
el.style.cursor = moving ? 'grabbing' : 'grab';
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
export default function unsetGrabCursor() {
|
||||
const swiper = this;
|
||||
|
||||
if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = '';
|
||||
}
|
6
resources/web/guide/swiper/core/images/index.js
Normal file
6
resources/web/guide/swiper/core/images/index.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import loadImage from './loadImage.js';
|
||||
import preloadImages from './preloadImages.js';
|
||||
export default {
|
||||
loadImage,
|
||||
preloadImages
|
||||
};
|
37
resources/web/guide/swiper/core/images/loadImage.js
Normal file
37
resources/web/guide/swiper/core/images/loadImage.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
import { getWindow } from 'ssr-window';
|
||||
import $ from '../../shared/dom.js';
|
||||
export default function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) {
|
||||
const window = getWindow();
|
||||
let image;
|
||||
|
||||
function onReady() {
|
||||
if (callback) callback();
|
||||
}
|
||||
|
||||
const isPicture = $(imageEl).parent('picture')[0];
|
||||
|
||||
if (!isPicture && (!imageEl.complete || !checkForComplete)) {
|
||||
if (src) {
|
||||
image = new window.Image();
|
||||
image.onload = onReady;
|
||||
image.onerror = onReady;
|
||||
|
||||
if (sizes) {
|
||||
image.sizes = sizes;
|
||||
}
|
||||
|
||||
if (srcset) {
|
||||
image.srcset = srcset;
|
||||
}
|
||||
|
||||
if (src) {
|
||||
image.src = src;
|
||||
}
|
||||
} else {
|
||||
onReady();
|
||||
}
|
||||
} else {
|
||||
// image already loaded...
|
||||
onReady();
|
||||
}
|
||||
}
|
19
resources/web/guide/swiper/core/images/preloadImages.js
Normal file
19
resources/web/guide/swiper/core/images/preloadImages.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
export default function preloadImages() {
|
||||
const swiper = this;
|
||||
swiper.imagesToLoad = swiper.$el.find('img');
|
||||
|
||||
function onReady() {
|
||||
if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
|
||||
if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
|
||||
|
||||
if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
|
||||
if (swiper.params.updateOnImagesReady) swiper.update();
|
||||
swiper.emit('imagesReady');
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {
|
||||
const imageEl = swiper.imagesToLoad[i];
|
||||
swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady);
|
||||
}
|
||||
}
|
8
resources/web/guide/swiper/core/loop/index.js
Normal file
8
resources/web/guide/swiper/core/loop/index.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import loopCreate from './loopCreate.js';
|
||||
import loopFix from './loopFix.js';
|
||||
import loopDestroy from './loopDestroy.js';
|
||||
export default {
|
||||
loopCreate,
|
||||
loopFix,
|
||||
loopDestroy
|
||||
};
|
59
resources/web/guide/swiper/core/loop/loopCreate.js
Normal file
59
resources/web/guide/swiper/core/loop/loopCreate.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
import { getDocument } from 'ssr-window';
|
||||
import $ from '../../shared/dom.js';
|
||||
export default function loopCreate() {
|
||||
const swiper = this;
|
||||
const document = getDocument();
|
||||
const {
|
||||
params,
|
||||
$wrapperEl
|
||||
} = swiper; // Remove duplicated slides
|
||||
|
||||
const $selector = $($wrapperEl.children()[0].parentNode);
|
||||
$selector.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove();
|
||||
let slides = $selector.children(`.${params.slideClass}`);
|
||||
|
||||
if (params.loopFillGroupWithBlank) {
|
||||
const blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup;
|
||||
|
||||
if (blankSlidesNum !== params.slidesPerGroup) {
|
||||
for (let i = 0; i < blankSlidesNum; i += 1) {
|
||||
const blankNode = $(document.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`);
|
||||
$selector.append(blankNode);
|
||||
}
|
||||
|
||||
slides = $selector.children(`.${params.slideClass}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;
|
||||
swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));
|
||||
swiper.loopedSlides += params.loopAdditionalSlides;
|
||||
|
||||
if (swiper.loopedSlides > slides.length) {
|
||||
swiper.loopedSlides = slides.length;
|
||||
}
|
||||
|
||||
const prependSlides = [];
|
||||
const appendSlides = [];
|
||||
slides.each((el, index) => {
|
||||
const slide = $(el);
|
||||
|
||||
if (index < swiper.loopedSlides) {
|
||||
appendSlides.push(el);
|
||||
}
|
||||
|
||||
if (index < slides.length && index >= slides.length - swiper.loopedSlides) {
|
||||
prependSlides.push(el);
|
||||
}
|
||||
|
||||
slide.attr('data-swiper-slide-index', index);
|
||||
});
|
||||
|
||||
for (let i = 0; i < appendSlides.length; i += 1) {
|
||||
$selector.append($(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
|
||||
}
|
||||
|
||||
for (let i = prependSlides.length - 1; i >= 0; i -= 1) {
|
||||
$selector.prepend($(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
|
||||
}
|
||||
}
|
10
resources/web/guide/swiper/core/loop/loopDestroy.js
Normal file
10
resources/web/guide/swiper/core/loop/loopDestroy.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
export default function loopDestroy() {
|
||||
const swiper = this;
|
||||
const {
|
||||
$wrapperEl,
|
||||
params,
|
||||
slides
|
||||
} = swiper;
|
||||
$wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove();
|
||||
slides.removeAttr('data-swiper-slide-index');
|
||||
}
|
41
resources/web/guide/swiper/core/loop/loopFix.js
Normal file
41
resources/web/guide/swiper/core/loop/loopFix.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
export default function loopFix() {
|
||||
const swiper = this;
|
||||
swiper.emit('beforeLoopFix');
|
||||
const {
|
||||
activeIndex,
|
||||
slides,
|
||||
loopedSlides,
|
||||
allowSlidePrev,
|
||||
allowSlideNext,
|
||||
snapGrid,
|
||||
rtlTranslate: rtl
|
||||
} = swiper;
|
||||
let newIndex;
|
||||
swiper.allowSlidePrev = true;
|
||||
swiper.allowSlideNext = true;
|
||||
const snapTranslate = -snapGrid[activeIndex];
|
||||
const diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding
|
||||
|
||||
if (activeIndex < loopedSlides) {
|
||||
newIndex = slides.length - loopedSlides * 3 + activeIndex;
|
||||
newIndex += loopedSlides;
|
||||
const slideChanged = swiper.slideTo(newIndex, 0, false, true);
|
||||
|
||||
if (slideChanged && diff !== 0) {
|
||||
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
||||
}
|
||||
} else if (activeIndex >= slides.length - loopedSlides) {
|
||||
// Fix For Positive Oversliding
|
||||
newIndex = -slides.length + activeIndex + loopedSlides;
|
||||
newIndex += loopedSlides;
|
||||
const slideChanged = swiper.slideTo(newIndex, 0, false, true);
|
||||
|
||||
if (slideChanged && diff !== 0) {
|
||||
swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
||||
}
|
||||
}
|
||||
|
||||
swiper.allowSlidePrev = allowSlidePrev;
|
||||
swiper.allowSlideNext = allowSlideNext;
|
||||
swiper.emit('loopFix');
|
||||
}
|
38
resources/web/guide/swiper/core/moduleExtendParams.js
Normal file
38
resources/web/guide/swiper/core/moduleExtendParams.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { extend } from '../shared/utils.js';
|
||||
export default function moduleExtendParams(params, allModulesParams) {
|
||||
return function extendParams(obj = {}) {
|
||||
const moduleParamName = Object.keys(obj)[0];
|
||||
const moduleParams = obj[moduleParamName];
|
||||
|
||||
if (typeof moduleParams !== 'object' || moduleParams === null) {
|
||||
extend(allModulesParams, obj);
|
||||
return;
|
||||
}
|
||||
|
||||
if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) {
|
||||
params[moduleParamName] = {
|
||||
auto: true
|
||||
};
|
||||
}
|
||||
|
||||
if (!(moduleParamName in params && 'enabled' in moduleParams)) {
|
||||
extend(allModulesParams, obj);
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[moduleParamName] === true) {
|
||||
params[moduleParamName] = {
|
||||
enabled: true
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {
|
||||
params[moduleParamName].enabled = true;
|
||||
}
|
||||
|
||||
if (!params[moduleParamName]) params[moduleParamName] = {
|
||||
enabled: false
|
||||
};
|
||||
extend(allModulesParams, obj);
|
||||
};
|
||||
}
|
75
resources/web/guide/swiper/core/modules/observer/observer.js
Normal file
75
resources/web/guide/swiper/core/modules/observer/observer.js
Normal file
|
@ -0,0 +1,75 @@
|
|||
import { getWindow } from 'ssr-window';
|
||||
export default function Observer({
|
||||
swiper,
|
||||
extendParams,
|
||||
on,
|
||||
emit
|
||||
}) {
|
||||
const observers = [];
|
||||
const window = getWindow();
|
||||
|
||||
const attach = (target, options = {}) => {
|
||||
const ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;
|
||||
const observer = new ObserverFunc(mutations => {
|
||||
// The observerUpdate event should only be triggered
|
||||
// once despite the number of mutations. Additional
|
||||
// triggers are redundant and are very costly
|
||||
if (mutations.length === 1) {
|
||||
emit('observerUpdate', mutations[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
const observerUpdate = function observerUpdate() {
|
||||
emit('observerUpdate', mutations[0]);
|
||||
};
|
||||
|
||||
if (window.requestAnimationFrame) {
|
||||
window.requestAnimationFrame(observerUpdate);
|
||||
} else {
|
||||
window.setTimeout(observerUpdate, 0);
|
||||
}
|
||||
});
|
||||
observer.observe(target, {
|
||||
attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
||||
childList: typeof options.childList === 'undefined' ? true : options.childList,
|
||||
characterData: typeof options.characterData === 'undefined' ? true : options.characterData
|
||||
});
|
||||
observers.push(observer);
|
||||
};
|
||||
|
||||
const init = () => {
|
||||
if (!swiper.params.observer) return;
|
||||
|
||||
if (swiper.params.observeParents) {
|
||||
const containerParents = swiper.$el.parents();
|
||||
|
||||
for (let i = 0; i < containerParents.length; i += 1) {
|
||||
attach(containerParents[i]);
|
||||
}
|
||||
} // Observe container
|
||||
|
||||
|
||||
attach(swiper.$el[0], {
|
||||
childList: swiper.params.observeSlideChildren
|
||||
}); // Observe wrapper
|
||||
|
||||
attach(swiper.$wrapperEl[0], {
|
||||
attributes: false
|
||||
});
|
||||
};
|
||||
|
||||
const destroy = () => {
|
||||
observers.forEach(observer => {
|
||||
observer.disconnect();
|
||||
});
|
||||
observers.splice(0, observers.length);
|
||||
};
|
||||
|
||||
extendParams({
|
||||
observer: false,
|
||||
observeParents: false,
|
||||
observeSlideChildren: false
|
||||
});
|
||||
on('init', init);
|
||||
on('destroy', destroy);
|
||||
}
|
68
resources/web/guide/swiper/core/modules/resize/resize.js
Normal file
68
resources/web/guide/swiper/core/modules/resize/resize.js
Normal file
|
@ -0,0 +1,68 @@
|
|||
import { getWindow } from 'ssr-window';
|
||||
export default function Resize({
|
||||
swiper,
|
||||
on,
|
||||
emit
|
||||
}) {
|
||||
const window = getWindow();
|
||||
let observer = null;
|
||||
|
||||
const resizeHandler = () => {
|
||||
if (!swiper || swiper.destroyed || !swiper.initialized) return;
|
||||
emit('beforeResize');
|
||||
emit('resize');
|
||||
};
|
||||
|
||||
const createObserver = () => {
|
||||
if (!swiper || swiper.destroyed || !swiper.initialized) return;
|
||||
observer = new ResizeObserver(entries => {
|
||||
const {
|
||||
width,
|
||||
height
|
||||
} = swiper;
|
||||
let newWidth = width;
|
||||
let newHeight = height;
|
||||
entries.forEach(({
|
||||
contentBoxSize,
|
||||
contentRect,
|
||||
target
|
||||
}) => {
|
||||
if (target && target !== swiper.el) return;
|
||||
newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
|
||||
newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
|
||||
});
|
||||
|
||||
if (newWidth !== width || newHeight !== height) {
|
||||
resizeHandler();
|
||||
}
|
||||
});
|
||||
observer.observe(swiper.el);
|
||||
};
|
||||
|
||||
const removeObserver = () => {
|
||||
if (observer && observer.unobserve && swiper.el) {
|
||||
observer.unobserve(swiper.el);
|
||||
observer = null;
|
||||
}
|
||||
};
|
||||
|
||||
const orientationChangeHandler = () => {
|
||||
if (!swiper || swiper.destroyed || !swiper.initialized) return;
|
||||
emit('orientationchange');
|
||||
};
|
||||
|
||||
on('init', () => {
|
||||
if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') {
|
||||
createObserver();
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('resize', resizeHandler);
|
||||
window.addEventListener('orientationchange', orientationChangeHandler);
|
||||
});
|
||||
on('destroy', () => {
|
||||
removeObserver();
|
||||
window.removeEventListener('resize', resizeHandler);
|
||||
window.removeEventListener('orientationchange', orientationChangeHandler);
|
||||
});
|
||||
}
|
16
resources/web/guide/swiper/core/slide/index.js
Normal file
16
resources/web/guide/swiper/core/slide/index.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import slideTo from './slideTo.js';
|
||||
import slideToLoop from './slideToLoop.js';
|
||||
import slideNext from './slideNext.js';
|
||||
import slidePrev from './slidePrev.js';
|
||||
import slideReset from './slideReset.js';
|
||||
import slideToClosest from './slideToClosest.js';
|
||||
import slideToClickedSlide from './slideToClickedSlide.js';
|
||||
export default {
|
||||
slideTo,
|
||||
slideToLoop,
|
||||
slideNext,
|
||||
slidePrev,
|
||||
slideReset,
|
||||
slideToClosest,
|
||||
slideToClickedSlide
|
||||
};
|
26
resources/web/guide/swiper/core/slide/slideNext.js
Normal file
26
resources/web/guide/swiper/core/slide/slideNext.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
/* eslint no-unused-vars: "off" */
|
||||
export default function slideNext(speed = this.params.speed, runCallbacks = true, internal) {
|
||||
const swiper = this;
|
||||
const {
|
||||
animating,
|
||||
enabled,
|
||||
params
|
||||
} = swiper;
|
||||
if (!enabled) return swiper;
|
||||
let perGroup = params.slidesPerGroup;
|
||||
|
||||
if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
|
||||
perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
|
||||
}
|
||||
|
||||
const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup;
|
||||
|
||||
if (params.loop) {
|
||||
if (animating && params.loopPreventsSlide) return false;
|
||||
swiper.loopFix(); // eslint-disable-next-line
|
||||
|
||||
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
|
||||
}
|
||||
|
||||
return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
|
||||
}
|
59
resources/web/guide/swiper/core/slide/slidePrev.js
Normal file
59
resources/web/guide/swiper/core/slide/slidePrev.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
/* eslint no-unused-vars: "off" */
|
||||
export default function slidePrev(speed = this.params.speed, runCallbacks = true, internal) {
|
||||
const swiper = this;
|
||||
const {
|
||||
params,
|
||||
animating,
|
||||
snapGrid,
|
||||
slidesGrid,
|
||||
rtlTranslate,
|
||||
enabled
|
||||
} = swiper;
|
||||
if (!enabled) return swiper;
|
||||
|
||||
if (params.loop) {
|
||||
if (animating && params.loopPreventsSlide) return false;
|
||||
swiper.loopFix(); // eslint-disable-next-line
|
||||
|
||||
swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
|
||||
}
|
||||
|
||||
const translate = rtlTranslate ? swiper.translate : -swiper.translate;
|
||||
|
||||
function normalize(val) {
|
||||
if (val < 0) return -Math.floor(Math.abs(val));
|
||||
return Math.floor(val);
|
||||
}
|
||||
|
||||
const normalizedTranslate = normalize(translate);
|
||||
const normalizedSnapGrid = snapGrid.map(val => normalize(val));
|
||||
let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
||||
|
||||
if (typeof prevSnap === 'undefined' && params.cssMode) {
|
||||
let prevSnapIndex;
|
||||
snapGrid.forEach((snap, snapIndex) => {
|
||||
if (normalizedTranslate >= snap) {
|
||||
// prevSnap = snap;
|
||||
prevSnapIndex = snapIndex;
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof prevSnapIndex !== 'undefined') {
|
||||
prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
|
||||
}
|
||||
}
|
||||
|
||||
let prevIndex = 0;
|
||||
|
||||
if (typeof prevSnap !== 'undefined') {
|
||||
prevIndex = slidesGrid.indexOf(prevSnap);
|
||||
if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
|
||||
|
||||
if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
|
||||
prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1;
|
||||
prevIndex = Math.max(prevIndex, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
|
||||
}
|
5
resources/web/guide/swiper/core/slide/slideReset.js
Normal file
5
resources/web/guide/swiper/core/slide/slideReset.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
/* eslint no-unused-vars: "off" */
|
||||
export default function slideReset(speed = this.params.speed, runCallbacks = true, internal) {
|
||||
const swiper = this;
|
||||
return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
|
||||
}
|
189
resources/web/guide/swiper/core/slide/slideTo.js
Normal file
189
resources/web/guide/swiper/core/slide/slideTo.js
Normal file
|
@ -0,0 +1,189 @@
|
|||
import { animateCSSModeScroll } from '../../shared/utils.js';
|
||||
export default function slideTo(index = 0, speed = this.params.speed, runCallbacks = true, internal, initial) {
|
||||
if (typeof index !== 'number' && typeof index !== 'string') {
|
||||
throw new Error(`The 'index' argument cannot have type other than 'number' or 'string'. [${typeof index}] given.`);
|
||||
}
|
||||
|
||||
if (typeof index === 'string') {
|
||||
/**
|
||||
* The `index` argument converted from `string` to `number`.
|
||||
* @type {number}
|
||||
*/
|
||||
const indexAsNumber = parseInt(index, 10);
|
||||
/**
|
||||
* Determines whether the `index` argument is a valid `number`
|
||||
* after being converted from the `string` type.
|
||||
* @type {boolean}
|
||||
*/
|
||||
|
||||
const isValidNumber = isFinite(indexAsNumber);
|
||||
|
||||
if (!isValidNumber) {
|
||||
throw new Error(`The passed-in 'index' (string) couldn't be converted to 'number'. [${index}] given.`);
|
||||
} // Knowing that the converted `index` is a valid number,
|
||||
// we can update the original argument's value.
|
||||
|
||||
|
||||
index = indexAsNumber;
|
||||
}
|
||||
|
||||
const swiper = this;
|
||||
let slideIndex = index;
|
||||
if (slideIndex < 0) slideIndex = 0;
|
||||
const {
|
||||
params,
|
||||
snapGrid,
|
||||
slidesGrid,
|
||||
previousIndex,
|
||||
activeIndex,
|
||||
rtlTranslate: rtl,
|
||||
wrapperEl,
|
||||
enabled
|
||||
} = swiper;
|
||||
|
||||
if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
|
||||
let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
|
||||
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
|
||||
|
||||
if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {
|
||||
swiper.emit('beforeSlideChangeStart');
|
||||
}
|
||||
|
||||
const translate = -snapGrid[snapIndex]; // Update progress
|
||||
|
||||
swiper.updateProgress(translate); // Normalize slideIndex
|
||||
|
||||
if (params.normalizeSlideIndex) {
|
||||
for (let i = 0; i < slidesGrid.length; i += 1) {
|
||||
const normalizedTranslate = -Math.floor(translate * 100);
|
||||
const normalizedGrid = Math.floor(slidesGrid[i] * 100);
|
||||
const normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);
|
||||
|
||||
if (typeof slidesGrid[i + 1] !== 'undefined') {
|
||||
if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) {
|
||||
slideIndex = i;
|
||||
} else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) {
|
||||
slideIndex = i + 1;
|
||||
}
|
||||
} else if (normalizedTranslate >= normalizedGrid) {
|
||||
slideIndex = i;
|
||||
}
|
||||
}
|
||||
} // Directions locks
|
||||
|
||||
|
||||
if (swiper.initialized && slideIndex !== activeIndex) {
|
||||
if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
|
||||
if ((activeIndex || 0) !== slideIndex) return false;
|
||||
}
|
||||
}
|
||||
|
||||
let direction;
|
||||
if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index
|
||||
|
||||
if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {
|
||||
swiper.updateActiveIndex(slideIndex); // Update Height
|
||||
|
||||
if (params.autoHeight) {
|
||||
swiper.updateAutoHeight();
|
||||
}
|
||||
|
||||
swiper.updateSlidesClasses();
|
||||
|
||||
if (params.effect !== 'slide') {
|
||||
swiper.setTranslate(translate);
|
||||
}
|
||||
|
||||
if (direction !== 'reset') {
|
||||
swiper.transitionStart(runCallbacks, direction);
|
||||
swiper.transitionEnd(runCallbacks, direction);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (params.cssMode) {
|
||||
const isH = swiper.isHorizontal();
|
||||
const t = rtl ? translate : -translate;
|
||||
|
||||
if (speed === 0) {
|
||||
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
|
||||
|
||||
if (isVirtual) {
|
||||
swiper.wrapperEl.style.scrollSnapType = 'none';
|
||||
swiper._immediateVirtual = true;
|
||||
}
|
||||
|
||||
wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
|
||||
|
||||
if (isVirtual) {
|
||||
requestAnimationFrame(() => {
|
||||
swiper.wrapperEl.style.scrollSnapType = '';
|
||||
swiper._swiperImmediateVirtual = false;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (!swiper.support.smoothScroll) {
|
||||
animateCSSModeScroll({
|
||||
swiper,
|
||||
targetPosition: t,
|
||||
side: isH ? 'left' : 'top'
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
wrapperEl.scrollTo({
|
||||
[isH ? 'left' : 'top']: t,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (speed === 0) {
|
||||
swiper.setTransition(0);
|
||||
swiper.setTranslate(translate);
|
||||
swiper.updateActiveIndex(slideIndex);
|
||||
swiper.updateSlidesClasses();
|
||||
swiper.emit('beforeTransitionStart', speed, internal);
|
||||
swiper.transitionStart(runCallbacks, direction);
|
||||
swiper.transitionEnd(runCallbacks, direction);
|
||||
} else {
|
||||
swiper.setTransition(speed);
|
||||
swiper.setTranslate(translate);
|
||||
swiper.updateActiveIndex(slideIndex);
|
||||
swiper.updateSlidesClasses();
|
||||
swiper.emit('beforeTransitionStart', speed, internal);
|
||||
swiper.transitionStart(runCallbacks, direction);
|
||||
|
||||
if (!swiper.animating) {
|
||||
swiper.animating = true;
|
||||
|
||||
if (!swiper.onSlideToWrapperTransitionEnd) {
|
||||
swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
|
||||
if (!swiper || swiper.destroyed) return;
|
||||
if (e.target !== this) return;
|
||||
swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
||||
swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
|
||||
swiper.onSlideToWrapperTransitionEnd = null;
|
||||
delete swiper.onSlideToWrapperTransitionEnd;
|
||||
swiper.transitionEnd(runCallbacks, direction);
|
||||
};
|
||||
}
|
||||
|
||||
swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
||||
swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
39
resources/web/guide/swiper/core/slide/slideToClickedSlide.js
Normal file
39
resources/web/guide/swiper/core/slide/slideToClickedSlide.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
import $ from '../../shared/dom.js';
|
||||
import { nextTick } from '../../shared/utils.js';
|
||||
export default function slideToClickedSlide() {
|
||||
const swiper = this;
|
||||
const {
|
||||
params,
|
||||
$wrapperEl
|
||||
} = swiper;
|
||||
const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
||||
let slideToIndex = swiper.clickedIndex;
|
||||
let realIndex;
|
||||
|
||||
if (params.loop) {
|
||||
if (swiper.animating) return;
|
||||
realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);
|
||||
|
||||
if (params.centeredSlides) {
|
||||
if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
|
||||
swiper.loopFix();
|
||||
slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index();
|
||||
nextTick(() => {
|
||||
swiper.slideTo(slideToIndex);
|
||||
});
|
||||
} else {
|
||||
swiper.slideTo(slideToIndex);
|
||||
}
|
||||
} else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
||||
swiper.loopFix();
|
||||
slideToIndex = $wrapperEl.children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`).eq(0).index();
|
||||
nextTick(() => {
|
||||
swiper.slideTo(slideToIndex);
|
||||
});
|
||||
} else {
|
||||
swiper.slideTo(slideToIndex);
|
||||
}
|
||||
} else {
|
||||
swiper.slideTo(slideToIndex);
|
||||
}
|
||||
}
|
32
resources/web/guide/swiper/core/slide/slideToClosest.js
Normal file
32
resources/web/guide/swiper/core/slide/slideToClosest.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* eslint no-unused-vars: "off" */
|
||||
export default function slideToClosest(speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) {
|
||||
const swiper = this;
|
||||
let index = swiper.activeIndex;
|
||||
const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
|
||||
const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
|
||||
const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
|
||||
|
||||
if (translate >= swiper.snapGrid[snapIndex]) {
|
||||
// The current translate is on or after the current snap index, so the choice
|
||||
// is between the current index and the one after it.
|
||||
const currentSnap = swiper.snapGrid[snapIndex];
|
||||
const nextSnap = swiper.snapGrid[snapIndex + 1];
|
||||
|
||||
if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {
|
||||
index += swiper.params.slidesPerGroup;
|
||||
}
|
||||
} else {
|
||||
// The current translate is before the current snap index, so the choice
|
||||
// is between the current index and the one before it.
|
||||
const prevSnap = swiper.snapGrid[snapIndex - 1];
|
||||
const currentSnap = swiper.snapGrid[snapIndex];
|
||||
|
||||
if (translate - prevSnap <= (currentSnap - prevSnap) * threshold) {
|
||||
index -= swiper.params.slidesPerGroup;
|
||||
}
|
||||
}
|
||||
|
||||
index = Math.max(index, 0);
|
||||
index = Math.min(index, swiper.slidesGrid.length - 1);
|
||||
return swiper.slideTo(index, speed, runCallbacks, internal);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue