MediaWiki:Gadget-LabelScan.js: Unterschied zwischen den Versionen

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 291: Zeile 291:


   // --------- Score-Badges ---------
   // --------- Score-Badges ---------
// function scoreBadge(score){
  function scoreBadge(score){
//  if (CFG.showNumericScore) {
    if (CFG.showNumericScore) {
//  return `<span style="font-variant-numeric:tabular-nums;color:#666">${score.toFixed(3)}</span>`;
    return `<span style="font-variant-numeric:tabular-nums;color:#666">${score.toFixed(3)}</span>`;
//  }
    }
//  const [hi, mid] = CFG.confidenceBands || [0.90, 0.80];
    const [hi, mid] = CFG.confidenceBands || [0.90, 0.80];
//  let txt = 'niedrig', bg = '#f1f5f9', fg = '#334155';
    let txt = 'niedrig', bg = '#f1f5f9', fg = '#334155';
//  if (score >= hi) { txt = 'hoch';  bg = '#e6ffed'; fg = '#0a7d2c'; }
    if (score >= hi) { txt = 'hoch';  bg = '#e6ffed'; fg = '#0a7d2c'; }
//  else if (score >= mid) { txt = 'mittel'; bg = '#fff7e6'; fg = '#a45500'; }
    else if (score >= mid) { txt = 'mittel'; bg = '#fff7e6'; fg = '#a45500'; }
//  return `<span style="display:inline-block;padding:.12rem .45rem;border-radius:999px;background:${bg};color:${fg};font-weight:600;font-size:.85em;line-height:1">${txt}</span>`;
    return `<span style="display:inline-block;padding:.12rem .45rem;border-radius:999px;background:${bg};color:${fg};font-weight:600;font-size:.85em;line-height:1">${txt}</span>`;
//}
  }


   // --------- Rendering (max. 3 Treffer) ---------
   // --------- Rendering (max. 3 Treffer) ---------