View Single Post
Old 01-05-2008, 10:17 PM   #20 (permalink)
jdspc
Jeffesis
 
jdspc's Avatar
 
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,294
iTrader: 0 / 0%
Latest Blog:
Hear Silence

jdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web projdspc is a highly respected web pro
Each index.template.php will vary according to the mods installed but..
on mine starting at line 471 is the following;
Look for a comment with
Code:
// Unfortunately, Safari does not have...
scroll down and insert the line
Code:
include("mykontera.inc");
after the last </div> before the comment on AJAX (see below)


PHP Code:
        // Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
        
if ($context['browser']['is_safari'])
            echo 
'
            window.addEventListener("load", smf_codeFix, false);

            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = 0; i < codeFix.length; i++)
                {
                    if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
                        codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
                }
            }'
;
        elseif (
$context['browser']['is_firefox'])
            echo 
'
            window.addEventListener("load", smf_codeFix, false);
            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = 0; i < codeFix.length; i++)
                {
                    if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
                        codeFix[i].style.overflow = "scroll";
                }
            }'
;            
        else
            echo 
'
            var window_oldOnload = window.onload;
            window.onload = smf_codeFix;

            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = codeFix.length - 1; i > 0; i--)
                {
                    if (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].className == "code"))
                        codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
                }

                if (window_oldOnload)
                {
                    window_oldOnload();
                    window_oldOnload = null;
                }
            }'
;

        echo 
'
        // ]]></script>'
;
    }

    echo 
'
    </div>'
;
include(
"mykontera.inc");
    
// The following will be used to let the user know that some AJAX process is running
    
echo '
    <div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</body></html>'
;

Then upload the file you made earlier containing the kontera js that you named mykontera.inc to the folder of your theme...ie themes/default

This is the easiest method.

Let me know and holler with any questions.
__________________
It isn't necessary to imagine the world ending in fire or ice – there are two other possibilities: one is paperwork, and the other is nostalgia.
1989: Zappa
jdspc is offline   Reply With Quote