80 lines
2 KiB
Lua
80 lines
2 KiB
Lua
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)
|
|
|
|
-- this registers the plugin UI
|
|
local plugin = {
|
|
name = "Global settings",
|
|
info = '',
|
|
ext = {"mp3","wav","ogg","mp4","vtt","md","html","jml","jpg","png","svg"},
|
|
opts = {
|
|
{
|
|
key='app.opts.plugin_global_title',
|
|
title='Title',
|
|
info='Preferably dot-style domain-notation for easy recollection',
|
|
default = "xrforge",
|
|
values=''
|
|
},
|
|
{
|
|
key='app.opts.plugin_global_subtitle',
|
|
title='Subtitle',
|
|
info='Slogan here',
|
|
default = "Portable XR experiences for Phone, VRheadset & desktop.",
|
|
values=''
|
|
},
|
|
{
|
|
key='app.opts.plugin_global_topmenu_mapname',
|
|
title='Overview link',
|
|
info='Top-right link <img class="icon list-tree" src="/img/list-tree.svg"> (overview page)',
|
|
default = "map",
|
|
values=''
|
|
},
|
|
{
|
|
key='app.opts.plugin_global_homepage',
|
|
title='Homepage',
|
|
info='Display 3D or 2D experiences on homepage',
|
|
default = "3D",
|
|
values={ ['3D'] = '3D', ['2D'] = '2D' },
|
|
},
|
|
{
|
|
key='app.opts.plugin_global_topmenu_html',
|
|
title='Menu html',
|
|
info='Add extra menu items here',
|
|
default = '<a href="/about">about</a>',
|
|
control='textarea',
|
|
values=''
|
|
},
|
|
{
|
|
key='app.opts.plugin_global_headertags',
|
|
title='Header html',
|
|
info='Add extra header tags here',
|
|
default = [[
|
|
<!--
|
|
<link rel="stylesheet" type="text/css" href="https://my.org/foo.css" media="all" />
|
|
-->
|
|
]],
|
|
control='textarea',
|
|
values=''
|
|
},
|
|
},
|
|
middleware = {
|
|
homepage_2D_or_3D = function(req,res,next)
|
|
if (app.opts.plugin_global_homepage == '3D') or (req.param.view == '3D') or (req.param.url) then
|
|
res.template = 'page/index.html'
|
|
else
|
|
res.template = 'page/dir.html'
|
|
end
|
|
next()
|
|
end
|
|
}
|
|
}
|
|
|
|
return plugin
|