add newLineCharacter argument to getValue

This commit is contained in:
nightwing 2014-11-11 11:45:20 +04:00
commit 64f2fc4015

View file

@ -83,8 +83,8 @@ var Document = function(textOrLines) {
/** /**
* Returns all the lines in the document as a single string, joined by the new line character. * Returns all the lines in the document as a single string, joined by the new line character.
**/ **/
this.getValue = function() { this.getValue = function(newLineCharacter) {
return this.getAllLines().join(this.getNewLineCharacter()); return this.getAllLines().join(newLineCharacter || this.getNewLineCharacter());
}; };
/** /**
@ -213,8 +213,8 @@ var Document = function(textOrLines) {
* *
* @returns {String} * @returns {String}
**/ **/
this.getTextRange = function(range) { this.getTextRange = function(range, newLineCharacter) {
return this.getLinesForRange(range).join(this.getNewLineCharacter()); return this.getLinesForRange(range).join(newLineCharacter || this.getNewLineCharacter());
}; };
/** /**