跳转到内容

模組:Vae2 icon

维基百科,自由的百科全书

这是本页的一个历史版本,由Daiquping留言 | 贡献2014年11月9日 (日) 03:29 (先copy va2 icon 之后再作修改)编辑。这可能和当前版本存在着巨大的差异。

(差异) ←上一修订 | 最后版本 (差异) | 下一修订→ (差异)
local p = {}
--p.main 修改自自module:Template:Weighted_page_size
function p.Weighted_page_size( titleText )
    if not titleText then
        return 0
    end
    local title = mw.title.new( titleText )
    if not title then
        return 0
    end
    local content = title:getContent()
    if not content then
        return 0
    end
    local chars = mw.ustring.len( content )
    return math.floor( chars * 3.7 + 0.5 )
end

function p.main( frame )
    local titleText = frame.args[1]
    local size
    local icontext
    size = p.Weighted_page_size(titleText)

    if size<3000 then
        icontext='[[File:Qsicon Ueberarbeiten.svg|16px|基础条目(少於3KB)]]'
    elseif size<10000 then   
        icontext='[[File:Qsicon inArbeit.svg|16px|基础条目(3至10KB)]]'
    elseif size<30000 then  
        icontext='[[File:YesCheck BlueLinear.svg|16px|基础条目(10至30KB)]]'
    else    
        icontext='[[File:YesCheck GreenLinear.svg|16px|基础条目(30KB或以上)]]'
    end
    return icontext
end

return p