Jump to content

Module:Search and Module:Search/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
 
remove that bit about a middle
 
Line 1: Line 1:
-- This module implements {{search}}
local p = {}
local p = {}


Line 26: Line 27:
local search_phrase_encoded = urlencode(args[1] or 'example phrase')
local search_phrase_encoded = urlencode(args[1] or 'example phrase')
local short_module_args = {
local short_module_args = {
class = 'template-search plainlinks',
class = 'template-search-sand plainlinks',
make_link('https://en.wikipedia.org/w/index.php?title=Special:Search&search=' .. search_phrase_encoded, 'Wikipedia', 'wp'),
make_link('//en.wikipedia.org/w/index.php?title=Special:Search&search=' .. search_phrase_encoded, 'Wikipedia', 'wp'),
make_link('https://www.google.com/search?q=' .. search_phrase_encoded, 'Google', 'g'),
make_link('https://www.google.com/search?q=' .. search_phrase_encoded, 'Google', 'g'),
make_link('https://www.bing.com/search?q=' .. search_phrase_encoded, 'Bing', 'b'),
make_link('https://www.bing.com/search?q=' .. search_phrase_encoded, 'Bing', 'b'),
}
}
local long_module_args = {
local long_module_args = {
class = 'template-search plainlinks',
class = 'template-search-sand plainlinks',
make_link('https://en.wikipedia.org/w/index.php?title=Special:Search&search=' .. search_phrase_encoded, 'Wikipedia', 'wp'),
make_link('//en.wikipedia.org/w/index.php?title=Special:Search&search=' .. search_phrase_encoded, 'Wikipedia', 'wp'),
make_link('https://www.google.com/search?q=site%3Awikipedia.org+' .. search_phrase_encoded, 'Wikipedia over Google', 'gwp'),
make_link('https://www.google.com/search?q=site%3Awikipedia.org+' .. search_phrase_encoded, 'Wikipedia over Google', 'gwp'),
make_link('https://www.google.com/search?q=' .. search_phrase_encoded, 'Google', 'g'),
make_link('https://www.google.com/search?q=' .. search_phrase_encoded, 'Google', 'g'),
Line 50: Line 51:
local list = ubl(long and long_module_args or short_module_args)
local list = ubl(long and long_module_args or short_module_args)
return frame:extensionTag{
return frame:extensionTag{
name = 'templatestyles', args = { src = 'Module:Search/styles.css' }
name = 'templatestyles', args = { src = 'Module:Search/sandbox/styles.css' }
} .. '(' .. list .. ')'
} .. '(' .. list .. ')'
end
end