From 9af9bfe3d016b7c5b821d4693544ba0cb37dd60a Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 3 Aug 2016 22:43:56 -0600 Subject: [PATCH] More switch style --- core/mci_view_factory.js | 218 ++++++++++++++++---------------- core/new_scan.js | 14 +- core/scanner_tossers/ftn_bso.js | 14 +- 3 files changed, 123 insertions(+), 123 deletions(-) diff --git a/core/mci_view_factory.js b/core/mci_view_factory.js index 11ce305f..c5b95bb3 100644 --- a/core/mci_view_factory.js +++ b/core/mci_view_factory.js @@ -78,126 +78,126 @@ MCIViewFactory.prototype.createFromMCI = function(mci, cb) { // switch(mci.code) { // Text Label (Text View) - case 'TL' : - setOption(0, 'textStyle'); - setOption(1, 'justify'); - setWidth(2); + case 'TL' : + setOption(0, 'textStyle'); + setOption(1, 'justify'); + setWidth(2); - view = new TextView(options); - break; + view = new TextView(options); + break; - // Edit Text - case 'ET' : - setWidth(0); + // Edit Text + case 'ET' : + setWidth(0); - setOption(1, 'textStyle'); - setFocusOption(0, 'focusTextStyle'); + setOption(1, 'textStyle'); + setFocusOption(0, 'focusTextStyle'); - view = new EditTextView(options); - break; + view = new EditTextView(options); + break; - // Masked Edit Text - case 'ME' : - setOption(0, 'textStyle'); - setFocusOption(0, 'focusTextStyle'); + // Masked Edit Text + case 'ME' : + setOption(0, 'textStyle'); + setFocusOption(0, 'focusTextStyle'); - view = new MaskEditTextView(options); - break; + view = new MaskEditTextView(options); + break; - // Multi Line Edit Text - case 'MT' : - // :TODO: apply params - view = new MultiLineEditTextView(options); - break; + // Multi Line Edit Text + case 'MT' : + // :TODO: apply params + view = new MultiLineEditTextView(options); + break; - // Pre-defined Label (Text View) - // :TODO: Currently no real point of PL -- @method replaces this pretty much... probably remove - case 'PL' : - if(mci.args.length > 0) { - options.text = getPredefinedMCIValue(this.client, mci.args[0]); - if(options.text) { - setOption(1, 'textStyle'); - setOption(2, 'justify'); - setWidth(3); + // Pre-defined Label (Text View) + // :TODO: Currently no real point of PL -- @method replaces this pretty much... probably remove + case 'PL' : + if(mci.args.length > 0) { + options.text = getPredefinedMCIValue(this.client, mci.args[0]); + if(options.text) { + setOption(1, 'textStyle'); + setOption(2, 'justify'); + setWidth(3); + + view = new TextView(options); + } + } + break; + + // Button + case 'BT' : + if(mci.args.length > 0) { + options.dimens = { width : parseInt(mci.args[0], 10) }; + } + + setOption(1, 'textStyle'); + setOption(2, 'justify'); + + setFocusOption(0, 'focusTextStyle'); + + view = new ButtonView(options); + break; + + // Vertial Menu + case 'VM' : + setOption(0, 'itemSpacing'); + setOption(1, 'justify'); + setOption(2, 'textStyle'); + + setFocusOption(0, 'focusTextStyle'); + + view = new VerticalMenuView(options); + break; + + // Horizontal Menu + case 'HM' : + setOption(0, 'itemSpacing'); + setOption(1, 'textStyle'); + + setFocusOption(0, 'focusTextStyle'); + + view = new HorizontalMenuView(options); + break; + + case 'SM' : + setOption(0, 'textStyle'); + setOption(1, 'justify'); + + setFocusOption(0, 'focusTextStyle'); + + view = new SpinnerMenuView(options); + break; + + case 'TM' : + if(mci.args.length > 0) { + var styleSG1 = { fg : parseInt(mci.args[0], 10) }; + if(mci.args.length > 1) { + styleSG1.bg = parseInt(mci.args[1], 10); + } + options.styleSG1 = ansi.getSGRFromGraphicRendition(styleSG1, true); + } + + setFocusOption(0, 'focusTextStyle'); + + view = new ToggleMenuView(options); + break; + + case 'KE' : + view = new KeyEntryView(options); + break; + + default : + options.text = getPredefinedMCIValue(this.client, mci.code); + if(_.isString(options.text)) { + setWidth(0); + + setOption(1, 'textStyle'); + setOption(2, 'justify'); view = new TextView(options); } - } - break; - - // Button - case 'BT' : - if(mci.args.length > 0) { - options.dimens = { width : parseInt(mci.args[0], 10) }; - } - - setOption(1, 'textStyle'); - setOption(2, 'justify'); - - setFocusOption(0, 'focusTextStyle'); - - view = new ButtonView(options); - break; - - // Vertial Menu - case 'VM' : - setOption(0, 'itemSpacing'); - setOption(1, 'justify'); - setOption(2, 'textStyle'); - - setFocusOption(0, 'focusTextStyle'); - - view = new VerticalMenuView(options); - break; - - // Horizontal Menu - case 'HM' : - setOption(0, 'itemSpacing'); - setOption(1, 'textStyle'); - - setFocusOption(0, 'focusTextStyle'); - - view = new HorizontalMenuView(options); - break; - - case 'SM' : - setOption(0, 'textStyle'); - setOption(1, 'justify'); - - setFocusOption(0, 'focusTextStyle'); - - view = new SpinnerMenuView(options); - break; - - case 'TM' : - if(mci.args.length > 0) { - var styleSG1 = { fg : parseInt(mci.args[0], 10) }; - if(mci.args.length > 1) { - styleSG1.bg = parseInt(mci.args[1], 10); - } - options.styleSG1 = ansi.getSGRFromGraphicRendition(styleSG1, true); - } - - setFocusOption(0, 'focusTextStyle'); - - view = new ToggleMenuView(options); - break; - - case 'KE' : - view = new KeyEntryView(options); - break; - - default : - options.text = getPredefinedMCIValue(this.client, mci.code); - if(_.isString(options.text)) { - setWidth(0); - - setOption(1, 'textStyle'); - setOption(2, 'justify'); - - view = new TextView(options); - } - break; + break; } return view; diff --git a/core/new_scan.js b/core/new_scan.js index d7825940..09985e1f 100644 --- a/core/new_scan.js +++ b/core/new_scan.js @@ -212,13 +212,13 @@ NewScanModule.prototype.mciReady = function(mciData, cb) { }, function performCurrentStepScan(callback) { switch(self.currentStep) { - case 'messageConferences' : - self.newScanMessageConference( () => { - callback(null); // finished - }); - break; - - default : return callback(null); + case 'messageConferences' : + self.newScanMessageConference( () => { + callback(null); // finished + }); + break; + + default : return callback(null); } } ], diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index db15b73e..b7d45f59 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -194,11 +194,11 @@ function FTNMessageScanTossModule() { let ext; switch(flowType) { - case 'mail' : ext = `${exportType.toLowerCase()[0]}ut`; break; - case 'ref' : ext = `${exportType.toLowerCase()[0]}lo`; break; - case 'busy' : ext = 'bsy'; break; - case 'request' : ext = 'req'; break; - case 'requests' : ext = 'hrq'; break; + case 'mail' : ext = `${exportType.toLowerCase()[0]}ut`; break; + case 'ref' : ext = `${exportType.toLowerCase()[0]}lo`; break; + case 'busy' : ext = 'bsy'; break; + case 'request' : ext = 'req'; break; + case 'requests' : ext = 'hrq'; break; } return ext; @@ -309,8 +309,8 @@ function FTNMessageScanTossModule() { // Set appropriate attribute flag for export type // switch(this.getExportType(options.nodeConfig)) { - case 'crash' : ftnAttribute |= ftnMailPacket.Packet.Attribute.Crash; break; - case 'hold' : ftnAttribute |= ftnMailPacket.Packet.Attribute.Hold; break; + case 'crash' : ftnAttribute |= ftnMailPacket.Packet.Attribute.Crash; break; + case 'hold' : ftnAttribute |= ftnMailPacket.Packet.Attribute.Hold; break; // :TODO: Others? }