From ed0d2b7f54cf61e2297e8f9cc5727a11ac414251 Mon Sep 17 00:00:00 2001 From: BlackLight Date: Thu, 23 Dec 2010 18:10:50 +0100 Subject: [PATCH] Fixing some autocompletion stuff --- blash.css | 5 +++++ blash.js | 9 +++++++++ index.html | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/blash.css b/blash.css index 1ab7fd8..31926fb 100644 --- a/blash.css +++ b/blash.css @@ -4,6 +4,7 @@ body color : #888; font-family : Terminus, courier, monospace, fixed; font-size : 13px; + tabindex : -1; } input.promptInput @@ -24,11 +25,13 @@ div#blashWindow padding : 10px; border : 1px solid #888; overflow : auto; + tabindex : -1; } a.bannerLink { color : white; + tabindex : -1; } span.directory @@ -39,11 +42,13 @@ span.directory a { color : green; + tabindex : -1; } a:visited { color : green; + tabindex : -1; } span.syntax diff --git a/blash.js b/blash.js index 9687a31..d840cad 100644 --- a/blash.js +++ b/blash.js @@ -160,6 +160,7 @@ function blash () this.prompt.setAttribute ( 'autocomplete', 'off' ); this.prompt.setAttribute ( 'onkeydown', 'shell.getKey ( event )' ); this.prompt.setAttribute ( 'onkeyup', 'this.focus()' ); + this.prompt.setAttribute ( 'onblur', 'return false' ); this.cmdOut = document.createElement ( 'div' ); this.cmdOut.setAttribute ( 'id', 'blashCmdOut' ); @@ -263,6 +264,14 @@ function blash () } this.prompt.focus(); + setTimeout ( function() { shell.prompt.focus(); }, 1 ); + + if ( this.prompt.setSelectionRange ) + { + this.prompt.setSelectionRange ( this.prompt.value.length, this.prompt.value.length ); + } + + return false; } this.prompt.focus(); diff --git a/index.html b/index.html index 2864a51..aad07ae 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@
- +