Skip to content
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

speedy/xfd: Handle non-wikitext contentmodels #1208

Merged
merged 3 commits into from
Dec 12, 2020

Conversation

Amorymeltzer
Copy link
Collaborator

@Amorymeltzer Amorymeltzer commented Nov 23, 2020

Basically, try to deal with most of #745 as far as Twinkle is concerned (basically, not MML), albeit somewhat naïvely. Imperfect, so wouldn't mind some feedback (cc @DannyS712 and @siddharthvp)

(1st commit: Not strictly a contentmodel issue, but post CSD on talk if can't edit (basically, #1091 but for CSD))

2nd commit: speedy: Place tag in comment block for javascript, css, and santized-css content models, otherwise place on talkpage (as per instructions) (scribunto already handled in #1121)

3rd commit: xfd:

  • TfD: use comment block for sanitized-css (scribunto goes on /doc per instructions)
  • MfD: use comment block for javascript, css, and sanitized-css

As written, depends on #1201 but need not.

params.tagText += params.templatetype === 'standard' || params.templatetype === 'sidebar' ? '\n' : ''; // No newline for inline
}

if (pageobj.canEdit() && ['wikitext', 'sanitized-css'].indexOf(pageobj.getContentModel()) !== -1) {
Copy link
Collaborator Author

@Amorymeltzer Amorymeltzer Nov 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three make use of the autoEditRequest from #1091, but it means that the language is currently saying that the page was protected, which is wrong. Is it excessive to create a new template just for this? We could do a separate if (and function?) like is done for twinklespeedy.js in this PR and not rely on that functionality. Alternatively, adding a parameter to the function could allow for a bespoke message, but it's not currently easy to detect protection status, so a less good option overall.

Place tag within comment block on js/css pages, put on talk page otherwise (per instructions).  As written, depends on `getContentModel`, need not.
- tfd: sanitized-css (Scribunto already goes on /doc)
- mfd: json, javascript, css, sanitized-css
@Amorymeltzer Amorymeltzer added this to the December 2020 update milestone Dec 7, 2020
@Amorymeltzer Amorymeltzer merged commit 44c1f75 into wikimedia-gadgets:master Dec 12, 2020
@Amorymeltzer Amorymeltzer deleted the speedy-weirdos branch December 12, 2020 22:08
@siddharthvp siddharthvp mentioned this pull request Dec 14, 2020
siddharthvp added a commit that referenced this pull request Dec 20, 2020
(handling of non-wikitext content models)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant