From e8007c1c795a5bb35dc696fdf7fb51b482b629b6 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 26 Nov 2015 02:34:23 +0300 Subject: [PATCH] fixed one bug, found a new one... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse-walk.js | 2 +- ui (gen4)/lib/widget/browse.html | 2 +- ui (gen4)/lib/widget/browse.js | 16 +++++++++++----- ui (gen4)/ui.js | 1 + ui (gen4)/viewer.js | 7 ++++--- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ui (gen4)/lib/widget/browse-walk.js b/ui (gen4)/lib/widget/browse-walk.js index e74ffd22..30394661 100755 --- a/ui (gen4)/lib/widget/browse-walk.js +++ b/ui (gen4)/lib/widget/browse-walk.js @@ -79,7 +79,7 @@ function(path, make){ // get the drive list on windows... if(os.type() == 'Windows_NT' && path == '/'){ return new promise(function(resolve, reject){ - // NOTE: this is a bit brain-dead but it does the job done + // NOTE: this is a bit brain-dead but it gets the job done // and faster than fancy modules like drivelist... 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .split('') diff --git a/ui (gen4)/lib/widget/browse.html b/ui (gen4)/lib/widget/browse.html index 63ed2589..e124abaf 100755 --- a/ui (gen4)/lib/widget/browse.html +++ b/ui (gen4)/lib/widget/browse.html @@ -117,7 +117,7 @@ body.dark { var TREE = { dir_a: {}, - dir_b: { + 'dir b': { file1: 'this is a file', file2: 'this is a file', file3: 'this is a file', diff --git a/ui (gen4)/lib/widget/browse.js b/ui (gen4)/lib/widget/browse.js index 9986773f..d5437dbb 100755 --- a/ui (gen4)/lib/widget/browse.js +++ b/ui (gen4)/lib/widget/browse.js @@ -30,6 +30,7 @@ var widget = require('./widget') /*********************************************************************/ // Helpers... +// XXX why do we need this??? var quoteWS = function(str){ return str.replace(/(\s)/g, '\\$1') } @@ -562,7 +563,8 @@ var BrowserPrototype = { /* XXX does the right thing (replaces the later .focus(..) * and .keyup(..)) but does not work in IE... .on('input', function(){ - that.filterList(quoteWS($(this).text())) + //that.filterList(quoteWS($(this).text())) + that.filterList($(this).text()) }) */ // only update if text changed... @@ -607,7 +609,8 @@ var BrowserPrototype = { // handle clicks ONLY when not disabled... .click(function(){ if(!$(this).hasClass('disabled')){ - that.push(quoteWS($(this).text())) + //that.push(quoteWS($(this).text())) + that.push($(this).text()) } }) .text(p) @@ -1377,7 +1380,8 @@ var BrowserPrototype = { } var path = this.path - var txt = quoteWS(elem.text()) + //var txt = quoteWS(elem.text()) + var txt = elem.text() path.push(elem.text()) // XXX should this be before or after the actual path update??? @@ -1435,7 +1439,8 @@ var BrowserPrototype = { var path = this.path - path.push(quoteWS(elem.text())) + //path.push(quoteWS(elem.text())) + path.push(elem.text()) var res = this.open(path) @@ -1570,7 +1575,8 @@ var BrowserPrototype = { } path = this.path - path.push(quoteWS(elem.text())) + //path.push(quoteWS(elem.text())) + path.push(elem.text()) } // get the options method and call it if it exists... diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index 89efebed..51b22cad 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -236,6 +236,7 @@ module.GLOBAL_KEYBOARD = { alt: 'browseActions: "/Bookmark/"', }, C: 'browseActions: "/Crop/"', + O: 'pathListerTest', // XXX for debug... G: function(){ $('.viewer').toggleClass('visible-gid') }, diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index 5df562a1..b1b0fd2b 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -2718,6 +2718,8 @@ var ActionTreeActions = actions.Actions({ }) }], // XXX make this nw only... + // XXX BUG: for some reason this when run from .browseActions(..) loads + // incorrectly while when called directly is OK... pathListerTest: ['Interface|Test/Path lister test (floating)...', function(path){ var parent = this.preventClosing ? this.preventClosing() : null @@ -2727,8 +2729,7 @@ var ActionTreeActions = actions.Actions({ console.log('PATH:', path.slice(1)) // XXX use logger... - // XXX this does not work because in the last path - // element ' ' is replaced with a '\\ '... + // XXX need to strip the leading '/' in a more cross-platform way... this.loadPath && this.loadPath(path.slice(1)) return @@ -3180,7 +3181,7 @@ module.ImageBookmarks = ImageGridFeatures.Feature({ var AppControlActions = actions.Actions({ // XXX revise these... - close: ['File|Interface/Cloase viewer', + close: ['File|Interface/Close viewer', function(){ // XXX should we do anything else here like auto-save??? window.close()