This is a comment on Simple Quotes, posted by WikiAdmin at 11/12/2011 18:43
View source for With absolute path for sub pages
js/default.js
%%(hl javascript)
function all_init () // initialization everything
{
if (wikiedit)
we_init(wikiedit);
if (dbclick)
dclick(dbclick);
init_travel();
crit_init();
quote_init();
}
function quote_init()
{
document.onkeydown = function(e)
{
if (!e) e = window.event;
if (e.keyCode == 81 && e.ctrlKey)
{
var txt = '';
if (txt = window.getSelection) {
var node = window.getSelection().anchorNode.parentNode.parentNode;
if (node.className == "page")
{
txt = "# ";
}
else if (node.className == "comment")
{
txt = "((/" + node.id + " # )) ";
}
else
{
return;
}
txt += window.getSelection().toString();
}
else
{
txt = document.selection.createRange().text;
}
if (txt)
{
textarea = document.getElementById("addcomment");
br = "";
if (textarea.value != "")
{
br = "\r\n\r\n";
}
document.getElementById("addcomment").value += br + "<[" + txt + "]> \r\n";
}
}
}
}
%%