<!-- ======================== -->
<!-- CSS for the button block -->
<style type="text/css">
.div_expand-collapse_all {
text-align:center;
font-size:.8em;
color:#EDEDED;
border-radius:.3em;
border-width:thin;
border-style:solid;
border-color:#cce9cd;
background-color:#077CC1;
position:fixed;
bottom:0;
right:0;
padding:.5em;
z-index:200;
}
.div_expand-collapse_all:before {
content:"Expand or collapse all sections"
}
.buttons_expand-collapse_all {
font-size:.8em;
margin-top:.2em;
}
</style>
<!-- ======================================= -->
<!-- "Expand All" and "Collapse All" buttons -->
<div class="div_expand-collapse_all"><br />
<button class="buttons_expand-collapse_all" name="expandAll" id="expandAll" type="button">Expand All</button>
<button class="buttons_expand-collapse_all" name="collapseAll" id="collapseAll" type="button">Collapse All</button>
</div>
<!-- =================== -->
<!-- "Expand All" script -->
<script type="text/javascript">
AJS.toInit(function() {
AJS.$('#expandAll').click(function() {
AJS.$('.expand-container').each(function() {
if (AJS.$('.expand-content', this).css('display', 'none').css('opacity', '0')) {
AJS.$('.expand-control .expand-control-icon', this).addClass('expanded');
AJS.$('.expand-content', this).removeClass('expand-hidden');
AJS.$('.expand-content', this).css('display', 'block');
AJS.$('.expand-content', this).css('opacity', '1');
}
});
});
});
</script>
<!-- ===================== -->
<!-- "Collapse All" script -->
<script type="text/javascript">
AJS.toInit(function() {
AJS.$('#collapseAll').click(function() {
AJS.$('.expand-container').each(function() {
if (AJS.$('.expand-content', this).css('display', 'block').css('opacity', '1')) {
AJS.$('.expand-control .expand-control-icon', this).removeClass('expanded');
AJS.$('.expand-content', this).addClass('expand-hidden');
AJS.$('.expand-content', this).css('display', 'none');
AJS.$('.expand-content', this).css('opacity', '0');
}
});
});
});
</script>
<script>
var expandAnchor = function() {
var hash = decodeURIComponent(window.location.hash);
if (hash) {
var hashPageTitle = AJS.params.pageTitle.split(" ").join("");
if (hash.indexOf(hashPageTitle) === -1) {
if (jQuery.isNumeric(hashPageTitle.substring(0,1))) {
hash = "#id-" + hashPageTitle + "-" + hash.slice(1);
} else {
hash = "#" + hashPageTitle + "-" + hash.slice(1);
}
}
var escapedId = hash.replace(/[!"$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g, "\\$&");
jQuery(escapedId).parents('.expand-container').children('.expand-hidden').prev().click();
window.location.href=hash;
}
}
AJS.toInit(function() {
// handle initial page load
expandAnchor();
// use polling because hashchange event doesn't fire for some reason
function hashHandler(){
this.oldHash = window.location.hash;
this.Check;
var that = this;
var detect = function(){
if(that.oldHash!=window.location.hash){
console.log("HASH CHANGED - new has" + window.location.hash);
expandAnchor();
that.oldHash = window.location.hash;
}
};
this.Check = setInterval(function(){ detect() }, 100);
}
var hashDetection = new hashHandler();
});
</script>
<style>
.expand-control-text {
font-size:130%;
color:#077CC1
}
</style> |