+
diff --git a/js/archive.js b/js/archive.js
index 965ad3ddbf..76ba191238 100644
--- a/js/archive.js
+++ b/js/archive.js
@@ -4,7 +4,6 @@ layout: null
/* Only run this if we are online*/
if (window.navigator.onLine) {
- var dockerVersion = 'v{{ site.engine_version }}';
var suppressButterBar = false;
/* This JSON file contains a current list of all docs versions of Docker */
$.getJSON("/js/archives.json", function(result){
@@ -33,10 +32,16 @@ if (window.navigator.onLine) {
}
});
// only append the butterbar if we are NOT the current version
+ // Also set the isArchive variable to true if it's an archive. It defaults
+ // to true, set in _layouts/docs.html. We default to true because it looks
+ // better in CSS to show stuff than to hide stuff onLoad.
if ( suppressButterBar == false ) {
$( 'body' ).prepend(outerDivStart + buttonCode + listStart + listItems.join("") + listEnd + outerDivEnd);
+ isArchive = true;
+ console.log("Detected that this is an archive.");
} else {
- console.log("Suppressing the archive versions bar");
+ isArchive = false;
+ console.log("This is not an archive. Suppressing the archive versions bar");
}
});
}
\ No newline at end of file
diff --git a/js/docs.js b/js/docs.js
index 2a45fbb80c..fcaf92f90e 100644
--- a/js/docs.js
+++ b/js/docs.js
@@ -292,6 +292,26 @@ window.onload = function() {
var group = $(this).attr('data-group');
$('.nav-tabs > li > a[data-group="'+ group +'"]').tab('show');
})
+
+ // isArchive is set by logic in archive.js
+ if ( isArchive == false ) {
+ console.log("Showing content that should only be in the current version.");
+ // Hide elements that are not appropriate for archives
+ // PollDaddy
+ $('#ratings-div').css("visibility","visible");
+ console.log("Ratings widget shown.");
+ // Archive drop-down
+ $('.ctrl-right .btn-group').css("visibility","visible");
+ console.log("Archive widget shown.");
+ // Swarch
+ $('.search-form').css("visibility","visible");
+ console.log("Search widget shown.");
+ // Page edit link
+ $('.feedback-links li').first().css("visibility","visible");
+ console.log("Page edit link shown.");
+ } else {
+ console.log("Keeping non-applicable elements hidden.");
+ }
};
$('.glossLink').popover();