Skip to content
Merged

2.8.3 #3390

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
|
*/

$config['migration_version'] = 238;
$config['migration_version'] = 239;

/*
|--------------------------------------------------------------------------
Expand Down
30 changes: 30 additions & 0 deletions application/migrations/239_tag_2_8_3.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

/*
* Tag Cloudlog as 2.8.3 Migration
*/

class Migration_tag_2_8_3 extends CI_Migration {

public function up()
{

// Tag Cloudlog 2.8.3
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.8.3'));

// Trigger Version Info Dialog
$this->db->where('option_type', 'version_dialog');
$this->db->where('option_name', 'confirmed');
$this->db->update('user_options', array('option_value' => 'false'));

}

public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.8.2'));
}
}
49 changes: 47 additions & 2 deletions application/views/interface_assets/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ function toggleMessageLog() {
setRst($(".mode").val());

/* On Page Load */
var catcher = function() {
var catcher = function(e) {
var changed = false;
$('form').each(function() {
if ($(this).data('initialForm') != $(this).serialize()) {
Expand All @@ -1616,7 +1616,10 @@ function toggleMessageLog() {
}
});
if (changed) {
return 'Unsaved QSO!';
// For external navigation (closing tab/window), browsers require native dialog
e.preventDefault();
e.returnValue = 'You have unsaved changes. Are you sure you want to leave?';
return e.returnValue;
}
};

Expand All @@ -1641,6 +1644,48 @@ function toggleMessageLog() {
}
});
$(window).bind('beforeunload', catcher);

// Intercept internal link clicks to show custom modal
$(document).on('click', 'a[href]:not([href^="#"]):not([target="_blank"]):not(.no-confirm):not([data-bs-toggle])', function(e) {
var href = $(this).attr('href');

// Skip if it's a javascript: link, empty, or hash link
if (!href || href === '#' || href.indexOf('javascript:') === 0) {
return true;
}

// Check if form has unsaved changes
var hasChanges = false;
$('form').each(function() {
if ($(this).data('initialForm') != $(this).serialize()) {
hasChanges = true;
return false;
}
});

if (hasChanges) {
e.preventDefault();

// Check if custom modal element exists in DOM at click time
var modalEl = document.getElementById('leaveQsoModal');
if (modalEl && typeof bootstrap !== 'undefined' && bootstrap.Modal) {
// Use custom modal
window.pendingNavigation = href;
var modal = bootstrap.Modal.getInstance(modalEl);
if (!modal) {
modal = new bootstrap.Modal(modalEl);
}
modal.show();
} else {
// Fallback to confirm dialog on pages without custom modal
if (confirm('You have unsaved changes. Are you sure you want to leave QSO entry?')) {
$(window).unbind('beforeunload', catcher);
window.location.href = href;
}
}
return false;
}
});
});

// Callsign always has focus on load
Expand Down
124 changes: 88 additions & 36 deletions application/views/qso/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
var text_error_timeoff_less_timeon = "<?php echo lang('qso_error_timeoff_less_timeon'); ?>";
var lang_qso_title_previous_contacts = "<?php echo lang('qso_title_previous_contacts'); ?>";
var lang_qso_title_times_worked_before = "<?php echo lang('qso_title_times_worked_before'); ?>";

// Function to switch between LIVE and POST mode without the beforeunload warning
function switchMode(url) {
// Temporarily unbind the beforeunload event to prevent the "Leave site?" popup
$(window).unbind('beforeunload');
// Navigate to the new URL
window.location.href = url;
}
</script>

<div class="row qsopane">
Expand All @@ -16,12 +24,7 @@
<div class="card-header">
<ul style="font-size: 15px;" class="nav nav-tabs card-header-tabs pull-right" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="qsp-tab" data-bs-toggle="tab" href="#qso" role="tab" aria-controls="qso" aria-selected="true"><?php echo lang('gen_hamradio_qso'); ?><?php if ($_GET['manual'] == 0) {
echo " <span class=\"badge text-bg-success\" style=\"cursor: pointer;\" onclick=\"window.location.href='" . site_url('qso') . "?manual=1'\" title=\"Switch to POST mode\">LIVE</span>";
};
if ($_GET['manual'] == 1) {
echo " <span class=\"badge text-bg-danger\" style=\"cursor: pointer;\" onclick=\"window.location.href='" . site_url('qso') . "?manual=0'\" title=\"Switch to LIVE mode\">POST</span>";
} ?></a>
<a class="nav-link active" id="qsp-tab" data-bs-toggle="tab" href="#qso" role="tab" aria-controls="qso" aria-selected="true"><?php echo lang('gen_hamradio_qso'); ?></a>
</li>

<li class="nav-item">
Expand Down Expand Up @@ -55,6 +58,15 @@
</div>
</li>

