Skip to content

Commit

Permalink
fix: recover code lost from bad merges
Browse files Browse the repository at this point in the history
Signed-off-by: Gerard Hickey <[email protected]>
  • Loading branch information
hickey committed Mar 2, 2024
1 parent 57d2766 commit 9ad1637
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion meshchatconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ extra_nodes = {}
-- @type string
protocol_version = "1.02"
app_version = "master"
default_channel = "chat"
default_channel = ""
51 changes: 29 additions & 22 deletions www/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,37 @@ function start_chat() {
debug("start_chat()");

// wait until the configuration is fully loaded
load_config().then(function(data) {
config = data;
document.title = 'Mesh Chat v' + data.version;
$('#version').html('<strong>Mesh Chat v' + data.version + '</strong>');
$('#node').html('<strong>Node:</strong> ' + data.node);
$('#zone').html('<strong>Zone:</strong> ' + data.zone);
$('#callsign').html('<strong>Call Sign:</strong> ' + Cookies.get('meshchat_call_sign'));
$('#copyright').html('Mesh Chat v' + data.version + ' Copyright &copy; ' + new Date().getFullYear() + ' <a href="http://www.trevorsbench.com">Trevor Paskett - K7FPV</a> <small>(Lua by KN6PLV)</small>');

if ("default_channel" in data) {
default_channel = data.default_channel;
$('#send-channel').val(data.default_channel);
$('#channels').val(data.default_channel);
messages.set_channel(data.default_channel);
update_messages();
}
$.getJSON('/cgi-bin/meshchat?action=config',
(data) => {
config = data;
document.title = 'Mesh Chat v' + data.version;
$('#version').html('<strong>Mesh Chat v' + data.version + '</strong>');
$('#node').html('<strong>Node:</strong> ' + data.node);
$('#zone').html('<strong>Zone:</strong> ' + data.zone);
$('#callsign').html('<strong>Call Sign:</strong> ' + Cookies.get('meshchat_call_sign'));
$('#copyright').html('Mesh Chat v' + data.version + ' Copyright &copy; ' + new Date().getFullYear() + ' <a href="http://www.trevorsbench.com">Trevor Paskett - K7FPV</a> <small>(Lua by KN6PLV)</small>');

if ("default_channel" in data) {
default_channel = data.default_channel;
$('#send-channel').val(data.default_channel);
$('#channels').val(data.default_channel);
messages.set_channel(data.default_channel);
update_messages();
}

if ("debug" in data) {
context.debug = data.debug == 1 ? true : false;
}
if ("debug" in data) {
context.debug = data.debug == 1 ? true : false;
}

// signal that the config has finished loading
context.config_loaded = true;
})
// signal that the config has finished loading
context.config_loaded = true;
}
).fail(
(error) => {
// TODO error message on UI describing failure
error("Failed to load configuration from config API: " + error);
}
);

//$('#logout').html('Logout ' + call_sign);
messages.subscribe(update_messages);
Expand Down
15 changes: 4 additions & 11 deletions www/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ $(function() {
Cookies.remove('meshchat_call_sign');
window.location = '/meshchat';
});

$.getJSON('/cgi-bin/meshchat?action=config', function(data) {
config = data;

document.title = 'Mesh Chat v' + data.version;
$('#version').html('<strong>Mesh Chat v' + data.version + '</strong>');
$('#node').html('<strong>Node:</strong> ' + data.node);
$('#zone').html('<strong>Zone:</strong> ' + data.zone);
$('#callsign').html('<strong>Call Sign:</strong> ' + Cookies.get('meshchat_call_sign'));
$('#copyright').html('Mesh Chat v' + data.version + ' Copyright &copy; ' + new Date().getFullYear() + ' <a href="http://www.trevorsbench.com">Trevor Paskett - K7FPV</a> <small>(Lua by KN6PLV)</small>');
});
});

function node_name() {
Expand Down Expand Up @@ -74,3 +63,7 @@ function aredn_domain(host) {
function debug(msg) {
context.debug && console.debug(msg);
}

function error(msg) {
console.error(msg);
}

0 comments on commit 9ad1637

Please sign in to comment.