Fix: my tablet did not send doubleclick events, changed to 'edges'

This commit is contained in:
Iam Naughton Phier 2015-03-26 15:43:20 +02:00
parent 47da8dfd35
commit 4bcfeb755c
4 changed files with 53 additions and 18 deletions

View file

@ -18,7 +18,16 @@
</head> </head>
<body> <body>
<div id="outbox"> <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>
<div align="center"> <div align="center">
@ -43,9 +52,11 @@
<li><span class="key">I</span> SAUCE or Partymeister info</li> <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">V</span> Center Small Ascii Vertically</li>
<li><span class="key">H</span> This help (: <span class="key">Esc</span> Cancel fullscreen</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> <h5>MOBILE/MOUSE</h5>
</ul> <li class='nodot'><span class="key">TOP</span> start scrolling / reverse scrolling</li>
</div> <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>
<div class='hidden' id='panel'> <div class='hidden' id='panel'>

View file

@ -114,7 +114,7 @@ class @Sahli
@filedata = json.filedata @filedata = json.filedata
@slides = json.slides @slides = json.slides
@location = json.location @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) -> @loadinfopanel = (index) ->
data = @filedata[index] data = @filedata[index]
@ -295,11 +295,21 @@ class @Sahli
dcol.width amt dcol.width amt
@loadkeys = -> @loadkeys = ->
$(document).on('dblclick', (ev) =>
@nextpic()
)
$(document).on('click', (ev) => $(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) => $(document).on('keydown', (ev) =>
switch ev.which switch ev.which
@ -328,7 +338,7 @@ class @Sahli
when @keycode 'x' when @keycode 'x'
@changescrolldirection 1 @changescrolldirection 1
when @keycode 'c' when @keycode 'c'
@panelmode(1) @panelmode()
when @keycode 'i' when @keycode 'i'
$('div.infobox').toggle() $('div.infobox').toggle()
when @keycode 'v' when @keycode 'v'

View file

@ -25,6 +25,7 @@ body {
margin: 0; margin: 0;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
font-family: 'microknightplus'
} }
.hidden { .hidden {

View file

@ -132,7 +132,7 @@ l__________/__________|___|______l__________j_____j
_this.filedata = json.filedata; _this.filedata = json.filedata;
_this.slides = json.slides; _this.slides = json.slides;
_this.location = json.location; _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)); })(this));
}; };
@ -346,14 +346,27 @@ l__________/__________|___|______l__________j_____j
}; };
Sahli.loadkeys = function() { Sahli.loadkeys = function() {
$(document).on('dblclick', (function(_this) {
return function(ev) {
return _this.nextpic();
};
})(this));
$(document).on('click', (function(_this) { $(document).on('click', (function(_this) {
return function(ev) { 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)); })(this));
return $(document).on('keydown', (function(_this) { return $(document).on('keydown', (function(_this) {
@ -384,7 +397,7 @@ l__________/__________|___|______l__________j_____j
case _this.keycode('x'): case _this.keycode('x'):
return _this.changescrolldirection(1); return _this.changescrolldirection(1);
case _this.keycode('c'): case _this.keycode('c'):
return _this.panelmode(1); return _this.panelmode();
case _this.keycode('i'): case _this.keycode('i'):
return $('div.infobox').toggle(); return $('div.infobox').toggle();
case _this.keycode('v'): case _this.keycode('v'):