diff options
| author | Jules <jules@asdf.us> | 2014-11-30 16:54:12 -0500 |
|---|---|---|
| committer | Jules <jules@asdf.us> | 2014-11-30 16:54:12 -0500 |
| commit | cea658bee03c9dc1843916ccd3c49bd67481e3b2 (patch) | |
| tree | d75b7ca251b87f43422ae2f606071b98cff40458 /js/lex.js | |
| parent | b25804afdf38918c9e205e9acda50bdbfe24cd12 (diff) | |
| parent | 4f2f5dc5580359bba21150af3ce5d34ad14b3ab4 (diff) | |
Merge branch 'master' of ghghgh.us:ascii
Diffstat (limited to 'js/lex.js')
| -rw-r--r-- | js/lex.js | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -25,16 +25,23 @@ Lex.prototype.read = function(){ this.char = this.span.innerHTML return this.char } +Lex.prototype.ascii = function(){ + return this.char || " " +} Lex.prototype.sanitize = function(){ return this.char == "%" ? '%%' : this.char || " " } -Lex.prototype.irc = function(){ - var char = this.sanitize() +var fgOnly = false +Lex.prototype.mirc = function(){ + var char = this.char || " " + if (fgOnly) { + return "\x03" + (this.fg&15) + char + } if (this.bg == 1 && this.fg == 0) { return char } else { - return "\\x03" + (this.fg&15) + "," + (this.bg&15) + char + return "\x03" + (this.fg&15) + "," + (this.bg&15) + char } } Lex.prototype.clone = function (lex){ |
