From 95d44c4940e116446160c6a7c124a8c105c2e7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjarne=20Var=C3=B6ystrand?= Date: Mon, 24 Oct 2016 00:31:49 +0200 Subject: [PATCH] [FIXED] Slideshow settings didn't stick Minimized our Javascript and instead added the uncompressed/raw JS to OxyGen-slideshow.js for anyone that want to have a look at it. [FIXED] Slideshow settings didn't stick --- OxyGen-slideshow/OxyGen-slideshow.js | 41 ++++++++++------ OxyGen-slideshow/plugin.json | 2 +- OxyGen-slideshow/plugin.php | 71 +--------------------------- README.md | 4 ++ 4 files changed, 34 insertions(+), 84 deletions(-) diff --git a/OxyGen-slideshow/OxyGen-slideshow.js b/OxyGen-slideshow/OxyGen-slideshow.js index b0b04d1..393fd70 100644 --- a/OxyGen-slideshow/OxyGen-slideshow.js +++ b/OxyGen-slideshow/OxyGen-slideshow.js @@ -10,8 +10,8 @@ pulse{$slideUnique}.on( 'playing', function(isPlaying) { }); pulse{$slideUnique}.on( 'transitionstart', function(e) { var data = e.data, - title = $('#content-title{$slideUnique}'), - caption = $('#content-caption{$slideUnique}'), + title = $('#{$slideUnique}_title'), + caption = $('#{$slideUnique}_caption'), link = $('#content-link{$slideUnique}'); link.attr("href", data.url); if (data.title.length > 1 ) { @@ -37,17 +37,30 @@ function playState{$slideUnique}(playing) { } else { el.html('{{ language.play }}'); } -} -var interval = 1; -setInterval(function(){ - if(interval == 3){ - $('#nav_content').fadeOut(2000); - interval = 1; +}; +$(document).ready(function() { +//The page is "ready" and the document can be manipulated. + if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)){ + //If the device is a touch capable device, then... + $(document).on("touchstart", "a", function() { + //Do something on tap. + }); + } else { + var interval = 1; + setInterval(function(g){ + if(interval == 5){ + $('#nav_content').fadeOut(2000, function(h){ + $('#nav_content').css({"display": "block","visibility": "hidden"}); + interval = 1; + }); + } + interval = interval+1; + },1000); + $(document).bind('mousemove keypress', function(i) { + $('#nav_content').fadeIn(2000, function(j){ + $('#nav_content').css({"visibility": "visible"}); + interval = 1; + }); + }); } - interval = interval+1; -},1000); - -$(document).bind('mousemove keypress', function() { - $('#nav_content').fadeIn(2000); - interval = 1; }); diff --git a/OxyGen-slideshow/plugin.json b/OxyGen-slideshow/plugin.json index fcfd951..290362f 100644 --- a/OxyGen-slideshow/plugin.json +++ b/OxyGen-slideshow/plugin.json @@ -1,6 +1,6 @@ { "name": "OxyGen Slideshow", - "version": "1.1", + "version": "1.1.1", "description": "Embed slideshow with controls in essay and pages.", "author": { "name": "Bjarne Varoystrand", diff --git a/OxyGen-slideshow/plugin.php b/OxyGen-slideshow/plugin.php index 0438494..7a7aef5 100644 --- a/OxyGen-slideshow/plugin.php +++ b/OxyGen-slideshow/plugin.php @@ -9,7 +9,7 @@ function render($attributes) { return <<
- +