-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
147 lines (135 loc) · 4.56 KB
/
index.html
File metadata and controls
147 lines (135 loc) · 4.56 KB
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
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" />
<script type="text/javascript" src="js/base43.js" ></script>
<script type="text/javascript">
function main(){
var input = document.getElementById("input");
try {
var val43 = Base43.decode(input.value.trim());
document.getElementById("output").innerHTML = val43;
document.getElementById("error").style.display = "none";
} catch (e) {
document.getElementById("error").style.display = "block";
if (e.message) {
document.getElementById("error_text").innerHTML = e.message;
}
}
return false;
}
</script>
<!-- My inadequate attempts at CSS -->
<style>
body {
padding: 30px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
}
textarea#input {
width: 600px;
height: 120px;
border: 3px solid #cccccc;
padding: 5px;
font-family: Tahoma, sans-serif;
display: block;
}
pre.prettyprint {
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
display: block;
padding: 8.5px;
margin: 0 0 9px;
font-size: 12.025px;
line-height: 18px;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: pre-wrap;
background-color: #f5f5f5;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,0.15);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
max-width: 800px;
}
form button {
float: right;
margin: 10px;
display: inline-block;
padding: 4px 10px 4px;
margin-bottom: 0;
font-size: 13px;
line-height: 18px;
color: #333;
text-align: center;
text-shadow: 0 1px 1px rgba(255,255,255,0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -ms-linear-gradient(top,#fff,#e6e6e6);
background-image: -webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));
background-image: -webkit-linear-gradient(top,#fff,#e6e6e6);
background-image: -o-linear-gradient(top,#fff,#e6e6e6);
background-image: linear-gradient(top,#fff,#e6e6e6);
background-image: -moz-linear-gradient(top,#fff,#e6e6e6);
background-repeat: repeat-x;
border: 1px solid #ccc;
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff',endColorstr='#e6e6e6',GradientType=0);
filter: progid:dximagetransform.microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
cursor: pointer;
webkit-appearance: button;
}
#heading {
max-width: 800px;
}
form {
display: inline-block;
margin: 20px;
}
#error {
display: none;
margin: 10px 0px;
padding:12px;
color: #D8000C;
background-color: #FFBABA;
max-width: 800px;
}
#error i {
margin:10px 22px;
vertical-align:middle;
}
#error_text {
display: inline-block;
}
#footer {
margin-top: 80px;
}
</style>
</head>
<body>
<!-- This is where I try to write raw html and make a total mess of it. Here goes! -->
<div id="heading">
<h1>Electrum base43 converter</h1>
<p>This tool converts Electrum's base 43 data format into the hex string format understood by Bitcoin. You might use this to convert an Electrum QR code of an offline signed transaction into a hex string before broadcasting it to the Bitcoin network with a tool like <a href="https://blockchain.info/pushtx">this one</a>.
</p>
</div>
<form onsubmit="return main()">
<textarea type="textarea" name="theTextArea" id="input"></textarea>
<button>convert!</button>
</form>
<pre class="prettyprint" id="output">this is where the output will go</pre>
<div id="error"><i class="fa fa-times-circle"></i>
<div id="error_text">There is an error. </div>
</div>
<div id="footer">Find me on <a href="https://github.com/jacoblyles/base43js">github</a></div>
</body>
</html>