From caaa969ba1e2b49d712050cfee1f3e06b969b731 Mon Sep 17 00:00:00 2001 From: ZdDroid <43038779+ZdDroid@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:54:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=89=93=E5=8D=B0=E6=9C=BA?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=B3=E9=94=AE=E5=AD=97=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=20(#2376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ZdDroid <601865048@qq.com> --- resources/web/guide/24/24.css | 28 ++ resources/web/guide/24/24.js | 432 +++++++++++++++++------------- resources/web/guide/24/index.html | 95 +++---- 3 files changed, 326 insertions(+), 229 deletions(-) diff --git a/resources/web/guide/24/24.css b/resources/web/guide/24/24.css index eeb78189fe9..c1e19b485d0 100644 --- a/resources/web/guide/24/24.css +++ b/resources/web/guide/24/24.css @@ -147,3 +147,31 @@ display: flex; justify-content:space-around; } + +.search { + width: 100%; + position: relative; + display: flex; + } + + .searchTerm { + width: 100%; + border: 3px solid #009688; + /*border-right: none;*/ + padding: 5px; + height: 20px; + border-radius: 5px 5px 5px 5px; + outline: none; + color: #9DBFAF; + } + + .searchTerm:focus{ + color: #009688; + } + + /*Resize the wrap to see the search bar change!*/ + .wrap{ + width: 30%; + padding-bottom: 5px; + padding-left: 42px; + } \ No newline at end of file diff --git a/resources/web/guide/24/24.js b/resources/web/guide/24/24.js index 880d83ca492..b7e16b7850e 100644 --- a/resources/web/guide/24/24.js +++ b/resources/web/guide/24/24.js @@ -1,142 +1,129 @@ -function OnInit() -{ +function OnInit() { + //let strInput=JSON.stringify(cData); - //HandleStudio(strInput); - + //HandleModelList(cData); + TranslatePage(); - + RequestProfile(); } -function RequestProfile() -{ - var tSend={}; - tSend['sequence_id']=Math.round(new Date() / 1000); - tSend['command']="request_userguide_profile"; - - SendWXMessage( JSON.stringify(tSend) ); +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']; +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') - { + + if (strCmd == 'response_userguide_profile') { HandleModelList(pVal['response']); } } -function ShowPrinterThumb(pItem, strImg) -{ - $(pItem).attr('src',strImg); - $(pItem).attr('onerror',null); +function ShowPrinterThumb(pItem, strImg) { + $(pItem).attr('src', strImg); + $(pItem).attr('onerror', null); } -function HandleModelList( pVal ) -{ - if( !pVal.hasOwnProperty("model") ) +function HandleModelList(pVal) { + if (!pVal.hasOwnProperty("model")) return; - let pModel=pVal['model']; - - let nTotal=pModel.length; - let ModelHtml={}; - for(let n=0;n'+ -'
'+ -'
'+ -'
all
'+ -'
none
'+ -'
'+ -' '+sVV+''+ -'
'+ -'
'+ -'
'+ -''; - + if ($(".OneVendorBlock[vendor='" + strVendor + "']").length == 0) { + let sVV = strVendor; + if (sVV == "BBL") + sVV = "Bambu Lab"; + if (sVV == "Custom") + sVV = "Custom Printer"; + if (sVV == "Other") + sVV = "Orca colosseum"; + + let HtmlNewVendor = '
' + + '
' + + '
' + + '
all
' + + '
none
' + + '
' + + ' ' + sVV + '' + + '
' + + '
' + + '
' + + '
'; + $('#Content').append(HtmlNewVendor); } - - let ModelName=OneModel['model']; - + + 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'+nNozzel+'mm nozzle'; + 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 += '
' + nNozzel + 'mm nozzle
'; } - - let CoverImage=OneModel['cover']; - ModelHtml[strVendor]+='
'+ -'
'+ -'
'+OneModel['model']+'
'+ HtmlNozzel +'
'; + + let CoverImage = OneModel['cover']; + ModelHtml[strVendor] += '
' + + '
' + + '
' + OneModel['model'] + '
' + HtmlNozzel + '
'; } - + //Update Nozzel Html Append - for( let key in ModelHtml ) - { - $(".OneVendorBlock[vendor='"+key+"'] .PrinterArea").append( ModelHtml[key] ); + for (let key in ModelHtml) { + $(".OneVendorBlock[vendor='" + key + "'] .PrinterArea").append(ModelHtml[key]); } - - + + //Update Checkbox $('input').prop("checked", false); - for(let m=0;m' + + '
' + + '
' + + '
all
' + + '
none
' + + '
' + + ' ' + sVV + '' + + '
' + + '
' + + '
' + + ''; + + $('#Content').append(HtmlNewVendor); + } + + //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 += '
' + nNozzel + 'mm nozzle
'; + } + + let CoverImage = OneModel['cover']; + ModelHtml[strVendor] += '
' + + '
' + + '
' + OneModel['model'] + '
' + HtmlNozzel + '
'; + } + + //Update Nozzel Html Append + for (let key in ModelHtml) { + let obj = $(".OneVendorBlock[vendor='" + key + "'] .PrinterArea"); + obj.empty(); + obj.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'][vendor='Custom']").prop("checked", true); + // } + + TranslatePage(); } -function SelectPrinterNone( sVendor ) -{ - $("input[vendor='"+sVendor+"']").prop("checked", false); +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 ) - { +function OnExit() { + let ModelAll = {}; + + let ModelSelect = $("input:checked"); + let nTotal = ModelSelect.length; + + if (nTotal == 0) { ShowNotice(1); - + return 0; } - - for(let n=0;n0) - { - 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) ); +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)); } } diff --git a/resources/web/guide/24/index.html b/resources/web/guide/24/index.html index 87a538f478f..d4c66983698 100644 --- a/resources/web/guide/24/index.html +++ b/resources/web/guide/24/index.html @@ -1,27 +1,34 @@ + - - -引导_P21 - - - - - - - - - - + + + 引导_P21 + + + + + + + + + + + -
-
Printer Selection
-
-
+
+
Printer Selection
+
+
+ +
+
- - -
-
-
Confirm
-
Cancel
-
- -
-
-
error
-
-
At least one printer must be selected.
-
-
ok
+
+
+
Confirm
+
Cancel
-
- - - - - + + \ No newline at end of file