User:MusikAnimal/twinkleblock

From wikishia
User script
twinkleblock
File:Screenshot of twinkleblock script.png
Blocking Keegagan as WP:NOTHERE
DescriptionBlock module for the popular Twinkle gadget
AuthorMusikAnimal and friends
StatusStable
UpdatedJune 10, 2015; Lua error in package.lua at line 80: module 'Module:Date' not found. (2015-06-10)
Browser supportAny modern browser or IE8+
Skin supportAll
SourceMediaWiki:Gadget-twinkleblock.js

twinkleblock is the missing block module for admins, included in the standard installation of Twinkle. Usage should be fairly straightforward but I've created this page to outline its features.

Common scenario

  • You want to block User:Keegagan
  • You go to either Special:Contribs/Keegagan, User:Keegagan or User talk:Keegagan (or any subpages, etc) and click Block in the Twinkle menu
  • If the user has been blocked before, you will see a message in red that reads "This user has been blocked in the past (block log)". Clicking the block log link will open it in a new tab. Use that to determine the duration you want to use
  • Choose your options accordingly. You'll almost always choose a preset and then adjust only the duration if necessary
  • Execute the block and be amazed! (hopefully)

So the idea is that you'll never have to go to Special:Block again, and that letting JavaScript do both the blocking and issuing of the template will save you mucho time.

Customization

You can customize the grouping and ordering of all the presets and templates. To do this, you will need to override some of the variables in your common.js.

The ordering and grouping is determined by Twinkle.block.blockGroups. The format is as follows:

Twinkle.block.blockGroups = [
  {
    label: 'Group label'
    list: [
      { label: 'description of preset #1', value: 'preset_1' }
      { label: 'description of preset #2', value: 'preset_2' }
    ]
  },
  {
    ...another group...
  }
];

Where preset_1 is the name of a preset as defined in Twinkle.block.blockPresetsInfo.

You can also tweak the presets themselves to however you wish. There is a wide range of options. For the full documentation, see the comments here on GitHub. You will need to override the full Twinkle.block.blockPresetsInfo object in order for your changes to take effect.

WARNING: It is possible that an update to Twinkle could break your preferences. If this happens, it is likely because a template you are using is no longer supported. Please consult the history on GitHub. You take full responsibility for changes you make to core Twinkle. If you are unsure or need help, don't hesitate to reach out to MusikAnimal any JavaScript programmer.

Known bugs and to-dos

State Issue
File:Pictogram voting keep.svg Fixed When issuing a block template, if you remove the duration, the block template will still have a duration
File:Pictogram voting keep.svg Fixed Needs an option to omit the duration parameter in the block template so that the notice reads "you have been blocked temporarily"
File:Pictogram voting keep.svg Fixed When issuing only a template, leave the duration parameter blank (and not supplied with expiry of an existing block)
File:Pictogram voting keep.svg Fixed If "Prevent this user from editing their own talk page while blocked" is checked, make it so that notalk=yes is added to the block template
File:Pictogram voting keep.svg Fixed Make it so that you can add the article name to the edit warring template
File:Pictogram voting keep.svg Fixed Make the generic block preset the default, rather than having it blank with no preset chosen
File:Pictogram voting keep.svg Fixed Do not automatically supply the article parameter in the block template (as we would with issuing normal warnings)
File:Pictogram voting keep.svg Fixed Template:Blocked talk-revoked-notice isn't being subst'ed
File:Pictogram voting keep.svg Fixed Disable autoblock when blocking bots
File:Pictogram voting keep.svg Fixed When reblocking and issuing a template, or only reblocking, keep expiry of existing block. By contrast if only issuing a template leave duration parameter blank
File:Pictogram voting keep.svg Fixed Only set anon=yes if it is an anon-only block, don't set if only templating
File:Pictogram voting keep.svg Fixed Use ellipsis and truncate long user names that extend past the window
File:Pictogram voting keep.svg Fixed Create {{uw-sockblock}} for sockmaster to accept standard params
File:Pictogram voting delete.svg Won't fix Allow users to rearrange the dropdowns in Twinkle preferences (not easy to implement). Instead you can override the JavaScript objects used, see Customization above.
Mid priority Disable changing of block duration for indefinite blocks, such as vandalism-only
Mid priority Add a "Long-term abuse" preset that has normal bad-faith indef (or 31 hours for anonymous users) block options, but per WP:DENY does not issue a block template by default
Low priority When issuing only a block, the Twinkle window should timeout and automatically hide and load the user's contributions page
Low priority Place "Block" item just after "Warn" in the Twinkle menu

Setup

Included in the standard installation of Twinkle. Turn on in your gadget preferences.

Bugs/feature requests

Ask/request anything you'd like on the talk page or at Wikipedia talk:Twinkle.