MCPcopy Create free account
hub / github.com/pbakaus/impeccable / syncInsertCreateButton

Function syncInsertCreateButton

skill/scripts/live-browser.js:2263–2286  ·  view source on GitHub ↗
(btn, input)

Source from the content-addressed store, hash-verified

2261 }
2262
2263 function syncInsertCreateButton(btn, input) {
2264 btn = btn || uiGetById(PREFIX + '-insert-create');
2265 input = input || uiGetById(PREFIX + '-insert-input');
2266 if (!btn || !input) return;
2267 const gate = insertCreateGateState(input);
2268 const ok = canCreateInsert(gate);
2269 const reason = ok ? 'Create variants' : insertCreateDisabledReason(gate);
2270 btn.setAttribute('aria-disabled', ok ? 'false' : 'true');
2271 btn.setAttribute('aria-label', reason);
2272 if (ok) {
2273 hideInsertCreateTooltip();
2274 btn.style.background = BP.accent;
2275 btn.style.color = C.ink;
2276 btn.style.border = 'none';
2277 btn.style.opacity = '1';
2278 btn.style.cursor = 'pointer';
2279 } else {
2280 btn.style.background = 'transparent';
2281 btn.style.color = BP.textDim;
2282 btn.style.border = '1px solid ' + BP.hairline;
2283 btn.style.opacity = '0.72';
2284 btn.style.cursor = 'not-allowed';
2285 }
2286 }
2287
2288 /** Stylesheet shared by the replace and insert configure rows. */
2289 function ensureConfigureInputStyle() {

Callers 4

onAnnotUpFunction · 0.70
showBarFunction · 0.70
updateBarContentFunction · 0.70
buildInsertConfigureRowFunction · 0.70

Calls 5

uiGetByIdFunction · 0.70
insertCreateGateStateFunction · 0.70
canCreateInsertFunction · 0.70
hideInsertCreateTooltipFunction · 0.70

Tested by

no test coverage detected