Compare commits

...

27 Commits

Author SHA1 Message Date
nertyog c347a9a773 feat(ui): adapt smart cache button, 46px action row, unified broken fallback card and bulletproof header menu 2026-10-09 07:17:11 +03:00
nertyog 5a3c31ac6e merge: integrate origin/main history preserving verified 2.0-2.2 v1.2.1 codebase 2026-09-29 01:44:31 +03:00
nertyog 89dfbeb748 chore: update release ocmod zip with latest 2.0-2.2 fixes 2026-09-05 17:28:00 +03:00
nertyog a26095323c merge: integrate client fixes from test-client-fixes into main 2026-09-05 17:27:21 +03:00
nertyog 22f1e535c7 fix(svg): hide SVG autofix sub-checkbox container when main SVG option is unchecked 2026-08-13 19:40:30 +03:00
nertyog 1656e0e5c8 fix(svg): set default for module_img_opti_support_svg_autofix to 0 (unchecked by default) 2026-08-13 19:37:59 +03:00
nertyog c0ea9a5a1e fix(svg): make SVG autofix sub-checkbox always visible inside SVG card without initial display:none 2026-08-13 19:35:14 +03:00
nertyog ea4cba3194 fix(svg): scope SVG CSS rules strictly to catalog image paths (/image/catalog/), removing artificial theme class overrides 2026-08-13 19:28:48 +03:00
nertyog c24b8d2ba8 fix(svg): isolate SVG CSS rules, add optional SVG autofix sub-setting, and exclude UI/language flags from sizing rules 2026-08-13 19:25:14 +03:00
nertyog 0b9e19eccd release(v1.2.0): finalize stage 7.1 & 7.2 improvements, watermark preview fixes, tab/tool persistence and checkbox setting handlers 2026-08-07 05:36:25 +03:00
nertyog 7277ecc621 fix(settings): explicitly initialize unchecked checkbox settings to 0 in POST handler before saving to DB 2026-08-07 05:33:59 +03:00
nertyog 9d2bd1c2ed fix(ui): prevent cross-tool scan cache leak when switching tools and refreshing page 2026-08-07 05:26:43 +03:00
nertyog 16f855fcf0 feat(ui): persist active tab and tool selection in localStorage across page refreshes 2026-08-07 05:22:31 +03:00
nertyog 2a9e4c3769 fix(watermark): add interactive HTML5 colorpicker, unique cache-busted preview filenames and exact product canvas aspect ratio 2026-08-07 05:16:40 +03:00
nertyog c7eec6d352 fix(watermark): case-insensitive Windows path check, text font size (wm_text_size), and fixed pixel size (wm_size_px) 2026-08-07 05:11:34 +03:00
nertyog be06ede1c3 feat(ui): implement Stage 7 watermark background switcher (product, white, transparent grid) and action button margin polish 2026-08-07 04:58:49 +03:00
nertyog 07e9d9773c fix(ajax): strip UTF-8 BOM headers from all PHP files and rebuild release zip package image_optimizer_nat_OC_20_22_1_2_0.ocmod.zip 2026-08-07 04:55:52 +03:00
nertyog 3e5dc38ce3 release: rebuild 100% fresh release zip package image_optimizer_nat_OC_20_22_1_2_0.ocmod.zip with verified disk file parity 2026-08-07 04:46:38 +03:00
nertyog ccf944e750 fix(lang): correct Ukrainian translation for button_online_instruction key 2026-08-07 04:44:22 +03:00
nertyog e4307b27fc release: lock version 1.2.0 across all files, install.xml, and rebuild release zip package image_optimizer_nat_OC_20_22_1_2_0.ocmod.zip 2026-08-07 04:36:17 +03:00
nertyog 082fe99fc6 style: improve category badge contrast, padding, and border-radius in light/dark themes 2026-08-07 04:34:20 +03:00
nertyog b7b476e472 docs: add exhaustive documentation table for all 19 pro tools across instruction.html, instructions.txt, and readme.txt 2026-08-07 04:32:44 +03:00
nertyog 7ba8d48fc4 docs: update v1.2.0 badge and document On-the-Fly Fake JPG Guard in instruction.html 2026-08-07 04:31:25 +03:00
nertyog cbf05b88b0 docs: expand documentation to cover all 9 tabs, nuances, and rebuild release packages v1.2.0 2026-08-07 04:29:18 +03:00
nertyog 57d6bac47c docs: update version tag to v1.2.0, sync all documentation files and rebuild release zip package 2026-08-07 04:27:09 +03:00
nertyog c37d0c04b8 docs & release: add online instruction button, clean code comments, update documentation files and build docs/ package structure 2026-08-07 04:24:48 +03:00
nertyog faf03e20b7 release: 1.0.0 reference release for OpenCart 2.0-2.2 (with GD/Imagick labels, On-the-Fly Fake JPG Guard, persistent DB stats, full settings export/import, and UI polish) 2026-08-07 04:16:02 +03:00
3 changed files with 223 additions and 30 deletions

