| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 title=Donate to Adblock Plus | 1 title=Donate to Adblock Plus |
| 2 | 2 |
| 3 <head> | 3 <head> |
| 4 <style type="text/css"> | 4 <style type="text/css"> |
| 5 h2 | 5 h2 |
| 6 { | 6 { |
| 7 padding-top: 20px; | 7 padding-top: 20px; |
| 8 border-top: 1px solid #ccc; | 8 border-top: 1px solid #ccc; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 432 ); | 432 ); |
| 433 if (!selectedCurrency) | 433 if (!selectedCurrency) |
| 434 return; | 434 return; |
| 435 var currencyLabel = selectedCurrency.parentNode[textAttr]; | 435 var currencyLabel = selectedCurrency.parentNode[textAttr]; |
| 436 var currencyLabels = document.querySelectorAll(".currency-label"); | 436 var currencyLabels = document.querySelectorAll(".currency-label"); |
| 437 for (var i = 0; i < currencyLabels.length; i++) | 437 for (var i = 0; i < currencyLabels.length; i++) |
| 438 currencyLabels[i][textAttr] = currencyLabel; | 438 currencyLabels[i][textAttr] = currencyLabel; |
| 439 ensureMinPrice(); | 439 ensureMinPrice(); |
| 440 } | 440 } |
| 441 | 441 |
| 442 function addEventListenersBySelector(query, event, callback) | |
| 443 { | |
| 444 query = document.querySelectorAll(query); | |
| 445 var queryIndex = query.length; | |
| 446 //fallback to attachEvent for IE8 | |
| 447 var addListenerFunction = typeof document.addEventListener == "function" ? | |
| 448 "addEventListener" : | |
| 449 "attachEvent"; | |
| 450 if (addListenerFunction == "attachEvent") | |
| 451 event = "on" + event; | |
| 452 while (queryIndex--) | |
| 453 query[queryIndex][addListenerFunction](event, callback, false); | |
| 454 } | |
| 455 | |
| 456 function initializeDonationForm() | 442 function initializeDonationForm() |
| 457 { | 443 { |
| 458 formValues.name = getText("i18n_name"); | 444 formValues.name = getText("i18n_name"); |
| 459 addEventListenersBySelector("button[name='payment']", "click", onSelectPayme nt); | 445 document.getElementById("form-payment").addEventListener("click", onSelectPa yment, true); |
| 460 addEventListenersBySelector("input[name='currency']", "click", updateCurrenc y); | 446 document.getElementById("form-currency").addEventListener("click", updateCur rency, true); |
| 461 addEventListenersBySelector("#form", "submit", onSubmitDonation); | 447 document.getElementById("form").addEventListener("submit", onSubmitDonation, false); |
| 462 updateCurrency(); | 448 updateCurrency(); |
| 463 } | 449 } |
| 464 | 450 |
| 465 function onSelectPayment(event) | 451 function onSelectPayment(event) |
| 466 { | 452 { |
| 467 if(event.preventDefault) | 453 if (event.target.tagName != "BUTTON") |
|
Thomas Greiner
2016/01/27 17:20:31
Detail: Missing whitespace after `if`.
juliandoucette
2016/01/28 14:02:53
Done.
| |
| 468 event.preventDefault(); | 454 return; |
| 469 else | 455 event.preventDefault(); |
| 470 event.returnValue = false; | 456 document.getElementById("form").className = event.target.className; |
| 471 document.getElementById("form").className = (event.target || event.srcElemen t).className; | |
| 472 ensureMinPrice(); | 457 ensureMinPrice(); |
| 473 } | 458 } |
| 474 | 459 |
| 475 function onSubmitDonation(event) | 460 function onSubmitDonation(event) |
| 476 { | 461 { |
| 477 if(event.preventDefault) | 462 event.preventDefault(); |
| 478 event.preventDefault(); | |
| 479 else | |
| 480 event.returnValue = false; | |
| 481 var provider = providers[document.getElementById("form").className]; | 463 var provider = providers[document.getElementById("form").className]; |
| 482 if (provider) | 464 if (provider) |
| 483 provider(); | 465 provider(); |
| 484 } | 466 } |
| 485 | 467 |
| 486 if (document.addEventListener) | 468 document.addEventListener("DOMContentLoaded", initializeDonationForm, false); |
| 487 document.addEventListener("DOMContentLoaded", initializeDonationForm); | |
| 488 else | |
| 489 document.attachEvent("onreadystatechange", initializeDonationForm); | |
| 490 | 469 |
| 491 })(); | 470 })(); |
| 492 | 471 |
| 493 // --> | 472 // --> |
| 494 </script> | 473 </script> |
| 495 </head> | 474 </head> |
| 496 <span class="hidden" id="i18n_name">{{s1 Adblock Plus Contribution}}</span> | 475 <span class="hidden" id="i18n_name">{{s1 Adblock Plus Contribution}}</span> |
| 497 | 476 |
| 498 <p> | 477 <p> |
| 499 {{s2 Adblock Plus is - and will always be - free. Our mission is to provide us ers with tools that allow them to gain control over their Internet browsing and protect them from unwanted and malicious elements. | 478 {{s2 Adblock Plus is - and will always be - free. Our mission is to provide us ers with tools that allow them to gain control over their Internet browsing and protect them from unwanted and malicious elements. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 </div> | 545 </div> |
| 567 <div id="recurrent-cancellation"> | 546 <div id="recurrent-cancellation"> |
| 568 * {{s12 To cancel your monthly payment, click the link below that corres ponds to how you donated:}} | 547 * {{s12 To cancel your monthly payment, click the link below that corres ponds to how you donated:}} |
| 569 <ul> | 548 <ul> |
| 570 <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_manage-paylist " target="_blank">{{s13 I donated with PayPal}}</a></li> | 549 <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_manage-paylist " target="_blank">{{s13 I donated with PayPal}}</a></li> |
| 571 </ul> | 550 </ul> |
| 572 </div> | 551 </div> |
| 573 </div> | 552 </div> |
| 574 </div> | 553 </div> |
| 575 </form> | 554 </form> |
| LEFT | RIGHT |