<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
	<name>AJAX Personal Text</name>
	<id>yodaofdarkness:ajaxpersonal</id>
	<version>1.0.2</version>
	<homepage>http://www.fustrate.com</homepage>

	<file name="$sourcedir/Xml.php">
		<operation>
			<search position="replace"><![CDATA[
	updateMemberData($context['user']['id'], array('personal_text' => htmlspecialchars(quoted_printable_decode(html_entity_decode(censorText($_REQUEST['text']), ENT_QUOTES, $context['character_set'])))));]]></search>
			<add><![CDATA[
	updateMemberData($context['user']['id'], array('personal_text' => htmlspecialchars(quoted_printable_decode(html_entity_decode(censorText($_REQUEST['text']), ENT_QUOTES, $context['character_set'])))));]]></add>
		</operation>
	</file>

	<file name="$themedir/scripts/script.js">
		<operation>
			<search position="replace"><![CDATA[
// Event handler for clicking submit.
PersonalText.prototype.onInputSubmit = function ()
{
	var personal_text = document.getElementById("update_personal_text_span");
	var new_personal_text = document.getElementById("new_personal_text").value;
	
	ajax_indicator(true);
	sendXMLDocument(smf_prepareScriptUrl(this.opt.sScriptUrl) + 'action=xmlhttp;sa=personal', 'text=' + escape(new_personal_text));
	ajax_indicator(false);

	setOuterHTML(personal_text, '<span style="font-size: 80%; padding: 3px;" id="update_personal_text" title="' + aPersonalText[0].sLabelPersonalText + '" onclick="aPersonalText[0].showEdit();" onmouseover="aPersonalText[0].onBoxHover(this, true)" onmouseout="aPersonalText[0].onBoxHover(this, false)" style="cursor: ' + (is_ie && !is_ie6up ? 'hand' : 'pointer') + ';">' + new_personal_text + '</span>');
}]]></search>
			<add><![CDATA[
// Event handler for clicking submit.
PersonalText.prototype.onInputSubmit = function ()
{
	var personal_text = document.getElementById("update_personal_text_span");
	var new_personal_text = document.getElementById("new_personal_text").value.php_to8bit();
	var new_personal_text_plain = document.getElementById("new_personal_text").value;
	
	ajax_indicator(true);
	sendXMLDocument(smf_prepareScriptUrl(this.opt.sScriptUrl) + 'action=xmlhttp;sa=personal', 'text=' + escape(new_personal_text));
	ajax_indicator(false);

	setOuterHTML(personal_text, '<span style="font-size: 80%; padding: 3px;" id="update_personal_text" title="' + aPersonalText[0].sLabelPersonalText + '" onclick="aPersonalText[0].showEdit();" onmouseover="aPersonalText[0].onBoxHover(this, true)" onmouseout="aPersonalText[0].onBoxHover(this, false)" style="cursor: ' + (is_ie && !is_ie6up ? 'hand' : 'pointer') + ';">' + new_personal_text_plain + '</span>');
}]]></add>
		</operation>
	</file>
</modification>