r103434 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103433‎ | r103434 | r103435 >
Date:01:37, 17 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
lightbox updates
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_common/interface.i18n.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/RapidHtmlResources.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/css/lightbox1.css (deleted) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/html/lightbox1.html (deleted) (history)
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/js/lightbox1.js (deleted) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/css/lightbox1.css (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/lightbox1.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/lightbox1.html
@@ -9,69 +9,70 @@
1010 var scriptPath = "@script_path";
1111 </script>
1212
13 - <div class="ltr">
14 - <div id="appeal">
15 - <div id="appeal-content">
16 - <div class="call-r">
17 - <div id="donate">
18 - <h3 id="amount-heading">Donate</h3>
19 -
20 - <form method="post" name="paypalcontribution">
21 - <div style="display: block;" id="amount-content">
22 - <div id="amtErrorMessages" class="small"></div>
23 - <table id="amount-table">
24 - <tr>
25 - <td><label><input type="radio" name="amountRadio" value="5" /> $5</label></td>
26 - <td><label><input type="radio" name="amountRadio" value="10" /> $10</label></td>
27 - <td><label><input type="radio" name="amountRadio" value="20" /> $20</label></td>
28 - <td><label><input type="radio" name="amountRadio" value="35" /> $35</label></td>
29 - </tr>
30 - <tr>
31 - <td><label><input type="radio" name="amountRadio" value="50" /> $50</label></td>
32 - <td><label><input type="radio" name="amountRadio" value="100" /> $100</label></td>
33 - <td><label><input type="radio" name="amountRadio" value="250" /> $250</label></td>
34 - <td><input type="radio" name="amountRadio" id="input_amount_other" value="other" /> <label>$<input type="text" name="amountGiven" size="4" id="other-amount" placeholder="Other" onfocus="this.form.input_amount_other.checked=true;"/></label></td>
35 - </tr>
36 - </table>
37 -
38 - <p class="donate-options">
39 - <input class="btn" id="cc" value="Donate by Credit Card" type="button">
40 - <br><input class="btn" id="pp" value="Donate via PayPal" type="button"><span id="loading"></span>
41 - </p>
42 - </div>
43 -
44 - </form>
45 - </div>
46 -
47 - <div id="callout-content">
48 - <hr>
49 - <h3>Where your donation goes</h3>
50 - <p><strong>Technology:</strong> Servers, bandwidth,
51 -maintenance, development. Wikipedia is the #5 website in the world and
52 -it runs on a fraction of what other top websites spend.</p>
53 - <p><strong>People:</strong> The other top 10 website
54 -have thousands of employees. We have fewer than 100, making your
55 -donation a great investment in a highly-efficient not-for-profit
56 -organization.</p>
57 - </div>
58 - </div>
59 -
60 - <h2 id="appeal-head"> <span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
61 - <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
62 - </div>
63 - </div>
64 -
65 - <hr>
66 -
67 - <p>We do not store your credit card information, and your personal data is subject to our <a target="_blank" href="http://wikimediafoundation.org/wiki/Donor_policy"> donor privacy policy</a>.</p>
68 - <p><a href="http://wikipedia.webitects.com/wiki/Ways_to_Give/en">More information or other ways to give</a><br><a href="http://wikipedia.webitects.com/wiki/FAQ/en">Answers to frequently asked questions</a></p>
69 - </div>
 13+<div class="ltr">
 14+ <div id="appeal">
 15+ <div id="appeal-content">
 16+ <div class="call-r">
 17+ <div id="donate">
 18+ <noscript>
 19+ <div id="noscript">
 20+ <p id="noscript-msg">It appears that you do not have JavaScript enabled, or your browser does not support it. In order to provide a safe, secure and pleasant experience, our donation form requires JavaScript.</p><p id="noscript-redirect-msg">If you cannot or do not wish to enable JavaScript, you may still contribute by visiting:</p><p id="noscript-redirect-link"><a href="http://wikimediafoundation.org/wiki/DonateNonJS/en">http://wikimediafoundation.org/wiki/DonateNonJS/en</a></p>
 21+ </div>
 22+ </noscript>
 23+
 24+ <h3 id="amount-heading">%donate_interface-amount-legend%</h3>
 25+
 26+ <p id="topError" class="creditcard-error-msg"></p>
 27+ <form method="post" name="paypalcontribution">
 28+ <div style="display: block;" id="amount-content">
 29+ <div id="amtErrorMessages" class="small"></div>
 30+ <table id="amount-table">
 31+ <tr>
 32+ <td><label><input type="radio" name="amountRadio" value="5" /> $5</label></td>
 33+ <td><label><input type="radio" name="amountRadio" value="10" /> $10</label></td>
 34+ <td><label><input type="radio" name="amountRadio" value="20" /> $20</label></td>
 35+ <td><label><input type="radio" name="amountRadio" value="35" /> $35</label></td>
 36+ </tr>
 37+ <tr>
 38+ <td><label><input type="radio" name="amountRadio" value="50" /> $50</label></td>
 39+ <td><label><input type="radio" name="amountRadio" value="100" /> $100</label></td>
 40+ <td><label><input type="radio" name="amountRadio" value="250" /> $250</label></td>
 41+ <td><input type="radio" name="amountRadio" id="input_amount_other" value="other" /> <label>$<input type="text" name="amountGiven" size="4" id="other-amount" placeholder="Other" onfocus="this.form.input_amount_other.checked=true;"/></label></td>
 42+ </tr>
 43+ </table>
 44+
 45+ <p class="donate-options">
 46+ <input class="btn" id="cc" value="%donate_interface-cc-button%" type="button"/>
 47+ <br><input class="btn" id="pp" value="%donate_interface-paypal-button%" type="button"><span id="loading"></span>
 48+ </p>
 49+ </div>
 50+ </form>
 51+ </div>
 52+
 53+ <div id="callout-content">
 54+ <hr/>
 55+ <p id="informationsharing">%donate_interface-informationsharing|url%</p>
 56+ </div>
 57+ </div>
 58+
 59+ <h2 id="appeal-head"><span class="mw-headline">{{LanguageSwitch|2011FR/@appeal-title|@language}}</span></h2>
 60+ <div id="appeal-body" class="plainlinks">{{LanguageSwitch|2011FR/@appeal|@language}}</div>
 61+ </div>
 62+ </div>
 63+
 64+ <hr/>
 65+
 66+ <p>
 67+ <a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=Ways_to_Give&language=@language&uselang=@language&country=@country">%donate_interface-otherways-short%</a><br/>
 68+ <a href="http://wikimediafoundation.org/wiki/Special:LandingCheck?landing_page=FAQ&language=@language&uselang=@language&country=@country">%donate_interface-faqs%</a>
 69+ </p>
 70+</div>
7071
7172 <div id="dialog">
7273 <div id="steps">
7374 <form id="donationForm" name="donationForm" action="" method="post">
7475 <fieldset class="step">
75 - <legend>Personal Information</legend>
 76+ <legend>%donate_interface-billing-address%</legend>
7677 <input type="hidden" name="gateway" value="payflowpro" id="gateway" />
7778 <input type="hidden" name="returnto" value="Thank_You/en" />
7879 <input type="hidden" value="@action" name="action" />
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/css/lightbox1.css
@@ -67,9 +67,6 @@
6868 .donate-options {
6969 text-align: center;
7070 }
71 -.donate-options input {
72 - width: 15em;
73 -}
7471
7572 input.button, select#input_currency_code {
7673 font-size: 95%;
@@ -175,7 +172,7 @@
176173 }
177174 input.btn {
178175 font-size: 15px;
179 - margin-bottom: 3px;
 176+ margin-bottom: 4px;
180177 }
181178 #dialog{
182179 overflow: hidden;
@@ -293,4 +290,8 @@
294291 }
295292 #steps #card-errors .error-msg {
296293 margin-bottom: 1em;
297 -}
\ No newline at end of file
 294+}
 295+#informationsharing {
 296+ font-size: 11px;
 297+ line-height: 13px;
 298+}
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js
@@ -45,7 +45,7 @@
4646 resizable: false,
4747 autoOpen: false,
4848 modal: true,
49 - title: 'Donate by Credit Card'
 49+ title: mw.msg( 'donate_interface-cc-button' )
