[PATCH 1/2] templates: Get rid of type attribute in script tags

Andrew Donnellan ajd at linux.ibm.com
Thu Oct 31 17:57:36 AEDT 2019


In HTML5, the type attribute of a script tag is optional if it's
JavaScript.

Remove all occurrences. The only real gain is slightly smaller page output,
but it also shuts up validators that like to be noisy about this.

Signed-off-by: Andrew Donnellan <ajd at linux.ibm.com>
---
 patchwork/templates/patchwork/bundle.html     |  4 ++--
 patchwork/templates/patchwork/login.html      |  2 +-
 patchwork/templates/patchwork/submission.html |  2 +-
 templates/base.html                           | 14 +++++++-------
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/patchwork/templates/patchwork/bundle.html b/patchwork/templates/patchwork/bundle.html
index b5c9f90a4afd..411c18b5b345 100644
--- a/patchwork/templates/patchwork/bundle.html
+++ b/patchwork/templates/patchwork/bundle.html
@@ -4,8 +4,8 @@
 {% load static %}
 
 {% block headers %}
-  <script type="text/javascript" src="{% static "js/jquery.tablednd.js" %}"></script>
-  <script type="text/javascript" src="{% static "js/bundle.js" %}"></script>
+  <script src="{% static "js/jquery.tablednd.js" %}"></script>
+  <script src="{% static "js/bundle.js" %}"></script>
 {% endblock %}
 {% block title %}{{project.name}}{% endblock %}
 
diff --git a/patchwork/templates/patchwork/login.html b/patchwork/templates/patchwork/login.html
index e8b1a4e8f242..46f77edf6984 100644
--- a/patchwork/templates/patchwork/login.html
+++ b/patchwork/templates/patchwork/login.html
@@ -4,7 +4,7 @@
 {% block heading %}Sign in to Patchwork{% endblock %}
 
 {% block headers %}
-  <script type="text/javascript">
+  <script>
     $(function() {
         $('#id_username').focus()
     });
diff --git a/patchwork/templates/patchwork/submission.html b/patchwork/templates/patchwork/submission.html
index 6fa816397bd0..1fa89f945da1 100644
--- a/patchwork/templates/patchwork/submission.html
+++ b/patchwork/templates/patchwork/submission.html
@@ -8,7 +8,7 @@
 {% block title %}{{submission.name}}{% endblock %}
 
 {% block body %}
-<script type="text/javascript">
+<script>
 function toggle_div(link_id, headers_id)
 {
     var link = document.getElementById(link_id)
diff --git a/templates/base.html b/templates/base.html
index 802ea98b0745..01b0d6b5e598 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -7,9 +7,9 @@
   <link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.min.css" %}"/>
   <link rel="stylesheet" type="text/css" href="{% static "css/selectize.bootstrap3.css" %}"/>
   <link rel="stylesheet" type="text/css" href="{% static "css/style.css" %}"/>
-  <script type="text/javascript" src="{% static "js/jquery-1.10.1.min.js" %}"></script>
-  <script type="text/javascript" src="{% static "js/jquery.stickytableheaders.min.js" %}"></script>
-  <script type="text/javascript" src="{% static "js/jquery.checkboxes-1.0.6.min.js" %}"></script>
+  <script src="{% static "js/jquery-1.10.1.min.js" %}"></script>
+  <script src="{% static "js/jquery.stickytableheaders.min.js" %}"></script>
+  <script src="{% static "js/jquery.checkboxes-1.0.6.min.js" %}"></script>
   <!-- IE8 support of HTML5 elements and media queries -->
   <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
   <!--[if lt IE 9]>
@@ -18,10 +18,10 @@
     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
     <script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script>
   <![endif]-->
-  <script type="text/javascript" src="{% static "js/bootstrap.min.js" %}"></script>
-  <script type="text/javascript" src="{% static "js/selectize.min.js" %}"></script>
-  <script type="text/javascript" src="{% static "js/clipboard.min.js" %}"></script>
-  <script type="text/javascript">
+  <script src="{% static "js/bootstrap.min.js" %}"></script>
+  <script src="{% static "js/selectize.min.js" %}"></script>
+  <script src="{% static "js/clipboard.min.js" %}"></script>
+  <script>
    $(document).ready(function() {
        new Clipboard(document.querySelectorAll('button.btn-copy'));
    });
-- 
2.20.1



More information about the Patchwork mailing list