From 00a1ad795d1f40464e6f3cb5258893112c327a10 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 27 Dec 2023 22:39:26 +1100 Subject: [PATCH] Move our tools to tools/ no longer need ansitex.src --- ansitex.src | 1 - main.js | 2 +- export.js => tools/export.js | 0 tools/frame_load.js | 29 ++++++++++++++++++++++++ frames_check.js => tools/frames_check.js | 0 frames_list.js => tools/frames_list.js | 0 frames_tag.js => tools/frames_tag.js | 0 tools/msgbases_list.js | 4 ++++ save.js => tools/save.js | 0 9 files changed, 34 insertions(+), 2 deletions(-) delete mode 100644 ansitex.src rename export.js => tools/export.js (100%) create mode 100644 tools/frame_load.js rename frames_check.js => tools/frames_check.js (100%) rename frames_list.js => tools/frames_list.js (100%) rename frames_tag.js => tools/frames_tag.js (100%) create mode 100644 tools/msgbases_list.js rename save.js => tools/save.js (100%) diff --git a/ansitex.src b/ansitex.src deleted file mode 100644 index 3cb80de..0000000 --- a/ansitex.src +++ /dev/null @@ -1 +0,0 @@ -exec "?ansitex" diff --git a/main.js b/main.js index 9cc40f1..dece69d 100644 --- a/main.js +++ b/main.js @@ -7,7 +7,7 @@ */ log(LOG_DEBUG,'* INIT: ANSItex'); -var debug_mode = 'ansitex/at0593/10010011'; // eg: 'user/password/10010010001'; +var debug_mode = ''; // eg: 'user/password/10010010001'; // SBBS Key definitions require('key_defs.js','KEY_ESC'); diff --git a/export.js b/tools/export.js similarity index 100% rename from export.js rename to tools/export.js diff --git a/tools/frame_load.js b/tools/frame_load.js new file mode 100644 index 0000000..a49098c --- /dev/null +++ b/tools/frame_load.js @@ -0,0 +1,29 @@ +load('ansitex/load/funcs.js'); +load('ansitex/load/page.js'); + +/* parse command arguments */ +if (argv.length !== 1) { + writeln('! ERROR: Need 1 arguments only'); + exit(1); +} + +var file = argv.shift(); + +var ext = file_getext(file).substr(1).toLowerCase(); + +// Type of frame to load +switch (ext) { + case 'tex': + require('ansitex/load/session/ansitex.js','SESSION_ANSITEX'); + break; + + case 'vtx': + require('ansitex/load/session/viewdata.js','SESSION_VIEWDATA'); + break; +} + +var page = new Page(false); +page.import(file); +//page.build(); +//page.get(new PageObject(980,'a')); +page.save(); diff --git a/frames_check.js b/tools/frames_check.js similarity index 100% rename from frames_check.js rename to tools/frames_check.js diff --git a/frames_list.js b/tools/frames_list.js similarity index 100% rename from frames_list.js rename to tools/frames_list.js diff --git a/frames_tag.js b/tools/frames_tag.js similarity index 100% rename from frames_tag.js rename to tools/frames_tag.js diff --git a/tools/msgbases_list.js b/tools/msgbases_list.js new file mode 100644 index 0000000..90e3296 --- /dev/null +++ b/tools/msgbases_list.js @@ -0,0 +1,4 @@ +load('ansitex/load/msgbases.js'); + +var ma = new MsgAreas(); +writeln(JSON.stringify(ma.list)); diff --git a/save.js b/tools/save.js similarity index 100% rename from save.js rename to tools/save.js