diff --git a/index.html b/index.html index 233d273..63b9fa1 100644 --- a/index.html +++ b/index.html @@ -49,6 +49,7 @@
')
+ 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 = $('')
@@ -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
diff --git a/sahli.js b/sahli.js
index 30a3e25..45def1d 100644
--- a/sahli.js
+++ b/sahli.js
@@ -59,6 +59,7 @@ l__________/__________|___|______l__________j_____j
'margin': '0 auto'
});
ptxt = $('');
+ ptxt.addClass('plaintext');
color = this.calccolor(picdata.color);
bgcolor = this.calccolor(picdata.bg);
pdiv.addClass('scrolly');
@@ -69,9 +70,6 @@ l__________/__________|___|______l__________j_____j
'margin': 'auto',
'display': 'inline-block'
});
- ptxt.width(picdata.width * 8);
- this.origwidth = ptxt.width;
- pdiv.width(ptxt.width);
pdiv.prepend(buf.clone());
pdiv.append(ptxt);
pdiv.append(buf);
@@ -91,6 +89,15 @@ l__________/__________|___|______l__________j_____j
return req.send(null);
};
+ Sahli.increaseFont = function(node, increaseBy) {
+ var current_size;
+ if (increaseBy == null) {
+ increaseBy = 5;
+ }
+ current_size = parseInt($(node).css("font-size"));
+ return $(node).css("font-size", current_size + increaseBy);
+ };
+
Sahli.loadpicture = function(picdata, inserthere) {
var fname, pdiv, pimg;
fname = this.location + '/' + picdata.file;
@@ -476,6 +483,10 @@ l__________/__________|___|______l__________j_____j
return _this.scroll_speed = 4;
case _this.keycode('5'):
return _this.changespeed(5);
+ case _this.keycode('8'):
+ return _this.increaseFont($('pre'), -2);
+ case _this.keycode('9'):
+ return _this.increaseFont($('pre'), 2);
case 40:
return _this.moveline(1);
case 38: