Added feature to increase/decrease font size in Amiga/plain mode
This commit is contained in:
parent
8f01863d39
commit
5e05d0fbb8
4 changed files with 30 additions and 55 deletions
15
sahli.coffee
15
sahli.coffee
|
|
@ -52,6 +52,7 @@ class @Sahli
|
|||
buf = $('<span>')
|
||||
buf.css {'margin':'0 auto'}
|
||||
ptxt = $('<pre>')
|
||||
ptxt.addClass 'plaintext'
|
||||
color = @calccolor(picdata.color)
|
||||
bgcolor = @calccolor(picdata.bg)
|
||||
pdiv.addClass 'scrolly'
|
||||
|
|
@ -61,9 +62,9 @@ class @Sahli
|
|||
'background-color': bgcolor
|
||||
'margin': 'auto'
|
||||
'display': 'inline-block'
|
||||
ptxt.width picdata.width * 8
|
||||
@origwidth = ptxt.width
|
||||
pdiv.width ptxt.width
|
||||
#ptxt.width picdata.width * 8
|
||||
#@origwidth = ptxt.width
|
||||
#pdiv.width ptxt.width
|
||||
pdiv.prepend buf.clone()
|
||||
pdiv.append ptxt
|
||||
pdiv.append buf
|
||||
|
|
@ -81,6 +82,10 @@ class @Sahli
|
|||
req.open 'GET', fname, true
|
||||
req.send null
|
||||
|
||||
@increaseFont = (node, increaseBy=5) ->
|
||||
current_size = parseInt($(node).css("font-size"));
|
||||
$(node).css("font-size", current_size + increaseBy);
|
||||
|
||||
@loadpicture = (picdata, inserthere) ->
|
||||
fname = @location + '/' + picdata.file
|
||||
pdiv = $('<div>')
|
||||
|
|
@ -407,6 +412,10 @@ class @Sahli
|
|||
@scroll_speed = 4
|
||||
when @keycode '5'
|
||||
@changespeed 5
|
||||
when @keycode '8'
|
||||
@increaseFont($('pre'), -2)
|
||||
when @keycode '9'
|
||||
@increaseFont($('pre'), 2)
|
||||
when 40 # down
|
||||
@moveline 1
|
||||
when 38 # up
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue