-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
116 lines (105 loc) · 3.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Version 2.0 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Link Builder</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/logo-nav.css" rel="stylesheet">
<meta charset="UTF-8" />
<script>
function paramAdd(name) {
var idWdsFormTable = $("#idWdsFormTable");
var tr_name = "tr_" + name;
$("#idWdsFormTable").prepend(
'<tr id="' + tr_name + '">' +
'<td><label for="' + name + '" ></label>' + name + '</td>' +
'<td><input type="text" size="80" class="field" id="' + name + '" name="' + name + '"></td>' +
'<td><a href="#" onclick="endisable(event); return false;" class="disable">disable/enable</a></td>' +
'</tr>'
);
var newline = document.getElementById(tr_name);
newline.focus();
}
function endisable(e) {
var $input = $(e.target).closest("tr").find(":input");
return !$input.attr("disabled", !$input.is(":disabled"));
}
function customInput() {
var name = document.getElementById("idAddInputValue").value;
if(name == "") {
alert("Please enter an input name.");
return false;
} else {
if (document.getElementById(name) == null) {
paramAdd(name);
} else {
alert("Oops. Looks like " + name + " already exists");
return false;
}
}
}
</script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
The Link Builder
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="https://github.com/PatrickTCB/link-builder">View Repo on GitHub</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Content -->
<div id="0" class="container">
<h2>URL configuration</h2>
<form name="WDS_FORM_CONFIG" action=".">
<p>
<label for="WDS_METHOD">Method</label>
<select onchange="document.WDS_FORM.method = this.value;" name="WDS_METHOD">
<option selected="selected" value="POST">post</option>
<option value="GET">get</option>
</select>
<label for="WDS_TARGET">target</label>
<input type="text" size="15" onChange="document.WDS_FORM.target = this.value;" name="WDS_TARGET" id="WDS_TARGET" value="" /><br />
<label for="WDS_ACTION">URL</label>
<input type="text" size="80" onChange="document.WDS_FORM.action = this.value;" name="WDS_ACTION" id="WDS_ACTION" value="https://site.domain.tld/path/to/resource/" />
</p>
<p>
<input type="button" onclick="document.WDS_FORM.submit();" class="button" value="Submit" />
</p>
</form>
<h2>Parameter configuration</h2>
<p>Use this button to add a new POST or GET parameter to your link</p>
<input type="button" id="addInput" onclick="customInput()" class="button" value="Add param" />
<input type="text" id="idAddInputValue" />
<p>
<form action="https://site.domain.tld/path/to/resource/" method="post" name="WDS_FORM" id="WDS_FORM" target="">
<table class="table-hover">
<tbody id="idWdsFormTable">
</tbody>
</table>
</form>
</p>
</div>
<!-- /.container section -->
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>