MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Line 1,091: Line 1,091:
         '<button id="gr-hl-prev" style="background:rgba(255,255,255,0.2);border:none;color:#fff;min-width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;">↑</button>' +
         '<button id="gr-hl-prev" style="background:rgba(255,255,255,0.2);border:none;color:#fff;min-width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;">↑</button>' +
         '<button id="gr-hl-next" style="background:rgba(255,255,255,0.2);border:none;color:#fff;min-width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;">↓</button>' +
         '<button id="gr-hl-next" style="background:rgba(255,255,255,0.2);border:none;color:#fff;min-width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;">↓</button>' +
        '<button id="gr-hl-results" style="background:rgba(255,255,255,0.2);border:none;color:#fff;min-width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;">←</button>' +
         '<button id="gr-hl-dismiss" style="background:rgba(255,255,255,0.15);border:none;color:#fff;min-width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;">✕</button>';
         '<button id="gr-hl-dismiss" style="background:rgba(255,255,255,0.15);border:none;color:#fff;min-width:36px;height:36px;border-radius:50%;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;">✕</button>';
     } else {
     } else {
Line 1,098: Line 1,099:
         '<span>🔍 <strong>' + escHtml(query) + '</strong> — ' + count + ' match' + (count===1?'':'es') + '</span>' +
         '<span>🔍 <strong>' + escHtml(query) + '</strong> — ' + count + ' match' + (count===1?'':'es') + '</span>' +
         '<button id="gr-hl-prev" style="background:rgba(255,255,255,0.2);border:none;color:#fff;padding:4px 10px;border-radius:4px;cursor:pointer;font-size:13px;min-height:32px;">↑ Prev</button>' +
         '<button id="gr-hl-prev" style="background:rgba(255,255,255,0.2);border:none;color:#fff;padding:4px 10px;border-radius:4px;cursor:pointer;font-size:13px;min-height:32px;">↑ Prev</button>' +
         '<button id="gr-hl-next" style="background:rgba(255,255,255,0.2);border:none;color:#fff;padding:4px 10px;border-radius:4px;cursor:pointer;font-size:13px;min-height:32px;">↓ Next</button>';
         '<button id="gr-hl-next" style="background:rgba(255,255,255,0.2);border:none;color:#fff;padding:4px 10px;border-radius:4px;cursor:pointer;font-size:13px;min-height:32px;">↓ Next</button>' +
        '<button id="gr-hl-results" style="background:rgba(255,255,255,0.2);border:none;color:#fff;padding:4px 10px;border-radius:4px;cursor:pointer;font-size:13px;min-height:32px;">← Results</button>';
       bar.appendChild( nav );
       bar.appendChild( nav );
     }
     }
Line 1,106: Line 1,108:
       : ( function() {
       : ( function() {
           var b = document.createElement( 'button' );
           var b = document.createElement( 'button' );
           b.textContent = '✕ Clear';
           b.textContent = '✕ Close';
           b.id = 'gr-hl-dismiss';
           b.id = 'gr-hl-dismiss';
           b.style.cssText = 'background:rgba(255,255,255,0.15);border:none;color:#fff;padding:4px 12px;border-radius:4px;cursor:pointer;font-size:13px;min-height:32px;';
           b.style.cssText = 'background:rgba(255,255,255,0.15);border:none;color:#fff;padding:4px 12px;border-radius:4px;cursor:pointer;font-size:13px;min-height:32px;';
Line 1,130: Line 1,132:
     }
     }


     var nextBtn = document.getElementById( 'gr-hl-next' );
     var nextBtn   = document.getElementById( 'gr-hl-next' );
     var prevBtn = document.getElementById( 'gr-hl-prev' );
     var prevBtn   = document.getElementById( 'gr-hl-prev' );
    var resultsBtn = document.getElementById( 'gr-hl-results' );
     if ( nextBtn ) nextBtn.onclick = function() { goTo( currentIdx + 1 ); };
     if ( nextBtn ) nextBtn.onclick = function() { goTo( currentIdx + 1 ); };
     if ( prevBtn ) prevBtn.onclick = function() { goTo( currentIdx - 1 ); };
     if ( prevBtn ) prevBtn.onclick = function() { goTo( currentIdx - 1 ); };
    if ( resultsBtn ) resultsBtn.onclick = function() {
      bar.remove();
      /* Re-open search dialog with the same query prefilled */
      if ( window.showSearchDialog ) { window.showSearchDialog( query ); }
    };
   }
   }