2006-04-21 00:54:01 -04:00
|
|
|
function customFieldsOnComplete() {
|
|
|
|
var pidEl = document.getElementById('post_ID');
|
|
|
|
pidEl.name = 'post_ID';
|
|
|
|
pidEl.value = getNodeValue(theList.ajaxAdd.responseXML, 'postid');
|
|
|
|
var aEl = document.getElementById('hiddenaction')
|
|
|
|
if ( aEl.value == 'post' ) aEl.value = 'postajaxpost';
|
|
|
|
}
|
2006-03-28 20:51:55 -05:00
|
|
|
addLoadEvent(customFieldsAddIn);
|
|
|
|
function customFieldsAddIn() {
|
2006-04-03 20:16:27 -04:00
|
|
|
theList.showLink=0;
|
2006-04-21 00:54:01 -04:00
|
|
|
theList.addComplete = customFieldsOnComplete;
|
2006-03-28 20:51:55 -05: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');
|
|
|
|
inputs[i].onkeypress = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.name.slice(5),10) + '");', e); };
|
|
|
|
}
|
|
|
|
if ('updatemeta' == inputs[i].className) {
|
|
|
|
inputs[i].onclick = function(e) {return killSubmit('theList.ajaxUpdater("meta", "meta-' + parseInt(this.parentNode.parentNode.id.slice(5),10) + '");', e); };
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-21 00:54:01 -04:00
|
|
|
document.getElementById('metakeyinput').onkeypress = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
|
|
|
|
document.getElementById('updatemetasub').onclick = function(e) {return killSubmit('theList.inputData+="&id="+document.getElementById("post_ID").value;theList.ajaxAdder("meta", "newmeta");', e); };
|
2006-03-28 20:51:55 -05:00
|
|
|
}
|