User:Alexis Jazz/Factotum/Modules

When using Factotum you can load modules to add custom functionality. Put them in your common.js. For modules that are expected to run on page load, you may need to put them before the line that loads Factotum. For modules that only affect the Factotum form and/or editing it generally doesn't matter.

Modules on this page that were written by Alexis Jazz are public domain, irrevocably released as WTFPL v2. Some modules include other content, like content from Wikipedia, Unicode descriptions, etc. That content is licensed however it was originally licensed.

Picture of the day
POTD.js

Get the picture of the day (according to POTD) as the background in Factotum.

Alternative reference selector
AltRefModule.js

Some differences with the reference list that is natively part of Factotum:
 * This also works when editing sections.
 * It's probably slower. Might be noticeable on low-power devices.
 * Prepends the innerText of .cs1-visible-error to labels. (no machine-readable errors available)
 * Blue border on the "Go" button to differentiate it from the native reflist.
 * Doesn't respond to clicking edit markers next to references.
 * Detects all references within  tags, but if the associated reference can't be found in the reference list it just uses the wikitext for a label.
 * Where the native reflist starts with the reference list and tries to match those to references in wikitext, AltRefModule starts with the references from the wikitext and tries to match them to  . So the native reflist reads   just once while AltRefModule reads them for every   in the wikitext. This is more expensive.
 * AJ doesn't wanna support it.

Dropdown for insertion of various file templates, only on file pages
User:Alexis Jazz/Factotum/modules/FileTemplates.js

Unfuck CfD indentation
See discussion on Template talk:Cfd2 (revision 1091610184).

See also icon insertion (incomplete)
SeeAlso.js

Template:Done/See also insertion of the green check marks section. Can't someone who isn't me do the other sections?

Yes this is crap, it can be done way more efficient/compact, but I don't care enough personally.

Emoji-inator
Emoji-inator.js

Per request. The horror..

Ideas for modules
Which I'm too lazy to implement.

Lint error prevention
Suggested by Klein Muçi: "stop me from posting an edit which contains lint errors ... suggest fixing existing lint errors if found in the section/page that is being edited"

Tables
Suggested by Klein Muçi: "allow for easier table handling/editing"

Could possibly be done with a popup that provides a large number of OO.ui.TextInputWidget, hiding most initially but making more visible as needed.

Images
Suggested by Klein Muçi: "allow for easier image handling/editing"

Various approaches possible. Most obvious/doable solution would be a popup with a search field where clicking an image would show another popup asking for a caption and insert the image as a thumbnail. I don't suppose there's any existing library for this?