Module:AVDevice: 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 528: Line 528:


-- Build the add accessory link with prefilled AV device
-- Build the add accessory link with prefilled AV device
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[av_devices]"] = pageName
["Accessory[av_devices]"] = pageName
}
}
Line 643: Line 638:
-- Build the add part link with prefilled AV device
-- Build the add part link with prefilled AV device
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[av_devices]"] = pageName
["Part[av_devices]"] = pageName
}
}
MediaWiki Appliance - Powered by TurnKey Linux