From c93db77a36540cac99aa234b238505c0b45ce12a Mon Sep 17 00:00:00 2001
From: Andre Angelantoni
Date: Mon, 16 Sep 2024 14:58:55 -0600
Subject: [PATCH 1/4] 462: Merge jq_is_version_deprecated().
---
themes/jquery/functions.php | 41 +++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/themes/jquery/functions.php b/themes/jquery/functions.php
index cb0ead2f..a889eda2 100755
--- a/themes/jquery/functions.php
+++ b/themes/jquery/functions.php
@@ -252,6 +252,46 @@ function jq_image_posted_on() {
return $classes;
} );
+/*
+ * Determine if the current page is for a deprecated version of jQuery.
+ * We are concened with two URL structures:
+ * category/deprecated/deprecated-1.3/
+ * category/version/1.9/
+ *
+ * @returns int True or false
+ */
+function jq_is_version_deprecated($url) {
+ $parsedUrl = parse_url($url);
+ $path = $parsedUrl['path'];
+ $segments = explode('/', trim($path, '/'));
+
+ $versionLessThan3 = false;
+
+ if (count($segments) > 2) {
+ switch (strtolower($segments[1])) {
+ // Check first URL structure:
+ // category/deprecated/deprecated-1.3/
+ case 'deprecated':
+ // Obtain the version number from the third slug.
+ $version = floatval(substr($segments[2], 11));
+
+ if ($version < 3) $versionLessThan3 = true;
+
+ break;
+
+ // Check second URL structure:
+ // category/version/1.9/
+ case 'version':
+ $version = floatval($segments[2]);
+
+ if ($version < 3) $versionLessThan3 = true;
+
+ break;
+ }
+ }
+ return $versionLessThan3;
+}
+
/**
* Content Security Policy
*/
@@ -296,3 +336,4 @@ function jq_content_security_policy() {
}
add_action( 'send_headers', 'jq_content_security_policy' );
+
From d430bc9597d1426a3121157f25a3dcb89d0c43d8 Mon Sep 17 00:00:00 2001
From: Andre Angelantoni
Date: Mon, 16 Sep 2024 15:02:27 -0600
Subject: [PATCH 2/4] Merge CSS for warning box.
---
themes/api.jquery.com/style.css | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/themes/api.jquery.com/style.css b/themes/api.jquery.com/style.css
index 0e8a6999..b200f107 100755
--- a/themes/api.jquery.com/style.css
+++ b/themes/api.jquery.com/style.css
@@ -34,3 +34,14 @@ a {
margin-top: 0;
padding-left: 1em;
}
+
+/* Support warning at top of API pages */
+
+#support-warning-box {
+ padding-top: 8px;
+ padding-left: 8px;
+ padding-bottom: 8px;
+ display: flex;
+ position: relative;
+ z-index: 1;
+}
From 14a45271d0c55a755dc85a91d7d6aec7598c3379 Mon Sep 17 00:00:00 2001
From: Andre Angelantoni
Date: Mon, 16 Sep 2024 15:03:29 -0600
Subject: [PATCH 3/4] 462: New category page that shows warning box.
---
themes/api.jquery.com/category.php | 71 ++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100755 themes/api.jquery.com/category.php
diff --git a/themes/api.jquery.com/category.php b/themes/api.jquery.com/category.php
new file mode 100755
index 00000000..2a3d1fa2
--- /dev/null
+++ b/themes/api.jquery.com/category.php
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
' );
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 9450f7df39034ae5f655bdf493a7c7eebaa53826 Mon Sep 17 00:00:00 2001
From: Andre Angelantoni
Date: Mon, 16 Sep 2024 17:51:53 -0600
Subject: [PATCH 4/4] 462: Add menu, status message and other changes.
---
themes/jquery/css/base.css | 18 ++++++++++++++++++
themes/jquery/header.php | 8 ++++++++
themes/jquery/menu-header.php | 1 +
3 files changed, 27 insertions(+)
diff --git a/themes/jquery/css/base.css b/themes/jquery/css/base.css
index 86e8a7ca..b2aa7715 100644
--- a/themes/jquery/css/base.css
+++ b/themes/jquery/css/base.css
@@ -881,6 +881,24 @@ iframe {
margin: 0;
}
+/* Support message at top of page.
+ ========================================================================== */
+
+#support-message {
+ display: flex;
+ justify-content: center;
+ background-color: #dddddd;
+ padding: 4px 4px;
+ font-size: 15px;
+}
+#support-message span {
+ text-align: center;
+ padding-left: 20px;
+ padding-right: 20px;
+}
+#support-message span a {
+ color: #222;
+}
/* Global Nav
========================================================================== */
diff --git a/themes/jquery/header.php b/themes/jquery/header.php
index 2cba8285..1ad913b2 100755
--- a/themes/jquery/header.php
+++ b/themes/jquery/header.php
@@ -39,6 +39,14 @@
>
+
+
+
+
jQuery 4 is currently in beta. Soon jQuery 3 will reach EOL along with versions 1 and 2. Learn more about our Version Support.
+
+
+
+