Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Trim whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Aug 1, 2012
1 parent 9a337f7 commit 83f78f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
28 changes: 14 additions & 14 deletions www/assets/%version/gittip.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
if (!window.console)
{
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count",
"trace", "profile", "profileEnd"];
window.console = {};
for (var i=0, name; name = names[i]; i++)
Expand Down Expand Up @@ -58,7 +58,7 @@ if (!String.prototype.replaceAll)

if(!String.prototype.trim)
{ // http://stackoverflow.com/questions/1418050/string-strip-for-javascript
String.prototype.trim = function()
String.prototype.trim = function()
{
return String(this).replace(/^\s+|\s+$/g, '');
};
Expand Down Expand Up @@ -93,7 +93,7 @@ Gittip.showFeedback = function(msg, details)
{
if (msg === null)
msg = "Failure";
msg = '<h3><span class="highlight">' + msg + '</span></h3>';
msg = '<h3><span class="highlight">' + msg + '</span></h3>';
msg += '<div class="details"></div>';
$('#feedback').html(msg);
if (details !== undefined)
Expand All @@ -106,7 +106,7 @@ Gittip.submitForm = function(url, data, success, error)
if (success === undefined)
{
success = function()
{
{
Gittip.showFeedback("Success!");
}
}
Expand All @@ -118,7 +118,7 @@ Gittip.submitForm = function(url, data, success, error)
Gittip.showFeedback(data.problem);
};
}

function _success(data)
{
if (data.problem === "" || data.problem === undefined)
Expand Down Expand Up @@ -180,17 +180,17 @@ Gittip.submitPaymentForm = function(e)
setTimeout(Gittip.submitPaymentForm, 200);
return false;
}


// Adapt our form lingo to balanced nomenclature.

function val(field)
{
return $('FORM#payment INPUT[id="' + field + '"]').val();
}

var credit_card = {}; // holds CC info

credit_card.card_number = val('card_number');
if (credit_card.card_number.search('[*]') !== -1)
credit_card.card_number = ''; // don't send if it's the **** version
Expand All @@ -202,14 +202,14 @@ Gittip.submitPaymentForm = function(e)
, 'region': credit_card.region // workaround
};
credit_card.postal_code = val('zip');

var expiry = val('expiry').split('/'); // format enforced by mask
credit_card.expiration_month= expiry[0];
credit_card.expiration_year = expiry[1];


// Require some options (expiry is theoretically handled by the mask).

if (!balanced.card.isCardNumberValid(credit_card.card_number))
{
$('BUTTON#save').text('Save');
Expand All @@ -222,7 +222,7 @@ Gittip.submitPaymentForm = function(e)
$('BUTTON#save').text('Save');
Gittip.showFeedback(null, ["Your CVV is bad."]);
}
else
else
{
balanced.card.create(credit_card, Gittip.paymentsResponseHandler);
}
Expand Down Expand Up @@ -369,11 +369,11 @@ Gittip.initTipButtons = function()
// Exit early if the button has the disabled class. I'm not using the
// disabled HTML attribute because (in Chrome) hovering over a disabled
// button means the row doesn't get the hover event.

if ($(this).hasClass('disabled'))
return;


// Grab the row and the current button. Exit early if they clicked the
// current selection.

Expand All @@ -398,7 +398,7 @@ Gittip.initTipButtons = function()
$('#payment-prompt').addClass('needed');
}


// Go to work!

var amount = $(this).text().replace('$', '');
Expand Down
6 changes: 3 additions & 3 deletions www/credit-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
else:
assert stripe_customer_id == card['id']
payments_down = False

username = user.id
# ========================================================================== ^L
{% extends templates/base.html %}
Expand Down Expand Up @@ -89,7 +89,7 @@ <h2 class="first">Credit Card</h2>

<h2 class="first">You are <a href="/{{ user.id }}/">{{ user.id }}</a>.</h2>
<h2>Your <b>credit card</b> is <span id="status">{{ status }}</span>.</h2>

{% if payments_down %}

<p>We had a problem contacting <a href="https://www.balancedpayments.com/">our payment
Expand Down Expand Up @@ -189,7 +189,7 @@ <h3>Optional</h3>
{% end %}
</form>

<div id="delete">
<div id="delete">
<h2>Delete credit card.</h2>

<p>Your credit card details will immediately be completely purged from
Expand Down

0 comments on commit 83f78f3

Please sign in to comment.