Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
ParlementairesJS
Commits
62c828f1
Commit
62c828f1
authored
Jan 18, 2023
by
Bastien Le Querrec
Browse files
add the possibility to exclude a group
so we can hide far-right groups :)
parent
bdc815bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
62c828f1
...
...
@@ -46,6 +46,7 @@ You must set at least the `dataset` and `datasetConfig` values. Change the `id-o
|
`twitter`
| false | Display Twitter link. |
`true`
|
|
`facebook`
| false | Display Facebook link. |
`true`
|
|
`download`
| false | Display a link to download data as a CSV file. |
`true`
|
|
`hiddenGroups`
| false | Do not display MPs in on of the specified parliamentary group. |
`[]`
|
## Iframe (fallback)
...
...
demo.html
View file @
62c828f1
...
...
@@ -65,6 +65,7 @@
//twitter: false, // Show Twitter links (optional; default: true)
//facebook: false, // Show Facebook links (optional; default: true)
//download: false, // Show link to download data (optional; default: false)
hiddenGroups
:
[
"
Rassemblement National
"
]
// Hide groups in the list (optional; default: [])
}).
display
(
'
deputes
'
);
</script>
</body>
...
...
parlementaires.js
View file @
62c828f1
...
...
@@ -20,6 +20,7 @@ function display(targetId) {
// Initiate vars
var
mps
=
[];
var
groups
=
[];
var
hiddenGroups
=
(
!
this
.
options
.
hiddenGroups
)
?
[]
:
this
.
options
.
hiddenGroups
;
var
counties
=
[];
var
selected
=
[];
var
group
=
0
;
...
...
@@ -135,8 +136,14 @@ function display(targetId) {
// List available groups and counties
for
(
var
i
=
0
;
i
<
mps
.
length
;
i
++
)
{
if
(
mps
[
i
].
county
&&
counties
.
indexOf
(
mps
[
i
].
county
)
==
-
1
)
counties
.
push
(
mps
[
i
].
county
);
if
(
mps
[
i
].
group
&&
groups
.
indexOf
(
mps
[
i
].
group
)
==
-
1
)
groups
.
push
(
mps
[
i
].
group
);
if
(
mps
[
i
].
county
&&
counties
.
indexOf
(
mps
[
i
].
county
)
==
-
1
)
counties
.
push
(
mps
[
i
].
county
);
if
(
mps
[
i
].
group
&&
groups
.
indexOf
(
mps
[
i
].
group
)
==
-
1
&&
hiddenGroups
.
indexOf
(
mps
[
i
].
group
)
==
-
1
)
// Exclude hidden groups from the final list
groups
.
push
(
mps
[
i
].
group
);
}
// Fill in group select
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment