diff --git a/ui (gen4)/experiments/browse-dialog.css b/ui (gen4)/experiments/browse-dialog.css index b97ca739..dd3f3bd9 100755 --- a/ui (gen4)/experiments/browse-dialog.css +++ b/ui (gen4)/experiments/browse-dialog.css @@ -38,6 +38,7 @@ padding-left: 10px; padding-right: 10px; white-space: nowrap; + padding-right: 30px; opacity: 0.8; } @@ -70,6 +71,9 @@ .browse .path .dir.cur:hover { opacity: 1; } +.browse .path .dir.cur[contenteditable] { + opacity: 1; +} .browse .path .dir.cur:empty:not([contenteditable]) { position: relative; width: 50px; diff --git a/ui (gen4)/experiments/browse-dialog.js b/ui (gen4)/experiments/browse-dialog.js index 7d7b203d..7ab8664a 100755 --- a/ui (gen4)/experiments/browse-dialog.js +++ b/ui (gen4)/experiments/browse-dialog.js @@ -50,6 +50,21 @@ var BrowserClassPrototype = { // path... var path = $('
') .addClass('v-block path') + /* + .click(function(){ + // XXX set contenteditable... + // XXX set value to path... + // XXX select all... + }) + .on('blur', function(){ + // XXX unset contenteditable... + }) + .keyup(function(){ + // XXX update path... + // - set /../..../ to path + // - use the part after the last '/' ad filter... + }) + */ if(options.show_path == false){ path.hide() @@ -111,7 +126,7 @@ var BrowserPrototype = { Filter: { pattern: '.browse .path div.cur[contenteditable]', - // keep text editing action from affecting the seelction... + // keep text editing action from affecting the selection... ignore: [ 'Backspace', 'Left', @@ -253,6 +268,7 @@ var BrowserPrototype = { }) // add current selection indicator... + var txt p.append($('
') .addClass('dir cur') .click(function(){ @@ -272,10 +288,23 @@ var BrowserPrototype = { if(!that._hold_blur){ that.stopFilter() } - //that.stopFilter() + }) + /* XXX does the right thing (replaces the later .focus(..) + * and .keyup(..)) but does not work in IE... + .on('input', function(){ + that.showFiltered($(this).text()) + }) + */ + // only update if text changed... + .focus(function(){ + txt = $(this).text() }) .keyup(function(){ - that.showFiltered($(this).text()) + var cur = $(this).text() + if(txt != cur){ + txt = cur + that.showFiltered(cur) + } })) // fill the children list... @@ -372,6 +401,8 @@ var BrowserPrototype = { // // TODO need to support glob / nested patterns... // ..things like /**/a*/*moo/ + // + // XXX add * support... filter: function(pattern, a, b){ pattern = pattern == null ? '*' : pattern var ignore_disabled = typeof(a) == typeof(true) ? a : b @@ -502,13 +533,14 @@ var BrowserPrototype = { var that = this var e = this.dom.find('.path .dir.cur') - .text('') + //.text('') .attr('contenteditable', true) .focus() // place the cursor... - range.setStart(e[0], 0) - range.collapse(true) + //range.setStart(e[0], 0) + //range.collapse(true) + range.selectNodeContents(e[0]) selection.removeAllRanges() selection.addRange(range) }