Skip to content
Snippets Groups Projects
Commit 1f131a76 authored by deuce's avatar deuce
Browse files

Avoid the use of js.global, remove added load paths on exit.

parent 1e23fc95
Branches
Tags
No related merge requests found
......@@ -16,7 +16,7 @@
*
*/
if (js.global.Attribute === undefined)
if (typeof(Attribute) === 'undefined')
load("attribute.js");
function Graphic(w,h,attr,ch)
......
js.load_path_list.unshift(js.exec_dir+"dorkit/");
if (js.global.system !== undefined)
if (typeof(system) !== 'undefined')
js.load_path_list.unshift(system.exec_dir+"dorkit/");
load('ansi_input.js');
var k;
......
......@@ -2,7 +2,7 @@
* Implements the local console using conio
*/
if (js.global.Graphic === undefined)
if (typeof(Graphic) === 'undefined')
load("graphic.js");
dk.console.local_io = {
......
load("sbbsdefs.js");
js.global.dk_old_ctrlkey_passthru = console.ctrlkey_passthru;
js.global.dk_old_pauseoff = bbs.sys_status & SS_PAUSEOFF;
js.on_exit("console.ctrlkey_passthru=js.global.dk_old_ctrlkey_passthru;bbs.sys_status=(bbs.sys_status &~ SS_PAUSEOFF)|js.global.dk_old_pauseoff");
dk_old_ctrlkey_passthru = console.ctrlkey_passthru;
dk_old_pauseoff = bbs.sys_status & SS_PAUSEOFF;
js.on_exit("console.ctrlkey_passthru=dk_old_ctrlkey_passthru;bbs.sys_status=(bbs.sys_status &~ SS_PAUSEOFF)|dk_old_pauseoff");
console.ctrlkey_passthru=0x7fffffff; // Disable all parsing.
/*
......
js.load_path_list.unshift(js.exec_dir+"dorkit/");
if (js.global.system !== undefined)
if (typeof(system) !== 'undefined')
js.load_path_list.unshift(system.exec_dir+"dorkit/");
load('ansi_input.js');
var q = new Queue("dorkit_input");
......
......@@ -7,9 +7,9 @@
* all data should be provided using the print() method.
*/
if (js.global.Graphic === undefined)
if (typeof(Graphic) === 'undefined')
load("graphic.js");
if (js.global.Attribute === undefined)
if (typeof(Attribute) === 'undefined')
load("attribute.js");
function Screen(w, h, attr, fill)
......
js.load_path_list.unshift(js.exec_dir+"dorkit/");
if (js.global.system !== undefined)
if (typeof(system) !== 'undefined')
js.load_path_list.unshift(system.exec_dir+"dorkit/");
load('ansi_input.js');
var i;
......
js.load_path_list.unshift(js.exec_dir+"dorkit/");
if (js.global.system !== undefined)
js.on_exit("js.load_path_list.shift()");
if (typeof(system) !== 'undefined') {
js.load_path_list.unshift(system.exec_dir+"dorkit/");
js.on_exit("js.load_path_list.shift()");
}
load("screen.js");
// polyfill the String object with repeat method.
......@@ -716,13 +719,13 @@ var dk = {
gen_dir:undefined,
sysop_name:undefined,
default_attr:new Attribute(7),
mode:(js.global.bbs !== undefined
&& js.global.server !== undefined
&& js.global.client !== undefined
&& js.global.user !== undefined
&& js.global.console !== undefined) ? 'sbbs'
: (js.global.jsexec_revision !== undefined ? 'jsexec'
: (js.global.jsdoor_revision !== undefined ? 'jsdoor' : undefined))
mode:(typeof(bbs) !== 'undefined'
&& typeof(server) !== 'undefined'
&& typeof(client) !== 'undefined'
&& typeof(user) !== 'undefined'
&& typeof(console) !== 'undefined') ? 'sbbs'
: (typeof(jsexec_revision) !== 'undefined' ? 'jsexec'
: (typeof(jsdoor_revision) !== 'undefined' ? 'jsdoor' : undefined))
},
misc:{
event_time:undefined,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment