Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
howto-cards
Commits
881ba760
Commit
881ba760
authored
Dec 11, 2020
by
Jacek Lebioda
Browse files
fix: optimize search script
parent
c6634b83
Pipeline
#35576
passed with stages
in 1 minute and 55 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
_includes/search.html
View file @
881ba760
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
window
.
content
=
{
{
%
for
card
in
the_cards
%
}
window
.
content
=
{
{
%
for
card
in
the_cards
%
}
"
{{ card.url | slugify }}
"
:
{
"
{{ card.url | slugify }}
"
:
{
"
title
"
:
"
{{ card.shortcut | xml_escape }}
"
,
"
title
"
:
"
{{ card.shortcut | xml_escape }}
"
,
"
content
"
:
{{
card
.
content
|
strip_html
|
strip_newlines
|
jsonify
}},
"
content
"
:
{{
card
.
content
|
strip_html
|
strip_newlines
|
truncate
:
150
|
jsonify
}},
"
url
"
:
"
{{ card.url | xml_escape | relative_url }}
"
"
url
"
:
"
{{ card.url | xml_escape | relative_url }}
"
}
{
%
unless
forloop
.
last
%
},{
%
endunless
%
}
{
%
endfor
%
}
}
{
%
unless
forloop
.
last
%
},{
%
endunless
%
}
{
%
endfor
%
}
};
};
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
for
(
var
i
=
0
;
i
<
results
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
results
.
length
;
i
++
)
{
var
node
=
document
.
createElement
(
"
tr
"
);
var
node
=
document
.
createElement
(
"
tr
"
);
node
.
innerHTML
=
construct_cell
(
prettify
(
window
.
content
[
results
[
i
].
ref
].
title
),
node
.
innerHTML
=
construct_cell
(
prettify
(
window
.
content
[
results
[
i
].
ref
].
title
),
window
.
content
[
results
[
i
].
ref
].
content
.
substring
(
0
,
1
2
5
)
+
'
...
'
,
window
.
content
[
results
[
i
].
ref
].
content
.
substring
(
0
,
15
0
)
+
'
...
'
,
window
.
content
[
results
[
i
].
ref
].
url
);
window
.
content
[
results
[
i
].
ref
].
url
);
el_table_body
.
appendChild
(
node
);
el_table_body
.
appendChild
(
node
);
}
}
...
@@ -84,4 +84,4 @@
...
@@ -84,4 +84,4 @@
el_tr_placeholder
.
style
.
display
=
"
none
"
;
el_tr_placeholder
.
style
.
display
=
"
none
"
;
})
})
</script>
</script>
\ No newline at end of file
Write
Preview
Markdown
is supported
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