Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MACAO Hugo
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
MACAO Hugo
Commits
fc9082d6
Commit
fc9082d6
authored
6 months ago
by
David Rouquet
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' into '15-choses-a-faire-css'
# Conflicts: # macao/layouts/partials/docs/inject/head.html
parents
ef716964
1f912611
Branches
Branches containing commit
No related tags found
1 merge request
!2
Resolve "CSS Work"
Pipeline
#2014
passed
6 months ago
Stage: test
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
macao/assets/quiz.js
+16
-6
16 additions, 6 deletions
macao/assets/quiz.js
macao/layouts/partials/docs/inject/head.html
+2
-0
2 additions, 0 deletions
macao/layouts/partials/docs/inject/head.html
with
18 additions
and
6 deletions
macao/assets/quiz.js
+
16
−
6
View file @
fc9082d6
...
@@ -44,6 +44,22 @@ $(function () {
...
@@ -44,6 +44,22 @@ $(function () {
// Load survey model from JSON
// Load survey model from JSON
const
survey
=
new
Survey
.
Model
(
jsonStatic
);
const
survey
=
new
Survey
.
Model
(
jsonStatic
);
// Instantiate `markdown-it`
const
converter
=
markdownit
({
html
:
true
// Support HTML tags in the source (unsafe, see documentation)
});
survey
.
onTextMarkdown
.
add
((
_
,
options
)
=>
{
console
.
log
(
"
On text markdown
"
)
// Convert Markdown to HTML
let
str
=
converter
.
renderInline
(
options
.
text
);
// ...
// Sanitize the HTML markup using a third-party library here
// ...
// Set HTML markup to render
options
.
html
=
str
;
});
// Add "Check answers" button
// Add "Check answers" button
survey
.
addNavigationItem
({
survey
.
addNavigationItem
({
id
:
"
sv-nav-check
"
,
id
:
"
sv-nav-check
"
,
...
@@ -65,12 +81,6 @@ $(function () {
...
@@ -65,12 +81,6 @@ $(function () {
innerCss
:
"
sd-btn nav-input
"
innerCss
:
"
sd-btn nav-input
"
});
});
survey
.
onTextMarkdown
.
add
((
survey
,
options
)
=>
{
// FIXME: this inserts raw HTML from the text, to remove as soon as Macao-Legacy converter
// can actually produce Markdown
options
.
html
=
options
.
text
;
});
survey
.
onValueChanged
.
add
((
_
,
options
)
=>
{
survey
.
onValueChanged
.
add
((
_
,
options
)
=>
{
console
.
log
(
options
)
console
.
log
(
options
)
});
});
...
...
This diff is collapsed.
Click to expand it.
macao/layouts/partials/docs/inject/head.html
+
2
−
0
View file @
fc9082d6
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
<script
defer
type=
"text/javascript"
<script
defer
type=
"text/javascript"
src=
"https://unpkg.com/survey-core/themes/default-light-panelless.min.js"
></script>
src=
"https://unpkg.com/survey-core/themes/default-light-panelless.min.js"
></script>
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
integrity=
"sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg=="
crossorigin=
"anonymous"
referrerpolicy=
"no-referrer"
/>
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css"
integrity=
"sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg=="
crossorigin=
"anonymous"
referrerpolicy=
"no-referrer"
/>
<script
src=
"https://cdn.jsdelivr.net/npm/markdown-it@14.1.0/dist/markdown-it.min.js"
></script>
{{- $quizjs := slice -}}
{{- $quizjs := slice -}}
{{- $quizjs = $quizjs | append (resources.Get "quiz.js") -}}
{{- $quizjs = $quizjs | append (resources.Get "quiz.js") -}}
{{- $quizjs = $quizjs | append (resources.Get "custom.js") -}}
{{- $quizjs = $quizjs | append (resources.Get "custom.js") -}}
...
...
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