93 lines
2.4 KiB
Smarty
93 lines
2.4 KiB
Smarty
{**
|
|
* 2014-2020 Presta-Mod.pl Rafał Zontek
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* Poniższy kod jest kodem płatnym, rozpowszechanie bez pisemnej zgody autora zabronione
|
|
* Moduł można zakupić na stronie Presta-Mod.pl. Modyfikacja kodu jest zabroniona,
|
|
* wszelkie modyfikacje powodują utratę gwarancji
|
|
*
|
|
* http://presta-mod.pl
|
|
*
|
|
* DISCLAIMER
|
|
*
|
|
*
|
|
* @author Presta-Mod.pl Rafał Zontek <biuro@presta-mod.pl>
|
|
* @copyright 2014-2020 Presta-Mod.pl
|
|
* @license Licecnja na jedną domenę
|
|
* Presta-Mod.pl Rafał Zontek
|
|
*}
|
|
<div class="panel">
|
|
<fieldset>
|
|
<legend>{l s='Generowanie miniatur' mod='regenerateimage'}</legend>
|
|
<form action="" method="post">
|
|
<textarea class="dialog" rows="10" disabled="disabled"></textarea>
|
|
</form>
|
|
{l s='Status: ' mod='regenerateimage'}<strong><div class="status">{$status|escape:'htmlall':'UTF-8'}</div> / {$all}</strong> <br/>
|
|
<button class="btn btn-default reset_status">{l s='Resetuj status' mod='exportxml'}</button><br/>
|
|
<button class="btn btn-default start_update">{l s='Aktualizacja' mod='exportxml'}</button><br/>
|
|
</fieldset>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
var s = null;
|
|
var refreshStatus = null;
|
|
|
|
|
|
function startRefreshStatus() {
|
|
refreshStatus = setInterval(function(){
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
headers: { "cache-control": "no-cache" },
|
|
url: '{$base_dir}modules/regenerateimage/ajax.php?get_status&rand=' + new Date().getTime(),
|
|
async: true,
|
|
cache: false,
|
|
data: 'ajax_blockcart_display=expand',
|
|
success: function(f) {
|
|
$('.status').html(f);
|
|
}
|
|
});
|
|
},500);
|
|
}
|
|
|
|
function resetStatus() {
|
|
if (s == null) {
|
|
stopUpdate();
|
|
}
|
|
$.ajax('{$base_dir}modules/regenerateimage/ajax.php?reset_status');
|
|
return false;
|
|
}
|
|
|
|
function startUpdate() {
|
|
$.ajax({
|
|
type: 'POST',
|
|
headers: { "cache-control": "no-cache" },
|
|
url: '{$base_dir}modules/regenerateimage/ajax.php?progress&rand=' + new Date().getTime(),
|
|
async: true,
|
|
cache: false,
|
|
data: 'ajax_blockcart_display=expand',
|
|
success: function(f) {
|
|
if (f.indexOf('-1') == -1) {
|
|
$('.dialog').prepend(f);
|
|
startUpdate();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function stopUpdate() {
|
|
return false;
|
|
}
|
|
|
|
$('.reset_status').click(resetStatus);
|
|
startRefreshStatus();
|
|
$('.start_update').click(function(){
|
|
$('.dialog').html('');
|
|
startUpdate();
|
|
|
|
});
|
|
|
|
})
|
|
|
|
</script> |