Module:Contentious topics/aware
Appearance
From Wikipedia, the free encyclopedia
(Redirected from Module:Ds/aware)
[画像:Warning] This Lua module is used in MediaWiki:Abusefilter-warning-CT .
Changes to it can cause immediate changes to the Wikipedia user interface.
To avoid major disruption, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them.
Changes to it can cause immediate changes to the Wikipedia user interface.
To avoid major disruption, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them.
See doc at Template:Contentious topics/aware/doc
The above documentation is transcluded from Module:Contentious topics/aware/doc. (edit | history)
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Subpages of this module.
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Subpages of this module.
localp={} localgetArgs=require('Module:Arguments').getArgs functionp.detect(frame) localtitle localargs=getArgs(frame) ifargs.testTitlethen title=mw.title.new(args.testTitle) else title=mw.title.getCurrentTitle() end localcontent=title:getContent()or'' localcodes=string.match(content,"{{%s-[cC]ontentious [tT]opics/[aA]ware%s-|([^}]-)}}") localshortcutCodes=string.match(content,"{{%s-[cC][tT]/[aA]ware%s-|([^}]-)}}") localdsCodes=string.match(content,"{{%s-D[sS]/[aA]ware%s-|([^}]-)}}") if(notcodes)and(notdsCodes)and(notshortcutCodes)thenreturnend localtext if(codes)then text=p._listToText(frame,mw.text.split(codes,"|")) elseif(dsCodes)then text=p._listToText(frame,mw.text.split(dsCodes,"|")) else text=p._listToText(frame,mw.text.split(shortcutCodes,"|")) end returnframe:preprocess( "<div style = 'font-weight: bold'>It is not necessary to notify this user about the following topics being contentious topics:" ..text.. "\n The user has indicated that they are already aware using the template <nowiki>{{Contentious topics/aware}}</nowiki> on their talk page.</div>" ) end functionp.listToText(frame) returnp._listToText(frame,getArgs(frame)) end functionp._listToText(frame,t) localnew={} localt=require('Module:TableTools').compressSparseArray(t) fori,vinipairs(t)do table.insert(new,frame:expandTemplate{title='Contentious_topics/list',args={["scope"]=v}}) end return'\n*'..table.concat(new,'\n*') end returnp