MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
(4 intermediate revisions by the same user not shown)
Line 464: Line 464:
         if (isAnon) {
         if (isAnon) {
             if (!document.getElementById('gr-header-login')) {
             if (!document.getElementById('gr-header-login')) {
                 authEl = makeHeaderLink('gr-header-login', wikiHref('Special:UserLogin'), 'Login/Signup');
                 authEl = makeHeaderLink('gr-header-login', wikiHref('Special:UserLogin'), 'Login');
             }
             }
         } else if (!document.getElementById('gr-header-user')) {
         } else if (!document.getElementById('gr-header-user')) {
Line 833: Line 833:


         if (isMob) {
         if (isMob) {
             bar.style.cssText = [
             bar.className = 'gr-search-hl-mobile';
                'position:fixed', 'bottom:0', 'left:0', 'right:0',
                'z-index:10200', 'background:#b5451b', 'color:#fff',
                'padding:0', 'display:flex', 'align-items:stretch',
                'font-family:system-ui,sans-serif',
                'box-shadow:0 -2px 12px rgba(0,0,0,0.25)', 'height:56px'
            ].join(';');
 
            var mbs = 'flex:1;display:flex;flex-direction:column;align-items:center;' +
                'justify-content:center;background:none;border:none;color:#fff;cursor:pointer;' +
                'padding:6px 4px;font-family:system-ui,sans-serif;font-size:11px;font-weight:500;' +
                'gap:3px;-webkit-tap-highlight-color:rgba(0,0,0,0.12);';


             bar.innerHTML =
             bar.innerHTML =
                 '<button id="gr-hl-prev" style="' + mbs + '">' +
                 '<button id="gr-hl-results" class="gr-search-bar-btn">' +
                 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>' +
                '<span class="gra-icon gra-icon-search" aria-hidden="true"></span>' +
                 '<span>' + count + ' match' + (count === 1 ? '' : 'es') + '</span></button>' +
                '<button id="gr-hl-prev" class="gr-search-bar-btn">' +
                '<span class="gra-icon gra-icon-prev" aria-hidden="true"></span>' + +
                 '<span>Prev</span></button>' +
                 '<span>Prev</span></button>' +
                 '<button id="gr-hl-next" style="' + mbs + '">' +
                 '<button id="gr-hl-next" class="gr-search-bar-btn">' +
                 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>' +
                 '<span class="gr-icon gr-icon-next" aria-hidden="true"></span>' + +
                 '<span>Next</span></button>' +
                 '<span>Next</span></button>' +
                 '<button id="gr-hl-results" style="' + mbs + 'flex:1.6;border-left:1px solid rgba(255,255,255,0.2);border-right:1px solid rgba(255,255,255,0.2);">' +
                 '<button id="gr-hl-dismiss" class="gr-search-bar-btn">' +
                '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><line x1="16.5" y1="16.5" x2="22" y2="22"/></svg>' +
                 '<span class="gra-icon gra-icon-dismiss" aria-hidden="true"></span>' + +
                 '<span>' + count + ' match' + (count === 1 ? '' : 'es') + '</span></button>' +
                '<button id="gr-hl-dismiss" style="' + mbs + '">' +
                '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>' +
                 '<span>Close</span></button>';
                 '<span>Close</span></button>';
         } else {
         } else {