User:BrandonXLF/Invert

From Wikipedia, the free encyclopedia

< BrandonXLF's scripts | JS | Base template

Invert
Invert script being used
DescriptionAdds a invert link
Invert inverts the colour of the page. It adds a link to the toolbar that will allow you to invert the page colour and the colour of images. The script saves CSS by editing your custom CSS file. The script also allows you to modify a temporary configuration for the page you're viewing or the saved configuration, which is saved to you CSS file (counts as a edit). This script should work with all skins, please report any issues.
Author(s)User:BrandonXLF
StatusWorking
First releasedSeptember 23, 2018
Browser support
  • Chrome: 18+
  • Firefox: 49+ (34+)
  • Edge: 12+
  • Internet Explorer: None
  • Opera: 15+
    Safari: 6+
  • Samsung Internet: 6+
  • WebView: 4.4+
Skin supportAll
SourceInvert.js (git)
GitHub repositorywikipedia-user-scripts

Invert inverts the colour of the page. It adds a link to the toolbar that will allow you to invert the page colour and the colour of images. The script saves CSS by editing your custom CSS file. The script also allows you to modify a temporary configuration for the page you're viewing or the saved configuration, which is saved to you CSS file (counts as a edit). This script should work with all skins, please report any issues.

Installation

  • Add the following to your common.js or your skin.js (this method is deprecated and may be removed):
importScript('User:BrandonXLF/Invert.js'); // [[User:BrandonXLF/Invert.js]]
  • Alternatively, use the following instead of the above:
mw.loader.load('/w/index.php?title=User:BrandonXLF/Invert.js&action=raw&ctype=text/javascript'); // [[User:BrandonXLF/Invert.js]]
  • To install on other wikis (for instance, globally in your global.js on the Meta-Wiki), use the following code:
mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:BrandonXLF/Invert.js&action=raw&ctype=text/javascript');
  • After installing reload the page and clear your cache

Invert images

The script can also be set to invert images.

To also invert images, hover over the "Invert" link and check the option to invert images.

Comments/Bugs

Comments are welcome on my talk page, be sure to indicate that you're talking about this script in the title. I would really like any suggestion to make the script run better.