Don't know
... lets add a big code block so we can see what it does !
$(document).ready(function() {
// menu drop downs
$('ul.dropmenu, ul.quickbuttons').superfish({delay : 600, speed: 200, sensitivity : 8, interval : 50, timeout : 1});
// tooltips
$('.preview').SiteTooltip();
// find all nested linked images and turn off the border
$('a.bbc_link img.bbc_img').parent().css('border', '0');
$expand_link = $('.codeexpand');
if ($expand_link.length != 0)
{
$expand_link.click(function () {
var text = $(this).parent().parent().find('.bbc_code');
contentOverlayDiv(text.html());
});
}
});
function contentOverlayDiv(box_content, sHeader, sIcon)
{
// Set up our div details
var sAjax_indicator = '<div class="centertext"><img src="' + smf_images_url + '/loading.gif" ></div>';
var sIcon = smf_images_url + '/' + (typeof(sIcon) == 'string' ? sIcon : 'helptopics.png');
var sHeader = typeof(sHeader) == 'string' ? sHeader : code_popup_heading_text;
// Create the div that we are going to load
var oContainer = new smc_Popup({heading: sHeader, content: sAjax_indicator, icon: sIcon, css: {position: '', margin: '5%', width: '90%', height: '90%'}});
var oPopup_body = $('#' + oContainer.popup_id).find('.popup_content');
oPopup_body.html(box_content);
oPopup_body.css({"max-height": '90%'});
}
// The purpose of this code is to fix the height of overflow: auto blocks, because some browsers can't figure it out for themselves.
function smf_codeBoxFix()
{
var codeFix = document.getElementsByTagName('code');
for (var i = codeFix.length - 1; i >= 0; i--)
{
if (is_webkit && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + 'px';
else if (is_ff && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = 'scroll';
else if ('currentStyle' in codeFix[i] && codeFix[i].currentStyle.overflow == 'auto' && (codeFix[i].currentStyle.height == '' || codeFix[i].currentStyle.height == 'auto') && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0))
codeFix[i].style.height = (codeFix[i].offsetHeight + 24) + 'px';
}
}
// Add a fix for code stuff?
if (is_ie || is_webkit || is_ff)
addLoadEvent(smf_codeBoxFix);
// Toggles the element height and width styles of an image.
function smc_toggleImageDimensions()
{
var oImages = document.getElementsByTagName('IMG');
for (oImage in oImages)
{
// Not a resized image? Skip it.
if (oImages[oImage].className == undefined || oImages[oImage].className.indexOf('bbc_img resized') == -1)
continue;
oImages[oImage].style.cursor = 'pointer';
oImages[oImage].onclick = function() {
this.style.width = this.style.height = this.style.width == 'auto' ? null : 'auto';
};
}
}
// Add a load event for the function above.
addLoadEvent(smc_toggleImageDimensions);
// Adds a button to a certain button strip.
function smf_addButton(sButtonStripId, bUseImage, oOptions)
{
var oButtonStrip = document.getElementById(sButtonStripId);
var aItems = oButtonStrip.getElementsByTagName('span');
// Remove the 'last' class from the last item.
if (aItems.length > 0)
{
var oLastSpan = aItems[aItems.length - 1];
oLastSpan.className = oLastSpan.className.replace(/\s*last/, 'position_holder');
}
// Add the button.
var oButtonStripList = oButtonStrip.getElementsByTagName('ul')[0];
var oNewButton = document.createElement('li');
if ('sId' in oOptions)
oNewButton.id = oOptions.sId
setInnerHTML(oNewButton, '<a href="' + oOptions.sUrl + '" ' + ('sCustom' in oOptions ? oOptions.sCustom : '') + '><span class="last"' + ('sId' in oOptions ? ' id="' + oOptions.sId + '_text"': '') + '>' + oOptions.sText + '</span></a>');
oButtonStripList.appendChild(oNewButton);
}
In FF it has the little handle in the lower right of the code box ...