accept URL from cli for lovr/love
13
README.md
|
|
@ -4,10 +4,13 @@ Download/run the binaries for your platform in the releases section.<br>
|
|||
Developers can run it via [LÖVR](https://lovr.org) or [LÖVE2D](https://love2d.org)
|
||||
|
||||
```
|
||||
$ love src # if you have LÖVE2D installed (>v12)
|
||||
$ lovr src # if you have LÖVR installed
|
||||
-- ./lovr xurfer https://snips.sh/f/_U5-XctEVE?r=1' -- cube, monkey, scene
|
||||
$ love xurfer <url> # if you have LÖVE2D installed (>v12)
|
||||
$ lovr xurfer <url> # if you have LÖVR installed
|
||||
```
|
||||
|
||||
**Example**: lovr xurfer <a href="https://snips.sh/f/_U5-XctEVE?r=1">https://snips.sh/f/_U5-XctEVE?r=1</a>
|
||||
|
||||
## Multiplatform Multimodal XR Browser
|
||||
|
||||
The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.isvery.ninja) codebase** which gracefully degrades to handheld/embedded/braille devices:
|
||||
|
|
@ -28,9 +31,9 @@ The aim of this project is providing **one [XR Hypermedia browser](https://xrhf.
|
|||
So you can strip/bloat however you want, or build one yourself:
|
||||
|
||||
```
|
||||
$ cp src/ext/skeleton src/ext/myextension
|
||||
$ sed 's|skeleton|myextension|g' src/ext/myextension/*
|
||||
$ ./lovr src
|
||||
$ cp xurfer/ext/skeleton xurfer/ext/myextension
|
||||
$ sed 's|skeleton|myextension|g' xurfer/ext/myextension/*
|
||||
$ ./lovr xurfer
|
||||
[i] loading 'myextension'
|
||||
...
|
||||
```
|
||||
|
|
|
|||
6
api.md
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
<pre>
|
||||
<a href="">api</a>
|
||||
<a href="src/lib/json.lua">api.parser.json</a>
|
||||
<a href="xurfer/lib/json.lua">api.parser.json</a>
|
||||
<a href="#api-parser-xml">api.parser.xml</a>
|
||||
<a href="src/lib/url.lua">api.url</a>
|
||||
<a href="src/util.lua">api.util</a>
|
||||
<a href="xurfer/lib/url.lua">api.url</a>
|
||||
<a href="xurfer/util.lua">api.util</a>
|
||||
<a href="">api.protocol</a>
|
||||
<a href="#api-ext">api.ext.*</a>
|
||||
<a href="#api-ext-exec">api.ext.exec(fn, ,..)</a>
|
||||
|
|
|
|||
45
src/main.lua
|
|
@ -1,45 +0,0 @@
|
|||
local util = require("util")
|
||||
local ecs = require("ecs")
|
||||
|
||||
api = {
|
||||
parser = {
|
||||
json = require("json"),
|
||||
xml = require("xmlSimple"),
|
||||
},
|
||||
url = require("url"),
|
||||
util = require("util"),
|
||||
ecs = ecs,
|
||||
world = ecs.world(),
|
||||
protocol = {},
|
||||
ext = { -- all extensions are loaded here from disk at runtime
|
||||
exec = function(...) util.exec(api.ext,...) end -- util function to call func on each extension
|
||||
}
|
||||
}
|
||||
|
||||
local runtime
|
||||
local runtimepath
|
||||
|
||||
if lovr ~= nil then runtime = { path = "lovr", api = lovr } end
|
||||
if love ~= nil then runtime = { path = "love", api = love } end
|
||||
|
||||
api = util.merge( api, runtime.api )
|
||||
|
||||
require( runtime.path .. "/main")
|
||||
|
||||
util.loaddir( "ext", api, api.ext )
|
||||
util.loaddir( "media", api, api.media )
|
||||
ecs.init()
|
||||
api.ext.exec('init')
|
||||
|
||||
-- GLB URLS
|
||||
--local url='https://coderofsalvation.codeberg.page/xrfragment-haxe/example/assets/example.glb?bar=1&f=2#foo'
|
||||
--local url = 'https://codeberg.org/coderofsalvation/xrfragment/raw/branch/main/assets/template/website/website.glb'
|
||||
--local url = 'https://codeberg.org/coderofsalvation/xrfragment/raw/branch/main/assets/simple-a.glb'
|
||||
--local url = 'https://xrforge.isvery.ninja/models/zzswz4qlqw8w/model_files/test.xrf.glb'
|
||||
--
|
||||
-- JANUS JML URLS
|
||||
--local url = 'https://janusxr.org/index.html'
|
||||
--local url = 'https://snips.sh/f/rHFLg-cewi?r=1' -- cube
|
||||
local url = 'https://snips.sh/f/_U5-XctEVE?r=1' -- cube, monkey, scene
|
||||
|
||||
api.ecs.add( api.world, { URI = { url = url, method = 'GET', target = '_top' } })
|
||||
|
|
@ -1,12 +1,14 @@
|
|||
local api = ...
|
||||
|
||||
local sample = require "sample"
|
||||
|
||||
local sample
|
||||
|
||||
return {
|
||||
name = "kitchensink",
|
||||
enabled = false,
|
||||
enabled = (lover ~= nil),
|
||||
|
||||
init = function() end,
|
||||
init = function()
|
||||
sample = require "sample"
|
||||
end,
|
||||
|
||||
update = function()
|
||||
local iui = api.iui
|
||||
|
Before Width: | Height: | Size: 638 KiB After Width: | Height: | Size: 638 KiB |
|
Before Width: | Height: | Size: 310 KiB After Width: | Height: | Size: 310 KiB |
|
Before Width: | Height: | Size: 684 KiB After Width: | Height: | Size: 684 KiB |
|
Before Width: | Height: | Size: 663 KiB After Width: | Height: | Size: 663 KiB |
|
Before Width: | Height: | Size: 782 KiB After Width: | Height: | Size: 782 KiB |
|
Before Width: | Height: | Size: 708 KiB After Width: | Height: | Size: 708 KiB |
|
|
@ -1,3 +1,9 @@
|
|||
api.protocol.http = {
|
||||
request = function(url,opts)
|
||||
print("[!] todo: love2D/lua api.protocol.http needs curl/wget fallback")
|
||||
end
|
||||
}
|
||||
|
||||
-- Load some default values for our rectangle.
|
||||
function love.load()
|
||||
x, y, w, h = 20, 20, 60, 20
|
||||
0
src/lovr/.gitignore → xurfer/lovr/.gitignore
vendored
|
Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 175 KiB |
|
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
|
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 617 B After Width: | Height: | Size: 617 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |