+
+
+
+
-
= ($scope.filteredSnippets.length -1)) {
+ if ($scope.selectIndex >= ($scope.filteredSnippets.length - 1)) {
return
}
selectItem(++$scope.selectIndex)
}
function selectPriorItem () {
- if ($scope.selectIndex == 0) {
+ if ($scope.selectIndex === 0) {
focusSearchInput()
return
}
selectItem(--$scope.selectIndex)
}
+ // Focusing control
+ $scope.isFocusing = 0
+
function focusSearchInput () {
$scope.isFocusing = SEARCH_INPUT
document.getElementById('search-input').focus()
+
+ $scope.controlIndex = 0
}
+ $scope.focusSearchInput = focusSearchInput
function focusList () {
$scope.isFocusing = RESULT_LIST
document.getElementById('search-input').blur()
+
+ $scope.controlIndex = 0
}
$scope.focusList = focusList
- function focusDetail () {
- $scope.isFocusing = RESULT_DETAIL
- }
-
- function hidePopUp () {
- remote.getCurrentWindow().hide()
- }
-})
-.directive('resultItem', function () {
- return {
- link: function (scope, el, attr) {
-
+ function focusControl () {
+ if ($scope.controlIndex === 0) {
+ $scope.controlIndex = 1
}
+ $scope.isFocusing = RESULT_CONTROL
+ }
+ $scope.focusControl = focusControl
+
+ function focusContent () {
+ angular.element(aceView).scope().focus()
+ $scope.isFocusing = RESULT_CONTENT
+ }
+
+ $scope.controlIndex = 0
+
+ function nextControl () {
+ if ($scope.controlIndex === 3) {
+ $scope.controlIndex = 0
+ focusContent()
+ return
+ }
+ $scope.controlIndex ++
+ }
+
+ function priorControl () {
+ if ($scope.controlIndex === 1) {
+ focusList()
+ return
+ }
+ $scope.controlIndex --
}
})
.directive('searchInput', function () {
diff --git a/electron_src/popup/popup.scss b/electron_src/popup/popup.scss
index ef1e8856..eeb9b6a0 100644
--- a/electron_src/popup/popup.scss
+++ b/electron_src/popup/popup.scss
@@ -21,7 +21,7 @@ $focused-shadow-color: $brand-primary;
bottom: 0;
width: 100%;
overflow: hidden;
- .result-list{
+ .left-pane{
margin: 0;
position: absolute;
left: 0;
@@ -30,6 +30,9 @@ $focused-shadow-color: $brand-primary;
width: 40%;
overflow-y: auto;
overflow-x: hidden;
+
+ }
+ .result-list{
list-style:none;
padding: 0;
&.focused{
@@ -52,10 +55,7 @@ $focused-shadow-color: $brand-primary;
}
border-right: 1px solid $border-color;
}
- .result-detail{
- &.focused{
- border: solid 1px $brand-primary;
- }
+ .right-pane{
position: absolute;
left: 40%;
top: 0;
@@ -63,12 +63,20 @@ $focused-shadow-color: $brand-primary;
width: 60%;
overflow-y: auto;
overflow-x: hidden;
- .result-detail-cotent{
- position: absolute;
- top: 34px;
- bottom: 0;
- width: 100%;
- }
+
+ }
+
+ .result-detail-control{
+ position: absolute;
+ top: 0;
+ width: 100%;
+ height: 34px;
+ }
+ .result-detail-content{
+ position: absolute;
+ top: 34px;
+ bottom: 0;
+ width: 100%;
}
}
diff --git a/icon.png b/icon.png
new file mode 100644
index 00000000..c26ad86d
Binary files /dev/null and b/icon.png differ
diff --git a/main.js b/main.js
index f1106629..3e13070f 100644
--- a/main.js
+++ b/main.js
@@ -12,7 +12,12 @@ app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})
+var Tray = require('tray')
+var appIcon = null
+
app.on('ready', function () {
+ appIcon = new Tray('./icon.png')
+ appIcon.setToolTip('This is my application.')
mainWindow = new BrowserWindow({width: 800, height: 600})
diff --git a/src/directives/ui-ace.js b/src/directives/ui-ace.js
index f50ee49c..cc45e323 100644
--- a/src/directives/ui-ace.js
+++ b/src/directives/ui-ace.js
@@ -332,6 +332,12 @@ angular.module('ui.ace', [])
scope.Infinity = -1
+ scope.focus = function () {
+ acee.focus()
+ }
+
+ scope.addCommand = acee.commands.addCommand
+
}
};
}]);