Merge pull request #5 from lastebil/overhaul
Fix: my tablet did not send doubleclick events, changed to 'edges'
This commit is contained in:
commit
a31167bd4b
4 changed files with 53 additions and 18 deletions
19
index.html
19
index.html
|
|
@ -18,7 +18,16 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id="outbox">
|
||||
<div id='sahliviewer'><hr></div>
|
||||
<div id='sahliviewer'><hr>
|
||||
<h1>Space to Start</h1>
|
||||
<ul class='keylist'>
|
||||
<h5>MOBILE/MOUSE</h5>
|
||||
<li class='nodot'><span class="key">TOP</span> start scrolling / reverse scrolling</li>
|
||||
<li class='nodot'><span class="key">BOTTOM</span> Next Picture </li>
|
||||
<li class='nodot'><span class="key">LEFT</span> Fullscreen</li>
|
||||
<li class='nodot'><span class="key">RIGHT</span> Panel Mode</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
|
|
@ -43,9 +52,11 @@
|
|||
<li><span class="key">I</span> SAUCE or Partymeister info</li>
|
||||
<li><span class="key">V</span> Center Small Ascii Vertically</li>
|
||||
<li><span class="key">H</span> This help (: <span class="key">Esc</span> Cancel fullscreen</li>
|
||||
<li class='nodot'><b>Tab also works for "info" but browsers hate it, so use 'I'</b></li>
|
||||
</ul>
|
||||
</div>
|
||||
<h5>MOBILE/MOUSE</h5>
|
||||
<li class='nodot'><span class="key">TOP</span> start scrolling / reverse scrolling</li>
|
||||
<li class='nodot'><span class="key">BOTTOM</span> Next Picture </li>
|
||||
<li class='nodot'><span class="key">LEFT</span> Fullscreen <span class="key">RIGHT</span> Panel Mode</li>
|
||||
</ul> </div>
|
||||
</div>
|
||||
|
||||
<div class='hidden' id='panel'>
|
||||
|
|
|
|||
22
sahli.coffee
22
sahli.coffee
|
|
@ -114,7 +114,7 @@ class @Sahli
|
|||
@filedata = json.filedata
|
||||
@slides = json.slides
|
||||
@location = json.location
|
||||
alert "SAHLI READY TO GO\n#{@filedata.length} Entries"
|
||||
alert "SAHLI READY TO GO\n#{@filedata.length} Entries\nH for Help\nSpace to Start"
|
||||
|
||||
@loadinfopanel = (index) ->
|
||||
data = @filedata[index]
|
||||
|
|
@ -295,11 +295,21 @@ class @Sahli
|
|||
dcol.width amt
|
||||
|
||||
@loadkeys = ->
|
||||
$(document).on('dblclick', (ev) =>
|
||||
@nextpic()
|
||||
)
|
||||
|
||||
$(document).on('click', (ev) =>
|
||||
@setscroll()
|
||||
clickx = ev.clientX
|
||||
clicky = ev.clientY
|
||||
wh = window.innerHeight
|
||||
ww = window.innerWidth
|
||||
if clicky > wh-100
|
||||
@nextpic()
|
||||
if clicky < 100
|
||||
@setscroll()
|
||||
if (clicky > 100 && clicky < wh-100 )
|
||||
if clickx < 100
|
||||
@togglefullscreen()
|
||||
if clickx > ww-100
|
||||
@panelmode()
|
||||
)
|
||||
$(document).on('keydown', (ev) =>
|
||||
switch ev.which
|
||||
|
|
@ -328,7 +338,7 @@ class @Sahli
|
|||
when @keycode 'x'
|
||||
@changescrolldirection 1
|
||||
when @keycode 'c'
|
||||
@panelmode(1)
|
||||
@panelmode()
|
||||
when @keycode 'i'
|
||||
$('div.infobox').toggle()
|
||||
when @keycode 'v'
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ body {
|
|||
margin: 0;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
font-family: 'microknightplus'
|
||||
}
|
||||
|
||||
.hidden {
|
||||
|
|
|
|||
29
sahli.js
29
sahli.js
|
|
@ -132,7 +132,7 @@ l__________/__________|___|______l__________j_____j
|
|||
_this.filedata = json.filedata;
|
||||
_this.slides = json.slides;
|
||||
_this.location = json.location;
|
||||
return alert("SAHLI READY TO GO\n" + _this.filedata.length + " Entries");
|
||||
return alert("SAHLI READY TO GO\n" + _this.filedata.length + " Entries\nH for Help\nSpace to Start");
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
|
@ -346,14 +346,27 @@ l__________/__________|___|______l__________j_____j
|
|||
};
|
||||
|
||||
Sahli.loadkeys = function() {
|
||||
$(document).on('dblclick', (function(_this) {
|
||||
return function(ev) {
|
||||
return _this.nextpic();
|
||||
};
|
||||
})(this));
|
||||
$(document).on('click', (function(_this) {
|
||||
return function(ev) {
|
||||
return _this.setscroll();
|
||||
var clickx, clicky, wh, ww;
|
||||
clickx = ev.clientX;
|
||||
clicky = ev.clientY;
|
||||
wh = window.innerHeight;
|
||||
ww = window.innerWidth;
|
||||
if (clicky > wh - 100) {
|
||||
_this.nextpic();
|
||||
}
|
||||
if (clicky < 100) {
|
||||
_this.setscroll();
|
||||
}
|
||||
if (clicky > 100 && clicky < wh - 100) {
|
||||
if (clickx < 100) {
|
||||
_this.togglefullscreen();
|
||||
}
|
||||
if (clickx > ww - 100) {
|
||||
return _this.panelmode();
|
||||
}
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
return $(document).on('keydown', (function(_this) {
|
||||
|
|
@ -384,7 +397,7 @@ l__________/__________|___|______l__________j_____j
|
|||
case _this.keycode('x'):
|
||||
return _this.changescrolldirection(1);
|
||||
case _this.keycode('c'):
|
||||
return _this.panelmode(1);
|
||||
return _this.panelmode();
|
||||
case _this.keycode('i'):
|
||||
return $('div.infobox').toggle();
|
||||
case _this.keycode('v'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue