From 39a696fc7cf9754007cc00dac7c92068aeb20018 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sat, 10 Jul 2021 16:31:16 +1000 Subject: [PATCH] Diff page - use the document title in for better bookmarking --- backend/__init__.py | 3 ++- backend/store.py | 2 ++ backend/templates/base.html | 2 +- backend/templates/diff.html | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/__init__.py b/backend/__init__.py index 5d7b0dd1..c48ce1ba 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -611,7 +611,8 @@ def changedetection_app(config=None, datastore_o=None): uuid=uuid, newest_version_timestamp=dates[0], current_previous_version=str(previous_version), - current_diff_url=watch['url']) + current_diff_url=watch['url'], + extra_title=" - Diff - {}".format(watch['title'] if watch['title'] else watch['url'])) return output diff --git a/backend/store.py b/backend/store.py index 0289dd7d..7ddabb76 100644 --- a/backend/store.py +++ b/backend/store.py @@ -191,6 +191,8 @@ class ChangeDetectionStore: if not self.__data['watching'][uuid]['title']: self.__data['watching'][uuid]['title'] = None + + self.__data['has_unviewed'] = has_unviewed return self.__data diff --git a/backend/templates/base.html b/backend/templates/base.html index 7fd21898..612e1b47 100644 --- a/backend/templates/base.html +++ b/backend/templates/base.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Self hosted website change detection."> - <title>Change Detection + Change Detection{{extra_title}} {% if extra_stylesheets %} diff --git a/backend/templates/diff.html b/backend/templates/diff.html index 57776b6c..3d5cee16 100644 --- a/backend/templates/diff.html +++ b/backend/templates/diff.html @@ -130,7 +130,8 @@ if ('oninput' in a) { function onDiffTypeChange(radio) { window.diffType = radio.value; - document.title = "Diff " + radio.value.slice(4); +// Not necessary +// document.title = "Diff " + radio.value.slice(4); } var radio = document.getElementsByName('diff_type');