<?xml version="1.0" encoding="UTF-8" ?>
<Module xmlns:ning="http://developer.ning.com/opensocial/">
    <ModulePrefs title="Donate"
        author="Ning, Inc." 
        author_affiliation="Ning, Inc." 
        author_email="ninghelp@ning.com" 
        author_location="" 
        description="Let your members quickly and easily donate money to your PayPal account."
        directory_title="Donate"
        screenshot="http://os.ning.com/ningapps/paypal/images/paypal-screenshot.png"
        thumbnail="http://os.ning.com/ningapps/paypal/images/paypal-thumbnail.png"
        title_url="http://developer.ning.com/" 
        >
        <Require feature="opensocial-0.8" />
        <Require feature="dynamic-height" />
        <Require feature="views" />
        <Require feature="skins"/>
        <ning:screenshot view="tab">http://os.ning.com/ningapps/paypal/images/paypal-thumbnail.png</ning:screenshot> 
    </ModulePrefs>
<Content type="html" view="home,canvas">
<![CDATA[
<link rel="stylesheet" type="text/css" href="http://os.ning.com/ningapps/paypal/style.css?v=1" />

<div id="contents" class="ui-tabs">
	
	<ul id="nav" class="admin-only">
		<li><a href="#loading" class="hide">Loading</a></li>
		<li><a href="#unlaunched" class="hide">Unlaunched</a></li>
		<li><a href="#main">User View</a></li>
		<li class="last"><a href="#manage-settings">Settings</a></li>
	</ul>

    <div id="loading" class="ui-tabs-hide">
        <img src="http://os.ning.com/ningapps/paypal/images/ajax-loader.gif" width="128" height="15" alt="Loading...">
    </div>
	
    <div id="unlaunched" class="ui-tabs-hide">
        <p class="admin-only">Please click the "Settings" link above to set up your application.</p>
        <p class="member-only">This application is still being set up. Please check back!</p>
    </div>
	
	<div id="manage-settings" class="ui-tabs-hide">
		<h2>Settings</h2>
		<div id="alert-success" class="alert hide">Your changes have been successfully saved.</div>
		<div id="alert-error" class="alert error hide">Unable to save changes.</div>
		<form id="settings">
			<fieldset>
				<legend>Options Menu</legend>
				<p>Adjust settings for your donation page:</p>
				<label for="edit_email">Email Address</label>
				<input id="edit_email" type="text" />
                <small>The PayPal account where you'd like to collect payments. <strong>Note: This email address will be displayed to people that make donations</strong></small>
				<label for="edit_item_name">Fundraising Campaign Title</label>
				<input id="edit_item_name" type="text" />
				<small>Example: Cycling Network Fundraiser</small>
				<label for="edit_item_desc">Fundraising Campaign Description</label>
				<input id="edit_item_desc" type="text" />
				<small>Let your members know why you're raising money</small>
				<label for="edit_amount">Suggested Donation Amount (Optional)</label>
				<input id="edit_amount" type="text" />
			</fieldset>
		</form>
		<button id="settings-submit" type="submit" value="Submit">Save Settings</button>
	</div>
	
	<div class="ui-tabs-hide" id="main" class="ui-tabs-hide">
		<h2 id="campaign_title"></h2>
		<p id="campaign_desc"></p>
		<form>
			<fieldset id="donate">
				<label>Donation Amount:</label>
				<input id="user_amount" type="text" />
                <small id="suggested_amount"></small>
			</fieldset>
		</form>
		<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
            <input type="hidden" name="cmd" value="_xclick">
            <input id="email" type="hidden" name="business" value="">
            <input id="item_name" type="hidden" name="item_name" value="">
            <input id="amount" type="hidden" name="amount" value="">
            <input type="hidden" name="currency_code" value="USD">
            <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
		</form>
	</div>
</div>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://os.ning.com/ningapps/paypal/js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="http://os.ning.com/ningapps/paypal/logic.js"></script>
<script type="text/javascript">
    jQuery("#contents").tabs({
        show: gadgets.window.adjustHeight
    });
    NING.skinning.updateCSS();

    paypal.init();

    $('#settings').submit(paypal.saveSettings());
    $('#settings-submit').click(paypal.saveSettings());
    $('#user_amount').change(paypal.updateUserAmount('#user_amount', '#amount'));

</script>
]]>
</Content>

</Module>

