web2019/templates/page-place-order.html
Egor Savkin c63249e8a0 Inject JS in templates with correct domains
Signed-off-by: Egor Savkin <es@m-labs.hk>
2024-07-18 11:56:58 +08:00

58 lines
1.4 KiB
HTML

{% extends 'section.html' %}
{% block deferred_styles %}
{{ super() }}
<link rel="stylesheet" href="{{ get_url(path='css/order-hardware.css', cachebust=true) }}">
{% endblock %}
{% block hero %}{% endblock %}
{% block main %}
<main id="root-shop"></main>
{% endblock %}
{% block footer %}{% endblock %}
{% block js %}
<script>
(function () {
function deviceIsMobile() {
// Do not rely on User-Agent: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
// Be in sync with css/order-hardware.css
return window.innerWidth < 768;
}
function isTouchEnabled() {
return ('ontouchstart' in window) ||
(navigator.maxTouchPoints > 0) ||
(navigator.msMaxTouchPoints > 0);
}
window.deviceIsMobile = deviceIsMobile;
window.isTouchEnabled = isTouchEnabled;
})();
</script>
<!-- Load Data -->
<script src="{{ get_url(path='js/shop_data.js', cachebust=true) }}"></script>
<script>
window.DOMAIN = "{{get_env(name="DOMAINNAME", default="m-labs.hk")}}";
window.API_RFQ = `https://hooks.${window.DOMAIN}/rfq`;
</script>
<!-- Load our React component. -->
<!-- <script type="text/babel" src="{{ get_url(path='js/shop.jsx', cachebust=true) }}"></script> -->
<script src="{{ get_url(path='js/shop.bundle.js', cachebust=true) }}"></script>
{% endblock %}