Skip to content

Commit

Permalink
[FIXED] Slideshow settings didn't stick
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BlackSkorpio committed Oct 23, 2016
1 parent bd84672 commit 95d44c4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 84 deletions.
41 changes: 27 additions & 14 deletions OxyGen-slideshow/OxyGen-slideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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;
});
2 changes: 1 addition & 1 deletion OxyGen-slideshow/plugin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
71 changes: 2 additions & 69 deletions OxyGen-slideshow/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function render($attributes) {
return <<<HTML
<figure class="k-content-embed og-slideshow" id="{$slideUnique}_slideshow">
<div class="k-content">
<koken:pulse source="album" filter:id="{$attributes['album']}" jsvar="pulse{$slideUnique}" group="albums-{$slideUnique}" next="#sldshw-next{$slideUnique}" previous="#sldshw-prev{$slideUnique}" toggle="#sldshw-play{$slideUnique}" link_to="lightbox" />
<koken:pulse source="album" filter:id="{$attributes['album']}" jsvar="pulse{$slideUnique}" group="og-slideshow-{$attributes['album']}" next="#sldshw-next{$slideUnique}" previous="#sldshw-prev{$slideUnique}" toggle="#sldshw-play{$slideUnique}" link_to="lightbox" />
<ul class="og-slideshow nav-content" id="nav_content">
<li class="sldshw-prev"><a href="#" id="sldshw-prev{$slideUnique}" title="{{ language.previous }}">&larr;&nbsp;</a>
<li class="sldshw-play"><a href="#" id="sldshw-play{$slideUnique}" title="Toggle" data-bind-to-key="space">Loading</a>
Expand All @@ -20,74 +20,7 @@ function render($attributes) {
<span id="{$slideUnique}_title" class="k-content-title">&nbsp;</span>
<span id="{$slideUnique}_caption" class="k-content-caption">&nbsp;</span>
</figcaption>
<script>
pulse{$slideUnique}.on( 'start', function() {
$('#sldshw-play{$slideUnique}').addClass('waiting');
playState{$slideUnique}(pulse{$slideUnique}.options.autostart);
});
pulse{$slideUnique}.on( 'dataloaded', function() {
$('#sldshw-play{$slideUnique}').removeClass('waiting');
});
pulse{$slideUnique}.on( 'playing', function(isPlaying) {
playState{$slideUnique}(isPlaying);
});
pulse{$slideUnique}.on( 'transitionstart', function(e) {
var data = e.data,
title = $('#{$slideUnique}_title'),
caption = $('#{$slideUnique}_caption'),
link = $('#content-link{$slideUnique}');
link.attr("href", data.url);
if (data.title.length > 1 ) {
title.html( data.title );
} else {
title.html( data.filename );
}
link.attr("title", data.title || data.filename );
if (data.caption.length > 1) {
caption.html( data.caption );
} else {
caption.html( '&nbsp;' );
}
$('#sldshw-play{$slideUnique}').removeClass('waiting');
});
pulse{$slideUnique}.on( 'waiting', function() {
$('#sldshw-play{$slideUnique}').addClass('waiting');
});
function playState{$slideUnique}(playing) {
var el = $('#sldshw-play{$slideUnique}');
if (playing) {
el.html('{{ language.pause }}');
} else {
el.html('{{ language.play }}');
}
};
$(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;
});
});
}
});
</script>
<script> pulse{$slideUnique}.on( 'start', function() { $('#sldshw-play{$slideUnique}').addClass('waiting'); playState{$slideUnique}(pulse{$slideUnique}.options.autostart); }); pulse{$slideUnique}.on( 'dataloaded', function() { $('#sldshw-play{$slideUnique}').removeClass('waiting'); }); pulse{$slideUnique}.on( 'playing', function(isPlaying) { playState{$slideUnique}(isPlaying); }); pulse{$slideUnique}.on( 'transitionstart', function(e) { var data = e.data, title = $('#{$slideUnique}_title'), caption = $('#{$slideUnique}_caption'), link = $('#content-link{$slideUnique}'); link.attr("href", data.url); if (data.title.length > 1 ) { title.html( data.title ); } else { title.html( data.filename ); } link.attr("title", data.title || data.filename ); if (data.caption.length > 1) { caption.html( data.caption ); } else { caption.html( '&nbsp;' ); } $('#sldshw-play{$slideUnique}').removeClass('waiting'); }); pulse{$slideUnique}.on( 'waiting', function() { $('#sldshw-play{$slideUnique}').addClass('waiting'); }); function playState{$slideUnique}(playing) { var el = $('#sldshw-play{$slideUnique}'); if (playing) { el.html('{{ language.pause }}'); } else { el.html('{{ language.play }}'); } }; $(document).ready(function() { if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)){ $(document).on("touchstart", "a", function() { }); } 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; }); }); } }); </script>
</figure>
HTML;
}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Slideshow settings for each slideshow, can be set directly inside `Admin->Site -

## Changelog

### 1.1.1
* 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

### 1.1
* Abandonded using custom divs for the slideshow.
* Instead we are now using the same as the core slideshows: `<figure>` `<figcaption>` this way we get to re-use the themes built in classes. But still be able to set unciqe styles to each slideshow.
Expand Down

0 comments on commit 95d44c4

Please sign in to comment.