Home
Random
Log in
Settings
About OtherX
Disclaimers
Search
Editing
Module:Top icons
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local sites = { rsc = { format = 'The RuneScape Classic Wiki also has an article on: [[classicrsw:%s]]', params = { 'rsc' }, abbr = 'CS', title = 'The RuneScape Classic Wiki also has an article on %s.', }, rs = { format = 'The RuneScape Wiki also has an article on: [[rsw:%s]]', params = { 'rs' }, abbr = 'RuneScape', title = 'The RuneScape Wiki also has an article on %s.', }, wp = { format = 'Wikipedia also has an article on: [[wikipedia:%s]]', params = { 'wp' }, abbr = 'Wikipedia', title = 'Wikipedia also has an article on %s.', }, meta = { format = '[[meta:%s]]', params = { 'meta' }, abbr = 'Weird Gloop', title = 'The Weird Gloop meta wiki also has an article on %s.', }, } local order = { 'rs', 'rsc', 'wp', 'meta' } local allparams = {} function p.main(frame) local args = frame:getParent().args return p._main(args) end function p._main(args) local pagename = mw.title.getCurrentTitle().fullText local vals = {} -- create allparams for s,t in pairs(sites) do for _,v in ipairs(t.params) do allparams[v] = s end end -- loop named params for i,v in pairs(allparams) do if args[i] and not vals[v] then vals[v] = args[i] end end -- loop unnamed params local i = 1 local v while args[i] do v = allparams[args[i]] if v and not vals[v] then vals[v] = pagename end i = i + 1 end local ret = mw.html.create('div') ret:addClass('noexcerpt noprint nomobile navigation-not-searchable rs-external-header-links'):css('display', 'none') for _,v in ipairs(order) do if vals[v] then local span = ret:tag('span') span:wikitext(string.format(sites[v].format, vals[v])) :addClass('rs-header-icon rs-header-icon-'..v) :attr({ ['data-title'] = string.format(sites[v].title, vals[v]), ['data-site'] = v, ['data-text'] = sites[v].abbr, }) end end return tostring(ret) end return p
Summary:
Please note that all contributions to OtherX may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
OtherX:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Documentation
(
edit
)
Template:Helper module
(
edit
)
Module:Array
(
edit
)
Module:DPLlua
(
edit
)
Module:DependencyList
(
edit
)
Module:Documentation
(
edit
)
Module:Helper module
(
edit
)
Module:Mw.html extension
(
edit
)
Module:Paramtest
(
edit
)
Module:Tooltip
(
edit
)
Module:Top icons
(
edit
)
Module:Top icons/doc
(
edit
)
Module:Yesno
(
edit
)
This page is a member of a hidden category:
Category:Pages with broken file links