FANDOM


local p = {};
 
-- Update these on Sunday
local upcoming = "21";
local latest = "20";
local secondLatest = "19"
local first = "1";
local second = "2";
 
function p.getLink(frame)
    local ep = tonumber(frame:getParent().args['episode']);
    local theme = frame:getParent().args['theme'];
    local link = p.getLinkRaw(ep, theme);
    return link;
end
 
function p.getLatestLink()
    local ep = tonumber(latest) + 2
    return "http://webtoons.com/viewer?titleNo=1022&episodeNo=" .. ep
end
 
function p.getLinkRaw(ep, theme)
    local link = "http://webtoons.com/viewer?titleNo=1022&episodeNo="
    local epNum = 0
    local epName = ""
 
    if(theme == "" or theme == nil) then
        if(ep <= 14) then
            epNum = ep
        elseif(ep < 19) then
            epNum = ep + 1
        elseif(ep >= 19) then
            epNum = ep + 2
        end
 
        epName = "Episode " .. ep
    else
        if(ep == 1) then
            epNum = 19
            epName = "Halloween Episode"
        end
    end
 
    return "[" .. link .. epNum .. " " .. epName .. "]"
 
end
 
 
function p.firstLabel(frame)
    local ep = frame:getParent().args['episode']
    local theme = frame:getParent().args['theme']
 
    if(ep == first and theme == "") then
        return ""
    elseif(ep == second and theme == "") then
        return ""
    else
        return "⇐ First"
    end
 
end
 
function p.firstValue(frame)
    local ep = frame:getParent().args['episode']
    local theme = frame:getParent().args['theme']
 
    if(ep == first and theme == "") then
        return ""
    elseif(ep == second and theme == "") then
        return ""
    else
        return "[[Episode 1]]"
    end
 
end
 
function p.latestLabel(frame)
    local ep = frame:getParent().args['episode']
    local theme = frame:getParent().args['theme']
 
    if(ep == latest) then
        return ""
    elseif(ep == secondLatest) then
    --elseif(ep == 1 and not(theme == "")) then
        return ""
    else
        return "Latest ⇒"
    end
 
end
 
function p.latestValue(frame)
    local ep = frame:getParent().args['episode']
    local theme = frame:getParent().args['theme']
 
    if(ep == latest) then
        return ""
    elseif(ep == secondLatest) then
    --elseif(ep == 1 and not(theme == "")) then
        return ""
    else
        return p.getLatestPage()
    end
 
end
 
function p.getLatestPage()
    return "[[Episode " .. latest .. "]]";
end
 
function p.nextLabel(frame)
    return "Next →"
end
 
function p.nextValue(frame)
    local ep = tonumber(frame:getParent().args['episode']);
    return "[[Episode " .. ep+1 .. "]]";
end
 
function p.previousLabel(frame)
    return "← Previous"
end
 
function p.previousValue(frame)
    local ep = tonumber(frame:getParent().args['episode']);
    return "[[Episode " .. ep-1 .. "]]";
end
 
return p;

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.