-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
459 lines (410 loc) · 13.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Get Yo Scrip</title>
<style>
body {
font-family: Arial, sans-serif;
}
h1 {
text-align: center;
font-weight: bold;
}
form {
width: 80%;
margin: 0 auto;
}
.submit-btn {
display: block;
margin: 20px auto;
padding: 10px 30px;
font-size: 18px;
background-color: #007BFF;
color: #FFF;
border: none;
border-radius: 4px;
cursor: pointer;
}
.output {
display: none;
margin: 20px auto; /* Center the box */
max-width: 50%; /* Set a max-width */
box-sizing: border-box; /* Include padding and border in the element's total width and height */
}
@media (min-width: 768px) {
.output {
max-width: 70%; /* Smaller max-width for larger screens */
}
}
.code-box {
display: block;
width: 100%;
padding: 12px;
margin-bottom: 12px;
font-family: "Courier New", Courier, monospace;
font-size: 14px;
line-height: 1.42857143;
color: #333;
word-break: break-all;
word-wrap: break-word;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
}
.code-box-container {
position: relative;
}
.copy-btn {
position: absolute;
top: 8px;
right: 8px;
padding: 5px 10px;
font-size: 14px;
background-color: #007BFF;
color: #FFF;
border: none;
border-radius: 4px;
cursor: pointer;
opacity: 0.8;
}
.copy-btn:hover {
opacity: 1;
}
.warning {
color: red;
font-size: 12px;
margin-left: 4px;
}
/* Slider */
input[type=range] {
-webkit-appearance: none;
width: 100%;
margin: 10px 0;
background: transparent;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 8px;
cursor: pointer;
background: #ccc;
border-radius: 4px;
}
input[type=range]::-webkit-slider-thumb {
height: 20px;
width: 20px;
background-color: #007BFF;
border-radius: 50%;
cursor: pointer;
-webkit-appearance: none;
margin-top: -6px;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 8px;
cursor: pointer;
background: #ccc;
border-radius: 4px;
}
input[type=range]::-moz-range-thumb {
height: 20px;
width: 20px;
background-color: #007BFF;
border-radius: 50%;
cursor: pointer;
}
/* Slider labels */
.slider-labels {
display: flex;
justify-content: space-between;
font-family: "Courier New", Courier, monospace;
font-size: 14px;
margin-bottom: 10px;
}
.slider-labels {
display: flex;
justify-content: space-between;
font-family: Arial, sans-serif;
font-size: 14px;
margin-bottom: 10px;
width: 80%;
margin-left: auto;
margin-right: auto;
}
.slider-label {
display: inline-block;
padding: 2px 4px;
background-color: #007BFF;
color: #FFF;
border-radius: 4px;
opacity: 0.8;
cursor: pointer;
user-select: none; /* Prevents text selection when clicked */
}
.slider-label:hover {
opacity: 1;
}
input[type="text"], input[type="checkbox"], input[type="range"] {
border-radius: 5px;
border: 1px solid #ccc;
padding: 8px;
font-size: 16px;
outline: none;
}
input[type="text"]:focus, input[type="checkbox"]:focus, input[type="range"]:focus {
border-color: #007BFF;
}
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
</style>
</head>
<body>
<h1>Get Me Allez</h1>
<h2>You're looking for the older version here: <a href=https://arjunmanjunatha.github.io/getyoscrip_v2/> </h2>
<!-- <form id="form">
<h2>Input your details</h2>
<div>
<label for="aid">AID:</label>
<input type="text" id="aid" name="aid" pattern="[a-z0-9]+" required>
<span class="warning" id="aidWarning"></span> <!-- Add this line -->
<!-- </div>
<div>
<label>Exclude Providers:</label>
<input type="checkbox" id="all" name="exclude" value="all">
<label for="all">ALL (Pop only)</label>
<input type="checkbox" id="booking" name="exclude" value="booking">
<label for="booking">Booking</label>
<input type="checkbox" id="expedia" name="exclude" value="expedia">
<label for="expedia">Expedia</label>
<input type="checkbox" id="vrbo" name="exclude" value="vrbo">
<label for="vrbo">VRBO</label>
<input type="checkbox" id="hotelscom" name="exclude" value="hotelscom">
<label for="hotelscom">hotelscom</label>
<input type="checkbox" id="tripadvisor" name="exclude" value="tripadvisor">
<label for="tripadvisor">TripAdvisor</label>
<input type="checkbox" id="hotelscombined" name="exclude" value="hotelscombined">
<label for="hotelscombined">HotelsCombined</label>
<input type="checkbox" id="none" name="exclude" value="none" checked>
<label for="none">None</label>
</div>
<div>
<label for="campaignId">Campaign ID:</label>
<input type="text" id="campaignId" name="campaignId" pattern="[a-z0-9]*">
<span class="warning" id="campaignIdWarning"></span>
</div>
<div>
<!-- DEEPSTRUCT -->
<!-- <label>Grab existing links from:</label>
<input type="checkbox" id="cj" name="links" value="cj">
<label for="cj">CJ</label>
<input type="checkbox" id="travelpayouts" name="links" value="travelpayouts">
<label for="travelpayouts">TravelPayouts</label>
<label for="custom">Custom:</label>
<input type="text" id="custom" name="links" placeholder="example.com/, another-example.com/">
</div> -->
<!-- Added POP Level Switch -->
<!-- <div>
<label for="popSwitch">POP Enabled (always on by default):</label>
<label class="switch">
<input type="checkbox" id="popSwitch" checked>
<span class="slider round"></span>
</label>
</div> -->
<!-- Added new menu items with toggle switches -->
<!-- <div>
<label for="linkCloaking">Preserve Link Cloaking on Preview (switch on to enable):</label>
<label class="switch">
<input type="checkbox" id="linkCloaking">
<span class="slider round"></span>
</label>
</div>
<div>
<label for="bookingLabel">Preserve Booking Label(only for Bcom, switch on to enable):</label>
<label class="switch">
<input type="checkbox" id="bookingLabel">
<span class="slider round"></span>
</label>
</div> -->
<!-- submit button -->
<!-- <button type="submit" class="submit-btn">Script Me!</button>
</form> -->
<!-- This is output box -->
<!-- <div class="output" id="output">
<label>Generated Script:</label>
<div class="code-box-container">
<pre class="code-box" id="generatedScript"></pre>
<button onclick="copyToClipboard()" class="copy-btn">Copy to Clipboard</button>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Function to validate input fields
function validateInput(inputId, pattern, warningId, warningMessage) {
const input = document.getElementById(inputId);
const warning = document.getElementById(warningId);
input.addEventListener('input', function (event) {
if (!pattern.test(event.target.value)) {
input.setCustomValidity("Invalid Input");
warning.textContent = warningMessage;
} else {
input.setCustomValidity("");
warning.textContent = "";
}
});
}
// Validate AID and Campaign ID
validateInput("aid", /^[a-z0-9]+$/, "aidWarning", "This can only be lowercase letters and numbers");
validateInput("campaignId", /^[a-z0-9]*$/, "campaignIdWarning", "This can only be lowercase letters and numbers");
// Form submission event listener
document.getElementById("form").addEventListener("submit", function (event) {
event.preventDefault();
generateOutput();
});
// Function to generate the output script
function generateOutput() {
// Reset the Copy to Clipboard button text every time the script is generated
const copyButton = document.querySelector(".copy-btn");
copyButton.textContent = "Copy to Clipboard";
const aid = document.getElementById("aid").value.trim();
const campaignId = document.getElementById("campaignId").value.trim();
const excludes = Array.from(document.querySelectorAll("input[name='exclude']:checked")).map(input => input.value);
const links = Array.from(document.querySelectorAll("input[name='links']:checked")).map(input => input.value);
const custom = document.getElementById("custom").value.trim();
let scriptContent = `<script>
(function (s, t, a, y, twenty, two) {
s.Stay22 = s.Stay22 || {};
s.Stay22.params = {
aid: "${aid}",`;
// Handle excludes
if (excludes.includes("all")) {
scriptContent += `
excludes: ["vrbo","booking","expedia","tripadvisor","hotelscombined","hotelscom"],`;
} else if (!excludes.includes("none")) {
const excludeValues = excludes.filter(value => value !== "none").map(value => `"${value}"`).join(",");
scriptContent += `
excludes: [${excludeValues}],`;
}
// Handle links
if (!links.includes("none") || custom) {
const linkValues = [];
if (links.includes("cj")) {
linkValues.push("fave.co/","anrdoezrs.net/click","kqzyfj.com/click","dpbolvw.net/click","tkqlhce.com/click","jdoqocy.com/click");
}
if (links.includes("travelpayouts")) {
linkValues.push("tp.st/","tp.media/");
}
if (custom) {
const customUrls = custom.split(',').map(url => url.trim());
linkValues.push(...customUrls);
}
scriptContent += `
deepStruct: [${linkValues.map(value => `"${value}"`).join(",")}],`;
}
// Handle Campaign ID
if (campaignId) {
scriptContent += `
campaign: "${campaignId}",`;
}
// Handle new toggle switches
const popSwitch = document.getElementById("popSwitch").checked;
if (!popSwitch) {
scriptContent += `
disablePop: "true",`;
}
const linkCloaking = document.getElementById("linkCloaking").checked;
if (linkCloaking) {
scriptContent += `
keepItPretty: "true",`;
}
const bookingLabel = document.getElementById("bookingLabel").checked;
if (bookingLabel) {
scriptContent += `
preserveCampaign: "true",`;
}
// Finalize script
scriptContent += `};
// Leave this part as-is;
twenty = t.createElement(a);
two = t.getElementsByTagName(a)[0];
twenty.async = 1;
twenty.src = y;
two.parentNode.insertBefore(twenty, two);
})(window, document, "script", "https://scripts.stay22.com/letmeallez.js");
` + "<" + "/script>";
const generatedScript = document.getElementById("generatedScript");
generatedScript.textContent = scriptContent;
document.getElementById("output").style.display = "flex";
document.getElementById("output").style.flexDirection = "column";
}
// Correctly attaching the copyToClipboard function to the window object
window.copyToClipboard = function() {
const codeBox = document.getElementById("generatedScript");
const textArea = document.createElement("textarea");
textArea.value = codeBox.textContent; // Get the content you want to copy
document.body.appendChild(textArea); // Append the textarea to the body
textArea.select(); // Select the content of the textarea
document.execCommand("copy"); // Execute the copy command
document.body.removeChild(textArea); // Remove the temporary textarea
// Change the button text to give feedback to the user
const copyButton = document.querySelector(".copy-btn");
copyButton.textContent = "Copied!";
};
// Your existing code for handling form submission and other functionalities
});
</script> -->
</body>
</html>