Release v0.4.0: dev -> main #251
@@ -237,6 +237,11 @@ body {
|
|||||||
.theme-card .swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(255,255,255,.15); }
|
.theme-card .swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(255,255,255,.15); }
|
||||||
.theme-name { font-weight: 600; }
|
.theme-name { font-weight: 600; }
|
||||||
.iconbtn:hover { color: var(--fg); border-color: var(--muted); }
|
.iconbtn:hover { color: var(--fg); border-color: var(--muted); }
|
||||||
|
/* #130: line wrap toggle, accent when active like other toggles */
|
||||||
|
.iconbtn.wrap-toggle[aria-pressed="true"],
|
||||||
|
.btn-icon.wrap-toggle[aria-pressed="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
|
||||||
|
html[data-wrap] .codebody { white-space: pre-wrap; }
|
||||||
|
html[data-wrap] .editor { white-space: pre-wrap; }
|
||||||
.iconbtn.danger:hover { color: #ff8fa3; border-color: #ff8fa3; }
|
.iconbtn.danger:hover { color: #ff8fa3; border-color: #ff8fa3; }
|
||||||
.code-head {
|
.code-head {
|
||||||
display: flex; align-items: center; gap: 10px; padding: 8px 16px;
|
display: flex; align-items: center; gap: 10px; padding: 8px 16px;
|
||||||
|
|||||||
@@ -46,6 +46,37 @@
|
|||||||
// do not persist anything here: URL theme is a one-off override
|
// do not persist anything here: URL theme is a one-off override
|
||||||
document.documentElement.dataset.preset = dark ? PAIRS[t].dark : PAIRS[t].light;
|
document.documentElement.dataset.preset = dark ? PAIRS[t].dark : PAIRS[t].light;
|
||||||
})();
|
})();
|
||||||
|
// #130: shared line wrap preference (localStorage 'palette-wrap', default off)
|
||||||
|
(function () {
|
||||||
|
function wrapOn() {
|
||||||
|
try { return localStorage.getItem('palette-wrap') === '1'; } catch (e) { return false; }
|
||||||
|
}
|
||||||
|
function wrapApply(on) {
|
||||||
|
if (on) document.documentElement.setAttribute('data-wrap', '1');
|
||||||
|
else document.documentElement.removeAttribute('data-wrap');
|
||||||
|
document.querySelectorAll('.wrap-toggle').forEach(function (b) {
|
||||||
|
b.setAttribute('aria-pressed', on ? 'true' : 'false');
|
||||||
|
});
|
||||||
|
var s = document.getElementById('wrap-setting');
|
||||||
|
if (s) s.checked = on;
|
||||||
|
}
|
||||||
|
window.paletteWrapToggle = function () {
|
||||||
|
var on = !wrapOn();
|
||||||
|
try { localStorage.setItem('palette-wrap', on ? '1' : '0'); } catch (e) {}
|
||||||
|
wrapApply(on);
|
||||||
|
return on;
|
||||||
|
};
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
wrapApply(wrapOn());
|
||||||
|
document.querySelectorAll('.wrap-toggle').forEach(function (b) {
|
||||||
|
b.addEventListener('click', function () { window.paletteWrapToggle(); });
|
||||||
|
});
|
||||||
|
var s = document.getElementById('wrap-setting');
|
||||||
|
if (s) s.addEventListener('change', function () {
|
||||||
|
if (s.checked !== wrapOn()) window.paletteWrapToggle();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<option>markdown</option><option>text</option>
|
<option>markdown</option><option>text</option>
|
||||||
</select>
|
</select>
|
||||||
<button class="btn btn-icon" id="reguess" title="Re-detect language" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a9 9 0 1 1-2.64-6.36"/><polyline points="21 3 21 9 15 9"/></svg></button>
|
<button class="btn btn-icon" id="reguess" title="Re-detect language" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12a9 9 0 1 1-2.64-6.36"/><polyline points="21 3 21 9 15 9"/></svg></button>
|
||||||
|
<button type="button" class="btn btn-icon wrap-toggle" id="wrap-toggle" title="Toggle line wrap" aria-pressed="false">wrap</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="float editor-wrap">
|
<div class="float editor-wrap">
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
<h1>{{if .Title}}{{.Title}}{{else}}Untitled paste{{end}}</h1>
|
<h1>{{if .Title}}{{.Title}}{{else}}Untitled paste{{end}}</h1>
|
||||||
{{if .CustomSlug}}<span class="slug">/{{.CustomSlug}}</span>{{end}}
|
{{if .CustomSlug}}<span class="slug">/{{.CustomSlug}}</span>{{end}}
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
|
<button type="button" class="iconbtn wrap-toggle" title="Toggle line wrap" aria-pressed="false">wrap</button>
|
||||||
<a class="iconbtn" href="/raw/{{.ID}}">raw</a>
|
<a class="iconbtn" href="/raw/{{.ID}}">raw</a>
|
||||||
<a class="iconbtn" href="#" id="copy-btn" onclick="copyContent(this); return false;">copy</a>
|
<a class="iconbtn" href="#" id="copy-btn" onclick="copyContent(this); return false;">copy</a>
|
||||||
{{if .DeletionToken}}<a class="iconbtn danger" href="#" onclick="redeem('{{.DeletionToken}}'); return false;">delete</a>{{end}}
|
{{if .DeletionToken}}<a class="iconbtn danger" href="#" onclick="redeem('{{.DeletionToken}}'); return false;">delete</a>{{end}}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
|
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
|
||||||
<span>Dark mode</span>
|
<span>Dark mode</span>
|
||||||
</button>
|
</button>
|
||||||
|
<h3 style="margin-top:18px">Editor</h3>
|
||||||
|
<label class="toggle" for="wrap-setting" style="display:inline-flex"><input type="checkbox" id="wrap-setting"> Line wrap</label>
|
||||||
<p class="admin-link-row"><a class="admin-link" href="/admin">Admin</a></p>
|
<p class="admin-link-row"><a class="admin-link" href="/admin">Admin</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user