Module:Comment

local p = {}

local utilsError = require('Module:UtilsError')

function p.Main(frame) return p.main(frame.args) end

function p.main(args) local cType = args[1] -- "Comment Type," The template that is being called (Fi, Midna, Navi, etc.) This is typically set by default on every template to decrease user error, but some templates (like Template:Manual) allow for this to be changed to relate to different games. local cSubject = args[2] -- "Comment Subject," The header for the comment (Stalfos, Green Rupee, Zelda, etc.) Pulls from parameter 1 (or 2 if Template:Manual is used). local cContent = args[3] -- "Comment Content," The quote that is displayed in the comment. Pulls from parameter 2 (or 3 if Template:Manual is used) and automatically surrounds it with qutotation marks. --The following comment types all regard non-mainspace Zelda Wiki pages and are used for general notices and headers. These are typically not able to be collapsible like most other comment templates, and are almost always found on Talk and User pages. if (cType == "Archive") then --for Template:Archive (regarding Archived Talk Pages) returnTable = string.format("\nThis page is an archive of an old Talk Page. The contents have been moved from another page to clear space and to preserve history, so this page is locked from editing. If you wish to ask about the corresponding page, or respond to an earlier message, you may direct any comments to the current talk page. If you wish to refer to a message on this page, link to %s.'' ", cSubject, cContent)

--The following comment types all regard Character comments in-game. These usually regard Link's partner or other character that gives general information on certain subjects, like a "tutorial" guide. Each of these characters have their own template, and the cType parameter is automatically set for every usage of the template. elseif (cType == "Fi") then --for Template:Fi (Skyward Sword) returnTable = string.format("Fi's Comment: \n{|\n|\n|Target lock: %s \"%s \"\n|}  ", cSubject, cContent)

elseif (cType == "Fishman") then --for Template:Fishman (The Wind Waker) returnTable = string.format("Fishman's Comment: \n{|\n|\n|%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "Happy Mask Salesman") then --for Template:Happy Mask Salesman (Majora's Mask) returnTable = string.format("The Happy Mask Salesman's Comment: \n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "Midna") then --for Template:Midna (Twilight Princess) returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Midna's Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"<span class=\"colored-text tphd-midna-blue\">%s \"\n|}  ", cSubject, cContent)

elseif (cType == "Monita") then --for Template:Monita (Nintendo Land) returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Monita's Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "Navi") then --for Template:Navi (Ocarina of Time) returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Navi's Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "Tatl") then --for Template:Tatl (Majora's Mask) returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Tatl's Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "Tingle") then --for Template:Tingle (the Wind Waker [not HD]) returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Tingle's Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent) --The following is for Template:Manual. On each page, the editor enters and the Game abbreviation replaces the "cType" variable, which was automatically set on the previous templates.

elseif (cType == "TLoZ") then --for The Legend of Zelda manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">The Legend of Zelda Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "TAoL") then --for The Adventure of Link manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">The Adventure of Link Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent) elseif (cType == "ZG&W") then --for the Zelda (Game & Watch) manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Zelda (Game & Watch) Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "ALttP") then --for the A Link to the Past manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">A Link to the Past Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "LA") then --for the Link's Awakening manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Link's Awakening Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "OoT") then --for the Ocarina of Time manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Ocarina of Time Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "MM") then --for the Majora's Mask manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Majora's Mask Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 25px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

elseif (cType == "LCT") then --for the Link's Crossbow Training manual returnTable = string.format("<div class=\"toccolours mw-collapsible\" data-expandtext=\"show comment ▼\" data-collapsetext=\"hide comment ▲\"><div style=\"font-size: 105%%\">Link's Crossbow Training Manual Comment: <div class=\"mw-collapsible-content\" style=\"border-radius: 24px; border: 6px solid ; background-color: ; display: flex\">\n{|\n|\n|<span style=\"font-size: 130%%; font-weight: bold;\">%s \"%s\"\n|}  ", cSubject, cContent)

else --Activates when someone enters an invalid value for "cType" utilsError.warn(string.format("%s is not a valid game, see here for all usable games. If this is a mistake, please contact a staff member on the Discord server.", cType)) end return returnTable end

return p