fullscreen toggle; hide scrollbar; fix some fonts to use local fonts
This commit is contained in:
parent
2be40c4966
commit
b10ed90e85
3 changed files with 29 additions and 33 deletions
42
sahli.coffee
42
sahli.coffee
|
|
@ -41,7 +41,6 @@ class @Sahli
|
||||||
@loadansi picdata, inserthere
|
@loadansi picdata, inserthere
|
||||||
else
|
else
|
||||||
@loadplain picdata, inserthere
|
@loadplain picdata, inserthere
|
||||||
return
|
|
||||||
|
|
||||||
@loadplain = (picdata, inserthere) ->
|
@loadplain = (picdata, inserthere) ->
|
||||||
pdiv = $('<div>')
|
pdiv = $('<div>')
|
||||||
|
|
@ -70,11 +69,9 @@ class @Sahli
|
||||||
inserthere.after pdiv
|
inserthere.after pdiv
|
||||||
else
|
else
|
||||||
@loaderror inserthere, fname, req.statusText, req.status
|
@loaderror inserthere, fname, req.statusText, req.status
|
||||||
return
|
|
||||||
|
|
||||||
req.open 'GET', fname, true
|
req.open 'GET', fname, true
|
||||||
req.send null
|
req.send null
|
||||||
return
|
|
||||||
|
|
||||||
@loadansi = (picdata, inserthere) ->
|
@loadansi = (picdata, inserthere) ->
|
||||||
fname = @location + '/' + picdata.file
|
fname = @location + '/' + picdata.file
|
||||||
|
|
@ -85,13 +82,11 @@ class @Sahli
|
||||||
@origwidth = canv.width
|
@origwidth = canv.width
|
||||||
@origheight = canv.height
|
@origheight = canv.height
|
||||||
@SAUCE = SAUCE
|
@SAUCE = SAUCE
|
||||||
return
|
|
||||||
),
|
),
|
||||||
'font': '80x25'
|
'font': '80x25'
|
||||||
'bits': '8'
|
'bits': '8'
|
||||||
'columns': 160
|
'columns': 160
|
||||||
'thumbnail': 0
|
'thumbnail': 0
|
||||||
return
|
|
||||||
|
|
||||||
@loadhugeansi = (picdata, inserthere) ->
|
@loadhugeansi = (picdata, inserthere) ->
|
||||||
fname = @location + '/' + picdata.file
|
fname = @location + '/' + picdata.file
|
||||||
|
|
@ -105,23 +100,20 @@ class @Sahli
|
||||||
pdiv.append canv
|
pdiv.append canv
|
||||||
calcheight = calcheight + canv.height
|
calcheight = calcheight + canv.height
|
||||||
canvwidth = canv.width
|
canvwidth = canv.width
|
||||||
return
|
|
||||||
inserthere.after pdiv
|
inserthere.after pdiv
|
||||||
@SAUCE = SAUCE
|
@SAUCE = SAUCE
|
||||||
@origwidth = canvwidth
|
@origwidth = canvwidth
|
||||||
@origheight = calcheight
|
@origheight = calcheight
|
||||||
pdiv.width canvwidth
|
pdiv.width canvwidth
|
||||||
return
|
|
||||||
), 30, 'bits': '8'
|
), 30, 'bits': '8'
|
||||||
return
|
|
||||||
|
|
||||||
@loadavatar = (picdata, inserthere) ->
|
@loadavatar = (picdata, inserthere) ->
|
||||||
alert 'avatar', picdata, inserthere
|
alert 'avatar', picdata, inserthere
|
||||||
return
|
|
||||||
|
|
||||||
@requestsahlifile = (url) ->
|
@requestsahlifile = (url) ->
|
||||||
@loadkeys()
|
@loadkeys()
|
||||||
@DEBUG = false
|
@DEBUG = false
|
||||||
|
@fullscreen = false
|
||||||
@scroll_speed= 5
|
@scroll_speed= 5
|
||||||
@scroll_direction= 1
|
@scroll_direction= 1
|
||||||
@asciiasgfx= false
|
@asciiasgfx= false
|
||||||
|
|
@ -150,33 +142,31 @@ class @Sahli
|
||||||
@currentpic += 1
|
@currentpic += 1
|
||||||
if @currentpic > filedata.length - 1
|
if @currentpic > filedata.length - 1
|
||||||
@currentpic = 0
|
@currentpic = 0
|
||||||
return
|
|
||||||
|
|
||||||
@gofullscreen = ->
|
@togglefullscreen = ->
|
||||||
docElm = document.documentElement
|
docElm = document.documentElement
|
||||||
window.setTimeout @resizedrawbox, 100
|
if @fullscreen
|
||||||
if docElm.requestFullscreen
|
|
||||||
docElm.requestFullscreen Element.ALLOW_KEYBOARD_INPUT
|
|
||||||
else if docElm.mozRequestFullScreen
|
|
||||||
docElm.mozRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
|
|
||||||
else if docElm.webkitRequestFullScreen
|
|
||||||
docElm.webkitRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
|
|
||||||
return
|
|
||||||
|
|
||||||
@cancelfullscreen = ->
|
|
||||||
window.setTimeout @resizedrawbox, 100, @nonfsheight
|
|
||||||
if document.exitFullscreen
|
if document.exitFullscreen
|
||||||
document.exitFullscreen()
|
document.exitFullscreen()
|
||||||
else if document.mozCancelFullScreen
|
else if document.mozCancelFullScreen
|
||||||
document.mozCancelFullScreen()
|
document.mozCancelFullScreen()
|
||||||
else if document.webkitCancelFullScreen
|
else if document.webkitCancelFullScreen
|
||||||
document.webkitCancelFullScreen()
|
document.webkitCancelFullScreen()
|
||||||
return
|
@fullscreen = false
|
||||||
|
else
|
||||||
|
if docElm.requestFullscreen
|
||||||
|
docElm.requestFullscreen Element.ALLOW_KEYBOARD_INPUT
|
||||||
|
else if docElm.mozRequestFullScreen
|
||||||
|
docElm.mozRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
|
||||||
|
else if docElm.webkitRequestFullScreen
|
||||||
|
docElm.webkitRequestFullScreen Element.ALLOW_KEYBOARD_INPUT
|
||||||
|
@fullscreen = true
|
||||||
|
|
||||||
|
@cancelfullscreen = ->
|
||||||
|
|
||||||
@toggledebug = ->
|
@toggledebug = ->
|
||||||
$('h1#top').fadeToggle()
|
$('h1#top').fadeToggle()
|
||||||
@DEBUG = !@DEBUG
|
@DEBUG = !@DEBUG
|
||||||
return
|
|
||||||
|
|
||||||
@keycode = (char) ->
|
@keycode = (char) ->
|
||||||
char.toUpperCase().charCodeAt 0
|
char.toUpperCase().charCodeAt 0
|
||||||
|
|
@ -196,6 +186,8 @@ class @Sahli
|
||||||
switch ev.which
|
switch ev.which
|
||||||
when @keycode(' ')
|
when @keycode(' ')
|
||||||
@nextpic()
|
@nextpic()
|
||||||
|
when @keycode('f')
|
||||||
|
@togglefullscreen()
|
||||||
when @keycode('s')
|
when @keycode('s')
|
||||||
alert("not spaaaace")
|
alert("not spaaaace")
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,19 @@ body {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1#top {
|
h1#top {
|
||||||
border: 1px solid green;
|
border: 1px solid green;
|
||||||
color: green;
|
color: green;
|
||||||
font-family: TopazPlus a600a1200a4000,monospace;
|
font-family: topaz500,monospace;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: .25ex;
|
top: .25ex;
|
||||||
left: .25ex;
|
left: .25ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#drawbox {
|
div#sahliviewer {
|
||||||
border: 1px inset grey;
|
border: 1px inset grey;
|
||||||
color: green;
|
color: green;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
|
@ -49,7 +50,7 @@ h6 {
|
||||||
-webkit-border-radius: 8;
|
-webkit-border-radius: 8;
|
||||||
-moz-border-radius: 8;
|
-moz-border-radius: 8;
|
||||||
border-radius: 8;
|
border-radius: 8;
|
||||||
font-family: "TopazPlus a600a1200a4000",mOsOul, Consolas, monospace;
|
font-family: topaz1200,mOsOul, Consolas, monospace;
|
||||||
opacity: .85;
|
opacity: .85;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,7 +94,7 @@ ul.keylist li.nodot {
|
||||||
}
|
}
|
||||||
|
|
||||||
div.infobox {
|
div.infobox {
|
||||||
font-family: "mOsOul,TopazPlus a600a1200a4000",MicroKnightPlus, Consolas, monospace;
|
font-family: mosoul,topaz1200,microknight, Consolas, monospace;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 1ex;
|
top: 1ex;
|
||||||
left: 1ex;
|
left: 1ex;
|
||||||
|
|
|
||||||
3
todo.txt
3
todo.txt
|
|
@ -1,4 +1,7 @@
|
||||||
(A) fix scrolling!
|
(A) fix scrolling!
|
||||||
|
(B) @EDITOR add more Amiga fonts.
|
||||||
|
|
||||||
|
|
||||||
(C) check below items for neccesity
|
(C) check below items for neccesity
|
||||||
@EDITOR redo filenames to load from list of files in directory (specfied in 'location')
|
@EDITOR redo filenames to load from list of files in directory (specfied in 'location')
|
||||||
(A) remove the SAUCE lines at bottom, return ANSI object for render @SAUCE
|
(A) remove the SAUCE lines at bottom, return ANSI object for render @SAUCE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue