Modul:Preview warning

Iz Wikipedije, proste enciklopedije
Documentation icon Dokumentacija modula[predogled] [uredi] [zgodovina] [osveži]

Usage[uredi kodo]

Put this code in your template. The message will only show in Show preview (you can try with this page):

  • {{#invoke:Preview warning|main|Message text}}


local p = {}

--[[
main

This function returns parameter 1 as a warning if the page containing it is being previewed.

Usage:
{{#invoke:Preview warning|main|warning_text}}

]]

function p.main(frame)
	local preview = frame.args[1]:match('^%s*(.-)%s*$') or ''
	if preview == '' then preview = 'S to predlogo je nekaj narobe' end
	if frame:preprocess( "{{REVISIONID}}" ) == "" then return '<div class="hatnote" style="color:red"><strong>Opozorilo:</strong> ' .. preview .. ' (to sporočilo je prikazano le v predogledu)</div>' end
end

return p