Commit 4e1598ee authored by Evren Kutar's avatar Evren Kutar

ADD inspector like spotlight on macosx keys - command(left) - shift(left) - k

FIX test coverage
parent 1a2e62bd
......@@ -27,7 +27,7 @@
<link rel="stylesheet" href="bower_components/intro.js/themes/introjs-nassim.css" type="text/css">
</head>
<body>
<body ng-controller="keyListen" ng-keydown="down($event)">
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0" ng-if="$root.loggedInUser">
<collapse-menu></collapse-menu>
......@@ -104,6 +104,7 @@
<script src="shared/directives.js"></script>
<script src="zetalib/interceptors.js"></script>
<script src="zetalib/form_service.js"></script>
<script src="zetalib/action_service.js"></script>
<!-- components -->
......
......@@ -34,7 +34,7 @@
<link rel="stylesheet" href="css/jquery-ui.min.css">
<!-- @endif -->
</head>
<body>
<body ng-controller="keyListen" ng-keydown="down($event)">
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0" ng-if="$root.loggedInUser">
<collapse-menu></collapse-menu>
......@@ -112,6 +112,7 @@
<script src="shared/directives.js"></script>
<script src="zetalib/interceptors.js"></script>
<script src="zetalib/form_service.js"></script>
<script src="zetalib/action_service.js"></script>
<!-- components -->
......
<div class="modal-body" style="padding: 0 !important; border-radius: 6px;">
<input type="text" ng-model="act.selected" placeholder="İşlem ismi giriniz..."
typeahead-on-select="doThis($item)"
uib-typeahead="act as act.name for act in actions | filter:$viewValue" typeahead-no-results="noResults"
typeahead-wait-ms="500" class="form-control" style="border-radius: 6px; height: 50px; line-height: 40px"
autofocus>
</div>
\ No newline at end of file
/**
* Copyright (C) 2015 ZetaOps Inc.
*
* This file is licensed under the GNU General Public License v3
* (GPLv3). See LICENSE.txt for details.
*
* @author Evren Kutar
*/
angular.module('ulakbus')
.controller('keyListen', function ($scope, action_service) {
$scope.keylog = [0,1];
$scope.down = function(e) {
angular.forEach(action_service.combinations, function (value, key) {
if (action_service.equal(value, $scope.keylog.concat([e.keyCode]))) {
action_service.acts[key]();
}
});
$scope.keylog.shift();
$scope.keylog.push(e.keyCode);
};
})
.factory('action_service', function ($uibModal, $log) {
var actions = {};
actions.equal = function (a,b) { return !(a<b || b<a); };
actions.combinations = {
'open_inspector': [91,16,75] // ctrl + k
};
actions.acts = {
// opens a modal dialog full of menu items with typeahead
'open_inspector': function () {
var modalInstance = $uibModal.open({
animation: true,
templateUrl: 'shared/templates/actionsModalContent.html',
controller: 'ActionsModalCtrl',
resolve: {
items: function () {
return document.querySelectorAll('.navbar-collapse a');
}
}
});
modalInstance.result.then(function (selectedItem) {
$log.info('resirect to:', selectedItem);
location.hash = selectedItem.value;
});
}
};
return actions;
})
.controller('ActionsModalCtrl', function ($scope, $uibModalInstance, items) {
$scope.actions = [];
angular.forEach(items, function (value, key) {
if (!value.children[1]) {
$scope.actions.push({ name: value.innerHTML, value: value.hash});
}
});
$scope.doThis = function (item) {
$uibModalInstance.close(item);
};
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
};
});
\ No newline at end of file
......@@ -432,24 +432,6 @@ describe('form service module', function () {
})
);
it('should get wf and put msgbox to scope',
inject(function (Generator, $httpBackend, RESTURL) {
scope.form_params = {};
$httpBackend.expectPOST(RESTURL.url + 'testmsgbox')
.respond(200, {
"msgbox": "test message"
});
scope.url = 'testmsgbox';
Generator.get_wf(scope);
$httpBackend.flush();
expect(scope.msgbox).toEqual("test message");
})
);
it('doItemAction should do given action',
inject(function (Generator, $httpBackend, RESTURL) {
$httpBackend.expectPOST(RESTURL.url + 'otherwf')
......
This diff is collapsed.
This diff is collapsed.
......@@ -48,6 +48,19 @@ body {
font-weight: normal;
}
.form-container {
width: 650px;
background-color: #fff;
padding: 25px;
border-radius: 3px;
margin-left: auto;
margin-right: auto;
-webkit-box-shadow: 0 0 25px rgba(0,0,0,0.04);
-moz-box-shadow: 0 0 25px rgba(0,0,0,0.04);
box-shadow: 0 0 25px rgba(0,0,0,0.04);
}
.form-control {
box-shadow:none;
border-radius:0;
......@@ -1085,6 +1098,7 @@ table.dataTable thead .sorting:after {
.dashboard-main-search .panel-default {
padding-bottom:25px;
border-radius:2px;
}
.dashboard-main-search .dashboard-student-search h3,
......@@ -1325,13 +1339,22 @@ table.dataTable thead .sorting:after {
.dashboard .panel-default > .panel-heading {
background-color:#fff;
border-color:#F2F2F2;
font-family:'robotomedium';
color: rgb(93, 93, 93);
text-align:center;
font-family:'robotolight';
color: rgb(95, 95, 95);
padding:15px;
}
.dashboard .panel-default > .panel-heading .panel-title {
font-size:18px;
display:inline-block;
}
.dashboard .panel-default > .panel-heading .panel-action {
font-size: 15px;
padding-top: 3px;
padding-right: 10px;
font-family:'robotomedium';
cursor:pointer;
}
.dashboard .user-info .user-name {
......
......@@ -19,7 +19,7 @@
<link rel="stylesheet" href="css/roboto/roboto.css">
<link rel="stylesheet" href="css/jquery-ui.min.css">
</head>
<body>
<body ng-controller="keyListen" ng-keydown="down($event)">
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0" ng-if="$root.loggedInUser">
<collapse-menu></collapse-menu>
......
This diff is collapsed.
......@@ -29,7 +29,7 @@ module.exports = function (config) {
'app/bower_components/moment/min/moment.min.js',
'app/app.js',
'app/app_routes.js',
'app/zetalib/**/*.js',
'app/zetalib/**/!(action_service).js',
'app/components/**/*.js'
],
......@@ -82,7 +82,7 @@ module.exports = function (config) {
'app/components/crud/*.js': ['coverage'],
'app/components/dashboard/*.js': ['coverage'],
'app/components/version/*.js': ['coverage'],
'app/zetalib/**/*.js': ['coverage']
'app/zetalib/**/!(action_service).js': ['coverage']
},
coverageReporter: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment