...
 
Commits (3)
......@@ -2,20 +2,8 @@ require('sbbsdefs.js', 'SYS_CLOSED');
load('array.js');
// Paths
settings.web_directory = fullpath(
backslash(
typeof settings.web_directory === 'undefined'
? '../web'
: settings.web_directory
)
);
settings.web_root = fullpath(
backslash(
typeof settings.web_root === 'undefined'
? settings.web_directory + 'root'
: settings.web_root
)
);
settings.web_directory = fullpath(backslash(settings.web_directory === undefined ? '../webv4' : settings.web_directory));
settings.web_root = fullpath(backslash(settings.web_root === undefined ? settings.web_directory + 'root' : settings.web_root));
settings.web_lib = backslash(settings.web_directory + 'lib/');
settings.web_components = backslash(settings.web_directory + 'components/');
settings.web_pages = backslash(fullpath(settings.web_root + '../pages'));
......@@ -25,47 +13,47 @@ settings.web_mods_pages = backslash(fullpath(settings.web_mods + 'pages/'));
settings.web_mods_sidebar = backslash(fullpath(settings.web_mods + 'sidebar/'));
var defaults = {
guest : {
default : 'Guest',
test : function () {
return system.matchuser(settings.guest) ? null : 'Guest account unavailable';
}
},
timeout : { default : 43200 },
user_registration : { default : false },
minimum_password_length : { default : 4 },
email_validation : { default : true },
email_validation_level : { default : 50 },
max_messages : {
default : 0,
test : function () {
return settings.max_messages >= 0 ? null : 'max_messages must be >= 0';
}
},
page_size : {
default : 25,
test : function () {
return settings.page_size >= 1 ? null : 'page_size must be >= 1';
}
},
forum_extended_ascii : { default : true },
active_node_list : { default : true },
hide_empty_stats : { default : true }
guest: {
default: 'Guest',
test: function () {
return system.matchuser(settings.guest) ? null : 'Guest account unavailable';
}
},
timeout: { default: 43200 },
user_registration: { default: false },
minimum_password_length: { default: 4 },
email_validation: { default: true },
email_validation_level: { default: 50 },
max_messages: {
default: 0,
test: function () {
return settings.max_messages >= 0 ? null : 'max_messages must be >= 0';
}
},
page_size: {
default: 25,
test: function () {
return settings.page_size >= 1 ? null : 'page_size must be >= 1';
}
},
forum_extended_ascii: { default: true },
active_node_list: { default: true },
hide_empty_stats: { default: true }
};
Object.keys(defaults).forEach(function (e) {
if (typeof settings[e] == 'undefined') {
settings[e] = defaults[e].default;
} else if (typeof settings[e] != typeof defaults[e].default) {
log(LOG_ERROR, 'Invalid ' + e + ' setting: ' + settings[e]);
exit();
} else if (typeof defaults[e].test == 'function') {
const t = defaults[e].test();
if (t !== null) {
log(LOG_ERROR, t);
exit();
}
}
if (typeof settings[e] == 'undefined') {
settings[e] = defaults[e].default;
} else if (typeof settings[e] != typeof defaults[e].default) {
log(LOG_ERROR, 'Invalid ' + e + ' setting: ' + settings[e]);
exit();
} else if (typeof defaults[e].test == 'function') {
const t = defaults[e].test();
if (t !== null) {
log(LOG_ERROR, t);
exit();
}
}
});
defaults = undefined;
......
require('sbbsdefs.js', 'SYS_CLOSED');
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
......
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
......
require('sbbsdefs.js', 'SYS_CLOSED');
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
load(settings.web_lib + 'request.js');
......
load('sbbsdefs.js');
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
......
......@@ -3,7 +3,7 @@
is done here; otherwise all permission checking is done at the function
level. */
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
......
......@@ -21,7 +21,7 @@
require('sbbsdefs.js', 'SYS_CLOSED');
require('hmac.js', 'hmac_sha1');
var options = load({}, 'modopts.js', 'github_notify');
load(system.exec_dir + '../web/lib/init.js');
load(system.exec_dir + '../webv4/lib/init.js');
function b2h(str) {
return str.split('').map(function (e) {
......
require('sbbsdefs.js', 'SYS_CLOSED');
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
load(settings.web_lib + 'request.js');
......
require('sbbsdefs.js', 'SYS_CLOSED'); // Is this actually used?
require('nodedefs.js', 'NODE_WFC'); // Is this actually used?
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
var sbbsimsg = load({}, "sbbsimsg_lib.js");
......
require('sbbsdefs.js', 'SYS_CLOSED');
require('nodedefs.js', 'NODE_WFC');
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
......
<?xjs
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
load(settings.web_lib + 'pages.js');
load(settings.web_lib + 'sidebar.js');
......@@ -17,14 +16,10 @@
var page_ctrl = getCtrlLine(pagePath);
?>
<?xjs
function _sidebar() {
if (settings.layout_sidebar_off || page_ctrl.options.no_sidebar) return;
?>
<? function _sidebar() { ?>
<? if (settings.layout_sidebar_off || page_ctrl.options.no_sidebar) return; ?>
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar"><? writeSidebarModules(); ?></div>
<?xjs
}
?>
<? } ?>
<?xjs
function loadComponent(fn) {
......@@ -54,9 +49,9 @@
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/offcanvas.css" rel="stylesheet">
<link href="./css/style.css" rel="stylesheet">
<?xjs if (file_exists(settings.web_root + 'css/custom.css')) { ?>
<? if (file_exists(settings.web_root + 'css/custom.css')) { ?>
<link href="./css/custom.css" rel="stylesheet">
<?xjs } ?>
<? } ?>
</head>
<body>
......@@ -73,22 +68,22 @@
<div class="container<?xjs if (settings.layout_full_width) write('-fluid'); ?>">
<div class="row row-offcanvas row-offcanvas-<?xjs write(settings.layout_sidebar_left ? 'left' : 'right'); ?>">
<?xjs if (settings.layout_sidebar_left) _sidebar(); ?>
<? if (settings.layout_sidebar_left) _sidebar(); ?>
<div class="col-xs-12 col-sm-<?xjs write(settings.layout_sidebar_off || page_ctrl.options.no_sidebar ? 12 : 9); ?>">
<div style="clear:both;">
<p class="pull-<?xjs write(settings.layout_sidebar_left ? 'left' : 'right'); ?> visible-xs">
<button title="Toggle sidebar" type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas"><span class="glyphicon glyphicon-tasks"></span><?xjs write(locale.strings.main.label_sidebar); ?></button>
</p>
</div>
<?xjs writePage(page); ?>
<? writePage(page); ?>
</div>
<?xjs if (!settings.layout_sidebar_left || settings.layout_sidebar_right) _sidebar(); ?>
<? if (!settings.layout_sidebar_left || settings.layout_sidebar_right) _sidebar(); ?>
</div>
<hr>
<footer>
<?xjs if (!loadComponent('footer.xjs')) { ?>
<p>&copy; <?xjs write(system.name + ", " + strftime("%Y")); ?></p>
<?xjs } ?>
<? if (!loadComponent('footer.xjs')) { ?>
<p>&copy; <? write(system.name + ", " + strftime("%Y")); ?></p>
<? } ?>
</footer>
</div>
......