aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/palette-actions.js
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 17:38:01 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 17:38:01 -0500
commit603e064e8595bea103c0df3939aa4a4b006309f3 (patch)
tree20378a3067ddac59d3bdf4421907a9ca59ed75bf /scripts/theme-studio/palette-actions.js
parenta0d45cbb48ffe97579a5b4797e48508a8eac4ca4 (diff)
downloaddotemacs-603e064e8595bea103c0df3939aa4a4b006309f3.tar.gz
dotemacs-603e064e8595bea103c0df3939aa4a4b006309f3.zip
Make theme studio column delete safer
Diffstat (limited to 'scripts/theme-studio/palette-actions.js')
-rw-r--r--scripts/theme-studio/palette-actions.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/theme-studio/palette-actions.js b/scripts/theme-studio/palette-actions.js
index e4993a60d..a4aef83c5 100644
--- a/scripts/theme-studio/palette-actions.js
+++ b/scripts/theme-studio/palette-actions.js
@@ -122,15 +122,17 @@ function deleteColumn(columnId,label){
normalizePalette();
const plan=deletePaletteColumnPlan(PALETTE,{bg:MAP['bg'],fg:MAP['p']},columnId);
if(!plan.removed.length){notify('nothing to delete in "'+(label||columnId)+'"',true);return;}
+ const title=label||columnId;
+ if(!confirm('Delete color column "'+title+'"?\n\nThis removes '+plan.removed.length+' palette color(s). Existing face assignments will stay on their old hex values and show as "(gone)".'))return;
plan.removed.forEach(({hex,name})=>rememberGone(hex,name));
PALETTE=plan.palette;selectedIdx=null;
renderPalette();buildTable();buildUITable();renderCode();applyGround();
- notify('deleted column "'+(label||columnId)+'" — '+plan.removed.length+' color(s) now show "(gone)" where used',false);
+ notify('deleted column "'+title+'" — '+plan.removed.length+' color(s) now show "(gone)" where used',false);
}
function columnHeader(f,position,count){
const h=document.createElement('div');h.className='fhead';
const label=(f.members.find(m=>m.hex.toLowerCase()===f.base.toLowerCase())||{}).name||f.column||f.base;
- h.innerHTML=`<button class="cmove left" title="move column left" ${position===0?'disabled':''}>&#8249;</button><button class="ctitle" title="select base color"></button><button class="cmove right" title="move column right" ${position===count-1?'disabled':''}>&#8250;</button><button class="cdel" title="delete column">×</button>`;
+ h.innerHTML=`<button class="cmove left" title="move column left" ${position===0?'disabled':''}>&#8249;</button><button class="ctitle" title="select base color"></button><button class="cmove right" title="move column right" ${position===count-1?'disabled':''}>&#8250;</button><button class="cdel" title="delete column with confirmation">×</button>`;
h.querySelector('.ctitle').textContent=label;
h.querySelector('.ctitle').onclick=()=>selectColumnBase(f);
h.querySelector('.left').onclick=(e)=>{e.stopPropagation();moveColumn(f.column,-1);};