Skip to content

Commit

Permalink
Inject version numbers into CSS/JS
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Jun 3, 2020
1 parent 7b12b2a commit 4f6f54c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ task copyResources(type: Copy) {
include "css/**"
include "js/**"
into "${buildDir}"
filter { String line ->
if (line.indexOf("@@") >= 0) {
line = line
.replace("@@TITLE@@", xsltExplorerTitle)
.replace("@@VERSION@@", xsltExplorerVersion)
}
line
}
doFirst {
mkdir "${buildDir}"
}
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/css/xsltexplorer.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* XSLT Explorer CSS */
/* @@TITLE@@ CSS version @@VERSION@@.
*
* See https://xslt.xmlexplorer.com/
*
*/

@import url("https://fonts.googleapis.com/css?family=B612+Mono&display=swap");
@import url("https://fonts.googleapis.com/css?family=Noto+Sans&display=swap");
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/js/xsltexplorer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* XSLT Explorer JS */
/* @@TITLE@@ JS version @@VERSION@@.
*
* See https://xslt.xmlexplorer.com/
*
*/

document.querySelectorAll("a").forEach(function(anchor) {
anchor.onclick = function () {
Expand Down Expand Up @@ -97,9 +101,6 @@ function toggleInstructions(div, classes) {
});

const style = window.getComputedStyle(div);

console.log(match, style.display, div);

if (match) {
if (style.display === "none") {
div.style.display = "block";
Expand Down Expand Up @@ -153,7 +154,6 @@ function checkVisible(anchor) {

const style = window.getComputedStyle(target);
if (style.display === "none") {
console.log("make visible:", target);
if (target.tagName === "SPAN") {
target.style.display = "inline";
} else {
Expand Down

0 comments on commit 4f6f54c

Please sign in to comment.