accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject svn commit: r1604270 - /accumulo/site/trunk/content/downloads/index.mdtext
Date Fri, 20 Jun 2014 20:08:16 GMT
Author: ctubbsii
Date: Fri Jun 20 20:08:15 2014
New Revision: 1604270

URL: http://svn.apache.org/r1604270
Log:
ACCUMULO-1377 Improve download page with dynamic links

Modified:
    accumulo/site/trunk/content/downloads/index.mdtext

Modified: accumulo/site/trunk/content/downloads/index.mdtext
URL: http://svn.apache.org/viewvc/accumulo/site/trunk/content/downloads/index.mdtext?rev=1604270&r1=1604269&r2=1604270&view=diff
==============================================================================
--- accumulo/site/trunk/content/downloads/index.mdtext (original)
+++ accumulo/site/trunk/content/downloads/index.mdtext Fri Jun 20 20:08:15 2014
@@ -17,7 +17,7 @@ Notice:    Licensed to the Apache Softwa
            specific language governing permissions and limitations
            under the License.
 
-<script>
+<script type="text/javascript">
 /**
 * Function that tracks a click on an outbound link in Google Analytics.
 * This function takes a valid URL string as an argument, and uses that URL string
@@ -37,8 +37,61 @@ var trackOutboundLink = function(url) {
     return false;
   }
 };
+
+var createSection = function(name, items, divider = true) {
+  var section = ''; 
+  if (divider) {
+    section += '<li class="divider" <="" li=""> </li>';
+  }
+  section += '<li class="dropdown-header">' + name + '</li>';
+  for (var i = 0; i < items.length; i++) {
+    section += '<li><a href="#">' + items[i] + '</a></li>';
+  }
+  return section;
+};
+
+var updateLinks = function(mirror) {
+  $('a[link-suffix]').each(function(i, obj) {
+    $(obj).attr('href', mirror.replace(/\/+$/, "") + $(obj).attr('link-suffix'));
+  }); 
+};
+
+var mirrorsCallback = function(json) {
+  var mirrorSelection = $("#mirror_selection");
+  var htmlContent =  '<span class="help-block">Select a mirror:</span>' +
+    '<div class="btn-group">' +
+      '<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">'
+
+        '<span data-bind="label">' + json.preferred + '</span>&nbsp;<span
class="caret">' +
+      '</button>' +
+      '<ul class="dropdown-menu">';
+
+  htmlContent += createSection("Preferred Mirror (based on location)", [ json.preferred ],
false);
+  htmlContent += createSection("HTTP Mirrors", json.http);
+  htmlContent += createSection("FTP Mirrors", json.ftp);
+  htmlContent += createSection("Backup Mirrors", json.backup);
+
+  htmlContent += '</ul></div>';
+  mirrorSelection.html(htmlContent);
+
+  $("#mirror_selection a").click(function(event) {
+      var target=$(event.target);
+      var mirror=target.text();
+      updateLinks(mirror);
+      target.closest('.btn-group').find('[data-bind="label"]').text(mirror).end();
+  }); 
+
+  updateLinks(json.preferred);
+};
+
+// get mirrors when page is ready
+var mirrorURL = "http://www.apache.org/dyn/closer.cgi";
+$(function() { $.getJSON(mirrorURL + "?asjson=1", mirrorsCallback); }); 
+
 </script>
 
+<div id="mirror_selection"></div>
+<br />
+
 Be sure to verify your downloads by these [procedures][VERIFY_PROCEDURES] using these [KEYS][GPG_KEYS].
 
 ## Current Release
@@ -52,12 +105,12 @@ For convenience, [MD5][MD5SUM_160] and [
 <table class="table">
 <tr>
 <th>Generic Binaries</th>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.6.0/accumulo-1.6.0-bin.tar.gz"
onClick="return trackOutboundLink('/downloads/accumulo-1.6.0-bin.tar.gz');">accumulo-1.6.0-bin.tar.gz</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.6.0/accumulo-1.6.0-bin.tar.gz"
link-suffix="/accumulo/1.6.0/accumulo-1.6.0-bin.tar.gz" onClick="return trackOutboundLink('/downloads/accumulo-1.6.0-bin.tar.gz');">accumulo-1.6.0-bin.tar.gz</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.6.0/accumulo-1.6.0-bin.tar.gz.asc">ASC</a></td>
 </tr>
 <tr>
 <th>Source</th>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.6.0/accumulo-1.6.0-src.tar.gz"
onClick="return trackOutboundLink('/downloads/accumulo-1.6.0-src.tar.gz');">accumulo-1.6.0-src.tar.gz</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.6.0/accumulo-1.6.0-src.tar.gz"
link-suffix="/accumulo/1.6.0/accumulo-1.6.0-src.tar.gz" onClick="return trackOutboundLink('/downloads/accumulo-1.6.0-src.tar.gz');">accumulo-1.6.0-src.tar.gz</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.6.0/accumulo-1.6.0-src.tar.gz.asc">ASC</a></td>
 </tr>
 </table>
@@ -78,37 +131,37 @@ For convenience, [MD5][MD5SUM_151] and [
 <table class="table">
 <tr>
 <th>Generic Binaries</th>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-bin.tar.gz"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-bin.tar.gz');">accumulo-1.5.1-bin.tar.gz</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-bin.tar.gz"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-bin.tar.gz" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-bin.tar.gz');">accumulo-1.5.1-bin.tar.gz</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-bin.tar.gz.asc">ASC</a></td>
 </tr>
 <tr>
 <th rowspan="6">Platform Binaries</th>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-bin.rpm"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-bin.rpm');">accumulo-1.5.1-bin.rpm</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-bin.rpm"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-bin.rpm" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-bin.rpm');">accumulo-1.5.1-bin.rpm</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-bin.rpm.asc">ASC</a></td>
 </tr>
 <tr>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-native.rpm"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-native.rpm');">accumulo-1.5.1-native.rpm</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-native.rpm"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-native.rpm" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-native.rpm');">accumulo-1.5.1-native.rpm</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-native.rpm.asc">ASC</a></td>
 </tr>
 <tr>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-test.rpm"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-test.rpm');">accumulo-1.5.1-test.rpm</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-test.rpm"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-test.rpm" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-test.rpm');">accumulo-1.5.1-test.rpm</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-test.rpm.asc"asc>ASC</a></td>
 </tr>
 <tr>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-bin.deb"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-bin.deb');">accumulo-1.5.1-bin.deb</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-bin.deb"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-bin.deb" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-bin.deb');">accumulo-1.5.1-bin.deb</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-bin.deb.asc">ASC</a></td>
 </tr>
 <tr>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-native.deb"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-native.deb');">accumulo-1.5.1-native.deb</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-native.deb"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-native.deb" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-native.deb');">accumulo-1.5.1-native.deb</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-native.deb.asc">ASC</a></td>
 </tr>
 <tr>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-test.deb"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-test.deb');">accumulo-1.5.1-test.deb</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-test.deb"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-test.deb" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-test.deb');">accumulo-1.5.1-test.deb</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-test.deb.asc">ASC</a></td>
 </tr>
 <tr>
 <th>Source</th>
-<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-src.tar.gz"
onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-src.tar.gz');">accumulo-1.5.1-src.tar.gz</a></td>
+<td><a href="https://www.apache.org/dyn/closer.cgi/accumulo/1.5.1/accumulo-1.5.1-src.tar.gz"
link-suffix="/accumulo/1.5.1/accumulo-1.5.1-src.tar.gz" onClick="return trackOutboundLink('/downloads/accumulo-1.5.1-src.tar.gz');">accumulo-1.5.1-src.tar.gz</a></td>
 <td><a href="https://www.apache.org/dist/accumulo/1.5.1/accumulo-1.5.1-src.tar.gz.asc">ASC</a></td>
 </tr>
 </table>
@@ -145,4 +198,4 @@ Older releases can be found in the [arch
 [MD5SUM_160]: https://www.apache.org/dist/accumulo/1.6.0/MD5SUM "1.6.0 MD5 file hashes"
 
 [SHA1SUM_151]: https://www.apache.org/dist/accumulo/1.5.1/SHA1SUM "1.5.1 SHA1 file hashes"
-[SHA1SUM_160]: https://www.apache.org/dist/accumulo/1.6.0/SHA1SUM "1.6.0 SHA1 file hashes"
\ No newline at end of file
+[SHA1SUM_160]: https://www.apache.org/dist/accumulo/1.6.0/SHA1SUM "1.6.0 SHA1 file hashes"



Mime
View raw message