From baf7cd6a15735752976a9d26359472f3d12573df Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 5 Sep 2015 02:52:51 +0300 Subject: [PATCH] moved the browser widget out of experiments... Signed-off-by: Alex A. Naanou --- .../browse-dialog.css => css/widget/browse.css} | 0 .../widget/browse.html} | 16 ++++++++-------- .../browse-dialog.js => lib/widget/browse.js} | 16 ++++++++++------ 3 files changed, 18 insertions(+), 14 deletions(-) rename ui (gen4)/{experiments/browse-dialog.css => css/widget/browse.css} (100%) rename ui (gen4)/{experiments/browse-dialog.html => lib/widget/browse.html} (90%) rename ui (gen4)/{experiments/browse-dialog.js => lib/widget/browse.js} (95%) diff --git a/ui (gen4)/experiments/browse-dialog.css b/ui (gen4)/css/widget/browse.css similarity index 100% rename from ui (gen4)/experiments/browse-dialog.css rename to ui (gen4)/css/widget/browse.css diff --git a/ui (gen4)/experiments/browse-dialog.html b/ui (gen4)/lib/widget/browse.html similarity index 90% rename from ui (gen4)/experiments/browse-dialog.html rename to ui (gen4)/lib/widget/browse.html index 1b51f4f6..0e80a010 100755 --- a/ui (gen4)/experiments/browse-dialog.html +++ b/ui (gen4)/lib/widget/browse.html @@ -1,6 +1,6 @@ - + - - + + - - + + - + @@ -155,7 +155,7 @@ TREE.dir_c.dir_b.tree = TREE var use_disabled = true var show_files = false -requirejs(['../lib/keyboard', '../object', './browse-dialog'], function(k, o, br){ +requirejs(['../keyboard', '../../object', './browse'], function(k, o, br){ keyboard = k object = o browser = br @@ -279,7 +279,7 @@ requirejs(['../lib/keyboard', '../object', './browse-dialog'], function(k, o, br // matches... // NOTE: this will make more sence when path patterns are // supported... - 'dynamic/1/1/*': function(path, make){ + 'dynamic/1/*/*': function(path, make){ make('mooo!/') make('fooo!') }, diff --git a/ui (gen4)/experiments/browse-dialog.js b/ui (gen4)/lib/widget/browse.js similarity index 95% rename from ui (gen4)/experiments/browse-dialog.js rename to ui (gen4)/lib/widget/browse.js index 0e0c5f13..5b148eeb 100755 --- a/ui (gen4)/experiments/browse-dialog.js +++ b/ui (gen4)/lib/widget/browse.js @@ -18,7 +18,8 @@ if(typeof(module) !== 'undefined' && module.exports){ define(function(require){ var module = {} -var object = require('../object') +// XXX +var object = require('../../object') @@ -1731,12 +1732,15 @@ PathListPrototype.options = { var lister = keys .filter(function(k){ return k.trim().slice(-1) == '*' }) .filter(function(k){ - return k - .split(/[\\\/]+/) - // remove the '*'... + k = k.split(/[\\\/]+/) + // remove the trailing '*'... .slice(0, -1) - // do the match... - .filter(function(e, i){ return e != path[i] }).length == 0 }) + + // do the match... + return k.length <= path.length + && k.filter(function(e, i){ + return e != '*' && e != path[i] + }).length == 0 }) .sort(function(a, b){ return a.length - b.length}) .pop()