mashlib-jss 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +153 -0
- package/dist/789.mashlib.js +11 -0
- package/dist/789.mashlib.js.map +1 -0
- package/dist/789.mashlib.min.js +1 -0
- package/dist/841.mashlib.js +12133 -0
- package/dist/841.mashlib.js.map +1 -0
- package/dist/841.mashlib.min.js +73 -0
- package/dist/841.mashlib.min.js.map +1 -0
- package/dist/browse-test.html +134 -0
- package/dist/browse.html +134 -0
- package/dist/databrowser.html +3 -0
- package/dist/mash.css +1087 -0
- package/dist/mash.css.map +1 -0
- package/dist/mashlib.js +93663 -0
- package/dist/mashlib.js.map +1 -0
- package/dist/mashlib.min.js +279 -0
- package/dist/mashlib.min.js.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html id="docHTML">
|
|
3
|
+
<head>
|
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
|
5
|
+
<link type="text/css" rel="stylesheet" href="mash.css" />
|
|
6
|
+
<script type="text/javascript" src="mashlib.js"></script>
|
|
7
|
+
<script>
|
|
8
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
9
|
+
const authn = SolidLogic.authn
|
|
10
|
+
const authSession = SolidLogic.authSession
|
|
11
|
+
const store = SolidLogic.store
|
|
12
|
+
const dom = document
|
|
13
|
+
$rdf.Fetcher.crossSiteProxyTemplate = self.origin + '/xss?uri={uri}'
|
|
14
|
+
const uri = window.location.href
|
|
15
|
+
window.document.title = 'SolidOS Web App: ' + uri
|
|
16
|
+
const outliner = panes.getOutliner(dom) //function from solid-panes
|
|
17
|
+
|
|
18
|
+
function go (event) {
|
|
19
|
+
let uri = $rdf.uri.join(uriField.value, window.location.href)
|
|
20
|
+
console.log("User field " + uriField.value)
|
|
21
|
+
console.log("User requests " + uri)
|
|
22
|
+
|
|
23
|
+
const params = new URLSearchParams(location.search)
|
|
24
|
+
params.set('uri', uri);
|
|
25
|
+
window.history.replaceState({}, '', `${location.origin}${location.pathname}?${params}`);
|
|
26
|
+
|
|
27
|
+
var subject = $rdf.sym(uri);
|
|
28
|
+
outliner.GotoSubject(subject, true, undefined, true, undefined);
|
|
29
|
+
mungeLoginArea();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const uriField = dom.getElementById('uriField')
|
|
33
|
+
const goButton = dom.getElementById('goButton')
|
|
34
|
+
const loginButtonArea = document.getElementById("loginButtonArea");
|
|
35
|
+
const webIdArea = dom.getElementById('webId')
|
|
36
|
+
const banner = dom.getElementById('inputArea')
|
|
37
|
+
|
|
38
|
+
uriField.addEventListener('keyup', function (e) {
|
|
39
|
+
if (e.keyCode === 13) {
|
|
40
|
+
go(e)
|
|
41
|
+
}
|
|
42
|
+
}, false)
|
|
43
|
+
|
|
44
|
+
goButton.addEventListener('click', go, false);
|
|
45
|
+
let initial = new URLSearchParams(self.location.search).get("uri")
|
|
46
|
+
if (initial) {
|
|
47
|
+
uriField.value = initial
|
|
48
|
+
go()
|
|
49
|
+
} else {
|
|
50
|
+
console.log('ready for user input')
|
|
51
|
+
}
|
|
52
|
+
async function mungeLoginArea(){
|
|
53
|
+
loginButtonArea.innerHTML="";
|
|
54
|
+
if(uriField.value) {
|
|
55
|
+
loginButtonArea.appendChild(UI.login.loginStatusBox(document, null, {}))
|
|
56
|
+
}
|
|
57
|
+
const me = authn.currentUser()
|
|
58
|
+
if (me) {
|
|
59
|
+
const logoutButton = loginButtonArea.querySelector('input');
|
|
60
|
+
logoutButton.value = "Logout";
|
|
61
|
+
let displayId = `<${me.value}>`;
|
|
62
|
+
webIdArea.innerHTML = displayId;
|
|
63
|
+
banner.style.backgroundColor="#bbccbb";
|
|
64
|
+
} else {
|
|
65
|
+
banner.style.backgroundColor="#ccbbbb";
|
|
66
|
+
}
|
|
67
|
+
loginButtonArea.style.display="inline-block";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (authSession) {
|
|
71
|
+
authSession.events.on("login", () => {
|
|
72
|
+
mungeLoginArea();
|
|
73
|
+
go()
|
|
74
|
+
})
|
|
75
|
+
authSession.events.on("logout", () => {
|
|
76
|
+
mungeLoginArea();
|
|
77
|
+
webIdArea.innerHTML = "public user";
|
|
78
|
+
go()
|
|
79
|
+
})
|
|
80
|
+
authSession.events.on("sessionRestore", (url) => {
|
|
81
|
+
mungeLoginArea();
|
|
82
|
+
go()
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
mungeLoginArea();
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
88
|
+
</head>
|
|
89
|
+
<body>
|
|
90
|
+
|
|
91
|
+
<div style="width:100%;" id="inputArea">
|
|
92
|
+
<div style="margin-bottom:0.6em">
|
|
93
|
+
The SolidOS Databrowser
|
|
94
|
+
</div>
|
|
95
|
+
<div style="margin-left:1em">
|
|
96
|
+
Viewing <input id="uriField" type="text" style="font-size:100%; min-width:25em; padding:0.5em;" placeholder="enter a pod address e.g. https://you.solidcommunity.net/"/> <input type="button" id="goButton" value="Go" />
|
|
97
|
+
</div>
|
|
98
|
+
<div style="margin-top:0.5em;margin-left:1em">
|
|
99
|
+
As user <span id="webId"><public user></span> <span id="loginButtonArea"></span>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<table style="width:100%;">
|
|
104
|
+
<tr>
|
|
105
|
+
<div class="TabulatorOutline" id="DummyUUID" role="main">
|
|
106
|
+
<table id="outline"></table>
|
|
107
|
+
<div id="GlobalDashboard"></div>
|
|
108
|
+
</div>
|
|
109
|
+
</tr>
|
|
110
|
+
</table>
|
|
111
|
+
|
|
112
|
+
<style>
|
|
113
|
+
#inputArea {
|
|
114
|
+
width:100%;
|
|
115
|
+
padding:0.5em;
|
|
116
|
+
background-color:#d0d0d0;
|
|
117
|
+
}
|
|
118
|
+
#loginButtonArea input {
|
|
119
|
+
display:inline-block;
|
|
120
|
+
margin:0.25em !important;
|
|
121
|
+
padding:0.25em !important;
|
|
122
|
+
}
|
|
123
|
+
#webId {
|
|
124
|
+
display:inline-block;
|
|
125
|
+
padding-top:0.6em;
|
|
126
|
+
padding-bottom:0.6em;
|
|
127
|
+
}
|
|
128
|
+
#uriField {
|
|
129
|
+
width:70%;
|
|
130
|
+
margin-top:0.6em !important;
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
133
|
+
|
|
134
|
+
</body></html>
|
package/dist/browse.html
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html id="docHTML">
|
|
3
|
+
<head>
|
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
|
5
|
+
<link type="text/css" rel="stylesheet" href="mash.css" />
|
|
6
|
+
<script type="text/javascript" src="mashlib.min.js"></script>
|
|
7
|
+
<script>
|
|
8
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
9
|
+
const authn = SolidLogic.authn
|
|
10
|
+
const authSession = SolidLogic.authn.authSession
|
|
11
|
+
const store = SolidLogic.store
|
|
12
|
+
const dom = document
|
|
13
|
+
$rdf.Fetcher.crossSiteProxyTemplate = self.origin + '/xss?uri={uri}'
|
|
14
|
+
const uri = window.location.href
|
|
15
|
+
window.document.title = 'SolidOS Web App: ' + uri
|
|
16
|
+
const outliner = panes.getOutliner(dom) //function from solid-panes
|
|
17
|
+
|
|
18
|
+
function go (event) {
|
|
19
|
+
let uri = $rdf.uri.join(uriField.value, window.location.href)
|
|
20
|
+
console.log("User field " + uriField.value)
|
|
21
|
+
console.log("User requests " + uri)
|
|
22
|
+
|
|
23
|
+
const params = new URLSearchParams(location.search)
|
|
24
|
+
params.set('uri', uri);
|
|
25
|
+
window.history.replaceState({}, '', `${location.origin}${location.pathname}?${params}`);
|
|
26
|
+
|
|
27
|
+
var subject = $rdf.sym(uri);
|
|
28
|
+
outliner.GotoSubject(subject, true, undefined, true, undefined);
|
|
29
|
+
mungeLoginArea();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const uriField = dom.getElementById('uriField')
|
|
33
|
+
const goButton = dom.getElementById('goButton')
|
|
34
|
+
const loginButtonArea = document.getElementById("loginButtonArea");
|
|
35
|
+
const webIdArea = dom.getElementById('webId')
|
|
36
|
+
const banner = dom.getElementById('inputArea')
|
|
37
|
+
|
|
38
|
+
uriField.addEventListener('keyup', function (e) {
|
|
39
|
+
if (e.keyCode === 13) {
|
|
40
|
+
go(e)
|
|
41
|
+
}
|
|
42
|
+
}, false)
|
|
43
|
+
|
|
44
|
+
goButton.addEventListener('click', go, false);
|
|
45
|
+
let initial = new URLSearchParams(self.location.search).get("uri")
|
|
46
|
+
if (initial) {
|
|
47
|
+
uriField.value = initial
|
|
48
|
+
go()
|
|
49
|
+
} else {
|
|
50
|
+
console.log('ready for user input')
|
|
51
|
+
}
|
|
52
|
+
async function mungeLoginArea(){
|
|
53
|
+
loginButtonArea.innerHTML="";
|
|
54
|
+
if(uriField.value) {
|
|
55
|
+
loginButtonArea.appendChild(UI.login.loginStatusBox(document, null, {}))
|
|
56
|
+
}
|
|
57
|
+
const me = authn.currentUser()
|
|
58
|
+
if (me) {
|
|
59
|
+
const logoutButton = loginButtonArea.querySelector('input');
|
|
60
|
+
logoutButton.value = "Logout";
|
|
61
|
+
let displayId = `<${me.value}>`;
|
|
62
|
+
webIdArea.innerHTML = displayId;
|
|
63
|
+
banner.style.backgroundColor="#bbccbb";
|
|
64
|
+
} else {
|
|
65
|
+
banner.style.backgroundColor="#ccbbbb";
|
|
66
|
+
}
|
|
67
|
+
loginButtonArea.style.display="inline-block";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (authSession) {
|
|
71
|
+
authSession.events.on("login", () => {
|
|
72
|
+
mungeLoginArea();
|
|
73
|
+
go()
|
|
74
|
+
})
|
|
75
|
+
authSession.events.on("logout", () => {
|
|
76
|
+
mungeLoginArea();
|
|
77
|
+
webIdArea.innerHTML = "public user";
|
|
78
|
+
go()
|
|
79
|
+
})
|
|
80
|
+
authSession.events.on("sessionRestore", (url) => {
|
|
81
|
+
mungeLoginArea();
|
|
82
|
+
go()
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
mungeLoginArea();
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
88
|
+
</head>
|
|
89
|
+
<body>
|
|
90
|
+
|
|
91
|
+
<div style="width:100%;" id="inputArea">
|
|
92
|
+
<div style="margin-bottom:0.6em">
|
|
93
|
+
The SolidOS Databrowser
|
|
94
|
+
</div>
|
|
95
|
+
<div style="margin-left:1em">
|
|
96
|
+
Viewing <input id="uriField" type="text" style="font-size:100%; min-width:25em; padding:0.5em;" placeholder="enter a pod address e.g. https://you.solidcommunity.net/"/> <input type="button" id="goButton" value="Go" />
|
|
97
|
+
</div>
|
|
98
|
+
<div style="margin-top:0.5em;margin-left:1em">
|
|
99
|
+
As user <span id="webId"><public user></span> <span id="loginButtonArea"></span>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<table style="width:100%;">
|
|
104
|
+
<tr>
|
|
105
|
+
<div class="TabulatorOutline" id="DummyUUID" role="main">
|
|
106
|
+
<table id="outline"></table>
|
|
107
|
+
<div id="GlobalDashboard"></div>
|
|
108
|
+
</div>
|
|
109
|
+
</tr>
|
|
110
|
+
</table>
|
|
111
|
+
|
|
112
|
+
<style>
|
|
113
|
+
#inputArea {
|
|
114
|
+
width:100%;
|
|
115
|
+
padding:0.5em;
|
|
116
|
+
background-color:#d0d0d0;
|
|
117
|
+
}
|
|
118
|
+
#loginButtonArea input {
|
|
119
|
+
display:inline-block;
|
|
120
|
+
margin:0.25em !important;
|
|
121
|
+
padding:0.25em !important;
|
|
122
|
+
}
|
|
123
|
+
#webId {
|
|
124
|
+
display:inline-block;
|
|
125
|
+
padding-top:0.6em;
|
|
126
|
+
padding-bottom:0.6em;
|
|
127
|
+
}
|
|
128
|
+
#uriField {
|
|
129
|
+
width:70%;
|
|
130
|
+
margin-top:0.6em !important;
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
133
|
+
|
|
134
|
+
</body></html>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"/><title>SolidOS Web App</title><script>document.addEventListener('DOMContentLoaded', function() {
|
|
2
|
+
panes.runDataBrowser()
|
|
3
|
+
})</script><script defer="defer" src="/mashlib.min.js"></script><link href="/mash.css" rel="stylesheet"></head><body id="PageBody"><header id="PageHeader"></header><div class="TabulatorOutline" id="DummyUUID" role="main"><table id="outline"></table><div id="GlobalDashboard"></div></div><footer id="PageFooter"></footer></body></html>
|