Skip to content

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 = ''
}

@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

@sunafterrainwm sunafterrainwm requested a review from Xi-Plus May 9, 2021 02:05
@sunafterrainwm sunafterrainwm requested a review from Xi-Plus May 9, 2021 14:16
@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