Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/interventions/intervention-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ customElements.define('nv-intervention-editor', class extends HTMLElement {
window.addEventListener('click', this._typeOutsideHandler, true);
const rect = this.typeContainer.getBoundingClientRect();
const root = this.getRootNode();
const container = root.querySelector('.main-content-wrapper') || document.body;
const container = root.querySelector('.main-content-wrapper')
|| root.querySelector('.main-content')
|| document.body;
const computed = window.getComputedStyle(container);
this.typeDd.overlayContainer = container;
this.typeDd.previousContainerPosition = computed.position;
Expand Down
13 changes: 9 additions & 4 deletions components/interventions/nv-flashcards-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,16 @@ customElements.define("nv-flashcards-settings", class extends HTMLElement {
dd._outside = (e) => { if (!e.composedPath().includes(dd.container)) close(); };
window.addEventListener('click', dd._outside, true);
const rect = dd.container.getBoundingClientRect();
const root = this.getRootNode();
const container = root.querySelector('.main-content-wrapper') || document.body;
const container = document.querySelector('.main-content-wrapper')
|| document.querySelector('.main-content')
|| document.body;
const prev = window.getComputedStyle(container).position;
dd._overlayContainer = container; dd._prevPos = prev; if (prev === 'static') container.style.position = 'relative';
dd._origParent = dd.menu.parentElement; container.appendChild(dd.menu); dd.menu.classList.add('show');
dd._overlayContainer = container;
dd._prevPos = prev;
if (prev === 'static') container.style.position = 'relative';
dd._origParent = dd.menu.parentElement;
container.appendChild(dd.menu);
dd.menu.classList.add('show');
const cr = container.getBoundingClientRect();
Object.assign(dd.menu.style, { position: 'absolute', left: `${rect.left - cr.left}px`, top: `${rect.bottom - cr.top}px`, minWidth: `${rect.width}px`, width: `${rect.width}px`, zIndex: '9999' });
};
Expand Down
13 changes: 9 additions & 4 deletions components/interventions/nv-typing-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,16 @@ customElements.define("nv-typing-settings", class extends HTMLElement {
dd._outside = (e) => { if (!e.composedPath().includes(dd.container)) close(); };
window.addEventListener('click', dd._outside, true);
const rect = dd.container.getBoundingClientRect();
const root = this.getRootNode();
const container = root.querySelector('.main-content-wrapper') || document.body;
const container = document.querySelector('.main-content-wrapper')
|| document.querySelector('.main-content')
|| document.body;
const prev = window.getComputedStyle(container).position;
dd._overlayContainer = container; dd._prevPos = prev; if (prev === 'static') container.style.position = 'relative';
dd._origParent = dd.menu.parentElement; container.appendChild(dd.menu); dd.menu.classList.add('show');
dd._overlayContainer = container;
dd._prevPos = prev;
if (prev === 'static') container.style.position = 'relative';
dd._origParent = dd.menu.parentElement;
container.appendChild(dd.menu);
dd.menu.classList.add('show');
const cr = container.getBoundingClientRect();
Object.assign(dd.menu.style, { position: 'absolute', left: `${rect.left - cr.left}px`, top: `${rect.bottom - cr.top}px`, minWidth: `${rect.width}px`, width: `${rect.width}px`, zIndex: '9999' });
};
Expand Down
20 changes: 0 additions & 20 deletions verify_extension.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
"""Optional manifest verification script for Nirvanify extension."""
import json
from pathlib import Path

MANIFEST_PATH = Path('manifest.json')

def main():
if not MANIFEST_PATH.exists():
raise SystemExit('manifest.json not found')
data = json.loads(MANIFEST_PATH.read_text())
required_keys = ['manifest_version', 'name', 'version']
missing = [k for k in required_keys if k not in data]
if missing:
raise SystemExit(f'Missing keys: {missing}')
print('Manifest looks valid.')

if __name__ == '__main__':
main()

#!/usr/bin/env python3
"""Basic verification script for the Nirvanify extension.

Expand Down Expand Up @@ -46,7 +27,6 @@ def main() -> None:

manifest_path = root / 'manifest.json'
data = json.loads(manifest_path.read_text(encoding='utf-8'))
# Basic sanity check on manifest fields
if 'manifest_version' not in data:
raise SystemExit('manifest.json missing manifest_version')
print('Extension verification passed.')
Expand Down