Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
15ed9d81
Commit
15ed9d81
authored
4 years ago
by
me5na7qbjqbrp
Browse files
Options
Downloads
Patches
Plain Diff
Check image size before sending it
parent
de3660b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!113
Fix note pictures, better ansible
,
!112
Move image upload code to form clean
Pipeline
#8659
passed with warnings with stages
in 10 minutes and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/member/templates/member/picture_update.html
+12
-6
12 additions, 6 deletions
apps/member/templates/member/picture_update.html
with
12 additions
and
6 deletions
apps/member/templates/member/picture_update.html
+
12
−
6
View file @
15ed9d81
...
...
@@ -55,12 +55,18 @@ SPDX-License-Identifier: GPL-3.0-or-later
/* SCRIPT TO OPEN THE MODAL WITH THE PREVIEW */
$
(
"
#id_image
"
).
change
(
function
(
e
)
{
if
(
this
.
files
&&
this
.
files
[
0
])
{
var
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
$
(
"
#modal-image
"
).
attr
(
"
src
"
,
e
.
target
.
result
);
$
(
"
#modalCrop
"
).
modal
(
"
show
"
);
// Check the image size
if
(
this
.
files
[
0
].
size
>
2
*
1024
*
1024
)
{
alert
(
"
Ce fichier est trop volumineux.
"
)
}
else
{
// Read the selected image file
var
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
$
(
"
#modal-image
"
).
attr
(
"
src
"
,
e
.
target
.
result
);
$
(
"
#modalCrop
"
).
modal
(
"
show
"
);
}
reader
.
readAsDataURL
(
this
.
files
[
0
]);
}
reader
.
readAsDataURL
(
this
.
files
[
0
]);
}
});
...
...
@@ -104,4 +110,4 @@ SPDX-License-Identifier: GPL-3.0-or-later
});
});
</script>
{% endblock %}
\ No newline at end of file
{% endblock %}
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