FANDOM


-- <pre>
 
--[=[
 
{{navbox
 | title = Foo
 | 1:text =
  * foo
  * bar
 
 | 2:title = Foo
 | 2:text =
  * foo
  * bar
  * baz
 
 | 3:title = Foo
 | 3:text =
  {{navrow
   | 1:title = 
   | 1:text =
  }}
 
]=]
 
local p = {}
 
-- formats lists so it doesn't break when passed to :wikitext()
local function format_li( list )
    return list
end
 
-- access point for {{navbox}}
function p.box( frame )
 
    args = frame:getParent().args
 
    -- ideally this would be a nav tag, but wikitext doesn't accept those
    local nav = mw.html.create( 'div' )
        :addClass( 'navigation' )
 
    for i = 1, 10 do
        if args[i .. ':title'] then
            nav
                :tag( 'ul' )
                    :tag( 'li' )
                        :wikitext( args[i .. ':title'] )
                        :tag( 'ul' )
        end
 
        if args[i .. ':text'] then
            nav
                :wikitext( format_li( args[i .. ':text'] ) )
                :allDone()
        else
            break
        end
    end
 
end
 
-- access point for {{navrow}}
function p.row( frame )
end
 
function p.nat_test( frame )
    return frame:preprocess( '{{Exchange:Nature rune/test|View=price}}' )
end
 
function p.frame_test( frame )
    local mwFrame = mw.getCurrentFrame()
    local pFrame = frame:getParent()
 
    if pFrame == nil then
        return '#invoke'
    end
 
    return 'args'
end
 
function p.load( frame )
    local noErr, data = pcall( frame.expandTemplate, frame, {title='GEP', args={'Does not exist'}} )
    return data
end
 
 
return p

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.