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

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(8 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
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) ---------
// Score-Badge ausgeblendet
// <div>${scoreBadge(score)}</div>
   function renderResults(ranked){
   function renderResults(ranked){
     const box=qs('ados-scan-results');
     const box=qs('ados-scan-results');
Zeile 324: Zeile 327:
             <a href="${mw.util.getUrl((it.title||'').replace(/ /g,'_'))}">${mw.html.escape(it.title||'')}</a>
             <a href="${mw.util.getUrl((it.title||'').replace(/ /g,'_'))}">${mw.html.escape(it.title||'')}</a>
           </div>
           </div>
          <div>${scoreBadge(score)}</div>
           <div>
           <div>
             <a href="${mw.util.getUrl((it.title||'').replace(/ /g,'_'))}" class="mw-ui-button" style="display:inline-block;padding:.4rem .7rem;border-radius:8px;background:#2a4b8d;color:#fff;text-decoration:none;">Artikel öffnen</a>
             <a href="${mw.util.getUrl((it.title||'').replace(/ /g,'_'))}" class="mw-ui-button" style="display:inline-block;padding:.4rem .7rem;border-radius:8px;background:#2a4b8d;color:#fff;text-decoration:none;">Artikel öffnen</a>