Content deleted Content added
style cleanups; no substantive change |
restore version at 03:00, 1 June 2023 to remove temporary tests |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1:
local math_mod = require('Module:Math')
local wbc = require('Module:Weather box/colors')▼
local traceText
Line 127 ⟶ 125:
local result = {'|- style="text-align: center;"\n! scope="row" style="height: 16px;" | ', label, "\n"}
for i = 1, 13 do
table.insert(result,
' class="notheme"| '
)
end▼
local display = first_values[i]:getDisplay()
if display then
Line 150 ⟶ 147:
end
local function getInputs(
local month_names = { 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'year' }
Line 158 ⟶ 155:
for i, mon in ipairs(month_names) do
if include_space then
str =
else
str =
end
values[i] = Value.new(str)
Line 169 ⟶ 166:
for var, suf in ipairs(suffix) do
if include_space then
str =
else
str =
end
if str ~= nil and str ~= '' then
Line 248 ⟶ 245:
if F_values[i]:isValid() then
p = F_values[i]:getPrecision()
C_values[i]:setNumberRounded(
end
elseif F_values[i].string == '' then
if C_values[i]:isValid() then
p = C_values[i]:getPrecision()
F_values[i]:setNumberRounded(
end
end
Line 300 ⟶ 297:
end
local function
options = options or {}
local mode = (frame.args.mode or 'basic'):lower()▼
▲ local wbc = require('Module:Weather box/colors' .. (options.sandbox or ''))
local group_name = frame.args.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
buildRow = buildRow,
_buildRow = _buildRow,
}
|