Module:Edit button

From OtherX
Revision as of 13:30, 20 January 2024 by OtherXAdmin (talk | contribs) (Created page with "-- {{Helper module|name=Edit button|fname1=(text)|ftype1=string|fuse1=Creates an edit button for the current page that the module is invoked on<br><br><code>text</code> defaults to "edit"}} -- Creates a link that opens the editor screen for whatever page this module is invoked on return function(text, page) local page_title = page or mw.title.getCurrentTitle().fullText local url = tostring(mw.uri.fullUrl(page_title,'action=edit')) return '['..url..' '..(text or 'edi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Module:Edit button/doc. [edit] [history] [purge]

This module is a helper module to be used by other modules; it may not designed to be invoked directly. See RuneScape:Lua/Helper modules for a full list and more information. For a full list of modules using this helper click here

FunctionTypeUse
(text, page)string, stringCreates an edit button for page. page defaults to the current page that the module is invoked on

text defaults to "edit"

-- {{Helper module|name=Edit button|fname1=(text)|ftype1=string|fuse1=Creates an edit button for the current page that the module is invoked on<br><br><code>text</code> defaults to "edit"}}
-- Creates a link that opens the editor screen for whatever page this module is invoked on
 
return function(text, page)
	local page_title = page or mw.title.getCurrentTitle().fullText
	local url = tostring(mw.uri.fullUrl(page_title,'action=edit'))
	return '['..url..' '..(text or 'edit')..']'
end