added reload button

This commit is contained in:
q
2017-06-03 12:11:52 +03:00
parent f17e6d3819
commit ff5d395db8
2 changed files with 13 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ MDLinks is a static HTML page with JS markdown parser. It creates a link portal
* config.style='path_to_style.css'; * config.style='path_to_style.css';
* config.title='Title of page'; * config.title='Title of page';
* config.columns=[integer]; // Split heads to this many columns * config.columns=[integer]; // Split heads to this many columns
* config.narrow=[integer]; // Create one column table on windows narrower than N pixels
* config.search=true; // Display link search bar * config.search=true; // Display link search bar
* config.favicon='path_to_favicon.ico'; * config.favicon='path_to_favicon.ico';

View File

@@ -22,9 +22,12 @@
A:visited { text-decoration:none; color: #000000; } A:visited { text-decoration:none; color: #000000; }
A:hover { text-decoration: underline; } A:hover { text-decoration: underline; }
A:focus { text-decoration: underline; } A:focus { text-decoration: underline; }
#filter { width: 90%; } #filter { width: 100%; }
#search { width: 100%; display: table; }
.search_span { display: table-cell; text-align: center; vertical-align: middle; }
.head { font-size: 16px; text-align:left; padding-top: 0.2em; margin-bottom: -0.5em; } .head { font-size: 16px; text-align:left; padding-top: 0.2em; margin-bottom: -0.5em; }
.tickbox { z-index:99; display: block; position: absolute; top: 5px; right:5px; } .tickbox { width: 3em; }
#reload_span { float: right; }
LI.nolink:before { LI.nolink:before {
content:" "; content:" ";
padding-right: 1.0em; padding-right: 1.0em;
@@ -148,7 +151,9 @@ function print_results(hitList) {
} }
} }
} }
function reload_source() {
location.href=config.source
}
function get_URL(s) { function get_URL(s) {
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
@@ -217,9 +222,11 @@ var config = {
<script language="javascript" src="config.js"></script> <script language="javascript" src="config.js"></script>
</head> </head>
<body onload="read_links()"> <body onload="read_links()">
<div id="search"><span><input type="text" oninput="filter(event)" onkeypress="filter(event)" onblur="no_filter()" id="filter" title="Filter links by name"></span> <div id="search">
<span class=tickbox>^<input type=checkbox id=open_blank title="Open links in new window" onclick="toggle_blank()" tabindex=-1></span> <span class="search_span"><input type="text" oninput="filter(event)" onkeypress="filter(event)" onblur="no_filter()" id="filter" title="Filter links by name"></span>
<span class="search_span tickbox">^<input type=checkbox id=open_blank title="Open links in new window" onclick="toggle_blank()" tabindex=-1></span>
</div> </div>
<div id="main"></div> <div id="main"></div>
<span class="search_span" id="reload_span"><a href="#" onclick="reload_source()" title="Reload links source">&#8635;</a></span>
</body> </body>
</html> </html>