Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module:Mainspace editnotice
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local Arguments = require('Module:Arguments') local Disambiguation = require('Module:Disambiguation') local TfaTitle = require('Module:TFA title') local p = {} p.main = function(frame) local args = Arguments.getArgs(frame) return p.core(args.page and mw.title.new(args.page) or mw.title.getCurrentTitle(), frame) end local notices = { draft_notice = function (page, ctx) if page.exists and (page.isRedirect or ctx.isDisambigPage) and mw.title.new('Draft:'..page.fullText).exists then return "Draft at" end end, blp_notice = function(page) local content = page:getContent() local living = "%[%[%s*[Cc]ategory:%s*[Ll]iving[ _]people%s*%]%]" local possiblyLiving = "%[%[%s*[Cc]ategory:%s*[Pp]ossibly[ _]living[ _]people%s*%]%]" if content and (content:find(living) or content:find(possiblyLiving)) then return "BLP editnotice" end end, disambig_notice = function(page, ctx) if ctx.isDisambigPage then return "Disambig editnotice" end end, tfa_notice = function(page) if TfaTitle.today_title() == page.text then return "TFA editnotice" end end, refideas_notice = function(page) local talkContent = page.talkPageTitle:getContent() if talkContent and talkContent:match('%{%{[rR]ef ?idea') and not talkContent:match("Refideas%-nonotice") then return "Refideas editnotice" end end, } p.core = function(page, frame) -- Context object to store values that are expensive to compute and required -- in multiple places local context = { isDisambigPage = Disambiguation._isDisambiguationPage(page.fullText) } local text = '' for _, getNotice in pairs(notices) do local template = getNotice(page, context) text = text .. (template and ('<div class="editnotice-link" style="clear: both; float: right; margin: 0px 0.8em; padding: 0; line-height: 1em;"> <small>[[Template:'..template..'|'..template..']]</small> </div>' .. frame:expandTemplate{ title = template }) or '') end return text end return p
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Lua
(
edit
)
Template:Para
(
edit
)
Template:Sandbox other
(
edit
)
Template:Used in system
(
edit
)
Module:Lua banner
(
edit
)
Module:Mainspace editnotice/doc
(
edit
)
Module:String
(
edit
)