Add Site Studio themes and Theme Manager
Support categorized fragments, theme presets, block widths, and server-backed theme editing with onboarding and preview. Include Site Studio, design sources, specification and verification reports; remove the legacy studio-site example.
This commit is contained in:
@@ -202,7 +202,8 @@ function handleAction(a,b){const e=current();switch(a){case 'mobile':$('#side').
|
||||
case 'remove-list':{const f=b.dataset.listField;const arr=[...(e.fields[f]||[])];arr.splice(+b.dataset.index,1);e.fields[f]=arr;renderEditor();renderPreview();updateStatus();break;}
|
||||
case 'check-source':try{parseSource();s.sourceErrors=[];toast('Синтаксис и контракт YAML корректны')}catch(ex){s.sourceErrors=[{message:ex.message,line:ex.line}];toast(ex.message,'error')}renderDiagnosticsOnly();break;
|
||||
case 'apply-source':if(applyExpert()){render();}break;
|
||||
case 'find-source':{const q=prompt('Найти в исходнике:');if(!q)return;const ta=$('#entry-source'),ix=ta.value.toLowerCase().indexOf(q.toLowerCase());if(ix>=0){ta.focus();ta.setSelectionRange(ix,ix+q.length)}else toast('Строка не найдена');break;}
|
||||
case 'find-source':modal('Поиск в исходнике',`<label class="field">Строка поиска<input id="find-source-input" type="search" placeholder="Название поля или значение" autocomplete="off"></label>`,btn('Отмена','close-modal')+btn('Найти','find-source-submit','primary'));$('#find-source-input')?.focus();break;
|
||||
case 'find-source-submit':{const q=$('#find-source-input')?.value.trim();if(!q){toast('Введите строку поиска','warn');break;}closeModal();const ta=$('#entry-source');if(!ta)break;const ix=ta.value.toLowerCase().indexOf(q.toLowerCase());if(ix>=0){ta.focus();ta.setSelectionRange(ix,ix+q.length)}else toast('Строка не найдена','warn');break;}
|
||||
case 'diff-source':showDiff();break;
|
||||
case 'focus-source':$('#entry-source')?.focus();break;
|
||||
case 'discard-nav':discardUnsaved();closeModal();s.pendingNavigation?.();s.pendingNavigation=null;break;
|
||||
|
||||
Reference in New Issue
Block a user