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

Comrade:CriticalResist/sandbox/Sidebar additions documentation: Difference between revisions

More languages
(Created page with "Using the Common.js file, it's very easy to add icon hyperlinks to the sidebar on Citizen skin. Best of all, with the way I did it (really the simplest way), it doesn't add anything to the mobile sidebar. Because it's so small on mobile, being at the bottom of the screen, you don't really have the space This is the code for the Upload file icon I added: Known problems with my additions:")
Tag: Visual edit
 
No edit summary
Tag: Visual edit
Line 5: Line 5:
This is the code for the Upload file icon I added:
This is the code for the Upload file icon I added:


 
<code><br />/* Append Upload file icon to Citizen sidebar, under megamenu icon */
(function($, mw) {
    // Wait for the DOM to be ready
$(document).ready(function() {
if (!mw.user.isAnon()) {
            // Create the HTML for the "Upload file" icon + link
var uploadFileIcon = '<nowiki><a class="citizen-header__item" href="/wiki/Special:Upload"><div class="citizen-sidebar-upload citizen-header__button"></div></nowiki><nowiki></a></nowiki>';
   
            // Insert the icon HTML after the existing icon container element
$('.citizen-drawer').after(uploadFileIcon);
}
});
})(jQuery, mediaWiki);</code>


Known problems with my additions:
Known problems with my additions:

Revision as of 12:24, 23 September 2023

Using the Common.js file, it's very easy to add icon hyperlinks to the sidebar on Citizen skin.

Best of all, with the way I did it (really the simplest way), it doesn't add anything to the mobile sidebar. Because it's so small on mobile, being at the bottom of the screen, you don't really have the space

This is the code for the Upload file icon I added:


/* Append Upload file icon to Citizen sidebar, under megamenu icon */ (function($, mw) {

   // Wait for the DOM to be ready

$(document).ready(function() { if (!mw.user.isAnon()) {

           // Create the HTML for the "Upload file" icon + link

var uploadFileIcon = '<a class="citizen-header__item" href="/wiki/Special:Upload"><div class="citizen-sidebar-upload citizen-header__button"></div></a>';

           // Insert the icon HTML after the existing icon container element

$('.citizen-drawer').after(uploadFileIcon); } }); })(jQuery, mediaWiki);

Known problems with my additions: