fbpx
วิกิพีเดีย

มอดูล:Load WikiProject Modules

คู่มือการใช้งานมอดูล[สร้าง]
local p = {}  function standardicon(modulename)  index = {}  -- Take modulename as input, returns corresponding icon filename  -- Returns default icon if no icon is defined  -- Grow the library! Add default icons as needed by adding this line below:  -- index['MODULENAME'] = 'FILE NAME.ext'  index['เกี่ยวกับ'] = 'Information Noun 176431.svg'  index['เกี่ยวกับเรา'] = 'Information Noun 176431.svg'  index['การแจ้งเตือน'] = 'Bell icon.svg'  index['การแจ้งเตือนบทความ'] = 'Bell icon.svg'  index['การแจ้งเตือนบทความ'] = 'Bell icon.svg'  index['พาร์ทเนอร์'] = 'Handshake noun.svg'  index['ความร่วมมือ'] = 'Handshake noun.svg'  index['อภิปราย'] = 'Speechbubbles icon.svg'  index['อีเวนต์'] = 'Simpleicons Business calendar-with-a-clock-time-tools.svg' -- Is this PD-shapes?  index['แหล่งข้อมูลอื่น'] = 'Link icon.svg'  index['แหล่งข้อมูลอื่น'] = 'Link icon.svg'  index['ลิงก์'] = 'Link icon.svg'  index['แผนที่'] = 'MapPin.svg'  index['ตัวชี้วัด'] = 'ArticleCheck.svg'  index['ข่าว'] = 'Calendar icon 2.svg'  index['แอปออฟไลน์'] = 'Offline logo.svg'  index['สื่อข่าวสาร'] = 'Cite newspaper.svg'  index['ปรับปรุงล่าสุด'] = 'Clock icon.svg'  index['ปรับปรุงล่าสุด'] = 'Clock icon.svg'  index['เนื้อหาที่ได้รับการยอมรับ'] = 'RibbonPrize.svg'  index['เนื้อหาที่ได้รับการยอมรับ'] = 'RibbonPrize.svg'  index['โครงการวิกิที่เกี่ยวข้อง'] = 'Contributions icon.svg' -- Not for use for the update bot, special use case, that expands the page   index['โครงการวิกิที่เกี่ยวข้อง'] = 'Contributions icon.svg'  index['การร้องขอ'] = 'Quotes icon.svg'  index['การวิจัย'] = 'Microscope icon (black OCL).svg'  index['แหล่งที่มา'] = 'Cite book.svg'  index['แสดงผลงาน'] = 'RibbonPrize.svg'  index['ภารกิจ'] = 'ListBullet.svg'  index['เครื่องมือ'] = 'Octicons-tools-minor.svg'  index['การแปล'] = 'Translation icon.svg'  index['รายการเฝ้าดู'] = 'OpenEye icon.svg'  index['รายการงาน'] = 'ListBullet.svg'  for t, fn in pairs(index) do  if t == modulename then  return fn  end  end  return 'Beta icon.svg' -- default if nothing matches end  function editlinktest(modulename)  no_edit_links = {'Discussions', 'Alerts', 'Showcase', 'Related WikiProjects'} -- no edit link for these standard modules   for _, l in pairs(no_edit_links) do  if l == modulename then  return 'no'  end  end  return 'yes' end  function p.build(frame)  title = ''  intro = ''  image = ''  color = '#6af' -- default value  displaymode = 'normal' -- default value  modules = {}  for key, value in pairs(frame:getParent().args) do -- iterate through arguments, pick out values  if key == 'title' then  title = value  elseif key == 'intro' then  intro = value  elseif key == 'image' then  image = value  elseif key == 'color' then  color = value  elseif key == 'displaymode' then  displaymode = value  elseif string.find(key, 'module') ~= nil then -- matches module1, module2, etc.  id = string.gsub(key, 'module', '')  id = tonumber(id)  modules[id] = value  end  end   -- Rendering table of contents and body  toc_args = {width = 80, height = 55} -- passed into Image Array module  toc_args['font-size'] = '100%'  toc_args['margin'] = 0  body = ""   -- Load a Table of Contents entry, transclude module, for each named module  counter = 0  for _, module in pairs(modules) do  counter = counter + 1  toc_args['image' .. counter] = standardicon(module)  toc_args['alt' .. counter] = module  if displaymode == "womeninred" then  if module == "Metrics" or module == "Showcase" or module == "About us" or module == "Press" or module == "Research" or module == "External links" then  toc_args['link' .. counter] = "Wikipedia:WikiProject Women in Red/" .. module  else  toc_args['link' .. counter] = "#" .. module  end  else  toc_args['link' .. counter] = "#" .. module  end  toc_args['caption' .. counter] = "[[" .. toc_args['link' .. counter] .. "|" .. module .. "]]"  if module == "Related WikiProjects" then  -- Load the appropriate subpage of [[Wikipedia:Related WikiProjects]]  moduletitle = 'Related WikiProjects' .. '/' .. title  moduletitle_encoded = string.gsub('Wikipedia:' .. moduletitle, ' ', '_')  body = body .. "\n" .. frame:expandTemplate{ title = 'WPX header', args = { module, color = color, modulename = moduletitle_encoded, editlink = editlinktest(module) } }  body = body .. "\n" .. frame:expandTemplate{ title = "Wikipedia:Related WikiProjects/" .. title, args = {color} }  else  if displaymode == "normal" or ( displaymode == "womeninred" and module ~= "Metrics" and module ~= "Showcase" and module ~= "About us" and module ~= "Press" and module ~= "Research" and module ~= "External links" ) then  moduletitle = title .. '/' .. module  moduletitle_encoded = string.gsub('Wikipedia:' .. moduletitle, ' ', '_')  body = body .. "\n" .. frame:expandTemplate{ title = 'WPX header', args = { module, color = color, modulename = moduletitle_encoded, editlink = editlinktest(module) } }  if mw.title.makeTitle('Wikipedia', moduletitle).exists == true then  body = body .. "\n" .. frame:expandTemplate{ title = 'Wikipedia:' .. moduletitle, args = {color} } .. "\n<div style='clear:both;'></div>"  else  -- Is module in question a Standard Module? If so, load the template with corresponding editintro  if mw.title.makeTitle('Template', 'WPX module/' .. module).exists == true then  preload = '&preload=Template:WPX_module/' .. string.gsub(module, ' ', '_')  editintro = '&editintro=Template:WPX_editintro/' .. string.gsub(module, ' ', '_')  else  preload = '' -- no preload  editintro = '&editintro=Template:WPX_editintro/Generic' -- generic editintro  end  -- Create notice  create_url = '//en.wikipedia.org/wiki/Wikipedia:' .. string.gsub(moduletitle, ' ', '_') .. '?action=edit' .. preload .. editintro  create_button = frame:expandTemplate{ title = 'Template:Clickable button 2', args = {'Create Module', url = create_url, class = 'mw-ui-progressive' } }  body = body .. '[[Wikipedia:' .. moduletitle .. ']] does not exist. ' .. create_button  end  end  end   end   toc_args['perrow'] = counter -- sets length of image array to the number of icons  toc = "<div style='margin-bottom:4em;'>" .. frame:expandTemplate{ title='Image array', args = toc_args } .. "</div><div style='clear:both;'></div>"   -- Adding header  header = "__NOTOC__\n<div style='display: flex; display: -webkit-flex; flex-flow: row wrap; -webkit-flex-flow: row wrap;'>" -- top container  if displaymode == "womeninred" then  header = header .. "<div style='flex: 1 0; -webkit-flex: 1 0; border-top: solid .7em " .. color .. ";'>" -- intro  else  header = header .. "<div style='flex: 1 0; -webkit-flex: 1 0; padding-bottom: 3em; border-top: solid .7em " .. color .. ";'>" -- intro  end  -- Adding project icon  header = header .. "<div class='nomobile' style='float:left; margin-top: 1em; margin-right: 2em; margin-bottom: 1em; text-align: center;'>"  header = header .. image .. "</div>"  -- Adding project title  header = header .. "<div style='font-size: 120%; padding: 0;'>" -- header  header = header .. "<h1 style='font-weight: bold; border-bottom: none; margin:0; padding-top:0.5em;'>" .. title .. "</h1></div>"  if displaymode == "womeninred" then  header = header .. toc  end  -- Adding intro blurb  header = header .. "<div style='margin-top: 1em; font-size: 110%;'>"  header = header .. intro .. "</div>"  -- Adding announcement section  if mw.title.makeTitle('Wikipedia', title .. "/" .. "Announcements").exists == true then  header = header .. frame:expandTemplate{ title = 'Wikipedia:' .. title .. "/" .. "Announcements", args = { } }  end  header = header .. "</div>"  -- Adding member box  header = header .. "<div style='flex: 0 1; -webkit-flex: 0 20em;'>"  header = header .. frame:expandTemplate{ title = 'WPX member box', args = { } }  header = header .. "</div>"  -- Closing off header  header = header .. "</div></div>"   -- Assembling parts  if displaymode == "womeninred" then  contents = header .. body  else  contents = header .. toc .. body  end  return contents end  return p 

