local util = require('util') app.on('scan_experience', function(exp) --print_r(exp) end) app.on('scan_experience_file', function(exp) end) app.on('set', function(k,v) end) app.on('dir', function(opts) local me = app.plugin.federation if opts.urlpath == '/' then print_r(me.portals) --foreach( me.portals, function(k,portal) -- print("JAAA") -- table.insert( opts.data.items,{ -- url = portal.url, -- name = portal.name, -- thumbnail = portal.thumbnail -- }) --end) end end) local plugin = { name = 'Federation', info = 'Add links to other (janus)XR(forges), and have them show up as extra portals in portalrooms', opts = { -- TODO populate this based on xrforge-federation.json { key='app.opts.plugin_federation_title', title='Title', info="Displayed above federated portals", default="Federated neighbourhoods", values='' }, { key='app.opts.plugin_federation_strategy', title='Display portals', info="When to show federated portals?", default="always", values={always='always',homepage='only homepage'} }, { key='app.opts.plugin_federation_url_1', title='Federated URL 1', info="URL + Thumbnail URL (space separated)", default="https://xrforge.isvery.ninja https://i.imgur.com/x7fzn9v.png", values='' }, { key='app.opts.plugin_federation_url_2', title='Federated URL 2', info="URL + Thumbnail URL (space separated)", default="https://www.janusxr.org/new/ https://archive.org/download/janusxr-1/janusxr.png", values='' }, { key='app.opts.plugin_federation_url_3', title='Federated URL 3', info="URL + Thumbnail URL (space separated)", default="", values='' }, { key='app.opts.plugin_federation_url_4', title='Federated URL 4', info="URL + Thumbnail URL (space separated)", default="", values='' }, { key='app.opts.plugin_federation_url_5', title='Federated URL 5', info="URL + Thumbnail URL (space separated)", default="", values='' } } } -- this registers the plugin UI return plugin