New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide certain functions when the content model is non-normal #251

wants to merge 1 commit into
base: master


None yet
3 participants

zhaofengli commented Feb 15, 2015

Basic API functions like edit, protect and delete won't work on pages
with special content models like Flow discussion boards. So let's
hide functions requiring them on such pages.

Signed-off-by: Zhaofeng Li


This comment has been minimized.


atlight commented Feb 15, 2015

Thanks for your contribution.

FYI, the content models currently in use on enwiki are NULL, wikitext, css, javascript, Scribunto, flow-board, and json.

As far as I can tell, Twinkle's basic functionality (unlink, RPP, diff) should mostly work fine on pages of all content models. Obviously most of what Twinkle does relies on action=edit being available and {{transclusion}} functioning normally, so I guess we have to identify how Twinkle can best interact with content models where this is not the case.

In any case, I think disabling these Twinkle actions on all non-traditional content models (particularly Scribunto, where it has always been active) is a step backwards. We should consider each module and content model individually:

  • Flow doesn't appear to have traditional diffs, so it is right to disable the diff module on Flow boards. But it should be available on all other pages.
  • RPP should be available on all pages, except possibly those in the MediaWiki namespace. The only parts that might need to be altered for Flow pages are (a) protection tagging - I don't know how the enwiki community has decided to handle that on Flow boards - and (b) action=protect for sysops - I don't know whether this works in the same way for Flow boards as it does for regular pages.
  • CSD... well, I tried this in both user and sysop modes on a Flow board and it indeed appears not to work. However, note bug, which will mean that deletion should be possible in the future.
  • XFD could easily be made to work by modifying the page header, which is a separate API action.

Also, if you are going to do this, the function should go in morebits.js under the Morebits object.

Disable certain modules where they don't work
Signed-off-by: Zhaofeng Li <>

This comment has been minimized.

zhaofengli commented Feb 15, 2015

Okay, I've updated the commit. The namespace checks are now hard-coded into the modules themselves. I've disabled CSD/XfD for Flow and LQT as normal tagging and/or the delete API does not work there.


This comment has been minimized.

atlight commented on modules/twinklediff.js in a73893a Feb 16, 2015

There's no such namespace as 90...


This comment has been minimized.

atlight commented on a73893a Feb 16, 2015

Also, please use ===. The == operator should be avoided at all times in JavaScript code.


This comment has been minimized.

quiddity-wp commented May 21, 2016

@atlight re: namespace 90, it's LQT's "Thread:" per

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment