mirror of
https://github.com/xvvvyz/tilde.git
synced 2026-03-11 14:44:24 +00:00
prerender all links. i don't think this is actually doing anything
This commit is contained in:
parent
a822b49025
commit
18f6f5f28e
1 changed files with 10 additions and 5 deletions
15
index.html
15
index.html
|
|
@ -239,24 +239,29 @@
|
|||
* Help
|
||||
*/
|
||||
var Help = (function(config) {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var sidebar = document.getElementById('js-sidebar');
|
||||
var searchHelp = document.getElementById('js-help');
|
||||
|
||||
config.commands.forEach(function(command) {
|
||||
var prefetch = document.createElement('link');
|
||||
var li = document.createElement('li');
|
||||
var link = document.createElement('a');
|
||||
var anchor = document.createElement('a');
|
||||
var key = document.createElement('span');
|
||||
var name = document.createElement('span');
|
||||
|
||||
prefetch.rel = 'prerender';
|
||||
prefetch.href = command.url;
|
||||
key.className = 'help-key';
|
||||
key.innerHTML = command.key + config.searchDelimiter + ' ';
|
||||
name.className = 'help-name';
|
||||
name.innerHTML = command.name;
|
||||
link.href = command.url;
|
||||
anchor.href = command.url;
|
||||
|
||||
link.appendChild(key);
|
||||
link.appendChild(name);
|
||||
li.appendChild(link);
|
||||
head.appendChild(prefetch);
|
||||
anchor.appendChild(key);
|
||||
anchor.appendChild(name);
|
||||
li.appendChild(anchor);
|
||||
searchHelp.appendChild(li);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue