fix: always start at top
- additional cleanup of some things.
This commit is contained in:
parent
736240d41c
commit
adf666baaf
2 changed files with 7 additions and 45 deletions
27
sahli.coffee
27
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 = $('<div>')
|
||||
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 = $('<div>')
|
||||
|
|
@ -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 = ->
|
||||
|
|
|
|||
25
sahli.js
25
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 = $('<div>');
|
||||
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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue