bbs-reader.js
function makeHead(lLabel, lText, rLabel, rText) {
    if (!lText) {
        return "";
    }
    
    var fillSpace = 78, result = "<div class='line'>";
    
    fillSpace -= 2 + lLabel.length + 1 + lText.length;
    
    if (rText) {
        fillSpace -= 2 + rLabel.length + 2 + rText.length;
    }
    
    if (fillSpace < 0) {
        fillSpace = 0;
    }
    
    var span = new Span(4, 7, false);
    
    span.text = " " + lLabel + " ";
    
    result += span.toString();
    
    span.f = 7;
    span.b = 4;
    span.text = " " + lText + " ".repeat(fillSpace);
    
    result += span.toString();
    
    // result += makeSpan({f:4,b:7,text:" "+lLabel+" "}) + makeSpan({f:7,b:4,text:" "+lText+" ".repeat(fillSpace)});
    
    if (rText) {
        span.f = 4;
        span.b = 7;
        span.text = " " + rLabel + " ";
        
        result += span.toString();
        
        span.f = 7;
        span.b = 4;
        span.text = " " + rText + " ";
        
        result += span.toString();
        // result += makeSpan({f:4,b:7,text:" "+rLabel+" "}) + makeSpan({f:7,b:4,text:" "+rText+" "});
    }
    
    result += "</div>";
    
    return result;
}
function makeHead(lLabel, lText, rLabel, rText) {
    if (!lText) {
        return "";
    }
    
    var fillSpace = 78, result = "<div class='line'>";
    
    fillSpace -= 2 + lLabel.length + 1 + lText.length;
    
    if (rText) {
        fillSpace -= 2 + rLabel.length + 2 + rText.length;
    }
    
    if (fillSpace < 0) {
        fillSpace = 0;
    }
    
    var span = new Span(4, 7, false);
    
    span.text = " " + lLabel + " ";
    
    result += span.toString();
    
    span.f = 7;
    span.b = 4;
    span.text = " " + lText + " ".repeat(fillSpace);
    
    result += span.toString();
    
    // result += makeSpan({f:4,b:7,text:" "+lLabel+" "}) + makeSpan({f:7,b:4,text:" "+lText+" ".repeat(fillSpace)});
    
    if (rText) {
        span.f = 4;
        span.b = 7;
        span.text = " " + rLabel + " ";
        
        result += span.toString();
        
        span.f = 7;
        span.b = 4;
        span.text = " " + rText + " ";
        
        result += span.toString();
        // result += makeSpan({f:4,b:7,text:" "+rLabel+" "}) + makeSpan({f:7,b:4,text:" "+rText+" "});
    }
    
    result += "</div>";
    
    return result;
}
function makeHead ( lLabel , lText , rLabel , rText ) { if ( ! lText ) { return "" ; } var fillSpace = 78 , result = "<div class='line'>" ; fillSpace -= 2 + lLabel . length + 1 + lText . length ; if ( rText ) { fillSpace -= 2 + rLabel . length + 2 + rText . length ; } if ( fillSpace < 0 ) { fillSpace = 0 ; } var span = new Span ( 4 , 7 , false ) ; span . text = " " + lLabel + " " ; result += span . toString ( ) ; span . f = 7 ; span . b = 4 ; span . text = " " + lText + " " . repeat ( fillSpace ) ; result += span . toString ( ) ; // result += makeSpan({f:4,b:7,text:" "+lLabel+" "}) + makeSpan({f:7,b:4,text:" "+lText+" ".repeat(fillSpace)}); if ( rText ) { span . f = 4 ; span . b = 7 ; span . text = " " + rLabel + " " ; result += span . toString ( ) ; span . f = 7 ; span . b = 4 ; span . text = " " + rText + " " ; result += span . toString ( ) ; // result += makeSpan({f:4,b:7,text:" "+rLabel+" "}) + makeSpan({f:7,b:4,text:" "+rText+" "}); } result += "</div>" ; return result ; }
create head line
create head line