LEFT | RIGHT |
1 title=Adblock Plus has been uninstalled | 1 title=Adblock Plus has been uninstalled |
2 template=simple | 2 template=simple |
| 3 |
| 4 {% set reasons = [ |
| 5 ("1v0", "reason-not-installed", "I didn't install Adblock Plus."), |
| 6 ("2v0", "reason-slowing-down", "Adblock Plus slowed down my browser."), |
| 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."), |
| 9 ("5v0", "reason-better-adblocker", "I found better ad blocking software."), |
| 10 ("6v0", "reason-break-websites", "Adblock Plus breaks websites that I visit.") |
| 11 ] %} |
3 | 12 |
4 <head> | 13 <head> |
5 <meta name="robots" content="noindex" /> | 14 <meta name="robots" content="noindex" /> |
6 <script type="text/javascript"> | 15 <script type="text/javascript"> |
7 (function() | 16 (function() |
8 { | 17 { |
9 var reasons = [ | |
10 ["1v0", "{{reason-not-installed[Uninstallation reason] I didn't install Ad
block Plus.}}"], | |
11 ["2v0", "{{reason-slowing-down[Uninstallation reason] Adblock Plus slowed
down my browser.}}"], | |
12 ["3v0", "{{reason-acceptable-ads[Uninstallation reason] I don't like the A
cceptable Ads program.}}"], | |
13 ["4v0", "{{reason-see-ads[Uninstallation reason] Adblock Plus didn't block
all ads.}}"], | |
14 ["5v0", "{{reason-better-adblocker[Uninstallation reason] I found better a
d blocking software.}}"], | |
15 ["6v0", "{{reason-break-websites[Uninstallation reason] Adblock Plus break
s websites that I visit.}}"] | |
16 ]; | |
17 | |
18 function init() | 18 function init() |
19 { | 19 { |
20 var form = document.getElementById("reasons-form"); | 20 var form = document.getElementById("reasons-form"); |
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]); |
32 input.setAttribute("value", paramSplit[1]); | 32 input.setAttribute("value", 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"); |
| 38 var reasons = reasonsContainer.getElementsByTagName("li"); |
| 39 reasons = Array.prototype.slice.call(reasons); |
| 40 reasonsContainer.innerHTML = ""; |
37 while (reasons.length) | 41 while (reasons.length) |
38 { | 42 { |
39 var randomIndex = Math.floor(Math.random() * (reasons.length)); | 43 var randomIndex = Math.floor(Math.random() * (reasons.length -1)); |
40 var reason = reasons.splice(randomIndex, 1)[0]; | 44 var reasonElement = reasons.splice(randomIndex, 1)[0]; |
41 var listElement = document.createElement("li"); | 45 reasonsContainer.appendChild(reasonElement); |
42 var labelElement = document.createElement("label"); | |
43 var checkboxElement = document.createElement("input"); | |
44 checkboxElement.setAttribute("type", "checkbox"); | |
45 checkboxElement.setAttribute("name", "reason"); | |
46 checkboxElement.setAttribute("value", reason[0]); | |
47 var spanElement = document.createElement("span"); | |
48 spanElement.innerHTML = reason[1]; | |
49 labelElement.appendChild(checkboxElement); | |
50 labelElement.appendChild(spanElement); | |
51 listElement.appendChild(labelElement); | |
52 var reasonContainer = document.getElementById("reasons"); | |
53 reasonContainer.insertBefore(listElement, reasonContainer.firstChild); | |
54 } | 46 } |
55 | 47 |
56 var reasonOtherCheckbox = document.getElementById("reason-other"); | 48 var reasonOtherCheckbox = document.getElementById("reason-other"); |
57 reasonOtherCheckbox.addEventListener("change", function() | 49 reasonOtherCheckbox.addEventListener("change", function() |
58 { | 50 { |
59 var textArea = document.getElementById("reason-other-input"); | 51 var textArea = document.getElementById("reason-other-input"); |
60 if (textArea.hasAttribute("class")) | 52 if (textArea.hasAttribute("class")) |
61 textArea.removeAttribute("class") | 53 textArea.removeAttribute("class") |
62 else | 54 else |
63 textArea.setAttribute("class", "hidden"); | 55 textArea.setAttribute("class", "hidden"); |
(...skipping 11 matching lines...) Expand all Loading... |
75 { | 67 { |
76 form.submit(); | 68 form.submit(); |
77 } | 69 } |
78 }, false); | 70 }, false); |
79 } | 71 } |
80 document.addEventListener("DOMContentLoaded", init, false); | 72 document.addEventListener("DOMContentLoaded", init, false); |
81 })(); | 73 })(); |
82 </script> | 74 </script> |
83 </head> | 75 </head> |
84 | 76 |
85 <section markdown="1" class="highlighted"> | 77 <section class="highlighted"> |
86 #{{reasons-header[Form heading] Please select the reason(s) why you uninstalled
Adblock Plus:}} | 78 <h1>{{"Please select the reason(s) why you uninstalled Adblock Plus:"|translat
e("reasons-header", "Form heading")}}</h1> |
87 | 79 <form id="reasons-form" action="uninstall-abp-submit" method="post"> |
88 <form id="reasons-form" action="uninstall-abp-submit" method="post"> | 80 <ul id="reasons"> |
89 <ul id="reasons"> | 81 {%- for reasonId, stringId, value in reasons %} |
90 <li> | 82 <li> |
91 <label> | 83 <label> |
92 <input id="reason-other" type="checkbox" name="reason" value="0v0" /> | 84 <input type="checkbox" name="reason" value="{{reasonId}}" /> |
93 <span>{{reason-other[Last uninstallation reason] Other, namely...}}</spa
n> | 85 {{value|translate(stringId, "Uninstallation reason")}} |
94 </label> | 86 </label> |
95 <textarea id="reason-other-input" class="hidden" name="reasonOther" placeh
older="{{reason-other-placeholder[Textarea placeholder text, appears after selec
ting 'Other, namely...' option] Please explain why you are uninstalling Adblock
Plus}}"></textarea> | 87 </li> |
96 </li> | 88 {%- endfor %} |
97 </ul> | 89 <li> |
98 <button id="submit-form">{{submit[Submit button text] Submit}}</button> | 90 <label> |
99 <span class="error-label">{{error-msg[Error message, is being shown after subm
ission if no item selected] Please select at least one of the options above}}</s
pan> | 91 <input id="reason-other" type="checkbox" name="reason" value="0v0" /> |
100 </form> | 92 {{"Other, namely..."|translate("reason-other", "Last uninstallation re
ason")}} |
101 | 93 </label> |
102 {{disclaimer[Disclaimer below form] By clicking Submit, you are sending your res
ponse to Adblock Plus. Please see our [privacy policy](/privacy).}} | 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 {: .disclaimer } | 95 </li> |
| 96 </ul> |
| 97 <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> |
| 99 </form> |
| 100 <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")}} |
| 102 </p> |
104 </section> | 103 </section> |
LEFT | RIGHT |