Index: pages/uninstall-abp.tmpl |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/pages/uninstall-abp.tmpl |
@@ -0,0 +1,83 @@ |
+title=Adblock Plus has been uninstalled |
+template=simple |
+ |
+<head> |
+ <meta name="robots" content="noindex" /> |
+ <script type="text/javascript"> |
+ (function() |
+ { |
+ var reasons = [ |
saroyanm
2015/11/20 18:36:17
I've just noticed that the syntax highlighting bei
kzar
2015/11/21 19:01:25
Perhaps mixing " and 's would make it easier for y
saroyanm
2015/11/23 10:50:31
Yes, yes, but from point of view making it as mana
|
+ ["1v0", "{{"I didn't install Adblock Plus."|translate("reason-not-installed", "reason")}}"], |
+ ["2v0", "{{"Adblock Plus slowed down my browser."|translate("reason-slowing-down", "reason")}}"], |
+ ["3v0", "{{"I don't like the Acceptable Ads program."|translate("reason-acceptable-ads", "reason")}}"], |
+ ["4v0", "{{"Adblock Plus didn't block all ads."|translate("reason-see-ads", "reason")}}"], |
+ ["5v0", "{{"I found better ad blocking software."|translate("reason-better-adblocker", "reason")}}"], |
+ ["6v0", "{{"Adblock Plus breaks websites that I visit."|translate("reason-break-websites", "reason")}}"] |
+ ]; |
+ |
+ function init() |
+ { |
+ var form = document.getElementById("reasons-form"); |
+ |
+ // Create hidden input for GET parameters |
+ window.location.search.substr(1).split("&").forEach(function(param) |
+ { |
+ if (!/.=./.test(param)) |
+ return; |
+ |
+ var paramSplit = param.split("="); |
+ var input = document.createElement("input"); |
+ input.setAttribute("type", "hidden"); |
+ input.setAttribute("name", paramSplit[0]); |
+ input.setAttribute("value", paramSplit[1]); |
+ form.appendChild(input); |
+ }); |
+ |
+ // Randomly add reasons |
+ while (reasons.length > 0) |
+ { |
+ var randomIndex = Math.floor(Math.random() * (reasons.length)); |
+ var reason = reasons.splice(randomIndex, 1)[0]; |
+ var listElement = document.createElement("li"); |
+ var labelElement = document.createElement("label"); |
+ var checkboxElement = document.createElement("input"); |
+ checkboxElement.setAttribute("type", "checkbox"); |
+ checkboxElement.setAttribute("name", "reason"); |
+ checkboxElement.setAttribute("value", reason[0]); |
+ var spanElement = document.createElement("span"); |
+ spanElement.innerHTML = reason[1]; |
+ labelElement.appendChild(checkboxElement); |
+ labelElement.appendChild(spanElement); |
+ listElement.appendChild(labelElement); |
+ var reasonContainer = document.getElementById("reasons"); |
+ reasonContainer.insertBefore(listElement, reasonContainer.firstChild); |
+ } |
+ |
+ document.getElementById("reason-other").addEventListener("change", |
+ function() |
+ { |
+ var textArea = document.getElementById("reason-other-input"); |
+ textArea.hasAttribute("class") ? textArea.removeAttribute("class") : |
+ textArea.setAttribute("class", "hidden"); |
+ }, false); |
+ |
+ document.getElementById("submit-form").addEventListener("click", |
+ function(event) |
+ { |
+ if (!document.querySelector("ul input:checked")) |
+ { |
+ event.preventDefault(); |
+ form.setAttribute("class", "error"); |
+ } |
+ else |
+ form.submit(); |
+ }, false); |
+ } |
+ document.addEventListener("DOMContentLoaded", init, false); |
+ })(); |
+ </script> |
+</head> |
+ |
+<section class="highlighted"> |
+<? include uninstall-abp ?> |
+</section> |