Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Memorekall Member New
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Rekall
Memorekall Member New
Commits
2e00c828
Commit
2e00c828
authored
3 years ago
by
Sebastien
Browse files
Options
Downloads
Patches
Plain Diff
Fix sort tag labels before display
parent
6f97bb76
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!98
refresh the mosaic on annotation modification
Pipeline
#1094
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
capsule-prototype/js/MosaicPanelWidget.js
+52
-46
52 additions, 46 deletions
capsule-prototype/js/MosaicPanelWidget.js
with
52 additions
and
46 deletions
capsule-prototype/js/MosaicPanelWidget.js
+
52
−
46
View file @
2e00c828
...
...
@@ -2,11 +2,11 @@
function
MosaicPanelWidget
()
{
const
defaultOptions
=
{
getTagGradientColor
:
function
(
tag
)
{
var
isOpera
=
!!
window
.
opera
||
navigator
.
userAgent
.
indexOf
(
'
OPR/
'
)
>=
0
;
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var
isFirefox
=
typeof
InstallTrigger
!==
'
undefined
'
;
// Firefox 1.0+
var
isSafari
=
Object
.
prototype
.
toString
.
call
(
window
.
HTMLElement
).
indexOf
(
'
Constructor
'
)
>
0
;
// At least Safari 3+: "[object HTMLElementConstructor]"
var
isChrome
=
!!
window
.
chrome
&&
!
isOpera
;
// Chrome 1+
var
isIE
=
/*@cc_on!@*/
false
||
!!
document
.
documentMode
;
// At least IE6
let
isOpera
=
!!
window
.
opera
||
navigator
.
userAgent
.
indexOf
(
'
OPR/
'
)
>=
0
;
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
let
isFirefox
=
typeof
InstallTrigger
!==
'
undefined
'
;
// Firefox 1.0+
let
isSafari
=
Object
.
prototype
.
toString
.
call
(
window
.
HTMLElement
).
indexOf
(
'
Constructor
'
)
>
0
;
// At least Safari 3+: "[object HTMLElementConstructor]"
let
isChrome
=
!!
window
.
chrome
&&
!
isOpera
;
// Chrome 1+
//
var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6
if
(
isOpera
)
{
return
"
-o-linear-gradient(right bottom, rgba(20,46,51,1) 0%,
"
+
tag
.
color
+
"
100%)
"
;
...
...
@@ -19,9 +19,12 @@
}
},
getPreviewPath
:
function
(
tagOrDoc
)
{
Utils
.
getPreviewPath
(
tagOrDoc
);
// eslint-disable-next-line no-undef
return
Utils
.
getPreviewPath
(
tagOrDoc
);
},
htmlElement
:
function
()
{
return
$
(
'
#mosaic_tab
'
)
},
htmlElement
:
function
()
{
return
$
(
'
#mosaic_tab
'
)
},
isOpen
:
false
,
pubsub
:
function
()
{
return
app
.
rekall
.
Rekall
(
'
pubSub
'
);
...
...
@@ -105,9 +108,8 @@
});
let
divImageContainer
=
$
(
'
<div>
'
).
addClass
(
'
mosaic_item_thumbnail_container
'
);
divImageContainer
.
append
(
$
(
'
<img/>
'
)
.
append
(
$
(
'
<img
src="
'
+
url
+
'
" alt="thumbnail image"
/>
'
)
.
addClass
(
'
mosaic_item_thumbnail_container_img
'
)
.
attr
(
'
src
'
,
url
)
.
attr
(
'
onerror
'
,
"
this.src='../shared/css/images/img-document.png';
"
));
div
.
append
(
divImageContainer
);
div
.
append
(
$
(
'
<span/>
'
)
...
...
@@ -169,8 +171,8 @@
));
localOptions
.
htmlElement
().
append
(
typefilterdiv
);
localOptions
.
htmlElement
().
append
(
labelsfilterdiv
);
// eslint-disable-next-line no-undef
let
labels
=
new
Set
();
// TODO is there a better way to iterate over tags or documents ?
for
(
let
[
k
,
v
]
of
Object
.
entries
(
localOptions
.
rekall
().
sortings
.
colors
.
categories
))
{
let
categoryName
=
localOptions
.
rekall
().
sortings
.
colors
.
getCategoryName
(
k
)
let
category
=
$
(
'
<div/>
'
).
addClass
(
'
mosaic_category
'
).
css
(
'
background
'
,
localOptions
.
getTagGradientColor
(
v
));
...
...
@@ -198,7 +200,11 @@
localOptions
.
htmlElement
().
append
(
category
);
}
labels
.
forEach
(
l
=>
{
Array
.
from
(
labels
)
.
sort
(
function
(
a
,
b
)
{
return
a
.
toLowerCase
().
localeCompare
(
b
.
toLowerCase
());
})
.
forEach
(
l
=>
{
let
button
=
$
(
'
<div/>
'
).
html
(
l
);
button
.
addClass
(
'
mosaic_filter_item mosaic_button mosaic_label_filter
'
);
if
(
...
...
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