From ac103d7132986cdfcf1216edfb35efe6357c9940 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 1 Jun 2020 18:43:55 -0700 Subject: [PATCH] *: Remove use of Turbolinks library See #1841 for discussion on why Turbolinks needs to be removed. Closes: #1841. Closes: #1804. Tests performed: - There are no more references to 'turbolinks' in source code other than .po(t) files and the manual. - When loading a page, turbolinks.js is no longer loaded. - The following links don't have data-turbolinks attribute and work well when clicked.a - Gitweb repository links - Download manual links (en, es) - Ikiwiki wiki links - Sharing app web share links - TT-RSS mobile app link - 'Launch web client' button - 'Launch' button in web section of clients table - Active and regular front page shortcut - Roundcube does not have a link to /roundcube in description. - turblinks not present in /static/jslicense.html . LibreJs accepts all scripts. Reported-by: Veiko Aasa Signed-off-by: Sunil Mohan Adapa Tested-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- debian/control | 1 - .../gitweb/templates/gitweb_configure.html | 1 - plinth/modules/help/static/help.js | 28 ------------------- .../modules/help/templates/help_manual.html | 4 --- .../ikiwiki/templates/ikiwiki_configure.html | 1 - plinth/modules/roundcube/__init__.py | 3 +- plinth/modules/shaarli/__init__.py | 6 ++-- plinth/modules/sharing/templates/sharing.html | 3 +- plinth/modules/ttrss/__init__.py | 3 +- plinth/templates/base.html | 3 -- plinth/templates/clients-button.html | 4 +-- plinth/templates/clients.html | 2 +- plinth/templates/index.html | 4 +-- static/jslicense.html | 9 ------ static/themes/default/css/main.css | 5 ---- 15 files changed, 10 insertions(+), 67 deletions(-) delete mode 100644 plinth/modules/help/static/help.js diff --git a/debian/control b/debian/control index 8992c4d7a..d14cd7ded 100644 --- a/debian/control +++ b/debian/control @@ -85,7 +85,6 @@ Depends: lsof, netcat-openbsd, network-manager, - node-turbolinks, ppp, pppoe, python3-apt, diff --git a/plinth/modules/gitweb/templates/gitweb_configure.html b/plinth/modules/gitweb/templates/gitweb_configure.html index b5152afae..888241a64 100644 --- a/plinth/modules/gitweb/templates/gitweb_configure.html +++ b/plinth/modules/gitweb/templates/gitweb_configure.html @@ -70,7 +70,6 @@ {{ repo.name }} {% else %} {{ repo.name }} diff --git a/plinth/modules/help/static/help.js b/plinth/modules/help/static/help.js deleted file mode 100644 index d38de99ff..000000000 --- a/plinth/modules/help/static/help.js +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -/** - * @licstart The following is the entire license notice for the JavaScript - * code in this page. - * - * This file is part of FreedomBox. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - * @licend The above is the entire license notice for the JavaScript code - * in this page. - */ - -(function($) { - let downloadManualButton = $('a[href="/plinth/help/manual-download/"]'); - downloadManualButton.attr("data-turbolinks", "false"); -})(jQuery); diff --git a/plinth/modules/help/templates/help_manual.html b/plinth/modules/help/templates/help_manual.html index 11bce5c98..18113cd90 100644 --- a/plinth/modules/help/templates/help_manual.html +++ b/plinth/modules/help/templates/help_manual.html @@ -26,7 +26,3 @@ {{ content|safe }} {% endblock %} - -{% block page_js %} - -{% endblock %} diff --git a/plinth/modules/ikiwiki/templates/ikiwiki_configure.html b/plinth/modules/ikiwiki/templates/ikiwiki_configure.html index 13864598e..1f2eb2add 100644 --- a/plinth/modules/ikiwiki/templates/ikiwiki_configure.html +++ b/plinth/modules/ikiwiki/templates/ikiwiki_configure.html @@ -36,7 +36,6 @@ {{ site.1 }} diff --git a/plinth/modules/roundcube/__init__.py b/plinth/modules/roundcube/__init__.py index 7acab823e..25a055d09 100644 --- a/plinth/modules/roundcube/__init__.py +++ b/plinth/modules/roundcube/__init__.py @@ -23,8 +23,7 @@ _description = [ 'full functionality you expect from an email client, including ' 'MIME support, address book, folder manipulation, message ' 'searching and spell checking.'), - _('You can access Roundcube from /roundcube. Provide the username and password of the email ' + _('You can use it by providing the username and password of the email ' 'account you wish to access followed by the domain name of the ' 'IMAP server for your email provider, like imap.example.com' '. For IMAP over SSL (recommended), fill the server field ' diff --git a/plinth/modules/shaarli/__init__.py b/plinth/modules/shaarli/__init__.py index f7d1ecfdb..bcdbb3698 100644 --- a/plinth/modules/shaarli/__init__.py +++ b/plinth/modules/shaarli/__init__.py @@ -18,10 +18,8 @@ managed_packages = ['shaarli'] _description = [ _('Shaarli allows you to save and share bookmarks.'), - _('When enabled, Shaarli will be available from /shaarli path on the web server. Note that ' - 'Shaarli only supports a single user account, which you will need to ' - 'setup on the initial visit.'), + _('Note that Shaarli only supports a single user account, which you will ' + 'need to setup on the initial visit.'), ] app = None diff --git a/plinth/modules/sharing/templates/sharing.html b/plinth/modules/sharing/templates/sharing.html index c8f6afb10..8d3f3f5be 100644 --- a/plinth/modules/sharing/templates/sharing.html +++ b/plinth/modules/sharing/templates/sharing.html @@ -48,8 +48,7 @@ {{ share.name }} {{ share.path }} - + {{ share.url }} diff --git a/plinth/modules/ttrss/__init__.py b/plinth/modules/ttrss/__init__.py index d60155ed2..18784bdaf 100644 --- a/plinth/modules/ttrss/__init__.py +++ b/plinth/modules/ttrss/__init__.py @@ -35,8 +35,7 @@ _description = [ box_name=_(cfg.box_name), users_url=reverse_lazy('users:index')), format_lazy( _('When using a mobile or desktop application for Tiny Tiny RSS, use ' - 'the URL ' - '/tt-rss-app for connecting.')) + 'the URL /tt-rss-app for connecting.')) ] app = None diff --git a/plinth/templates/base.html b/plinth/templates/base.html index 3b9308a80..174f33bc6 100644 --- a/plinth/templates/base.html +++ b/plinth/templates/base.html @@ -24,7 +24,6 @@ maximum-scale = 1.0 retains dimensions instead of zooming in if page width < device width --> - @@ -56,8 +55,6 @@ - - diff --git a/plinth/templates/clients-button.html b/plinth/templates/clients-button.html index 674777dfd..e36b05b26 100644 --- a/plinth/templates/clients-button.html +++ b/plinth/templates/clients-button.html @@ -9,10 +9,10 @@ {% with client_platforms=clients|clients_get_platforms %} {% if client_platforms.web|length == 1 %} + {% endif %}> {% trans "Launch web client" %} diff --git a/plinth/templates/clients.html b/plinth/templates/clients.html index 5277179a9..a23f31d8d 100644 --- a/plinth/templates/clients.html +++ b/plinth/templates/clients.html @@ -21,7 +21,7 @@ {{ client.name }} diff --git a/plinth/templates/index.html b/plinth/templates/index.html index 2f77bb559..5d6e31819 100644 --- a/plinth/templates/index.html +++ b/plinth/templates/index.html @@ -65,9 +65,9 @@ {% if user.is_authenticated or not shortcut.login_required %}
{% if selected_shortcut.component_id == shortcut.component_id %} - + {% else %} - + {% endif %}
{{ shortcut.name }} diff --git a/static/jslicense.html b/static/jslicense.html index 967a6f45c..de895c279 100644 --- a/static/jslicense.html +++ b/static/jslicense.html @@ -37,15 +37,6 @@ modernizr - - - turbolinks.js - Expat - - - node-turbolinks - - jsxc-plinth.js diff --git a/static/themes/default/css/main.css b/static/themes/default/css/main.css index 40137df88..edc66372e 100644 --- a/static/themes/default/css/main.css +++ b/static/themes/default/css/main.css @@ -480,11 +480,6 @@ a.menu_link_active { background-image: url('../img/system-background.svg'); } -.turbolinks-progress-bar { - height: 3px; - background-color: white; -} - .names-table { table-layout: fixed; overflow-wrap: break-word;