From d02d9e4a7c3d110bd0db64694babcc943358a66e Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 15 Oct 2015 23:41:24 -0600 Subject: [PATCH] * TOONODE support when already logged in * Work on new user / NUA flow * Various cleanup --- core/system_menu_method.js | 30 ++++- mods/menu.hjson | 131 +++++++++---------- mods/themes/luciano_blocktronics/LETTER.ANS | Bin 0 -> 706 bytes mods/themes/luciano_blocktronics/NUA.ANS | Bin 2527 -> 2531 bytes mods/themes/luciano_blocktronics/TOONODE.ANS | Bin 0 -> 2179 bytes mods/themes/luciano_blocktronics/theme.hjson | 38 ++++++ 6 files changed, 125 insertions(+), 74 deletions(-) create mode 100644 mods/themes/luciano_blocktronics/LETTER.ANS create mode 100644 mods/themes/luciano_blocktronics/TOONODE.ANS diff --git a/core/system_menu_method.js b/core/system_menu_method.js index 6bc3b5fa..36783213 100644 --- a/core/system_menu_method.js +++ b/core/system_menu_method.js @@ -7,6 +7,7 @@ var ansi = require('./ansi_term.js'); var userDb = require('./database.js').dbs.user; var async = require('async'); +var _ = require('lodash'); exports.login = login; exports.logoff = logoff; @@ -48,13 +49,30 @@ function login(callingMenu, formData, extraArgs) { 'Already logged in' ); - // :TODO: display custom message if present (Obv/2: TOONODE.ANS) - - client.term.write('\nA user by that name is already logged in.\n'); + client.term.rawWrite(ansi.resetScreen()); - setTimeout(function timeout() { - client.gotoMenuModule( { name : callingMenu.menuConfig.fallback } ); - }, 500); + var tooNodeArt; + if(_.has(callingMenu, 'menuConfig.config.tooNodeArt')) { + tooNodeArt = callingMenu.menuConfig.config.tooNodeArt; + } else { + tooNodeArt = 'TOONODE'; + } + + var artOpts = { + client : client, + font : callingMenu.menuConfig.font, + name : tooNodeArt, + }; + + theme.displayThemeArt(artOpts, function artDisplayed(err) { + if(err) { + client.term.write('\nA user by that name is already logged in.\n'); + } + + setTimeout(function timeout() { + client.fallbackMenuModule(); + }, 2000); + }); return; } diff --git a/mods/menu.hjson b/mods/menu.hjson index 2f59f333..040cfc3b 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -117,8 +117,11 @@ login2: { art: USERLOG - next: messageArea - //"next" : "fullLoginSequenceLoginArt", + //next: messageArea + next: fullLoginSequenceLoginArt + config: { + tooNodeArt: TOONODE + } form: { 0: { mci: { @@ -246,7 +249,7 @@ } newUserFeedbackToSysOpPreamble: { - art: NUAFDBK + art: LETTER options: { pause: true } next: newUserFeedbackToSysOp extraArgs: { @@ -257,7 +260,9 @@ newUserFeedbackToSysOp: { status: Feedback to SysOp module: msg_area_post_fse - fallback: mainMenu + // :TODO: If the user is auto-approved, login seq. else, DONE.ANS -> Logoff + // :TODO: client.nextOrFallback(): go next or fallback. Use in MenuModule base also + fallback: fullLoginSequenceLoginArt config: { art: { header: MSGEHDR @@ -273,65 +278,57 @@ 0: { mci: { TL1: { - width: 27 argName: from } ET2: { - width: 27 - argName: to - focus: true + argName: to + focus: true text: @config:general.sysOp.username // :TODO: readOnly: true } ET3: { - width: 27 argName: subject maxLength: 72 submit: true text: New user feedback - }, - "MA5" : { - "width" : 27, - "textOverflow" : "..." } } submit: { 3: [ { - "value" : { "subject" : null }, - "action" : "@method:headerSubmit" + value: { subject: null } + action: @method:headerSubmit } ] } } - "1" : { - "mci" : { + 1: { + mci: { MT1: { - width: 79 - height: 14 - argName: ` - mode: edit + width: 79 + argName: message + mode: edit } } submit: { - *: [ { "value": "message", "action": "@method:editModeEscPressed" } ] - }, - "actionKeys" : [ + *: [ { value: "message", action: "@method:editModeEscPressed" } ] + } + actionKeys: [ { - "keys" : [ "escape" ], - "viewId" : 1 + keys: [ "escape" ] + viewId: 1 } ] }, - "2" : { - "TLTL" : { - "mci" : { - "TL1" : { - "width" : 5 - }, - "TL2" : { - "width" : 4 + 2: { + TLTL: { + mci: { + TL1: { + width: 5 + } + TL2: { + width: 4 } } } @@ -340,7 +337,8 @@ HM: { mci: { HM1: { - items: [ "Save", "Discard", "Help" ] + // :TODO: clear + items: [ "save", "help" ] } } submit: { @@ -351,10 +349,6 @@ } { value: { 1: 1 } - action: @systemMethod:fallbackMenu - } - { - value: { 1: 2 } action: @method:editModeMenuHelp } ] @@ -373,29 +367,26 @@ } } } - "fullLoginSequenceLoginArt" : { - "art" : "LOGIN", - "options" : { "pause" : true }, - "next" : "fullLoginSequenceLastCallers" - }, - "fullLoginSequenceLastCallers": { - "module" : "last_callers", - "art" : "LASTCALL", - "options" : { "pause" : true }, - "config" : { - "dateTimeFormat" : "ddd MMM Do h:mm a" - }, - "next" : "fullLoginSequenceSysStats" - }, - "fullLoginSequenceSysStats" : { - "art" : "SYSSTAT", - "options" : { "pause" : true }, - "next" : "fullLoginSequenceUserStats" - }, - "fullLoginSequenceUserStats" : { + fullLoginSequenceLoginArt: { + art: LOGIN + options: { pause: true } + next: fullLoginSequenceLastCallers + } + fullLoginSequenceLastCallers: { + module: last_callers + art: LASTCALL + options: { pause: true } + next: fullLoginSequenceSysStats + } + fullLoginSequenceSysStats: { + art: SYSSTAT + options: { pause: true } + next: fullLoginSequenceUserStats + } + fullLoginSequenceUserStats: { art: STATUS - "options" : { "pause" : true }, - "next" : "mainMenu" + options: { pause: true } + next: mainMenu }, "newUserActive" : { "art" : "SO-CC1.ANS", @@ -516,10 +507,14 @@ value: { command: "Q" } action: @menu:mainMenu } + { + value: { command: "G" } + action: @menu:logoff + } { value: 1 action: @menu:messageArea - } + } ] } messageAreaChangeCurrentArea: { @@ -854,10 +849,10 @@ } } // :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu - "messageAreaNewPost" : { - "status" : "Posting message", - "module" : "msg_area_post_fse", - "fallback" : "messageArea", // :TODO: remove once default fallback is in place + messageAreaNewPost: { + status: Posting message, + module: msg_area_post_fse + //"fallback" : "messageArea", // :TODO: remove once default fallback is in place config: { art: { header: MSGEHDR @@ -865,10 +860,10 @@ footerEditor: MSGEFTR footerEditorMenu: MSGEMFT help: MSGEHLP - }, + } editorMode: edit editorType: area - }, + } form: { 0: { mci: { diff --git a/mods/themes/luciano_blocktronics/LETTER.ANS b/mods/themes/luciano_blocktronics/LETTER.ANS new file mode 100644 index 0000000000000000000000000000000000000000..4d239593c8715668c35bccbc4585ba8da52b532b GIT binary patch literal 706 zcmb_ZO-sWt816g{h6iu<67Mq74_l?Du1*mV1kp=R-ImQV(`wfV`>hG)pA4Tj)uGIz zDQ(`oeZKnE&3O{?B#7mp@8&+w+&tjY&AphaSZakj2~lV_54qF?BY=f^gp7a;;{-I* zQH(ZV0j&1G=bgT$#TX-^gfKEdz=sK1u(N@n_SLnrbmY>KU}Y74%Tofpw#r5!gMtNx z#o@zH=@CRLWwgQ>z&{0u3T7vP9T(eih`Y~1m+;onfZ*nFhK)?ngBc_T{cm0n(iD8T zwcpj{isaRJd^t+9TZ&Ax*b;##_zQ?`Cl|?ynAeS9)4FQQYF$=~Q?{wstU#|3Z|kxV zGuGDZMHKI1k31J*HYuh{LbT6W@FAV`Ttrz_s%@r>4D?)diTzuW7pBm=#D*Ir`>7y`~>~r-h2Q6 literal 0 HcmV?d00001 diff --git a/mods/themes/luciano_blocktronics/NUA.ANS b/mods/themes/luciano_blocktronics/NUA.ANS index c1f00e4146f96af8a8454c8daae19307480ed52a..ffb3e5242fe8a729f8a95f92e3e335c5122ce9a2 100644 GIT binary patch delta 767 zcmZuvO-lk%6lI!p)D$9XH3-i|P`hzPok$QSaUq0C8WFRIEK8%;KPX$*O5Ub@eZk!u0(v$1hxYVPoQJMS(e;}>mcJl!3_nLdi>vnfr4X@wowB>|AQhn?# zS<1$JZwD|7Z-hmWqMiq- z6WV2R3UZWaMVzNZedP~FmdPd?246Yf)qT>7=rrkSh^!j3CIiDVWiF~MNMf&rJQ{An zi54$X;)|cTBI8uCP%ecg=P_PWy)HznRIqPBQqNE%GIukuI`M-YB6w1~ZG|T$grt+c K&<5l=z5WaB9OtqC delta 771 zcma)4Jxc>Y5akk+O9GKdqRoM<;77a35@U(Pf&?9)@Wlj%3xX}`A}+|sRIayZYbtTElx?UXrTJw47y72onXfV?*s5 zr0o{$`r|U;wJ$sabAMD$Eq%V1ug!VrEP=y@n5~Vuoq)b{+osKDi^dCxaS{p?Ze}Ux z^gqK*OVg31wDY`2_}g~-uA5EawJ|wc7q?;Q&$Zy?K)>0mMgs|x=B;-FZ_Sf$l2X=( diff --git a/mods/themes/luciano_blocktronics/TOONODE.ANS b/mods/themes/luciano_blocktronics/TOONODE.ANS new file mode 100644 index 0000000000000000000000000000000000000000..a7da6e05840df96c27a9f9a506965693fb117112 GIT binary patch literal 2179 zcmb`I&1xJ+6ongSw$&b?K&+Bdt)X4f^tYTq?Iw|1DO)&8pI_H#eIzF6(sZ9nCd z694i@X>!Yya;`&i%%Vv{xlO#%w&^p2jnnlnLeA5eA?i%D-d*xCjw3DGL66I3(0%J} zKEU9XBD7SXh!2LWR;I7^0Rt>rI?Y$Z4#WxUDey$P88VOPGTC-VTTqx`3_V1dV5m5T ztk4AP4xwj$fitAQ2dlzc)n#Qs3ex~-2f2ewSY)$G@c1N{8Vi$8O!&`uLVHLiyh6ug zJygxrjHsnjQUtUR!fo+6RJsQ_Ic4BOa`cpU=e9~m@tDWRp{m-73TJWORoP;=<09ku zVQCs1>8;L|j>20xN~W1ZmV-kTtHm)hX)UN!SrwwK^<^hqVghjyFNs!asN0GWg)3jA z9yZEYoEFu%q{VJX+9UJm_ngsVAR zEv_`yK-sWc9Sczxu{I?N7Z>{Qj%}bc{-X#O^$j52J@DHSmEs@*jrInlG~2&+U88uZ z5r}{59q~IlFA8DB5#fED(g_}Aw`M479Tbxsjh9M0OMX$gcO5%^i8WRP27Z`d$V(P82cRzP)5zdd z=S>Z)tk)Mme!Bj>|Fvlp(EoI`&H8H1|J4s?XXoc1&)%N-dh`C559yEJuH$RI{|m=Q B5TpPA literal 0 HcmV?d00001 diff --git a/mods/themes/luciano_blocktronics/theme.hjson b/mods/themes/luciano_blocktronics/theme.hjson index 4101c8e7..fc48632c 100644 --- a/mods/themes/luciano_blocktronics/theme.hjson +++ b/mods/themes/luciano_blocktronics/theme.hjson @@ -44,6 +44,21 @@ } } + newUserFeedbackToSysOp: { + 0: { + mci: { + TL1: { width: 19, textOverflow: "..." } + ET2: { width: 19, textOverflow: "..." } + ET3: { width: 19, textOverflow: "..." } + } + } + 1: { + mci: { + MT1: { height: 14 } + } + } + } + login2: { mci: { ET1: { width: 14 } @@ -162,6 +177,29 @@ } } } + + + fullLoginSequenceLastCallers: { + config: { + dateTimeFormat: MMM Do H:mm a + } + } + + fullLoginSequenceSysStats: { + + } + + fullLoginSequenceUserStats: { + mci: { + UN1: { width: 17 } + UR2: { width: 17 } + LO3: { width: 17 } + UF4: { width: 17 } + UG5: { width: 17 } + UT6: { width: 17 } + UC7: { width: 17 } + } + } } } } \ No newline at end of file