CIRCServer.splitLinesForSending Member
Please keep this in mind when editing:
Syntax
object.splitLinesForSending(line);
Arguments
Argument | Summary |
---|---|
line |
Returns
Remarks
See Also
Source Code
function my_splitlinesforsending(line)
{
var lines = line.split("\n");
var realLines = new Array();
for (var i = 0; i < lines.length; i++)
{
if (lines[i])
{
while (lines[i].length > this.maxLineLength)
{
var extraLine = lines[i].substr(0, this.maxLineLength - 5);
var pos = extraLine.lastIndexOf(" ");
if ((pos >= 0) && (pos >= this.maxLineLength - 15))
{
// Smart-split.
extraLine = lines[i].substr(0, pos) + "...";
lines[i] = "..." + lines[i].substr(extraLine.length - 2);
}
else
{
// Dump-split.
extraLine = lines[i].substr(0, this.maxLineLength);
lines[i] = lines[i].substr(extraLine.length);
}
realLines.push(extraLine);
}
realLines.push(lines[i]);
}
}
return realLines;
}