/*jslint plusplus: true, white: true, indent: 2, maxlen: 90 */
/**
* @author Wolfgang Kowarschick
* @copyright 2013, Wolfgang Kowarschick
* <br/>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted under the terms of the
* Creative Commons License Attribution-NonCommercial-ShareAlike 3.0 Unported
* (CC BY-NC-SA 3.0: http://creativecommons.org/licenses/by-nc-sa/3.0/).
*/
(function($wk$, document)
{ "use strict";
/**
* @class
* @name $wk$.Terminal1
* @param {String} p_terminal_id
* The identifier of the div element where the lines are to be
* printed.
*/
function Terminal(p_terminal_id) // constructor function
{ this.v_terminal = document.getElementById(p_terminal_id);
};
Terminal.author = "W. Kowa"; // not useful
Terminal.prototype =
{ /**
* Prints a line on the terminal.
* @param {String[]} arguments The strings to be printed.
*/
println:
function()
{ var i, n,
l_p = document.createElement("p"),
l_text = "",
l_sep = "";
for (i = 0, n = arguments.length; i < n; i++)
{ l_text += l_sep + arguments[i];
l_sep = ", ";
}
l_p.appendChild(document.createTextNode(l_text));
this.v_terminal.appendChild(l_p);
}
};
$wk$.Terminal1 = Terminal;
}(this.$wk$, this.document));