Arfs
Arfs

Reputation: 184

Mediawiki adding custom javascript / Editing Common.js

I need to add one line of custom js to my wiki that will apply to everyone. What line do i need to append to LocalSettings.php to enable modification of Mediawiki:Common.js (and Mediawiki:Common.css)? None of the following work:

$wgUseSiteJs = true;
$wgUserSiteJs = true;
$wgAllowUserJs = true;
$wgGroupPermissions['*']['edituserjs'] = true;
$wgGroupPermissions['*']['editusercssjs'] = true;

I also scoured every file in my installation of mediawiki for the string "Any JavaScript here will be loaded for all users on every page load", but nothing showed up so i dont know how to directly edit Common.js either.

I could create an extension, but that seems like total overkill for one line of code..

Upvotes: 0

Views: 772

Answers (1)

Arfs
Arfs

Reputation: 184

I solved the problem by running the following query in phpmyadmin:

SELECT user_id INTO @uid FROM user 
WHERE user_name = '<USER YOURE LOGGED IN AS>' LIMIT 1;

INSERT INTO `user_groups`(`ug_user`, `ug_group`)
VALUES (@uid,'bureaucrat'),(@uid,'sysop');

Upvotes: 1

Related Questions