From 21662b25b4e698bebe09df320558dfee43a07cb9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 26 Oct 2021 18:58:29 +0300 Subject: instructor/instruction -> guide --- assets/js/main.js | 76 +++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'assets/js') diff --git a/assets/js/main.js b/assets/js/main.js index 4fe4957..7d4f1e8 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -437,102 +437,102 @@ wg set ${iface} \\ `); } -var InstructWgQuick = function() {} +var GuideWgQuick = function() {} -InstructWgQuick.prototype.name = function() { return 'wg-quick'; } +GuideWgQuick.prototype.name = function() { return 'wg-quick'; } -InstructWgQuick.prototype.for_client = function(data) { +GuideWgQuick.prototype.for_client = function(data) { var config = wg_quick_client_file(data); var qr = new QRCode(config.text); return [config, qr]; } -InstructWgQuick.prototype.for_server = function(data) { +GuideWgQuick.prototype.for_server = function(data) { return [wg_quick_server_file(data)]; } -var InstructSystemd = function() {} +var GuideSystemd = function() {} -InstructSystemd.prototype.name = function() { return 'systemd-networkd'; } +GuideSystemd.prototype.name = function() { return 'systemd-networkd'; } -InstructSystemd.prototype.for_client = function(data) { +GuideSystemd.prototype.for_client = function(data) { return [systemd_client_netdev_file(data), systemd_client_network_file(data)]; } -InstructSystemd.prototype.for_server = function(data) { +GuideSystemd.prototype.for_server = function(data) { return [systemd_server_netdev_file(data)]; } -var InstructNetworkManager = function() {} +var GuideNetworkManager = function() {} -InstructNetworkManager.prototype.name = function() { return 'NetworkManager'; } +GuideNetworkManager.prototype.name = function() { return 'NetworkManager'; } -InstructNetworkManager.prototype.for_client = function(data) { +GuideNetworkManager.prototype.for_client = function(data) { return [nmcli_client_file(data)]; } -InstructNetworkManager.prototype.for_server = function(data) { +GuideNetworkManager.prototype.for_server = function(data) { return [nmcli_server_file(data)]; } -var InstructManual = function() {} +var GuideManual = function() {} -InstructManual.prototype.name = function() { return 'Manual'; } +GuideManual.prototype.name = function() { return 'Manual'; } -InstructManual.prototype.for_client = function(data) { +GuideManual.prototype.for_client = function(data) { return [manual_client_script(data)]; } -InstructManual.prototype.for_server = function(data) { +GuideManual.prototype.for_server = function(data) { return [manual_server_script(data)]; } -function clear_instructors() { - $('#instructors').empty(); +function clear_guides() { + $('#guides').empty(); } -function format_instructions(instructions) { +function format_guides(guides) { var container = $('
'); - instructions.forEach(function(instruction) { - container.append(instruction.format()); + guides.forEach(function(guide) { + container.append(guide.format()); }); return container; } -function format_server_instructions(instructor, data) { - return format_instructions(instructor.for_server(data)); +function format_server_guides(guide, data) { + return format_guides(guide.for_server(data)); } -function format_client_instructions(instructor, data) { - return format_instructions(instructor.for_client(data)); +function format_client_guides(guide, data) { + return format_guides(guide.for_client(data)); } -function add_instructor(instructor, data) { - $('#instructors').append($('
') - .append($('

').text(instructor.name())) +function add_guide(guide, data) { + $('#guides').append($('
') + .append($('

').text(guide.name())) .append($('
') .append($('
') - .append(format_server_instructions(instructor, data))) + .append(format_server_guides(guide, data))) .append($('
') - .append(format_client_instructions(instructor, data))))); + .append(format_client_guides(guide, data))))); } function form_on_submit() { - clear_instructors(); + clear_guides(); var data = new Data(); if (data.has_errors()) { return false; } - var instructors = [ - new InstructWgQuick(), - new InstructSystemd(), - new InstructNetworkManager(), - new InstructManual() + var guides = [ + new GuideWgQuick(), + new GuideSystemd(), + new GuideNetworkManager(), + new GuideManual() ]; - instructors.forEach(function(instructor) { - add_instructor(instructor, data); + guides.forEach(function(guide) { + add_guide(guide, data); }); return false; -- cgit v1.2.3