2009-07-03 12:38:21 +00:00
|
|
|
// Editor specific functions
|
2009-07-11 19:45:57 +00:00
|
|
|
|
2011-02-15 17:11:24 +00:00
|
|
|
function bodyLoad(version) {
|
2009-09-20 07:31:46 +00:00
|
|
|
}
|
2011-05-04 13:53:26 +00:00
|
|
|
|
|
|
|
function whisperClick(event, field) {
|
|
|
|
var el = event.target || event.srcElement;
|
|
|
|
if (/^a$/i.test(el.tagName) && !(event.button || event.ctrlKey || event.shiftKey || event.altKey || event.metaKey)) {
|
|
|
|
field.value = el.firstChild.data;
|
|
|
|
field.previousSibling.value = decodeURIComponent(el.href.replace(/.*=/, ''));
|
|
|
|
field.nextSibling.style.display = 'none';
|
|
|
|
eventStop(event);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function whisper(url, field) {
|
2011-05-05 05:46:36 +00:00
|
|
|
if (field.orig != field.value) { // ignore arrows, Shift, ...
|
2011-05-04 13:53:26 +00:00
|
|
|
field.orig = field.value;
|
2011-05-05 05:46:36 +00:00
|
|
|
field.previousSibling.value = field.value; // accept number, reject string
|
2011-05-04 13:53:26 +00:00
|
|
|
return ajax(url + encodeURIComponent(field.value), function (xmlhttp) {
|
2011-05-05 05:46:36 +00:00
|
|
|
if (xmlhttp.status && field.orig == field.value) { // ignore old responses
|
2011-05-04 13:53:26 +00:00
|
|
|
field.nextSibling.innerHTML = xmlhttp.responseText;
|
|
|
|
field.nextSibling.style.display = '';
|
|
|
|
var a = field.nextSibling.firstChild;
|
|
|
|
if (a && a.firstChild.data == field.value) {
|
|
|
|
field.previousSibling.value = decodeURIComponent(a.href.replace(/.*=/, ''));
|
2011-05-05 05:46:36 +00:00
|
|
|
a.className = 'active';
|
2011-05-04 13:53:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|