Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 <link rel="canonical" href="http://acceptableads.org/"/> | 1 <link rel="canonical" href="http://acceptableads.org/"/> |
2 <meta property="og:type" content="website"/> | 2 <meta property="og:type" content="website"/> |
3 <meta property="og:image" content="http://acceptableads.org/images/manifesto/acc eptable-ads-manifesto-share.png?a=show"/> | 3 <meta property="og:image" content="http://acceptableads.org/images/manifesto/acc eptable-ads-manifesto-share.png?a=show"/> |
4 <meta property="og:url" content="http://acceptableads.org"/> | 4 <meta property="og:url" content="http://acceptableads.org"/> |
5 <meta name="google-site-verification" content="3deBAaPY4M2OuOe576R36TC28S5svlfRR sdaGS6WCXg"/> | 5 <meta name="google-site-verification" content="3deBAaPY4M2OuOe576R36TC28S5svlfRR sdaGS6WCXg"/> |
6 <meta charset="utf-8"/> | 6 <meta charset="utf-8"/> |
7 <meta name="viewport" content="width=device-width, initial-scale=1"/> | 7 <meta name="viewport" content="width=device-width, initial-scale=1"/> |
8 <style type="text/css"> | 8 <style type="text/css"> |
9 @font-face | 9 @font-face |
10 { | 10 { |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 return; | 482 return; |
483 | 483 |
484 document.getElementById("signees").removeAttribute("hidden"); | 484 document.getElementById("signees").removeAttribute("hidden"); |
485 var signeesCount = document.getElementById("signees-count"); | 485 var signeesCount = document.getElementById("signees-count"); |
486 if ("textContent" in signeesCount) | 486 if ("textContent" in signeesCount) |
487 signeesCount.textContent = count; | 487 signeesCount.textContent = count; |
488 else | 488 else |
489 signeesCount.innerText = count; | 489 signeesCount.innerText = count; |
490 } | 490 } |
491 | 491 |
492 function addListener(obj, type, listener, useCapture, preventDefault) | 492 function addListener(obj, type, listener, useCapture) |
493 { | 493 { |
494 if ("addEventListener" in obj) | 494 if ("addEventListener" in obj) |
495 { | 495 { |
496 obj.addEventListener(type, function(ev) | 496 obj.addEventListener(type, function(ev) |
497 { | 497 { |
498 listener(ev); | 498 if (listener(ev) === false) |
499 if (preventDefault) | |
500 ev.preventDefault(); | 499 ev.preventDefault(); |
Wladimir Palant
2014/08/18 12:31:19
A more consistent approach would be using the retu
Thomas Greiner
2014/08/19 09:32:34
Done.
| |
501 }, useCapture); | 500 }, useCapture); |
502 } | 501 } |
503 else | 502 else |
504 { | 503 { |
505 if (type == "DOMContentLoaded") | 504 if (type == "DOMContentLoaded") |
506 type = "load"; | 505 type = "load"; |
507 | 506 |
508 obj.attachEvent("on" + type, function() | 507 obj.attachEvent("on" + type, function() |
509 { | 508 { |
510 listener(event); | 509 if (listener(event) === false) |
511 event.returnValue = preventDefault; | 510 event.returnValue = false; |
Wladimir Palant
2014/08/18 12:31:19
This should assign !preventDefault - see onclick="
Thomas Greiner
2014/08/19 09:32:34
Done.
| |
512 }); | 511 }); |
513 } | 512 } |
514 } | 513 } |
515 | 514 |
516 addListener(window, "DOMContentLoaded", function(ev) | 515 addListener(window, "DOMContentLoaded", function(ev) |
517 { | 516 { |
518 fetchNumberOfSignees(); | 517 fetchNumberOfSignees(); |
519 | 518 |
520 var moreSupporters = document.getElementById("supporters-more-link"); | 519 var moreSupporters = document.getElementById("supporters-more-link"); |
521 addListener(moreSupporters, "click", function(ev) | 520 addListener(moreSupporters, "click", function(ev) |
522 { | 521 { |
523 var overflow = document.getElementById("supporters-overflow"); | 522 var overflow = document.getElementById("supporters-overflow"); |
524 overflow.removeAttribute("hidden"); | 523 overflow.removeAttribute("hidden"); |
525 moreSupporters.parentNode.removeChild(moreSupporters); | 524 moreSupporters.parentNode.removeChild(moreSupporters); |
526 }, false, true); | 525 |
526 return false; | |
527 }, false); | |
527 | 528 |
528 var readmore = document.getElementById("readmore"); | 529 var readmore = document.getElementById("readmore"); |
529 addListener(readmore, "click", function(ev) | 530 addListener(readmore, "click", function(ev) |
530 { | 531 { |
531 var fulltext = document.getElementById("fulltext"); | 532 var fulltext = document.getElementById("fulltext"); |
532 if (fulltext.hasAttribute("hidden")) | 533 if (fulltext.hasAttribute("hidden")) |
533 fulltext.removeAttribute("hidden"); | 534 fulltext.removeAttribute("hidden"); |
534 else | 535 else |
535 fulltext.hidden = "hidden"; | 536 fulltext.hidden = "hidden"; |
536 | 537 |
537 if ("stopPropagation" in ev) | 538 if ("stopPropagation" in ev) |
538 ev.stopPropagation(); | 539 ev.stopPropagation(); |
539 }, false, true); | 540 |
541 return false; | |
542 }, false); | |
540 | 543 |
541 var shareTitle = document.getElementById("share-text-title")[textAttr]; | 544 var shareTitle = document.getElementById("share-text-title")[textAttr]; |
542 var shareDescription = document.getElementById("share-text-description")[textA ttr]; | 545 var shareDescription = document.getElementById("share-text-description")[textA ttr]; |
543 var facebookButton = document.getElementById("facebook"); | 546 var facebookButton = document.getElementById("facebook"); |
544 facebookButton.href = "https://www.facebook.com/sharer/sharer.php?s=100&p%5Bti tle%5D=" | 547 facebookButton.href = "https://www.facebook.com/sharer/sharer.php?s=100&p%5Bti tle%5D=" |
545 + encodeURIComponent(shareTitle) | 548 + encodeURIComponent(shareTitle) |
546 + "&p%5Bsummary%5D=" | 549 + "&p%5Bsummary%5D=" |
547 + encodeURIComponent(shareDescription) | 550 + encodeURIComponent(shareDescription) |
548 + "&p%5Burl%5D=http%3A%2F%2Facceptableads.org%2F"; | 551 + "&p%5Burl%5D=http%3A%2F%2Facceptableads.org%2F"; |
549 var twitterButton = document.getElementById("twitter"); | 552 var twitterButton = document.getElementById("twitter"); |
550 twitterButton.href = "https://twitter.com/intent/tweet?text=" | 553 twitterButton.href = "https://twitter.com/intent/tweet?text=" |
551 + encodeURIComponent(shareTitle) | 554 + encodeURIComponent(shareTitle) |
552 + "&url=http%3A%2F%2Facceptableads.org%2F"; | 555 + "&url=http%3A%2F%2Facceptableads.org%2F"; |
553 }, false, false); | 556 }, false); |
554 | 557 |
555 function checkCollapse() | 558 function checkCollapse() |
556 { | 559 { |
557 if (document.documentElement.offsetWidth < 500) | 560 if (document.documentElement.offsetWidth < 500) |
558 return; | 561 return; |
559 | 562 |
560 var social = document.getElementById("sign"); | 563 var social = document.getElementById("sign"); |
561 var placeholder = document.getElementById("sign-placeholder"); | 564 var placeholder = document.getElementById("sign-placeholder"); |
562 var classes = social.className.split(" "); | 565 var classes = social.className.split(" "); |
563 | 566 |
(...skipping 11 matching lines...) Expand all Loading... | |
575 } | 578 } |
576 } | 579 } |
577 else if (scrollTop < placeholder.offsetTop + placeholder.offsetHeight - 100) | 580 else if (scrollTop < placeholder.offsetTop + placeholder.offsetHeight - 100) |
578 { | 581 { |
579 classes.splice(classes.indexOf("collapsed"), 1); | 582 classes.splice(classes.indexOf("collapsed"), 1); |
580 placeholder.style.height = "0px"; | 583 placeholder.style.height = "0px"; |
581 social.className = classes.join(" "); | 584 social.className = classes.join(" "); |
582 } | 585 } |
583 } | 586 } |
584 | 587 |
585 addListener(window, "scroll", checkCollapse, false, false); | 588 addListener(window, "scroll", checkCollapse, false); |
586 addListener(window, "resize", checkCollapse, false, false); | 589 addListener(window, "resize", checkCollapse, false); |
587 --></script> | 590 --></script> |
LEFT | RIGHT |