Skip to content

Commit

Permalink
Autocomplete icons
Browse files Browse the repository at this point in the history
  • Loading branch information
unconed committed May 9, 2011
1 parent 2ac6f9f commit 1f94731
Show file tree
Hide file tree
Showing 7 changed files with 5,686 additions and 2 deletions.
30 changes: 29 additions & 1 deletion HTML/termkit.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ body {

.termkitOutputView .widgetFile .name, .termkitOutputView .widgetFile .meta {
padding-left: 42px;
background: #000;
}

.termkitOutputView .widgetFile .name {
Expand Down Expand Up @@ -278,7 +279,7 @@ body {
}

.termkitTokenField span.autocomplete .line span.prefix {
opacity: 0.5;
color: rgba(207, 207, 207, .65);
}

.termkitTokenField span.autocomplete .line:nth-child(2n) {
Expand Down Expand Up @@ -314,6 +315,33 @@ body {
background: #678 -webkit-gradient(linear, left top, left bottom, from(#678), to(#456));
}

.termkitTokenField span.autocomplete .line.match-command .prefix {
padding-left: 20px;
background: url(../Images/command.png) no-repeat 0 50%;
}
.termkitTokenField span.autocomplete .line.match-file .prefix {
padding-left: 20px;
background: url(../Images/file.png) no-repeat 0 50%;
}
.termkitTokenField span.autocomplete .line.match-folder .prefix {
padding-left: 20px;
background: url(../Images/folder.png) no-repeat 0 50%;
}

.termkitTokenField span#caret input.match-command {
padding-left: 20px;
background: url(../Images/command.png) no-repeat 0 50%;
}
.termkitTokenField span#caret input.match-file {
padding-left: 20px;
background: url(../Images/file.png) no-repeat 0 50%;
}
.termkitTokenField span#caret input.match-folder {
padding-left: 20px;
background: url(../Images/folder.png) no-repeat 0 50%;
}


/************/

.termkitTokenField > span.token {
Expand Down
6 changes: 5 additions & 1 deletion HTML/tokenfield/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ tf.autocomplete.prototype = {
// Reset caret position.
//this.caret.$element.find('input').css('marginTop', 0);
this.$element.css('marginTop', 0);
this.caret && this.caret.$input.removeClass()
},

onBlur: function (element) {
Expand Down Expand Up @@ -100,13 +101,16 @@ tf.autocomplete.prototype = {
queue: false,
});
that.animateTarget = offsetY;

// Style caret to match line.
that.caret && that.caret.$input.removeClass().addClass('match-' + that.items[that.selected].type);
}
else {
$e.empty().hide();
}

// Don't show single item popup.
if (that.items.length == 1 && that.items[0] == prefix) {
if (that.items.length == 1 && that.items[0].label == prefix) {
that.remove();
}
}
Expand Down
5,652 changes: 5,652 additions & 0 deletions Illustrator/Token Icons.ai

Large diffs are not rendered by default.

Binary file added Images/command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/command.psd
Binary file not shown.
Binary file modified Images/file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1f94731

Please sign in to comment.