Module:Search/sandbox: Difference between revisions

Content deleted Content added
move over to https
use module to keep classes in a certain place
Line 12:
end
 
local function addlink(purl, uunabbreviated, a, t, sabbreviation)
return '[' .. url .. ' <abbr title="' .. unabbreviated .. '">' .. abbreviation ..'</abbr>]'
local item = ll:tag('li')
item:wikitext(p .. '[' .. u .. ' ')
item:tag('abbr')
:attr('title', a)
:wikitext(t)
item:wikitext(']' .. s)
end
 
Line 31 ⟶ 26:
local ret = mw.html.create('div')
:addClass('template-search')
:addClass('plainlist')
:addClass('plainlinks')
ll = ret:tag('ul')
local list1 = {
addlink('(', '//en.wikipedia.org/w/index.php?title=Special:Search&search=' .. ssenc, 'Wikipedia', 'wp', ' ')
}
if long then
addlinktable.insert(''list1, addlink('https://www.google.com/search?q=site%3Awikipedia.org+' .. ssenc, 'Wikipedia over Google', 'gwp', ' '))
end
addlinktable.insert(''list1, addlink('https://www.google.com/search?q=' .. ssenc, 'Google', 'g', ' '))
if long then
addlinktable.insert(''list1, addlink('https://www.bing.com/search?q=site%3Awikipedia.org+' .. ssenc, 'Wikipedia over Bing', 'bwp', ' '))
addlinktable.insert(''list1, addlink('https://www.bing.com/search?q=' .. ssenc, 'Bing', 'b', ' | '))
addlink('', 'https://www.britannica.com/search?nop&query=' .. ssenc, 'Encyclopaedia Britannica', 'eb', ' ')
addlink('', 'https://www.bartleby.com/cgi-bin/texis/webinator/65search?query=' .. ssenc, 'Columbia Encyclopedia', 'co', ' ')
addlink('', 'https://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.pcmag.com%2Fencyclopedia_term%2F+' .. ssenc, 'PC Magazine Encyclopedia over Google', 'gct', ' ')
addlink('', 'https://scienceworld.wolfram.com/search/index.cgi?as_q=' .. ssenc, 'World of Science', 'sw', ' ')
addlink('', 'https://archive.org/search.php?query=' .. ssenc, 'Internet Archive', 'arc', ' ')
addlink('', 'https://babel.hathitrust.org/cgi/ls?field1=ocr;q1=' .. ssenc .. ';a=srchls;lmt=ft', 'HathiTrust', 'ht', ')')
else
addlink('', 'https://www.bing.com/search?q=' .. ssenc, 'Bing', 'b', ')')
end
local list2 = long and {
addlink('', 'https://www.britannica.com/search?nop&query=' .. ssenc, 'Encyclopaedia Britannica', 'eb'), ' ')
addlink('', 'https://www.bartleby.com/cgi-bin/texis/webinator/65search?query=' .. ssenc, 'Columbia Encyclopedia', 'co'), ' ')
addlink('', 'https://www.google.com/search?q=site%3Ahttp%3A%2F%2Fwww.pcmag.com%2Fencyclopedia_term%2F+' .. ssenc, 'PC Magazine Encyclopedia over Google', 'gct'), ' ')
addlink('', 'https://scienceworld.wolfram.com/search/index.cgi?as_q=' .. ssenc, 'World of Science', 'sw'), ' ')
addlink('', 'https://archive.org/search.php?query=' .. ssenc, 'Internet Archive', 'arc'), ' ')
addlink('', 'https://babel.hathitrust.org/cgi/ls?field1=ocr;q1=' .. ssenc .. ';a=srchls;lmt=ft', 'HathiTrust', 'ht', ')')
} or {
addlink('', 'https://www.bing.com/search?q=' .. ssenc, 'Bing', 'b', ')')
}
local make_list = require('Module:List').makeList
itemret:wikitext('](' .. s)
:wikitext(make_list('unbulleted', list1))
item :wikitext(p .. '[' .. u .. '| ')
:wikitext(make_list('unbulleted', list2))
:wikitext(t')')
return frame:extensionTag{