|
@@ -26,7 +26,9 @@ fn header(title: &str, css_path: &str) -> String {
|
|
|
<meta name="description" content="{title}"/>
|
|
|
</head>
|
|
|
<body>
|
|
|
- <div>
|
|
|
+ <div id="button-container">
|
|
|
+ <!-- class 2 buttons will appear here -->
|
|
|
+ </div>
|
|
|
<button onclick="window.location.href='../../index.html'">Home</button>
|
|
|
<input name="" type="button" value="Jump Item:">
|
|
|
<input type="text" name="textfield" id="textfield" />
|
|
@@ -39,7 +41,10 @@ fn header(title: &str, css_path: &str) -> String {
|
|
|
<a href="#option3">Turbo Augment</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- Viewspecs button -->
|
|
|
+ <button class="viewspecs-button" onclick="openNewWindow()">Viewspecs</button>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
|
|
|
<div>
|
|
|
<b>sort by</b> [<a href='../../authors.html'>author</a>] [<a href='../../dates.html'>dates</a>] [<a href='../../subjects.html'>subjects</a>]
|
|
@@ -54,7 +59,25 @@ const FOOTER: &str = r#"
|
|
|
</html>
|
|
|
"#;
|
|
|
|
|
|
-const JS_SCRIPT_VIEWSPECS: &str = r#"
|
|
|
+fn generate_popup_js() -> String {
|
|
|
+ r#"
|
|
|
+ function toggleNumbering() {
|
|
|
+ const numberingCheckbox = document.getElementById('numbering');
|
|
|
+ const purplenumbers = window.opener.document.querySelectorAll('.purplenumber');
|
|
|
+ purplenumbers.forEach(element => {
|
|
|
+ element.classList.toggle('transparent', !numberingCheckbox.checked);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ document.addEventListener('DOMContentLoaded', function() {
|
|
|
+ const numberingCheckbox = document.getElementById('numbering');
|
|
|
+ numberingCheckbox.addEventListener('change', toggleNumbering);
|
|
|
+ });
|
|
|
+ "#.to_string()
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const JS_SCRIPT_VIEWSPECS: &str = r##"
|
|
|
<script>
|
|
|
function showElement(body_id, summary_id){
|
|
|
const summaries = document.querySelectorAll('.message-meta');
|
|
@@ -112,9 +135,10 @@ const JS_SCRIPT_VIEWSPECS: &str = r#"
|
|
|
const id = document.getElementById('textfield').value;
|
|
|
if (id) {
|
|
|
window.location.href = `#${id}`;
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
const textfield = document.getElementById('textfield');
|
|
|
textfield.addEventListener('keydown', function(event) {
|
|
@@ -122,9 +146,85 @@ const JS_SCRIPT_VIEWSPECS: &str = r#"
|
|
|
jumpToItem();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ const jumpButton = document.querySelector('input[type="button"][value="Jump Item:"]');
|
|
|
+ jumpButton.addEventListener('click', jumpToItem);
|
|
|
});
|
|
|
+
|
|
|
+ function openNewWindow() {
|
|
|
+ const popupJs = `
|
|
|
+ function toggleNumbering() {
|
|
|
+ const numberingCheckbox = document.getElementById('numbering');
|
|
|
+ const purplenumbers = window.opener.document.querySelectorAll('.purplenumber');
|
|
|
+ purplenumbers.forEach(element => {
|
|
|
+ element.classList.toggle('transparent', !numberingCheckbox.checked);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ document.addEventListener('DOMContentLoaded', function() {
|
|
|
+ const numberingCheckbox = document.getElementById('numbering');
|
|
|
+ numberingCheckbox.addEventListener('change', toggleNumbering);
|
|
|
+ });
|
|
|
+ `;
|
|
|
+
|
|
|
+ const newWindow = window.open('', '', 'width=400,height=300');
|
|
|
+ newWindow.document.write(`
|
|
|
+ <html>
|
|
|
+ <head>
|
|
|
+ <title>Viewspecs</title>
|
|
|
+ <style>
|
|
|
+ .popup-content {
|
|
|
+ font-family: Arial, sans-serif;
|
|
|
+ font-size: 14px;
|
|
|
+ margin: 20px;
|
|
|
+ }
|
|
|
+ .popup-content fieldset {
|
|
|
+ border: 1px solid #000;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+ .popup-content legend {
|
|
|
+ padding: 0 10px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .popup-content label {
|
|
|
+ display: block;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
+ .popup-content input {
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .accept-button {
|
|
|
+ margin-top: 10px;
|
|
|
+ padding: 5px 10px;
|
|
|
+ font-size: 14px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .transparent {
|
|
|
+ color: transparent !important;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div class="popup-content">
|
|
|
+ <fieldset>
|
|
|
+ <legend>Show</legend>
|
|
|
+ <label><input type="checkbox" id="blankLines"> y z Blank lines</label>
|
|
|
+ <label><input type="checkbox" id="numbering" checked> m n Numbering</label>
|
|
|
+ <label><input type="checkbox" id="statementSignatures"> K L Statement signatures</label>
|
|
|
+ </fieldset>
|
|
|
+ <button class="accept-button" onclick="window.close()">Accept</button>
|
|
|
+ </div>
|
|
|
+ <script>${popupJs}<\/script>
|
|
|
+ </body>
|
|
|
+ </html>
|
|
|
+ `);
|
|
|
+ newWindow.document.close();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</script>
|
|
|
-"#;
|
|
|
+"##;
|
|
|
|
|
|
impl Lists {
|
|
|
pub fn to_html(&self) -> String {
|