Commit ee73e48d authored by Troy Grandy's avatar Troy Grandy

Screens that disconnect from internet will now get content once connection is reestablished.

parent 84766a11
......@@ -122,7 +122,11 @@
}));
});
$( "#slidelist" ).sortable({
containment: '#slidelist',
cursor: "move",
revert: true,
scroll: false,
helper: 'clone',
update: function( event, ui ) {
reorder();
}
......@@ -145,31 +149,31 @@
$('#listSlidesLoader').on('click', '.slideItem .addslidebutton', function(evt){
evt.preventDefault();
var slideItem = $(this).closest('.slideItem');
// Get highest layer
var index_highest = 0;
$("#slidelist>.activeIcon").each(function() {
var index_current = parseInt($(".slideForm>.order",this).val());
if(index_current > index_highest) {
index_highest = index_current;
}
});
var count = $('#slidelist>.slideIcon').length;
var owner = slideItem.find('.owner').text()
var title = slideItem.find('h4>span>b').text()
var tmplMarkup = $('#emptyslide').html();
var compiledTmpl = tmplMarkup.replace(/__prefix__/g, count).replace(/__title__/g, title).replace(/__owner__/g, owner);
$('#slidelist').append(compiledTmpl);
//Grab this newest slide we just added...
var newlayer = $('#slidelist .slideIcon:last-child')
// Fill it with goodies from the jsonData
$(".slideForm>.order", newlayer).val(index_highest+1)
$(".slideForm>.slide", newlayer).val(slideItem.data('id'))
$('.slideContent', newlayer).prepend(slideItem.find('.info').html())
// update form count
$('#id_slide-TOTAL_FORMS').attr('value', count+1);
$('#slidesModal').modal('hide');
reorder();
newlayer.find('.timeselect').flatpickr({enableTime: true});
// Get highest layer
var index_highest = 0;
$("#slidelist>.activeIcon").each(function() {
var index_current = parseInt($(".slideForm>.order",this).val());
if(index_current > index_highest) {
index_highest = index_current;
}
});
var count = $('#slidelist>.slideIcon').length;
var owner = slideItem.find('.owner').text()
var title = slideItem.find('h4>span>b').text()
var tmplMarkup = $('#emptyslide').html();
var compiledTmpl = tmplMarkup.replace(/__prefix__/g, count).replace(/__title__/g, title).replace(/__owner__/g, owner);
$('#slidelist').append(compiledTmpl);
//Grab this newest slide we just added...
var newlayer = $('#slidelist .slideIcon:last-child')
// Fill it with goodies from the jsonData
$(".slideForm>.order", newlayer).val(index_highest+1)
$(".slideForm>.slide", newlayer).val(slideItem.data('id'))
$('.slideContent', newlayer).prepend(slideItem.find('.info').html())
// update form count
$('#id_slide-TOTAL_FORMS').attr('value', count+1);
$('#slidesModal').modal('hide');
reorder();
newlayer.find('.timeselect').flatpickr({enableTime: true});
})
$(".timeselect").flatpickr({enableTime: true});
$("#slidelist").on('click', '.clear-time', function(){
......
......@@ -73,12 +73,20 @@ function nextframe(source, time, index){
$('.next').css('z-index', 4);
$('.next').toggleClass('next current')
current.attr('src', 'about:blank').load().css('z-index', 1).toggleClass('next current');
$.get('/slideshows/nextslide/{{slideshow.id}}/'+String(index)+'/', function(data){
$('#bg').css('opacity', 0);
setTimeout(function(){
setTimeout(function(){nextframe(data.slide, data.time, data.index)}, time)
}, 600);
})
function getIt(){
$.get('/slideshows/nextslide/{{slideshow.id}}/'+String(index)+'/', function(data){
$('#bg').css('opacity', 0);
setTimeout(function(){
setTimeout(function(){nextframe(data.slide, data.time, data.index)}, time)
}, 600);
}).fail(function(error){
console.log('fail', this)
setTimeout(function(){
getIt()
}, 6000)
})
}
getIt()
}, 600)
})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment