Modulo:Interprogetto: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
Riga 10:
--Tabella di corrispondenza tra valore e file da richiamare
local prefix_links ={
wiksource = {1, 's:', 'Wikisource' },
s = {2, 's:', 'Wikisource'},
testo = {3, 's:', 'Wikisource'},
oldwikisource = {4, 'oldwikisource:', 'Wikisource'},
wikiquote = {5, 'q:', 'Wikiquote'},
q = {6, 'q:', 'Wikiquote'},
wikibooks = {7, 'wikibooks:', 'Wikibooks'},
b = {8, 'b:', 'Wikibooks'},
ricetta = {9, 'b:Libro di cucina/Ricette/', 'Ricetta<br />(Wikibooks)'},
wiktionary = {10, 'wiktionary:', 'Wikizionario'},
wikt = {11, 'wikt:', 'Wikizionario'},
v = {12, 'v:', 'Wikiversità'},
wikinews = {13, 'wikinews:', 'Wikinotizie'},
n = {14, 'n:', 'Wikinotizie'},
voy = {15, 'voy:', 'Wikivoyage'}
}
--TODO collegamenti che usano Interprogetto/CollegamentoUseLang
local function sort_by_priority(t1, t2)
if t1[1] < t2[1] then
end
end
local function RenderLeftBar()
Riga 38 ⟶ 44:
.tag('div')
.attr('title', 'Collegamenti verso gli altri progetti Wikimedia')
-- costruisce le righe per la barra di sinistra
local
for k,v in pairs(args) do
if prefix_links[k] then
priority, prefix, label = unpack(prefix_links[k])
leftbar.newline().done()▼
▲ end
▲ leftbar.wikitext('* [[' .. prefix .. v .. '|' .. label .. ']]')
end
end
table.sort(left_rows, sort_by_priority)
for priority, row in #leftbar do
end
end
Riga 73 ⟶ 79:
current_page = mw.title.getCurrentTitle().text
for k, v in pairs(origArgs) do
-- controlla se è un parametro posizionale e
-- chiave con valore pari al nome della pagina corrente
local kn = tonumber(k)
if kn then
|