mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-21 14:22:19 +02:00
feat(photo-editor): Ajax Image Editor client (Photoshop-parity tools)
Photoshop-parity editor client: layers, selection/masking, brushes,
smart filters, LUT import, Quick Edit, mobile gestures, workspaces,
batch operations, and the service-worker versioning (v978->v1006).
Source: vendor/photocraft (ad1cff44) photo-editor client files, merged
onto upstream/dev (a8c147b2). Conflict resolution documented in
pr_work/A_conflicts.md; editor files taken from vendor/photocraft
(upstream's editor is an earlier snapshot of the same feature).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c74f475679
commit
5fac693c1c
@@ -1,5 +1,6 @@
|
||||
/** View menu wiring for rulers, guides, grid, and snapping preferences. */
|
||||
/** View menu wiring for rulers, guides, grid, snapping preferences, and panel visibility. */
|
||||
import { state } from './state.js';
|
||||
import * as panelVisibility from './panel-visibility.js';
|
||||
|
||||
export function wireViewMenu({ closeOtherTopbarMenus, registerDocClickAway, precisionGuides, composite, schedulePersist }) {
|
||||
const button = document.getElementById('ge-view-menu-btn');
|
||||
@@ -17,6 +18,11 @@ export function wireViewMenu({ closeOtherTopbarMenus, registerDocClickAway, prec
|
||||
if (size && document.activeElement !== size) size.value = String(state.gridSize || 16);
|
||||
const clear = menu.querySelector('[data-view-action="clear-guides"]');
|
||||
if (clear) clear.disabled = (state.guides?.vertical?.length || 0) + (state.guides?.horizontal?.length || 0) === 0;
|
||||
for (const panel of panelVisibility.list()) {
|
||||
const item = menu.querySelector(`[data-view-action="panel-${panel.id}"]`);
|
||||
item?.classList.toggle('active', !!panel.visible);
|
||||
item?.setAttribute('aria-checked', panel.visible ? 'true' : 'false');
|
||||
}
|
||||
};
|
||||
|
||||
button.addEventListener('click', event => {
|
||||
@@ -30,10 +36,17 @@ export function wireViewMenu({ closeOtherTopbarMenus, registerDocClickAway, prec
|
||||
const item = event.target.closest('[data-view-action]');
|
||||
if (!item || item.disabled) return;
|
||||
const action = item.dataset.viewAction;
|
||||
if (action === 'screen-mode') { document.getElementById('ge-maximize-toggle')?.click(); return; }
|
||||
if (action === 'panel-show-all') { panelVisibility.showAll(); sync(); return; }
|
||||
if (action === 'panel-hide-all') { panelVisibility.hideAll(); sync(); return; }
|
||||
if (action === 'panel-reset') { panelVisibility.reset(); sync(); return; }
|
||||
if (action.startsWith('panel-')) { panelVisibility.toggle(action.slice('panel-'.length)); sync(); return; }
|
||||
if (action === 'rulers') state.rulersVisible = !state.rulersVisible;
|
||||
else if (action === 'grid') state.gridVisible = !state.gridVisible;
|
||||
else if (action === 'snap') state.snapEnabled = !state.snapEnabled;
|
||||
else if (action === 'snap-grid') state.snapToGrid = !state.snapToGrid;
|
||||
else if (action === 'new-h-guide') precisionGuides.addGuide?.('horizontal', Math.round((state.imgHeight || 0) / 2));
|
||||
else if (action === 'new-v-guide') precisionGuides.addGuide?.('vertical', Math.round((state.imgWidth || 0) / 2));
|
||||
else if (action === 'clear-guides') precisionGuides.clearGuides();
|
||||
if (action !== 'clear-guides') {
|
||||
precisionGuides.syncVisibility();
|
||||
|
||||
Reference in New Issue
Block a user