Skip to content

Commit

Permalink
Hide list overflow and break dl overflow between words (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph authored Jan 23, 2023
1 parent fa25d58 commit e2b803a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ mod tests {
".*<title>Output {txid}:0</title>.*<h1>Output <span class=monospace>{txid}:0</span></h1>
<dl>
<dt>value</dt><dd>5000000000</dd>
<dt>script pubkey</dt><dd class=data>OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG</dd>
<dt>script pubkey</dt><dd class=monospace>OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG</dd>
<dt>transaction</dt><dd><a class=monospace href=/tx/{txid}>{txid}</a></dd>
</dl>
<h2>1 Sat Range</h2>
Expand All @@ -1418,7 +1418,7 @@ mod tests {
".*<title>Output {txid}:0</title>.*<h1>Output <span class=monospace>{txid}:0</span></h1>
<dl>
<dt>value</dt><dd>5000000000</dd>
<dt>script pubkey</dt><dd class=data>OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG</dd>
<dt>script pubkey</dt><dd class=monospace>OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG</dd>
<dt>transaction</dt><dd><a class=monospace href=/tx/{txid}>{txid}</a></dd>
</dl>.*"
),
Expand Down Expand Up @@ -1581,7 +1581,7 @@ mod tests {
</a>
<dl>
<dt>value</dt><dd>5000000000</dd>
<dt>script pubkey</dt><dd class=data></dd>
<dt>script pubkey</dt><dd class=monospace></dd>
</dl>
</li>
</ul>.*"
Expand Down
4 changes: 2 additions & 2 deletions src/templates/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ mod tests {
<h1>Input /1/2/3</h1>
<dl>
<dt>previous output</dt><dd class=monospace>0000000000000000000000000000000000000000000000000000000000000000:0</dd>
<dt>witness</dt><dd class=data>010101</dd>
<dt>script sig</dt><dd class=data>OP_PUSHBYTES_3 666f6f</dd>
<dt>witness</dt><dd class=monospace>010101</dd>
<dt>script sig</dt><dd class=monospace>OP_PUSHBYTES_3 666f6f</dd>
<dt>text</dt><dd>\x03foo</dd>
</dl>
"
Expand Down
6 changes: 3 additions & 3 deletions src/templates/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ mod tests {
<h1>Output <span class=monospace>1{64}:1</span></h1>
<dl>
<dt>value</dt><dd>3</dd>
<dt>script pubkey</dt><dd class=data>OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG</dd>
<dt>script pubkey</dt><dd class=monospace>OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG</dd>
<dt>address</dt><dd class=monospace>1111111111111111111114oLvT2</dd>
<dt>transaction</dt><dd><a class=monospace href=/tx/1{64}>1{64}</a></dd>
</dl>
Expand Down Expand Up @@ -70,7 +70,7 @@ mod tests {
<h1>Output <span class=monospace>1{64}:1</span></h1>
<dl>
<dt>value</dt><dd>1</dd>
<dt>script pubkey</dt><dd class=data>OP_0</dd>
<dt>script pubkey</dt><dd class=monospace>OP_0</dd>
<dt>transaction</dt><dd><a class=monospace href=/tx/1{64}>1{64}</a></dd>
</dl>
<p>Output has been spent.</p>
Expand All @@ -97,7 +97,7 @@ mod tests {
<h1>Output <span class=monospace>1{64}:1</span></h1>
<dl>
<dt>value</dt><dd>3</dd>
<dt>script pubkey</dt><dd class=data>OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG</dd>
<dt>script pubkey</dt><dd class=monospace>OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG</dd>
<dt>address</dt><dd class=monospace>1111111111111111111114oLvT2</dd>
<dt>transaction</dt><dd><a class=monospace href=/tx/1{64}>1{64}</a></dd>
</dl>
Expand Down
4 changes: 2 additions & 2 deletions src/templates/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ mod tests {
</a>
<dl>
<dt>value</dt><dd>5000000000</dd>
<dt>script pubkey</dt><dd class=data>OP_0</dd>
<dt>script pubkey</dt><dd class=monospace>OP_0</dd>
</dl>
</li>
<li>
Expand All @@ -81,7 +81,7 @@ mod tests {
</a>
<dl>
<dt>value</dt><dd>5000000000</dd>
<dt>script pubkey</dt><dd class=data>OP_PUSHNUM_1</dd>
<dt>script pubkey</dt><dd class=monospace>OP_PUSHNUM_1</dd>
</dl>
</li>
</ul>
Expand Down
13 changes: 8 additions & 5 deletions static/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ input[type=text] {
min-width: 0;
}

dl {
overflow-wrap: break-word;
}

ul, li {
overflow: hidden;
}

@media (max-width: 38rem) {
nav {
flex-direction: column;
Expand All @@ -109,11 +117,6 @@ input[type=text] {
font-family: monospace, monospace;
}

.data {
font-family: monospace, monospace;
overflow-wrap: break-word;
}

span.common, span.uncommon, span.rare, span.epic, span.legendary, span.mythic {
border-radius: 0.25rem;
color: white;
Expand Down
4 changes: 2 additions & 2 deletions templates/input.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ <h1>Input /{{self.path.0}}/{{self.path.1}}/{{self.path.2}}</h1>
<dt>sequence</dt><dd>{{self.input.sequence}}</dd>
%% }
%% if !self.input.witness.is_empty() {
<dt>witness</dt><dd class=data>{{hex::encode(consensus::serialize(&self.input.witness))}}</dd>
<dt>witness</dt><dd class=monospace>{{hex::encode(consensus::serialize(&self.input.witness))}}</dd>
%% }
%% if !self.input.script_sig.is_empty() {
<dt>script sig</dt><dd class=data>{{self.input.script_sig.asm()}}</dd>
<dt>script sig</dt><dd class=monospace>{{self.input.script_sig.asm()}}</dd>
<dt>text</dt><dd>{{String::from_utf8_lossy(self.input.script_sig.as_bytes())}}</dd>
%% }
</dl>
2 changes: 1 addition & 1 deletion templates/output.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>Output <span class=monospace>{{self.outpoint}}</span></h1>
</dd>
%% }
<dt>value</dt><dd>{{ self.output.value }}</dd>
<dt>script pubkey</dt><dd class=data>{{ self.output.script_pubkey.asm() }}</dd>
<dt>script pubkey</dt><dd class=monospace>{{ self.output.script_pubkey.asm() }}</dd>
%% if let Ok(address) = self.chain.address_from_script(&self.output.script_pubkey ) {
<dt>address</dt><dd class=monospace>{{ address }}</dd>
%% }
Expand Down
2 changes: 1 addition & 1 deletion templates/transaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2>{{"Output".tally(self.transaction.output.len())}}</h2>
</a>
<dl>
<dt>value</dt><dd>{{ output.value }}</dd>
<dt>script pubkey</dt><dd class=data>{{ output.script_pubkey.asm() }}</dd>
<dt>script pubkey</dt><dd class=monospace>{{ output.script_pubkey.asm() }}</dd>
%% if let Ok(address) = self.chain.address_from_script(&output.script_pubkey) {
<dt>address</dt><dd class=monospace>{{ address }}</dd>
%% }
Expand Down

0 comments on commit e2b803a

Please sign in to comment.