SlideUtils: Verbesserung/Anpassung auf Presenter
parent
4f79af47ac
commit
0335f63905
|
|
@ -54,8 +54,8 @@ function scrollIntoViewIfNeeded(target) {
|
||||||
if(__slide_data.jump_to_slide === false)
|
if(__slide_data.jump_to_slide === false)
|
||||||
return;
|
return;
|
||||||
var rect = target.getBoundingClientRect();
|
var rect = target.getBoundingClientRect();
|
||||||
console.log(rect);
|
/*console.log(rect);
|
||||||
console.log(window.innerHeight);
|
console.log(window.innerHeight);*/
|
||||||
if (rect.bottom > window.innerHeight-10) {
|
if (rect.bottom > window.innerHeight-10) {
|
||||||
target.scrollIntoView(false);
|
target.scrollIntoView(false);
|
||||||
if(rect.height < window.innerHeight-20) {
|
if(rect.height < window.innerHeight-20) {
|
||||||
|
|
@ -76,9 +76,9 @@ function scrollIntoViewIfNeeded(target) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function slide_key_up() {
|
function slide_prev() {
|
||||||
var slides = __slide_data.slides;
|
var slides = __slide_data.slides;
|
||||||
console.log('up');
|
/*console.log('up');*/
|
||||||
|
|
||||||
if(__slide_data.index>=0) {
|
if(__slide_data.index>=0) {
|
||||||
var slideslave = $(slides[__slide_data.index]).data('slideslave');
|
var slideslave = $(slides[__slide_data.index]).data('slideslave');
|
||||||
|
|
@ -102,11 +102,11 @@ function slide_key_up() {
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
function slide_key_down() {
|
function slide_next() {
|
||||||
console.log('down; index: ', __slide_data.index);
|
console.log('down; index: ', __slide_data.index);
|
||||||
var slides = __slide_data.slides;
|
var slides = __slide_data.slides;
|
||||||
if(__slide_data.index<(slides.length-1)) {
|
if(__slide_data.index<(slides.length-1)) {
|
||||||
console.log('bin drin');
|
/*console.log('bin drin');*/
|
||||||
__slide_data.index++;
|
__slide_data.index++;
|
||||||
if($(slides[__slide_data.index]).hasClass('nodisplay')) {
|
if($(slides[__slide_data.index]).hasClass('nodisplay')) {
|
||||||
$(slides[__slide_data.index]).removeClass('nodisplay');
|
$(slides[__slide_data.index]).removeClass('nodisplay');
|
||||||
|
|
@ -122,7 +122,7 @@ function slide_key_down() {
|
||||||
scrollIntoViewIfNeeded(this);
|
scrollIntoViewIfNeeded(this);
|
||||||
var slideslave = $(this).data('slideslave');
|
var slideslave = $(this).data('slideslave');
|
||||||
if(typeof slideslave !== 'undefined' && slideslave !== '') {
|
if(typeof slideslave !== 'undefined' && slideslave !== '') {
|
||||||
console.log('sslave', $(slideslave));
|
/*console.log('sslave', $(slideslave));*/
|
||||||
if($(slideslave).parent().hasClass("nodisplay")) {
|
if($(slideslave).parent().hasClass("nodisplay")) {
|
||||||
$(slideslave).parent().removeClass('nodisplay');
|
$(slideslave).parent().removeClass('nodisplay');
|
||||||
$(slideslave).parent().addClass('HASnodisplay');
|
$(slideslave).parent().addClass('HASnodisplay');
|
||||||
|
|
@ -140,6 +140,86 @@ function slide_key_down() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function topic_next() {
|
||||||
|
console.log('Nächstes Thema ...');
|
||||||
|
var i = $(".nav-pills:not(.pill-sub-1) > .nav-item > .nav-link.active").parent();
|
||||||
|
/*console.log(i);*/
|
||||||
|
var n = i.next();
|
||||||
|
if(n.length >= 1) {
|
||||||
|
/*console.log(n);*/
|
||||||
|
var a = n.find('a.nav-link');
|
||||||
|
/*console.log(a);*/
|
||||||
|
if(a.length >= 1)
|
||||||
|
a[0].click();
|
||||||
|
else
|
||||||
|
console.log("Kein nächster Punkt [FEHLER!]");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('Kein nächster Punkt!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function topic_prev() {
|
||||||
|
console.log('Vorheriges Thema ...');
|
||||||
|
var i = $(".nav-pills:not(.pill-sub-1) > .nav-item > .nav-link.active").parent();
|
||||||
|
/*console.log(i);*/
|
||||||
|
var n = i.prev();
|
||||||
|
/*console.log(n);*/
|
||||||
|
if(n.length >= 1) {
|
||||||
|
/*console.log(n);*/
|
||||||
|
var a = n.find('a.nav-link');
|
||||||
|
/*console.log(a);*/
|
||||||
|
if(a.length >= 1)
|
||||||
|
a[0].click();
|
||||||
|
else
|
||||||
|
console.log("Kein vorheriger Punkt [FEHLER!]");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('Kein vorheriger Punkt!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function page_next() {
|
||||||
|
console.log('Nächste Seite ...');
|
||||||
|
var i = $(".nav-pills.pill-sub-1 > .nav-item > .nav-link.active").parent();
|
||||||
|
/*console.log(i);*/
|
||||||
|
var n = i.next();
|
||||||
|
if(n.length >= 1) {
|
||||||
|
/*console.log(n);*/
|
||||||
|
var a = n.find('a.nav-link');
|
||||||
|
/*console.log(a);*/
|
||||||
|
if(a.length >= 1)
|
||||||
|
a[0].click();
|
||||||
|
else
|
||||||
|
console.log("Kein nächster Punkt [FEHLER!]");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('Kein nächster Punkt! -> Nächstes Thema');
|
||||||
|
topic_next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function page_prev() {
|
||||||
|
console.log('Vorherige Seite ...');
|
||||||
|
var i = $(".nav-pills.pill-sub-1 > .nav-item > .nav-link.active").parent();
|
||||||
|
/*console.log(i);*/
|
||||||
|
var n = i.prev();
|
||||||
|
/*console.log(n);*/
|
||||||
|
if(n.length >= 1) {
|
||||||
|
/*console.log(n);*/
|
||||||
|
var a = n.find('a.nav-link');
|
||||||
|
/*console.log(a);*/
|
||||||
|
if(a.length >= 1)
|
||||||
|
a[0].click();
|
||||||
|
else
|
||||||
|
console.log("Kein vorheriger Punkt [FEHLER!]");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('Kein vorheriger Punkt! -> Vorheriges Thema');
|
||||||
|
topic_prev();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function register_presentationkeys () {
|
function register_presentationkeys () {
|
||||||
console.log("registering keys ...")
|
console.log("registering keys ...")
|
||||||
|
|
@ -147,84 +227,28 @@ function register_presentationkeys () {
|
||||||
console.log('Keydown: ', e.which)
|
console.log('Keydown: ', e.which)
|
||||||
switch(e.which) {
|
switch(e.which) {
|
||||||
case 37:
|
case 37:
|
||||||
slide_key_up();
|
slide_prev();
|
||||||
break;
|
break;
|
||||||
case 39:
|
case 39:
|
||||||
slide_key_down();
|
slide_next();
|
||||||
break;
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
console.log('Nächster Punkt ...');
|
/* BILD RAUF: Punkt erster Ordnung weiter */
|
||||||
var i = $(".nav-pills:not(.pill-sub-1) > .nav-item > .nav-link.active").parent();
|
topic_next();
|
||||||
console.log(i);
|
|
||||||
var n = i.next();
|
|
||||||
if(n.length >= 1) {
|
|
||||||
console.log(n);
|
|
||||||
var a = n.find('a.nav-link');
|
|
||||||
console.log(a);
|
|
||||||
if(a.length >= 1)
|
|
||||||
a[0].click();
|
|
||||||
else
|
|
||||||
console.log("Kein nächster Punkt [FEHLER!]");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log('Kein nächster Punkt!');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 36:
|
case 36:
|
||||||
console.log('Vorheriger Punkt ...');
|
/* POS1: Punkt erster Ordnung zurück */
|
||||||
var i = $(".nav-pills:not(.pill-sub-1) > .nav-item > .nav-link.active").parent();
|
topic_prev();
|
||||||
console.log(i);
|
|
||||||
var n = i.prev();
|
|
||||||
console.log(n);
|
|
||||||
if(n.length >= 1) {
|
|
||||||
console.log(n);
|
|
||||||
var a = n.find('a.nav-link');
|
|
||||||
console.log(a);
|
|
||||||
if(a.length >= 1)
|
|
||||||
a[0].click();
|
|
||||||
else
|
|
||||||
console.log("Kein vorheriger Punkt [FEHLER!]");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log('Kein vorheriger Punkt!');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 34:
|
case 34:
|
||||||
console.log('Nächster Unter-Punkt ...');
|
case 74:
|
||||||
var i = $(".nav-pills.pill-sub-1 > .nav-item > .nav-link.active").parent();
|
/* BILD RUNTER: Punkt zweiter Ordnung weiter */
|
||||||
console.log(i);
|
page_next();
|
||||||
var n = i.next();
|
|
||||||
if(n.length >= 1) {
|
|
||||||
console.log(n);
|
|
||||||
var a = n.find('a.nav-link');
|
|
||||||
console.log(a);
|
|
||||||
if(a.length >= 1)
|
|
||||||
a[0].click();
|
|
||||||
else
|
|
||||||
console.log("Kein nächster Punkt [FEHLER!]");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log('Kein nächster Punkt!');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 35:
|
case 35:
|
||||||
console.log('Vorheriger Unter-Punkt ...');
|
case 70:
|
||||||
var i = $(".nav-pills.pill-sub-1 > .nav-item > .nav-link.active").parent();
|
/* ENDE: Punkt zweiter Ordnung zurück */
|
||||||
console.log(i);
|
page_prev();
|
||||||
var n = i.prev();
|
|
||||||
console.log(n);
|
|
||||||
if(n.length >= 1) {
|
|
||||||
console.log(n);
|
|
||||||
var a = n.find('a.nav-link');
|
|
||||||
console.log(a);
|
|
||||||
if(a.length >= 1)
|
|
||||||
a[0].click();
|
|
||||||
else
|
|
||||||
console.log("Kein vorheriger Punkt [FEHLER!]");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log('Kein vorheriger Punkt!');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -237,7 +261,7 @@ function jump_to_slide_true() {
|
||||||
|
|
||||||
function show_next_slide() {
|
function show_next_slide() {
|
||||||
if(__slide_data.index != __slide_data.slides.length-1) {
|
if(__slide_data.index != __slide_data.slides.length-1) {
|
||||||
slide_key_down();
|
slide_next();
|
||||||
setTimeout(show_next_slide, 0);
|
setTimeout(show_next_slide, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -252,6 +276,6 @@ function show_all_slides() {
|
||||||
{
|
{
|
||||||
console.log(__slide_data.slideslidess[0].index);
|
console.log(__slide_data.slideslidess[0].index);
|
||||||
console.log(__slide_data.slideslidess[0].slides.length-1);
|
console.log(__slide_data.slideslidess[0].slides.length-1);
|
||||||
slide_key_down();
|
slide_next();
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue