From 804e7f184dcebf99f74e1b945a4a0361d7496939 Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Fri, 11 Mar 2022 23:24:26 -0500 Subject: [PATCH 01/15] Attempting to make this a somewhat maintainable npm package. --- package-lock.json | 46 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 8 +++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a4c3fe..104145a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,50 @@ { + "name": "fTelnet", + "version": "1.0.0", + "lockfileVersion": 2, "requires": true, - "lockfileVersion": 1, + "packages": { + "": { + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "async": "^3.2.0", + "jsmin": "^1.0.1", + "typescript": "^4.1.3" + } + }, + "node_modules/async": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "dev": true + }, + "node_modules/jsmin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/jsmin/-/jsmin-1.0.1.tgz", + "integrity": "sha1-570NzWSWw79IYyNb9GGj2YqjuYw=", + "dev": true, + "bin": { + "jsmin": "bin/jsmin" + }, + "engines": { + "node": ">=0.1.93" + } + }, + "node_modules/typescript": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", + "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + } + }, "dependencies": { "async": { "version": "3.2.0", diff --git a/package.json b/package.json index 342a443..b2e8a77 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,13 @@ { + "name": "fTelnet", + "version": "1.0.0", + "description": "The foundation of an Iniquity bbs application.", + "author": "ispyhumanfly ", + "homepage": "http://iniquitybbs.com", + "license": "MIT", + "private": false, "requires": true, "lockfileVersion": 1, - "dependencies": {}, "devDependencies": { "async": "^3.2.0", "jsmin": "^1.0.1", From 51f378e611ac5be4666eed2be4aca0120dca4843 Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Fri, 11 Mar 2022 23:36:35 -0500 Subject: [PATCH 02/15] Now this can be build as an npm package. I also ported over the build.cmd and what not over to the more 'npm' way of doing things. --- build.cmd | 3 --- package.json | 3 +++ postbuild.js | 30 ++++++++++++++--------------- release/ftelnet.norip.noxfer.js | 2 +- release/ftelnet.norip.noxfer.min.js | 2 +- release/ftelnet.norip.xfer.js | 2 +- release/ftelnet.norip.xfer.min.js | 3 +-- release/ftelnet.rip.noxfer.js | 2 +- release/ftelnet.rip.noxfer.min.js | 2 +- release/ftelnet.rip.xfer.js | 2 +- release/ftelnet.rip.xfer.min.js | 3 +-- 11 files changed, 26 insertions(+), 28 deletions(-) delete mode 100644 build.cmd diff --git a/build.cmd b/build.cmd deleted file mode 100644 index eb3c9a5..0000000 --- a/build.cmd +++ /dev/null @@ -1,3 +0,0 @@ -cls -node node_modules\typescript\bin\tsc --build source %1 -node postbuild.js \ No newline at end of file diff --git a/package.json b/package.json index b2e8a77..5041d17 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "license": "MIT", "private": false, "requires": true, + "scripts": { + "build": "npx tsc --build source && node postbuild.js" + }, "lockfileVersion": 1, "devDependencies": { "async": "^3.2.0", diff --git a/postbuild.js b/postbuild.js index 8d72864..6bffa52 100644 --- a/postbuild.js +++ b/postbuild.js @@ -70,25 +70,25 @@ function minifyFile(filename) { } Promise.all([ - fixEnumerable('stage\\common.js'), - fixEnumerable('stage\\connections.js'), - fixEnumerable('stage\\crt.js'), - fixEnumerable('stage\\crtcontrols.js'), - fixEnumerable('stage\\filetransfer.js'), - fixEnumerable('stage\\ftelnetclient.js'), - fixEnumerable('stage\\graph.js') + fixEnumerable('stage/common.js'), + fixEnumerable('stage/connections.js'), + fixEnumerable('stage/crt.js'), + fixEnumerable('stage/crtcontrols.js'), + fixEnumerable('stage/filetransfer.js'), + fixEnumerable('stage/ftelnetclient.js'), + fixEnumerable('stage/graph.js') ]).then(function() { Promise.all([ - combineFiles(['stage\\common.js', 'stage\\crt.js', 'stage\\connections.js', 'stage\\ftelnetclient.js'], 'release\\ftelnet.norip.noxfer.js'), - combineFiles(['include\\blob.js', 'include\\filesaver.js', 'stage\\common.js', 'stage\\crt.js', 'stage\\connections.js', 'stage\\crtcontrols.js', 'stage\\filetransfer.js', 'stage\\ftelnetclient.js'], 'release\\ftelnet.norip.xfer.js'), - combineFiles(['stage\\common.js', 'stage\\crt.js', 'stage\\connections.js', 'stage\\graph.js', 'stage\\ftelnetclient.js'], 'release\\ftelnet.rip.noxfer.js'), - combineFiles(['include\\blob.js', 'include\\filesaver.js', 'stage\\common.js', 'stage\\crt.js', 'stage\\connections.js', 'stage\\crtcontrols.js', 'stage\\filetransfer.js', 'stage\\graph.js', 'stage\\ftelnetclient.js'], 'release\\ftelnet.rip.xfer.js') + combineFiles(['stage/common.js', 'stage/crt.js', 'stage/connections.js', 'stage/ftelnetclient.js'], 'release/ftelnet.norip.noxfer.js'), + combineFiles(['include/blob.js', 'include/filesaver.js', 'stage/common.js', 'stage/crt.js', 'stage/connections.js', 'stage/crtcontrols.js', 'stage/filetransfer.js', 'stage/ftelnetclient.js'], 'release/ftelnet.norip.xfer.js'), + combineFiles(['stage/common.js', 'stage/crt.js', 'stage/connections.js', 'stage/graph.js', 'stage/ftelnetclient.js'], 'release/ftelnet.rip.noxfer.js'), + combineFiles(['include/blob.js', 'include/filesaver.js', 'stage/common.js', 'stage/crt.js', 'stage/connections.js', 'stage/crtcontrols.js', 'stage/filetransfer.js', 'stage/graph.js', 'stage/ftelnetclient.js'], 'release/ftelnet.rip.xfer.js') ]).then(function() { Promise.all([ - minifyFile('release\\ftelnet.norip.noxfer.js'), - minifyFile('release\\ftelnet.norip.xfer.js'), - minifyFile('release\\ftelnet.rip.noxfer.js'), - minifyFile('release\\ftelnet.rip.xfer.js') + minifyFile('release/ftelnet.norip.noxfer.js'), + minifyFile('release/ftelnet.norip.xfer.js'), + minifyFile('release/ftelnet.rip.noxfer.js'), + minifyFile('release/ftelnet.rip.xfer.js') ]); }); }); diff --git a/release/ftelnet.norip.noxfer.js b/release/ftelnet.norip.noxfer.js index 6b61670..e6287b7 100644 --- a/release/ftelnet.norip.noxfer.js +++ b/release/ftelnet.norip.noxfer.js @@ -921,7 +921,7 @@ var Ansi = (function () { x = this.GetNextParam(0); y = this.GetNextParam(0); z = this.GetNextParam(0); - this.onescQ.trigger(x.toString(10)); + this.onescQ.trigger('CP' + x.toString(10) + '_' + y.toString(10) + 'x' + z.toString(10)); break; case 'r': if (this._AnsiIntermediates.length === 0) { diff --git a/release/ftelnet.norip.noxfer.min.js b/release/ftelnet.norip.noxfer.min.js index 695901e..421f7fa 100644 --- a/release/ftelnet.norip.noxfer.min.js +++ b/release/ftelnet.norip.noxfer.min.js @@ -90,7 +90,7 @@ else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB(' break;case 5:Colour256=this.ANSI256_COLORS[this.GetNextParam(0)];this._Crt.TextBackground24(Colour256.r,Colour256.g,Colour256.b);break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} break;case 49:Colour=this.ANSI_COLORS[40-40];this._Crt.TextBackground(Colour);break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:Colour=this.ANSI_COLORS[x-90]+8;this._Crt.TextColor(Colour);break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:Colour=this.ANSI_COLORS[x-100]+8;this._Crt.TextBackground(Colour);break;}} break;case'N':console.log('Unhandled ESC sequence: ANSI Music');break;case'n':x=this.GetNextParam(0);switch(x){case 5:this.onesc5n.trigger();break;case 6:this.onesc6n.trigger();break;case 255:this.onesc255n.trigger();break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} -break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger(x.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} +break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger('CP'+x.toString(10)+'_'+y.toString(10)+'x'+z.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} else if(this._AnsiIntermediates[0].indexOf('*')!==-1){console.log('Unhandled ESC sequence: Set the output emulation speed.');} else if(this._AnsiIntermediates[0].indexOf(']')!==-1){console.log('Unhandled ESC sequence: Set Top and Bottom Margins');} else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} diff --git a/release/ftelnet.norip.xfer.js b/release/ftelnet.norip.xfer.js index ebf6c32..869110d 100644 --- a/release/ftelnet.norip.xfer.js +++ b/release/ftelnet.norip.xfer.js @@ -1336,7 +1336,7 @@ var Ansi = (function () { x = this.GetNextParam(0); y = this.GetNextParam(0); z = this.GetNextParam(0); - this.onescQ.trigger(x.toString(10)); + this.onescQ.trigger('CP' + x.toString(10) + '_' + y.toString(10) + 'x' + z.toString(10)); break; case 'r': if (this._AnsiIntermediates.length === 0) { diff --git a/release/ftelnet.norip.xfer.min.js b/release/ftelnet.norip.xfer.min.js index b01a2ff..a1db467 100644 --- a/release/ftelnet.norip.xfer.min.js +++ b/release/ftelnet.norip.xfer.min.js @@ -15,7 +15,6 @@ return builder.getBlob(type);};}(typeof self!=="undefined"&&self||typeof window! A saveAs() FileSaver implementation. 2014-01-24 - By Eli Grey, http://eligrey.com License: X11/MIT See LICENSE.md @@ -123,7 +122,7 @@ else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB(' break;case 5:Colour256=this.ANSI256_COLORS[this.GetNextParam(0)];this._Crt.TextBackground24(Colour256.r,Colour256.g,Colour256.b);break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} break;case 49:Colour=this.ANSI_COLORS[40-40];this._Crt.TextBackground(Colour);break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:Colour=this.ANSI_COLORS[x-90]+8;this._Crt.TextColor(Colour);break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:Colour=this.ANSI_COLORS[x-100]+8;this._Crt.TextBackground(Colour);break;}} break;case'N':console.log('Unhandled ESC sequence: ANSI Music');break;case'n':x=this.GetNextParam(0);switch(x){case 5:this.onesc5n.trigger();break;case 6:this.onesc6n.trigger();break;case 255:this.onesc255n.trigger();break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} -break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger(x.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} +break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger('CP'+x.toString(10)+'_'+y.toString(10)+'x'+z.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} else if(this._AnsiIntermediates[0].indexOf('*')!==-1){console.log('Unhandled ESC sequence: Set the output emulation speed.');} else if(this._AnsiIntermediates[0].indexOf(']')!==-1){console.log('Unhandled ESC sequence: Set Top and Bottom Margins');} else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} diff --git a/release/ftelnet.rip.noxfer.js b/release/ftelnet.rip.noxfer.js index 6fdf097..979d4ec 100644 --- a/release/ftelnet.rip.noxfer.js +++ b/release/ftelnet.rip.noxfer.js @@ -921,7 +921,7 @@ var Ansi = (function () { x = this.GetNextParam(0); y = this.GetNextParam(0); z = this.GetNextParam(0); - this.onescQ.trigger(x.toString(10)); + this.onescQ.trigger('CP' + x.toString(10) + '_' + y.toString(10) + 'x' + z.toString(10)); break; case 'r': if (this._AnsiIntermediates.length === 0) { diff --git a/release/ftelnet.rip.noxfer.min.js b/release/ftelnet.rip.noxfer.min.js index 57f8f20..f74da33 100644 --- a/release/ftelnet.rip.noxfer.min.js +++ b/release/ftelnet.rip.noxfer.min.js @@ -90,7 +90,7 @@ else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB(' break;case 5:Colour256=this.ANSI256_COLORS[this.GetNextParam(0)];this._Crt.TextBackground24(Colour256.r,Colour256.g,Colour256.b);break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} break;case 49:Colour=this.ANSI_COLORS[40-40];this._Crt.TextBackground(Colour);break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:Colour=this.ANSI_COLORS[x-90]+8;this._Crt.TextColor(Colour);break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:Colour=this.ANSI_COLORS[x-100]+8;this._Crt.TextBackground(Colour);break;}} break;case'N':console.log('Unhandled ESC sequence: ANSI Music');break;case'n':x=this.GetNextParam(0);switch(x){case 5:this.onesc5n.trigger();break;case 6:this.onesc6n.trigger();break;case 255:this.onesc255n.trigger();break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} -break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger(x.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} +break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger('CP'+x.toString(10)+'_'+y.toString(10)+'x'+z.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} else if(this._AnsiIntermediates[0].indexOf('*')!==-1){console.log('Unhandled ESC sequence: Set the output emulation speed.');} else if(this._AnsiIntermediates[0].indexOf(']')!==-1){console.log('Unhandled ESC sequence: Set Top and Bottom Margins');} else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} diff --git a/release/ftelnet.rip.xfer.js b/release/ftelnet.rip.xfer.js index 26049fe..d53f3bc 100644 --- a/release/ftelnet.rip.xfer.js +++ b/release/ftelnet.rip.xfer.js @@ -1336,7 +1336,7 @@ var Ansi = (function () { x = this.GetNextParam(0); y = this.GetNextParam(0); z = this.GetNextParam(0); - this.onescQ.trigger(x.toString(10)); + this.onescQ.trigger('CP' + x.toString(10) + '_' + y.toString(10) + 'x' + z.toString(10)); break; case 'r': if (this._AnsiIntermediates.length === 0) { diff --git a/release/ftelnet.rip.xfer.min.js b/release/ftelnet.rip.xfer.min.js index 2711a3f..f8a86c4 100644 --- a/release/ftelnet.rip.xfer.min.js +++ b/release/ftelnet.rip.xfer.min.js @@ -15,7 +15,6 @@ return builder.getBlob(type);};}(typeof self!=="undefined"&&self||typeof window! A saveAs() FileSaver implementation. 2014-01-24 - By Eli Grey, http://eligrey.com License: X11/MIT See LICENSE.md @@ -123,7 +122,7 @@ else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB(' break;case 5:Colour256=this.ANSI256_COLORS[this.GetNextParam(0)];this._Crt.TextBackground24(Colour256.r,Colour256.g,Colour256.b);break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} break;case 49:Colour=this.ANSI_COLORS[40-40];this._Crt.TextBackground(Colour);break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:Colour=this.ANSI_COLORS[x-90]+8;this._Crt.TextColor(Colour);break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:Colour=this.ANSI_COLORS[x-100]+8;this._Crt.TextBackground(Colour);break;}} break;case'N':console.log('Unhandled ESC sequence: ANSI Music');break;case'n':x=this.GetNextParam(0);switch(x){case 5:this.onesc5n.trigger();break;case 6:this.onesc6n.trigger();break;case 255:this.onesc255n.trigger();break;default:console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');break;} -break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger(x.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} +break;case'P':x=Math.max(1,this.GetNextParam(1));this._Crt.DelChar(x);break;case'Q':x=this.GetNextParam(0);y=this.GetNextParam(0);z=this.GetNextParam(0);this.onescQ.trigger('CP'+x.toString(10)+'_'+y.toString(10)+'x'+z.toString(10));break;case'r':if(this._AnsiIntermediates.length===0){console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} else if(this._AnsiIntermediates[0].indexOf('*')!==-1){console.log('Unhandled ESC sequence: Set the output emulation speed.');} else if(this._AnsiIntermediates[0].indexOf(']')!==-1){console.log('Unhandled ESC sequence: Set Top and Bottom Margins');} else{console.log('Unknown ESC sequence: PB('+this._AnsiParams.toString()+') IB('+this._AnsiIntermediates.toString()+') FB('+finalByte+')');} From 5fdb2617dc67e85ffe86daafe275694da9222e54 Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Fri, 11 Mar 2022 23:38:44 -0500 Subject: [PATCH 03/15] Node, and VSC undertand unix/mac style directory paths. --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 00ad71f..55712c1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "node_modules\\typescript\\lib" + "typescript.tsdk": "node_modules/typescript/lib" } \ No newline at end of file From e01e6de285cccd9dbaec7857ce3d48ee299b3b3a Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Fri, 11 Mar 2022 23:45:01 -0500 Subject: [PATCH 04/15] Toying with a slightly more than simple example of using fTelnet with iniquity. --- release/index.html | 68 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/release/index.html b/release/index.html index 0506877..6bda17b 100644 --- a/release/index.html +++ b/release/index.html @@ -1,26 +1,52 @@  - - - Super Simple Sample - - - - - -

Super Simple Sample

+ + + + iniquitybbs.com + -

This is a super simple sample of how to use fTelnet. For more information, see the docs.

+ + + -
- - - + + +
+ + + + From 92231b8d1202c3d6339d9de74250c3b8f5eb66c7 Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Fri, 11 Mar 2022 23:46:10 -0500 Subject: [PATCH 05/15] Again. --- release/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/index.html b/release/index.html index 6bda17b..5a5e54e 100644 --- a/release/index.html +++ b/release/index.html @@ -21,7 +21,7 @@ - +
diff --git a/source/ftelnetclient/fTelnetClient.ts b/source/ftelnetclient/fTelnetClient.ts index b24831f..9ba9b91 100644 --- a/source/ftelnetclient/fTelnetClient.ts +++ b/source/ftelnetclient/fTelnetClient.ts @@ -653,11 +653,11 @@ class fTelnetClient { if (this._Options.ProxyHostname === '') { this._StatusBarLabel.innerHTML = 'Connected to ' + this._Options.Hostname + ':' + this._Options.Port; - this._StatusBar.style.backgroundColor = 'blue'; + this._StatusBar.style.backgroundColor = this._Options.StatusBarColor this._ClientContainer.style.opacity = '1.0'; } else { this._StatusBarLabel.innerHTML = 'Connected to ' + this._Options.Hostname + ':' + this._Options.Port + ' via ' + this._Options.ProxyHostname; - this._StatusBar.style.backgroundColor = 'blue'; + this._StatusBar.style.backgroundColor = this._Options.StatusBarColor this._ClientContainer.style.opacity = '1.0'; } diff --git a/source/ftelnetclient/fTelnetOptions.ts b/source/ftelnetclient/fTelnetOptions.ts index 1f3c02c..f91931e 100644 --- a/source/ftelnetclient/fTelnetOptions.ts +++ b/source/ftelnetclient/fTelnetOptions.ts @@ -44,4 +44,5 @@ class fTelnetOptions { public VirtualKeyboardVibrateDuration: number = 25; public VirtualKeyboardVisible: boolean = DetectMobileBrowser.IsMobile; public WebSocketUrlPath: string = ''; + public StatusBarColor: string = 'blue' } From f57a304678d87d5dfbcfdc20283f65769778506a Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Sat, 12 Mar 2022 12:38:51 -0500 Subject: [PATCH 11/15] Can now disable the focusbar via the options. --- source/ftelnetclient/fTelnetClient.ts | 10 +++++----- source/ftelnetclient/fTelnetOptions.ts | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/ftelnetclient/fTelnetClient.ts b/source/ftelnetclient/fTelnetClient.ts index 9ba9b91..f2d60eb 100644 --- a/source/ftelnetclient/fTelnetClient.ts +++ b/source/ftelnetclient/fTelnetClient.ts @@ -187,7 +187,7 @@ class fTelnetClient { this._FocusWarningBar.className = 'fTelnetFocusWarning'; this._FocusWarningBar.innerHTML = '*** CLICK HERE TO ENABLE KEYBOARD INPUT ***'; this._FocusWarningBar.style.display = 'none'; - this._fTelnetContainer.appendChild(this._FocusWarningBar); + if (!this._Options.DisableFocusBar) this._fTelnetContainer.appendChild(this._FocusWarningBar); // Create the scrollback bar this._ScrollbackBar = document.createElement('div'); @@ -236,7 +236,7 @@ class fTelnetClient { // Create the status bar this._StatusBar = document.createElement('div'); this._StatusBar.className = 'fTelnetStatusBar'; - this._fTelnetContainer.appendChild(this._StatusBar); + if (!this._Options.DisableStatusBar) this._fTelnetContainer.appendChild(this._StatusBar); // Create the statusbar menu button this._MenuButton = document.createElement('a'); @@ -244,7 +244,7 @@ class fTelnetClient { this._MenuButton.href = '#'; this._MenuButton.innerHTML = 'Menu'; this._MenuButton.addEventListener('click', (e: Event): boolean => { this.OnMenuButtonClick(); e.preventDefault(); return false; }, false); - this._StatusBar.appendChild(this._MenuButton); + if (!this._Options.DisableMenu) this._StatusBar.appendChild(this._MenuButton); // Create the statusbar connect button this._ConnectButton = document.createElement('a'); @@ -475,13 +475,13 @@ class fTelnetClient { if (this._Options.ProxyHostname === '') { this._ConnectButton.style.display = 'none'; this._StatusBarLabel.innerHTML = 'Connecting to ' + this._Options.Hostname + ':' + this._Options.Port; - this._StatusBar.style.backgroundColor = 'blue'; + this._StatusBar.style.backgroundColor = this._Options.StatusBarColor this._ClientContainer.style.opacity = '1.0'; this._Connection.connect(this._Options.Hostname, this._Options.Port, this._Options.WebSocketUrlPath, this._Options.ForceWss); } else { this._ConnectButton.style.display = 'none'; this._StatusBarLabel.innerHTML = 'Connecting to ' + this._Options.Hostname + ':' + this._Options.Port + ' via ' + this._Options.ProxyHostname; - this._StatusBar.style.backgroundColor = 'blue'; + this._StatusBar.style.backgroundColor = this._Options.StatusBarColor this._ClientContainer.style.opacity = '1.0'; this._Connection.connect(this._Options.Hostname, this._Options.Port, '', this._Options.ForceWss, this._Options.ProxyHostname, this._Options.ProxyPort, this._Options.ProxyPortSecure); } diff --git a/source/ftelnetclient/fTelnetOptions.ts b/source/ftelnetclient/fTelnetOptions.ts index f91931e..48cdb43 100644 --- a/source/ftelnetclient/fTelnetOptions.ts +++ b/source/ftelnetclient/fTelnetOptions.ts @@ -45,4 +45,7 @@ class fTelnetOptions { public VirtualKeyboardVisible: boolean = DetectMobileBrowser.IsMobile; public WebSocketUrlPath: string = ''; public StatusBarColor: string = 'blue' + public DisableStatusBar: boolean = false + public DisableFocusBar: boolean = false + public DisableMenu: boolean = false } From ae1986b8f4a24c7586c31feeece070748fff4a40 Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Sat, 12 Mar 2022 12:39:12 -0500 Subject: [PATCH 12/15] An even MORE simple example of fTelnet. --- release/index.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/release/index.html b/release/index.html index 48e2d68..db5a424 100644 --- a/release/index.html +++ b/release/index.html @@ -4,17 +4,22 @@ - iniquitybbs.com + fTelnet - +
From 05cd42bb4cba548bd78a2e1e3f9196593ae383ae Mon Sep 17 00:00:00 2001 From: Dan Stephenson Date: Sat, 12 Mar 2022 12:39:48 -0500 Subject: [PATCH 13/15] Preparing for a pull request back Rick. --- package.json | 4 ++-- release/ftelnet.norip.noxfer.js | 16 +++++++++++----- release/ftelnet.norip.noxfer.min.js | 13 ++++++++----- release/ftelnet.norip.xfer.js | 16 +++++++++++----- release/ftelnet.norip.xfer.min.js | 13 ++++++++----- release/ftelnet.rip.noxfer.js | 16 +++++++++++----- release/ftelnet.rip.noxfer.min.js | 13 ++++++++----- release/ftelnet.rip.xfer.js | 16 +++++++++++----- release/ftelnet.rip.xfer.min.js | 13 ++++++++----- 9 files changed, 78 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 3171f61..363d6c6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@iniquitybbs/fTelnet", + "name": "fTelnet", "version": "1.0.0", "description": "The foundation of an Iniquity bbs application.", "author": "ispyhumanfly ", @@ -9,7 +9,7 @@ "requires": true, "scripts": { "build": "npx tsc --build source && node postbuild.js", - "start": "npx webtelnet 8888 23 -h d1st.prg -c 437 -w ./release/" + "start": "npx webtelnet 8888 23 -h localhost -c 437 -w ./release/" }, "lockfileVersion": 1, "devDependencies": { diff --git a/release/ftelnet.norip.noxfer.js b/release/ftelnet.norip.noxfer.js index c518430..99277f9 100644 --- a/release/ftelnet.norip.noxfer.js +++ b/release/ftelnet.norip.noxfer.js @@ -4700,7 +4700,8 @@ var fTelnetClient = (function () { this._FocusWarningBar.className = 'fTelnetFocusWarning'; this._FocusWarningBar.innerHTML = '*** CLICK HERE TO ENABLE KEYBOARD INPUT ***'; this._FocusWarningBar.style.display = 'none'; - this._fTelnetContainer.appendChild(this._FocusWarningBar); + if (!this._Options.DisableFocusBar) + this._fTelnetContainer.appendChild(this._FocusWarningBar); this._ScrollbackBar = document.createElement('div'); this._ScrollbackBar.className = 'fTelnetScrollback'; if (this._UseModernScrollback) { @@ -4740,13 +4741,15 @@ var fTelnetClient = (function () { this._fTelnetContainer.appendChild(this._ScrollbackBar); this._StatusBar = document.createElement('div'); this._StatusBar.className = 'fTelnetStatusBar'; - this._fTelnetContainer.appendChild(this._StatusBar); + if (!this._Options.DisableStatusBar) + this._fTelnetContainer.appendChild(this._StatusBar); this._MenuButton = document.createElement('a'); this._MenuButton.className = 'fTelnetMenuButton'; this._MenuButton.href = '#'; this._MenuButton.innerHTML = 'Menu'; this._MenuButton.addEventListener('click', function (e) { _this.OnMenuButtonClick(); e.preventDefault(); return false; }, false); - this._StatusBar.appendChild(this._MenuButton); + if (!this._Options.DisableMenu) + this._StatusBar.appendChild(this._MenuButton); this._ConnectButton = document.createElement('a'); this._ConnectButton.className = 'fTelnetConnectButton'; this._ConnectButton.href = '#'; @@ -4942,14 +4945,14 @@ var fTelnetClient = (function () { if (this._Options.ProxyHostname === '') { this._ConnectButton.style.display = 'none'; this._StatusBarLabel.innerHTML = 'Connecting to ' + this._Options.Hostname + ':' + this._Options.Port; - this._StatusBar.style.backgroundColor = 'blue'; + this._StatusBar.style.backgroundColor = this._Options.StatusBarColor; this._ClientContainer.style.opacity = '1.0'; this._Connection.connect(this._Options.Hostname, this._Options.Port, this._Options.WebSocketUrlPath, this._Options.ForceWss); } else { this._ConnectButton.style.display = 'none'; this._StatusBarLabel.innerHTML = 'Connecting to ' + this._Options.Hostname + ':' + this._Options.Port + ' via ' + this._Options.ProxyHostname; - this._StatusBar.style.backgroundColor = 'blue'; + this._StatusBar.style.backgroundColor = this._Options.StatusBarColor; this._ClientContainer.style.opacity = '1.0'; this._Connection.connect(this._Options.Hostname, this._Options.Port, '', this._Options.ForceWss, this._Options.ProxyHostname, this._Options.ProxyPort, this._Options.ProxyPortSecure); } @@ -5419,6 +5422,9 @@ var fTelnetOptions = (function () { this.VirtualKeyboardVisible = DetectMobileBrowser.IsMobile; this.WebSocketUrlPath = ''; this.StatusBarColor = 'blue'; + this.DisableStatusBar = false; + this.DisableFocusBar = false; + this.DisableMenu = false; } return fTelnetOptions; }()); diff --git a/release/ftelnet.norip.noxfer.min.js b/release/ftelnet.norip.noxfer.min.js index 74e994e..e46c839 100644 --- a/release/ftelnet.norip.noxfer.min.js +++ b/release/ftelnet.norip.noxfer.min.js @@ -470,9 +470,12 @@ if(document.getElementById('fTelnetKeyboardCss')===null){var link=document.creat this._InitMessageBar=document.createElement('div');this._InitMessageBar.className='fTelnetInitMessage';this._InitMessageBar.innerHTML='Initializing fTelnet...';this._fTelnetContainer.appendChild(this._InitMessageBar);this._ClientContainer=document.createElement('div');this._ClientContainer.className='fTelnetClientContainer';this._fTelnetContainer.appendChild(this._ClientContainer);this._UseModernScrollback=(this._Options.AllowModernScrollback&&DetectMobileBrowser.SupportsModernScrollback&&(this._Options.Emulation!=='RIP'));if(this._UseModernScrollback){this._ClientContainer.style.overflowX='hidden';this._ClientContainer.style.overflowY='scroll';this._ClientContainer.style.height=this._Options.ScreenRows*16+'px';this._ClientContainer.style.width=(this._Options.ScreenColumns*9)+GetScrollbarWidth.Width+'px';this._ClientContainer.scrollTop=this._ClientContainer.scrollHeight;} this._Crt=new Crt(this._ClientContainer,this._UseModernScrollback);this._InitMessageBar.style.display='none';this._Crt.onfontchange.on(function(){_this.OnCrtScreenSizeChanged();});this._Crt.onkeypressed.on(function(){_this.OnCrtKeyPressed();});this._Crt.onscreensizechange.on(function(){_this.OnCrtScreenSizeChanged();});this._Crt.BareLFtoCRLF=this._Options.BareLFtoCRLF;this._Crt.LocalEcho=this._Options.LocalEcho;this._Crt.SkipRedrawWhenSameFontSize=this._Options.SkipRedrawWhenSameFontSize;this._Crt.SetFont(this._Options.Font);this._Crt.SetScreenSize(this._Options.ScreenColumns,this._Options.ScreenRows);this._Ansi=new Ansi(this._Crt);this._Ansi.onesc0c.on(function(){_this.OnAnsiESC0c();});this._Ansi.onesc5n.on(function(){_this.OnAnsiESC5n();});this._Ansi.onesc6n.on(function(){_this.OnAnsiESC6n();});this._Ansi.onesc255n.on(function(){_this.OnAnsiESC255n();});this._Ansi.onescQ.on(function(font){_this.OnAnsiESCQ(font);});this._Ansi.onripdetect.on(function(){_this.OnAnsiRIPDetect();});this._Ansi.onripdisable.on(function(){_this.OnAnsiRIPDisable();});this._Ansi.onripenable.on(function(){_this.OnAnsiRIPEnable();});if(this._Options.Emulation==='RIP'){this._RIP=new RIP(this._Crt,this._Ansi,this._ClientContainer);} if(!('WebSocket'in window)||navigator.userAgent.match('AppleWebKit/534.30')){this._Crt.WriteLn();this._Crt.WriteLn('Sorry, but your browser doesn\'t support the WebSocket protocol!');this._Crt.WriteLn();this._Crt.WriteLn('WebSockets are how fTelnet connects to the remote server, so without them that');this._Crt.WriteLn('means you won\'t be able to connect anywhere.');this._Crt.WriteLn();this._Crt.WriteLn('If you can, try upgrading your web browser. If that\'s not an option (ie you\'re');this._Crt.WriteLn('already running the latest version your platform supports, like IE 8 on');this._Crt.WriteLn('Windows XP), then try switching to a different web browser.');this._Crt.WriteLn();this._Crt.WriteLn('Feel free to contact me (http://www.ftelnet.ca/contact/) if you think you\'re');this._Crt.WriteLn('seeing this message in error, and I\'ll look into it. Be sure to let me know');this._Crt.WriteLn('what browser you use, as well as which version it is.');console.log('fTelnet Error: WebSocket not supported');} -this._FocusWarningBar=document.createElement('div');this._FocusWarningBar.className='fTelnetFocusWarning';this._FocusWarningBar.innerHTML='*** CLICK HERE TO ENABLE KEYBOARD INPUT ***';this._FocusWarningBar.style.display='none';this._fTelnetContainer.appendChild(this._FocusWarningBar);this._ScrollbackBar=document.createElement('div');this._ScrollbackBar.className='fTelnetScrollback';if(this._UseModernScrollback){this._ScrollbackBar.innerHTML='SCROLLBACK: Scroll back down to the bottom to exit scrollback mode';} +this._FocusWarningBar=document.createElement('div');this._FocusWarningBar.className='fTelnetFocusWarning';this._FocusWarningBar.innerHTML='*** CLICK HERE TO ENABLE KEYBOARD INPUT ***';this._FocusWarningBar.style.display='none';if(!this._Options.DisableFocusBar) +this._fTelnetContainer.appendChild(this._FocusWarningBar);this._ScrollbackBar=document.createElement('div');this._ScrollbackBar.className='fTelnetScrollback';if(this._UseModernScrollback){this._ScrollbackBar.innerHTML='SCROLLBACK: Scroll back down to the bottom to exit scrollback mode';} else{var ScrollbackLabel=document.createElement('span');ScrollbackLabel.innerHTML='SCROLLBACK:';this._ScrollbackBar.appendChild(ScrollbackLabel);var ScrollbackLineUp=document.createElement('a');ScrollbackLineUp.href='#';ScrollbackLineUp.innerHTML='Line Up';ScrollbackLineUp.addEventListener('click',function(e){_this._Crt.PushKeyDown(KeyboardKeys.UP,KeyboardKeys.UP,false,false,false);e.preventDefault();return false;});this._ScrollbackBar.appendChild(ScrollbackLineUp);var ScrollbackLineDown=document.createElement('a');ScrollbackLineDown.href='#';ScrollbackLineDown.innerHTML='Line Down';ScrollbackLineDown.addEventListener('click',function(e){_this._Crt.PushKeyDown(KeyboardKeys.DOWN,KeyboardKeys.DOWN,false,false,false);e.preventDefault();return false;});this._ScrollbackBar.appendChild(ScrollbackLineDown);var ScrollbackPageUp=document.createElement('a');ScrollbackPageUp.href='#';ScrollbackPageUp.innerHTML='Page Up';ScrollbackPageUp.addEventListener('click',function(e){_this._Crt.PushKeyDown(KeyboardKeys.PAGE_UP,KeyboardKeys.PAGE_UP,false,false,false);e.preventDefault();return false;});this._ScrollbackBar.appendChild(ScrollbackPageUp);var ScrollbackPageDown=document.createElement('a');ScrollbackPageDown.href='#';ScrollbackPageDown.innerHTML='Page Down';ScrollbackPageDown.addEventListener('click',function(e){_this._Crt.PushKeyDown(KeyboardKeys.PAGE_DOWN,KeyboardKeys.PAGE_DOWN,false,false,false);e.preventDefault();return false;});this._ScrollbackBar.appendChild(ScrollbackPageDown);var ScrollbackExit=document.createElement('a');ScrollbackExit.href='#';ScrollbackExit.innerHTML='Exit';ScrollbackExit.addEventListener('click',function(e){_this.ExitScrollback();e.preventDefault();return false;});this._ScrollbackBar.appendChild(ScrollbackExit);} -this._ScrollbackBar.style.display='none';this._fTelnetContainer.appendChild(this._ScrollbackBar);this._StatusBar=document.createElement('div');this._StatusBar.className='fTelnetStatusBar';this._fTelnetContainer.appendChild(this._StatusBar);this._MenuButton=document.createElement('a');this._MenuButton.className='fTelnetMenuButton';this._MenuButton.href='#';this._MenuButton.innerHTML='Menu';this._MenuButton.addEventListener('click',function(e){_this.OnMenuButtonClick();e.preventDefault();return false;},false);this._StatusBar.appendChild(this._MenuButton);this._ConnectButton=document.createElement('a');this._ConnectButton.className='fTelnetConnectButton';this._ConnectButton.href='#';this._ConnectButton.innerHTML='Connect';this._ConnectButton.addEventListener('click',function(e){_this.Connect();e.preventDefault();return false;},false);this._StatusBar.appendChild(this._ConnectButton);this._StatusBarLabel=document.createElement('span');this._StatusBarLabel.className='fTelnetStatusBarLabel';this._StatusBarLabel.innerHTML='Not connected';this._StatusBar.appendChild(this._StatusBarLabel);this._MenuButtons=document.createElement('div');this._MenuButtons.className='fTelnetMenuButtons';var MenuButtonsTable=document.createElement('table');var MenuButtonsRow1=document.createElement('tr');var MenuButtonsRow1Cell1=document.createElement('td');var MenuButtonsConnect=document.createElement('a');MenuButtonsConnect.href='#';MenuButtonsConnect.innerHTML='Connect';MenuButtonsConnect.addEventListener('click',function(me){_this.Connect();me.preventDefault();return false;});MenuButtonsRow1Cell1.appendChild(MenuButtonsConnect);MenuButtonsRow1.appendChild(MenuButtonsRow1Cell1);var MenuButtonsRow1Cell2=document.createElement('td');var MenuButtonsDisconnect=document.createElement('a');MenuButtonsDisconnect.href='#';MenuButtonsDisconnect.innerHTML='Disconnect';MenuButtonsDisconnect.addEventListener('click',function(me){_this.Disconnect(true);me.preventDefault();return false;});MenuButtonsRow1Cell2.appendChild(MenuButtonsDisconnect);MenuButtonsRow1.appendChild(MenuButtonsRow1Cell2);MenuButtonsTable.appendChild(MenuButtonsRow1);if(!DetectMobileBrowser.IsMobile){var MenuButtonsRow2=document.createElement('tr');var MenuButtonsRow2Cell1=document.createElement('td');var MenuButtonsCopy=document.createElement('a');MenuButtonsCopy.href='#';MenuButtonsCopy.innerHTML='Copy';MenuButtonsCopy.addEventListener('click',function(me){_this.ClipboardCopy();me.preventDefault();return false;});MenuButtonsRow2Cell1.appendChild(MenuButtonsCopy);MenuButtonsRow2.appendChild(MenuButtonsRow2Cell1);var MenuButtonsRow2Cell2=document.createElement('td');var MenuButtonsPaste=document.createElement('a');MenuButtonsPaste.href='#';MenuButtonsPaste.innerHTML='Paste';MenuButtonsPaste.addEventListener('click',function(me){_this.ClipboardPaste();me.preventDefault();return false;});MenuButtonsRow2Cell2.appendChild(MenuButtonsPaste);MenuButtonsRow2.appendChild(MenuButtonsRow2Cell2);MenuButtonsTable.appendChild(MenuButtonsRow2);} +this._ScrollbackBar.style.display='none';this._fTelnetContainer.appendChild(this._ScrollbackBar);this._StatusBar=document.createElement('div');this._StatusBar.className='fTelnetStatusBar';if(!this._Options.DisableStatusBar) +this._fTelnetContainer.appendChild(this._StatusBar);this._MenuButton=document.createElement('a');this._MenuButton.className='fTelnetMenuButton';this._MenuButton.href='#';this._MenuButton.innerHTML='Menu';this._MenuButton.addEventListener('click',function(e){_this.OnMenuButtonClick();e.preventDefault();return false;},false);if(!this._Options.DisableMenu) +this._StatusBar.appendChild(this._MenuButton);this._ConnectButton=document.createElement('a');this._ConnectButton.className='fTelnetConnectButton';this._ConnectButton.href='#';this._ConnectButton.innerHTML='Connect';this._ConnectButton.addEventListener('click',function(e){_this.Connect();e.preventDefault();return false;},false);this._StatusBar.appendChild(this._ConnectButton);this._StatusBarLabel=document.createElement('span');this._StatusBarLabel.className='fTelnetStatusBarLabel';this._StatusBarLabel.innerHTML='Not connected';this._StatusBar.appendChild(this._StatusBarLabel);this._MenuButtons=document.createElement('div');this._MenuButtons.className='fTelnetMenuButtons';var MenuButtonsTable=document.createElement('table');var MenuButtonsRow1=document.createElement('tr');var MenuButtonsRow1Cell1=document.createElement('td');var MenuButtonsConnect=document.createElement('a');MenuButtonsConnect.href='#';MenuButtonsConnect.innerHTML='Connect';MenuButtonsConnect.addEventListener('click',function(me){_this.Connect();me.preventDefault();return false;});MenuButtonsRow1Cell1.appendChild(MenuButtonsConnect);MenuButtonsRow1.appendChild(MenuButtonsRow1Cell1);var MenuButtonsRow1Cell2=document.createElement('td');var MenuButtonsDisconnect=document.createElement('a');MenuButtonsDisconnect.href='#';MenuButtonsDisconnect.innerHTML='Disconnect';MenuButtonsDisconnect.addEventListener('click',function(me){_this.Disconnect(true);me.preventDefault();return false;});MenuButtonsRow1Cell2.appendChild(MenuButtonsDisconnect);MenuButtonsRow1.appendChild(MenuButtonsRow1Cell2);MenuButtonsTable.appendChild(MenuButtonsRow1);if(!DetectMobileBrowser.IsMobile){var MenuButtonsRow2=document.createElement('tr');var MenuButtonsRow2Cell1=document.createElement('td');var MenuButtonsCopy=document.createElement('a');MenuButtonsCopy.href='#';MenuButtonsCopy.innerHTML='Copy';MenuButtonsCopy.addEventListener('click',function(me){_this.ClipboardCopy();me.preventDefault();return false;});MenuButtonsRow2Cell1.appendChild(MenuButtonsCopy);MenuButtonsRow2.appendChild(MenuButtonsRow2Cell1);var MenuButtonsRow2Cell2=document.createElement('td');var MenuButtonsPaste=document.createElement('a');MenuButtonsPaste.href='#';MenuButtonsPaste.innerHTML='Paste';MenuButtonsPaste.addEventListener('click',function(me){_this.ClipboardPaste();me.preventDefault();return false;});MenuButtonsRow2Cell2.appendChild(MenuButtonsPaste);MenuButtonsRow2.appendChild(MenuButtonsRow2Cell2);MenuButtonsTable.appendChild(MenuButtonsRow2);} if((typeof YModemReceive!=='undefined')&&(typeof YModemSend!=='undefined')){var MenuButtonsRow3=document.createElement('tr');var MenuButtonsRow3Cell1=document.createElement('td');var MenuButtonsUpload=document.createElement('a');MenuButtonsUpload.href='#';MenuButtonsUpload.innerHTML='Upload';MenuButtonsUpload.addEventListener('click',function(me){_this.Upload();me.preventDefault();return false;});MenuButtonsRow3Cell1.appendChild(MenuButtonsUpload);MenuButtonsRow3.appendChild(MenuButtonsRow3Cell1);var MenuButtonsRow3Cell2=document.createElement('td');var MenuButtonsDownload=document.createElement('a');MenuButtonsDownload.href='#';MenuButtonsDownload.innerHTML='Download';MenuButtonsDownload.addEventListener('click',function(me){_this.Download();me.preventDefault();return false;});MenuButtonsRow3Cell2.appendChild(MenuButtonsDownload);MenuButtonsRow3.appendChild(MenuButtonsRow3Cell2);MenuButtonsTable.appendChild(MenuButtonsRow3);} if(!window.cordova){var MenuButtonsRow4=document.createElement('tr');var MenuButtonsRow4Cell1=document.createElement('td');var MenuButtonsKeyboard=document.createElement('a');MenuButtonsKeyboard.href='#';MenuButtonsKeyboard.innerHTML='Keyboard';MenuButtonsKeyboard.addEventListener('click',function(me){_this.VirtualKeyboardVisible=!_this.VirtualKeyboardVisible;me.preventDefault();return false;});MenuButtonsRow4Cell1.appendChild(MenuButtonsKeyboard);MenuButtonsRow4.appendChild(MenuButtonsRow4Cell1);var MenuButtonsRow4Cell2=document.createElement('td');var MenuButtonsFullScreen=document.createElement('a');MenuButtonsFullScreen.href='#';MenuButtonsFullScreen.innerHTML='Full Screen';MenuButtonsFullScreen.addEventListener('click',function(me){_this.FullScreenToggle();me.preventDefault();return false;});MenuButtonsRow4Cell2.appendChild(MenuButtonsFullScreen);MenuButtonsRow4.appendChild(MenuButtonsRow4Cell2);MenuButtonsTable.appendChild(MenuButtonsRow4);} if(!this._UseModernScrollback){var MenuButtonsRow5=document.createElement('tr');var MenuButtonsRow5Cell1=document.createElement('td');MenuButtonsRow5Cell1.colSpan=2;var MenuButtonsScrollback=document.createElement('a');MenuButtonsScrollback.href='#';MenuButtonsScrollback.innerHTML='View Scrollback Buffer';MenuButtonsScrollback.addEventListener('click',function(me){_this.EnterScrollback();me.preventDefault();return false;});MenuButtonsRow5Cell1.appendChild(MenuButtonsScrollback);MenuButtonsRow5.appendChild(MenuButtonsRow5Cell1);MenuButtonsTable.appendChild(MenuButtonsRow5);} @@ -491,8 +494,8 @@ if((typeof this._Connection!=='undefined')&&(this._Connection.connected)){return switch(this._Options.ConnectionType){case'rlogin':this._Connection=new RLoginConnection();break;case'tcp':this._Connection=new WebSocketConnection();break;default:this._Connection=new TelnetConnection(this._Crt);this._Connection.LocalEcho=this._Options.LocalEcho;this._Connection.onlocalecho.on(function(value){_this.OnConnectionLocalEcho(value);});this._Connection.SendLocation=this._Options.SendLocation;break;} this._Connection.onclose.on(function(){_this.OnConnectionClose();});this._Connection.onconnect.on(function(){_this.OnConnectionConnect();});this._Connection.ondata.on(function(){_this.OnConnectionData();});this._Connection.onioerror.on(function(){_this.OnConnectionIOError();});this._Connection.onsecurityerror.on(function(){_this.OnConnectionSecurityError();});if(this._Options.Emulation==='RIP'){this._RIP.ResetWindows();} else{this._Crt.NormVideo();this._Crt.ClrScr();} -if(this._Options.ProxyHostname===''){this._ConnectButton.style.display='none';this._StatusBarLabel.innerHTML='Connecting to '+this._Options.Hostname+':'+this._Options.Port;this._StatusBar.style.backgroundColor='blue';this._ClientContainer.style.opacity='1.0';this._Connection.connect(this._Options.Hostname,this._Options.Port,this._Options.WebSocketUrlPath,this._Options.ForceWss);} -else{this._ConnectButton.style.display='none';this._StatusBarLabel.innerHTML='Connecting to '+this._Options.Hostname+':'+this._Options.Port+' via '+this._Options.ProxyHostname;this._StatusBar.style.backgroundColor='blue';this._ClientContainer.style.opacity='1.0';this._Connection.connect(this._Options.Hostname,this._Options.Port,'',this._Options.ForceWss,this._Options.ProxyHostname,this._Options.ProxyPort,this._Options.ProxyPortSecure);}};Object.defineProperty(fTelnetClient.prototype,"Connected",{get:function(){if(typeof this._Connection==='undefined'){return false;} +if(this._Options.ProxyHostname===''){this._ConnectButton.style.display='none';this._StatusBarLabel.innerHTML='Connecting to '+this._Options.Hostname+':'+this._Options.Port;this._StatusBar.style.backgroundColor=this._Options.StatusBarColor;this._ClientContainer.style.opacity='1.0';this._Connection.connect(this._Options.Hostname,this._Options.Port,this._Options.WebSocketUrlPath,this._Options.ForceWss);} +else{this._ConnectButton.style.display='none';this._StatusBarLabel.innerHTML='Connecting to '+this._Options.Hostname+':'+this._Options.Port+' via '+this._Options.ProxyHostname;this._StatusBar.style.backgroundColor=this._Options.StatusBarColor;this._ClientContainer.style.opacity='1.0';this._Connection.connect(this._Options.Hostname,this._Options.Port,'',this._Options.ForceWss,this._Options.ProxyHostname,this._Options.ProxyPort,this._Options.ProxyPortSecure);}};Object.defineProperty(fTelnetClient.prototype,"Connected",{get:function(){if(typeof this._Connection==='undefined'){return false;} return this._Connection.connected;},enumerable:true,configurable:true});Object.defineProperty(fTelnetClient.prototype,"Connection",{get:function(){return this._Connection;},enumerable:true,configurable:true});Object.defineProperty(fTelnetClient.prototype,"Crt",{get:function(){return this._Crt;},enumerable:true,configurable:true});fTelnetClient.prototype.Disconnect=function(prompt){if(typeof this._MenuButtons!=='undefined'){this._MenuButtons.style.display='none';} if(typeof this._Connection==='undefined'){return true;} if(!this._Connection.connected){return true;} @@ -550,5 +553,5 @@ if(typeof this._Connection==='undefined'){return;} if(!this._Connection.connected){return;} this._UploadInput.click();};fTelnetClient.prototype.UploadFile=function(file,fileCount){var _this=this;var reader=new FileReader();reader.onload=function(){var FR=new FileRecord(file.name,file.size);var Buffer=reader.result;var Bytes=new Uint8Array(Buffer);for(var i=0;i Date: Wed, 23 Mar 2022 19:00:35 -0400 Subject: [PATCH 14/15] fTelnet updates. --- package.json | 4 ++-- release/index.html | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 363d6c6..52e3399 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "fTelnet", + "name": "@iniquitybbs/fTelnet", "version": "1.0.0", "description": "The foundation of an Iniquity bbs application.", "author": "ispyhumanfly ", "homepage": "http://iniquitybbs.com", - "license": "MIT", + "license": "GNU", "private": true, "requires": true, "scripts": { diff --git a/release/index.html b/release/index.html index db5a424..4b3b077 100644 --- a/release/index.html +++ b/release/index.html @@ -4,7 +4,7 @@ - fTelnet + @iniquitybbs/fTelnet + -