diff --git a/resources/web/guide/24/24.css b/resources/web/guide/24/24.css index c1e19b485d0..eeb78189fe9 100644 --- a/resources/web/guide/24/24.css +++ b/resources/web/guide/24/24.css @@ -147,31 +147,3 @@ 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 52e8ff0e374..880d83ca492 100644 --- a/resources/web/guide/24/24.js +++ b/resources/web/guide/24/24.js @@ -1,129 +1,142 @@ -function OnInit() { - +function OnInit() +{ //let strInput=JSON.stringify(cData); - //HandleModelList(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 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; - pModel = pVal['model']; + let pModel=pVal['model']; - let nTotal = pModel.length; - let ModelHtml = {}; - for (let n = 0; n < nTotal; n++) { - let OneModel = pModel[n]; + 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 < NozzleArray.length; m++) { - let nNozzel = NozzleArray[m]; - HtmlNozzel += '
' + nNozzel + 'mm nozzle
'; + if( !ModelHtml.hasOwnProperty(strVendor)) + ModelHtml[strVendor]=''; + + let NozzleArray=OneModel['nozzle_diameter'].split(';'); + let HtmlNozzel=''; + for(let m=0;m'+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 < 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); - } + 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 SelectPrinterAll( sVendor ) { @@ -234,94 +155,100 @@ function SelectPrinterAll( sVendor ) } -function SelectPrinterAll(sVendor) { - $("input[vendor='" + sVendor + "']").prop("checked", true); -} - - -function SelectPrinterNone(sVendor) { - $("input[vendor='" + sVendor + "']").prop("checked", false); +function SelectPrinterNone( sVendor ) +{ + $("input[vendor='"+sVendor+"']").prop("checked", false); } // -function OnExit() { - let ModelAll = {}; - - let ModelSelect = $("input:checked"); - let nTotal = ModelSelect.length; +function OnExit() +{ + let ModelAll={}; + + let ModelSelect=$("input:checked"); + let nTotal=ModelSelect.length; - if (nTotal == 0) { + 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"); - + + for(let n=0;n 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)); +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 082c5dd5110..87a538f478f 100644 --- a/resources/web/guide/24/index.html +++ b/resources/web/guide/24/index.html @@ -1,6 +1,5 @@ - @@ -8,27 +7,21 @@ - + - + -
Printer Selection
-
- -
-
+
- - + +
+
+
Confirm
+
Cancel
+
+ +
+
+
error
+
+
At least one printer must be selected.
+
+
ok
-
-
Confirm
-
Cancel
+ document.onkeydown = function (event) { + var e = event || window.event || arguments.callee.caller.arguments[0]; + + if (e.keyCode == 27) + ClosePage(); - \ No newline at end of file + if (window.event) { + try { e.keyCode = 0; } catch (e) { } + e.returnValue = false; + } + }; + +