diff --git a/application/migrations/263_longer_dok.php b/application/migrations/263_longer_dok.php new file mode 100644 index 000000000..2a2903e99 --- /dev/null +++ b/application/migrations/263_longer_dok.php @@ -0,0 +1,22 @@ +dbtry("ALTER TABLE ".$this->config->item('table_name')." MODIFY COLUMN COL_DARC_DOK varchar(20);"); + $this->dbtry("ALTER TABLE ".$this->config->item('table_name')." MODIFY COLUMN COL_MY_DARC_DOK varchar(20);"); + } + + public function down(){ + } + + function dbtry($what) { + try { + $this->db->query($what); + } catch (Exception $e) { + log_message("error", "Something gone wrong while altering the QSO table: ".$e." // Executing: ".$this->db->last_query()); + } + } +} diff --git a/assets/js/dxwaterfall.js b/assets/js/dxwaterfall.js index c22280d0b..4defc5a3d 100644 --- a/assets/js/dxwaterfall.js +++ b/assets/js/dxwaterfall.js @@ -1,6 +1,7 @@ +// @ts-nocheck /** * @fileoverview DX WATERFALL for WaveLog - * @version 0.9.0 + * @version 0.9.1 // also change line 38 * @author Wavelog Team * * @description @@ -35,7 +36,7 @@ var DX_WATERFALL_CONSTANTS = { // Version - VERSION: '0.9.0', // DX Waterfall version (keep in sync with @version in file header) + VERSION: '0.9.1', // DX Waterfall version (keep in sync with @version in file header) // Debug and logging DEBUG_MODE: false, // Set to true for verbose logging, false for production @@ -1166,7 +1167,34 @@ var DX_WATERFALL_UTILS = { this.initCache(); } - // Check if button exists and click it + // Explicitly clear park reference fields FIRST + // This ensures they're cleared even if reset button doesn't fully clear them + var parkRefFields = [ + {selector: '#sota_ref', isSelectize: true}, + {selector: '#pota_ref', isSelectize: true}, + {selector: '#wwff_ref', isSelectize: true}, + {selector: '#iota_ref', isSelectize: false}, // IOTA is not selectize + {selector: '#darc_dok', isSelectize: true} + ]; + + parkRefFields.forEach(function(field) { + var $element = $(field.selector); + if ($element.length > 0) { + if (field.isSelectize) { + // For selectize fields, must call .selectize() method first to get instance + var $select = $element.selectize(); + var selectize = $select[0].selectize; + if (selectize) { + selectize.clear(); + } + } else { + // Use standard val("") for non-selectize fields (IOTA) + $element.val(""); + } + } + }); + + // Then click the reset button to clear other fields if (this.$btnReset && this.$btnReset.length > 0) { this.$btnReset.click(); } @@ -1174,6 +1202,7 @@ var DX_WATERFALL_UTILS = { /** * Populate QSO form with spot data (callsign, mode, and park references) + * Assumes form has already been cleared if needed * @param {Object} spotData - Spot data object * @param {string} spotData.callsign - Callsign to populate * @param {string} [spotData.mode] - Mode to set @@ -1204,8 +1233,6 @@ var DX_WATERFALL_UTILS = { wasPreventLookupSet = true; } - reset_fields(); - // Populate the callsign input field var callsignInput = $('#callsign'); var formattedCallsign = spotData.callsign.toUpperCase().replace(/0/g, 'Ø'); @@ -1217,74 +1244,90 @@ var DX_WATERFALL_UTILS = { var radioMode = DX_WATERFALL_UTILS.navigation.determineRadioMode(spotData); // Use skipTrigger=true to prevent change event race condition setMode(radioMode, true); - } else { } - // Populate SOTA reference if available (selectize field) - if (spotData.sotaRef && spotData.sotaRef !== '') { - var $sotaSelect = $('#sota_ref'); - if ($sotaSelect.length > 0 && $sotaSelect[0].selectize) { - var sotaSelectize = $sotaSelect[0].selectize; - sotaSelectize.addOption({name: spotData.sotaRef}); - sotaSelectize.setValue(spotData.sotaRef, false); - } - } + // Store park ref data to re-apply after callsign lookup clears the form + // Don't populate them now - they'll just be cleared by resetDefaultQSOFields() + var parkRefs = { + sota: spotData.sotaRef || null, + pota: spotData.potaRef || null, + iota: spotData.iotaRef || null, + wwff: spotData.wwffRef || null + }; - // Populate POTA reference if available (selectize field) - if (spotData.potaRef && spotData.potaRef !== '') { - var $potaSelect = $('#pota_ref'); - if ($potaSelect.length > 0 && $potaSelect[0].selectize) { - var potaSelectize = $potaSelect[0].selectize; - potaSelectize.addOption({name: spotData.potaRef}); - potaSelectize.setValue(spotData.potaRef, false); - } - } - - // Populate IOTA reference if available (regular select dropdown) - if (spotData.iotaRef && spotData.iotaRef !== '') { - var $iotaSelect = $('#iota_ref'); - if ($iotaSelect.length > 0) { - var optionExists = $iotaSelect.find('option[value="' + spotData.iotaRef + '"]').length > 0; - if (optionExists) { - $iotaSelect.val(spotData.iotaRef); - } else { - $iotaSelect.append($('