From ca7d6cdff656e5bb5e275e33ee8e7292ecb53836 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Fri, 6 Sep 2019 01:16:37 +0300 Subject: [PATCH] cleaned out redundant text browser... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 65 --------------------------------- 1 file changed, 65 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index 0a59f8bd..60ca8b47 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -5416,71 +5416,6 @@ object.Constructor('HTMLBrowser', - -//--------------------------------------------------------------------- -// Text tree renderer... -// -// This is mainly designed for testing. -// -// XXX Q: how should the header item and it's sub-list be linked??? - -var TextBrowserClassPrototype = { - __proto__: BaseBrowser, -} - -var TextBrowserPrototype = { - __proto__: BaseBrowser.prototype, - - options: { - renderIndent: '\t', - }, - - // NOTE: we do not need .renderGroup(..) here as a group is not - // visible in text... - renderList: function(header, items, footer, options){ - var that = this - return this.renderNested(null, items, null, null, options) - .join('\n') }, - renderItem: function(item, i, options){ - return item.current ? - `[ ${ item.text } ]` - : item.text }, - renderNested: function(header, children, context, item, options){ - var that = this - var nested = children - && children - .flat() - .map(function(e){ - return e instanceof Array ? - e.map(function(e){ - return (that.options.renderIndent || ' ') + e }) - : e }) - .flat() - return ( - // expanded... - header && nested ? - [ - ...(header == ' ' ? - // blank header... - [] - : ['- ' + header]), - nested, - ] - // collapsed... - : header ? - [ '+ ' + header ] - // nested... - : nested )}, -} - -var TextBrowser = -module.TextBrowser = -object.Constructor('TextBrowser', - TextBrowserClassPrototype, - TextBrowserPrototype) - - - //--------------------------------------------------------------------- // shorthands...