Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
131f988bea | ||
|
|
1c31c1d6a5 |
File diff suppressed because one or more lines are too long
@@ -115,7 +115,6 @@ devii-terminal.devii-state-fullscreen .devii-window {
|
||||
}
|
||||
|
||||
devii-terminal.devii-state-normal .devii-window {
|
||||
resize: both;
|
||||
}
|
||||
devii-terminal.devii-state-normal .devii-titlebar {
|
||||
cursor: move;
|
||||
|
||||
@@ -328,44 +328,3 @@
|
||||
padding: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- Markdown source/preview toggle ---- */
|
||||
.gist-markdown-toggle .gist-md-tabbar {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.gist-markdown-toggle .gist-md-tab {
|
||||
padding: 0.5em 1em;
|
||||
cursor: pointer;
|
||||
color: var(--text-muted);
|
||||
border: 1px solid transparent;
|
||||
border-bottom: none;
|
||||
border-radius: var(--radius) var(--radius) 0 0;
|
||||
background: transparent;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.gist-markdown-toggle .gist-md-tab.active {
|
||||
color: var(--text-primary);
|
||||
background: var(--bg-card);
|
||||
border-color: var(--border) var(--border) transparent;
|
||||
}
|
||||
|
||||
.gist-markdown-toggle .tab-pane {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gist-markdown-toggle .tab-pane.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.gist-markdown-toggle .gist-markdown-preview {
|
||||
padding: 1em;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0 0 var(--radius) var(--radius);
|
||||
min-height: 4em;
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ export class DeviiTerminal {
|
||||
}
|
||||
|
||||
_canOpenOnGesture() {
|
||||
if (this.element && this.element.state !== "closed") return false;
|
||||
if (document.querySelector(".modal-overlay.visible")) return false;
|
||||
if (document.querySelector(".dialog-overlay.visible")) return false;
|
||||
if (document.querySelector(".context-menu.visible")) return false;
|
||||
|
||||
@@ -297,8 +297,8 @@ export default class FloatingWindow extends Component {
|
||||
if (!this.geometry) return;
|
||||
const g = this.geometry;
|
||||
const safeHeight = this._safeViewport.height;
|
||||
g.width = Math.min(g.width, window.innerWidth - 16);
|
||||
g.height = Math.min(g.height, safeHeight - 16);
|
||||
g.width = Math.max(320, Math.min(g.width, window.innerWidth - 16));
|
||||
g.height = Math.max(220, Math.min(g.height, safeHeight - 16));
|
||||
g.left = Math.max(8, Math.min(g.left, window.innerWidth - g.width - 8));
|
||||
g.top = Math.max(8, Math.min(g.top, safeHeight - g.height - 8));
|
||||
}
|
||||
@@ -409,8 +409,8 @@ export default class FloatingWindow extends Component {
|
||||
this._ro = new ResizeObserver(() => {
|
||||
if (this.state === "normal" && this.geometry && !this._drag) {
|
||||
const rect = this.win.getBoundingClientRect();
|
||||
this.geometry.width = Math.round(rect.width);
|
||||
this.geometry.height = Math.round(rect.height);
|
||||
this.geometry.width = Math.max(320, Math.round(rect.width));
|
||||
this.geometry.height = Math.max(220, Math.round(rect.height));
|
||||
this._persistGeometry();
|
||||
}
|
||||
this._syncControls();
|
||||
|
||||
@@ -35,23 +35,6 @@
|
||||
|
||||
{% if gist['language'] == 'markdown_rendered' %}
|
||||
<div class="gist-rendered-content rendered-content">{{ render_content(gist['source_code'], author_is_admin=is_admin(author)) }}</div>
|
||||
{% elif gist['language'] == 'markdown' %}
|
||||
<div class="gist-code-block gist-markdown-toggle" data-tabs>
|
||||
<nav class="gist-md-tabbar" role="tablist">
|
||||
<button type="button" class="gist-md-tab" data-tab="source" role="tab">Source</button>
|
||||
<button type="button" class="gist-md-tab" data-tab="preview" role="tab">Preview</button>
|
||||
</nav>
|
||||
<div data-tab-pane="source" class="tab-pane active" role="tabpanel">
|
||||
<div class="gist-code-header">
|
||||
<span class="gist-language-name">{{ language_name(gist['language']) }}</span>
|
||||
<button type="button" class="gist-copy-btn" data-copy="gist-code-content">Copy</button>
|
||||
</div>
|
||||
<pre><code id="gist-code-content" class="language-markdown">{{ gist['source_code'] }}</code></pre>
|
||||
</div>
|
||||
<div data-tab-pane="preview" class="tab-pane gist-markdown-preview rendered-content" role="tabpanel">
|
||||
{{ render_content(gist['source_code'], author_is_admin=is_admin(author)) }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="gist-code-block">
|
||||
<div class="gist-code-header">
|
||||
|
||||
Reference in New Issue
Block a user