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 @@ + + + +
+
+ + +
' ); + } + ?> + + + + + + + + + +
+
+

+
+ +
+

+
+
+ + +
+ + + + + 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; +} 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/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' ); + 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. +
+ + +