From 8cd978f76e3b1fefe63b4671a66def3acbb41684 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 17 Dec 2024 12:12:36 +0700 Subject: [PATCH] Add date validation when storing frames, Fix viewing page info when aborting with ** --- load/page.js | 17 ++++++++++++++++- main.js | 4 ++++ tools/frame_get.js | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/load/page.js b/load/page.js index 896bb3f..0b6fc87 100644 --- a/load/page.js +++ b/load/page.js @@ -145,6 +145,7 @@ function Page(debug) { key: [], // Key actions raw: {}, // Page raw content for each session type + date: undefined, // Date of frame }; this.__defaults__ = { @@ -284,6 +285,20 @@ function Page(debug) { } }); + Object.defineProperty(this,'date',{ + get: function() { + if (this.__properties__.date !== undefined) + return strftime("%a, %d %b %Y %I:%M:%S %z",this.__properties__.date); + }, + + set: function(int) { + if (typeof int !== 'number') + throw new Error('DATE must be a epoch'); + + return this.__properties__.date = int; + } + }); + Page.prototype.__defineGetter__('dimensions',function() { return this.__properties__.width+' X '+this.__properties__.height; }); @@ -1315,7 +1330,7 @@ function Page(debug) { to: this.name, from: 'SYSTEM', tags: this.name, - date: strftime("%a, %d %b %Y, %I:%M:%S %Z",this.date), + date: this.date, subject: 'Content', }; diff --git a/main.js b/main.js index e16fc7b..4d9d091 100644 --- a/main.js +++ b/main.js @@ -488,6 +488,10 @@ while (bbs.online) { if (read === '*') { log(LOG_DEBUG,'- MODE_BL: Abort ['+cmd+'])'); + // 695 = NodeActionMain + bbs.replace_text(695,'\1h%s \1nViewing \1h*'+so.page.name.toString()+'#\1n'); + bbs.node_action=NODE_MAIN; + action = mode = null; cmd = ''; so.cursorOff(); diff --git a/tools/frame_get.js b/tools/frame_get.js index fee06a7..55c2e47 100644 --- a/tools/frame_get.js +++ b/tools/frame_get.js @@ -32,6 +32,7 @@ var po = new PageObject(argv[0]); if (p.get(po)) { writeln('Page : '+p.name); + writeln('- Date : '+p.date); writeln('- Cost : '+p.cost); writeln('- Owner : '+p.owner); writeln('- Key : '+p.key);