Toggle navigation
Toggle navigation
This project
Loading...
Sign in
arcs
/
arcs.js
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
3
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Yves Didier
2021-12-15 17:22:14 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1a82d944c51b918bf00a03a422662ea5a984613
f1a82d94
1 parent
b57e28c9
setup ui mapper
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
14 deletions
components/geolocator.js
components/positionwidget.js
components/uimapper.js
src/invocation.js
tests/geoloc/arcsapp.json
tests/geoloc/geoloc.html
components/geolocator.js
View file @
f1a82d9
This diff is collapsed. Click to expand it.
components/positionwidget.js
View file @
f1a82d9
/***
* @deprecated
* @see UIMapper
*
*/
arcs_module
(
function
(
ARCS
)
{
var
PositionWidget
;
...
...
@@ -25,4 +32,4 @@ arcs_module(
return
{
PositionWidget
:
PositionWidget
};
}
);
\ No newline at end of file
);
...
...
components/uimapper.js
View file @
f1a82d9
...
...
@@ -16,7 +16,7 @@ UIMapper = ARCS.Component.create(
eltField
=
eltField
[
fields
[
i
]];
}
let
value
=
arguments
[
params
[
0
]];
for
(
let
i
=
1
;
i
<
params
.
length
;
i
++
)
{
for
(
let
i
=
1
;
i
<
params
.
length
;
i
++
)
{
value
=
value
[
params
[
i
]];
}
eltField
[
fields
[
fields
.
length
-
1
]]
=
value
;
...
...
@@ -25,17 +25,17 @@ UIMapper = ARCS.Component.create(
for
(
let
p
in
obj
)
{
let
slotName
=
p
.
name
;
let
slotName
=
p
;
let
slotFunction
=
function
(
pobj
)
{
return
function
()
{
pobj
.
map
ping
.
map
(
elt
=>
{
pobj
.
map
(
elt
=>
{
mapFunction
(
elt
.
param
,
elt
.
field
).
apply
(
null
,
arguments
);
});
};
}
if
(
self
.
slots
.
indexOf
(
slotName
)
<
0
)
{
self
.
slots
.
push
(
slotName
);
self
[
slotName
]
=
slotFunction
(
p
);
self
[
slotName
]
=
slotFunction
(
obj
[
p
]
);
}
};
...
...
src/invocation.js
View file @
f1a82d9
...
...
@@ -56,7 +56,7 @@ Invocation.cast = function (obj, context) {
if
(
obj
.
storage
!==
undefined
)
{
let
data
=
null
;
if
(
typeof
(
localStorage
)
!==
"undefined"
)
{
let
item
=
localStorage
.
getItem
(
storage
.
key
);
let
item
=
localStorage
.
getItem
(
`ARCS.
${
storage
.
key
}
`
);
if
(
item
===
null
)
{
if
(
typeof
(
obj
.
storage
.
default
)
!==
"undefined"
)
{
data
=
obj
.
storage
.
default
;
...
...
tests/geoloc/arcsapp.json
View file @
f1a82d9
{
"context"
:
{
"libraries"
:
[
"
components/geolocator"
,
"components/positionwidget
"
],
"libraries"
:
[
"
../components/geolocator.js"
,
"../components/uimapper.js
"
],
"components"
:
{
"geolocator"
:
{
"type"
:
"GeoLocator"
},
"positionWidget"
:
{
"type"
:
"PositionWidget"
,
"value"
:
[
"lon"
,
"lat"
,
"acc"
]
},
"statemachine"
:
{
"positionWidget"
:
{
"type"
:
"UIMapper"
,
"value"
:
{
"updatePosition"
:
[
{
"param"
:
"0.coords.longitude"
,
"field"
:
"lon.innerHTML"
},
{
"param"
:
"0.coords.latitude"
,
"field"
:
"lat.innerHTML"
},
{
"param"
:
"0.coords.accuracy"
,
"field"
:
"acc.innerHTML"
}
]
}},
"statemachine"
:
{
"type"
:
"StateMachine"
,
"value"
:
{
"initial"
:
"start"
,
...
...
@@ -35,4 +41,4 @@
}
}
}
\ No newline at end of file
...
...
tests/geoloc/geoloc.html
View file @
f1a82d9
<html>
<head>
<title>
Geolocation with ARCS
</title>
<script
data-
main=
"../../build/arcs_browser
"
data-base-url=
"../..
"
data-arcsapp=
"arcsapp.json"
src=
"../../deps/requirejs/require
.js"
>
<script
data-
base-url=
"../..
"
data-arcsapp=
"arcsapp.json
"
type=
"module"
src=
"../../build/arcs_browser
.js"
>
</script>
<link
rel=
"stylesheet"
href=
"geoloc.css"
>
</head>
...
...
Please
register
or
login
to post a comment