View File

@ -14,7 +14,7 @@
$this->load->model('setting/setting');
if ($this->config->get('module_img_opti_status')) {
$nat_pos = $this->config->get('module_img_opti_menu_position');
if ($nat_pos == 'sidebar' || $nat_pos == 'both') {
if (empty($nat_pos) || $nat_pos == 'sidebar' || $nat_pos == 'both') {
if ($this->user->hasPermission('access', 'module/img_opti')) {
$nat_token_str = 'token=' . (isset($this->session->data['token']) ? $this->session->data['token'] : '');
$nat_item = array(
@ -46,10 +46,11 @@
if (!$exists) {
if ($nat_menu_index > -1) {
$data['menus'][$nat_menu_index]['children'][] = $nat_item;
$data['menus'][$nat_menu_index]['icon'] = 'fa-space-shuttle fa-rotate-270 fw';
} else {
$data['menus'][] = array(
'id' => 'menu-nat',
'icon' => 'fa-rocket fw',
'icon' => 'fa-space-shuttle fa-rotate-270 fw',
'name' => '[NAT] Modules',
'href' => '',
'children' => array($nat_item)
@ -73,7 +74,7 @@
$this->load->model('setting/setting');
if ($this->config->get('module_img_opti_status')) {
$nat_pos = $this->config->get('module_img_opti_menu_position');
if ($nat_pos == 'header' || $nat_pos == 'both') {
if (empty($nat_pos) || $nat_pos == 'header' || $nat_pos == 'both') {
if ($this->user->hasPermission('access', 'module/img_opti')) {
$exists = false;
foreach ($data['nat_menus'] as $m) {
@ -99,13 +100,31 @@
<operation error="skip">
<search><![CDATA[</head>]]></search>
<add position="before"><![CDATA[
<style>
<style type="text/css">
#nat-ecosystem-menu .fa-rocket { color: #ec741c !important; }
#nat-ecosystem-menu .fa-rocket:before { content: "\f197" !important; display: inline-block; transform: rotate(270deg); }
#nat-ecosystem-menu .fa-space-shuttle { color: #ec741c !important; }
a.img-thumbnail img, a.thumbnail img {
width: 100px !important;
height: 100px !important;
object-fit: contain !important;
}
</style>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
if (typeof $ !== 'undefined') {
var $menu = $('#nat-ecosystem-menu');
if ($menu.length && !$('.navbar-right #nat-ecosystem-menu, .pull-right #nat-ecosystem-menu').length) {
var $logout = $('a[href*="common/logout"]').closest('li');
if ($logout.length) {
$menu.insertBefore($logout);
} else {
$('.nav.navbar-nav.navbar-right, .navbar-right, .nav.pull-right, #header .nav').first().append($menu);
}
}
}
});
</script>
]]></add>
</operation>
<operation error="skip">
@ -114,7 +133,7 @@ a.img-thumbnail img, a.thumbnail img {
<?php if (isset($nat_menus) && !empty($nat_menus) && empty($GLOBALS['nat_menu_rendered'])) { ?>
<?php $GLOBALS['nat_menu_rendered'] = true; ?>
<li class="dropdown" id="nat-ecosystem-menu">
<a class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-rocket fa-lg" style="color:#e74c3c;"></i> <span class="hidden-xs hidden-sm hidden-md">[NAT]</span> <span class="caret"></span></a>
<a class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-space-shuttle fa-rotate-270 fa-lg" style="color: #ec741c;"></i> <span class="hidden-xs hidden-sm hidden-md">[NAT]</span> <span class="caret"></span></a>
<ul class="dropdown-menu dropdown-menu-right" id="nat-ecosystem-list">
<li class="dropdown-header">Ecosystem [NAT]</li>
<?php foreach ($nat_menus as $n_menu) { ?>

View File

@ -389,18 +389,18 @@
</div>
</div>
<div class="row">
<div class="col-sm-10" id="block-start">
<button type="button" id="btn-start" class="btn btn-primary btn-lg btn-block" <?php echo !$gd_enabled ? 'disabled' : ''; ?>><i class="fa fa-play"></i> <?php echo $button_start; ?></button>
<div class="row nat-opti-action-row" style="margin-top: 15px; display: flex; flex-wrap: wrap; align-items: stretch;">
<div class="col-sm-10 col-xs-9" id="block-start" style="padding-right: 5px; display: flex;">
<button type="button" id="btn-start" class="btn btn-primary btn-lg btn-block" <?php echo !$gd_enabled ? 'disabled' : ''; ?> style="border-radius: 6px; font-weight: bold; min-height: 46px; height: 100%; display: flex; align-items: center; justify-content: center;"><i class="fa fa-play" style="margin-right: 8px;"></i> <?php echo $button_start; ?></button>
</div>
<div class="col-sm-2" id="block-reset-cache">
<button type="button" id="btn-reset-cache" class="btn btn-default btn-lg btn-block" title="<?php echo $text_reset_cache_hint; ?>"><i class="fa fa-eraser"></i></button>
<div class="col-sm-2 col-xs-3" id="block-reset-cache" style="padding-left: 5px; display: flex;">
<button type="button" id="btn-reset-cache" class="btn btn-default btn-lg btn-block" data-toggle="tooltip" data-placement="top" title="<?php echo isset($help_btn_reset_cache) ? $help_btn_reset_cache : $text_reset_cache_hint; ?>" style="border-radius: 6px; min-height: 46px; height: 100%; display: flex; align-items: center; justify-content: center;"><i class="fa fa-eraser" style="font-size: 18px;"></i></button>
</div>
<div class="col-sm-6" id="block-pause" style="display:none;">
<button type="button" id="btn-pause" class="btn btn-warning btn-lg btn-block"><i class="fa fa-pause"></i> <?php echo $button_pause; ?></button>
<div class="col-sm-6 col-xs-6" id="block-pause" style="display:none; padding-right: 5px;">
<button type="button" id="btn-pause" class="btn btn-warning btn-lg btn-block" style="border-radius: 6px; font-weight: bold; min-height: 46px; height: 100%; display: flex; align-items: center; justify-content: center;"><i class="fa fa-pause" style="margin-right: 8px;"></i> <?php echo $button_pause; ?></button>
</div>
<div class="col-sm-6" id="block-stop" style="display:none;">
<button type="button" id="btn-stop" class="btn btn-danger btn-lg btn-block"><i class="fa fa-stop"></i> <?php echo $button_stop; ?></button>
<div class="col-sm-6 col-xs-6" id="block-stop" style="display:none; padding-left: 5px;">
<button type="button" id="btn-stop" class="btn btn-danger btn-lg btn-block" style="border-radius: 6px; font-weight: bold; min-height: 46px; height: 100%; display: flex; align-items: center; justify-content: center;"><i class="fa fa-stop" style="margin-right: 8px;"></i> <?php echo $button_stop; ?></button>
</div>
</div>
</div>
@ -459,6 +459,28 @@
<div class="tab-pane" id="tab-cleaner">
<div class="row">
<div class="col-md-5">
<div class="panel panel-default nat-smart-cache-panel" style="border-left: 4px solid #3498db; margin-bottom: 20px; background: #fdfefe;">
<div class="panel-body" style="padding: 15px;">
<div class="nat-smart-cache-flex">
<div class="nat-smart-cache-info">
<h4 style="margin: 0 0 5px 0; color: #2c3e50; font-weight: bold;">
<i class="fa fa-magic text-primary"></i> <?php echo $text_cleaner_smart_cache_title; ?>
<span data-toggle="popover" data-placement="bottom" title="<i class='fa fa-info-circle'></i> <?php echo $text_cleaner_smart_cache_popover_title; ?>" data-content="<?php echo $text_cleaner_smart_cache_popover_desc; ?>" style="cursor: pointer; margin-left: 6px; font-size: 15px; color: #3498db;">
<i class="fa fa-question-circle"></i>
</span>
</h4>
<div style="font-size: 12px; color: #7f8c8d; line-height: 1.4;">
<?php echo $text_cleaner_smart_cache_short_desc; ?>
</div>
</div>
<div class="nat-smart-cache-action">
<button type="button" id="btn-cleaner-smart-cache" class="btn btn-primary">
<i class="fa fa-magic"></i> <?php echo $button_cleaner_smart_cache; ?>
</button>
</div>
</div>
</div>
</div>
<div class="alert alert-info"><i class="fa fa-info-circle"></i> <?php echo $text_cleaner_info; ?></div>
<div id="form-cleaner">
<div class="form-group">
@ -624,22 +646,24 @@
</div>
<div class="row" style="margin-top: 20px;">
<div class="col-md-4">
<div class="checkbox" style="background: #fffdf5; padding: 15px; border: 1px solid #f39c12; border-radius: 6px; min-height: 150px; margin-top: 0; margin-bottom: 0;">
<label style="font-weight: bold; font-size: 14px; color: #d35400;">
<input type="checkbox" name="module_img_opti_broken_fallback" value="1" <?php if (isset($module_img_opti_broken_fallback) && $module_img_opti_broken_fallback) { ?>checked="checked"<?php } ?>>
<?php echo $entry_broken_fallback; ?>
</label>
<div style="font-size: 12px; color: #666; margin-top: 8px; line-height: 1.4;"><?php echo $help_broken_fallback; ?></div>
</div>
</div>
<div class="col-md-8">
<div class="form-group" style="background: #fffdf5; padding: 15px; border: 1px solid #f39c12; border-radius: 6px; min-height: 150px; margin-top: 0; margin-bottom: 0;">
<label style="font-weight: bold; font-size: 14px; color: #d35400; margin-bottom: 8px;"><?php echo $entry_fallback_image; ?></label>
<div style="display: flex; align-items: center; gap: 15px;">
<a href="" id="thumb-fallback_image" data-toggle="image" class="img-thumbnail" style="margin-bottom: 0; flex-shrink: 0;"><img src="<?php echo $thumb_fallback_image; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
<input type="hidden" name="module_img_opti_fallback_image" value="<?php echo $module_img_opti_fallback_image; ?>" id="input-fallback_image" />
<div style="font-size: 12px; color: #666; line-height: 1.4;"><?php echo $help_fallback_image; ?></div>
<div class="col-md-12">
<div style="background: #fffdf5; padding: 16px; border: 1px solid #f39c12; border-radius: 6px;">
<div class="checkbox" style="margin-top: 0; margin-bottom: 8px;">
<label style="font-weight: bold; font-size: 14px; color: #d35400;">
<input type="checkbox" name="module_img_opti_broken_fallback" id="chk-broken-fallback" value="1" <?php if (isset($module_img_opti_broken_fallback) && $module_img_opti_broken_fallback) { ?>checked="checked"<?php } ?>>
<i class="fa fa-picture-o"></i> <?php echo $entry_broken_fallback; ?>
</label>
</div>
<div style="font-size: 12px; color: #666; line-height: 1.4; margin-bottom: 10px;">
<?php echo $help_broken_fallback; ?>
</div>
<div id="fallback-image-box" style="<?php if (empty($module_img_opti_broken_fallback)) { ?>display: none;<?php } ?> margin-top: 10px; padding-top: 12px; border-top: 1px dashed #f0c36d;">
<label style="font-weight: bold; color: #333; font-size: 13px; margin-bottom: 8px; display: block;"><span data-toggle="tooltip" title="<?php echo $help_fallback_image; ?>" style="cursor:help; border-bottom:1px dashed #999;"><?php echo $entry_fallback_image; ?></span></label>
<div style="display: flex; align-items: center; gap: 15px; flex-wrap: wrap;">
<a href="" id="thumb-fallback_image" data-toggle="image" class="img-thumbnail" style="margin-bottom: 0; flex-shrink: 0;"><img src="<?php echo $thumb_fallback_image; ?>" alt="" title="" data-placeholder="<?php echo $placeholder; ?>" /></a>
<input type="hidden" name="module_img_opti_fallback_image" value="<?php echo $module_img_opti_fallback_image; ?>" id="input-fallback_image" />
<div style="font-size: 12px; color: #666; line-height: 1.4; max-width: 650px;"><?php echo $help_fallback_image; ?></div>
</div>
</div>
</div>
</div>
@ -1344,6 +1368,14 @@ $(document).ready(function() {
}
});
$(document).on('change', '#chk-broken-fallback', function() {
if ($(this).is(':checked')) {
$('#fallback-image-box').slideDown();
} else {
$('#fallback-image-box').slideUp();
}
});
$('#wm_type').on('change', function() {
if ($(this).val() == 'text') {
$('#wm_image_wrap').hide();
@ -3260,6 +3292,52 @@ $(document).ready(function() {
$('#tool-selector').val(savedTool).trigger('change');
}
});
// ============ SMART CACHE CLEANER (FROM TAB-CLEANER) ============
$(document).on('click', '#btn-cleaner-smart-cache', function(e) {
e.preventDefault();
var $btn = $(this);
$btn.button('loading');
$.ajax({
url: 'index.php?route=module/img_opti/run_tool&' + tokenParam,
type: 'post',
data: { tool: 'smart_cache', action: 'scan' },
dataType: 'json',
success: function(json) {
$btn.button('reset');
if (json && json.status === 'ok') {
var html = '';
html += '<div class="alert alert-info" style="margin-bottom: 15px;">';
html += '<p><strong><i class="fa fa-info-circle"></i> ' + (json.title || 'Smart Cache Analysis') + '</strong></p>';
html += '<p style="margin: 5px 0 0 0;">' + (json.message || '') + '</p>';
html += '</div>';
if (json.details && json.details.length) {
html += '<div style="max-height: 250px; overflow-y: auto; border: 1px solid #ddd; padding: 10px; background: #fff; border-radius: 4px; font-size: 12px; font-family: monospace;">';
for (var i = 0; i < json.details.length; i++) {
html += '<div style="padding: 2px 0; border-bottom: 1px solid #f1f1f1;">' + json.details[i] + '</div>';
}
html += '</div>';
}
$('#smart-cache-modal-content').html(html);
if (json.total_orphans && json.total_orphans > 0) {
$('#btn-do-smart-cache-clean').show().find('span').text('<?php echo $button_clean_orphans_now; ?> (' + json.total_orphans + ')');
} else {
$('#btn-do-smart-cache-clean').hide();
}
$('#modal-cleaner-smart-cache').modal('show');
} else {
alert(json && json.error ? json.error : 'Unknown error during smart cache analysis');
}
},
error: function(xhr, ajaxOptions, thrownError) {
$btn.button('reset');
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});
});
</script>
<div class="modal fade" id="modal-compare" tabindex="-1" role="dialog" aria-labelledby="compareModalLabel">
@ -3716,6 +3794,102 @@ $(document).ready(function() {
.compare-img img {
object-fit: contain;
}
/* Smart Cache Cleaner Panel (Responsive Flex Layout) */
.nat-smart-cache-flex {
display: flex !important;
align-items: center !important;
justify-content: space-between !important;
gap: 15px !important;
flex-wrap: wrap !important;
}
.nat-smart-cache-info {
flex: 1 1 180px !important;
min-width: 170px !important;
}
.nat-smart-cache-action {
flex: 0 0 auto !important;
display: flex !important;
align-items: center !important;
}
.nat-smart-cache-action .btn,
#btn-cleaner-smart-cache {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
gap: 8px !important;
min-height: 36px !important;
height: 36px !important;
line-height: 1 !important;
padding: 0 16px !important;
font-size: 13px !important;
font-weight: bold !important;
border-radius: 4px !important;
white-space: nowrap !important;
vertical-align: middle !important;
box-sizing: border-box !important;
}
.nat-smart-cache-action .btn i,
#btn-cleaner-smart-cache i {
margin: 0 !important;
font-size: 14px !important;
line-height: 1 !important;
}
@media (max-width: 767px) {
.nat-smart-cache-action {
width: 100% !important;
margin-top: 8px !important;
}
.nat-smart-cache-action .btn,
#btn-cleaner-smart-cache {
width: 100% !important;
display: flex !important;
}
}
html.nat-dark-mode .nat-smart-cache-panel,
body.nat-dark-mode .nat-smart-cache-panel {
border-left-color: #3498db !important;
}
/* Optimize Action Buttons Row Alignment */
.nat-opti-action-row {
margin-top: 15px !important;
display: flex !important;
flex-wrap: wrap !important;
align-items: stretch !important;
}
.nat-opti-action-row #btn-start,
.nat-opti-action-row #btn-reset-cache,
.nat-opti-action-row #btn-pause,
.nat-opti-action-row #btn-stop {
min-height: 46px !important;
height: 46px !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
box-sizing: border-box !important;
}
.nat-opti-action-row #btn-reset-cache i {
font-size: 18px !important;
}
.nat-opti-action-row #btn-start i,
.nat-opti-action-row #btn-pause i,
.nat-opti-action-row #btn-stop i {
margin-right: 8px !important;
font-size: 18px !important;
}
html.nat-dark-mode .nat-opti-action-row #btn-reset-cache,
body.nat-dark-mode .nat-opti-action-row #btn-reset-cache {
background-color: #1e293b !important;
border-color: #475569 !important;
color: #f1f5f9 !important;
}
html.nat-dark-mode .nat-opti-action-row #btn-reset-cache:hover,
body.nat-dark-mode .nat-opti-action-row #btn-reset-cache:hover {
background-color: #334155 !important;
border-color: #64748b !important;
color: #38bdf8 !important;
}
</style>