Modul:UserLinks: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Tidak ada ringkasan suntingan |
Uji |
||
Baris 12:
local mArguments -- [[Modul:Arguments]]
local mToolbar -- [[Modul:Toolbar]]
local mCategoryHandler -- [[
local mTableTools -- [[Modul:TableTools]]
local interwikiTable -- [[Modul:InterwikiTable]], loaded with mw.loadData
Baris 38:
-- indexed. This is made possible by the metatable and by the various link
-- functions, some of which are defined here, and some of which are defined
-- at [[
--]=]
local links, linkFunctions = {}, {}
Baris 48:
-- data snippets. New link functions should be added below the existing
-- functions.
----------------------------------------------------------------------------
Baris 81 ⟶ 78:
message('display-contributions')
)
end
function linkFunctions.c64(snippets)
-- Contributions
local first64 = snippets.username:match('^%x+:%x+:%x+:%x+:')
or snippets.username:match('^%x+:%x+:%x+:')
or snippets.username:match('^%x+:%x+:')
or snippets.username:match('^%x+:')
return first64 and makeWikilink(
snippets.interwiki,
-1,
'Contribs/' .. first64 .. ':/64',
'(/64)'
) or ''
end
Baris 87 ⟶ 98:
return makeUrlLink(
{
host = '
path = '/
query = {
project = snippets.toolLang .. '.' .. snippets.projectLong .. '.org'
}
Baris 115 ⟶ 126:
'Log/' .. snippets.username,
message('display-logs')
)
end
function linkFunctions.ae(snippets)
-- Automated edits (and non-automated contributions).
return makeUrlLink(
{
host = 'xtools.wmflabs.org',
path = '/autoedits/',
query = {
project = snippets.toolLang .. '.' .. snippets.projectLong .. '.org'
}
},
message('display-autoedits')
)
end
Baris 183 ⟶ 209:
return makeUrlLink(
{
host = '
path = '
query = {
▲ wiki = snippets.projectLong
}
},
Baris 615 ⟶ 640:
return snippets
end
function p.validateProjectCode(s)
Baris 623 ⟶ 648:
-- returns nil for both.
interwikiTable = interwikiTable or mw.loadData('Module:InterwikiTable')
end
end
Baris 813 ⟶ 838:
ret[#ret + 1] = '|}'
return table.concat(ret, '\n')
end
return p
|