Skip to content

Commit

Permalink
Improved UI to make it clear that the browser is not supported
Browse files Browse the repository at this point in the history
Some users do not understand that the browser does not support WebSerial because on the page https://hack-gpon.org/ont-huawei-ma5671a-ymodem/ pressing the button opens the flash window, with this PR the button is deactivated if the browser is not supported and the the strikethrough out character is applied to button text
  • Loading branch information
Ernesto Castellotti committed Jun 7, 2024
1 parent 276ec0d commit d5b910b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions _includes/root_lantiq.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ <h2>Root status</h2>
document.getElementById('start-button').disabled = false;
} else {
document.getElementById('browser-error').style.display = 'block';
document.getElementById('start-button').disabled = true;
document.getElementById('start-button').innerHTML=document.getElementById('start-button').innerText.strike();
}
const acontroller = new AbortController();
const cs = acontroller.signal;
Expand Down
4 changes: 3 additions & 1 deletion _includes/ymodem_lantiq.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ <h2>Flash firmware</h2>
document.getElementById('flash-start-button').disabled = false;
} else {
document.getElementById('flash-browser-error').style.display = 'block';
document.getElementById('flash-start-button').disabled = true;
document.getElementById('flash-start-button').innerHTML=document.getElementById('flash-start-button').innerText.strike()
}
const acontroller = new AbortController();
const cs = acontroller.signal;
Expand Down Expand Up @@ -202,4 +204,4 @@ <h2>Flash firmware</h2>
}
});
};
</script>
</script>
3 changes: 1 addition & 2 deletions _ont/ont-fs-com-gpon-onu-stick-with-mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ When you are ready with everything plugged in you need to press the button below

{: .text-center .fs-6 }
<button id="start-button" class="btn btn-blue" data-jtd-toggle="modal" data-jtd-target="#root-modal" disabled>Start emergency unlock!</button>
{% include root_lantiq.html modelName="FS GPON ONU Stick" unlockHuaweiShell=false %}

<div id="browser-error" style="display:none">{% include alert.html content="This browser is not compatible with the emergency unlock procedure. See the <a href='https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API#browser_compatibility'>Browser compatibility</a>" alert="Note" icon="svg-warning" color="red" %}</div>
{% include root_lantiq.html modelName="FS GPON ONU Stick" unlockHuaweiShell=false %}
<noscript>
{% include alert.html content="Your browser does not support JavaScript!" alert="Note" icon="svg-warning" color="red" %}
</noscript>
Expand Down
3 changes: 1 addition & 2 deletions _ont/ont-huawei-ma5671a-root-web.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ Connect the TTL adapter to the computer, once done press the following button. A

{: .text-center .fs-6 }
<button id="start-button" class="btn btn-blue" data-jtd-toggle="modal" data-jtd-target="#root-modal" disabled>Start root!</button>
{% include root_lantiq.html modelName="Huawei MA5671A" unlockHuaweiShell=true %}

<div id="browser-error" style="display:none">{% include alert.html content="This browser is not compatible with the web-root procedure. See the <a href='https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API#browser_compatibility'>Browser compatibility</a>" alert="Note" icon="svg-warning" color="red" %}</div>
{% include root_lantiq.html modelName="Huawei MA5671A" unlockHuaweiShell=true %}
<noscript>
{% include alert.html content="Your browser does not support JavaScript!" alert="Note" icon="svg-warning" color="red" %}
</noscript>
Expand Down

0 comments on commit d5b910b

Please sign in to comment.