Left: | ||
Right: |
OLD | NEW |
---|---|
1 title=Adblock Plus has been uninstalled | 1 title=Adblock Plus has been uninstalled |
2 template=simple | 2 template=simple |
3 | 3 |
4 {% set reasons = [ | 4 {% set reasons = [ |
5 ("1v0", "reason-not-installed", "I didn't install Adblock Plus."), | 5 ("1v0", "reason-not-installed", "I didn't install Adblock Plus."), |
6 ("2v0", "reason-slowing-down", "Adblock Plus slowed down my browser."), | 6 ("2v0", "reason-slowing-down", "Adblock Plus slowed down my browser."), |
7 ("3v0", "reason-acceptable-ads", "I don't like the Acceptable Ads program."), | 7 ("3v0", "reason-acceptable-ads", "I don't like the Acceptable Ads program."), |
8 ("4v0", "reason-see-ads", "Adblock Plus didn't block all ads."), | 8 ("4v0", "reason-see-ads", "Adblock Plus didn't block all ads."), |
9 ("5v0", "reason-better-adblocker", "I found better ad blocking software."), | 9 ("5v0", "reason-better-adblocker", "I found better ad blocking software."), |
10 ("6v0", "reason-break-websites", "Adblock Plus breaks websites that I visit.") | 10 ("6v0", "reason-break-websites", "Adblock Plus breaks websites that I visit.") |
(...skipping 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 // Create hidden input for GET parameters | 22 // Create hidden input for GET parameters |
23 window.location.search.substr(1).split("&").forEach(function(param) | 23 window.location.search.substr(1).split("&").forEach(function(param) |
24 { | 24 { |
25 if (!/.=./.test(param)) | 25 if (!/.=./.test(param)) |
26 return; | 26 return; |
27 | 27 |
28 var paramSplit = param.split("="); | 28 var paramSplit = param.split("="); |
29 var input = document.createElement("input"); | 29 var input = document.createElement("input"); |
30 input.setAttribute("type", "hidden"); | 30 input.setAttribute("type", "hidden"); |
31 input.setAttribute("name", paramSplit[0]); | 31 input.setAttribute("name", paramSplit[0]); |
Sebastian Noack
2015/12/14 14:16:34
The parameter key can theoretically also include u
saroyanm
2015/12/14 14:48:12
Done.
| |
32 input.setAttribute("value", paramSplit[1]); | 32 input.setAttribute("value", decodeURIComponent(paramSplit[1])); |
33 form.appendChild(input); | 33 form.appendChild(input); |
34 }); | 34 }); |
35 | 35 |
36 // Randomly add reasons | 36 // Randomly add reasons |
37 var reasonsContainer = document.getElementById("reasons"); | 37 var reasonsContainer = document.getElementById("reasons"); |
38 var reasons = reasonsContainer.getElementsByTagName("li"); | 38 var reasons = reasonsContainer.getElementsByTagName("li"); |
39 reasons = Array.prototype.slice.call(reasons); | 39 reasons = Array.prototype.slice.call(reasons); |
40 reasonsContainer.innerHTML = ""; | 40 reasonsContainer.innerHTML = ""; |
41 while (reasons.length) | 41 while (reasons.length) |
42 { | 42 { |
43 var randomIndex = Math.floor(Math.random() * (reasons.length -1)); | 43 var randomIndex = Math.floor(Math.random() * (reasons.length -1)); |
44 var reasonElement = reasons.splice(randomIndex, 1)[0]; | 44 var reasonElement = reasons.splice(randomIndex, 1)[0]; |
45 reasonsContainer.appendChild(reasonElement); | 45 reasonsContainer.appendChild(reasonElement); |
46 } | 46 } |
47 | 47 |
48 var reasonOtherCheckbox = document.getElementById("reason-other"); | 48 var reasonOtherCheckbox = document.getElementById("reason-other"); |
49 reasonOtherCheckbox.addEventListener("change", function() | 49 reasonOtherCheckbox.addEventListener("change", function() |
50 { | 50 { |
51 var textArea = document.getElementById("reason-other-input"); | 51 var reasonOther = document.getElementById("reason-other-container"); |
52 if (textArea.hasAttribute("class")) | 52 if (reasonOther.hasAttribute("class")) |
53 textArea.removeAttribute("class") | 53 reasonOther.removeAttribute("class") |
Sebastian Noack
2015/12/14 14:16:34
How about using |.classList.toggle("hidden")|?
saroyanm
2015/12/14 14:48:12
Done.
| |
54 else | 54 else |
55 textArea.setAttribute("class", "hidden"); | 55 reasonOther.setAttribute("class", "hidden"); |
56 }, false); | |
57 | |
58 var reasonOtherInput = document.getElementById("reason-other-input"); | |
59 var maxLength = reasonOtherInput.getAttribute("maxlength"); | |
60 var charCounter = document.getElementById("characters-countdown"); | |
61 charCounter.textContent = maxLength; | |
62 reasonOtherInput.addEventListener("keyup", function() | |
63 { | |
64 charCounter.textContent = maxLength - reasonOtherInput.value.length; | |
56 }, false); | 65 }, false); |
57 | 66 |
58 var submitButton = document.getElementById("submit-form"); | 67 var submitButton = document.getElementById("submit-form"); |
59 submitButton.addEventListener("click", function(event) | 68 submitButton.addEventListener("click", function(event) |
60 { | 69 { |
61 if (!document.querySelector("ul input:checked")) | 70 if (!document.querySelector("ul input:checked")) |
62 { | 71 { |
63 event.preventDefault(); | 72 event.preventDefault(); |
64 form.setAttribute("class", "error"); | 73 form.setAttribute("class", "error"); |
65 } | 74 } |
66 else | 75 else |
67 { | 76 { |
68 form.submit(); | 77 form.submit(); |
69 } | 78 } |
70 }, false); | 79 }, false); |
71 } | 80 } |
72 document.addEventListener("DOMContentLoaded", init, false); | 81 document.addEventListener("DOMContentLoaded", init, false); |
73 })(); | 82 })(); |
74 </script> | 83 </script> |
75 </head> | 84 </head> |
76 | 85 |
77 <section class="highlighted"> | 86 <section class="highlighted"> |
78 <h1>{{"Please select the reason(s) why you uninstalled Adblock Plus:"|translat e("reasons-header", "Form heading")}}</h1> | 87 <h1>{{"Please select the reason(s) why you uninstalled Adblock Plus:"|translat e("reasons-header", "Form heading")}}</h1> |
79 <form id="reasons-form" action="uninstall-abp-submit" method="post"> | 88 <form id="reasons-form" action="uninstalled-submit" method="get"> |
80 <ul id="reasons"> | 89 <ul id="reasons"> |
81 {%- for reasonId, stringId, value in reasons %} | 90 {%- for reasonId, stringId, value in reasons %} |
82 <li> | 91 <li> |
83 <label> | 92 <label> |
84 <input type="checkbox" name="reason" value="{{reasonId}}" /> | 93 <input type="checkbox" name="reason" value="{{reasonId}}" /> |
85 {{value|translate(stringId, "Uninstallation reason")}} | 94 {{value|translate(stringId, "Uninstallation reason")}} |
86 </label> | 95 </label> |
87 </li> | 96 </li> |
88 {%- endfor %} | 97 {%- endfor %} |
89 <li> | 98 <li> |
90 <label> | 99 <label> |
91 <input id="reason-other" type="checkbox" name="reason" value="0v0" /> | 100 <input id="reason-other" type="checkbox" name="reason" value="0v0" /> |
92 {{"Other, namely..."|translate("reason-other", "Last uninstallation re ason")}} | 101 {{"Other, namely..."|translate("reason-other", "Last uninstallation re ason")}} |
93 </label> | 102 </label> |
94 <textarea id="reason-other-input" class="hidden" name="reasonOther" plac eholder="{{"Please explain why you are uninstalling Adblock Plus"|translate("rea son-other-placeholder", "Textarea placeholder text, appears after selecting 'Oth er, namely...' option")}}"></textarea> | 103 <div id="reason-other-container" class="hidden"> |
104 <textarea id="reason-other-input" name="reasonOther" maxlength="300" p laceholder="{{"Please explain why you are uninstalling Adblock Plus"|translate(" reason-other-placeholder", "Textarea placeholder text, appears after selecting ' Other, namely...' option")}}"></textarea> | |
105 <div> | |
106 {{"Characters remaining:"|translate("countdown-text", "Text of char acter limit counter appears after selecting 'Other, namely...' option")}} | |
107 <span id="characters-countdown"></span> | |
108 </div> | |
109 </div> | |
95 </li> | 110 </li> |
96 </ul> | 111 </ul> |
97 <button id="submit-form">{{"Submit"|translate("submit", "Submit button text" )}}</button> | 112 <button id="submit-form">{{"Submit"|translate("submit", "Submit button text" )}}</button> |
98 <span class="error-label">{{"Please select at least one of the options above "|translate("error-msg", "Error message, is being shown after submission if no i tem selected")}}</span> | 113 <span class="error-label">{{"Please select at least one of the options above "|translate("error-msg", "Error message, is being shown after submission if no i tem selected")}}</span> |
99 </form> | 114 </form> |
100 <p class="disclaimer"> | 115 <p class="disclaimer"> |
101 {{"By clicking Submit, you are sending your response to Adblock Plus. Please see our <a href='/privacy'>privacy policy</a>."|translate("disclaimer", "Discla imer below form")}} | 116 {{"By clicking Submit, you are sending your response to Adblock Plus. Please see our <a href='/privacy'>privacy policy</a>."|translate("disclaimer", "Discla imer below form")}} |
102 </p> | 117 </p> |
103 </section> | 118 </section> |
OLD | NEW |