Skip to content

Commit

Permalink
2.10.8 Added Navtex Decoder tool and fine tuned tool popup layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
classaxe committed Jun 11, 2020
1 parent 9c59bc0 commit 5064163
Show file tree
Hide file tree
Showing 13 changed files with 257 additions and 51 deletions.
78 changes: 49 additions & 29 deletions public/css/style.css
@@ -1,8 +1,8 @@
/*
* Project: RXX - NDB Logging Database
* Homepage: https://rxx.classaxe.com
* Version: 2.10.7
* Date: 2020-06-10
* Version: 2.10.8
* Date: 2020-06-11
* Licence: LGPL
* Copyright: 2020 Martin Francis
*/
Expand Down Expand Up @@ -770,32 +770,32 @@ table.responsive tbody tr td b {
background-color: #f0f0f0;
padding: 0.25em;
}
#dgps_lookup textarea {
#frm_dgps textarea {
font-family: "Courier New", Courier, monospace;
font-size: 80%;
}
#dgps_lookup #dgps_ref {
#frm_dgps #dgps_ref {
height: 1.5em;
width: 3em;
display: inline;
}
#dgps_lookup label {
#frm_dgps label {
padding-right: 1em;
font-weight: bold;
font-size: 100%;
}
#dgps_lookup input[type='button'],
#dgps_lookup input[type='reset'],
#dgps_lookup input[type='submit'] {
#frm_dgps input[type='button'],
#frm_dgps input[type='reset'],
#frm_dgps input[type='submit'] {
margin: 0;
padding: 0.25em 1em;
}
#dgps_lookup textarea:read-only {
#frm_dgps textarea:read-only {
background-color: #fff;
font-weight: bold;
color: #000;
}
#coords label {
#frm_coordinates label {
display: inline-block;
text-align: right;
padding: 0 0.5em;
Expand All @@ -804,69 +804,89 @@ table.responsive tbody tr td b {
white-space: nowrap;
width: 11.5em;
}
#coords input[type='text'] {
#frm_coordinates input[type='text'] {
height: 1.5em;
width: 8em;
display: inline;
margin: 0;
}
#coords input[type='button'],
#coords input[type='reset'],
#coords input[type='submit'] {
#frm_coordinates input[type='button'],
#frm_coordinates input[type='reset'],
#frm_coordinates input[type='submit'] {
margin: 0;
padding: 0.3em 1em;
}
#coords div div {
#frm_coordinates div div {
display: inline-block;
padding: 0 0 0 0.5em;
margin: 0.25em 0;
}
#coords div span {
#frm_coordinates div span {
display: inline-block;
padding: 0;
margin: 0;
}
#coords .r3 span {
#frm_coordinates .r3 span {
margin-left: 19.85em;
}
@media (max-width: 55em) {
#coords {
#frm_coordinates {
border-bottom: 1px solid #ccc;
}
#coords div:last-child {
#frm_coordinates div:last-child {
border-bottom: none;
}
#coords div {
#frm_coordinates div {
padding: 0.25em 0 0.5em 0;
}
#coords div label {
#frm_coordinates div label {
padding: 0;
text-align: left;
}
#coords div input[type='text'] {
#frm_coordinates div input[type='text'] {
display: block;
}
#coords div div {
#frm_coordinates div div {
padding: 0;
border: none;
}
#coords div.r3 span {
#frm_coordinates div.r3 span {
margin-left: 11.5em;
}
}
@media (max-width: 39em) {
#coords div div {
#frm_coordinates div div {
display: block;
}
#coords div div input[type='button'],
#coords div div input[type='reset'],
#coords div div input[type='submit'] {
#frm_coordinates div div input[type='button'],
#frm_coordinates div div input[type='reset'],
#frm_coordinates div div input[type='submit'] {
margin: 0.5em 0 0 0;
}
#coords div.r3 span {
#frm_coordinates div.r3 span {
margin-left: 0;
}
}
#frm_navtex div {
width: 100%;
margin: 0.25em 0;
padding: 0;
}
#frm_navtex div input {
margin: 0;
padding: 0.25em 0.5em;
min-width: 6em;
text-transform: uppercase;
}
#frm_navtex div textarea {
margin: 0;
padding: 0.25em 1em;
}
#frm_navtex div p {
font-weight: bold;
margin: 0;
text-align: center;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
Expand Down
2 changes: 1 addition & 1 deletion public/css/style.min.css

Large diffs are not rendered by default.

