Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dirk Rockendorf
metager-app
Commits
4c0b7ae0
Commit
4c0b7ae0
authored
Nov 27, 2017
by
Phil Höfer
Browse files
Remove ECMAScript 6 keywords
parent
7dc4b881
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/app/results.js
View file @
4c0b7ae0
const
TRIES
=
3
;
const
TRYDELAYINCRMS
=
1000
;
var
TRIES
=
3
;
var
TRYDELAYINCRMS
=
1000
;
function
loadXMLDoc
(
filename
)
{
...
...
@@ -21,7 +21,7 @@ function render(err, content)
xsltProcessor
=
new
XSLTProcessor
();
xsltProcessor
.
importStylesheet
(
style
);
resultDocument
=
xsltProcessor
.
transformToFragment
(
content
,
document
);
document
.
body
.
replace
With
(
resultDocument
);
document
.
body
.
replace
Child
(
resultDocument
,
document
.
getElementById
(
"
temp
"
)
);
}
}
}
...
...
@@ -32,7 +32,7 @@ function render(err, content)
function
search
(
query
,
focus
,
callback
,
trycount
)
{
query
=
query
||
"
eingabe=
"
;
focus
=
focus
||
"
focus=web
"
;
let
doc
;
var
doc
;
trycount
=
trycount
||
0
;
try
{
doc
=
loadXMLDoc
(
"
https://metager3.de/meta/meta.ger3?
"
+
focus
+
"
&
"
+
query
+
"
&encoding=utf8&out=atom10&appversion=3.0.0
"
);
...
...
@@ -53,9 +53,16 @@ function boot()
search
(
getParameter
(
'
eingabe
'
),
getParameter
(
'
focus
'
),
render
);
}
function
filterFunc
(
p
,
i
,
a
)
{
return
p
.
startsWith
(
parameterName
+
"
=
"
);
}
function
getParameter
(
parameterName
)
{
const
parameterStrings
=
location
.
search
.
substr
(
1
).
split
(
"
&
"
);
const
results
=
parameterStrings
.
filter
((
p
,
i
,
a
)
=>
p
.
startsWith
(
parameterName
+
"
=
"
));
var
parameterStrings
=
location
.
search
.
substr
(
1
).
split
(
"
&
"
);
var
results
=
parameterStrings
.
filter
(
function
(
p
,
i
,
a
)
{
return
p
.
startsWith
(
parameterName
+
"
=
"
);
});
return
results
.
join
(
"
&
"
);
}
...
...
www/results.xhtml
View file @
4c0b7ae0
...
...
@@ -12,6 +12,7 @@
<script
type=
"text/javascript"
defer=
"defer"
src=
"app/results.js"
></script>
</head>
<body
onload=
"boot()"
>
<div
id=
"temp"
>
<header
class=
"persistent-search"
>
<form
class=
"search-card card elevation-2"
id=
"searchform"
>
<a
href=
"index.xhtml"
class=
"back"
>
...
...
@@ -27,5 +28,6 @@
<footer
class=
"footer-text"
>
MetaGer wird entwickelt und betrieben vom SUMA-EV - Verein für freien Wissenszugang.
</footer>
</div>
</body>
</html>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment