mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-21 20:31:00 +02:00
"Fixing" GUI key handling.
Change-Id: Ia610fc787aee12f773ab8bbe85628a7c5f5bdb10
This commit is contained in:
parent
590d93aeb6
commit
fe1f01af30
@ -34,6 +34,23 @@
|
||||
viewGestures: []
|
||||
};
|
||||
|
||||
var eegg = '', eeggMax = 'shiftONOS', eeggMin = 'shiftO';
|
||||
|
||||
function layEgg(lastKey) {
|
||||
eegg += lastKey;
|
||||
if (eeggMax.indexOf(eegg) == 0) {
|
||||
if (eeggMax == eegg) {
|
||||
d3.select('body').append('div').attr('id', 'eegg').append('img').attr('src', 'data/img/eegg.png');
|
||||
setTimeout(function () { d3.select('#eegg').remove(); }, 3000);
|
||||
eegg = '';
|
||||
}
|
||||
return true;
|
||||
} else if (eeggMin != eegg) {
|
||||
eegg = '';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function whatKey(code) {
|
||||
switch (code) {
|
||||
case 13: return 'enter';
|
||||
@ -81,6 +98,8 @@
|
||||
d3.event.stopPropagation();
|
||||
|
||||
if (enabled) {
|
||||
if (layEgg(key)) return;
|
||||
|
||||
// global callback?
|
||||
if (gcb && gcb(token, key, keyCode, event)) {
|
||||
// if the event was 'handled', we are done
|
||||
|
@ -58,3 +58,15 @@ body.dark {
|
||||
.dark #view h2 {
|
||||
color: #CE5650;
|
||||
}
|
||||
|
||||
#eegg {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
box-shadow: 2px 2px 24px 5px #888;
|
||||
background-color: #eee;
|
||||
margin: 0px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
BIN
web/gui/src/main/webapp/data/img/eegg.png
Normal file
BIN
web/gui/src/main/webapp/data/img/eegg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 616 KiB |
Loading…
x
Reference in New Issue
Block a user