模組討論:Sports table/WDL

由Fireattack在話題不要在表格里加入hard-coded的字體上作出的最新留言:4 年前

編輯請求,求更改模板

{{Editprotected}}

模塊:Sports table/WDL之中將

原本內容

function pp.status(Args) -- Declare status options -- ------------------------------------------------------------ -- NOTE: If you add to status_code, also add to status_called and status_letters!! -- Or functionality will be compromised -- ------------------------------------------------------------ local status_code, status_called = {} status_code = { A='晉級下一圈', C='冠軍', D='取消資格', E='確定淘汰出局',G='特邀嘉賓', H='東道主', O='附加賽勝者', P='升班', Q='獲得指定賽事參賽權', R='降班', S='衛冕球隊', T='晉級,但未定指定輪次', X='?', Y='?', Z='?'} status_called = { A=false, C=false, D=false, E=false, H=false, O=false, P=false, Q=false, R=false, S=false, T=false, X=false, Y=false, Z=false} local status_letters = 'ACDEHOPQRSTXYZ'

-- Status position (before or after read and default) local stat_pos_val = Args['status_pos'] or local status_position = 'after' -- Default location stat_pos_val = string.lower(stat_pos_val) if stat_pos_val=='before' then status_position = 'before' elseif stat_pos_val=='after' then status_position = 'after' end

-- Read in custom status options if Args['status_text_X'] then status_code.X = Args['status_text_X'] end if Args['status_text_Y'] then status_code.Y = Args['status_text_Y'] end if Args['status_text_Z'] then status_code.Z = Args['status_text_Z'] end

return {code=status_code, called=status_called, letters=status_letters, position=status_position} end

return pp

修改為

要更改之內容

function pp.status(Args) -- Declare status options -- ------------------------------------------------------------ -- NOTE: If you add to status_code, also add to status_called and status_letters!! -- Or functionality will be compromised -- ------------------------------------------------------------ local status_code, status_called = {}, {} status_code = { A='晉級下一圈', C='冠軍', D='取消資格', E='確定淘汰出局',G='特邀嘉賓', H='東道主', O='附加賽勝者', P='升班', Q='獲得指定賽事參賽權', R='降班', S='衛冕球隊', T='晉級,但未定指定輪次'} local status_letters = (Args['status_order'] or ) .. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

-- Status position (before or after read and default) local stat_pos_val = Args['status_pos'] or local status_position = 'after' -- Default location stat_pos_val = string.lower(stat_pos_val) if stat_pos_val=='before' then status_position = 'before' elseif stat_pos_val=='after' then status_position = 'after' end -- Read in custom status options for l in mw.text.gsplit(status_letters, ) do status_called[l] = false status_code[l] = status_code[l] or '?' status_letters = mw.ustring.gsub(status_letters, '(' .. l ..'.-)' .. l, '%1')

if Args['status_text_' .. l] then status_code[l] = Args['status_text_' .. l] end end

return {code=status_code, called=status_called, letters=status_letters, position=status_position} end

return pp

或者

要更改之內容-2

function pp.status(Args) -- Declare status options -- ------------------------------------------------------------ -- NOTE: If you add to status_code, also add to status_called and status_letters!! -- Or functionality will be compromised -- ------------------------------------------------------------ local status_code, status_called = {} status_code = { A='晉級下一圈', C='冠軍', D='取消資格', E='確定淘汰出局',G='特邀嘉賓', H='東道主', O='附加賽勝者', P='升班', Q='獲得指定賽事參賽權', R='降班', S='衛冕球隊', T='晉級,但未定指定輪次', X='?', Y='?', Z='?'} status_called = { A=false, C=false, D=false, E=false, H=false, O=false, P=false, Q=false, R=false, S=false, T=false, X=false, Y=false, Z=false} local status_letters = 'ACDEHOPQRSTXYZ'

-- Status position (before or after read and default) local stat_pos_val = Args['status_pos'] or local status_position = 'after' -- Default location stat_pos_val = string.lower(stat_pos_val) if stat_pos_val=='before' then status_position = 'before' elseif stat_pos_val=='after' then status_position = 'after' end

-- Read in custom status options

if Args['status_text_A'] then status_code.A = Args['status_text_A'] end if Args['status_text_B'] then status_code.B = Args['status_text_B'] end if Args['status_text_C'] then status_code.C = Args['status_text_C'] end if Args['status_text_D'] then status_code.D = Args['status_text_D'] end if Args['status_text_E'] then status_code.E = Args['status_text_E'] end if Args['status_text_F'] then status_code.F = Args['status_text_F'] end if Args['status_text_G'] then status_code.G = Args['status_text_G'] end if Args['status_text_H'] then status_code.H = Args['status_text_H'] end if Args['status_text_I'] then status_code.I = Args['status_text_I'] end if Args['status_text_J'] then status_code.J = Args['status_text_J'] end if Args['status_text_K'] then status_code.K = Args['status_text_K'] end if Args['status_text_L'] then status_code.L = Args['status_text_L'] end

       if Args['status_text_M'] then status_code.M = Args['status_text_M'] end

if Args['status_text_N'] then status_code.N = Args['status_text_N'] end

       if Args['status_text_O'] then status_code.O = Args['status_text_O'] end

if Args['status_text_P'] then status_code.P = Args['status_text_P'] end

       if Args['status_text_Q'] then status_code.Q = Args['status_text_Q'] end

if Args['status_text_R'] then status_code.R = Args['status_text_R'] end

       if Args['status_text_S'] then status_code.S = Args['status_text_S'] end

if Args['status_text_T'] then status_code.T = Args['status_text_T'] end

       if Args['status_text_U'] then status_code.U = Args['status_text_U'] end

if Args['status_text_V'] then status_code.V = Args['status_text_V'] end

       if Args['status_text_W'] then status_code.W = Args['status_text_W'] end

if Args['status_text_X'] then status_code.X = Args['status_text_X'] end if Args['status_text_Y'] then status_code.Y = Args['status_text_Y'] end if Args['status_text_Z'] then status_code.Z = Args['status_text_Z'] end

return {code=status_code, called=status_called, letters=status_letters, position=status_position} end

return pp

謝謝

--1.161.245.175留言2019年1月15日 (二) 13:48 (UTC)回覆

請求時請列明理由。--Jimmy Xu 2019年1月15日 (二) 16:34 (UTC)回覆

請求代為編輯

和前一匿名用戶要求的一樣,謝謝。原因是:可以有更多標記可以進行,也可進行預設標記之修改,就不會困在只能標X、Y、Z的窘境。36.226.52.140留言2019年2月10日 (日) 15:09 (UTC)回覆

不要在表格里加入hard-coded的字體

各地管用的字體並不一樣,請不要隨意指定固定字體,讓用戶的瀏覽器自動選擇。--Fireattack留言2019年12月24日 (二) 13:26 (UTC)回覆

返回 "Sports table/WDL" 頁面。