Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Démo Explorer
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Elan Littératures et Arts Numériques
Démo Explorer
Commits
ee0d660b
Commit
ee0d660b
authored
1 year ago
by
Arnaud Bey
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parents
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
index.html
+33
-0
33 additions, 0 deletions
index.html
script.js
+75
-0
75 additions, 0 deletions
script.js
style.css
+67
-0
67 additions, 0 deletions
style.css
with
175 additions
and
0 deletions
index.html
0 → 100644
+
33
−
0
View file @
ee0d660b
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
poc ithac viz
</title>
<link
href=
"./style.css"
rel=
"stylesheet"
/>
</head>
<body>
<header>
<h2>
XML Explorer
</h2>
</header>
<div
id=
"wrapper"
>
<div
id=
"tools"
>
<h1>
Choix hierachiques
</h1>
<div
id=
"hierarchical-choices"
>
</div>
<div
id=
"add-hierarchical-choice"
>
+ ajouter un choix
</div>
</div>
<div
id=
"visu"
>
Nombre de choix hiérarchiques :
<span
id=
"choices-count"
>
0
</span>
</div>
<div
id=
"inspector"
>
</div>
</div>
<script
type=
"module"
src=
"./script.js"
></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
script.js
0 → 100644
+
75
−
0
View file @
ee0d660b
window
.
addEventListener
(
"
load
"
,
(
event
)
=>
{
console
.
log
(
"
-------- script.js
"
)
explorer
.
init
()
});
var
explorer
=
{
hierarchicalOptions
:
{
""
:
""
,
paratxt_title
:
"
Titre
"
,
paratxt_lang
:
"
Langue
"
,
paratxt_author
:
"
Auteur
"
,
paratxt_pubplace
:
"
PubPlace
"
,
paratxt_date
:
"
Date
"
,
paratxt_publisher
:
"
Publisher
"
,
paratxt_editor
:
"
Editor
"
,
paratxt_ana
:
"
Ana
"
,
ancient_title
:
"
Anc. Title
"
,
ancient_author
:
"
Anc. Author
"
},
init
:
function
()
{
console
.
log
(
"
-------- init
"
)
document
.
querySelector
(
"
#add-hierarchical-choice
"
).
addEventListener
(
"
click
"
,
()
=>
{
this
.
addHierarchicalChoice
()
})
},
recalculate
:
function
()
{
console
.
log
(
"
-------- recalculate
"
)
const
countChoices
=
[...
document
.
querySelectorAll
(
"
.hierarchical-choice
"
)].
filter
((
choice
)
=>
choice
.
value
!=
""
).
length
document
.
querySelector
(
"
#choices-count
"
).
innerText
=
countChoices
},
removeHierarchicalChoice
:
function
(
deleteBtn
){
console
.
log
(
"
-------- removeHierarchicalChoice
"
)
deleteBtn
.
parentNode
.
remove
()
this
.
recalculate
()
},
addHierarchicalChoice
:
function
()
{
console
.
log
(
"
-------- addHierarchicalChoice
"
)
let
wrapper
=
document
.
createElement
(
"
div
"
)
wrapper
.
classList
.
add
(
"
hierarchical-choice-wrapper
"
)
let
select
=
document
.
createElement
(
"
select
"
)
select
.
classList
.
add
(
"
hierarchical-choice
"
)
wrapper
.
appendChild
(
select
)
Object
.
keys
(
this
.
hierarchicalOptions
).
forEach
(
key
=>
{
const
value
=
this
.
hierarchicalOptions
[
key
];
let
option
=
document
.
createElement
(
"
option
"
)
option
.
value
=
key
option
.
innerText
=
value
select
.
appendChild
(
option
)
});
select
.
addEventListener
(
"
change
"
,
()
=>
{
this
.
recalculate
()
})
let
deleteBtn
=
document
.
createElement
(
"
span
"
)
deleteBtn
.
innerText
=
"
X
"
deleteBtn
.
addEventListener
(
"
click
"
,
()
=>
{
this
.
removeHierarchicalChoice
(
deleteBtn
)
})
wrapper
.
appendChild
(
deleteBtn
)
document
.
querySelector
(
"
#hierarchical-choices
"
).
appendChild
(
wrapper
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
style.css
0 → 100644
+
67
−
0
View file @
ee0d660b
:root
{
--grey
:
#E9E9E9
;
--violet_txt
:
#004
;
--violet_border
:
#AAC
;
--violet_background
:
#DFDFF8
;
--unit
:
1rem
;
--header_height
:
calc
(
3
*
var
(
--unit
));
}
*
{
margin
:
0
;
padding
:
0
;
box-sizing
:
border-box
;
}
body
,
h1
,
h2
,
h3
{
font-size
:
1rem
;
font-weight
:
400
;
}
header
{
display
:
flex
;
align-items
:
center
;
height
:
var
(
--header_height
);
position
:
sticky
;
z-index
:
15
;
top
:
0px
;
padding-left
:
calc
(
1
*
var
(
--unit
));
}
#wrapper
{
display
:
flex
;
align-items
:
flex-start
;
}
#tools
,
#inspector
{
width
:
calc
(
100%
/
5
);
padding
:
calc
(
1
*
var
(
--unit
));
position
:
sticky
;
top
:
var
(
--header_height
);
overflow
:
scroll
;
height
:
calc
(
100vh
-
var
(
--header_height
));
border
:
1px
solid
white
;
}
header
,
#tools
,
#inspector
{
background-color
:
var
(
--grey
);
}
#visu
{
flex
:
1
;
padding
:
calc
(
1
*
var
(
--unit
));
height
:
calc
(
100vh
-
var
(
--header_height
));
overflow
:
scroll
;
}
.hierarchical-choice-wrapper
{
display
:
block
;
margin-bottom
:
calc
(
0.5
*
var
(
--unit
));
}
\ No newline at end of file
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