CoreFiles by mySites.guru
custom-fields.js26 lines, 1,296 bytes, from wordpress-2.1.2.zip
Raw History Compare with 2.1.1
md5
5b555632a4efda6f8419e1bff3e35cd9
sha1
fdc0d925ac45e15c8a33ec8c84d435f32c36790f
sha256
c468688a7cd68ac35ee024d89d6053389310f790fdaf9c841c7c29d33a4e73fb
function customFieldsOnComplete( what, where, update, transport ) {
	var pidEl = $('post_ID');
	pidEl.name = 'post_ID';
	pidEl.value = getNodeValue(transport.responseXML, 'postid');
	var aEl = $('hiddenaction')
	if ( aEl.value == 'post' ) aEl.value = 'postajaxpost';
}
addLoadEvent(customFieldsAddIn);
function customFieldsAddIn() {
	theList.showLink=0;
	theList.addComplete = customFieldsOnComplete;
	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); };
		}
	}

	$('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); };
}

The same content is in 23 releases, WordPress 2.1-beta1 to 2.2.3. See them all, or every version of this file.