Remove automatic cache generation

This commit is contained in:
grandeljay 2022-11-29 15:53:36 +01:00
parent b281ff8af5
commit 1a4e911fb8
5 changed files with 0 additions and 121 deletions

View file

@ -64,13 +64,6 @@ figure {
position: static;
}
/**
* Progress
*/
.ui.progress.nolabel:last-child {
margin: 0;
}
/**
* Wishlist Grid
*/

View file

@ -1,6 +0,0 @@
/**
* Progress
*/
.ui.progress {
display: none;
}

View file

@ -1,15 +1,4 @@
$(function () {
/**
* Progress
*/
var progress = $('.ui.progress');
progress.progress({
onSuccess : function() {
$(this).slideUp();
}
});
/**
* Get Wishlists
*/
@ -165,100 +154,11 @@ $(function () {
$('.wishlist-rename').removeClass('disabled');
$('.wishlist-delete').removeClass('disabled');
}
/**
* Generate cache
*//*
var cards = $('.ui.card[data-cache="true"]');
if (cards.length > 0) {
progress.slideDown();
progress.progress('reset');
progress.progress('set total', cards.length);
}
var timerInterval = 1200;
var timerCache = setTimeout(
function generateCacheCards() {
var cards = $('.ui.card[data-cache="true"]');
if (cards.length > 0) {
cards.each(function (index, card) {
generateCacheCard($(card));
if (index >= 0) {
return false;
}
});
setTimeout(generateCacheCards, timerInterval);
}
},
0
);
$('.ui.dropdown.options').dropdown({
onChange: function(value, text, choice) {
var dropdownOptions = $(this);
setTimeout(function() {
dropdownOptions.dropdown('restore defaults', true);
}, 0);
}
});
*/
},
})
.api(wishlists_api)
.api('query');
/*
function generateCacheCard(card) {
var href = card.find('.content [href]').prop('href');
if (!href) {
return;
}
var wishlist_id = $('.ui.dropdown.wishlists').dropdown('get value') - 1;
var wishlist_user = wishlists[wishlist_id].user;
card.addClass('loading');
card.attr('data-cache', 'false');
const params_cache = new URLSearchParams(
{
'module' : 'wishes',
'page' : 'api',
'wish_id' : card.attr('data-id'),
'wishlist_user' : wishlist_user,
}
);
fetch('/?' + params_cache, {
method: 'GET'
})
.then(handleFetchError)
.then(handleFetchResponse)
.then(function(response) {
card.replaceWith(response.html.replace('data-cache="true"', 'data-cache="false"'));
})
.catch(handleFetchCatch)
.finally(function() {
card.removeClass('loading');
progress.progress('increment', 1);
if (progress.progress('get percent') >= 100) {
progress.slideUp();
}
$('.ui.dropdown.options').dropdown();
});
}
*/
/**
* Share Wishlist
*/

View file

@ -62,8 +62,6 @@ $(function() {
}
});
$('.ui.progress').progress();
/**
* Preferences
*/

View file

@ -86,12 +86,6 @@ $page->navigation();
<h2 class="ui header"><?= __('Wishes') ?></h2>
<div class="ui primary progress">
<div class="bar">
<div class="progress"></div>
</div>
</div>
<?php include 'parts/wishlist.php' ?>
</div>
</main>