Recently I enabled the "Free Nodelet". Everytime I wanted to post a question, I couldn't recall the
What shortcuts can I use for linking to other information? link and took a lot of digging to get to the page. However, now I have a direct link to the shortcuts page, right under the text area, via this code:
<script language="javascript">
var lb = "\x5B";
var rb = "\x5D"
function getMyTable(){
//get the table
var tables = document.getElementsByTagName("table");
var mytable;
var evalstr = "tables" + lb + "i" + rb + ".className";
for(var i=0;i<tables.length;i++){
var class = eval(evalstr);
if(class == "addnewform"){
mytable = eval("tables" + lb + "i" + rb);
return mytable
}
}
return mytable;
}
function add_shortcut(){
var elements = getMyTable();
if(elements){
var row = elements.insertRow(elements.rows.length);
var cell = row.insertCell(0);
cell.innerHTML = '[node://43037]';
}
}
// Execute our snippets after the page is parsed.
var old_onload = window.onload;
window.onload = function() {
if (old_onload != null)
old_onload();
add_shortcut();
};
</script>
[node://43037]</br><hr>
<a href="http://perlmonks.org/?node=Free%20Nodelet%20Settings">Free No
+delet Settings</a>
The code to insert the link, in the html DOM is mine, however I forgot from where I copied the rest of the ideas, especially "lb"/"rb" and the "onload" trick. Credit goes to whoever first created it. Thanks