Changeset 15189


Ignore:
Timestamp:
03/30/13 12:20:49 (12 years ago)
Author:
tbretz
Message:
Updated to include 'to top' and 'to bottom' links
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/showlog.php

    r15112 r15189  
    6161}
    6262
     63/*
    6364function ascii2entities($string)
    6465{
     
    7273    return $string;
    7374}
     75*/
    7476
    7577function ansi_decode($matches)
     
    253255    // font-weight property.
    254256    if ($styles['bold'] && is_null($styles['color']))
    255         $css .= ($css ? ';' : '') . 'font-weight: bold';
     257        $css .= ($css ? ';' : '') . 'font-weight:bold';
    256258
    257259    // color property.
     
    274276    // Replace database strings
    275277    $str = preg_replace("/\ (([[:word:].-]+)(:[^ ]+)?(@))?([[:word:].-]+)(:([[:digit:]]+))?(\/([[:word:].-]+))/", " $2$4$5$8", $str);
     278
    276279    // Replace special characters to their corresponding HTML entities
    277     $str = ascii2entities($str);
     280    //$str = ascii2entities($str);
     281    $str = htmlentities($str, ENT_NOQUOTES);
     282
    278283    // Replace ANSI codes.
    279284    $str = preg_replace_callback('/(?:\e\[\d+(?:;\d+)*m)+/', 'ansi_decode', "$str\033[0m");
     285
    280286    // Strip ASCII bell.
    281     $str = str_replace("\007", '', $str);
     287    // $str = str_replace("\007", '', $str);
     288
    282289    // Replace \n
    283290    // $str = str_replace("\n", "<br/>\n", $str);
     291
    284292    // Return the parsed string.
    285293    return $str;
     
    338346   print("<meta http-equiv='refresh' content='".$refresh."'>\n");
    339347?>
     348<meta charset="UTF-8">
    340349<title><?php print($dir." - ".$name);?></title>
    341 </head>
    342 
    343350<script>
    344351function scroll(top)
     
    347354}
    348355</script>
     356</head>
    349357<body onload="setTimeout(function(){scroll(false);},1);">
    350358<span onclick="scroll(true);" style="cursor:pointer;padding:0 5px 4px 7px;position:fixed;top:0;right:0;text-decoration:underline;color:navy;background-color:#f0f0f0;">go to top &uarr;</span>
     
    355363<?php
    356364foreach ($file as $line)
    357     print(ansi2html($line));
     365    print(ansi2html(substr($line, 0, -1))."\n");
    358366?>
    359 </pre><span id="bottom""/></body>
     367
     368</pre>
     369<span id="bottom"></span>
     370</body>
    360371</html>
Note: See TracChangeset for help on using the changeset viewer.