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

Comrade:CriticalResist/sandbox/Edit button documentation

More languages
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Button has been disabled on Jan 6 2024 due to no usage by visitors. It can be re-enabled from common.js.

In September 2023 I launched a "fake" edit button for non-logged in users, or anonymous users as MediaWiki calls them. It appears on the citizen skin only (which is our default skin for anon users and I don't think they can change it) where the normal edit button would.

It relies on a Button template I made with its accompanying /style.css page. This button template can be used for different things but I would recommend we don't overdo it, it has to be used very specifically because you normally don't have buttons on wiki pages (so if we use it, it means we want a page to not look like a wiki page for whichever reason).

This new edit button transferred you to the request account page, but I've since changed the link to an in-between page here: ProleWiki:Before you can edit to make the transition less jarring, as people expect to be taken to an editing interface and instead are transported to a request account page.

The new edit button is controlled entirely from Mediawiki:common.js, which means it gets injected into the page with Javascript. This is a problem because more and more people it seems block Javascript on websites. But short of editing Citizen ourselves in the files directly I think this is the best (easiest) solution.

I wanted to add the js to Citizen.js, but for some reason it didn't load there. Common.js seems to load properly on page initialization so that's the file I'll be using for my JS code.

The button is added after the "View history" div which gets added by citizen, so it shouldn't show on other themes. It also checks that the user is not logged in with mw.isUserLoggedIn().

To style the button, code was added to Citizen.css. CSS loads properly and we don't need to use Common.css there. Since the real edit button is an ID, and you can't use an ID twice, I had to copy its CSS and recreate it for my button, which has the ca-request-account id.