Skip to content

Commit

Permalink
Always and only wrap text
Browse files Browse the repository at this point in the history
  • Loading branch information
axelson committed Aug 26, 2024
1 parent d3e3242 commit c93efda
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions lib/plug/templates/debugger.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@
font-size: <%= :math.pow(1.3, -1) %>em;
}
.wrap-text-checkbox-container {
display: flex;
gap: 6px;
.exception-details-text {
white-space: pre-wrap;
}
/*
Expand Down Expand Up @@ -682,10 +681,7 @@
<small>at <%= h method(@conn) %></small>
<small class="path"><%= h @conn.request_path %></small>
</h5>
<code><pre role="exception-details-text"><%= h @message %></pre></code>
<div class="wrap-text-checkbox-container">
<input role="wrap-text-checkbox" type="checkbox" value="wrap_text">Wrap text?
</div>
<code><pre class="exception-details-text"><%= h @message %></pre></code>
</header>

<%= for %{label: label, encoded_handler: encoded_handler} <- @actions do %>
Expand Down Expand Up @@ -845,27 +841,16 @@
var $copyBtn = document.querySelector('[role~="copy-to-markdown"]')
var $copyBtnText = document.querySelector('[role~="copy-to-markdown-text"]')
var $copy = document.querySelector('[role~="copy-contents"]')
var $exceptionDetailsText = document.querySelector('[role~="exception-details-text"]')
var $wrapTextCheckbox = document.querySelector('[role~="wrap-text-checkbox"]')
each($items, function ($item) {
on($item, 'click', itemOnclick)
})
on($toggle, 'click', toggleOnclick)
on($copyBtn, 'click', copyToClipboard)
on($wrapTextCheckbox, 'click', toggleWrapExceptionText)
restoreToggle()
function toggleWrapExceptionText () {
if ($exceptionDetailsText.style.whiteSpace === 'pre-wrap') {
$exceptionDetailsText.style.whiteSpace = '';
} else {
$exceptionDetailsText.style.whiteSpace = 'pre-wrap';
}
}
function copyToClipboard () {
if(navigator.clipboard) {
// For those working on localhost or HTTPS
Expand Down

0 comments on commit c93efda

Please sign in to comment.