Content deleted Content added
style cleanups; no substantive change |
work with refactored Module:Weather box |
||
Line 1:
local math_mod = require('Module:Math')
local traceText
Line 150 ⟶ 148:
end
local function getInputs(
local month_names = { 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'year' }
Line 158 ⟶ 156:
for i, mon in ipairs(month_names) do
if include_space then
str =
else
str =
end
values[i] = Value.new(str)
Line 169 ⟶ 167:
for var, suf in ipairs(suffix) do
if include_space then
str =
else
str =
end
if str ~= nil and str ~= '' then
Line 300 ⟶ 298:
end
local function
local
local mode = (definition.mode or 'basic'):lower()
local group_name =
local first_values, second_values
local color_values
local color_scheme =
local scale_factor = math_mod._cleanNumber(
local date_mode = checkFlag(
local label =
local annual_mode = (
local include_space = checkFlag(
local second_line = checkFlag(
local prefer_cm = checkFlag(
local imperial_first = checkFlag( args['imperial first'] )
local
local
▲ local trace = pframe.args.trace
if trace and trace ~= '' then
traceText = trace
Line 325 ⟶ 323:
end
if mode == 'basic' then
first_values = getInputs(
second_values = nil
elseif mode == 'temperature' then
first_values = getInputs(
second_values = getInputs(
reconcileTemperature(
elseif mode == "precipitation" then
first_values = getInputs(
second_values = getInputs(
reconcilePrecipitation(
else
error('Requested mode not recognized')
Line 379 ⟶ 377:
first_values, second_values = second_values, first_values
end
if not
if second_line and second_values ~= nil then
first_values = second_values
Line 388 ⟶ 386:
end
local function buildRow(frame)
return p▼
return _buildRow(frame.args, frame:getParent().args) -- row definition, template parameters
end
buildRow = buildRow,
_buildRow = _buildRow,
}
|