Skip to content

Commit

Permalink
refactor common JS for documentation into a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
randomdude999 committed Jan 21, 2024
1 parent 551a23b commit 52b9f9b
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 134 deletions.
29 changes: 1 addition & 28 deletions docs/changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,7 @@
<link rel="stylesheet" href="../shared/highlight_js_asar/styles/default.css"/>
<script src="../shared/highlight_js/highlight.min.js"></script>
<script src="../shared/highlight_js_asar/highlight_js_asar.js"></script>
<script>
hljs.configure(
{
tabReplace: ' ',
}
);
hljs.highlightAll();

hljsAsar.init();

function toggle_visibility(id)
{
var e =document.getElementById(id);
var label = document.getElementById(id.concat("-toggle"));

if(e.style.display == 'none')
{
label.innerHTML = label.innerHTML.replace("[+] Expand","[-] Collapse");
e.style.display = 'block';
}
else
{
label.innerHTML = label.innerHTML.replace("[-] Collapse","[+] Expand");
e.style.display = 'none';

}
}
</script>
<script src="../shared/common.js"></script>
</head>
<body>

Expand Down
31 changes: 5 additions & 26 deletions docs/manual/errors-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,11 @@
<html lang="en">
<head>
<title>Asar User Manual - Error list</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../shared/highlight_js/styles/default.css" />
<script src="../shared/highlight_js/highlight.pack.js"></script>
<script>
hljs.configure({
tabReplace: " ",
});
hljs.initHighlightingOnLoad();
function toggle_visibility(id) {
var e = document.getElementById(id);
var label = document.getElementById(id.concat("-toggle"));
if (e.style.display == "none") {
label.innerHTML = label.innerHTML.replace(
"[+] Expand",
"[-] Collapse"
);
e.style.display = "block";
} else {
label.innerHTML = label.innerHTML.replace(
"[-] Collapse",
"[+] Expand"
);
e.style.display = "none";
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../shared/highlight_js_asar/styles/default.css"/>
<script src="../shared/highlight_js/highlight.min.js"></script>
<script src="../shared/highlight_js_asar/highlight_js_asar.js"></script>
<script src="../shared/common.js"></script>
</head>
<body>
<table>
Expand Down
29 changes: 1 addition & 28 deletions docs/manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,7 @@
<link rel="stylesheet" href="../shared/highlight_js_asar/styles/default.css"/>
<script src="../shared/highlight_js/highlight.min.js"></script>
<script src="../shared/highlight_js_asar/highlight_js_asar.js"></script>
<script>
hljs.configure(
{
tabReplace: ' ',
}
);
hljs.highlightAll();

hljsAsar.init();

function toggle_visibility(id)
{
var e =document.getElementById(id);
var label = document.getElementById(id.concat("-toggle"));

if(e.style.display == 'none')
{
label.innerHTML = label.innerHTML.replace("[+] Expand","[-] Collapse");
e.style.display = 'block';
}
else
{
label.innerHTML = label.innerHTML.replace("[-] Collapse","[+] Expand");
e.style.display = 'none';

}
}
</script>
<script src="../shared/common.js"></script>
</head>
<body>

Expand Down
31 changes: 5 additions & 26 deletions docs/manual/warnings-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,11 @@
<html lang="en">
<head>
<title>Asar User Manual - Warning list</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../shared/highlight_js/styles/default.css" />
<script src="../shared/highlight_js/highlight.pack.js"></script>
<script>
hljs.configure({
tabReplace: " ",
});
hljs.initHighlightingOnLoad();
function toggle_visibility(id) {
var e = document.getElementById(id);
var label = document.getElementById(id.concat("-toggle"));
if (e.style.display == "none") {
label.innerHTML = label.innerHTML.replace(
"[+] Expand",
"[-] Collapse"
);
e.style.display = "block";
} else {
label.innerHTML = label.innerHTML.replace(
"[-] Collapse",
"[+] Expand"
);
e.style.display = "none";
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../shared/highlight_js_asar/styles/default.css"/>
<script src="../shared/highlight_js/highlight.min.js"></script>
<script src="../shared/highlight_js_asar/highlight_js_asar.js"></script>
<script src="../shared/common.js"></script>
</head>
<body>
<table>
Expand Down
26 changes: 26 additions & 0 deletions docs/shared/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
hljs.configure(
{
tabReplace: ' ',
}
);
hljs.highlightAll();

hljsAsar.init();

function toggle_visibility(id)
{
var e =document.getElementById(id);
var label = document.getElementById(id.concat("-toggle"));

if(e.style.display == 'none')
{
label.innerHTML = label.innerHTML.replace("[+] Expand","[-] Collapse");
e.style.display = 'block';
}
else
{
label.innerHTML = label.innerHTML.replace("[-] Collapse","[+] Expand");
e.style.display = 'none';

}
}
31 changes: 5 additions & 26 deletions src/generate_manual_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,11 @@ def __str__(self):
<html lang="en">
<head>
<title>Asar User Manual - #TITLE#</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../shared/highlight_js/styles/default.css" />
<script src="../shared/highlight_js/highlight.pack.js"></script>
<script>
hljs.configure({
tabReplace: " ",
});
hljs.initHighlightingOnLoad();
function toggle_visibility(id) {
var e = document.getElementById(id);
var label = document.getElementById(id.concat("-toggle"));
if (e.style.display == "none") {
label.innerHTML = label.innerHTML.replace(
"[+] Expand",
"[-] Collapse"
);
e.style.display = "block";
} else {
label.innerHTML = label.innerHTML.replace(
"[-] Collapse",
"[+] Expand"
);
e.style.display = "none";
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../shared/highlight_js_asar/styles/default.css"/>
<script src="../shared/highlight_js/highlight.min.js"></script>
<script src="../shared/highlight_js_asar/highlight_js_asar.js"></script>
<script src="../shared/common.js"></script>
</head>
<body>
<table>
Expand Down

0 comments on commit 52b9f9b

Please sign in to comment.