« get me outta code hell

Use cleaner tui-lib require syntax - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-12-22 13:13:06 -0400
committerFlorrie <towerofnix@gmail.com>2018-12-22 13:13:06 -0400
commit08a5e7805cee34ae50d958dddd262e6954afcf23 (patch)
tree9b4e683e27389bb02815070ed0f3f310852cee88
parent919a549cb627611c6d19ab8bc4e95c5a3d2e2b60 (diff)
Use cleaner tui-lib require syntax
m---------tui-lib0
-rw-r--r--ui.js36
2 files changed, 22 insertions, 14 deletions
diff --git a/tui-lib b/tui-lib
-Subproject e47a3546f0f9244bb6ee3aa708e7e24226fbdad
+Subproject d8331b98aad2e29b23e88901049fc3c91489a2c
diff --git a/ui.js b/ui.js
index fb1ec02..dfb75ae 100644
--- a/ui.js
+++ b/ui.js
@@ -5,21 +5,29 @@ const { parentSymbol, isGroup, isTrack, getItemPath, getItemPathString, flattenG
 const { shuffleArray } = require('./general-util')
 const processSmartPlaylist = require('./smart-playlist')
 const UndoManager = require('./undo-manager')
-
-const ansi = require('./tui-lib/util/ansi')
-const Button = require('./tui-lib/ui/form/Button')
-const Dialog = require('./tui-lib/ui/Dialog')
-const DisplayElement = require('./tui-lib/ui/DisplayElement')
-const FocusElement = require('./tui-lib/ui/form/FocusElement')
-const Form = require('./tui-lib/ui/form/Form')
-const Label = require('./tui-lib/ui/Label')
-const ListScrollForm = require('./tui-lib/ui/form/ListScrollForm')
-const Pane = require('./tui-lib/ui/Pane')
 const RecordStore = require('./record-store')
-const TextInput = require('./tui-lib/ui/form/TextInput')
-const WrapLabel = require('./tui-lib/ui/WrapLabel')
-const telc = require('./tui-lib/util/telchars')
-const unic = require('./tui-lib/util/unichars')
+
+const {
+  ui: {
+    Dialog,
+    DisplayElement,
+    Label,
+    Pane,
+    WrapLabel,
+    form: {
+      Button,
+      FocusElement,
+      Form,
+      ListScrollForm,
+      TextInput,
+    }
+  },
+  util: {
+    ansi,
+    telchars: telc,
+    unichars: unic,
+  }
+} = require('./tui-lib')
 
 const fs = require('fs')
 const { promisify } = require('util')