2026-08-02 22:39:29 +02:00
|
|
|
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)
|
|
|
|
|
|
2026-08-04 12:17:33 +02:00
|
|
|
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)
|
2026-08-02 22:39:29 +02:00
|
|
|
|
|
|
|
|
local plugin = {
|
2026-08-04 12:17:33 +02:00
|
|
|
name = 'Federation',
|
|
|
|
|
info = 'Add links to other (janus)XR(forges), and have them show up as extra portals in portalrooms',
|
2026-08-02 22:39:29 +02:00
|
|
|
opts = { -- TODO populate this based on xrforge-federation.json
|
2026-08-04 12:17:33 +02:00
|
|
|
{
|
|
|
|
|
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'}
|
|
|
|
|
},
|
2026-08-02 22:39:29 +02:00
|
|
|
{
|
2026-08-03 19:19:07 +02:00
|
|
|
key='app.opts.plugin_federation_url_1',
|
2026-08-04 12:17:33 +02:00
|
|
|
title='Federated URL 1',
|
|
|
|
|
info="URL + Thumbnail URL (space separated)",
|
|
|
|
|
default="https://xrforge.isvery.ninja https://i.imgur.com/x7fzn9v.png",
|
2026-08-03 19:19:07 +02:00
|
|
|
values=''
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key='app.opts.plugin_federation_url_2',
|
2026-08-04 12:17:33 +02:00
|
|
|
title='Federated URL 2',
|
|
|
|
|
info="URL + Thumbnail URL (space separated)",
|
|
|
|
|
default="https://www.janusxr.org/new/ https://archive.org/download/janusxr-1/janusxr.png",
|
2026-08-03 19:19:07 +02:00
|
|
|
values=''
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key='app.opts.plugin_federation_url_3',
|
2026-08-04 12:17:33 +02:00
|
|
|
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)",
|
2026-08-03 19:19:07 +02:00
|
|
|
default="",
|
|
|
|
|
values=''
|
2026-08-02 22:39:29 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-03 19:19:07 +02:00
|
|
|
-- this registers the plugin UI
|
2026-08-02 22:39:29 +02:00
|
|
|
return plugin
|