com web/php: Patch to allow you to click on the arrow on the downloads area and it taks you to the default .gz download. Unable to implement with
HTML5 so using JS to workaround the issue until a more elegant solution has been found: include/header.inc js/common.js

From: Date: Mon, 10 Jan 2011 22:01:19 +0000
Subject: com web/php: Patch to allow you to click on the arrow on the downloads area and it taks you to the default .gz download. Unable to implement with
HTML5 so using JS to workaround the issue until a more elegant solution has been found: include/header.inc js/common.js
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-23610@lists.php.net to get a copy of this message
Commit: c5a7d69cb4201a2766978043580ec5187aba67a5 Author: Paul Dragoonis <dragoonis@gmail.com> Mon, 10 Jan 2011 22:01:19 +0000 Parents: cdf9635e80e09f49d00cef6d068e760550a6cda8 Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=c5a7d69cb4201a2766978043580ec5187aba67a5 Log: Patch to allow you to click on the arrow on the downloads area and it taks you to the default .gz download. Unable to implement with HTML5 so using JS to workaround the issue until a more elegant solution has been found Changed paths: M include/header.inc M js/common.js Diff: diff --git a/include/header.inc b/include/header.inc index f073ef4..cfe754d 100644 --- a/include/header..inc +++ b/include/header.inc @@ -103,17 +103,17 @@ if (isset($shortname) && $shortname) { <div class="download"> <h2>Download PHP</h2> <?php if(!empty($RELEASES[5])): ?> - <ul> - <?php + <ul class="download-list"> +<?php foreach ($RELEASES[5] as $version => $release): $windowsVersionLink = substr($version, 0, strrpos($version, '.')); - ?> - <li> - <a href="/get/<?php echo $release['source'][1]['filename'] ?>/from/a/mirror" class="version" title="Download PHP">PHP <?php echo $version ?></a> - <a href="/get/<?php echo $release['source'][0]['filename'] ?>/from/a/mirror" title="Download bz2 version of PHP">Download as bz2</a> - <a href="http://windows.php.net/download/#php-<?php echo $windowsVersionLink; ?>" title="Download for windows">Download for windows</a> - <!-- (size) should go here, but it's not in version.inc at present --> - </li> +?> + <li rel="/get/<?php echo $release['source'][1]['filename'] ?>/from/a/mirror"> + <a href="/get/<?php echo $release['source'][1]['filename'] ?>/from/a/mirror" class="version" title="Download PHP">PHP <?php echo $version ?></a> + <a href="/get/<?php echo $release['source'][0]['filename'] ?>/from/a/mirror" title="Download bz2 version of PHP">Download as bz2</a> + <a href="http://windows.php.net/download/#php-<?php echo $windowsVersionLink; ?>" title="Download for windows">Download for windows</a> + <!-- (size) should go here, but it's not in version.inc at present --> + </li> <?php endforeach; ?> </ul> <?php endif; ?> diff --git a/js/common.js b/js/common.js index cef8466..b947ca6 100644 --- a/js/common.js +++ b/js/common.js @@ -25,6 +25,18 @@ $(document).ready(function() { document.cookie = "BetaWarning=off; expires=" + expiry.toGMTString() + "; path=/"; }); + // This is a temporary implementation so if you click on the Arrows on the Download area of the homepage + // That it takes you to the default .gz download. Could not apply HTML5's <a> tag to wrap around the <li> + // Because it contains <a> tags within it and the target conflicted. Using <li refl="#...'> to workaround this + // Until an elegant implementation is found. + var $homeDownload = $('div.download .download-list'); + if($homeDownload.length > 0) { + $homeDownload.find('li').bind('click', function() { + window.location.href = $(this).attr('rel').replace('#', ''); + }); + } + + if (showBetaWarning) { $headBetaWarning.show();

« previous php.webmaster (#23610) next »