diff --git a/gallery/__init__.py b/gallery/__init__.py
index 0e54219..42ff00b 100644
--- a/gallery/__init__.py
+++ b/gallery/__init__.py
@@ -75,9 +75,10 @@ def create_app(): # pylint: disable=R0914
migrate_upgrade(directory=MIGRATIONS_DIR)
# LOGIN MANAGER
+ # can also set session_protection to "strong"
+ # this would protect against session hijacking
login_manager.init_app(app)
login_manager.login_view = "gallery.index"
- # login_manager.session_protection = "strong"
@login_manager.user_loader
def load_user(user_id):
diff --git a/gallery/static/js/notifications.js b/gallery/static/js/notifications.js
index 1cda690..3674625 100644
--- a/gallery/static/js/notifications.js
+++ b/gallery/static/js/notifications.js
@@ -1,14 +1,14 @@
function addNotification(notificationText, notificationLevel) {
- let notificationContainer = document.querySelector('.notifications');
+ const notificationContainer = document.querySelector('.notifications');
// Set the different icons for the different notification levels
- let successIcon = '';
- let criticalIcon = '';
- let warningIcon = '';
- let infoIcon = '';
+ const successIcon = '';
+ const criticalIcon = '';
+ const warningIcon = '';
+ const infoIcon = '';
// Create notification element
- let notification = document.createElement('div');
+ const notification = document.createElement('div');
notification.classList.add('sniffle__notification');
notification.onclick = function() {
if (notification) {
@@ -21,7 +21,7 @@ function addNotification(notificationText, notificationLevel) {
};
// Create icon element and append to notification
- let iconElement = document.createElement('span');
+ const iconElement = document.createElement('span');
iconElement.classList.add('sniffle__notification-icon');
notification.appendChild(iconElement);
@@ -41,7 +41,7 @@ function addNotification(notificationText, notificationLevel) {
}
// Create text element and append to notification
- let description = document.createElement('span');
+ const description = document.createElement('span');
description.classList.add('sniffle__notification-text');
description.innerHTML = notificationText;
notification.appendChild(description);
diff --git a/gallery/static/js/popup.js b/gallery/static/js/popup.js
index 301c5b2..70506fd 100644
--- a/gallery/static/js/popup.js
+++ b/gallery/static/js/popup.js
@@ -1,19 +1,19 @@
function popUpShow(titleText, subtitleText, bodyContent=null, userActions=null) {
// Get popup elements
- let popupSelector = document.querySelector('.pop-up');
- let headerSelector = document.querySelector('.pop-up-header');
- let actionsSelector = document.querySelector('.pop-up-controlls');
+ const popupSelector = document.querySelector('.pop-up');
+ const headerSelector = document.querySelector('.pop-up-header');
+ const actionsSelector = document.querySelector('.pop-up-controlls');
// Clear popup elements
headerSelector.innerHTML = '';
actionsSelector.innerHTML = '';
// Set popup header and subtitle
- let titleElement = document.createElement('h2');
+ const titleElement = document.createElement('h2');
titleElement.innerHTML = titleText;
headerSelector.appendChild(titleElement);
- let subtitleElement = document.createElement('p');
+ const subtitleElement = document.createElement('p');
subtitleElement.innerHTML = subtitleText;
headerSelector.appendChild(subtitleElement);
@@ -39,7 +39,7 @@ function popUpShow(titleText, subtitleText, bodyContent=null, userActions=null)
}
function popupDissmiss() {
- let popupSelector = document.querySelector('.pop-up');
+ const popupSelector = document.querySelector('.pop-up');
document.querySelector("html").style.overflow = "auto";
popupSelector.classList.remove('active');
diff --git a/gallery/static/js/webp.js b/gallery/static/js/webp.js
index c39c4ff..93a4ade 100644
--- a/gallery/static/js/webp.js
+++ b/gallery/static/js/webp.js
@@ -1,5 +1,5 @@
function checkWebpSupport() {
- var webpSupport = false;
+ let webpSupport = false;
try {
webpSupport = document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0;
} catch (e) {