diff --git a/.jshintrc b/.jshintrc
index 64e26f6b..b08ae3bd 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -13,7 +13,8 @@
"Log",
"moment",
"Pusher",
- "md5"
+ "md5",
+ "key"
],
"browser": true,
"boss": true,
diff --git a/app/components/travis-cmd.js b/app/components/travis-cmd.js
new file mode 100644
index 00000000..0ce85be2
--- /dev/null
+++ b/app/components/travis-cmd.js
@@ -0,0 +1,82 @@
+import Ember from 'ember';
+import config from 'travis/config/environment';
+
+export default Ember.Component.extend({
+ keyboard: Ember.inject.service(),
+ auth: Ember.inject.service(),
+
+ classNameBindings: ['visible'],
+ classNames: ['travis-cmd'],
+
+ didInsertElement() {
+ this.get('keyboard').bind('t', this.show.bind(this));
+ this.get('keyboard').bind('esc', 'cmd', this.hide.bind(this));
+ },
+
+ show() {
+ this.loadSlugs();
+ this.set('visible', true);
+ this.get('keyboard').setScope('cmd');
+ },
+
+ hide() {
+ this.set('visible', false);
+ this.get('keyboard').setScope(null);
+ this.set('matches', null);
+ this.set('filterString', null);
+ this.set('results', null);
+ },
+
+ loadSlugs() {
+ this.set('loading', true);
+
+ $.ajax(config.apiEndpoint + '/repos/slugs', {
+ headers: {
+ Authorization: 'token ' + this.get('auth').token(),
+ Accept: 'application/json; version=2'
+ }
+ }).then((data) => {
+ this.set('loading', false);
+ this.set('repos', data.repositories);
+ this.onLoad();
+ });
+ },
+
+ onLoad() {
+ setTimeout( () => {
+ this.$('.input').focus();
+ }, 10);
+ },
+
+ actions: {
+ filterChanged(value) {
+ let list = this.get('repos');
+
+ $.ajax("https://repos-filter-production.herokuapp.com/filter?phrase="+value, {
+ headers: { "Authorization": "token " + Travis.lookup('service:auth').token()
+ } }).then((response) => {
+ let repos = response.repositories;
+ repos = repos.sortBy('score').reverse();
+ let matches = repos.slice(0, 10).mapBy('match').map( (match) => match.replace(new RegExp('<|>', 'g'), (match) => match === '<' ? '' : '' ) ).join('
');
+ console.log(matches);
+ this.set('matches', matches);
+ });
+
+ this.set('filterString', value);
+ },
+
+ keypress(event) {
+ if(event.keyCode === 27) {
+ this.hide();
+ } else if(event.keyCode === 13) {
+ let results;
+ if(results = this.get('results')) {
+ if(results[0]) {
+ let slug = results[0].original.slug;
+ console.log(slug);
+ }
+ }
+ }
+ }
+ }
+});
diff --git a/app/services/keyboard.js b/app/services/keyboard.js
new file mode 100644
index 00000000..e758606e
--- /dev/null
+++ b/app/services/keyboard.js
@@ -0,0 +1,13 @@
+import Ember from 'ember';
+
+let KeyboardService = Ember.Service.extend({
+ bind(keyName, scope, callback) {
+ key(...arguments);
+ },
+
+ setScope(scope) {
+ key.setScope(scope);
+ }
+});
+
+export default KeyboardService;
diff --git a/app/styles/app.scss b/app/styles/app.scss
index f848da8c..71327704 100644
--- a/app/styles/app.scss
+++ b/app/styles/app.scss
@@ -32,6 +32,7 @@
@import "app/modules/loading-indicator";
@import "app/modules/build-tile";
@import "app/modules/status-icon";
+@import "app/modules/travis-cmd";
@import "app/animation/tractor";
diff --git a/app/styles/app/modules/travis-cmd.scss b/app/styles/app/modules/travis-cmd.scss
new file mode 100644
index 00000000..de1d3512
--- /dev/null
+++ b/app/styles/app/modules/travis-cmd.scss
@@ -0,0 +1,37 @@
+.travis-cmd {
+ opacity: 0.3;
+ background: #000;
+ width: 100%;
+ height: 100%;
+ z-index: 10;
+ top: 0;
+ left: 0;
+ top: 0;
+ left: 0;
+ position: fixed;
+ display: none;
+
+ .content {
+ opacity: 1;
+ }
+
+ &.visible {
+ display: block;
+ }
+
+ .content {
+ width: 400px;
+ min-height: 60px;
+ background-color: white;
+ border-radius: 10px;
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ }
+
+ .content, .input {
+ color: black;
+ font-size: 20px;
+ }
+}
diff --git a/app/templates/application.hbs b/app/templates/application.hbs
index 47326c47..c6a223df 100644
--- a/app/templates/application.hbs
+++ b/app/templates/application.hbs
@@ -1,3 +1,5 @@
{{#popup-click-handler}}
{{outlet}}
{{/popup-click-handler}}
+
+{{travis-cmd}}
diff --git a/app/templates/components/travis-cmd.hbs b/app/templates/components/travis-cmd.hbs
new file mode 100644
index 00000000..95560083
--- /dev/null
+++ b/app/templates/components/travis-cmd.hbs
@@ -0,0 +1,15 @@
+