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

Side by Side Diff: pages/solutions/get-whitelisted/index.md

Issue 29526635: Issue 5566 - Move 'Get Whitelisted' page out of 'Solutions' (Closed) Base URL: https://hg.adblockplus.org/web.acceptableads.com
Patch Set: Rebase and update urls Created Aug. 25, 2017, 2:43 p.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 | « pages/solutions/advertisers.md ('k') | pages/solutions/get-whitelisted/thank-you.md » ('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=Get whitelisted
2 description=Fill out the form to get whitelisted
3 parent=solutions/index
4
5 <style type="text/css">
6 #acceptable_ads, .showError #error-msg
7 {
8 display: block;
9 }
10 #WebToLeadForm.non-publishers #acceptable_ads,
11 #WebToLeadForm.non-publishers .semioptional em, #error-msg
12 {
13 display: none;
14 }
15 .semioptional em
16 {
17 display: inline;
18 }
19 </style>
20
21 <script type="text/javascript">
22 function check_webtolead_fields()
23 {
24 if (document.getElementById("req_id") != null)
25 {
26 var required = document.getElementById("req_id").value;
27 required = required.substring(0, required.lastIndexOf(';'));
28 var requiredFields = required.split(';');
29
30 // Some of the fields are optional only for publishers
31 if (form.className == "non-publisher")
32 {
33 var semioptionalLabels = document.getElementsByClassName("semioptional") ;
34 for (var i = 0; i < semioptionalLabels.length; i++)
35 {
36 requiredFields.push(semioptionalLabels[i].getAttribute("for"));
37 }
38 }
39
40 var requireFilled = true;
41 for (var i = 0; i < requiredFields.length; i++)
42 {
43 var field = document.getElementById(requiredFields[i]);
44 if (field.value.length <= 0 || field.value == 0)
45 {
46 requireFilled = false;
47 break;
48 }
49 }
50 if (requireFilled)
51 {
52 document.WebToLeadForm.submit();
53 return true;
54 }
55 else
56 {
57 showError("Please provide all the required fields");
58 return false;
59 }
60 return false
61 }
62 else
63 document.WebToLeadForm.submit();
64 }
65
66 function validateEmailAdd()
67 {
68 var emailField = document.getElementById("email1");
69 if (emailField && emailField.value.length > 0 &&
70 emailField.value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$ /) == null)
71 {
72 return false;
73 }
74
75 return true;
76 }
77
78 // Custom form validation
79 var isHuman = false;
80 var partnerTypeElement = null;
81 var form = null;
82 var requiredElement = null;
83 var aaInput = null;
84 var partnerType = "";
85 var errorElement = null;
86
87 function validateAndSubmit()
88 {
89 if (!isHuman)
90 showError("To prevent spam the form has not been submitted");
91 else
92 {
93 if (!validateEmailAdd())
94 {
95 showError("Not a valid email address");
96 return false;
97 }
98
99 form.action = "https://eyeo.sugarondemand.com/index.php?entryPoint=WebToLe adCapture";
100 check_webtolead_fields();
101 }
102 }
103
104 function showError(msg)
105 {
106 if ("textContent" in errorElement)
107 errorElement.textContent = msg;
108 else // IE8
109 errorElement.innerText = msg;
110
111 form.className = form.className + " showError"
112 }
113
114 // Mark semioptional fields as required for non publishers group
115 function updateSemioptional(required)
116 {
117 var semioptionalLabels = document.getElementsByClassName("semioptional");
118 for (var i = 0; i < semioptionalLabels.length; i++)
119 {
120 var semioptionalId = semioptionalLabels[i].getAttribute("for");
121 document.getElementById(semioptionalId).required = required;
122 }
123 }
124
125 function updateForm()
126 {
127 var partnerType = partnerTypeElement[partnerTypeElement.selectedIndex];
128 if (partnerType.id != "publishers")
129 {
130 form.className = "non-publishers";
131 // Field is marked as required in CRM application, but it shouldn't
132 if (!aaInput.value)
133 aaInput.value = "none";
134
135 updateSemioptional(true);
136 }
137 else
138 {
139 form.className = "";
140 aaInput.value = aaInput.value == "none" ? "" : aaInput.value;
141
142 updateSemioptional(false);
143 }
144 }
145
146 document.addEventListener("DOMContentLoaded", function()
147 {
148 partnerTypeElement = document.getElementById("partner_type_c");
149 form = document.getElementById("WebToLeadForm");
150 requiredElement = document.getElementById("req_id");
151 aaInput = document.getElementById("website_with_acceptable_ads_c");
152 errorElement = document.getElementById("error-msg");
153
154 // Get partner type from URL
155 partnerType = location.search.split("type=")[1];
156 var option = document.getElementById(partnerType);
157 if (option)
158 {
159 document.getElementById(partnerType).selected = true;
160 updateForm();
161 }
162
163 partnerTypeElement.addEventListener("change", function()
164 {
165 updateForm();
166 });
167 document.getElementById("email1").addEventListener("change", function()
168 {
169 // Spam protection
170 isHuman = true;
171 validateEmailAdd();
172
173 }, false);
174 form.addEventListener("submit", function(ev)
175 {
176 ev.preventDefault();
177 validateAndSubmit();
178 // prevent submition
179 return false;
180 }, false);
181 }, false);
182 </script>
183
184 <div class="col-6 expand-on-tablet" markdown="1">
185
186 <form id="WebToLeadForm" class="publishers section" method="POST" name="WebToL eadForm" markdown="1">
187
188 # {{get-whitelisted Get whitelisted}}
189
190 ---
191
192 <div class="section" markdown="1">
193 {{make-web-better[subtitle] We love the web, but we think it can improve. Help u s make it a better place!}}
194
195 {{about-acceptable-ads[paragraph] The Acceptable Ads initiative is simple: if yo ur ads are nonintrusive and abide by the [Acceptable Ads criteria](about/criteri a), they will be seen by a much larger audience, thus increasing your traffic an d revenue. It's easy to join; many advertisers and publishers already benefit fr om the initiative. }}
196
197 {{before-applying[notice] **Important**: Before filling out the form please ensu re your ads meet the [Acceptable Ads criteria](about/criteria). }}
198
199 <noscript>
200 <p class="bg-error p-a-sm m-y-sm">
201 {{enable-javascript This form requires JavaScript to be enabled to limit the amount of spam we get. Please consider enabling it for this page, or write an e mail to <a href="mailto:acceptableads@adblockplus.org">acceptableads@adblockplus .org</a>.}}
202 </p>
203 </noscript>
204 </div>
205
206 <label for="partner_type_c">
207 {{partner-type Partner Type}}
208 </label>
209 <select id="partner_type_c" name="partner_type_c" tabindex="1">
210 <option id="publishers" selected="selected" value="Publisher">{{publishers Pub lishers}}</option>
211 <option id="ad-networks" value="Ad Network">{{ad-networks Ad Networks}}</optio n>
212 <option id="advertisers" value="Advertiser">{{advertisers Advertisers}}</optio n>
213 <option id="ad-tech-suppliers" value="Ad Tech supplier">{{tech-suppliers Ad Te ch suppliers}}</option>
214 </select>
215
216 <label class="semioptional" for="account_name" id="account_name_label">
217 {{company-name Company Name}} <em>{{optional[Optional field label] (optional)} }</em>
218 </label>
219 <input id="account_name" type="text" name="account_name" />
220
221 <label for="first_name">
222 {{first-name First Name}}
223 </label>
224 <input id="first_name" type="text" name="first_name" required />
225
226 <label for="last_name">
227 {{last-name Last Name}}
228 </label>
229 <input id="last_name" type="text" name="last_name" required />
230
231 <label class="semioptional" for="title">
232 {{job-title Job Title}} <em>{{optional}}</em>
233 </label>
234 <input id="title" type="text" name="title" />
235
236 <label for="website">
237 {{website Company Website}} <em>{{optional}}</em>
238 </label>
239 <input id="website" type="text" name="website" />
240
241 <label for="email1">
242 {{email Email Address}}
243 </label>
244 <input id="email1" type="email" name="email1" required />
245
246 <div id="acceptable_ads" markdown="1">
247 <label for="website_with_acceptable_ads_c">
248 {{aa-url1 Exact URL with acceptable ads}}
249 </label>
250 <input id="website_with_acceptable_ads_c" type="text" name="website_with_accep table_ads_c" />
251 <label for="second_website_with_acc_ads_c">
252 {{aa-url2 Exact second URL with acceptable ads}} <em>{{optional}}</em>
253 </label>
254 <input id="second_website_with_acc_ads_c" type="text" name="second_website_wit h_acc_ads_c" />
255 <label for="third_website_with_acc_ads_c">
256 {{aa-url3 Exact third URL with acceptable ads}} <em>{{optional}}</em>
257 </label>
258 <input id="third_website_with_acc_ads_c" type="text" name="third_website_with_ acc_ads_c" />
259 </div>
260
261 <label for="description">
262 {{comments Comments}} <em>{{optional}}</em>
263 </label>
264 <textarea id="description" name="description" rows="14"></textarea>
265
266 <p class="m-y-md" markdown="1">
267 {{privacy-policy[Privacy policy note] **Privacy policy:** Your information will be stored and used only to handle this application and to respond to your inquir y. It will never be shared with any third party. If you would like to have your information removed from our database, please email us at [acceptableads@adblock plus.org](mailto:acceptableads@adblockplus.org).}}
268 </p>
269
270 error
271 {: #error-msg .bg-error .p-a-sm .m-y-sm }
272
273 <p class="inline-buttons">
274 <input class="btn-outline-primary" type="reset" name="reset" value="{{clear Clea r}}" />
275 <input class="btn-primary" id="submit_button" type="submit" name="Submit" value= "{{submit Submit}}" />
276 </p>
277
278 <input id="redirect_url" type="hidden" name="redirect_url" value="https://accept ableads.com/solutions/get-whitelisted/thank-you">
279 <input id="campaign_id" type="hidden" name="campaign_id" value="40e41f0e-ee21-92 43-b374-57319a53b6f1">
280 <input id="assigned_user_id" type="hidden" name="assigned_user_id" value="652b2e 55-db9d-c45d-e982-51e3ee13f0d8">
281 <input id="team_id" type="hidden" name="team_id" value="1">
282 <input id="team_set_id" type="hidden" name="team_set_id" value="Global">
283 <input id="req_id" type="hidden" name="req_id" value="partner_type_c;first_name; last_name;email1;website_with_acceptable_ads_c;">
284
285 </form>
286 </div>
OLDNEW
« no previous file with comments | « pages/solutions/advertisers.md ('k') | pages/solutions/get-whitelisted/thank-you.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld