Skip to content

speedy/xfd: Add delete-templates on non-wikitext pages#206

Closed
sunafterrainwm wants to merge 4 commits into
xiplus-mediawiki-programs:masterfrom
sunafterrainwm:master
Closed

speedy/xfd: Add delete-templates on non-wikitext pages#206
sunafterrainwm wants to merge 4 commits into
xiplus-mediawiki-programs:masterfrom
sunafterrainwm:master

Conversation

@sunafterrainwm

Copy link
Copy Markdown
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

a2569875 commented May 7, 2021

Copy link
Copy Markdown

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

sunafterrainwm commented May 7, 2021

Copy link
Copy Markdown
Contributor Author

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

Comment thread package-lock.json Outdated
@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
@cchamish

cchamish commented May 8, 2021

Copy link
Copy Markdown
Collaborator

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

@a2569875

a2569875 commented May 8, 2021

Copy link
Copy Markdown

他指的應該是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
@cchamish

cchamish commented May 8, 2021

Copy link
Copy Markdown
Collaborator

@a2569875 ok

@sunafterrainwm sunafterrainwm requested a review from Xi-Plus May 9, 2021 02:05
Comment thread modules/twinklexfd.js Outdated
Comment thread modules/twinklespeedy.js Outdated
@sunafterrainwm sunafterrainwm requested a review from Xi-Plus May 9, 2021 14:16
@Xi-Plus

Xi-Plus commented May 10, 2021

Copy link
Copy Markdown
Member

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

@Xi-Plus

Xi-Plus commented May 20, 2021

Copy link
Copy Markdown
Member

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

#215,但不是定稿

@sunafterrainwm

Copy link
Copy Markdown
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