Added feature to increase/decrease font size in Amiga/plain mode

This commit is contained in:
m0qui 2018-03-26 21:41:49 +02:00
parent af4f9cf56b
commit 80a92fc0c0
4 changed files with 30 additions and 55 deletions

View file

@ -59,6 +59,7 @@ l__________/__________|___|______l__________j_____j
'margin': '0 auto'
});
ptxt = $('<pre>');
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: