this is cleaner

This commit is contained in:
Iam Naughton Phier 2015-02-17 16:53:45 +02:00
parent f4dec93ab5
commit 56fb44d1f8
2 changed files with 27 additions and 41 deletions

View file

@ -7,6 +7,11 @@
--> -->
<script type="text/javascript" src="ansilove.js/ansilove.js"></script> <script type="text/javascript" src="ansilove.js/ansilove.js"></script>
<script type="text/javascript" src="sahli.js"></script> <script type="text/javascript" src="sahli.js"></script>
<script>
$(document).ready(function(){
s = 5;
})
</script>
<link rel="stylesheet" href="sahli.css" type="text/css" media="screen" /> <link rel="stylesheet" href="sahli.css" type="text/css" media="screen" />
<meta charset='UTF-8' /> <meta charset='UTF-8' />
</head> </head>

View file

@ -12,28 +12,27 @@ l__________/__________|___|______l__________j_____j
Uses Andy Herbert's Ansilove.js for rendering. Uses Andy Herbert's Ansilove.js for rendering.
### ###
exports = Sahli class @Sahli
constructor: () ->
Sahli = -> @outbox = $('div#outbox')
@outbox = $('div#outbox') @dbox = $('div#drawbox')
@dbox = $('div#drawbox') @image = 0
@image = 0 # scroll speed of 5 looks ... "ok" on macbook pro. 4 was original.
# scroll speed of 5 looks ... "ok" on macbook pro. 4 was original. @scroll_speed = 5
@scroll_speed = 5 @scroll_direction = 1
@scroll_direction = 1 @zoomspeed = 200
@zoomspeed = 200 @asciiasgfx = true
@asciiasgfx = true @DEBUG = false
@DEBUG = false @dbox.height document.height - 24
@dbox.height document.height - 24 @dbox.width document.width - 2
@dbox.width document.width - 2 @sizemult = 16
@sizemult = 16 # 32 is larger than screen, and somewhat silly
# 32 is larger than screen, and somewhat silly @origheight = 0
@origheight = 0 @origwidth = 0
@origwidth = 0 @filedata = ''
@filedata = '' @slides = 0
@slides = 0 @currentpic = 0
@currentpic = 0 @nonfsheight = document.height - 40
@nonfsheight = document.height - 40
@loadpic = (picdata, inserthere) -> @loadpic = (picdata, inserthere) ->
switch picdata.filetype switch picdata.filetype
@ -195,26 +194,8 @@ Sahli = ->
document.webkitCancelFullScreen() document.webkitCancelFullScreen()
return return
@fixhelpbox = ->
h = $('.help')
xy =
'top': 0
'left': document.width / 2 - h.width() / 2
h.css xy
return
@toggledebug = -> @toggledebug = ->
$('h1#top').fadeToggle() $('h1#top').fadeToggle()
@DEBUG = !@DEBUG @DEBUG = !@DEBUG
return return
@loadkeys()
@fixhelpbox()
ref = this
$(window).resize ->
ref.resizedrawbox()
return
debugger
@requestsahlifile 'list.sahli'
return