Bước tới nội dung

Mô đun:Các thông báo sửa đổi Không gian tên Chính

Trang mô đun bị khóa vô hạn
Bách khoa toàn thư mở Wikipedia
(Đổi hướng từ Mô đun:Mainspace editnotice)

local Arguments = require('Mô đun:Arguments')local Disambiguation = require('Mô đun:Disambiguation')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)endlocal notices = { refideas_notice = function(page) local talkContent = page.talkPageTitle:getContent() if talkContent and (talkContent:match('%{%{[rR]ef ?idea') or mw.ustring.match(talkContent, '%{%{[ýÝ] tưởng tham khảo')) 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>[[Bản mẫu:'..template..'|'..template..']]</small> </div>' .. frame:expandTemplate{ title = template }) or '') end return textendreturn p