prerender all links. i don't think this is actually doing anything
This commit is contained in:
+10
-5
@@ -239,24 +239,29 @@
|
|||||||
* Help
|
* Help
|
||||||
*/
|
*/
|
||||||
var Help = (function(config) {
|
var Help = (function(config) {
|
||||||
|
var head = document.getElementsByTagName('head')[0];
|
||||||
var sidebar = document.getElementById('js-sidebar');
|
var sidebar = document.getElementById('js-sidebar');
|
||||||
var searchHelp = document.getElementById('js-help');
|
var searchHelp = document.getElementById('js-help');
|
||||||
|
|
||||||
config.commands.forEach(function(command) {
|
config.commands.forEach(function(command) {
|
||||||
|
var prefetch = document.createElement('link');
|
||||||
var li = document.createElement('li');
|
var li = document.createElement('li');
|
||||||
var link = document.createElement('a');
|
var anchor = document.createElement('a');
|
||||||
var key = document.createElement('span');
|
var key = document.createElement('span');
|
||||||
var name = document.createElement('span');
|
var name = document.createElement('span');
|
||||||
|
|
||||||
|
prefetch.rel = 'prerender';
|
||||||
|
prefetch.href = command.url;
|
||||||
key.className = 'help-key';
|
key.className = 'help-key';
|
||||||
key.innerHTML = command.key + config.searchDelimiter + ' ';
|
key.innerHTML = command.key + config.searchDelimiter + ' ';
|
||||||
name.className = 'help-name';
|
name.className = 'help-name';
|
||||||
name.innerHTML = command.name;
|
name.innerHTML = command.name;
|
||||||
link.href = command.url;
|
anchor.href = command.url;
|
||||||
|
|
||||||
link.appendChild(key);
|
head.appendChild(prefetch);
|
||||||
link.appendChild(name);
|
anchor.appendChild(key);
|
||||||
li.appendChild(link);
|
anchor.appendChild(name);
|
||||||
|
li.appendChild(anchor);
|
||||||
searchHelp.appendChild(li);
|
searchHelp.appendChild(li);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user