kopia lustrzana https://github.com/magicbug/Cloudlog
Add separate input field for WWFF info
rodzic
502c46907e
commit
66f70af2c4
|
@ -353,6 +353,35 @@ class QSO extends CI_Controller {
|
|||
echo json_encode($json);
|
||||
}
|
||||
|
||||
public function get_wwff() {
|
||||
$json = [];
|
||||
|
||||
if(!empty($this->input->get("query"))) {
|
||||
$query = isset($_GET['query']) ? $_GET['query'] : FALSE;
|
||||
$wwff = strtoupper($query);
|
||||
|
||||
$file = 'assets/json/wwff.txt';
|
||||
|
||||
if (is_readable($file)) {
|
||||
$lines = file($file, FILE_IGNORE_NEW_LINES);
|
||||
$input = preg_quote($wwff, '~');
|
||||
$reg = '~^'. $input .'(.*)$~';
|
||||
$result = preg_grep($reg, $lines);
|
||||
$json = [];
|
||||
$i = 0;
|
||||
foreach ($result as &$value) {
|
||||
// Limit to 100 as to not slowdown browser too much
|
||||
if (count($json) <= 100) {
|
||||
$json[] = ["name"=>$value];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($json);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function is used for autocompletion of DOK in the QSO entry form
|
||||
*/
|
||||
|
|
|
@ -103,6 +103,7 @@ $lang['gen_hamradio_dok'] = 'DOK';
|
|||
$lang['gen_hamradio_state'] = 'State';
|
||||
$lang['gen_hamradio_iota'] = 'IOTA';
|
||||
$lang['gen_hamradio_sota'] = 'SOTA';
|
||||
$lang['gen_hamradio_sota'] = 'WWFF';
|
||||
$lang['gen_hamradio_gridsquare'] = 'Gridsquare';
|
||||
$lang['gen_hamradio_operator'] = 'Operator';
|
||||
|
||||
|
|
|
@ -12,9 +12,10 @@ $lang['qso_title_image'] = 'Profile Picture';
|
|||
$lang['qso_transmit_power_helptext'] = 'Give power value in Watts. Include only numbers in the input.';
|
||||
|
||||
$lang['qso_sota_ref_helptext'] = 'For example: GM/NS-001.';
|
||||
$lang['qso_wwff_ref_helptext'] = 'For example: DLFF-0069.';
|
||||
|
||||
$lang['qso_sig_helptext'] = 'For example: WWFF or POTA';
|
||||
$lang['qso_sig_info_helptext'] = 'For example: DLFF-0029';
|
||||
$lang['qso_sig_helptext'] = 'For example: POTA';
|
||||
$lang['qso_sig_info_helptext'] = 'For example: PA-0150';
|
||||
|
||||
$lang['qso_dok_helptext'] = 'For example: Q03';
|
||||
|
||||
|
|
|
@ -12,9 +12,10 @@ $lang['qso_title_image'] = 'Profilbild';
|
|||
$lang['qso_transmit_power_helptext'] = 'Gib die Ausgangsleistung in Watt an. Erfasse nur Zahlen bei der Eingabe.';
|
||||
|
||||
$lang['qso_sota_ref_helptext'] = 'Zum Beispiel: GM/NS-001.';
|
||||
$lang['qso_wwff_ref_helptext'] = 'Zum Beispiel: DLFF-0069.';
|
||||
|
||||
$lang['qso_sig_helptext'] = 'Zum Beispiel: WWFF oder POTA';
|
||||
$lang['qso_sig_info_helptext'] = 'Zum Beispiel: DLFF-0029';
|
||||
$lang['qso_sig_helptext'] = 'Zum Beispiel: POTA';
|
||||
$lang['qso_sig_info_helptext'] = 'Zum Beispiel: PA-0150';
|
||||
|
||||
$lang['qso_dok_helptext'] = 'Zum Beispiel: Q03';
|
||||
|
||||
|
|
|
@ -2007,6 +2007,34 @@ $(document).ready(function(){
|
|||
}
|
||||
});
|
||||
|
||||
$('#wwff_ref_edit').selectize({
|
||||
maxItems: 1,
|
||||
closeAfterSelect: true,
|
||||
loadThrottle: 250,
|
||||
valueField: 'name',
|
||||
labelField: 'name',
|
||||
searchField: 'name',
|
||||
options: [],
|
||||
create: false,
|
||||
load: function(query, callback) {
|
||||
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
|
||||
$.ajax({
|
||||
url: baseURL+'index.php/qso/get_wwff',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
query: query,
|
||||
},
|
||||
error: function() {
|
||||
callback();
|
||||
},
|
||||
success: function(res) {
|
||||
callback(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#darc_dok_edit').selectize({
|
||||
maxItems: 1,
|
||||
closeAfterSelect: true,
|
||||
|
|
|
@ -394,6 +394,11 @@
|
|||
<input type="text" class="form-control" id="sota_ref_edit" name="sota_ref" value="<?php echo $qso->COL_SOTA_REF; ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="wwff_ref">WWFF</label>
|
||||
<input type="text" class="form-control" id="wwff_ref_edit" name="wwff_ref" value="<?php echo $qso->COL_SOTA_REF; ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sig">Sig</label>
|
||||
<input type="text" class="form-control" id="sig" name="sig" value="<?php echo $qso->COL_SIG; ?>">
|
||||
|
|
|
@ -387,6 +387,17 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-9">
|
||||
<label for="wwff_ref"><?php echo $this->lang->line('gen_hamradio_wwff_reference'); ?></label>
|
||||
<input class="form-control" id="wwff_ref" type="text" name="wwff_ref" value="" />
|
||||
<small id="wwffRefHelp" class="form-text text-muted"><?php echo $this->lang->line('qso_wwff_ref_helptext'); ?></small>
|
||||
</div>
|
||||
<div class="form-group col-md-3 align-self-center">
|
||||
<small id="wwff_info" class="badge badge-secondary"></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sig"><?php echo $this->lang->line('gen_hamradio_sig'); ?></label>
|
||||
<input class="form-control" id="sig" type="text" name="sig" value="" />
|
||||
|
|
|
@ -83,6 +83,10 @@ thead > tr > td {
|
|||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.qso_panel #wwff_ref-selectized {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.qso_panel #darc_dok-selectized {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
@ -103,6 +107,10 @@ thead > tr > td {
|
|||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.card-body #wwff_ref_edit-selectized {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.card-body #darc_dok_edit-selectized {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
|
|
@ -93,6 +93,39 @@ $( document ).ready(function() {
|
|||
$('#sota_info').attr('title', 'Lookup '+$('#sota_ref').val()+' summit info on sota.org.uk');
|
||||
});
|
||||
|
||||
$('#wwff_ref').selectize({
|
||||
maxItems: 1,
|
||||
closeAfterSelect: true,
|
||||
loadThrottle: 250,
|
||||
valueField: 'name',
|
||||
labelField: 'name',
|
||||
searchField: 'name',
|
||||
options: [],
|
||||
create: false,
|
||||
load: function(query, callback) {
|
||||
if (!query || query.length < 3) return callback(); // Only trigger if 3 or more characters are entered
|
||||
$.ajax({
|
||||
url: base_url+'index.php/qso/get_wwff',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
query: query,
|
||||
},
|
||||
error: function() {
|
||||
callback();
|
||||
},
|
||||
success: function(res) {
|
||||
callback(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#wwff_ref').change(function(){
|
||||
$('#wwff_info').html('<a target="_blank" href="https://wwff.co/directory/?showRef='+$('#wwff_ref').val()+'"><img width="32" height="32" src="'+base_url+'images/icons/wwff.co.png"></a>');
|
||||
$('#wwff_info').attr('title', 'Lookup '+$('#wwff_ref').val()+' reference info on wwff.co');
|
||||
});
|
||||
|
||||
$('#darc_dok').selectize({
|
||||
maxItems: 1,
|
||||
closeAfterSelect: true,
|
||||
|
@ -286,6 +319,9 @@ function reset_fields() {
|
|||
$('#input_usa_state').val("");
|
||||
$('#qso-last-table').show();
|
||||
$('#partial_view').hide();
|
||||
var $select = $('#wwff_ref').selectize();
|
||||
var selectize = $select[0].selectize;
|
||||
selectize.clear();
|
||||
var $select = $('#darc_dok').selectize();
|
||||
var selectize = $select[0].selectize;
|
||||
selectize.clear();
|
||||
|
|
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 32 KiB |
Ładowanie…
Reference in New Issue