66 changes: 61 additions & 5 deletions public/js/functions.js
@@ -1,8 +1,8 @@
/*
* Project: RXX - NDB Logging Database
* Homepage: https://rxx.classaxe.com
* Version: 2.10.7
* Date: 2020-06-10
* Version: 2.10.8
* Date: 2020-06-11
* Licence: LGPL
* Copyright: 2020 Martin Francis
*/
Expand Down Expand Up @@ -51,9 +51,9 @@ var popWinSpecs = {
'states_*' : 'width=720,height=760,resizable=1',
'states_aus' : 'width=720,height=240,resizable=1',
'states_can_usa' : 'width=680,height=690,resizable=1',
'tools_coordinates' : 'width=890,height=220,resizable=1',
'tools_dgps' : 'width=640,height=375,resizable=1',
'tools_navtex' : 'width=420,height=370,resizable=1',
'tools_coordinates' : 'width=900,height=195,resizable=1',
'tools_dgps' : 'width=640,height=320,resizable=1',
'tools_navtex' : 'width=420,height=580,resizable=1',
'tools_references' : 'width=520,height=130,resizable=1',
'tools_sunrise' : 'width=455,height=310,resizable=1',
};
Expand Down Expand Up @@ -2413,4 +2413,60 @@ var COORDS = {
$('#lon_dddd').val(dec_lon);
return true;
}
}
var NAVTEX = {
init: function() {
$('#frm_navtex').on('submit', function(){
return false;
});
$('#translateMumbo').on('click', function() {
$('#navtex2').val(NAVTEX.mumboToText($('#navtex1').val()));
});
$('#clearoutMumbo').on('click', function() {
$('#navtex1').val('');
});
$('#clearoutText').on('click', function() {
$('#navtex2').val('');
});
$('#clearoutAll').on('click', function() {
$('#navtex1').val('');
$('#navtex2').val('');
});
$('#translateText').on('click', function() {
$('#navtex1').val(NAVTEX.textToMumbo($('#navtex2').val()));
});
$('#close').on('click', function(){
window.close();
})
},
mumboChars: "-?:$3!&#8*().,9014'57=2/6+",
textChars: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
mumboChar: function(chars) {
var pos = NAVTEX.textChars.indexOf(chars);
if (pos > -1) {
return NAVTEX.mumboChars.charAt(pos);
}
return chars;
},
textChar: function(chars) {
var pos = NAVTEX.mumboChars.indexOf(chars);
if (pos > -1) {
return NAVTEX.textChars.charAt(pos);
}
return chars;
},
textToMumbo: function(input) {
var i, output = '';
for (i=0; i<input.length; i++) {
output += NAVTEX.mumboChar(input.charAt(i).toUpperCase());
}
return output;
},
mumboToText: function(input) {
var i, output = '';
for (i = 0; i < input.length; i++) {
output += NAVTEX.textChar(input.charAt(i));
}
return output;
}
}
6 changes: 3 additions & 3 deletions public/js/functions.min.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/Controller/Web/Tools/Tools.php
Expand Up @@ -27,12 +27,13 @@ class Tools extends Base
* @param ToolRepository $toolRepository
* @return Response
*/
public function index($_locale, $system, ToolRepository $toolRepository)
public function index($_locale, $system, Request $request, ToolRepository $toolRepository)
{
$tools = $toolRepository->getAll();

$parameters = [
'_locale' => $_locale,
'args' => $request->query->get('args'),
'mode' => 'Tools',
'system' => $system,
'classic' => $this->systemRepository->getClassicUrl('tools'),
Expand All @@ -56,13 +57,13 @@ public function index($_locale, $system, ToolRepository $toolRepository)
* )
* @param $_locale
* @param $system
* @param Request $request
* @param $tool
* @param $args
* @param Request $request
* @param ToolRepository $toolRepository
* @return Response
*/
public function tool($_locale, $system, Request $request, $tool, $args, ToolRepository $toolRepository)
public function tool($_locale, $system, $tool, $args, Request $request, ToolRepository $toolRepository)
{
$parameters = $toolRepository->get($tool);
$parameters['_locale'] = $_locale;
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/ToolRepository.php
Expand Up @@ -14,7 +14,7 @@ class ToolRepository
'shortName' => 'Coordinates',
],
'navtex' => [
'mode' => 'NAVTEX Missed Shift Fixer (Version 1.4)',
'mode' => 'NAVTEX Missed Shift Fixer (v1.4)',
'shortName' => 'NAVTEX Fixer',
],
'sunrise' => [
Expand Down
28 changes: 26 additions & 2 deletions src/css/include/tools.less
Expand Up @@ -2,7 +2,7 @@
background-color: #f0f0f0;
padding: 0.25em;
}
#dgps_lookup {
#frm_dgps {
textarea {
font-family: "Courier New", Courier, monospace;
font-size: 80%;
Expand All @@ -29,7 +29,7 @@
color: #000;
}
}
#coords {
#frm_coordinates {
label {
display: inline-block;
text-align: right;
Expand Down Expand Up @@ -117,4 +117,28 @@
}
}
}
}
#frm_navtex {
div {
width: 100%;
margin: 0.25em 0;
padding: 0;
input {
margin: 0;
padding: 0.25em 0.5em;
min-width: 6em;
text-transform: uppercase;
}

textarea {
margin: 0;
padding: 0.25em 1em;
}

p {
font-weight: bold;
margin: 0;
text-align: center;
}
}
}
6 changes: 3 additions & 3 deletions src/js/_globals.js
Expand Up @@ -43,9 +43,9 @@ var popWinSpecs = {
'states_*' : 'width=720,height=760,resizable=1',
'states_aus' : 'width=720,height=240,resizable=1',
'states_can_usa' : 'width=680,height=690,resizable=1',
'tools_coordinates' : 'width=890,height=220,resizable=1',
'tools_dgps' : 'width=640,height=375,resizable=1',
'tools_navtex' : 'width=420,height=370,resizable=1',
'tools_coordinates' : 'width=900,height=195,resizable=1',
'tools_dgps' : 'width=640,height=320,resizable=1',
'tools_navtex' : 'width=420,height=580,resizable=1',
'tools_references' : 'width=520,height=130,resizable=1',
'tools_sunrise' : 'width=455,height=310,resizable=1',
};

0 comments on commit 5064163

Please sign in to comment.