Changeset 1532

Show
Ignore:
Timestamp:
03/08/08 02:00:46 (9 months ago)
Author:
jm3
Message:

now strips the first and/or last line of feed text if they are blank in order to account for clean formatting of the feed in the HTML without appending extra blank lines everywhere.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/frontispiece/index.html

    r1531 r1532  
    88        <script type="text/javascript" src="javascripts/moo.js"></script> 
    99        <script type="text/javascript" src="javascripts/say.js"></script> 
     10        <script type="text/javascript"> 
     11                window.addEvent('domready', function(){ 
     12                  type_text( "words",      "screen", 18, 10 ); 
     13                  type_text( "words_2",    "screen_2", 18, 50 ); 
     14                  type_text( "header_txt", "header", 18, 60 ); 
     15                }); 
     16        </script> 
    1017</head> 
    1118<body> 
     
    1724 
    1825<div id="header_txt" style="display: none;"> 
    19 FEED ME LINKS : A SOCIAL BOOKMARKING EXPERIMENT</div> 
     26 FEED ME LINKS : A SOCIAL BOOKMARKING EXPERIMENT 
     27 STATUS: COMPLETE 
     28</div> 
    2029 
    2130<div id="words" style="display: none;"> 
    2231THE DATE: 2002. 
     32LOCATION: SOMEWHERE IN THE MID-ATLANTIC 
    2333</div> 
    2434 
  • feedmelinks/frontispiece/javascripts/say.js

    r1524 r1532  
    11var s = ""; 
    22var words = "..."; 
     3 
     4function t(s) { 
     5        //console.log( s ); 
     6} 
    37 
    48function type_text( text, target, height, rate ) { 
     
    2024  var lines_in_target = multi_line_from_div( target ); 
    2125  if( lines_in_target && lines_in_target.length > $(target).height ) { 
    22     //console.log( "clipping" ); 
     26    t( "clipping" ); 
    2327    lines_in_target.shift(); 
    2428    $(target).innerHTML = lines_in_target.join(""); 
     
    2832  line = line.substring( 1, line.length); 
    2933 
    30   //console.log( line.length + " characters in line" ); 
    31   //console.log( lines.length + " lines in story" ); 
     34  t( line.length + " characters in line" ); 
     35  t( lines.length + " lines in story" ); 
    3236 
    3337  type_by_letter( line, lines, target, rate ); 
     
    3640function type_by_letter( line, lines, target, rate ) { 
    3741  if( ! line || ! lines || line.length < 1 ) { 
    38     //console.log( "writing new line" ); 
     42    t( "writing new line" ); 
    3943    $(target).innerHTML += "\n";  
    4044    setTimeout( function() { type_line( lines, target, rate);} , rate); // next line 
     
    5357  if( lines ) 
    5458    lines = lines.split( /$/m ); 
     59                if( lines && lines.length && lines[0].match( /^\s*$/ )) { 
     60                        t( "trimming empty initial line from " + div ); 
     61                        lines.shift(); 
     62                } 
     63 
     64        if( lines && lines.length > 1 && lines[lines.length-1].match( /^\s*$/ )) { 
     65                t( "trimming empty final line from " + div ); 
     66                lines.pop(); 
     67        } 
    5568  return lines; 
    5669} 
    57  
    58 window.addEvent('domready', function(){ 
    59   type_text( "words",      "screen", 18, 10 ); // last is height 
    60   type_text( "words_2",    "screen_2", 18, 50 ); // last is height 
    61   type_text( "header_txt", "header", 18, 60 ); // last is height 
    62 }); 
    63  
  • feedmelinks/frontispiece/stylesheets/yeah.css

    r1527 r1532  
    1818#header { 
    1919  font-size: 22px; 
    20   font-weight: bold; 
    21   color: #00ff00; 
    22   background-color: #000; 
     20  color: purple; 
    2321} 
     22 
    2423#screen { 
    2524  width: 600px; 
    2625  float: left; 
    2726} 
     27 
    2828#screen_2 { 
    2929  width: 600px;