Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit d89eade9 authored by nightfox's avatar nightfox

Version 1.21: Uses require() instead of load() to load the required .js...

Version 1.21: Uses require() instead of load() to load the required .js libraries, if the require() function is defined (it was added in Synchronet 3.17).  This avoids 'multiple definition' errors with the latest .js libarries & Synchronet binaries.
parent 10042a16
......@@ -148,6 +148,10 @@
* 2019-04-26 Eric Oulashin Version 1.20
* Added configurable options for the message score colors
* for the message list
* 2019-05-04 Eric Oulashin Version 1.21
* Started updating to use require() instead of load()
* if the require() function exists (it was added in
* Synchronet 3.17).
*/
// TODO: Support anonymous posts? Bit values for sub[x].settings:
......@@ -216,8 +220,18 @@
added in the future.
*/
load("sbbsdefs.js");
load("text.js"); // Text string definitions (referencing text.dat)
const requireFnExists = (typeof(require) === "function");
if (requireFnExists)
{
require("sbbsdefs.js", "K_UPPER");
require("text.js", "Email"); // Text string definitions (referencing text.dat)
}
else
{
load("sbbsdefs.js");
load("text.js"); // Text string definitions (referencing text.dat)
}
// This script requires Synchronet version 3.15 or higher.
// Exit if the Synchronet version is below the minimum.
......@@ -235,8 +249,8 @@ if (system.version_num < 31500)
}
// Reader version information
var READER_VERSION = "1.20";
var READER_DATE = "2019-04-26";
var READER_VERSION = "1.21";
var READER_DATE = "2019-05-04";
// Keyboard key codes for displaying on the screen
var UP_ARROW = ascii(24);
......@@ -478,15 +492,28 @@ if (file_exists(gFileAttachDir))
// with a scrollable user interface.
var gFrameJSAvailable = file_exists(backslash(system.exec_dir) + "load/frame.js");
if (gFrameJSAvailable)
load("frame.js");
{
if (requireFnExists)
require("frame.js", "Frame");
else
load("frame.js");
}
var gScrollbarJSAvailable = file_exists(backslash(system.exec_dir) + "load/scrollbar.js");
if (gScrollbarJSAvailable)
load("scrollbar.js");
{
if (requireFnExists)
require("scrollbar.js", "ScrollBar");
else
load("scrollbar.js");
}
// See if the avatar support files are available, and load them if so
var gAvatar = null;
if (file_exists(backslash(system.exec_dir) + "load/smbdefs.js") && file_exists(backslash(system.exec_dir) + "load/avatar_lib.js"))
{
load("smbdefs.js");
if (requireFnExists)
require("smbdefs.js", "SMB_POLL_ANSWER");
else
load("smbdefs.js");
gAvatar = load({}, "avatar_lib.js");
}
......
Digital Distortion Message Reader
Version 1.20
Release date: 2019-04-26
Version 1.21
Release date: 2019-05-04
by
......
......@@ -5,6 +5,12 @@ Revision History (change log)
=============================
Version Date Description
------- ---- -----------
1.21 2019-05-04 New uses require() instead of load(), if the require()
function exists, to load required .js library scripts.
This helps avoid 'multiple definition' errors. The
require() function was added in Synchronet 3.17, so
if the require() function doesn't exist, then the reader
will use load().
1.20 2019-04-26 Added configurable options for the message score colors
for the message list: msgListScoreColor,
msgListToUserScoreColor, msgListFromUserScoreColor, and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment