diff --git a/sahli.coffee b/sahli.coffee index e707553..5329a3a 100644 --- a/sahli.coffee +++ b/sahli.coffee @@ -64,36 +64,17 @@ class @Sahli pdiv.prepend buf.clone() pdiv.append ptxt pdiv.append buf - # this is going to be interesting when dealing with ansi files in UTF-8 - # or SHIFT-JIS etc - is it needed now? no. it is not. -# req.overrideMimeType 'text/plain; charset=ISO-8859-1' req.onreadystatechange = -> if req.readyState == req.DONE if req.status == 200 or req.status == 0 ptxt.text @responseText inserthere.after pdiv - $('body').scrollTop(0) + $('body').scrollTop 0 else @loaderror inserthere, fname, req.statusText, req.status req.open 'GET', fname, true req.send null - @loadansi = (picdata, inserthere) -> - fname = @location + '/' + picdata.file - pdiv = $('
') - pdiv.addClass 'scrolly' - AnsiLove.render fname, ((canv, SAUCE) -> - pdiv.append canv - inserthere.after pdiv - @origwidth = canv.width - @origheight = canv.height - @SAUCE = SAUCE - ), - 'font': '80x25' - 'bits': '8' - 'columns': 160 - 'thumbnail': 0 - @loadhugeansi = (picdata, inserthere) -> fname = @location + '/' + picdata.file pdiv = $('
') @@ -108,6 +89,7 @@ class @Sahli calcheight = calcheight + canv.height canvwidth = canv.width inserthere.after pdiv + $('body').scrollTop 0 @SAUCE = SAUCE @origwidth = canvwidth @origheight = calcheight @@ -115,7 +97,7 @@ class @Sahli ), 30, 'bits': '8' @loadavatar = (picdata, inserthere) -> - alert 'avatar', picdata, inserthere + console.log 'avatar', picdata, inserthere @requestsahlifile = (url) -> @loadkeys() @@ -159,8 +141,7 @@ class @Sahli $('#panel').hide() $('#outbox').show() $('body').stop() - @loadinfopanel(i) - $('body').scrollTop(0) + @loadinfopanel i @togglefullscreen = -> diff --git a/sahli.js b/sahli.js index 9c445a3..1caa9f9 100644 --- a/sahli.js +++ b/sahli.js @@ -86,25 +86,6 @@ l__________/__________|___|______l__________j_____j return req.send(null); }; - Sahli.loadansi = function(picdata, inserthere) { - var fname, pdiv; - fname = this.location + '/' + picdata.file; - pdiv = $('
'); - pdiv.addClass('scrolly'); - return AnsiLove.render(fname, (function(canv, SAUCE) { - pdiv.append(canv); - inserthere.after(pdiv); - this.origwidth = canv.width; - this.origheight = canv.height; - return this.SAUCE = SAUCE; - }), { - 'font': '80x25', - 'bits': '8', - 'columns': 160, - 'thumbnail': 0 - }); - }; - Sahli.loadhugeansi = function(picdata, inserthere) { var calcheight, canvwidth, fname, pdiv; fname = this.location + '/' + picdata.file; @@ -122,6 +103,7 @@ l__________/__________|___|______l__________j_____j return canvwidth = canv.width; }); inserthere.after(pdiv); + $('body').scrollTop(0); _this.SAUCE = SAUCE; _this.origwidth = canvwidth; _this.origheight = calcheight; @@ -133,7 +115,7 @@ l__________/__________|___|______l__________j_____j }; Sahli.loadavatar = function(picdata, inserthere) { - return alert('avatar', picdata, inserthere); + return console.log('avatar', picdata, inserthere); }; Sahli.requestsahlifile = function(url) { @@ -186,8 +168,7 @@ l__________/__________|___|______l__________j_____j $('#panel').hide(); $('#outbox').show(); $('body').stop(); - Sahli.loadinfopanel(i); - return $('body').scrollTop(0); + return Sahli.loadinfopanel(i); }; Sahli.togglefullscreen = function() {