mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Add turbolinks
- Load scripts in the head with `defer` instead of at the end of the body - Disable turbolinks for application shortcuts and manual download Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
d8c7382045
commit
f762f57d1c
1
debian/control
vendored
1
debian/control
vendored
@ -63,6 +63,7 @@ Depends: ${python3:Depends}
|
|||||||
, libjs-jquery
|
, libjs-jquery
|
||||||
, libjs-modernizr
|
, libjs-modernizr
|
||||||
, network-manager
|
, network-manager
|
||||||
|
, node-turbolinks
|
||||||
, ppp
|
, ppp
|
||||||
, pppoe
|
, pppoe
|
||||||
, python3-apt
|
, python3-apt
|
||||||
|
|||||||
@ -94,3 +94,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block page_js %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function($) {
|
||||||
|
let downloadManualButton = $('a[href="/plinth/help/manual/download/"]');
|
||||||
|
downloadManualButton.attr("data-turbolinks", "false");
|
||||||
|
})(jQuery);
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
@ -70,6 +70,15 @@
|
|||||||
<link rel="stylesheet" href="{% static '/javascript/bootstrap/css/bootstrap.min.css' %}"/>
|
<link rel="stylesheet" href="{% static '/javascript/bootstrap/css/bootstrap.min.css' %}"/>
|
||||||
<link rel="stylesheet" href="{% static 'theme/css/plinth.css' %}"/>
|
<link rel="stylesheet" href="{% static 'theme/css/plinth.css' %}"/>
|
||||||
<link rel="stylesheet" href="{% static 'theme/css/responsive.css' %}"/>
|
<link rel="stylesheet" href="{% static 'theme/css/responsive.css' %}"/>
|
||||||
|
<!-- Local link to system Turbolinks JS -->
|
||||||
|
<script type="text/javascript" src="{% static '/javascript/turbolinks/turbolinks.js' %}" defer></script>
|
||||||
|
<!-- Local link to system Modernizr (includes HTML5 Shiv) -->
|
||||||
|
<script type="text/javascript" src="{% static '/javascript/modernizr/modernizr.min.js' %}" defer></script>
|
||||||
|
<!-- Local link to system jQuery -->
|
||||||
|
<!-- TODO Deferring jQuery is causing scripts to be loaded before jQuery is available -->
|
||||||
|
<script type="text/javascript" src="{% static '/javascript/jquery/jquery.min.js' %}"></script>
|
||||||
|
<!-- Local link to system Bootstrap JS -->
|
||||||
|
<script type="text/javascript" src="{% static '/javascript/bootstrap/js/bootstrap.min.js' %}" defer></script>
|
||||||
{% block app_head %}<!-- placeholder for app/module-specific head files -->{% endblock %}
|
{% block app_head %}<!-- placeholder for app/module-specific head files -->{% endblock %}
|
||||||
{% block page_head %}<!-- placeholder for page-specific head files -->{% endblock %}
|
{% block page_head %}<!-- placeholder for page-specific head files -->{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
@ -244,14 +253,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</footer><!--/.footer-->
|
</footer><!--/.footer-->
|
||||||
</div><!--/#container-->
|
</div><!--/#container-->
|
||||||
<!-- JavaScript <script> tags are placed at the end of the document to speed up initial page loads-->
|
|
||||||
<!-- Local link to system Modernizr (includes HTML5 Shiv) -->
|
|
||||||
<script type="text/javascript" src="{% static '/javascript/modernizr/modernizr.min.js' %}"></script>
|
|
||||||
<!-- Local link to system jQuery -->
|
|
||||||
<script type="text/javascript" src="{% static '/javascript/jquery/jquery.min.js' %}"></script>
|
|
||||||
<!-- Local link to system Bootstrap JS -->
|
|
||||||
<script type="text/javascript" src="{% static '/javascript/bootstrap/js/bootstrap.min.js' %}"></script>
|
|
||||||
|
|
||||||
{% block app_js %}<!-- placeholder for app-specific js files -->{% endblock %}
|
{% block app_js %}<!-- placeholder for app-specific js files -->{% endblock %}
|
||||||
{% block page_js %}<!-- placeholder for page-specific js files -->{% endblock %}
|
{% block page_js %}<!-- placeholder for page-specific js files -->{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -82,9 +82,9 @@
|
|||||||
{% if user.is_authenticated or not shortcut.login_required %}
|
{% if user.is_authenticated or not shortcut.login_required %}
|
||||||
<div class="card thumbnail">
|
<div class="card thumbnail">
|
||||||
{% if selected_id == shortcut.id %}
|
{% if selected_id == shortcut.id %}
|
||||||
<a href="{{ shortcut.url }}" class="nav-link active">
|
<a href="{{ shortcut.url }}" class="nav-link active" data-turbolinks="false">
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ shortcut.url }}" class="nav-link">
|
<a href="{{ shortcut.url }}" class="nav-link" data-turbolinks="false">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="card-icon">
|
<div class="card-icon">
|
||||||
<img src="{% static 'theme/icons/' %}{{ shortcut.icon }}.png"/>
|
<img src="{% static 'theme/icons/' %}{{ shortcut.icon }}.png"/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user