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: Add delete-templates on non-wikitext pages #206

Closed

Conversation

sunafterrainwm
Copy link
Contributor

No description provided.

@github-actions github-actions bot added dependencies Pull requests that update a dependency file Module: speedy Including image and speedy labels May 7, 2021
@a2569875
Copy link

a2569875 commented May 7, 2021

like this https://en.wikipedia.org/w/index.php?diff=978461935
if mw.config.get('wgPageContentModel') is 'Scribunto' add "require('Module:Module wikitext')._addText("{{Delete|快速刪除理由}}");'
if mw.config.get('wgPageContentModel') is 'json' ('{...}') add '"_addText":"{{Delete|快速刪除理由}}"'
if mw.config.get('wgPageContentModel') is 'json' ('[...]') add '{"_addText":"{{Delete|快速刪除理由}}"}'
if mw.config.get('wgPageContentModel') is 'js' or 'css' add '/_addText:{{Delete|快速刪除理由}}/'

@sunafterrainwm
Copy link
Contributor Author

sunafterrainwm commented May 7, 2021

json 的改法 或許

if (mw.config.get('wgPageContentModel')==='json') {
var json = JSON.parse(text)
if (json instanceof Array) {
json.unshift({_addText: code})
} else {
json._addText = code
}
text = JSON.stringify(json)
code = ''
}

package-lock.json Outdated Show resolved Hide resolved
@github-actions github-actions bot added Module: xfd and removed dependencies Pull requests that update a dependency file labels May 8, 2021
@sunafterrainwm sunafterrainwm changed the title Use Module:Module wikitext to tag modules speedy & xfd: let javascript, css, json, module can tag delete templete and show the template May 8, 2021
@hamishzx
Copy link
Collaborator

hamishzx commented May 8, 2021

其实我没看懂commit message, 啥是require delete

@a2569875
Copy link

a2569875 commented May 8, 2021

他指的應該是request 吧

@Xi-Plus Xi-Plus changed the title speedy & xfd: let javascript, css, json, module can tag delete templete and show the template speedy/xfd: Add delete-templates on non-wikitext pages May 8, 2021
@hamishzx
Copy link
Collaborator

hamishzx commented May 8, 2021

@a2569875 ok

modules/twinklexfd.js Outdated Show resolved Hide resolved
modules/twinklespeedy.js Outdated Show resolved Hide resolved
@Xi-Plus
Copy link
Member

Xi-Plus commented May 10, 2021

重複的程式碼應該整合到一起以便後續維護,但我還在想具體該怎麼處理。

@Xi-Plus
Copy link
Member

Xi-Plus commented May 20, 2021

重複的程式碼應該整合到一起以便後續維護,但我還在想具體該怎麼處理。

#215,但不是定稿

@sunafterrainwm
Copy link
Contributor Author

等待 #215 完成

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: speedy Including image and speedy Module: xfd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants