Module:UpdateExcerpt: Difference between revisions

Undo revision 86569 by Cronos (talk)
Tag: Undo
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 33: Line 33:


     local html = string.format(
     local html = string.format(
         '<div style="flex:1; min-height:0; overflow-y:auto; max-height:%.1fem; padding:14px 18px; font-family: sans-serif; font-size:0.92em; line-height:1.7;">\n__NOEDITSECTION__\n%s\n</div>',
         '<div style="flex:1; min-height:0; overflow-y:auto; padding:14px 18px; font-family: sans-serif; font-size:0.92em; line-height:1.7;">\n__NOEDITSECTION__\n%s\n</div>',
        maxHeight,
         frame:preprocess(notesRaw)
         frame:preprocess(notesRaw)
     )
     )


     return html
     return html
end
function p.getDateLink(frame)
    local parentArgs = frame:getParent().args or {}
    local args = frame.args or {}
    local month = parentArgs.month or args.month or parentArgs[1] or args[1] or ""
    local day  = parentArgs.day or args.day or parentArgs[2] or args[2] or ""
    local year  = parentArgs.year or args.year or parentArgs[3] or args[3] or ""
    month = mw.text.trim(month)
    day  = mw.text.trim(day)
    year  = mw.text.trim(year)
    if month == "" or day == "" or year == "" then
        local latestUpdate = require("Module:LatestUpdate")
        if month == "" then month = latestUpdate.month() end
        if day == ""  then day  = latestUpdate.day() end
        if year == ""  then year  = latestUpdate.year() end
    end
    return "[[Update:" .. month .. " " .. day .. ", " .. year .. "| ".. month .. " " .. day .. ", " .. year .. "]]"
end
end


Line 102: Line 123:
     footer:tag("span")
     footer:tag("span")
         :addClass("update-excerpt__readmore")
         :addClass("update-excerpt__readmore")
         :wikitext("Read more")
         :wikitext("[[Update:" .. month .. " " .. day .. ", " .. year .. "|Read more]]")
       
    footer:wikitext("[[Update:" .. month .. " " .. day .. ", " .. year .. "|<span class=\"update-excerpt__footer-overlay\"></span>]]")


     return tostring(html)
     return tostring(html)