FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
mashlib-jss/src/index.ts at main · JavaScriptSolidServer/mashlib-jss · GitHub
JavaScriptSolidServer
mashlib-jss
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
mashlib-jss
/
src
/
index.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
68 lines (58 loc) · 1.93 KB
Breadcrumbs
mashlib-jss
/
src
/
index.ts
Copy path
File metadata and controls
68 lines (58 loc) · 1.93 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import
*
as
$rdf
from
'rdflib'
import
*
as
panes
from
'solid-panes'
import
{
authn
,
solidLogicSingleton
,
authSession
,
store
}
from
'solid-logic'
import
versionInfo
from
'./versionInfo'
import
{
mashStyle
}
from
'./styles/mashlib-style'
import
'./styles/mash.css'
const
global
:
any
=
window
global
.
$rdf
=
$rdf
global
.
panes
=
panes
global
.
SolidLogic
=
{
authn
,
authSession
,
store
,
solidLogicSingleton
}
global
.
mashlib
=
{
versionInfo
}
global
.
panes
.
runDataBrowser
=
function
(
uri
?:
string
|
$rdf
.
NamedNode
|
null
)
{
document
.
getElementById
(
'PageBody'
)
?.
setAttribute
(
'style'
,
mashStyle
.
dbLayout
)
document
.
getElementById
(
'PageHeader'
)
?.
setAttribute
(
'style'
,
mashStyle
.
dbLayoutHeader
)
document
.
getElementById
(
'PageFooter'
)
?.
setAttribute
(
'style'
,
mashStyle
.
dbLayoutFooter
)
document
.
getElementById
(
'DummyUUID'
)
?.
setAttribute
(
'style'
,
mashStyle
.
dbLayoutContent
)
// Set up cross-site proxy
const
fetcher
:
any
=
$rdf
.
Fetcher
fetcher
.
crossSiteProxyTemplate
=
window
.
origin
+
'/xss/?uri={uri}'
// Add web monetization tag to page header
try
{
const
webMonetizationTag
:
HTMLElement
=
document
.
createElement
(
'meta'
)
webMonetizationTag
.
setAttribute
(
'name'
,
'monetization'
)
webMonetizationTag
.
setAttribute
(
'content'
,
`$
${
window
.
location
.
host
}
`
)
document
.
head
.
appendChild
(
webMonetizationTag
)
}
catch
(
e
)
{
console
.
error
(
'Failed to add web monetization tag to page header'
)
}
// Authenticate the user
authn
.
checkUser
(
)
.
then
(
function
(
_profile
:
any
)
{
const
mainPage
=
panes
.
initMainPage
(
solidLogicSingleton
.
store
,
uri
)
return
mainPage
}
)
}
window
.
onpopstate
=
function
(
_event
:
any
)
{
global
.
document
.
outline
.
GotoSubject
(
$rdf
.
sym
(
window
.
document
.
location
.
href
)
,
true
,
undefined
,
true
,
undefined
)
}
// It's not clear where this function is used, so unfortunately we cannot remove it:
function
dump
(
msg
:
string
[
]
)
{
console
.
log
(
msg
.
slice
(
0
,
-
1
)
)
}
global
.
dump
=
dump
export
{
versionInfo
}
Back
|
FazBrowse Home
|
New Git URL