Ignore:
Timestamp:
10/19/08 17:29:07 (4 years ago)
Author:
hverton
Message:

fixed layout issue with long code lines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/ExiteCMS/tracsvn/php-files/modules/tracsvn/templates/modules.tracsvn.svn.tpl

    r1879 r1880  
    1515{*                                                                         *} 
    1616{***************************************************************************} 
    17 {include file="_openside_x.tpl" name=$_name title=$locale.400 state=$_state style=$_style} 
     17{include file="_opentable_x.tpl" name=$_name title=$locale.400 state=$_state style=$_style} 
    1818{if $file} 
    1919    <table cellspacing='0' cellpadding='0' align='center' width='100%'> 
     
    2929        </tr> 
    3030    </table> 
    31     <br /> 
    3231    {if $is_source} 
    3332        {literal} 
     
    7473        </style> 
    7574        {/literal} 
    76         {$output} 
     75        <div id='codeblock.0' style='width:400px;'>{$output}</div> 
    7776    {else} 
    7877        <table cellspacing='0' cellpadding='0' align='center' width='100%'> 
    7978            <tr> 
    8079                <td class='tbl' align='center'> 
    81                     {$output.0} 
     80                    <div id='codeblock.0' style='width:400px;'>{$output.0}</div> 
    8281                </td> 
    8382            </tr> 
     
    198197        {if $smarty.section.id.first} 
    199198            <br /> 
    200             <table cellspacing='1' cellpadding='0' align='center' width='100%' class='tbl-border'> 
     199            <table cellspacing='1' cellpadding='0' align='center' class='tbl-border'> 
    201200        {/if} 
    202201        <tr> 
     
    235234                {assign var=linecolor value=""} 
    236235            {/if} 
    237             <td class='tbl1' align='left' width='94%' style='font-family:monospace;font-size:100%;{$linecolor}'> 
     236            <td class='tbl1' align='left' width='94%' style='font-family:monospace;font-size:120%;{$linecolor}'> 
    238237                {if $diffs[id].output[nr].line != ""} 
    239                     <div style='float:left;white-space:nowrap;overflow:hidden;text-overflow:clip;'>{$diffs[id].output[nr].line}</div> 
     238                    <div id='codeblock.{$smarty.section.id.index}' style='float:left;width:400px;white-space:nowrap;overflow:hidden;text-overflow:clip;'>{$diffs[id].output[nr].line}</div> 
    240239                {/if} 
    241240            </td> 
     
    297296    </table> 
    298297{/if} 
    299 {include file="_closeside_x.tpl"} 
     298{include file="_closetable_x.tpl"} 
     299<script type='text/javascript'> 
     300{literal} 
     301// Dean Edwards/Matthias Miller/John Resig 
     302function init() { 
     303    // quit if this function has already been called 
     304    if (arguments.callee.done) return; 
     305 
     306    // flag this function so we don't do the same thing twice 
     307    arguments.callee.done = true; 
     308 
     309    // kill the timer 
     310    if (_timer) clearInterval(_timer); 
     311 
     312    // needed inside the loop 
     313    var parent_left = 0; 
     314    var parent_width = 0; 
     315    var obj = 1; 
     316    var i = 0; 
     317 
     318    // set the width correctly 
     319    while (document.getElementById("codeblock." + i) != null) { 
     320        // get the info about the objects parent 
     321        obj = document.getElementById("codeblock." + i).parentNode; 
     322        // fall back gracefully if the parentNode can not be found 
     323        if (obj == null) obj = document.getElementById("codeblock." + i).offsetParent; 
     324        parent_left = findPosX(obj); 
     325        parent_width = obj.offsetWidth; 
     326        // calculate the new width of the block, leave plenty of space to handle browser subtleties  
     327        block_width = parent_left + parent_width - findPosX(document.getElementById("codeblock." + i)) - 20; 
     328        // adjust the width of the code blocks 
     329        document.getElementById("codeblock." + i).style.width = block_width + "px"; 
     330        i++; 
     331    } 
     332}; 
     333 
     334/* for Mozilla/Opera9 */ 
     335if (document.addEventListener) { 
     336    document.addEventListener("DOMContentLoaded", init, false); 
     337} 
     338 
     339/* for Internet Explorer */ 
     340/*@cc_on @*/ 
     341/*@if (@_win32) 
     342    document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>"); 
     343    var script = document.getElementById("__ie_onload"); 
     344    script.onreadystatechange = function() { 
     345        if (this.readyState == "complete") { 
     346            init(); // call the onload handler 
     347        } 
     348    }; 
     349/*@end @*/ 
     350 
     351/* for Safari and Konqueror */ 
     352if (/KHTML|WebKit/i.test(navigator.userAgent)) { // sniff 
     353    var _timer = setInterval(function() { 
     354        if (/loaded|complete/.test(document.readyState)) { 
     355            init(); // call the onload handler 
     356        } 
     357    }, 10); 
     358} 
     359 
     360/* other alternatives */ 
     361if (window.attachEvent) { 
     362    window.attachEvent('onload', init); 
     363} else if (window.addEventListener) { 
     364    window.addEventListener('load', init, false); 
     365} 
     366 
     367/* if all else fails try this */ 
     368window.onload = init; 
     369{/literal} 
     370</script> 
    300371{***************************************************************************} 
    301372{* End of template                                                         *} 
Note: See TracChangeset for help on using the changeset viewer.