Module:Miramoji: Difference between revisions

From Meta Wiki
Jump to navigation Jump to search
Better variable names
 
m 1 revision imported: some changes are needed ; like removing link to UTRS
 
(No difference)

Latest revision as of 18:23, 12 December 2024

Documentation for this module may be created at Module:Miramoji/doc

local p = {}

function p.runemoji(frame)
	local args = frame.args
	local name = args[1]
	local size = args[2]
    
	local emojis = {
		christmas = "Christmas Tree.png",
		database = "DatabaseBlackOutline.png",
		pumpkin = "PumpkinNotCarved.jpg",
		party = "Party Popper Emojipedia.png",
		brick = "Bricks.png",
		honeycomb = "MirahezeHoneycomb.png",
		document = "Docsicon.png",
		blackpencil = "20150202215729!OOjs UI icon edit-ltr.svg",
		pencil = "Pencil.svg",
		userinfo = "User-info.svg",
		error = "RedWarn.png",
		earth = "Emblem-earth.svg",
		earth2 = "SSDEarthNoIce.png",
		venus = "Tango Venus.svg",
		mars = "Tango Mars.svg",
		jupiter = "Tango Jupiter.svg",
		neptune = "Tango Neptune.svg",
		snowflake = "PaintedSnowflake.png",
		grayflake = "GrayPaintedSnowflake.png",
		iceflake = "IcyPaintedSnowflake.png",
		miraheze = "Miraheze Logo.svg",
		lock = "ClosedLock.jpg",
		warning = "Red warning 2.png",
		bluecheck = "30px-Blue check.svg.png",
		mhadmin = "Miraheze admin.png",
		mhcheckuser = "Miraheze CheckUser Logo.png",
		mhsteward = "Miraheze Steward.PNG",
		mhsysadmin = "Miraheze Sysadmin.PNG",
		mhwikicreator = "Miraheze Wiki Creator.PNG",
		mhbureaucrat = "Miraheze Bureaucrat.PNG",
		mhpatrolled = "Miraheze Autopatrolled.PNG",
		mhmainpage = "Meta Mobile Main Page.png",
		pen = "Pen icon.png",
		mars2 = "Mars transparent.png",
		mhrollback = "Miraheze rollback.png",
		mhsettings = "Miraheze settings.png",
	}

	local emoji = emojis[name]

	if not emoji then
		return (
			'<strong class="error scribunto-error">Template:Miramoji error - No emoji found with name "'
			.. name
			.. '"</strong>'
		)
	end

	return ("[[File:" .. emoji .. "|" .. size .. "px|link=]]")
end

return p