Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Citizen.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 18: Line 18:
         link.title = 'Create a new page';
         link.title = 'Create a new page';
          
          
         link.innerHTML = '<span class="citizen-ui-icon" style="display:flex;align-items:center;justify-content:center;font-size:20px;"><i class="fa-solid fa-file-circle-plus"></i></span>';
         link.innerHTML = '<span class="citizen-ui-icon" style="display:flex;align-items:center;justify-content:center;font-size:20px;color:oklch(80% 0.05 262.29);"><i class="fa-solid fa-file-circle-plus"></i></span>';
          
          
         buttonDiv.appendChild(link);
         buttonDiv.appendChild(link);
         header.insertBefore(buttonDiv, drawer);
         drawer.after(buttonDiv);
     }
     }
});
});

Latest revision as of 19:09, 5 February 2026

$(function() {
    // Load FontAwesome
    var fa = document.createElement('link');
    fa.rel = 'stylesheet';
    fa.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css';
    document.head.appendChild(fa);
    
    var header = document.querySelector('.citizen-header');
    var drawer = header.querySelector('.citizen-drawer');
    
    if (header && drawer) {
        var buttonDiv = document.createElement('div');
        buttonDiv.className = 'citizen-header__item';
        
        var link = document.createElement('a');
        link.href = '/index.php/Special:CreatePage';
        link.className = 'citizen-header__button';
        link.title = 'Create a new page';
        
        link.innerHTML = '<span class="citizen-ui-icon" style="display:flex;align-items:center;justify-content:center;font-size:20px;color:oklch(80% 0.05 262.29);"><i class="fa-solid fa-file-circle-plus"></i></span>';
        
        buttonDiv.appendChild(link);
        drawer.after(buttonDiv);
    }
});