[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Mathieu Othacehe |
Date: |
Fri, 23 Apr 2021 09:12:05 -0400 (EDT) |
branch: master
commit 53d87e849d2c36558e86307afdb1377b6158d768
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Fri Apr 23 15:06:42 2021 +0200
Rationalize static files.
* src/static/js/popper.min.js: New file.
* src/static/js/jquery-3.6.0.min.js: Remove it.
* src/static/js/jquery-3.3.1.min.js: New file.
* src/static/js/cuirass.js: New file.
* src/static/js/bootstrap.min.js: New file.
* src/static/css/bootstrap.css: Rename it ...
* src/static/css/bootstrap.min.css: ... into this new file.
* src/cuirass/templates.scm (html-page): Adapt it.
* Makefile.am (dist_css_DATA, dist_js_DATA): Adapt them.
---
Makefile.am | 8 ++--
src/cuirass/http.scm | 8 ++--
src/cuirass/templates.scm | 45 +++++-----------------
.../css/{bootstrap.css => bootstrap.min.css} | 0
src/static/js/bootstrap.min.js | 7 ++++
src/static/js/cuirass.js | 30 +++++++++++++++
src/static/js/jquery-3.3.1.min.js | 2 +
src/static/js/jquery-3.6.0.min.js | 2 -
src/static/js/popper.min.js | 5 +++
9 files changed, 63 insertions(+), 44 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index c19a913..052fe7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,7 +101,7 @@ dist_sql_DATA = \
dist_css_DATA = \
src/static/css/choices.min.css \
src/static/css/cuirass.css \
- src/static/css/bootstrap.css \
+ src/static/css/bootstrap.min.css \
src/static/css/datatables.min.css \
src/static/css/open-iconic-bootstrap.css
dist_fonts_DATA = \
@@ -114,12 +114,14 @@ dist_images_DATA = \
src/static/images/guix.png \
src/static/images/icon.png
dist_js_DATA = \
- src/static/js/bootstrap.bundle.min.js \
+ src/static/js/bootstrap.min.js \
+ src/static/js/cuirass.js \
src/static/js/chart.js \
src/static/js/choices.min.js \
src/static/js/d3.v6.min.js \
src/static/js/datatables.min.js \
- src/static/js/jquery-3.6.0.min.js
+ src/static/js/jquery-3.3.1.min.js \
+ src/static/js/popper.min.js
TEST_EXTENSIONS = .scm .sh
AM_TESTS_ENVIRONMENT = \
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 78ad9e9..5de391c 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -76,7 +76,7 @@
("html" . (text/html))))
(define %file-white-list
- '("css/bootstrap.css"
+ '("css/bootstrap.min.css"
"css/choices.min.css"
"css/datatables.min.css"
"css/cuirass.css"
@@ -85,11 +85,13 @@
"fonts/open-iconic.woff"
"images/icon.png"
"images/guix.png"
- "js/bootstrap.bundle.min.js"
"js/chart.js"
+ "js/cuirass.js"
"js/d3.v6.min.js"
"js/datatables.min.js"
- "js/jquery-3.6.0.min.js"
+ "js/jquery-3.3.1.min.js"
+ "js/popper.min.js"
+ "js/bootstrap.min.js"
"js/choices.min.js"))
(define (build->hydra-build build)
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
index a3f3f36..5a49313 100644
--- a/src/cuirass/templates.scm
+++ b/src/cuirass/templates.scm
@@ -120,7 +120,7 @@ system whose names start with " (code "guile-") ":" (br)
"shrink-to-fit=no")
", "))))
(link (@ (rel "stylesheet")
- (href "/static/css/bootstrap.css")))
+ (href "/static/css/bootstrap.min.css")))
(link (@ (rel "stylesheet")
(href "/static/css/datatables.min.css")))
(link (@ (rel "stylesheet")
@@ -131,41 +131,14 @@ system whose names start with " (code "guile-") ":" (br)
(href "/static/css/cuirass.css")))
(link (@ (rel "icon") (type "image/png")
(href "/static/images/icon.png")))
- (script (@ (src "/static/js/jquery-3.6.0.min.js")))
- (script (@ (src "/static/js/bootstrap.bundle.min.js")))
- (script (@ (src "/static/js/datatables.min.js")))
- (script (@ (src "/static/js/d3.v6.min.js")))
- (script "
-$(document).ready(function() {
- var default_opts = {
-paging: false,
-searching: false,
-info: false,
-order: [],
-};
- var spec_table = $('#spec-table');
- if (spec_table.find('th').length > 1) {
- spec_table.DataTable({
-...default_opts,
-/* Do not sort the 'Action' column. */
-columnDefs: [
- { orderable: false, targets: 5 },
- { orderable: false, targets: 6 }
- ],
-});
-}
- var eval_table = $('#eval-table');
- if (eval_table.find('th').length > 1) {
- eval_table.DataTable({
-...default_opts,
-columnDefs: [
- { orderable: false, targets: 0 },
- { orderable: false, targets: 1 },
- { orderable: false, targets: 8 }
- ],
-});
-}
-});")
+ ;; The empty strings are mandatory to force the SXML parser to
+ ;; create end script tags.
+ (script (@ (src "/static/js/jquery-3.3.1.min.js")) "")
+ (script (@ (src "/static/js/popper.min.js")) "")
+ (script (@ (src "/static/js/bootstrap.min.js")) "")
+ (script (@ (src "/static/js/datatables.min.js")) "")
+ (script (@ (src "/static/js/d3.v6.min.js")) "")
+ (script (@ (src "/static/js/cuirass.js")) "")
(title ,title))
(body
(header
diff --git a/src/static/css/bootstrap.css b/src/static/css/bootstrap.min.css
similarity index 100%
rename from src/static/css/bootstrap.css
rename to src/static/css/bootstrap.min.css
diff --git a/src/static/js/bootstrap.min.js b/src/static/js/bootstrap.min.js
new file mode 100644
index 0000000..9df6b6c
--- /dev/null
+++ b/src/static/js/bootstrap.min.js
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v4.2.1 (https://getbootstrap.com/)
+ * Copyright 2011-2018 The Bootstrap Authors
(https://github.com/twbs/bootstrap/graphs/contributors)
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof
module?e(exports,require("popper.js"),require("jquery")):"function"==typeof
define&&define.amd?define(["exports","popper.js","jquery"],e):e(t.bootstrap={},t.Popper,t.jQuery)}(this,function(t,u,g){"use
strict";function i(t,e){for(var n=0;n<e.length;n++){var
i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in
i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return
e&&i(t.prototype,e),n&&i(t,n),t [...]
+//# sourceMappingURL=bootstrap.min.js.map
\ No newline at end of file
diff --git a/src/static/js/cuirass.js b/src/static/js/cuirass.js
new file mode 100644
index 0000000..b6265f8
--- /dev/null
+++ b/src/static/js/cuirass.js
@@ -0,0 +1,30 @@
+$(document).ready(function() {
+ var default_opts = {
+ paging: false,
+ searching: false,
+ info: false,
+ order: [],
+ };
+ var spec_table = $('#spec-table');
+ if (spec_table.find('th').length > 1) {
+ spec_table.DataTable({
+ ...default_opts,
+ /* Do not sort the 'Action' column. */
+ columnDefs: [
+ { orderable: false, targets: 5 },
+ { orderable: false, targets: 6 }
+ ],
+ });
+ }
+ var eval_table = $('#eval-table');
+ if (eval_table.find('th').length > 1) {
+ eval_table.DataTable({
+ ...default_opts,
+ columnDefs: [
+ { orderable: false, targets: 0 },
+ { orderable: false, targets: 1 },
+ { orderable: false, targets: 8 }
+ ],
+ });
+ }
+});
diff --git a/src/static/js/jquery-3.3.1.min.js
b/src/static/js/jquery-3.3.1.min.js
new file mode 100644
index 0000000..f4ca9b2
--- /dev/null
+++ b/src/static/js/jquery-3.3.1.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.3.1
-ajax,-ajax/jsonp,-ajax/load,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector
| (c) JS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof
module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw
new Error("jQuery requires a window with a document");return
t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use
strict";var
n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,u=n.push,s=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,d=f.toString,p=d.call(Object),h={},g=function
e(t){return"function"==typeof [...]
diff --git a/src/static/js/jquery-3.6.0.min.js
b/src/static/js/jquery-3.6.0.min.js
deleted file mode 100644
index c4c6022..0000000
--- a/src/static/js/jquery-3.6.0.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors |
jquery.org/license */
-!function(e,t){"use strict";"object"==typeof module&&"object"==typeof
module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw
new Error("jQuery requires a window with a document");return
t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use
strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return
t.flat.call(e)}:function(e){return
t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=
[...]
diff --git a/src/static/js/popper.min.js b/src/static/js/popper.min.js
new file mode 100644
index 0000000..9b7dbeb
--- /dev/null
+++ b/src/static/js/popper.min.js
@@ -0,0 +1,5 @@
+/*
+ Copyright (C) Federico Zivolo 2018
+ Distributed under the MIT License (license terms are at
http://opensource.org/licenses/MIT).
+ */(function(e,t){'object'==typeof exports&&'undefined'!=typeof
module?module.exports=t():'function'==typeof
define&&define.amd?define(t):e.Popper=t()})(this,function(){'use
strict';function e(e){return e&&'[object
Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var
o=e.ownerDocument.defaultView,n=o.getComputedStyle(e,null);return
t?n[t]:n}function
o(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function
n(e){if(!e)return document.body;switch(e.nodeName) [...]
+//# sourceMappingURL=popper.min.js.map