{if true then showfediportals = app.opts.plugin_federation_strategy == 'always' or (app.opts.plugin_federation_strategy == 'homepage' and urlpath == '/') -- optimize janus resource URLs for archive.org app.plugin.archive.flush() function URL(url) url = util.baseURLify(url) app.plugin.archive.add(url) return url end end} {if defined(items) and #items > 0 then for i,v in pairs(items) do if #v.thumbnail > 0 then print('\t') end end end} {if defined(itemsremote) and #itemsremote > 0 then for i,v in pairs(itemsremote) do if #v.thumbnail > 0 then print('\t') end end end} {if showfediportals then for i=1,5 do local urls = app.opts[ 'plugin_federation_url_' .. i] if #urls > 0 then local fediurl = urls:gsub(' .*','') local thumburl = urls:gsub('.* ','') print('\t') end end end} {if true then local room = '' pos = '0 0 0' if not defined(item) and defined(items) then room = app.opts.plugin_janusxr_portalroom end if defined(item) and item.janusxr and item.janusxr.wrap then pos = '0 0 2' room = app.plugin.janusxr.wrapRoomAroundFile(item) end if defined(item) and item.tag.xrfragments and item.tag.xrfragments.href then room = '' -- xrfragments 3D files dont need to be wrapped with room end print(' ') if defined(item) then print(' ') end end} {if true then function addPortal(id,x,v,url,i,z,thumb,rotation,scale) local title = v.title print('\t') print('\t ') print('\t ') --TODO: fix janusweb paragraph for markdown urls --if v.README ~= nil then -- print('\t ') --end print('\t') end end} {if not defined(item) and defined(items) and #items > 0 then for i,v in pairs(items) do local width = 3.2 local center = -((#items*width)/1.3) + (i*width) local url = v.url local thumb = ' shader_id="defaultportal"' if #v.thumbnail > 0 then thumb = ' thumb_id="img' .. i .. '" ' end if v.dir then url = url .. "/" end if v.redirect then url = v.redirect end -- dont wrap standalone glb's in janusxr addPortal('dir',center, v, url,i, -4, thumb, '0 0 0', '0.2 0.2 0.2') end end} {if not defined(item) and defined(itemsremote) and #itemsremote > 0 then for i,v in pairs(itemsremote) do local width = 3.2 local center = -((#itemsremote*width)/1.3) + (i*width) local url = v.url --if url:match("://") then -- url = url .. ( url:match("#") and '&' or '#' ) .. 'janus.referrer=' .. -- EscapeFragment( util.getURL() ) --end local thumb = ' shader_id="defaultportal"' if #v.thumbnail > 0 then thumb = ' thumb_id="imgremote' .. i .. '" ' end if v.dir then url = url .. "/" end if v.redirect then url = v.redirect end -- dont wrap standalone glb's in janusxr addPortal('remote',center, v, url,i, 4, thumb, '0 180 0', '0.2 0.2 0.2') end print([[ ]]) end} {if #referrer > 0 then -- hardcoded reciprocal portal local v = { url = referrer, title = app.opts.plugin_janusxr_portal_up, } addPortal('parent',5, v, v.url, 0, 0, ' shader_id="defaultportal"', '0 -90 0', '0.2 0.2 0.2') end} {if isroot then local plugins = {} foreach(app.plugin, function(name,p) if not tostring(name):match("[0-9]") then table.insert(plugins,name) end end) local embedsrc = EscapeFragment( "config\n======\n" .. util.dump({ plugins = plugins, host = app.host, protocol = app.scheme, convert_assimp_filetypes_in = app.opts.plugin_convert_assimp_filetypes_in, convert_assimp_filetypes_out = app.opts.plugin_convert_assimp_filetypes_out, janusxr_portalroom = app.opts.plugin_janusxr_wrap_video, janusxr_wrap_3dfile = app.opts.plugin_janusxr_wrap_3dfile, janusxr_wrap_video = app.opts.plugin_janusxr_wrap_video, janusxr_wrap_aframe = app.opts.plugin_janusxr_wrap_aframe, janusxr_janusweb_corsproxies = util.split("https://p.janusxr.org https://cors.xrforge.org"," ") }) ) print([[ ]]) end} {if not defined(item) then print('${janusxr_jml_deco}') end} ${opts.plugin_janusxr_jml} {if #app.plugin.archive.url > 0 then print('') print("
") for k,url in pairs(app.plugin.archive.url) do print(' ') end print("
") end}