<li class="nav-item ms-auto d-flex align-items-center">
<?php if ($_GET['manual'] == 0) {
echo " <span class=\"badge text-bg-success\" style=\"cursor: pointer; font-size: 0.9rem; padding: 0.4rem 0.9rem;\" onclick=\"switchMode('" . site_url('qso') . "?manual=1')\" title=\"Switch to Manual mode\">LIVE</span>";
};
if ($_GET['manual'] == 1) {
echo " <span class=\"badge text-bg-danger\" style=\"cursor: pointer; font-size: 0.9rem; padding: 0.4rem 0.9rem;\" onclick=\"switchMode('" . site_url('qso') . "?manual=0')\" title=\"Switch to LIVE mode\">POST</span>";
} ?>
</li>

</ul>
</div>

Expand Down Expand Up @@ -680,9 +692,9 @@
<div class="card-header">
<h4 style="font-size: 16px; font-weight: bold;" class="card-title">Winkey Web Sockets

<div id="cw_socket_status" class="badge text-bg-danger">
<div id="cw_socket_status" class="badge text-bg-danger">
Status: Disconnected
</div>
</div>

<button id="toggleLogButton" onclick="toggleMessageLog()" class="btn btn-sm btn-outline-secondary" title="Toggle Message Log">
<i class="fas fa-list"></i>
Expand Down Expand Up @@ -711,7 +723,7 @@
</div>
</div>
</div>

<!-- CW Speed Control Row -->
<div class="row mb-3">
<div class="col-12">
Expand All @@ -725,7 +737,7 @@
</div>
</div>
</div>

<!-- Send Message Row -->
<div class="row mb-3">
<div class="col-12">
Expand Down Expand Up @@ -785,7 +797,7 @@
</div>
</div>
</div>

<!-- Send Message Row -->
<div class="row mb-3">
<div class="col-12">
Expand Down Expand Up @@ -849,32 +861,72 @@

</div>

<!-- Custom Leave QSO Entry Modal -->
<div class="modal fade" id="leaveQsoModal" tabindex="-1" aria-labelledby="leaveQsoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header bg-warning">
<h5 class="modal-title" id="leaveQsoModalLabel">
<i class="fas fa-exclamation-triangle me-2"></i>Leave QSO Entry?
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p class="mb-0">Are you sure you want to leave QSO entry? Any unsaved changes will be lost.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
<i class="fas fa-times me-1"></i>Stay on Page
</button>
<button type="button" class="btn btn-warning" id="confirmLeaveQso">
<i class="fas fa-sign-out-alt me-1"></i>Leave Page
</button>
</div>
</div>
</div>
</div>

<script>
function openBandmap() {
// Open bandmap in a new window without URL bar, toolbars, etc.
const width = 500;
const height = 800;
const left = (screen.width - width) / 2;
const top = (screen.height - height) / 2;

// Note: Modern browsers may still show address bar due to security restrictions
// For Chrome, you can use: chrome.exe --app=http://localhost/index.php/dxcluster/bandmap
const features = `width=${width},height=${height},left=${left},top=${top},` +
`toolbar=no,location=no,directories=no,status=no,menubar=no,` +
`scrollbars=yes,resizable=yes,copyhistory=no`;

const popup = window.open('<?php echo site_url('dxcluster/bandmap'); ?>', 'bandmap', features);

// Try to make it fullscreen (user will need to allow this)
if (popup) {
popup.focus();
}
}
</div>

function openBandmapFullscreen() {
// Alternative: Open in current window and go fullscreen
window.location.href = '<?php echo site_url('dxcluster/bandmap'); ?>';
<script>
// Handle the confirm leave button for the custom modal (vanilla JS to avoid jQuery dependency)
document.addEventListener('DOMContentLoaded', function() {
var confirmBtn = document.getElementById('confirmLeaveQso');
if (confirmBtn) {
confirmBtn.addEventListener('click', function() {
if (window.pendingNavigation) {
// Unbind beforeunload to allow navigation
window.jQuery && window.jQuery(window).unbind('beforeunload');
// Navigate to the pending URL
window.location.href = window.pendingNavigation;
}
</script>
});
}
});

function openBandmap() {
// Open bandmap in a new window without URL bar, toolbars, etc.
const width = 500;
const height = 800;
const left = (screen.width - width) / 2;
const top = (screen.height - height) / 2;

// Note: Modern browsers may still show address bar due to security restrictions
// For Chrome, you can use: chrome.exe --app=http://localhost/index.php/dxcluster/bandmap
const features = `width=${width},height=${height},left=${left},top=${top},` +
`toolbar=no,location=no,directories=no,status=no,menubar=no,` +
`scrollbars=yes,resizable=yes,copyhistory=no`;

const popup = window.open('<?php echo site_url('dxcluster/bandmap'); ?>', 'bandmap', features);

// Try to make it fullscreen (user will need to allow this)
if (popup) {
popup.focus();
}
}

function openBandmapFullscreen() {
// Alternative: Open in current window and go fullscreen
window.location.href = '<?php echo site_url('dxcluster/bandmap'); ?>';
}
</script>