Module:CRTModel: Difference between revisions

Rename buttons: "Add an accessory" → "Add accessory", "Add a part" → "Add part", "Add a document" → "Add document" (via update-page on MediaWiki MCP Server)
Remove random timestamp targets from Add Part and Add Accessory buttons — let users name pages themselves (via update-page on MediaWiki MCP Server)
Line 717: Line 717:


-- Build the add accessory link with prefilled CRT model
-- Build the add accessory link with prefilled CRT model
local accTimestamp = os.time()
math.randomseed(accTimestamp + pageId + 2)
local accRandom = math.random(1000, 9999)
local accTarget = accTimestamp .. "-" .. accRandom
local addAccessoryUrl = mw.uri.fullUrl(
local addAccessoryUrl = mw.uri.fullUrl(
"Special:FormEdit",
"Special:FormEdit",
{
{
form = "Accessory",
form = "Accessory",
target = accTarget,
["Accessory[crt_models]"] = pageName
["Accessory[crt_models]"] = pageName
}
}
Line 833: Line 828:
-- Build the add part link with prefilled CRT model
-- Build the add part link with prefilled CRT model
local partTimestamp = os.time()
math.randomseed(partTimestamp + pageId + 1)
local partRandom = math.random(1000, 9999)
local partTarget = partTimestamp .. "-" .. partRandom
local addPartUrl = mw.uri.fullUrl(
local addPartUrl = mw.uri.fullUrl(
"Special:FormEdit",
"Special:FormEdit",
{
{
form = "Part",
form = "Part",
target = partTarget,
["Part[crt_models]"] = pageName
["Part[crt_models]"] = pageName
}
}
MediaWiki Appliance - Powered by TurnKey Linux