diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ab794f30d..483be96a4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: "v3.19.0" + rev: "v3.19.1" hooks: - id: pyupgrade args: [--py312] diff --git a/djangoproject/scss/_style.scss b/djangoproject/scss/_style.scss index 27bf24b36..014b09bb0 100644 --- a/djangoproject/scss/_style.scss +++ b/djangoproject/scss/_style.scss @@ -483,6 +483,10 @@ blockquote { } + .meta::selection { + color: var(--white-color); + } + .logo { @include font-size(40); @include sans-serif; diff --git a/djangoproject/static/js/djangoproject.js b/djangoproject/static/js/djangoproject.js index 474231d6d..f6e9229eb 100644 --- a/djangoproject/static/js/djangoproject.js +++ b/djangoproject/static/js/djangoproject.js @@ -4,3 +4,10 @@ document.querySelectorAll('.doc-switcher li.current').forEach(function (el) { this.parentElement.classList.toggle('open'); }); }); + +// Propagate the current fragment identifier when switching docs versions +document.querySelectorAll('#doc-versions a').forEach(function (el) { + el.addEventListener('click', function () { + this.href = this.href.split('#')[0] + window.location.hash; + }); +}); diff --git a/djangoproject/static/js/main.js b/djangoproject/static/js/main.js index 8d9dd2797..a51dcd812 100644 --- a/djangoproject/static/js/main.js +++ b/djangoproject/static/js/main.js @@ -19,10 +19,6 @@ define(function () { mods.push('mod/list-collapsing'); } - if (hasClass('version-switcher')) { - mods.push('mod/version-switcher'); - } - if (hasClass('doc-floating-warning')) { mods.push('mod/floating-warning'); } diff --git a/djangoproject/static/js/mod/version-switcher.js b/djangoproject/static/js/mod/version-switcher.js deleted file mode 100644 index b494c9597..000000000 --- a/djangoproject/static/js/mod/version-switcher.js +++ /dev/null @@ -1,25 +0,0 @@ -define([ - 'jquery', //requires jquery -], function ($) { - var VersionSwitcher = function (switcher) { - this.switcher = $(switcher); // the version switcher - this.init(); - }; - - VersionSwitcher.prototype = { - init: function () { - var self = this; - $(document).ready(function () { - // Propagate the fragment identifier to the links in the version switcher - self.switcher.find('a').on('click', function () { - var hrefWithoutFragment = this.href.split('#')[0]; - this.href = hrefWithoutFragment + window.location.hash; - // do nothing and let the event bubble up - }); - }); - }, - }; - - // Export a single instance of our module: - return new VersionSwitcher('#doc-versions'); -}); diff --git a/djangoproject/templates/base.html b/djangoproject/templates/base.html index 896483b61..57e76365f 100644 --- a/djangoproject/templates/base.html +++ b/djangoproject/templates/base.html @@ -154,7 +154,6 @@ "mod/list-collapsing": extless("{% static 'js/mod/list-collapsing.js' %}"), "mod/list-feature": extless("{% static 'js/mod/list-feature.js' %}"), "mod/mobile-menu": extless("{% static 'js/mod/mobile-menu.js' %}"), - "mod/version-switcher": extless("{% static 'js/mod/version-switcher.js' %}"), "mod/search-key": extless("{% static 'js/mod/search-key.js' %}"), "mod/stripe-change-card": extless("{% static 'js/mod/stripe-change-card.js' %}"), "mod/switch-dark-mode": extless("{% static 'js/mod/switch-dark-mode.js' %}"), diff --git a/requirements/common.txt b/requirements/common.txt index 93793d5b5..03e2fc5ca 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -10,7 +10,7 @@ django-registration-redux==2.13 Django==5.0.9 docutils==0.21.2 feedparser==6.0.11 -Jinja2==3.1.4 +Jinja2==3.1.5 libsass==0.23.0 Markdown==3.7 Pillow==11.0.0