Module:Coordinates: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
imported>Sukanthi
"--[[ This module is intended to replace the functionality of {{Coord}} and related templates. It provides several methods, including {{#invoke:Coordinates | coord }} : General function formatting and displaying coordinate values. {{#invoke:Coordinates | dec2dms }} : Simple function for converting decimal degree values to DMS format. {{#invoke:Coordinates | dms..."-இப்பெயரில் புதிய பக்கம் உருவாக்கப்பட்டுள்ளது
No edit summary
 
(3 பயனர்களால் செய்யப்பட்ட 6 இடைப்பட்ட திருத்தங்கள் காட்டப்படவில்லை.)
வரிசை 1:
--[[
This module is changed from original don't edit
 
This module is intended to replace the functionality of {{Coord}} and related
templates. It provides several methods, including
வரி 24 ⟶ 26:
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = 'https://geohack.toolforge.org/geohack.php?pagename=' .. page_name .. '&params='
 
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(s, notescoords)
.. return mw.getCurrentFrame():extensionTag{
local coords = s .. notes;
name = 'indicator',
 
args = { name = 'coordinates' },
return '<!-- COORD INDICATOR START ' .. coords .. ' -->'
content = '<span id="coordinates">[[புவியியல் ஆள்கூற்று முறை|ஆள்கூறுகள்]]: ' .. coords .. '</span>'
.. mw.getCurrentFrame():extensionTag{
}
name = 'indicator',
args = { name = 'coordinates' },
content = '<span id="coordinates">[[புவியியல் ஆள்கூற்று முறை|ஆள்கூறுகள்]]: ' .. coords .. '</span>'
}
.. '<!-- COORD INDICATOR END -->'
end
 
வரி 161 ⟶ 159:
name = 'templatestyles', args = { src = stylesheetLink }
} .. '<span class="plainlinks nourlexpansion">[' .. coord_link .. uriComponents ..
' ' .. inner .. ']</span>' .. '[[Category:Pages using gadget WikiMiniAtlas]]'
end
 
வரி 468 ⟶ 466:
else
-- Error
return errorPrinter({{"formatTest", "Unknown argument format"}}) .. '[[Categoryபகுப்பு:Pages with malformed coordinate tags]]'
end
result.name = args.name
வரி 481 ⟶ 479:
local ret = specPrinter(args, result)
if #errors > 0 then
ret = ret .. ' ' .. errorPrinter(errors) .. '[[Categoryபகுப்பு:Pages with malformed coordinate tags]]'
end
return ret, backward
வரி 644 ⟶ 642:
end
 
local function coord_wrapper(in_args)
-- Calls the parser function {{#coordinates:}}.
return local result = mw.getCurrentFrame():callParserFunction('#coordinates', in_args) or ''
if string.find(result, "The format of the coordinate could not be determined") ~= nil then
-- We wanted the #coordinates parser function from Extension:GeoData,
-- but we got the one from Extension:Maps instead :(
result = nil
end
return result or ''
end
 
local text = ''
if isInline(Display) then
text = text .. '<span class="geo-inline">' .. contents .. Notes .. '</span>'
end
if isInTitle(Display) then
-- Add to output since indicator content is invisible to Lua later on
text = text .. displaytitle(contents, Notes) .. makeWikidataCategories(args.qid)
if not isInline(Display) then
text = text .. '<span class="geo-inline-hidden noexcerpt">' .. contents .. Notes .. '</span>'
end
text = text .. displaytitle(contents, .. Notes) .. makeWikidataCategories(args.qid)
end
if not args.nosave then
வரி 687 ⟶ 695:
 
]]
function coordinates.coord2text_coord2text(framecoord,type)
if frame.args[1]coord == '' or frame.args[2]type == '' or not frame.args[2]type then return nil end
frame.args[2]type = mw.text.trim(frame.args[2]type)
if frame.args[2]type == 'lat' or frame.args[2]type == 'long' then
local result, negative = mw.text.split((mw.ustring.match(frame.args[1]coord,'[%.%d]+°[NS] [%.%d]+°[EW]') or ''), ' ')
if frame.args[2]type == 'lat' then
result, negative = result[1], 'S'
else
வரி 701 ⟶ 709:
return result[1]
else
return mw.ustring.match(frame.args[1]coord, 'params=.-_' ..frame.args[2] type .. ':(.-)[ _]')
end
end
 
function coordinates.coord2text(frame)
return coordinates._coord2text(frame.args[1],frame.args[2])
end
 
வரி 750 ⟶ 762:
end
-- replace the existing indicator with a new indicator using the modified content
-- find the in-source 'indicators' and then call displaytitle
frame.args[1] = mw.ustring.gsub(
frame.args[1],
'(<span class="geo%-inline[^"]*">(.+)</span>)\127[^\127]*UNIQ%-%-indicator%-%x+%-%-?QINU[^\127]*\127',
'<!%-%- COORD INDICATOR START (.-) %-%->.-<!%-%- COORD INDICATOR END %-%->',
function (coordsinline, coord) return inline .. displaytitle(coords, ''coord) end
)
 
"https://tamilar.wiki/w/Module:Coordinates" இலிருந்து மீள்விக்கப்பட்டது