| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| (Empty) | |
| 1 title=Adblock Plus has been uninstalled | |
| 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 ] %} | |
| 12 | |
| 13 <head> | |
| 14 <meta name="robots" content="noindex" /> | |
| 15 | |
| 16 <script type="text/javascript"> | |
| 17 (function() | |
| 18 { | |
| 19 function init() | |
| 20 { | |
| 21 var form = document.getElementById("reasons-form"); | |
| 22 window.location.search.substr(1).split("&").forEach(function(param) | |
| 23 { | |
| 24 if (!/.=./.test(param)) | |
| 25 return; | |
| 26 | |
| 27 var paramSplit = param.split("="); | |
| 28 var input = document.createElement("input"); | |
| 29 input.setAttribute("type", "hidden"); | |
| 30 input.setAttribute("name", paramSplit[0]); | |
| 31 input.setAttribute("value", paramSplit[1]); | |
| 32 form.appendChild(input); | |
| 33 }); | |
| 34 | |
| 35 var reasonsContainer = document.getElementById("reasons"); | |
| 36 var reasons = reasonsContainer.cloneNode(true).getElementsByTagName("li"); | |
| 37 reasonsContainer.innerHTML = ""; | |
| 38 var reasons = Array.prototype.slice.call(reasons); | |
| 39 while (reasons.length > 0) | |
| 40 { | |
| 41 var randomIndex = Math.floor(Math.random() * (reasons.length -1)); | |
| 42 var reasonElement = reasons.splice(randomIndex, 1)[0]; | |
| 43 reasonsContainer.appendChild(reasonElement); | |
| 44 } | |
| 45 | |
| 46 document.getElementById("reason-other").addEventListener("change", | |
| 47 function() | |
| 48 { | |
| 49 var textArea = document.getElementById("reason-other-input"); | |
| 50 textArea.hasAttribute("class") ? textArea.removeAttribute("class") : | |
| 51 textArea.setAttribute("class", "hidden"); | |
| 52 }, false); | |
| 53 | |
| 54 document.getElementById("submit-form").addEventListener("click", | |
| 55 function(event) | |
| 56 { | |
| 57 if (!document.querySelector("ul input:checked")) | |
| 58 { | |
| 59 event.preventDefault(); | |
| 60 form.setAttribute("class", "error"); | |
| 61 } | |
| 62 }, false); | |
| 63 } | |
| 64 document.addEventListener("DOMContentLoaded", init, false); | |
| 65 })(); | |
| 66 </script> | |
| 67 </head> | |
| 68 <section class="highlighted"> | |
| 69 <h1>{{"Please select the reason(s) why you uninstalled Adblock Plus:"|translat e("reasons-header", "Form heading")}}</h1> | |
| 70 <form id="reasons-form" action="uninstall-abp-submit" method="post"> | |
| 71 <ul id="reasons"> | |
| 72 {%- for reasonId, stringId, value in reasons %} | |
|
kzar
2015/11/18 17:14:45
I think it would make more sense to add a to_json
saroyanm
2015/11/18 18:00:18
Fare enough, I agree that this is not a good solut
kzar
2015/11/19 11:24:54
Make this page Markdown, you don't need it to be a
kzar
2015/11/19 11:28:56
Also why not keep the string ID the same as the ID
saroyanm
2015/11/19 17:00:17
Ohh wow, didn't considered that case, for some rea
saroyanm
2015/11/19 17:00:17
It was requirement by data annalists to have reque
kzar
2015/11/20 13:06:13
OK fair enough, thanks the latest version of this
| |
| 73 <li> | |
| 74 <label> | |
| 75 <input type="checkbox" name="reason" value="{{reasonId}}" /> | |
| 76 <span>{{value|translate(stringId, "One of the listed uninstallation re ason")}}</span> | |
| 77 </label> | |
| 78 </li> | |
| 79 {%- endfor %} | |
| 80 <li> | |
| 81 <label> | |
| 82 <input id="reason-other" type="checkbox" name="reason" value="0v0" /> | |
| 83 <span>{{"Other, namely..."|translate("reason-other", "Last uninstallat ion reason")}}</span> | |
| 84 </label> | |
| 85 <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> | |
| 86 </li> | |
| 87 </ul> | |
| 88 <button id="submit-form" type="submit">{{"Submit"|translate("submit", "Submi t button text")}}</button> | |
| 89 <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> | |
| 90 </form> | |
| 91 <p class="disclaimer">{{"By clicking Submit, you are sending your response to Adblock Plus. Please see our <a href='https://adblockplus.org/privacy'>privacy p olicy</a>."|translate("disclaimer", "Disclaimer below form")}}</p> | |
| 92 </section> | |
| OLD | NEW |