From 5b14e5882cfdaf04e72f4c3e3c8276d918420e84 Mon Sep 17 00:00:00 2001 From: raphjaph Date: Mon, 23 Jan 2023 21:26:01 +0100 Subject: [PATCH 1/3] hide list overflows and wrap dl overflows --- src/subcommand/server.rs | 6 +++--- src/templates/input.rs | 4 ++-- src/templates/output.rs | 6 +++--- src/templates/transaction.rs | 4 ++-- static/index.css | 17 ++++++++--------- templates/input.html | 4 ++-- templates/output.html | 2 +- templates/transaction.html | 2 +- 8 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 0c7f3bc4c6..18c05b6aaa 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -1397,7 +1397,7 @@ mod tests { ".*Output {txid}:0.*

Output {txid}:0

value
5000000000
-
script pubkey
OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG
+
script pubkey
OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG
transaction
{txid}

1 Sat Range

@@ -1418,7 +1418,7 @@ mod tests { ".*Output {txid}:0.*

Output {txid}:0

value
5000000000
-
script pubkey
OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG
+
script pubkey
OP_PUSHBYTES_65 [[:xdigit:]]{{130}} OP_CHECKSIG
transaction
{txid}
.*" ), @@ -1581,7 +1581,7 @@ mod tests {
value
5000000000
-
script pubkey
+
script pubkey
.*" diff --git a/src/templates/input.rs b/src/templates/input.rs index 2a8a08acdb..9fb77e1fd8 100644 --- a/src/templates/input.rs +++ b/src/templates/input.rs @@ -40,8 +40,8 @@ mod tests {

Input /1/2/3

previous output
0000000000000000000000000000000000000000000000000000000000000000:0
-
witness
010101
-
script sig
OP_PUSHBYTES_3 666f6f
+
witness
010101
+
script sig
OP_PUSHBYTES_3 666f6f
text
\x03foo
" diff --git a/src/templates/output.rs b/src/templates/output.rs index 2e59dd992d..d8d447bcb5 100644 --- a/src/templates/output.rs +++ b/src/templates/output.rs @@ -39,7 +39,7 @@ mod tests {

Output 1{64}:1

value
3
-
script pubkey
OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG
+
script pubkey
OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG
address
1111111111111111111114oLvT2
transaction
1{64}
@@ -70,7 +70,7 @@ mod tests {

Output 1{64}:1

value
1
-
script pubkey
OP_0
+
script pubkey
OP_0
transaction
1{64}

Output has been spent.

@@ -97,7 +97,7 @@ mod tests {

Output 1{64}:1

value
3
-
script pubkey
OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG
+
script pubkey
OP_DUP OP_HASH160 OP_PUSHBYTES_20 0{40} OP_EQUALVERIFY OP_CHECKSIG
address
1111111111111111111114oLvT2
transaction
1{64}
diff --git a/src/templates/transaction.rs b/src/templates/transaction.rs index 1edf38ac2f..687e30defc 100644 --- a/src/templates/transaction.rs +++ b/src/templates/transaction.rs @@ -72,7 +72,7 @@ mod tests {
value
5000000000
-
script pubkey
OP_0
+
script pubkey
OP_0
  • @@ -81,7 +81,7 @@ mod tests {
    value
    5000000000
    -
    script pubkey
    OP_PUSHNUM_1
    +
    script pubkey
    OP_PUSHNUM_1
  • diff --git a/static/index.css b/static/index.css index 9cb6913a62..a322c72523 100644 --- a/static/index.css +++ b/static/index.css @@ -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; @@ -105,15 +113,6 @@ input[type=text] { text-align: center; } -.monospace { - 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; diff --git a/templates/input.html b/templates/input.html index 9b22120f97..08d19e069f 100644 --- a/templates/input.html +++ b/templates/input.html @@ -7,10 +7,10 @@

    Input /{{self.path.0}}/{{self.path.1}}/{{self.path.2}}

    sequence
    {{self.input.sequence}}
    %% } %% if !self.input.witness.is_empty() { -
    witness
    {{hex::encode(consensus::serialize(&self.input.witness))}}
    +
    witness
    {{hex::encode(consensus::serialize(&self.input.witness))}}
    %% } %% if !self.input.script_sig.is_empty() { -
    script sig
    {{self.input.script_sig.asm()}}
    +
    script sig
    {{self.input.script_sig.asm()}}
    text
    {{String::from_utf8_lossy(self.input.script_sig.as_bytes())}}
    %% } diff --git a/templates/output.html b/templates/output.html index 134f114277..3736b21110 100644 --- a/templates/output.html +++ b/templates/output.html @@ -9,7 +9,7 @@

    Output {{self.outpoint}}

    %% }
    value
    {{ self.output.value }}
    -
    script pubkey
    {{ self.output.script_pubkey.asm() }}
    +
    script pubkey
    {{ self.output.script_pubkey.asm() }}
    %% if let Ok(address) = self.chain.address_from_script(&self.output.script_pubkey ) {
    address
    {{ address }}
    %% } diff --git a/templates/transaction.html b/templates/transaction.html index 6192976229..3a58f7fb92 100644 --- a/templates/transaction.html +++ b/templates/transaction.html @@ -21,7 +21,7 @@

    {{"Output".tally(self.transaction.output.len())}}

    value
    {{ output.value }}
    -
    script pubkey
    {{ output.script_pubkey.asm() }}
    +
    script pubkey
    {{ output.script_pubkey.asm() }}
    %% if let Ok(address) = self.chain.address_from_script(&output.script_pubkey) {
    address
    {{ address }}
    %% } From 8f91e44dcd80ddea2695d5140b10fe26cfa4054c Mon Sep 17 00:00:00 2001 From: raphjaph Date: Mon, 23 Jan 2023 21:33:56 +0100 Subject: [PATCH 2/3] quick fix --- static/index.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/index.css b/static/index.css index a322c72523..fa3af10b9e 100644 --- a/static/index.css +++ b/static/index.css @@ -102,6 +102,10 @@ ul, li { } } +.monospace { + font-family: monospace, monospace; +} + .blocks { font-family: monospace, monospace; list-style-position: inside; From b09225c46c2aa0f1f29e99ee9ffd7318ab02e105 Mon Sep 17 00:00:00 2001 From: raphjaph Date: Mon, 23 Jan 2023 21:34:44 +0100 Subject: [PATCH 3/3] quick fix --- static/index.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/index.css b/static/index.css index fa3af10b9e..05406d4c4f 100644 --- a/static/index.css +++ b/static/index.css @@ -102,10 +102,6 @@ ul, li { } } -.monospace { - font-family: monospace, monospace; -} - .blocks { font-family: monospace, monospace; list-style-position: inside; @@ -117,6 +113,10 @@ ul, li { text-align: center; } +.monospace { + font-family: monospace, monospace; +} + span.common, span.uncommon, span.rare, span.epic, span.legendary, span.mythic { border-radius: 0.25rem; color: white;