ver. 0.307: check-update button + auto-generated changelog
- Add "Sprawdź aktualizacje" refresh button in admin sidebar (AJAX check without page reload) - Add UpdateController::checkUpdate() action clearing session cache and querying update server - Replace hand-edited changelog.php with auto-generating script (reads manifests + legacy JSON) - Migrate all legacy changelog entries (0.300-0.001) to changelog-legacy.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,10 +44,16 @@
|
||||
<div class="menu">
|
||||
<div class="logo sticky-top">
|
||||
shop<b>Pro</b>
|
||||
<span>ver. <?= \Shared\Helpers\Helpers::get_version();?></span><br>
|
||||
<? if ( $settings[ 'update' ] and \Shared\Helpers\Helpers::get_new_version() > \Shared\Helpers\Helpers::get_version() ):?>
|
||||
<a href="/admin/update/main_view/" class="label label-danger">aktualizacja</a>
|
||||
<? endif;?>
|
||||
<span>ver. <?= \Shared\Helpers\Helpers::get_version();?>
|
||||
<? if ( $settings[ 'update' ] ):?>
|
||||
<i class="fa fa-refresh check-update-btn" id="check-update-btn" title="Sprawdź aktualizacje" style="cursor:pointer;margin-left:4px;font-size:11px;opacity:0.7;"></i>
|
||||
<? endif;?>
|
||||
</span><br>
|
||||
<span id="update-badge-wrap">
|
||||
<? if ( $settings[ 'update' ] and \Shared\Helpers\Helpers::get_new_version() > \Shared\Helpers\Helpers::get_version() ):?>
|
||||
<a href="/admin/update/main_view/" class="label label-danger">aktualizacja</a>
|
||||
<? endif;?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="menu-content">
|
||||
<ul>
|
||||
@@ -356,6 +362,32 @@
|
||||
});
|
||||
})();
|
||||
|
||||
(function() {
|
||||
$(document).off('click.checkUpdate', '#check-update-btn').on('click.checkUpdate', '#check-update-btn', function(e) {
|
||||
e.preventDefault();
|
||||
var $btn = $(this);
|
||||
if ($btn.hasClass('fa-spin')) return;
|
||||
$btn.addClass('fa-spin').css('opacity', 1);
|
||||
$.ajax({
|
||||
url: '/admin/update/checkUpdate/',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
$btn.removeClass('fa-spin').css('opacity', 0.7);
|
||||
var $wrap = $('#update-badge-wrap');
|
||||
if (data.has_update) {
|
||||
$wrap.html('<a href="/admin/update/main_view/" class="label label-danger">aktualizacja</a>');
|
||||
} else {
|
||||
$wrap.html('');
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$btn.removeClass('fa-spin').css('opacity', 0.7);
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
$(document).ready(function () {
|
||||
var user_agent = navigator.userAgent.toLowerCase();
|
||||
var click_event = user_agent.match(/(iphone|ipod|ipad)/) ? "touchend" : "click";
|
||||
|
||||
Reference in New Issue
Block a user