fbpx
วิกิพีเดีย

มอดูล:Flag

คู่มือการใช้งานมอดูล[ดู] [แก้] [ประวัติ] [ล้างแคช]

Lua-native alternative to popular flag templates. Can be used to reduce post-expand include size of pages with lots of templates, since it avoids calling multilevel templates.

Usage

Examples

Template Module
Code Output PEIS Code Output PEIS
{{flag|China}}  จีน 443b {{#invoke:flag|main|China}}  China 128b
{{flagcountry|China}}  จีน 577b {{#invoke:flag|country|China}}  จีน 128b
{{flagdeco|China}} 452b {{#invoke:flag|deco|China}} 107b
{{flagicon|China}} 548b {{#invoke:flag|icon|China}} 117b
{{flag+link|History of|China}}  จีน 663b {{#invoke:flag|+link|History of|China}}  China 139b

local p = {}  function p._main(frame, name, mode, check)  local categories = {  Flagicon = '[[หมวดหมู่:Flagicons with missing country data templates]]',  Flagdeco = '[[หมวดหมู่:Flagdeco with missing country data templates]]',  }   local args={}   if require('มอดูล:Yesno')(frame.args['getParent']) then  for k,v in pairs(frame:getParent().args) do  if (v or '') ~= '' then  args[k] = v  end  end  end  for k,v in pairs(frame.args) do  if (v or '') ~= '' then  args[k] = v  end  end   if name == 'Flag+link' then  args['pref'] = args[1]  else  args['variant'] = args[2] or args['variant']  args[2] = args[1]  end   args[1] = mode .. (args['opts'] and args['opts'] or '')  args['missingcategory'] = categories[name] or ''  args['noredlink'] = args['noredlink'] or 'no'   if require('มอดูล:Yesno')(args['placeholder']) ~= true then  args[1] = args[1] .. 'o'  end   if check then  local opts = {  unknown=frame:expandTemplate{ title = 'main other', args = { '[[หมวดหมู่:หน้าที่ใช้แม่แบบ ' .. mw.ustring.lower(name) .. ' โดยมีพารามิเตอร์แปลกปลอม|_VALUE_' .. frame:getParent():getTitle() .. ']]' } },  preview='หน้านี้ใช้ [[แม่แบบ:' .. name .. ']] โดยมีพารามิเตอร์แปลกปลอม "_VALUE_"',  ignoreblank='y',  [1] = '1',  [2] = '2',  [3] = 'variant',  [4] = 'image',  [5] = 'size',  [6] = 'sz',  [7] = 'border',  [8] = 'align',  [9] = 'al',  [10]= 'width',  [11]= 'w',  [12]= 'alt',  [13]= 'ilink',  [14]= 'noredlink',  [15]= 'missingcategory',  [16]= 'name',  [17]= 'clink',  [18]= 'link',  [19]= 'pref',  [20]= 'suff',  [21]= 'plink',  [22]= 'the',  [23]= 'section',  [24]= 'altvar',  [25]= 'avar',  [26]= 'age',  [27]= 'nalign',  [28]= 'nal',  [29]= 'text',  [30]= 'nodata',  [31]= 'opts',  [32]= 'placeholder',  [33]= 'getParent'  }   check = require('มอดูล:Check for unknown parameters')._check(opts,args)  else  check = ''  end   return require('มอดูล:Flagg').luaMain(frame,args)..check end  function p.main(frame) return p._main(frame, 'Flag', 'uncb', false) end p['flag'] = p.main function p.deco(frame) return p._main(frame, 'Flagdeco', 'uxx', false) end p['flagdeco'] = p.deco function p.icon(frame) return p._main(frame, 'Flagicon', 'cxxl', true ) end p['flagicon'] = p.icon function p.pluslink(frame) return p._main(frame, 'Flag+link', 'unpof', false ) end p['+link'] = p.pluslink p['flag+link'] = p.pluslink function p.country(frame) return p._main(frame, 'Flagcountry', 'unce', false ) end p['flagcountry'] = p.country  return p 

มอด, flag, อการใช, งานมอด, แก, ประว, างแคช, this, module, rated, beta, ready, widespread, still, should, used, with, some, caution, ensure, results, expected, แม, แบบน, ใช, สคร, ปต, ภาษาล, อา, module, flaggmodule, check, unknown, parameterslua, native, alterna. khumuxkarichnganmxdul du aek prawti langaekhch This module is rated as beta and is ready for widespread use It is still new and should be used with some caution to ensure the results are as expected aemaebbniichskhriptphasaluxa Module FlaggModule Check for unknown parametersLua native alternative to popular flag templates Can be used to reduce post expand include size of pages with lots of templates since it avoids calling multilevel templates Usage aekikh flag invoke flag main flagcountry invoke flag country flagdeco invoke flag deco flagicon invoke flag icon flag link invoke flag link Examples aekikh Template ModuleCode Output PEIS Code Output PEIS a href E0 B9 81 E0 B8 A1 E0 B9 88 E0 B9 81 E0 B8 9A E0 B8 9A Flag html title aemaebb Flag flag a China cin 443b invoke flag main China China 128b a href E0 B9 81 E0 B8 A1 E0 B9 88 E0 B9 81 E0 B8 9A E0 B8 9A Flagcountry html title aemaebb Flagcountry flagcountry a China cin 577b invoke flag country China cin 128b a href E0 B9 81 E0 B8 A1 E0 B9 88 E0 B9 81 E0 B8 9A E0 B8 9A Flagdeco html title aemaebb Flagdeco flagdeco a China 452b invoke flag deco China 107b a href E0 B9 81 E0 B8 A1 E0 B9 88 E0 B9 81 E0 B8 9A E0 B8 9A Flagicon html title aemaebb Flagicon flagicon a China 548b invoke flag icon China 117b a href E0 B9 81 E0 B8 A1 E0 B9 88 E0 B9 81 E0 B8 9A E0 B8 9A Flag 2Blink html title aemaebb Flag link flag link a History of China cin 663b invoke flag link History of China China 139bkhumuxkarichnganthipraktdanbnnidungmacak mxdul Flag doc aek prawti phuekhiynsamarththakarthdlxngidthikrabathray srang khdlxk aelachudthdsxb srang khxngmxdulni hnayxykhxngmxdulnilocal p function p main frame name mode check local categories Flagicon hmwdhmu Flagicons with missing country data templates Flagdeco hmwdhmu Flagdeco with missing country data templates local args if require mxdul Yesno frame args getParent then for k v in pairs frame getParent args do if v or then args k v end end end for k v in pairs frame args do if v or then args k v end end if name Flag link then args pref args 1 else args variant args 2 or args variant args 2 args 1 end args 1 mode args opts and args opts or args missingcategory categories name or args noredlink args noredlink or no if require mxdul Yesno args placeholder true then args 1 args 1 o end if check then local opts unknown frame expandTemplate title main other args hmwdhmu hnathiichaemaebb mw ustring lower name odymipharamietxraeplkplxm VALUE frame getParent getTitle preview hnaniich aemaebb name odymipharamietxraeplkplxm VALUE ignoreblank y 1 1 2 2 3 variant 4 image 5 size 6 sz 7 border 8 align 9 al 10 width 11 w 12 alt 13 ilink 14 noredlink 15 missingcategory 16 name 17 clink 18 link 19 pref 20 suff 21 plink 22 the 23 section 24 altvar 25 avar 26 age 27 nalign 28 nal 29 text 30 nodata 31 opts 32 placeholder 33 getParent check require mxdul Check for unknown parameters check opts args else check end return require mxdul Flagg luaMain frame args check end function p main frame return p main frame Flag uncb false end p flag p main function p deco frame return p main frame Flagdeco uxx false end p flagdeco p deco function p icon frame return p main frame Flagicon cxxl true end p flagicon p icon function p pluslink frame return p main frame Flag link unpof false end p link p pluslink p flag link p pluslink function p country frame return p main frame Flagcountry unce false end p flagcountry p country return p ekhathungcak https th wikipedia org w index php title mxdul Flag amp oldid 9715661, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม