From ebc8e9b72c9d90961e20ca75613a868646db0bda Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 21 Dec 2023 21:00:08 -0800 Subject: [PATCH] More effectively block drag and right-click --- web/static/css/theme.css | 10 ++++++++++ web/templates/photo/gallery.html | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/web/static/css/theme.css b/web/static/css/theme.css index 33b6a2a..17678ad 100644 --- a/web/static/css/theme.css +++ b/web/static/css/theme.css @@ -8,6 +8,16 @@ abbr { cursor: not-allowed; } +img { + /* https://stackoverflow.com/questions/12906789/preventing-an-image-from-being-draggable-or-selectable-without-using-js */ + user-drag: none; + user-select: none; + -moz-user-select: none; + -webkit-user-drag: none; + -webkit-user-select: none; + -ms-user-select: none; +} + /* Container for large profile pic on user pages */ .profile-photo { width: 150px; diff --git a/web/templates/photo/gallery.html b/web/templates/photo/gallery.html index 42df558..4e6435a 100644 --- a/web/templates/photo/gallery.html +++ b/web/templates/photo/gallery.html @@ -572,7 +572,7 @@ {{else}} -