Merge branch 'mt' of truck/Sahli into master
This commit is contained in:
commit
10bc3e132e
6 changed files with 261 additions and 71 deletions
102
list.sahli
102
list.sahli
|
|
@ -14,100 +14,104 @@
|
||||||
|
|
||||||
"filedata": [
|
"filedata": [
|
||||||
|
|
||||||
|
{
|
||||||
|
"file": "AD - Green Beam.scaled.png",
|
||||||
|
"name": "Green Beam",
|
||||||
|
"amiga": false,
|
||||||
|
"filetype": "image",
|
||||||
|
"width": "1600",
|
||||||
|
"author": "AD",
|
||||||
|
"font": "Propaz",
|
||||||
|
"color": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
255
|
||||||
|
],
|
||||||
|
"bg": [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
|
],
|
||||||
|
"line1": "",
|
||||||
|
"line2": "",
|
||||||
|
"text": ""
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"file": "om-boss.png",
|
||||||
|
"name": "Green Beam",
|
||||||
|
"amiga": false,
|
||||||
|
"filetype": "image",
|
||||||
|
"width": "640",
|
||||||
|
"author": "AD",
|
||||||
|
"font": "Propaz",
|
||||||
|
"color": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
255
|
||||||
|
],
|
||||||
|
"bg": [
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255,
|
||||||
|
255
|
||||||
|
],
|
||||||
|
"line1": "",
|
||||||
|
"line2": "",
|
||||||
|
"text": ""
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
"file": "spaceflight.asc",
|
"file": "spaceflight.asc",
|
||||||
|
|
||||||
"name": "Spaceflight",
|
"name": "Spaceflight",
|
||||||
|
|
||||||
"amiga": true,
|
"amiga": true,
|
||||||
|
|
||||||
"filetype": "plain",
|
"filetype": "plain",
|
||||||
|
|
||||||
"width": "80",
|
"width": "80",
|
||||||
|
|
||||||
"author": "Urs",
|
"author": "Urs",
|
||||||
|
|
||||||
"font": "pot-noodle",
|
"font": "pot-noodle",
|
||||||
|
|
||||||
"color": [
|
"color": [
|
||||||
|
|
||||||
255,
|
255,
|
||||||
|
|
||||||
128,
|
128,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
255
|
255
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
"bg": [
|
"bg": [
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
255
|
255
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
"line1": "Orange on Dark Grey",
|
"line1": "Orange on Dark Grey",
|
||||||
|
|
||||||
"line2": "Test for plain files",
|
"line2": "Test for plain files",
|
||||||
|
|
||||||
"text": ""
|
"text": ""
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
"file": "az0!-revi510n.txt",
|
"file": "az0!-revi510n.txt",
|
||||||
|
|
||||||
"name": "Revision",
|
"name": "Revision",
|
||||||
|
|
||||||
"amiga": true,
|
"amiga": true,
|
||||||
|
|
||||||
"filetype": "plain",
|
"filetype": "plain",
|
||||||
|
|
||||||
"width": "80",
|
"width": "80",
|
||||||
|
|
||||||
"author": "Azzarro/Madwizards",
|
"author": "Azzarro/Madwizards",
|
||||||
|
"font": "mosoul",
|
||||||
"font": "Propaz",
|
"color": [
|
||||||
|
|
||||||
"color": [
|
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
240,
|
240,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
255
|
255
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
"bg": [
|
"bg": [
|
||||||
|
|
||||||
255,
|
255,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
0,
|
0,
|
||||||
|
|
||||||
255
|
255
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
"line1": "Azzaro Returns",
|
"line1": "Azzaro Returns",
|
||||||
|
|
||||||
"line2": "Revision ansi/ascii compo 2013",
|
"line2": "Revision ansi/ascii compo 2013",
|
||||||
|
"text": "Color test as well as mOsOul test."
|
||||||
"text": "Color test as well as Microknight test."
|
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "dS!-JUFV.txt",
|
"file": "dS!-JUFV.txt",
|
||||||
|
|
|
||||||
94
sahli.coffee
94
sahli.coffee
|
|
@ -14,6 +14,7 @@ l__________/__________|___|______l__________j_____j
|
||||||
|
|
||||||
class @Sahli
|
class @Sahli
|
||||||
constructor: () ->
|
constructor: () ->
|
||||||
|
$('body').css('cursor', 'none');
|
||||||
# I don't think we actually are going to have one, as we don't
|
# I don't think we actually are going to have one, as we don't
|
||||||
# need instance variables (things used outside the function)
|
# need instance variables (things used outside the function)
|
||||||
|
|
||||||
|
|
@ -39,6 +40,8 @@ class @Sahli
|
||||||
@loadhugeansi picdata, inserthere
|
@loadhugeansi picdata, inserthere
|
||||||
when 'tundra'
|
when 'tundra'
|
||||||
@loadhugeansi picdata, inserthere
|
@loadhugeansi picdata, inserthere
|
||||||
|
when 'image'
|
||||||
|
@loadpicture picdata, inserthere
|
||||||
else
|
else
|
||||||
@loadplain picdata, inserthere
|
@loadplain picdata, inserthere
|
||||||
|
|
||||||
|
|
@ -49,6 +52,7 @@ class @Sahli
|
||||||
buf = $('<span>')
|
buf = $('<span>')
|
||||||
buf.css {'margin':'0 auto'}
|
buf.css {'margin':'0 auto'}
|
||||||
ptxt = $('<pre>')
|
ptxt = $('<pre>')
|
||||||
|
ptxt.addClass 'plaintext'
|
||||||
color = @calccolor(picdata.color)
|
color = @calccolor(picdata.color)
|
||||||
bgcolor = @calccolor(picdata.bg)
|
bgcolor = @calccolor(picdata.bg)
|
||||||
pdiv.addClass 'scrolly'
|
pdiv.addClass 'scrolly'
|
||||||
|
|
@ -58,9 +62,9 @@ class @Sahli
|
||||||
'background-color': bgcolor
|
'background-color': bgcolor
|
||||||
'margin': 'auto'
|
'margin': 'auto'
|
||||||
'display': 'inline-block'
|
'display': 'inline-block'
|
||||||
ptxt.width picdata.width * 8
|
#ptxt.width picdata.width * 8
|
||||||
@origwidth = ptxt.width
|
#@origwidth = ptxt.width
|
||||||
pdiv.width ptxt.width
|
#pdiv.width ptxt.width
|
||||||
pdiv.prepend buf.clone()
|
pdiv.prepend buf.clone()
|
||||||
pdiv.append ptxt
|
pdiv.append ptxt
|
||||||
pdiv.append buf
|
pdiv.append buf
|
||||||
|
|
@ -78,6 +82,72 @@ class @Sahli
|
||||||
req.open 'GET', fname, true
|
req.open 'GET', fname, true
|
||||||
req.send null
|
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>')
|
||||||
|
pdiv.addClass 'scrolly'
|
||||||
|
pdiv.addClass 'image'
|
||||||
|
pdiv.width window.innerWidth
|
||||||
|
pdiv.css 'display', 'inline-block'
|
||||||
|
pimg = $('<img src="' + fname + '" />')
|
||||||
|
pimg.addClass 'fullwidth'
|
||||||
|
pdiv.append pimg
|
||||||
|
inserthere.after pdiv
|
||||||
|
$('h6').hide()
|
||||||
|
$('body').scrollTop 0
|
||||||
|
@origwidth = picdata.width
|
||||||
|
@origheight = picdata.height
|
||||||
|
@bestfit()
|
||||||
|
|
||||||
|
@fullwidthplain = =>
|
||||||
|
if ($('pre').css("font-size") == "16px")
|
||||||
|
$('pre').css("font-size", "2.5vw");
|
||||||
|
else
|
||||||
|
$('pre').css("font-size", "16px");
|
||||||
|
|
||||||
|
@togglefullwidthmode = =>
|
||||||
|
if ($('pre').hasClass('plaintext'))
|
||||||
|
@fullwidthplain()
|
||||||
|
else
|
||||||
|
if $('div.scrolly').hasClass('image')
|
||||||
|
@bestfit()
|
||||||
|
else
|
||||||
|
@zoom()
|
||||||
|
|
||||||
|
@zoomin = =>
|
||||||
|
if ($('pre').hasClass('plaintext'))
|
||||||
|
@increaseFont($('pre'), 2)
|
||||||
|
else
|
||||||
|
@zoom(100);
|
||||||
|
|
||||||
|
@zoomout = =>
|
||||||
|
if ($('pre').hasClass('plaintext'))
|
||||||
|
@increaseFont($('pre'), -2)
|
||||||
|
else
|
||||||
|
@zoom(-100);
|
||||||
|
|
||||||
|
@bestfit = =>
|
||||||
|
if $('div.scrolly').hasClass('image')
|
||||||
|
if $('div.scrolly').hasClass('bestfitMode')
|
||||||
|
$('div.scrolly').removeClass 'bestfitMode'
|
||||||
|
$('div.scrolly').addClass 'fullwidthMode'
|
||||||
|
$('div.scrolly').width window.innerWidth
|
||||||
|
$('div.scrolly').height("")
|
||||||
|
$('img.bestfit').addClass 'fullwidth'
|
||||||
|
$('img.bestfit').removeClass 'bestfit'
|
||||||
|
else
|
||||||
|
$('h6').hide()
|
||||||
|
$('div.scrolly').addClass 'bestfitMode'
|
||||||
|
$('div.scrolly').removeClass 'fullwidthMode'
|
||||||
|
$('div.scrolly').width window.innerWidth
|
||||||
|
$('div.scrolly').height window.innerHeight
|
||||||
|
$('img.fullwidth').addClass 'bestfit'
|
||||||
|
$('img.fullwidth').removeClass 'fullwidth'
|
||||||
|
|
||||||
@loadhugeansi = (picdata, inserthere) ->
|
@loadhugeansi = (picdata, inserthere) ->
|
||||||
fname = @location + '/' + picdata.file
|
fname = @location + '/' + picdata.file
|
||||||
pdiv = $('<div>')
|
pdiv = $('<div>')
|
||||||
|
|
@ -97,7 +167,7 @@ class @Sahli
|
||||||
@origwidth = canvwidth
|
@origwidth = canvwidth
|
||||||
@origheight = calcheight
|
@origheight = calcheight
|
||||||
pdiv.width canvwidth
|
pdiv.width canvwidth
|
||||||
), 30, 'bits': '8'
|
), 30, {'bits': '8', "font": picdata.font}
|
||||||
|
|
||||||
@loadavatar = (picdata, inserthere) ->
|
@loadavatar = (picdata, inserthere) ->
|
||||||
console.log 'avatar', picdata, inserthere
|
console.log 'avatar', picdata, inserthere
|
||||||
|
|
@ -137,6 +207,7 @@ class @Sahli
|
||||||
filedata = @filedata
|
filedata = @filedata
|
||||||
filedata[i].pic = $('<h6>' + filedata[i].file + '</h6>')
|
filedata[i].pic = $('<h6>' + filedata[i].file + '</h6>')
|
||||||
viewbox.append filedata[i].pic
|
viewbox.append filedata[i].pic
|
||||||
|
$('h6').show()
|
||||||
@loadpic filedata[i], filedata[i].pic
|
@loadpic filedata[i], filedata[i].pic
|
||||||
@currentpic += 1
|
@currentpic += 1
|
||||||
if @currentpic > filedata.length - 1
|
if @currentpic > filedata.length - 1
|
||||||
|
|
@ -237,7 +308,7 @@ class @Sahli
|
||||||
zoomee.width newwidth
|
zoomee.width newwidth
|
||||||
$('canvas').width newwidth
|
$('canvas').width newwidth
|
||||||
else
|
else
|
||||||
if zoomee.width() != @origwidth
|
if parseInt( zoomee.width(), 10 ) != parseInt( @origwidth, 10)
|
||||||
zoomee.width @origwidth
|
zoomee.width @origwidth
|
||||||
$('canvas').width '100%'
|
$('canvas').width '100%'
|
||||||
else
|
else
|
||||||
|
|
@ -330,18 +401,18 @@ class @Sahli
|
||||||
@setscroll()
|
@setscroll()
|
||||||
when @keycode 't'
|
when @keycode 't'
|
||||||
$('body').scrollTop 0
|
$('body').scrollTop 0
|
||||||
@zoom 0
|
@togglefullwidthmode()
|
||||||
when @keycode 'b'
|
when @keycode 'b'
|
||||||
$('body').scrollTop $('body').height()
|
$('body').scrollTop $('body').height()
|
||||||
when @keycode 'a'
|
when @keycode 'a'
|
||||||
$('body').stop()
|
$('body').stop()
|
||||||
@scroll_direction = - @scroll_direction
|
@scroll_direction = - @scroll_direction
|
||||||
when @keycode 'z'
|
when @keycode 'z'
|
||||||
@zoom()
|
@togglefullwidthmode()
|
||||||
when @keycode 'e'
|
when @keycode 'e'
|
||||||
@zoom 100
|
@zoomin()
|
||||||
when @keycode 'r'
|
when @keycode 'r'
|
||||||
@zoom -100
|
@zoomout()
|
||||||
when @keycode 'w'
|
when @keycode 'w'
|
||||||
@changescrolldirection -1
|
@changescrolldirection -1
|
||||||
when @keycode 'x'
|
when @keycode 'x'
|
||||||
|
|
@ -351,6 +422,7 @@ class @Sahli
|
||||||
when @keycode 'i'
|
when @keycode 'i'
|
||||||
$('div.infobox').toggle()
|
$('div.infobox').toggle()
|
||||||
when @keycode 'v'
|
when @keycode 'v'
|
||||||
|
$('h6').show()
|
||||||
$('h6').height( (window.innerHeight - $('.scrolly').height()) / 2 )
|
$('h6').height( (window.innerHeight - $('.scrolly').height()) / 2 )
|
||||||
when @keycode '1'
|
when @keycode '1'
|
||||||
@changespeed 1
|
@changespeed 1
|
||||||
|
|
@ -365,6 +437,10 @@ class @Sahli
|
||||||
@scroll_speed = 4
|
@scroll_speed = 4
|
||||||
when @keycode '5'
|
when @keycode '5'
|
||||||
@changespeed 5
|
@changespeed 5
|
||||||
|
when @keycode '8'
|
||||||
|
@increaseFont($('pre'), -2)
|
||||||
|
when @keycode '9'
|
||||||
|
@increaseFont($('pre'), 2)
|
||||||
when 40 # down
|
when 40 # down
|
||||||
@moveline 1
|
@moveline 1
|
||||||
when 38 # up
|
when 38 # up
|
||||||
|
|
|
||||||
20
sahli.css
20
sahli.css
|
|
@ -10,6 +10,10 @@ body {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
line-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
#top {
|
#top {
|
||||||
border: 1px solid green;
|
border: 1px solid green;
|
||||||
color: green;
|
color: green;
|
||||||
|
|
@ -40,7 +44,7 @@ h6 {
|
||||||
.help {
|
.help {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 1em;
|
top: 1em;
|
||||||
left: 33%;
|
left: 25%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background-color: lightgrey;
|
background-color: lightgrey;
|
||||||
border: outset darkgray;
|
border: outset darkgray;
|
||||||
|
|
@ -49,7 +53,19 @@ h6 {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
font-family: topaz1200,mOsOul, Consolas, monospace;
|
font-family: topaz1200,mOsOul, Consolas, monospace;
|
||||||
opacity: .85;
|
opacity: .85;
|
||||||
width: 33%;
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fullwidth {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bestfit {
|
||||||
|
padding: 0;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.keylist {
|
.keylist {
|
||||||
|
|
|
||||||
116
sahli.js
116
sahli.js
|
|
@ -1,4 +1,4 @@
|
||||||
// Generated by CoffeeScript 1.11.0
|
// Generated by CoffeeScript 1.9.3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
.___________________________________, ___
|
.___________________________________, ___
|
||||||
|
|
@ -16,7 +16,9 @@ l__________/__________|___|______l__________j_____j
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.Sahli = (function() {
|
this.Sahli = (function() {
|
||||||
function Sahli() {}
|
function Sahli() {
|
||||||
|
$('body').css('cursor', 'none');
|
||||||
|
}
|
||||||
|
|
||||||
Sahli.loadpic = function(picdata, inserthere) {
|
Sahli.loadpic = function(picdata, inserthere) {
|
||||||
switch (picdata.filetype) {
|
switch (picdata.filetype) {
|
||||||
|
|
@ -40,6 +42,8 @@ l__________/__________|___|______l__________j_____j
|
||||||
return this.loadhugeansi(picdata, inserthere);
|
return this.loadhugeansi(picdata, inserthere);
|
||||||
case 'tundra':
|
case 'tundra':
|
||||||
return this.loadhugeansi(picdata, inserthere);
|
return this.loadhugeansi(picdata, inserthere);
|
||||||
|
case 'image':
|
||||||
|
return this.loadpicture(picdata, inserthere);
|
||||||
default:
|
default:
|
||||||
return this.loadplain(picdata, inserthere);
|
return this.loadplain(picdata, inserthere);
|
||||||
}
|
}
|
||||||
|
|
@ -55,6 +59,7 @@ l__________/__________|___|______l__________j_____j
|
||||||
'margin': '0 auto'
|
'margin': '0 auto'
|
||||||
});
|
});
|
||||||
ptxt = $('<pre>');
|
ptxt = $('<pre>');
|
||||||
|
ptxt.addClass('plaintext');
|
||||||
color = this.calccolor(picdata.color);
|
color = this.calccolor(picdata.color);
|
||||||
bgcolor = this.calccolor(picdata.bg);
|
bgcolor = this.calccolor(picdata.bg);
|
||||||
pdiv.addClass('scrolly');
|
pdiv.addClass('scrolly');
|
||||||
|
|
@ -65,9 +70,6 @@ l__________/__________|___|______l__________j_____j
|
||||||
'margin': 'auto',
|
'margin': 'auto',
|
||||||
'display': 'inline-block'
|
'display': 'inline-block'
|
||||||
});
|
});
|
||||||
ptxt.width(picdata.width * 8);
|
|
||||||
this.origwidth = ptxt.width;
|
|
||||||
pdiv.width(ptxt.width);
|
|
||||||
pdiv.prepend(buf.clone());
|
pdiv.prepend(buf.clone());
|
||||||
pdiv.append(ptxt);
|
pdiv.append(ptxt);
|
||||||
pdiv.append(buf);
|
pdiv.append(buf);
|
||||||
|
|
@ -87,6 +89,91 @@ l__________/__________|___|______l__________j_____j
|
||||||
return req.send(null);
|
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;
|
||||||
|
pdiv = $('<div>');
|
||||||
|
pdiv.addClass('scrolly');
|
||||||
|
pdiv.addClass('image');
|
||||||
|
pdiv.width(window.innerWidth);
|
||||||
|
pdiv.css('display', 'inline-block');
|
||||||
|
pimg = $('<img src="' + fname + '" />');
|
||||||
|
pimg.addClass('fullwidth');
|
||||||
|
pdiv.append(pimg);
|
||||||
|
inserthere.after(pdiv);
|
||||||
|
$('h6').hide();
|
||||||
|
$('body').scrollTop(0);
|
||||||
|
this.origwidth = picdata.width;
|
||||||
|
this.origheight = picdata.height;
|
||||||
|
return this.bestfit();
|
||||||
|
};
|
||||||
|
|
||||||
|
Sahli.fullwidthplain = function() {
|
||||||
|
if ($('pre').css("font-size") === "16px") {
|
||||||
|
return $('pre').css("font-size", "2.5vw");
|
||||||
|
} else {
|
||||||
|
return $('pre').css("font-size", "16px");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Sahli.togglefullwidthmode = function() {
|
||||||
|
if ($('pre').hasClass('plaintext')) {
|
||||||
|
return Sahli.fullwidthplain();
|
||||||
|
} else {
|
||||||
|
if ($('div.scrolly').hasClass('image')) {
|
||||||
|
return Sahli.bestfit();
|
||||||
|
} else {
|
||||||
|
return Sahli.zoom();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Sahli.zoomin = function() {
|
||||||
|
if ($('pre').hasClass('plaintext')) {
|
||||||
|
return Sahli.increaseFont($('pre'), 2);
|
||||||
|
} else {
|
||||||
|
return Sahli.zoom(100);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Sahli.zoomout = function() {
|
||||||
|
if ($('pre').hasClass('plaintext')) {
|
||||||
|
return Sahli.increaseFont($('pre'), -2);
|
||||||
|
} else {
|
||||||
|
return Sahli.zoom(-100);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Sahli.bestfit = function() {
|
||||||
|
if ($('div.scrolly').hasClass('image')) {
|
||||||
|
if ($('div.scrolly').hasClass('bestfitMode')) {
|
||||||
|
$('div.scrolly').removeClass('bestfitMode');
|
||||||
|
$('div.scrolly').addClass('fullwidthMode');
|
||||||
|
$('div.scrolly').width(window.innerWidth);
|
||||||
|
$('div.scrolly').height("");
|
||||||
|
$('img.bestfit').addClass('fullwidth');
|
||||||
|
return $('img.bestfit').removeClass('bestfit');
|
||||||
|
} else {
|
||||||
|
$('h6').hide();
|
||||||
|
$('div.scrolly').addClass('bestfitMode');
|
||||||
|
$('div.scrolly').removeClass('fullwidthMode');
|
||||||
|
$('div.scrolly').width(window.innerWidth);
|
||||||
|
$('div.scrolly').height(window.innerHeight);
|
||||||
|
$('img.fullwidth').addClass('bestfit');
|
||||||
|
return $('img.fullwidth').removeClass('fullwidth');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
Sahli.loadhugeansi = function(picdata, inserthere) {
|
Sahli.loadhugeansi = function(picdata, inserthere) {
|
||||||
var calcheight, canvwidth, fname, pdiv;
|
var calcheight, canvwidth, fname, pdiv;
|
||||||
fname = this.location + '/' + picdata.file;
|
fname = this.location + '/' + picdata.file;
|
||||||
|
|
@ -111,7 +198,8 @@ l__________/__________|___|______l__________j_____j
|
||||||
return pdiv.width(canvwidth);
|
return pdiv.width(canvwidth);
|
||||||
};
|
};
|
||||||
})(this)), 30, {
|
})(this)), 30, {
|
||||||
'bits': '8'
|
'bits': '8',
|
||||||
|
"font": picdata.font
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -161,6 +249,7 @@ l__________/__________|___|______l__________j_____j
|
||||||
filedata = Sahli.filedata;
|
filedata = Sahli.filedata;
|
||||||
filedata[i].pic = $('<h6>' + filedata[i].file + '</h6>');
|
filedata[i].pic = $('<h6>' + filedata[i].file + '</h6>');
|
||||||
viewbox.append(filedata[i].pic);
|
viewbox.append(filedata[i].pic);
|
||||||
|
$('h6').show();
|
||||||
Sahli.loadpic(filedata[i], filedata[i].pic);
|
Sahli.loadpic(filedata[i], filedata[i].pic);
|
||||||
Sahli.currentpic += 1;
|
Sahli.currentpic += 1;
|
||||||
if (Sahli.currentpic > filedata.length - 1) {
|
if (Sahli.currentpic > filedata.length - 1) {
|
||||||
|
|
@ -280,7 +369,7 @@ l__________/__________|___|______l__________j_____j
|
||||||
zoomee.width(newwidth);
|
zoomee.width(newwidth);
|
||||||
return $('canvas').width(newwidth);
|
return $('canvas').width(newwidth);
|
||||||
} else {
|
} else {
|
||||||
if (zoomee.width() !== this.origwidth) {
|
if (parseInt(zoomee.width(), 10) !== parseInt(this.origwidth, 10)) {
|
||||||
zoomee.width(this.origwidth);
|
zoomee.width(this.origwidth);
|
||||||
return $('canvas').width('100%');
|
return $('canvas').width('100%');
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -392,18 +481,18 @@ l__________/__________|___|______l__________j_____j
|
||||||
return _this.setscroll();
|
return _this.setscroll();
|
||||||
case _this.keycode('t'):
|
case _this.keycode('t'):
|
||||||
$('body').scrollTop(0);
|
$('body').scrollTop(0);
|
||||||
return _this.zoom(0);
|
return _this.togglefullwidthmode();
|
||||||
case _this.keycode('b'):
|
case _this.keycode('b'):
|
||||||
return $('body').scrollTop($('body').height());
|
return $('body').scrollTop($('body').height());
|
||||||
case _this.keycode('a'):
|
case _this.keycode('a'):
|
||||||
$('body').stop();
|
$('body').stop();
|
||||||
return _this.scroll_direction = -_this.scroll_direction;
|
return _this.scroll_direction = -_this.scroll_direction;
|
||||||
case _this.keycode('z'):
|
case _this.keycode('z'):
|
||||||
return _this.zoom();
|
return _this.togglefullwidthmode();
|
||||||
case _this.keycode('e'):
|
case _this.keycode('e'):
|
||||||
return _this.zoom(100);
|
return _this.zoomin();
|
||||||
case _this.keycode('r'):
|
case _this.keycode('r'):
|
||||||
return _this.zoom(-100);
|
return _this.zoomout();
|
||||||
case _this.keycode('w'):
|
case _this.keycode('w'):
|
||||||
return _this.changescrolldirection(-1);
|
return _this.changescrolldirection(-1);
|
||||||
case _this.keycode('x'):
|
case _this.keycode('x'):
|
||||||
|
|
@ -413,6 +502,7 @@ l__________/__________|___|______l__________j_____j
|
||||||
case _this.keycode('i'):
|
case _this.keycode('i'):
|
||||||
return $('div.infobox').toggle();
|
return $('div.infobox').toggle();
|
||||||
case _this.keycode('v'):
|
case _this.keycode('v'):
|
||||||
|
$('h6').show();
|
||||||
return $('h6').height((window.innerHeight - $('.scrolly').height()) / 2);
|
return $('h6').height((window.innerHeight - $('.scrolly').height()) / 2);
|
||||||
case _this.keycode('1'):
|
case _this.keycode('1'):
|
||||||
return _this.changespeed(1);
|
return _this.changespeed(1);
|
||||||
|
|
@ -427,6 +517,10 @@ l__________/__________|___|______l__________j_____j
|
||||||
return _this.scroll_speed = 4;
|
return _this.scroll_speed = 4;
|
||||||
case _this.keycode('5'):
|
case _this.keycode('5'):
|
||||||
return _this.changespeed(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:
|
case 40:
|
||||||
return _this.moveline(1);
|
return _this.moveline(1);
|
||||||
case 38:
|
case 38:
|
||||||
|
|
|
||||||
BIN
testshow/AD - Green Beam.scaled.png
Normal file
BIN
testshow/AD - Green Beam.scaled.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
testshow/om-boss.png
Normal file
BIN
testshow/om-boss.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Loading…
Add table
Add a link
Reference in a new issue