มอด, load, wikiproject, modules, อการใช, งานมอด, สร, าง, ณอาจจะต, องการสร, างค, อการใช, งานของมอด, ลน, เข, ยนสามารถทำการทดลองได, กระบะทราย, สร, าง, ดลอก, และช, ดทดสอบ, สร, าง, ของมอด, ลน, โปรดเพ, มหมวดหม, ไปท, หน, าย, อย, หน, าย, อยของมอด, ลน, local, function,. khumuxkarichnganmxdul srang khunxaccatxngkarsrangkhumuxkarichngankhxngmxdulniphuekhiynsamarththakarthdlxngidthikrabathray srang khdlxk aelachudthdsxb srang khxngmxdulnioprdephimhmwdhmuipthihnayxy doc hnayxykhxngmxdulnilocal p function standardicon modulename index Take modulename as input returns corresponding icon filename Returns default icon if no icon is defined Grow the library Add default icons as needed by adding this line below index MODULENAME FILE NAME ext index ekiywkb Information Noun 176431 svg index ekiywkbera Information Noun 176431 svg index karaecngetuxn Bell icon svg index karaecngetuxnbthkhwam Bell icon svg index karaecngetuxnbthkhwam Bell icon svg index pharthenxr Handshake noun svg index khwamrwmmux Handshake noun svg index xphipray Speechbubbles icon svg index xiewnt Simpleicons Business calendar with a clock time tools svg Is this PD shapes index aehlngkhxmulxun Link icon svg index aehlngkhxmulxun Link icon svg index lingk Link icon svg index aephnthi MapPin svg index twchiwd ArticleCheck svg index khaw Calendar icon 2 svg index aexpxxfiln Offline logo svg index suxkhawsar Cite newspaper svg index prbprunglasud Clock icon svg index prbprunglasud Clock icon svg index enuxhathiidrbkaryxmrb RibbonPrize svg index enuxhathiidrbkaryxmrb RibbonPrize svg index okhrngkarwikithiekiywkhxng Contributions icon svg Not for use for the update bot special use case that expands the page index okhrngkarwikithiekiywkhxng Contributions icon svg index karrxngkhx Quotes icon svg index karwicy Microscope icon black OCL svg index aehlngthima Cite book svg index aesdngphlngan RibbonPrize svg index pharkic ListBullet svg index ekhruxngmux Octicons tools minor svg index karaepl Translation icon svg index raykarefadu OpenEye icon svg index raykarngan ListBullet svg for t fn in pairs index do if t modulename then return fn end end return Beta icon svg default if nothing matches end function editlinktest modulename no edit links Discussions Alerts Showcase Related WikiProjects no edit link for these standard modules for l in pairs no edit links do if l modulename then return no end end return yes end function p build frame title intro image color 6af default value displaymode normal default value modules for key value in pairs frame getParent args do iterate through arguments pick out values if key title then title value elseif key intro then intro value elseif key image then image value elseif key color then color value elseif key displaymode then displaymode value elseif string find key module nil then matches module1 module2 etc id string gsub key module id tonumber id modules id value end end Rendering table of contents and body toc args width 80 height 55 passed into Image Array module toc args font size 100 toc args margin 0 body Load a Table of Contents entry transclude module for each named module counter 0 for module in pairs modules do counter counter 1 toc args image counter standardicon module toc args alt counter module if displaymode womeninred then if module Metrics or module Showcase or module About us or module Press or module Research or module External links then toc args link counter Wikipedia WikiProject Women in Red module else toc args link counter module end else toc args link counter module end toc args caption counter toc args link counter module if module Related WikiProjects then Load the appropriate subpage of Wikipedia Related WikiProjects moduletitle Related WikiProjects title moduletitle encoded string gsub Wikipedia moduletitle body body n frame expandTemplate title WPX header args module color color modulename moduletitle encoded editlink editlinktest module body body n frame expandTemplate title Wikipedia Related WikiProjects title args color else if displaymode normal or displaymode womeninred and module Metrics and module Showcase and module About us and module Press and module Research and module External links then moduletitle title module moduletitle encoded string gsub Wikipedia moduletitle body body n frame expandTemplate title WPX header args module color color modulename moduletitle encoded editlink editlinktest module if mw title makeTitle Wikipedia moduletitle exists true then body body n frame expandTemplate title Wikipedia moduletitle args color n lt div style clear both gt lt div gt else Is module in question a Standard Module If so load the template with corresponding editintro if mw title makeTitle Template WPX module module exists true then preload amp preload Template WPX module string gsub module editintro amp editintro Template WPX editintro string gsub module else preload no preload editintro amp editintro Template WPX editintro Generic generic editintro end Create notice create url en wikipedia org wiki Wikipedia string gsub moduletitle action edit preload editintro create button frame expandTemplate title Template Clickable button 2 args Create Module url create url class mw ui progressive body body Wikipedia moduletitle does not exist create button end end end end toc args perrow counter sets length of image array to the number of icons toc lt div style margin bottom 4em gt frame expandTemplate title Image array args toc args lt div gt lt div style clear both gt lt div gt Adding header header NOTOC n lt div style display flex display webkit flex flex flow row wrap webkit flex flow row wrap gt top container if displaymode womeninred then header header lt div style flex 1 0 webkit flex 1 0 border top solid 7em color gt intro else header header lt div style flex 1 0 webkit flex 1 0 padding bottom 3em border top solid 7em color gt intro end Adding project icon header header lt div class nomobile style float left margin top 1em margin right 2em margin bottom 1em text align center gt header header image lt div gt Adding project title header header lt div style font size 120 padding 0 gt header header header lt h1 style font weight bold border bottom none margin 0 padding top 0 5em gt title lt h1 gt lt div gt if displaymode womeninred then header header toc end Adding intro blurb header header lt div style margin top 1em font size 110 gt header header intro lt div gt Adding announcement section if mw title makeTitle Wikipedia title Announcements exists true then header header frame expandTemplate title Wikipedia title Announcements args end header header lt div gt Adding member box header header lt div style flex 0 1 webkit flex 0 20em gt header header frame expandTemplate title WPX member box args header header lt div gt Closing off header header header lt div gt lt div gt Assembling parts if displaymode womeninred then contents header body else contents header toc body end return contents end return p ekhathungcak https th wikipedia org w index php title mxdul Load WikiProject Modules amp oldid 7219644, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

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