|
@@ -15,7 +15,7 @@ use kuchiki::NodeRef;
|
|
|
|
|
|
fn header(title: &str, css_path: &str) -> String {
|
|
|
format!(
|
|
|
- r#"<!DOCTYPE html>
|
|
|
+ r##"<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<title>{title}</title>
|
|
@@ -27,11 +27,25 @@ fn header(title: &str, css_path: &str) -> String {
|
|
|
</head>
|
|
|
<body>
|
|
|
<div>
|
|
|
- <b>sort by</b> [<a href='../../authors.html'>author</a>] [<a href='../../dates.html'>dates</a>] [<a href='../../subjects.html'>subjects</a>]
|
|
|
<button onclick="window.location.href='../../index.html'">Home</button>
|
|
|
+ <input name="" type="button" value="Jump Item:">
|
|
|
+ <input type="text" name="textfield" id="textfield" />
|
|
|
+ <!--dropdown for options-->
|
|
|
+ <div class="dropdown">
|
|
|
+ <button>Options</button>
|
|
|
+ <div class="dropdown-content">
|
|
|
+ <a href="#option1">Class 1</a>
|
|
|
+ <a href="#option2">Class 2</a>
|
|
|
+ <a href="#option3">Turbo Augment</a>
|
|
|
+ </div>
|
|
|
+ </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>]
|
|
|
</div>
|
|
|
<hr>
|
|
|
- "#
|
|
|
+ "##
|
|
|
)
|
|
|
}
|
|
|
|
|
@@ -93,6 +107,22 @@ const JS_SCRIPT_VIEWSPECS: &str = r#"
|
|
|
|
|
|
window.scrollTo(0, 0);
|
|
|
}
|
|
|
+
|
|
|
+ function jumpToItem() {
|
|
|
+ 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) {
|
|
|
+ if (event.key === 'Enter') {
|
|
|
+ jumpToItem();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
</script>
|
|
|
"#;
|
|
|
|