5050 } );
5151
5252 // If the form is being reloaded, restore the amount
@@ -65,15 +65,15 @@
6666 }
6767
6868 $( '#cc' ).click( function() {
69 - if ( validateAmount( document.paypalcontribution ) ) {
 69+ if ( validateAmount() ) {
7070 $( '#dialog' ).dialog( 'open' );
7171 }
7272 });
7373 $( '#pp' ).click( function() {
74 - if ( validateAmount( document.paypalcontribution ) ) {
 74+ if ( validateAmount() ) {
 75+ //$( 'input#pp' ).attr( 'disabled', 'disabled' );
7576 $( "input[name='gateway']" ).val( 'paypal' );
7677 document.paypalcontribution.action = "https://wikimediafoundation.org/wiki/Special:ContributionTracking/en";
77 - $( '#loading' ).html( "<img src='../images/loading.gif' /> Redirecting to PayPal..." );
7878 document.paypalcontribution.submit();
7979 }
8080 });
@@ -202,7 +202,7 @@
203203 'state': $( 'select#state option:selected' ).val(),
204204 'zip': $( "input[name='zip']" ).val(),
205205 'emailAdd': $( "input[name='emailAdd']" ).val(),
206 - 'country': 'US',
 206+ 'country': $( "input[name='country']" ).val(),
207207 'payment_method': 'cc',
208208 'language': 'en',
209209
@@ -258,29 +258,41 @@
259259
260260 return error;
261261 }
262 -
263 - function validateAmount(){
 262+
 263+ /**
 264+ * Validate the donation amount to make sure it is formatted correctly and at least a minimum amount.
 265+ */
 266+ function validateAmount() {
264267 var error = true;
265268 var amount = $( "input[name='amount']" ).val(); // get the amount
266 - var otherAmount = amount // create a working copy
267 - otherAmount = otherAmount.replace( /[,.](\d)$/, '\:$10' );
268 - otherAmount = otherAmount.replace( /[,.](\d)(\d)$/, '\:$1$2' );
269 - otherAmount = otherAmount.replace( /[,.]/g, '' );
270 - otherAmount = otherAmount.replace( /:/, '.' );
271 - amount = otherAmount; // reset amount to working copy amount
272 - $( "input[name='amount']" ).val( amount ); // set the new amount back into the form
 269+ // Normalize weird amount formats.
 270+ // Don't mess with these unless you know what you're doing.
 271+ amount = amount.replace( /[,.](\d)$/, '\:$10' );
 272+ amount = amount.replace( /[,.](\d)(\d)$/, '\:$1$2' );
 273+ amount = amount.replace( /[,.]/g, '' );
 274+ amount = amount.replace( /:/, '.' );
 275+ $( 'input[name="amount"]' ).val( amount ); // set the new amount back into the form
273276
274277 // Check amount is a real number, sets error as true (good) if no issues
275278 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
 279+
 280+ // Find out the currency code
 281+ if ( $( 'input[name="currency_code"]' ).val() == '' ) {
 282+ var currency_code = 'USD'; // hard-code since we're only running this in the US
 283+ $( "input[name='currency_code']" ).val( currency_code );
 284+ } else {
 285+ var currency_code = $( 'input[name="currency_code"]' ).val();
 286+ }
 287+
276288 // Check amount is at least the minimum
277 - var currency = 'USD'; // hard-coded for these forms and tests
278 - $( "input[name='currency_code']" ).val( currency );
279 - if ( typeof( wgCurrencyMinimums[currency] ) == 'undefined' ) {
280 - wgCurrencyMinimums[currency] = 1;
 289+ if ( typeof( wgCurrencyMinimums[currency_code] ) == 'undefined' ) {
 290+ wgCurrencyMinimums[currency_code] = 1;
281291 }
282 - if ( amount < wgCurrencyMinimums[currency] || error ) {
283 - alert( 'You must contribute at least $1'.replace('$1', wgCurrencyMinimums[currency] + ' ' + currency ) );
 292+ if ( amount < wgCurrencyMinimums[currency_code] || error ) {
 293+ alert( mw.msg( 'donate_interface-smallamount-error' ).replace( '$1', wgCurrencyMinimums[currency_code] + ' ' + currency_code ) );
284294 error = true;
 295+ $( '#other-amount' ).val( '' );
 296+ $( '#other-amount' ).focus();
285297 }
286298 return !error;
287299 };
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/html/lightbox1.html
@@ -1,245 +0,0 @@
2 -<!--[if lt IE 7]><style type="text/css">body{behavior:url("/w/skins-1.17/vector/csshover.min.htc")}</style><![endif]-->
3 -<script type="text/javascript">
4 -mw.loader.load('pfp.form.rapidhtml.lightbox.js');
5 -mw.loader.load('pfp.form.rapidhtml.lightbox.css');
6 -</script>
7 -
8 - <div class="ltr">
9 - <div id="appeal">
10 - <div id="appeal-content">
11 - <div class="call-r">
12 - <div id="donate">
13 - <h3 id="amount-heading">Donate</h3>
14 -
15 - <form method="post" name="paypalcontribution">
16 - <div style="display: block;" id="amount-content">
17 -
18 - <table id="amount-table">
19 - <tr>
20 - <td><label><input type="radio" name="amountRadio" value="5" /> $5</label></td>
21 - <td><label><input type="radio" name="amountRadio" value="10" /> $10</label></td>
22 - <td><label><input type="radio" name="amountRadio" value="20" /> $20</label></td>
23 - <td><label><input type="radio" name="amountRadio" value="35" /> $35</label></td>
24 - </tr>
25 - <tr>
26 - <td><label><input type="radio" name="amountRadio" value="50" /> $50</label></td>
27 - <td><label><input type="radio" name="amountRadio" value="100" /> $100</label></td>
28 - <td><label><input type="radio" name="amountRadio" value="250" /> $250</label></td>
29 - <td><input type="radio" name="amountRadio" id="input_amount_other" value="other" /> <label>$<input type="text" name="amountGiven" size="4" id="other-amount" placeholder="Other" onfocus="this.form.input_amount_other.checked=true;"/></label></td>
30 - </tr>
31 - </table>
32 -
33 - <p class="donate-options">
34 - <input class="btn" id="cc" value="Donate by Credit Card" type="button">
35 - <br><input class="btn" id="pp" value="Donate via PayPal" type="button"><span id="loading"></span>
36 - </p>
37 - </div>
38 -
39 - </form>
40 - </div>
41 -
42 - <div id="callout-content">
43 - <hr>
44 - <h3>Where your donation goes</h3>
45 - <p><strong>Technology:</strong> Servers, bandwidth,
46 -maintenance, development. Wikipedia is the #5 website in the world and
47 -it runs on a fraction of what other top websites spend.</p>
48 - <p><strong>People:</strong> The other top 10 website
49 -have thousands of employees. We have fewer than 100, making your
50 -donation a great investment in a highly-efficient not-for-profit
51 -organization.</p>
52 - </div>
53 - </div>
54 -
55 - <h2 id="appeal-head"> <span class="mw-headline" id="From_Wikipedia_programmer_Brandon_Harris">From Wikipedia programmer Brandon Harris</span></h2>
56 - <div id="appeal-body" class="plainlinks">
57 - <p>I feel like I'm living the first line of my obituary.</p>
58 - <p>I don't think there will be anything else that I do in my
59 - life as important as what I do now for Wikipedia. We're not just
60 -building an encyclopedia, we're working to make people free. When we
61 -have access to free knowledge, we are better people. We understand the
62 -world is bigger than us, and we become infected with tolerance and
63 -understanding.</p>
64 - <p>Wikipedia is the 5th largest website in the world. I work
65 - at the small non-profit that keeps it on the web. We don't run ads
66 -because doing so would sacrifice our independence. The site is not and
67 -should never be a propaganda tool.</p>
68 - <p>Our work is possible because of donations from our
69 -readers. Will you help protect Wikipedia by donating $5, $10, $20 or
70 -whatever you can afford?</p>
71 - <p>I work at the Wikimedia Foundation because everything in
72 -my soul tells me it's the right thing to do. I've worked at huge tech
73 -companies, doing some job to build some crappy thing that's designed to
74 -steal money from some kid who doesn't know it. I would come home from
75 -work crushed.</p>
76 - <p>You might not know this, but the Wikimedia Foundation
77 -operates with a very small staff. Most other top-ten sites have tens of
78 -thousands of people and massive budgets. But they produce a fraction of
79 -what we pull off with sticks and wire.</p>
80 - <p>When you give to Wikipedia, you're supporting free
81 -knowledge around the world. You're not only leaving a legacy for your
82 -children and for their children, you're elevating people around the
83 -world who have access to this treasure. You're assuring that one day
84 -everyone else will too.</p>
85 - <p>Thank you,</p>
86 - <p><strong>Brandon Harris</strong><br></p>
87 - <p>Programmer, Wikimedia Foundation</p>
88 - </div>
89 - </div>
90 - </div>
91 -
92 - <hr>
93 -
94 - <p>We do not store your credit card information, and your personal data is subject to our <a target="_blank" href="http://wikimediafoundation.org/wiki/Donor_policy"> donor privacy policy</a>.</p>
95 - <p><a href="http://wikipedia.webitects.com/wiki/Ways_to_Give/en">More information or other ways to give</a><br><a href="http://wikipedia.webitects.com/wiki/FAQ/en">Answers to frequently asked questions</a></p>
96 - </div>
97 -
98 -<div id="dialog">
99 - <div id="steps">
100 - <form id="donationForm" name="donationForm" action="" method="post">
101 - <fieldset class="step">
102 - <legend>Personal Information</legend>
103 - <input type="hidden" name="gateway" value="payflowpro" id="gateway" />
104 - <input type="hidden" name="returnto" value="Thank_You/en" />
105 - <input type="hidden" value="@action" name="action" />
106 - <input type="hidden" value="@amount" name="amount" />
107 - <input type="hidden" value="@country" name="country" id="country" />
108 - <input type="hidden" value="@expiration" name="expiration" />
109 - <input type="hidden" value="@currency_code" name="currency" />
110 - <input type="hidden" value="@utm_source" name="utm_source"/>
111 - <input type="hidden" value="@utm_medium" name="utm_medium"/>
112 - <input type="hidden" value="@utm_campaign" name="utm_campaign"/>
113 - <input type="hidden" value="@language" name="language"/>
114 - <input type="hidden" value="@referrer" name="referrer"/>
115 - <input type="hidden" value="@comment" name="comment"/>
116 - <input type="hidden" value="@comment-option" name="comment-option"/>
117 - <input type="hidden" value="@email-opt" name="email-opt"/>
118 - <input type="hidden" value="processed" name="payment_method"/>
119 - <input type="hidden" value="@token" name="token"/>
120 - <input type="hidden" value="@order_id" name="order_id"/>
121 - <input type="hidden" value="@numAttempt" name="numAttempt"/>
122 - <input type="hidden" value="@contribution_tracking_id" name="contribution_tracking_id"/>
123 - <input type="hidden" value="@data_hash" name="data_hash"/>
124 - <input type="hidden" value="@owa_session" name="owa_session"/>
125 - <input type="hidden" value="@owa_ref" name="owa_ref"/>
126 - <div class="step-content">
127 - <div class="stuff">
128 - <table>
129 - <tr>
130 - <td class="label">
131 - <label for="fname">Name</label>
132 - </td>
133 - <td>
134 - <input name="fname" placeholder="First name" size="25" value="@fname" type="text" maxlength="30" class="required" id="fname" style="width: 136px;" />&#160;<input name="lname" placeholder="Last name" size="25" value="@lname" type="text" maxlength="30" class="required" id="lname" style="width: 136px;" />
135 - </td>
136 - </tr>
137 - </table>
138 - </div>
139 - <div class="stuff">
140 - <table>
141 - <tr>
142 - <td class="label">
143 - <label for="street">Billing Address</label>
144 - </td>
145 - <td>
146 - <input name="street" placeholder="Street" size="30" value="@street" type="text" maxlength="100" class="required" id="street" style="width: 258px;" />
147 - </td>
148 - </tr>
149 - <tr>
150 - <td class="label">&#160;</td>
151 - <td>
152 - <input name="city" placeholder="City" class="required" size="18" value="@city" type="text" maxlength="40" id="city" style="width: 136px;"/>
153 - <select name="state" class="required" id="state" value="@state"><option value="" /><option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="PR">PR</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option><option value="AA">AA</option><option value="AE">AE</option><option value="AP">AP</option></select>
154 - <input name="zip" placeholder="Zip" class="required" size="5" value="@zip" type="text" maxlength="10" id="zip" style="width: 48px;" /><input type="hidden" value="US" name="country" />
155 - </td>
156 - </tr>
157 - </table>
158 - </div>
159 - <div class="stuff">
160 - <table>
161 - <tr>
162 - <td class="label">
163 - <label for="email">Email</label>
164 - </td>
165 - <td>
166 - <input name="emailAdd" placeholder="Email address" size="30" value="@emailAdd" type="text" maxlength="100" class="required" id="email" style="width: 258px;" />
167 - </td>
168 - </tr>
169 - </table>
170 - </div>
171 - <a href="#" class="continue-button">Continue</a>
172 - </div>
173 - </fieldset>
174 - <fieldset class="step">
175 - <legend>Payment</legend>
176 - <div class="step-content">
177 - <div class="stuff">
178 - <table>
179 - <tr>
180 - <td class="label">
181 - <label for="email">Card Number</label>
182 - </td>
183 - <td>
184 - <input name="card_num" size="30" value="@card_num" type="text" maxlength="100" class="required" id="card_num" style="width: 258px;" />
185 - </td>
186 - </tr>
187 - </table>
188 - </div>
189 - <div class="stuff">
190 - <table>
191 - <tr>
192 - <td class="label">
193 - <label for="expiration">Expiration Date</label>
194 - </td>
195 - <td>
196 - <select name="mos" id="expiration">
197 - <option value="01">1 (January)</option>
198 - <option value="02">2 (February)</option>
199 - <option value="03">3 (March)</option>
200 - <option value="04">4 (April)</option>
201 - <option value="05">5 (May)</option>
202 - <option value="06">6 (June)</option>
203 - <option value="07">7 (July)</option>
204 - <option value="08">8 (August)</option>
205 - <option value="09">9 (September)</option>
206 - <option value="10">10 (October)</option>
207 - <option value="11">11 (November)</option>
208 - <option value="12">12 (December)</option>
209 - </select>
210 - /
211 - <select name="year" id="year">
212 - <option value="2011">2011</option>
213 - <option value="2012">2012</option>
214 - <option value="2013">2013</option>
215 - <option value="2014">2014</option>
216 - <option value="2015">2015</option>
217 - <option value="2016">2016</option>
218 - <option value="2017">2017</option>
219 - <option value="2018">2018</option>
220 - <option value="2019">2019</option>
221 - <option value="2020">2020</option>
222 - <option value="2021">2021</option>
223 - </select>
224 - </td>
225 - </tr>
226 - </table>
227 - </div>
228 - <div class="stuff">
229 - <table>
230 - <tr>
231 - <td class="label">
232 - <label for="email">Security Code</label>
233 - </td>
234 - <td>
235 - <input name="cvv" size="30" value="@cvv" type="text" maxlength="100" class="required" id="cvv" style="width: 50px;" />
236 - </td>
237 - </tr>
238 - </table>
239 - </div>
240 - <a href="#" class="back-button" id="goback">Back</a>
241 - <a href="#" class="continue-button" id="submitcreditcard">Continue</a>
242 - </div>
243 - </fieldset>
244 - </form>
245 - </div>
246 -</div>
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/RapidHtmlResources.php
@@ -18,10 +18,9 @@
1919 'js/lightbox1.js',
2020 ),
2121 'styles' => array(
22 - 'css/lightbox1.css',
 22+ 'css/lightbox1.css',
2323 ),
2424 'dependencies' => array(
25 - 'jquery.ui.core',
2625 'jquery.ui.widget',
2726 'jquery.ui.mouse',
2827 'jquery.ui.position',
@@ -30,9 +29,12 @@
3130 'jquery.ui.button',
3231 'jquery.ui.dialog',
3332 ),
34 - 'localBasePath' => dirname( __FILE__ ),
 33+ 'messages' => array(
 34+ 'donate_interface-cc-button',
 35+ 'donate_interface-paypal-button',
 36+ ),
 37+ 'localBasePath' => dirname( __FILE__ ).'/../../payflowpro_gateway/forms',
3538 'remoteExtPath' => $wgPayflowRapidHtmlRemoteExtPath,
36 - 'position' => 'top',
3739 );
3840
3941 /**
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/css/lightbox1.css
@@ -1,288 +0,0 @@
2 -/* Pitch */
3 -#pitch {
4 - height: 236px;
5 - background-image: url(http://upload.wikimedia.org/wikipedia/foundation/d/dc/Jimmy_Appeal_2009.jpg);
6 - background-position: right top;
7 - background-repeat: no-repeat;
8 - background-color: #1e1e1e;
9 - border: 1px solid gray;
10 - border-bottom-width: 0;
11 -}
12 -#pitch-head {
13 - width: 50%;
14 - font-size: 1.75em;
15 - line-height: 1.5em;
16 - color: white;
17 - margin-top: 16px;
18 - margin-left: 24px;
19 -}
20 -#pitch-body {
21 - width: 50%;
22 - font-size: 1em;
23 - line-height: 1.5em;
24 - color: white;
25 - margin-top: 16px;
26 - margin-left: 24px;
27 -}
28 -
29 -#appeal-head {
30 - font-size: 1.5em;
31 - line-height: 1.125em;
32 - padding-bottom: 0.5em;
33 - padding-top: 0.125em;
34 -}
35 -#appeal-body {
36 - padding: 0.2em 0em;
37 - font-size: 1.125em;
38 - margin-bottom: 1em;
39 -}
40 -/* Donate */
41 -#donate {
42 - font-size: 16px;
43 -}
44 -#amount-table td {
45 - font-size: 100%;
46 - padding: 4px;
47 -}
48 -
49 -#donate-content {
50 - background-color: #CCE7CD;
51 - border: 1px solid #5eac58;
52 -}
53 -#donate-head {
54 - font-size: 1.5em;
55 - line-height: 1.125em;
56 - padding-bottom: 0.5em;
57 - padding-top: 0.125em;
58 - border-color: #5eac58;
59 -}
60 -#donate-body {
61 - font-size: 1.25em;
62 -}
63 -
64 -.donate-body-small {
65 - font-size: .75em;
66 - margin-bottom:1em;
67 -}
68 -.donate-options {
69 - text-align: center;
70 -}
71 -.donate-options input {
72 - width: 15em;
73 -}
74 -
75 -input.button, select#input_currency_code {
76 - font-size: 95%;
77 -}
78 -
79 -table {
80 - background-color: transparent;
81 -}
82 -
83 -#footer {
84 - background-image: none !important;
85 -}
86 -
87 -#mw-head-base {
88 - height: 1em !important;
89 -}
90 -
91 -#mw-panel div.portal {
92 - display: none !important;
93 -}
94 -
95 -#p-namespaces, #p-views, #p-cactions, #p-search, #p-personal, #catlinks, #firstHeading, #contentSub, #siteSub {
96 - display: none;
97 -}
98 -
99 -div#content {
100 - background-color: transparent !important;
101 - background-image: none !important;
102 -}
103 -
104 -div#mw-head-base {
105 - background-image: none !important;
106 -}
107 -
108 -.l {
109 - float: left;
110 -}
111 -.r {
112 - float: right;
113 -}
114 -hr {
115 - margin: 1.5em 0 0.5em;
116 -}
117 -h3 span {
118 - font-weight: normal;
119 -}
120 -#amount-table td {
121 - white-space: nowrap;
122 -}
123 -.call-l {
124 - float: left;
125 - margin: 0.2em 1em 1em 0;
126 -}
127 -.call-l, .call-r {
128 - background: none repeat scroll 0 0 #FFFFFF;
129 - border: 1px solid #444444;
130 - font-size: 13px;
131 - padding: 15px 20px;
132 -}
133 -.call-l h3, .call-r h3 {
134 - font-size: 17px;
135 -}
136 -.call-l .loading, .call-r .loading {
137 - background-image: url("../images/loading-white.gif");
138 -}
139 -.call-r {
140 - float: right;
141 - margin: 0.2em 0 1em 1em;
142 -}
143 -#loading {
144 - font-size: 12px;
145 - margin-left: 0.5em;
146 - vertical-align: middle;
147 -}
148 -.loading {
149 - background: url("../images/loading-green.gif") no-repeat scroll 50% 50% transparent;
150 - padding: 10px;
151 -}
152 -.mute {
153 - font-size: 12px;
154 -}
155 -
156 -/* Callouts */
157 -.call-l, .call-r { width: 310px; }
158 -
159 -/* Layout */
160 -.clear { clear: both; }
161 -
162 -/* Lightbox */
163 -div.ui-dialog {
164 - width: 600px;
165 - overflow: hidden;
166 -}
167 -.ui-dialog .ui-dialog-title {
168 - font-size: 1em;
169 - font-weight: normal;
170 -}
171 -.ui-widget {
172 - font-size: 1em;
173 -}
174 -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
175 - font-size: 0.8em;
176 -}
177 -input.btn {
178 - font-size: 15px;
179 - margin-bottom: 3px;
180 -}
181 -#dialog{
182 - overflow: hidden;
183 -}
184 -.ui-dialog .ui-dialog-content {
185 - padding: 0;
186 -}
187 -#steps{
188 - width:600px;
189 - overflow:hidden;
190 - font-family:sans-serif;
191 -}
192 -.step{
193 - float:left;
194 - width:600px;
195 - position: relative;
196 -}
197 -.step-content {
198 - padding: 20px;
199 - height: 260px;
200 -}
201 -
202 -#steps form fieldset{
203 - border:none;
204 - padding: 0;
205 - margin: 0;
206 -}
207 -#steps form legend{
208 - text-align:left;
209 - color:#666;
210 - font-size:24px;
211 - /* text-shadow:1px 1px 1px #aaa; */
212 - font-weight:bold;
213 - float:left;
214 - width:580px;
215 - padding:8px 0px 5px 20px;
216 - margin:10px 0px;
217 -}
218 -#steps form div.stuff{
219 - clear:both;
220 - margin:3px 0px;
221 - width:auto;
222 - padding:5px 10px;
223 - /*
224 - background-color:#f4f4f4;
225 - border:1px solid #fff;
226 - -moz-border-radius: 5px;
227 - -webkit-border-radius: 5px;
228 - border-radius: 5px;
229 - -moz-box-shadow:0px 0px 3px #aaa;
230 - -webkit-box-shadow:0px 0px 3px #aaa;
231 - box-shadow:0px 0px 3px #aaa;
232 - */
233 -}
234 -#steps form div.stuff label{
235 - width:140px;
236 - float:left;
237 - text-align:right;
238 - margin-right:12px;
239 - line-height:26px;
240 - color:#666;
241 - /* text-shadow:1px 1px 1px #fff; */
242 - font-weight:bold;
243 - font-size: 15px;
244 -}
245 -#steps form input:not([type=radio]),
246 -#steps form textarea,
247 -#steps form select{
248 - background: #ffffff;
249 - border: 1px solid #ccc;
250 - -moz-border-radius: 3px;
251 - -webkit-border-radius: 3px;
252 - border-radius: 3px;
253 - outline: none;
254 - padding: 5px;
255 -}
256 -#steps form input.widefield{
257 - width: 200px;
258 - float:left;
259 -}
260 -#steps form input.large{
261 - font-size: 20px;
262 - line-height: 22px;
263 - width: 62px;
264 -}
265 -#steps form input:focus{
266 - -moz-box-shadow:0px 0px 3px #aaa;
267 - -webkit-box-shadow:0px 0px 3px #aaa;
268 - box-shadow:0px 0px 3px #aaa;
269 - background-color:#FFFEEF;
270 -}
271 -#steps form p.submit{
272 - background:none;
273 - border:none;
274 - -moz-box-shadow:none;
275 - -webkit-box-shadow:none;
276 - box-shadow:none;
277 -}
278 -#steps form a.back-button {
279 - position: absolute;
280 - bottom: 25px;
281 - left: 25px;
282 - margin: 0 !important;
283 -}
284 -#steps form a.continue-button {
285 - position: absolute;
286 - bottom: 25px;
287 - right: 25px;
288 - margin: 0 !important;
289 -}
\ No newline at end of file
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/js/lightbox1.js
@@ -1,200 +0,0 @@
2 -$(function() {
3 -
4 - $( '#dialog' ).dialog( {
5 - width: 600,
6 - resizable: false,
7 - autoOpen: false,
8 - modal: true,
9 - title: 'Donate by Credit Card'
10 - } );
11 -
12 - // If the form is being reloaded, restore the amount
13 - var previousAmount = $( 'input[name="amount"]' ).val();
14 - if ( previousAmount && previousAmount > 0 ) {
15 - var matched = false;
16 - $( 'input[name="amountRadio"]' ).each( function( index ) {
17 - if ( $( this ).val() == previousAmount ) {
18 - $( this ).attr( 'checked', true );
19 - matched = true;
20 - }
21 - } );
22 - if ( !matched ) {
23 - $( 'input#input_amount_other' ).attr( 'checked', true );
24 - $( 'input#other-amount' ).val( previousAmount );
25 - }
26 - }
27 -
28 - $( '#cc' ).click( function() {
29 - if ( validateAmount( document.paypalcontribution ) ) {
30 - $( '#dialog' ).dialog( 'open' );
31 - }
32 - });
33 - $( '#pp' ).click( function() {
34 - if ( validateAmount( document.paypalcontribution ) ) {
35 - $( "input[name='gateway']" ).val( 'paypal' );
36 - document.paypalcontribution.action = "https://wikimediafoundation.org/wiki/Special:ContributionTracking/en";
37 - $( '#loading' ).html( "<img src='../images/loading.gif' /> Redirecting to PayPal..." );
38 - document.paypalcontribution.submit();
39 - }
40 - });
41 -
42 - /* Set selected amount to amount */
43 - $( "input[name='amountRadio']" ).click( function() { setAmount( $( this ) ); } );
44 - $( "#other-amount" ).change( function() { setAmount( $( this ) ); } );
45 - function setAmount(e) { $("input[name='amount']").val( e.val() ); }
46 -
47 - /* number of fieldsets */
48 - var fieldsetCount = $( '#donationForm' ).children().length;
49 -
50 - /* current position of fieldset / navigation link */
51 - var current = 1;
52 -
53 - /*
54 - Sum and save the widths of each one of the fieldsets.
55 - Set the final sum as the total width of the steps element.
56 - */
57 - var stepsWidth = 0;
58 - var widths = new Array();
59 - $( '#steps .step' ).each( function(i) {
60 - var $step = $( this );
61 - widths[i] = stepsWidth;
62 - stepsWidth += 600; // Hard-coding as $.width() is not working for some reason
63 - } );
64 - $( '#steps' ).width( stepsWidth );
65 -
66 - /* To avoid problems in IE, focus the first input of the form */
67 - $( '#donationForm' ).children( ':first' ).find( ':input:first' ).focus();
68 -
69 - /* make continue buttons */
70 - $( 'a.continue-button' ).button();
71 - $( 'a.continue-button' ).click( function(e) {
72 - var $this = $( this );
73 - current = $( this ).parent().parent().index() + 1;
74 - if ( current == fieldsetCount ) {
75 - finalSubmit();
76 - return false;
77 - }
78 - if ( validateStep( current ) === 1 ) {
79 - current = current + 1;
80 - $( '#steps' ).stop().animate( { marginLeft: '-' + widths[current - 1] + 'px' }, 500,
81 - function() {
82 - $( '#donationForm' ).children( ':nth-child(' + parseInt(current) + ')' ).find( ':input:first' ).focus();
83 - }
84 - );
85 - } else {
86 - $this.blur();
87 - }
88 -
89 - e.preventDefault();
90 - });
91 -
92 - /* Make back button */
93 - $( 'a.back-button' ).button();
94 - $( 'a.back-button' ).click( function(e) {
95 - var $this = $( this );
96 - /* Set current to 1 less than previous step */
97 - current = $( this ).parent().parent().index();
98 -
99 - $( '#steps' ).stop().animate( { marginLeft: '+' + widths[current - 1] + 'px' }, 500 );
100 -
101 - e.preventDefault();
102 - });
103 -
104 - /* Hitting tab on the last input of each fieldset makes the form slide to the next step. */
105 - $( '#donationForm > fieldset' ).each( function() {
106 - var $fieldset = $( this );
107 - $fieldset.find( ':input:last' ).keydown( function(e) {
108 - if ( e.which == 9 ){ // 9 is the char code for tab
109 - $fieldset.find( 'a.continue-button' ).click();
110 - /* Force the blur for validation */
111 - e.preventDefault();
112 - }
113 - });
114 - });
115 -
116 - /*
117 - Validates errors on all the fieldsets.
118 - Records if the form has errors in $( '#donationForm' ).data().
119 - */
120 - function validateSteps() {
121 - var formErrors = false;
122 - for( var i = 1; i < fieldsetCount; ++i ) {
123 - var error = validateStep(i);
124 - if ( error == -1 ) formErrors = true;
125 - }
126 - $( '#donationForm' ).data( 'errors', formErrors );
127 - }
128 -
129 - function finalSubmit() {
130 - var formErrors = false;
131 - for( var i = 1; i <= fieldsetCount; ++i ) {
132 - var error = validateStep(i);
133 - if ( error == -1 ) formErrors = true;
134 - }
135 - $( '#donationForm' ).data( 'errors', formErrors );
136 -
137 - if ( $( '#donationForm' ).data( 'errors' ) ) {
138 - alert( 'Please correct the errors in the form.' );
139 - return false;
140 - } else {
141 - /* Set country to US */
142 - $( "input[name='country']" ).val('US' );
143 -
144 - /* Set expiration date */
145 - $( "input[name='expiration']" ).val(
146 - $( "select[name='mos']" ).val() + $( "select[name='year']" ).val().substring( 2, 4 )
147 - )
148 -
149 - /* Submit the form */
150 - document.donationForm.action = $( "input[name='action']" ).val();
151 - document.donationForm.submit();
152 - }
153 - }
154 -
155 - /*
156 - validates one fieldset
157 - returns -1 if errors found, or 1 if not
158 - */
159 - function validateStep( step ) {
160 - var error = 1;
161 - $( '#donationForm' ).children( ':nth-child(' + parseInt(step) + ')' ).find( ':input:not(button).required' ).each( function() {
162 - var $this = $( this );
163 - var valueLength = jQuery.trim( $this.val() ).length;
164 -
165 - if ( valueLength == '' ) {
166 - error = -1;
167 - $this.css( 'background-color', '#FFEDEF' );
168 - } else {
169 - $this.css( 'background-color', '#FFFFFF' );
170 - }
171 - });
172 -
173 - return error;
174 - }
175 -
176 - function validateAmount(){
177 - var error = true;
178 - var amount = $( "input[name='amount']" ).val(); // get the amount
179 - var otherAmount = amount // create a working copy
180 - otherAmount = otherAmount.replace( /[,.](\d)$/, '\:$10' );
181 - otherAmount = otherAmount.replace( /[,.](\d)(\d)$/, '\:$1$2' );
182 - otherAmount = otherAmount.replace( /[,.]/g, '' );
183 - otherAmount = otherAmount.replace( /:/, '.' );
184 - amount = otherAmount; // reset amount to working copy amount
185 - $( "input[name='amount']" ).val( amount ); // set the new amount back into the form
186 -
187 - // Check amount is a real number, sets error as true (good) if no issues
188 - error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
189 - // Check amount is at least the minimum
190 - var currency = 'USD'; // hard-coded for these forms and tests
191 - $( "input[name='currency_code']" ).val( currency );
192 - if ( typeof( wgCurrencyMinimums[currency] ) == 'undefined' ) {
193 - wgCurrencyMinimums[currency] = 1;
194 - }
195 - if ( amount < wgCurrencyMinimums[currency] || error ) {
196 - alert( 'You must contribute at least $1'.replace('$1', wgCurrencyMinimums[currency] + ' ' + currency ) );
197 - error = true;
198 - }
199 - return !error;
200 - };
201 -});
Index: trunk/extensions/DonationInterface/gateway_common/interface.i18n.php
@@ -124,6 +124,7 @@
125125 // Migrated messages
126126 'donate_interface-accessible' => 'This page is only accessible from the donation page.',
127127 'donate_interface-paypal-button' => 'Donate via PayPal',
 128+ 'donate_interface-paypal-redirect' => 'Redirecting to PayPal…',
128129 'donate_interface-cc-button' => 'Donate by credit card',
129130 'donate_interface-ccdc-button' => 'Donate by credit/debit card',
130131 'donate_interface-dd-button' => 'Donate by direct debit',

Follow-up revisions

RevisionCommit summaryAuthorDate
r103624MFT r103434, r103537, r103541, r103548khorn23:04, 18 November 2011
r106245MFT r102664, r102689, r102736, r102807, r102812, r102824, r102872, r102922, r...awjrichards21:26, 14 December 2011

Status & tagging log