svn: /web/php/trunk/ include/header.inc js/common.js

[email protected] (Paul Dragoonis)
Newsgroups php.webmaster
Message-ID <[email protected]>
dragoonis                                Mon, 10 Jan 2011 22:01:19 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=307357

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:
    U   web/php/trunk/include/header.inc
    U   web/php/trunk/js/common.js

Modified: web/php/trunk/include/header.inc
===================================================================
--- web/php/trunk/include/header.inc	2011-01-10 21:18:54 UTC (rev 307356)
+++ web/php/trunk/include/header.inc	2011-01-10 22:01:19 UTC (rev 307357)
@@ -103,17 +103,17 @@
         <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; ?>

Modified: web/php/trunk/js/common.js
===================================================================
--- web/php/trunk/js/common.js	2011-01-10 21:18:54 UTC (rev 307356)
+++ web/php/trunk/js/common.js	2011-01-10 22:01:19 UTC (rev 307357)
@@ -25,7 +25,19 @@
         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();
         $('body').css('margin-top', '25px');
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.