From 6fc95b3fea64a169cc33fdc1fc66f9990e159758 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 28 Jan 2022 16:12:46 -0500 Subject: [PATCH] Override JS file so we can in-line license tags This JS file appears to be the only one we need. --- themes/fsftheme/default/includes/header.php | 2 +- www/resources/script.js | 49 +++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 www/resources/script.js diff --git a/themes/fsftheme/default/includes/header.php b/themes/fsftheme/default/includes/header.php index df53049..2dd8903 100644 --- a/themes/fsftheme/default/includes/header.php +++ b/themes/fsftheme/default/includes/header.php @@ -43,7 +43,7 @@ header('X-Frame-Options: SAMEORIGIN'); - + <?php if (array_key_exists('header', $this->data)) { echo $this->data['header']; diff --git a/www/resources/script.js b/www/resources/script.js new file mode 100644 index 0000000..58eecb6 --- /dev/null +++ b/www/resources/script.js @@ -0,0 +1,49 @@ +// @license magnet:?xt=urn:btih:5de60da917303dbfad4f93fb1b985ced5a89eac2&dn=lgpl-2.1.txt LGPL-2.1-or-later +// this code comes from www/resources/script.js + +/** + * Set focus to the element with the given id. + * + * @param id The id of the element which should receive focus. + */ +function SimpleSAML_focus(id) +{ + var element = document.getElementById(id); + if (element != null) { + element.focus(); + } +} + + +/** + * Show the given DOM element. + * + * @param id The id of the element which should be shown. + */ +function SimpleSAML_show(id) +{ + var element = document.getElementById(id); + if (element == null) { + return; + } + + element.style.display = 'block'; +} + + +/** + * Hide the given DOM element. + * + * @param id The id of the element which should be hidden. + */ +function SimpleSAML_hide(id) +{ + var element = document.getElementById(id); + if (element == null) { + return; + } + + element.style.display = 'none'; +} + +// @license-end -- 2.25.1