Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: pages/uninstall-abp.tmpl

Issue 29329984: Issue 3257 - Create uninstallation page in adblockplus.org (Closed)
Patch Set: Fix editor readability, use for loop to randomly generate the list Created Nov. 23, 2015, 10:49 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « includes/uninstall-abp-submit.md ('k') | pages/uninstall-abp-submit.tmpl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 title=Adblock Plus has been uninstalled
2 template=simple
3
4 <head>
5 <meta name="robots" content="noindex" />
6 <script type="text/javascript">
7 (function()
8 {
9 var reasons = [
10 ["1v0", "{{'I didn\'t install Adblock Plus.'|translate('reason-not-install ed', 'reason')}}"],
11 ["2v0", "{{'Adblock Plus slowed down my browser.'|translate('reason-slowin g-down', 'reason')}}"],
12 ["3v0", "{{'I don\'t like the Acceptable Ads program.'|translate('reason-a cceptable-ads', 'reason')}}"],
13 ["4v0", "{{'Adblock Plus didn\'t block all ads.'|translate('reason-see-ads ', 'reason')}}"],
14 ["5v0", "{{'I found better ad blocking software.'|translate('reason-better -adblocker', 'reason')}}"],
15 ["6v0", "{{'Adblock Plus breaks websites that I visit.'|translate('reason- break-websites', 'reason')}}"]
16 ];
17
18 function init()
19 {
20 var form = document.getElementById("reasons-form");
21
22 // Create hidden input for GET parameters
23 window.location.search.substr(1).split("&").forEach(function(param)
24 {
25 if (!/.=./.test(param))
26 return;
27
28 var paramSplit = param.split("=");
29 var input = document.createElement("input");
30 input.setAttribute("type", "hidden");
31 input.setAttribute("name", paramSplit[0]);
32 input.setAttribute("value", paramSplit[1]);
33 form.appendChild(input);
34 });
35
36 // Randomly add reasons
37 for (var i = reasons.length; i > 0; i -= 1)
38 {
39 var reason = reasons.splice(Math.floor(Math.random() * i), 1)[0];
40 var listElement = document.createElement("li");
41 var labelElement = document.createElement("label");
42 var checkboxElement = document.createElement("input");
43 checkboxElement.setAttribute("type", "checkbox");
44 checkboxElement.setAttribute("name", "reason");
45 checkboxElement.setAttribute("value", reason[0]);
46 var spanElement = document.createElement("span");
47 spanElement.innerHTML = reason[1];
48 labelElement.appendChild(checkboxElement);
49 labelElement.appendChild(spanElement);
50 listElement.appendChild(labelElement);
51 var reasonContainer = document.getElementById("reasons");
52 reasonContainer.insertBefore(listElement, reasonContainer.firstChild);
53 }
54
55 document.getElementById("reason-other").addEventListener("change",
56 function()
57 {
58 var textArea = document.getElementById("reason-other-input");
59 textArea.hasAttribute("class") ? textArea.removeAttribute("class") :
60 textArea.setAttribute("class", "hidden");
61 }, false);
62
63 document.getElementById("submit-form").addEventListener("click",
64 function(event)
65 {
66 if (!document.querySelector("ul input:checked"))
67 {
68 event.preventDefault();
69 form.setAttribute("class", "error");
70 }
71 else
72 form.submit();
73 }, false);
74 }
75 document.addEventListener("DOMContentLoaded", init, false);
76 })();
77 </script>
78 </head>
79
80 <section class="highlighted">
81 <? include uninstall-abp ?>
82 </section>
OLDNEW
« no previous file with comments | « includes/uninstall-abp-submit.md ('k') | pages/uninstall-abp-submit.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld