Fandom

Reincarnator Wikia

Module:Polyfill

137pages on
this wiki
Add New Page
Talk0
-- <pre>
--------------------------------------------------------------------------------
-- Copied from http://figverse.wikia.com/wiki/Module:Polyfill?action=edit
--
-- Wikia currently uses MediaWiki version 1.19.20, which lacks some modern
-- features. This module aims to fill those gaps until Wikia updates their
-- software.
--------------------------------------------------------------------------------
local polyfill = {}
 
--------------------------------------------------------------------------------
-- The {{PAGEID}} magic word requires MediaWiki version 1.20 or higher.
-- Implemented by [[Template:PAGEID]].
--------------------------------------------------------------------------------
function polyfill.PAGEID()
    return mw.title.getCurrentTitle().id
end
 
--------------------------------------------------------------------------------
-- The {{ROOTPAGENAME}} magic word requires MediaWiki version 1.22 or higher.
-- Implemented by [[Template:ROOTPAGENAME]].
--------------------------------------------------------------------------------
function polyfill.ROOTPAGENAME()
    return mw.title.getCurrentTitle().rootText
end
 
--------------------------------------------------------------------------------
-- The {{ROOTPAGENAMEE}} magic word requires MediaWiki version 1.22 or higher.
-- Implemented by [[Template:ROOTPAGENAMEE]].
--------------------------------------------------------------------------------
function polyfill.ROOTPAGENAMEE()
    local foo = mw.title.getCurrentTitle().rootText
    local bar = mw.uri.encode(foo, "WIKI")
 
    return mw.text.nowiki(bar)
end
 
--------------------------------------------------------------------------------
-- The {{NAMESPACENUMBER}} magic word requires MediaWiki version 1.20 or higher.
-- Implemented by [[Template:NAMESPACENUMBER]].
--------------------------------------------------------------------------------
function polyfill.NAMESPACENUMBER()
    return mw.title.getCurrentTitle().namespace
end
 
-- </pre>
--------------------------------------------------------------------------------
-- End script.
--
-- [[Category:Templates]]
--------------------------------------------------------------------------------
return polyfill

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.