Skip to content

Commit 01afa60

Browse files
committed
fixed missed }) in donate.html and moved donate function out of main.js
1 parent bd8cb5a commit 01afa60

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

war/donate.html

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,24 +188,24 @@ <h2>$100,000</h2>
188188
$("#otherAmount").removeClass("active");
189189
$("#amountSent").attr("value",$(this).html().replace("$",""));
190190
$(this).addClass("active");
191-
});
191+
})
192192

193193
$(".other").click(function(){
194194
$("#otherAmount").addClass("active");
195195
$("#amountSent").attr("value",$(this).val());
196196
$("#otherAmount").focus();
197-
});
197+
})
198198

199199
$("#otherAmount").click(function(){
200200
$("#otherAmount").addClass("active");
201201
$(".donation").removeClass("active");
202202
$("#amountSent").attr("value",$(this).val());
203203
$(".other").addClass("active");
204-
});
204+
})
205205

206206
$("#otherAmount").on("input",function(){
207207
$("#amountSent").attr("value",$(this).val());
208-
});
208+
})
209209

210210
var amount = getUrlParameter('amount');
211211
if(amount=="" || amount==undefined){
@@ -228,11 +228,10 @@ <h2>$100,000</h2>
228228
$("#otherAmount").val(amount);
229229
$("#amountSent").attr("value",amount);
230230
}
231-
232-
});
231+
})
233232

234233

235-
var getUrlParameter = function getUrlParameter(sParam) {
234+
function getUrlParameter(sParam) {
236235
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
237236
sURLVariables = sPageURL.split('&'),
238237
sParameterName,
@@ -245,7 +244,19 @@ <h2>$100,000</h2>
245244
return sParameterName[1] === undefined ? true : sParameterName[1];
246245
}
247246
}
248-
};
247+
}
248+
249+
function donate(){
250+
var amount = $(".donation.active");
251+
if(amount.hasClass("other")){
252+
amount=$("#otherAmount").val();
253+
}
254+
else{
255+
amount=amount.html().replace("$","");
256+
}
257+
window.location="\donate.html?amount="+amount;
258+
}
259+
249260

250261
window.___gcfg = {
251262
lang: 'en-GB'

war/js/main.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $(window).on('load', function() {
2828
})
2929

3030
$(function() {
31-
// it's not clear to me what this does?
31+
// unclear what this does?
3232
// side bar
3333
$('.bs-docs-sidenav').affix({
3434
offset: {
@@ -48,6 +48,7 @@ $(function() {
4848
});
4949

5050
$('.minilogo').tooltip();
51+
})
5152

5253

5354
window.___gcfg = {
@@ -56,17 +57,6 @@ window.___gcfg = {
5657

5758
// function definitions (hoisted so order does not matter)
5859

59-
function donate(){
60-
var amount = $(".donation.active");
61-
if(amount.hasClass("other")){
62-
amount=$("#otherAmount").val();
63-
}
64-
else{
65-
amount=amount.html().replace("$","");
66-
}
67-
window.location="\donate.html?amount="+amount;
68-
}
69-
7060
function detectmob() {
7161
if (window.innerWidth <= 800 && window.innerHeight <= 600) {
7262
return true;

0 commit comments

Comments
 (0)