Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tdt4242-base
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
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
Åsmund Haugse
tdt4242-base
Commits
1e7a044a
Commit
1e7a044a
authored
3 years ago
by
Haakon Gunleiksrud
Browse files
Options
Downloads
Patches
Plain Diff
feat/add preview of image in workout if image file
parent
37f14a8e
No related branches found
No related tags found
1 merge request
!16
feat/add preview of image in workout if image file
Pipeline
#138839
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/www/scripts/workout.js
+9
-0
9 additions, 0 deletions
frontend/www/scripts/workout.js
with
9 additions
and
0 deletions
frontend/www/scripts/workout.js
+
9
−
0
View file @
1e7a044a
...
...
@@ -42,6 +42,15 @@ async function retrieveWorkout(id) {
a
.
text
=
pathArray
[
pathArray
.
length
-
1
];
a
.
className
=
"
me-2
"
;
filesDiv
.
appendChild
(
a
);
let
isImage
=
[
"
jpg
"
,
"
png
"
,
"
gif
"
,
"
jpeg
"
].
includes
(
a
.
text
.
split
(
"
.
"
)[
1
]);
if
(
isImage
){
let
img
=
document
.
createElement
(
"
img
"
);
img
.
src
=
file
.
file
;
img
.
width
=
"
500
"
;
filesDiv
.
appendChild
(
img
);
}
}
// create exercises
...
...
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