forked from chaperise/subset-sum-solver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (86 loc) · 4.1 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
<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>pp lol!!1</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="title" content="bottom text">
<meta name="author" content="bottom text">
<meta name="subject" content="bottom text">
<meta name="description" content="bottom text">
<meta name="keywords" content="bottom, text, bottom text">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicons -->
<link href="https://raw.githubusercontent.com/armirage/armirage.github.io/master/images/favicons/apple-touch-icon.png" rel="apple-touch-icon" sizes="180x180">
<link href="https://raw.githubusercontent.com/armirage/armirage.github.io/master/images/favicons/favicon-32x32.png" rel="icon" type="image/png" sizes="32x32">
<link href="https://raw.githubusercontent.com/armirage/armirage.github.io/master/images/favicons/favicon-16x16.png" rel="icon" type="image/png" sizes="16x16">
<link href="https://raw.githubusercontent.com/armirage/armirage.github.io/master/images/favicons/manifest.json" rel="manifest">
<link href="https://raw.githubusercontent.com/armirage/armirage.github.io/master/images/favicons/safari-pinned-tab.svg" rel="mask-icon" color="#5bbad5">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="theme-color" content="#ffffff">
<!-- Style -->
<link href="./github-pages/form-style.css" rel="stylesheet">
</head>
<body onload="defaultValues()">
<h1>bottom text</h1>
<div class="container">
<form id="form1" action="javascript:passData()">
<label for="inputCSV">List of Values*</label>
<textarea
id="inputCSV"
name="input-csv"
title="Enter each damage value (positive integer only) followed by a comma ","."
pattern="[A-Za-z]{3}"
placeholder="Enter a comma separated list of damage values ex: (1,2,3,69,...)"
style="height:5em"
required>
</textarea>
<p>* by default zeroes and duplicates of the target are removed from this list.</p>
<p>* if you put more than like 10 values javascript will do the funny and probably freeze, so make sure not to go overboard.</p>
<label for="inputTarget">Target Sum</label>
<input
id="inputTarget"
name="input-target"
title="Enter a number (positive integers only)."
pattern="^-?[0-9]\d*(\.\d+)?$"
placeholder="Enter a number."
required>
<br>
<label for="inputTarget">(Optional) Limit by Terms*</label>
<input
id="inputTerms"
name="input-terms"
title="Enter a number (positive)."
pattern="^[1-9]\d*$"
placeholder="Enter a positive number.">
<p>* Will return only subsets as long as the term limit set. For all subsets leave blank.</p>
<br>
<label for="inputTarget">Options</label>
<input type="checkbox" name="returnTime" value="true" checked> Include processing time.<br>
<input type="checkbox" name="returnHTML" value="true" checked> Return HTML rendered subsets. (Multiplicity is displayed along side number.)<br>
<input type="checkbox" name="returnSubsets" value="true"> Return JavaScript array of subsets.<br>
<input type="checkbox" name="removeDuplicates" value="true"> Remove duplicate numbers from list.<br>
<p>** To see results in Output, submit form.</p>
<input type="submit" value="Submit">
</form>
</div>
<h2>Output</h2>
<div id="outputDiv" class="container"></div>
<noscript>Sorry, your browser does not support JavaScript!</noscript>
<script type="module" src="./github-pages/form-script.js"></script>
<script>
function defaultValues() {
document.getElementById("inputCSV").value = "1, 2, 3, 4";
document.getElementById("inputTarget").value = "6";
}
function passData() {
// This is the function called when the form submits.
// Use it to ensure the form validation passes before running the scripts.
// JavaScript module functions are scoped. To call them emit an event,
// with the companion event listener within the module.
const event = new Event('runScript');
document.getElementById( "outputDiv" ).innerHTML = "";
document.body.dispatchEvent(event);
}
</script>
</body>
</html>