Jump to content

User:Alexis Jazz/Factotum/Custom inserts and replacements

From Wikipedia, the free encyclopedia

How to..

Tell users to read the FAQ in two clicks/taps?

[edit]

In the settings, open the "Editing" tap. Add the following custom insert:

You should read the [[WP:FAQ|FAQ]], it answers all your questions.:<<AUTOPOST|FAQ>>

Save your settings. You will now have a button below (configurable to be above) the reply window labeled "FAQ". If you press it the text "You should read the FAQ, it answers all your questions." will be inserted in the reply window and the form will be submitted.

Just insert it, make changes and submit it myself when I'm ready?

[edit]

It's the same thing but without the "AUTOPOST":

You should read the [[WP:FAQ|FAQ]], it answers all your questions.:<<FAQ>>

The "FAQ" button will now be below the reply window. The label is optional, this also works fine as a custom insert:

You should read the [[WP:FAQ|FAQ]], it answers all your questions.

If you enter this example the button label will read "You should..".

Stop making this typo that my spell checker misses?

[edit]

Enter the following regular expression in the Editing tab:

/lose change/loose change/g

When you post or preview your message the replacement will be made.

Make it so that the replacement is tied to a button?

[edit]

Enter this as a custom insert:

/lose change/loose change/g:<<money>>

Now press the money button.

Make my entire message small, like, including the signature?

[edit]
/^([^<])/<span style="font-size:smaller">$1/:<<tiny>>

This will add a span tag to the beginning of your message. Factotum will notice there's no closing tag and append it for you.


More

[edit]

Answer an edit request on English Wikipedia

[edit]
  1. Enable section editing with Bawl
  2. Add one of the following to your custom inserts:
    /{\{([Rr]equest[ _]edit|[Ee]dit[ _](semi|extended|template|fully|interface)\-protected)(\|([^a\|\}]|a(?!ns))*)*(\|ans[werd]*=[a-zA-Z\|\}]*)?(\|([^a\|\}]|a(?!ns=))*)([^]*)/{{$1$3|answered=yes$6$8\n:{{done}} ~~~~/:<<Answer ER>>
    Or use the autopost version:
    /{\{([Rr]equest[ _]edit|[Ee]dit[ _](semi|extended|template|fully|interface)\-protected)(\|([^a\|\}]|a(?!ns))*)*(\|ans[werd]*=[a-zA-Z\|\}]*)?(\|([^a\|\}]|a(?!ns=))*)([^]*)/{{$1$3|answered=yes$6$8\n:{{done}} ~~~~/:<<AUTOPOST|NONCMT|Answer ER>>
  3. Edit a section with an edit request, click the "Answer ER" button. (and submit if you didn't use the autopost version)

Code nowiki

[edit]

<code><nowiki>BAWLCRT</nowiki></code>:<<CODE>>

Syntaxhighlight

[edit]

<syntaxhighlight lang="javascript">BAWLCRT</syntaxhighlight>:<<SH js>>

Page blanking

[edit]

As requested at Wikipedia:User scripts/Requests:

/[^]+//:<<AUTOPOST|SUMMARY=vandals!|blank>>

Weird pipe trick

[edit]

Enable "Run automatic replacements again after processing markup" (or hit preview a few times whenever you want to use this) and add the following two replacements:

/(^|\s)(http[s]?:\/\/[^\s\|]+)\|([^\s]+)/$1$2 TAILPIPETRICK$3/g
/(^|\s)(\[\[[^\]\|]+)(\|[^\]]*)?\]\] TAILPIPETRICK([^\s]+)/$1$2|$4]]/g

When a pipe and some text is appended to a URL that can be rewritten to an internal URL the text after the pipe will become the name of the link.

For example:

Have a https://en.wikipedia.org/wiki/Wikipedia:Teahouse|cup_of_tea darling.

becomes:

Have a [[:Wikipedia:Teahouse|cup of tea]] darling.

Bad habit of multiple newlines after a list

[edit]

Factotum doesn't typically ignore these for comments. (has to do with the multi-to-single line conversion) You should enter this one in the "custom regular expressions that are applied to comments only" field to avoid it getting applied to articles.

/(\n[\*#].*\n)\n/$1/g

Bad source removal

[edit]

/(<ref([^>]*)[Oo]ne[Dd]io([^>]*\/[^>]*)>|<ref([^>]*)>([^<]*)[Oo]ne[Dd]io([^<]*)<\/ref>)/{{subst:cn}}/g:<<SUMMARY=Onedio.com is not a reliable source, see [[:Special:PermanentLink/1186273699#Onedio.comFTTPIPEWP:RSN]]. Replacing with {{cn}}. Please check if other references support the same statements.|Onedio>>

Removes references with "onedio" in their name or body and replaces them with {{subst:cn}}. Also sets the edit summary.