Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
howto-cards
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marie Fossepre
howto-cards
Commits
22d121ff
Commit
22d121ff
authored
4 years ago
by
Jacek Lebioda
Browse files
Options
Downloads
Plain Diff
Merge branch 'new-landing-page' into 'develop'
New landing page See merge request
!191
parents
4fb34b25
e5b0442e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_layouts/landing.html
+3
-11
3 additions, 11 deletions
_layouts/landing.html
assets/js/landing.js
+11
-5
11 additions, 5 deletions
assets/js/landing.js
with
14 additions
and
16 deletions
_layouts/landing.html
+
3
−
11
View file @
22d121ff
...
...
@@ -79,16 +79,6 @@
<div
class=
"left-inner-container"
id=
"left-inner-container"
ondrop=
"window.cardDropDiscard(event)"
ondragover=
"window.allowDrop(event)"
>
</div>
<div
class=
"right-inner-container"
id=
"right-inner-container"
ondrop=
"window.cardDrop(event)"
ondragover=
"window.allowDrop(event)"
>
<a
class=
"card-link"
href=
"/#handbook-1-general"
>
<div
class=
"card-pinned card-red"
>
<div
class=
"card-header"
>
<div
class=
"card-icon"
><i
class=
"large material-icons"
>
book
</i></div>
</div>
<div
class=
"card-content"
>
<div
class=
"card-title"
>
Handbook
</div>
</div>
</div>
</a>
<div
id=
"drop-to-add"
class=
"card-pinned card-grayed card-pulsate"
>
<div
class=
"card-header"
>
<div
class=
"card-icon"
><i
class=
"large material-icons"
>
add
</i></div>
...
...
@@ -118,7 +108,9 @@
</div>
</body>
{%- include scripts.html -%}
<script>
window
.
is_internal
=
false
;
</script>
<script
src=
"{{ "
assets
/
js
/
landing.js
"
|
relative_url
}}"
></script>
</html>
This diff is collapsed.
Click to expand it.
assets/js/landing.js
+
11
−
5
View file @
22d121ff
window
.
cards_limit
=
6
;
var
storage_key
=
"
pinnedCards
"
;
if
(
window
.
is_internal
)
{
storage_key
+=
"
Internal
"
}
else
{
storage_key
+=
"
External
"
}
let
$left_inner_container
=
document
.
getElementById
(
"
left-inner-container
"
);
let
$right_inner_container
=
document
.
getElementById
(
"
right-inner-container
"
);
let
$drop_to_add
=
document
.
getElementById
(
"
drop-to-add
"
);
// ============= DATA ========================================
let
pinned_cards_store
=
localStorage
.
getItem
(
"
pinnedCards
"
);
let
pinned_cards_store
=
localStorage
.
getItem
(
storage_key
);
window
.
pinned_cards
=
[
];
// ============= DOM functions ========================================
...
...
@@ -128,7 +134,7 @@ window.cardDrop = function(event) {
}
if
(
!
list_contains
(
window
.
pinned_cards
,
card
,
"
title
"
))
{
window
.
pinned_cards
.
push
(
card
);
localStorage
.
setItem
(
"
pinnedCards
"
,
JSON
.
stringify
(
pinned_cards
));
localStorage
.
setItem
(
storage_key
,
JSON
.
stringify
(
pinned_cards
));
window
.
cards
=
window
.
cards
.
filter
(
function
(
el
)
{
return
el
[
'
title
'
]
!=
card
[
'
title
'
];});
rebuild_pinned_cards
();
rebuild_cards
();
...
...
@@ -142,7 +148,7 @@ window.cardDropDiscard = function(event) {
return
;
if
(
list_contains
(
window
.
pinned_cards
,
card
,
"
title
"
))
{
remove_from_list
(
window
.
pinned_cards
,
card
,
"
title
"
);
localStorage
.
setItem
(
"
pinnedCards
"
,
JSON
.
stringify
(
pinned_cards
));
localStorage
.
setItem
(
storage_key
,
JSON
.
stringify
(
pinned_cards
));
cards
.
push
(
card
);
rebuild_pinned_cards
();
rebuild_cards
();
...
...
@@ -181,7 +187,7 @@ window.clear_pinned = function() {
cards
.
push
(
card
);
}
pinned_cards
=
[];
localStorage
.
setItem
(
"
pinnedCards
"
,
JSON
.
stringify
(
pinned_cards
));
localStorage
.
setItem
(
storage_key
,
JSON
.
stringify
(
pinned_cards
));
rebuild_pinned_cards
();
rebuild_cards
();
refresh_drop_to_add_button
();
...
...
@@ -189,7 +195,7 @@ window.clear_pinned = function() {
window
.
start_cards
=
function
()
{
// ============= Initialization ========================================
if
(
pinned_cards_store
==
null
)
{
localStorage
.
setItem
(
"
pinnedCards
"
,
JSON
.
stringify
(
pinned_cards
));
localStorage
.
setItem
(
storage_key
,
JSON
.
stringify
(
pinned_cards
));
}
else
{
pinned_cards
=
JSON
.
parse
(
pinned_cards_store
);
// Sort alphabetically
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment