Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Module:Toolbar

Permanently protected module
From Wikipedia, the free encyclopedia
Module documentation[view] [edit] [history] [purge]
WarningThis Lua module is used in system messages, and onapproximately 1,460,000 pages, or roughly 2% of all pages.
Changes to it can cause immediate changes to the Wikipedia user interface.
To avoid major disruption and server load, any changes should be tested in the module's/sandbox or/testcases subpages, or in your ownmodule sandbox. The tested changes can be added to this page in a single edit. Please discuss changes on thetalk page before implementing them.
Thismodule is rated asready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned onhelp pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed throughsandbox testing rather than repeated trial-and-error editing.
Page protectedThis module is currentlyprotected from editing.
See theprotection policy andprotection log for more details. Please discuss any changes on thetalk page; you maysubmit an edit request to ask anadministrator to make an edit if it isuncontroversial or supported byconsensus. You may alsorequest that this page be unprotected.
This module depends on the following other modules:

This module implements{{toolbar}}. Please see the template page for documentation.

See also

The abovedocumentation istranscluded fromModule:Toolbar/doc.(edit |history)
Editors can experiment in this module'ssandbox(edit |diff) andtestcases(edit |run) pages.
Subpages of this module.

-- This module implements {{toolbar}}.localmArguments-- Lazily initialise [[Module:Arguments]]localmTableTools=require('Module:TableTools')localyesno=require('Module:Yesno')localp={}functionp.main(frame)mArguments=require('Module:Arguments')localargs=mArguments.getArgs(frame)returnp._main(args)endfunctionp._main(args)localtoolbarItems=p.makeToolbarItems(args)ifnottoolbarItemsthen-- Return the blank string if no arguments were specified, rather than-- returning empty brackets.return''elseifyesno(args.span)==falsethenreturnstring.format('(%s)',toolbarItems)elsereturnstring.format('<span class="plainlinks%s"%s>(%s)</span>',type(args.class)=='string'and' '..args.classor'',type(args.style)=='string'andstring.format(' style="%s"',args.style)or'',toolbarItems)endendfunctionp.makeToolbarItems(args)localnums=mTableTools.numKeys(args)localsep=(args.separatoror'pipe')..'-separator'sep=mw.message.new(sep):plain()localret={}fori,vinipairs(nums)doret[#ret+1]=mw.ustring.gsub(args[v],"%[%[::+(.-)%]%]","[[:%1]]")endif#ret>0thenreturntable.concat(ret,sep)elsereturnnilendendreturnp
Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:Toolbar&oldid=885216335"
Category:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp