{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) app.plugin.archive.add(url) return url end end} {if items and #items > 0 then for i,v in pairs(items) do if #v.thumbnail > 0 then print('\t') end end end} {if 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 item then print([[ ]]) else local room = app.opts.plugin_janusxr_portalroom if item and item.janusxr and item.janusxr.room then room = item.janusxr.room end if room == 'random' then room = app.plugin.janusxr.getRandomRoom() end print(' ') end} {if true then function addPortal(id,x,v,url,i,z,thumb,rotation,scale) local title = v.title local maxchar = 20 if #title > maxchar then title = title:sub(0,maxchar) .. '..' end 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 item and 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 item and 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 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} ${janusxr_jml_deco} ${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}