local E, L, V, P, G = unpack(ElvUI);
local mPlugin = "mMediaTag"
local mMT = E:GetModule(mPlugin);
local addon, ns = ...

local function mChangeLog()
	local cTitle, cText1, cText2, cText3, cText4, cText5, cDate = ""
	local cLine1 = "|n"
	local cLine2 = "|n|n"
	local cLine3 = "|n|n|n"
	
	cDate  = "07.08.2020"
	cTitle = "|CFF8E44ADm|r|CFF2ECC71Media|r|CFF3498DBTag|r Changelog!"
	cText1 = L["Changelog"] 
	cText2 = L["several small bugs fixed"]
	cText3 = L[" "]
	cText4 = L[" "]
	cText5 = L[" "]
	
	cTitle = format("%s - %s", cTitle, cDate)
	cText1 = format("%s%s|r", ns.mColor6, cText1)
	cText2 = format("%s%s|r", ns.mColor2, cText2)
	cText3 = format("%s%s|r", ns.mColor2, cText3)
	cText4 = format("%s%s|r", ns.mColor2, cText4)
	cText5 = format("%s%s|r", ns.mColor2, cText5)
	
	return format("%s%s%s%s%s%s%s%s%s%s%s%s", cTitle, cLine3, cText1, cLine1, cText2, cLine1, cText3, cLine1, cText4, cLine1, cText5, cLine1)
end

function mMT:Changelog()
	StaticPopupDialogs["mChangeLog"] = {
		text = mChangeLog(),
		button1 = "OK",
		OnAccept = function()
		  E.db[mPlugin].mPluginVersion = ns.mVersion
		end,
		timeout = 120,
		whileDead = true,
		hideOnEscape = true,
		preferredIndex = 3,
	}

	StaticPopup_Show ("mChangeLog")
end
