2006-09-13 23:39:53 +02:00
|
|
|
function customFieldsOnComplete( what, where, update, transport ) {
|
|
|
|
var pidEl = $('post_ID');
|
2006-04-21 06:54:01 +02:00
|
|
|
pidEl.name = 'post_ID';
|
2006-09-13 23:39:53 +02:00
|
|
|
pidEl.value = getNodeValue(transport.responseXML, 'postid');
|
|
|
|
var aEl = $('hiddenaction')
|
2006-04-21 06:54:01 +02:00
|
|
|
if ( aEl.value == 'post' ) aEl.value = 'postajaxpost';
|
|
|
|
}
|
2006-03-29 03:51:55 +02:00
|
|
|
addLoadEvent(customFieldsAddIn);
|
|
|
|
function customFieldsAddIn() {
|
2006-04-04 02:16:27 +02:00
|
|
|
theList.showLink=0;
|
2006-04-21 06:54:01 +02:00
|
|
|
theList.addComplete = customFieldsOnComplete;
|
2006-03-29 03:51:55 +02:00
|
|
|
if (!theList.theList) return false;
|
|
|
|
inputs = theList.theList.getElementsByTagName('input');
|
|
|
|
for ( var i=0; i < inputs.length; i++ ) {
|
|
|
|
if ('text' == inputs[i].type) {
|
|
|
|
inputs[i].setAttribute('autocomplete', 'off');
|
2006-11-19 08:56:05 +01:00
|
|
|
inputs[i].onkeypress = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.name.slice(5),10) + '");', e); };
|
2006-03-29 03:51:55 +02:00
|
|
|
}
|
|
|
|
if ('updatemeta' == inputs[i].className) {
|
2006-11-19 08:56:05 +01:00
|
|
|
inputs[i].onclick = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.parentNode.parentNode.id.slice(5),10) + '");', e); };
|
2006-03-29 03:51:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-13 23:39:53 +02:00
|
|
|
$('metakeyinput').onkeypress = function(e) {return killSubmit('theList.inputData+="&id="+$("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
|
|
|
|
$('updatemetasub').onclick = function(e) {return killSubmit('theList.inputData+="&id="+$("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
|
2006-03-29 03:51:55 +02:00
|
|
|
}
|