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..."-இப்பெயரில் புதிய பக்கம் உருவாக்கப்பட்டுள்ளது |
imported>Sukanthi No edit summary |
||
வரிசை 16:
]]
require('
local math_mod = require("Module:Math")
local coordinates = {};
local current_page = mw.title.getCurrentTitle()
local page_name = mw.uri.encode( current_page.prefixedText, 'WIKI' );
local coord_link = '//geohack.toolforge.org/geohack.php?pagename=' .. page_name .. '¶ms='
local templatestyles = 'Module:Coordinates/styles.css'
--[[ Helper function, replacement for {{coord/display/title}} ]]
local function displaytitle(s, notes)
local l = "[[Geographic coordinate system|Coordinates]]: " .. s
local coords = s .. notes;▼
local co = '<span id="coordinates">' .. l .. notes .. '</span>';
return '<span style="font-size: small;">' .. co .. '</span>';
end
--[[ Helper function, Replacement for {{coord/display/inline}} ]]
local function displayinline(s, notes)
end
வரி 70 ⟶ 69:
local result = ""
for i,v in ipairs(errors) do
result = result .. errorHTML .. "<br />"
end
return result
வரிசை 157:
end
return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = templatestyles} }▼
▲ return mw.getCurrentFrame():extensionTag{
.. '[' .. coord_link .. uriComponents .. ' ' .. inner .. ']'
▲ } .. '<span class="plainlinks nourlexpansion">[' .. coord_link .. uriComponents ..
▲ ' ' .. inner .. ']</span>'
end
வரி 634 ⟶ 633:
local Display = args.display and args.display:lower() or 'inline'
local function isInline(s)
-- Finds whether coordinates are displayed inline.
வரி 651 ⟶ 649:
local text = ''
if isInline(Display) then
text = text .. displayinline(contents
end
if isInTitle(Display) then
text = text
text = text .. displaytitle(contents, Notes) .. makeWikidataCategories(args.qid)▼
.. displaytitle(contents, Notes)
end
if not args.nosave then
வரிசை 719:
]]
function coordinates.coordinsert(frame)
for i, v in ipairs(frame.args) do
if i ~= 1 then
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ')
end
வரி 732 ⟶ 727:
end
if frame.args.name then
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none"> (<span class="fn org">' .. namestr .. '</span>)</span></span>%3')
frame.args[1] = mw.ustring.gsub(frame.args[1], '(¶ms=[^&"<>%[%] ]*) ', '%1&title=' .. mw.uri.encode(namestr) .. ' ')
end
end
return frame.args[1]
end
| |||