Commit 53889c21 authored by Marc Duez's avatar Marc Duez

shortcut.js : add some shortcut (next/previous/save/admin) / fix mac shortcut

parent bd4ffb76
......@@ -67,7 +67,7 @@
<script type="text/javascript" src='js/database.js'></script>
<script type="text/javascript" src='js/conf.js'></script>
<script type="text/javascript" src='js/stats.js'></script>
<script type="text/javascript" src='js/shortcut.js'></script>
</head>
......
......@@ -660,7 +660,7 @@ List.prototype = {
},
clickList: function (e, cloneID) {
if (!e.ctrlKey) this.m.unselectAll()
if (!(e.ctrlKey || e.metaKey)) this.m.unselectAll()
this.m.select(cloneID)
},
......
......@@ -61,10 +61,6 @@ if (typeof config != 'undefined') {
if (typeof config.use_database != 'undefined' && config.use_database){
$("#db_menu").css("display", "");
}
if (config.debug_mode) {
$("#debug_menu").css("display", "");
}
}
......@@ -87,6 +83,7 @@ if (config.use_database) var db = new Database("plop!", DB_ADDRESS);
/* Stat object
*/
var stats = new Stats(sp);
var shortcut = new Shortcut()
/* Add view in the model -> Alignment button
*/
......@@ -111,18 +108,4 @@ if (location.search != ''){
myConsole.popupMsg(myConsole.msg.welcome)
}
/*Statements and functions which allows to active the ALT key, and the movement of the SVG frame*/
document.onkeydown = keydown;
document.onkeyup = keyup;
function keydown(evt) {
if (evt.altKey && sp.reinit) {
sp.active_move = true;
}
}
function keyup(evt) {
sp.active_move = false;
}
initTag();//TODO a enlever
......@@ -1792,7 +1792,7 @@ ScatterPlot.prototype = {
.attr("height", 0)
this.active_selector = false;
if (!d3.event.ctrlKey) this.m.unselectAll()
if (!(d3.event.ctrlKey || d3.event.metakey)) this.m.unselectAll()
this.m.multiSelect(nodes_selected)
}
}
......
......@@ -245,7 +245,7 @@ Segment.prototype = {
var self = this;
var align = document.getElementById("align");
if (align != null) {
if (this.m.getSelected.length > 1) {
if (this.m.getSelected().length > 1) {
align.className = "button";
align.onclick = function() {self.align();};
}
......
/*
* This file is part of "Vidjil" <http://bioinfo.lifl.fr/vidjil>, V(D)J repertoire browsing and analysis
* Copyright (C) 2014 by Carette Antonin <antonin.carette@etudiant.univ-lille1.fr> and the Vidjil Team
* Bonsai bioinformatics at LIFL (UMR CNRS 8022, Université Lille) and Inria Lille
*
* "Vidjil" is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* "Vidjil" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with "Vidjil". If not, see <http://www.gnu.org/licenses/>
*/
function Shortcut () {
this.init()
}
Shortcut.prototype = {
init : function () {
var self = this
document.onkeydown = function (e) { self.checkKey(e); }
document.onkeyup = function (e) { sp.active_move = false; }
},
checkKey : function (e) {
e = e || window.event;
e.preventDefault()
var key = e.keyCode;
if (key==0) key = e.which
switch(key) {
case 37 : //left arrow
m.previousTime()
break;
case 39 : //right arrow
m.nextTime()
break;
case 83 : //ctrl+s
if (e.ctrlKey || e.metakey) db.save_analysis()
break;
case 65 : //ctrl+a
if (e.ctrlKey || e.metakey){
var d_m = $("#debug_menu")
if (d_m.css("display") == "none"){
$("#debug_menu").css("display", "");
}else{
$("#debug_menu").css("display", "none");
}
}
default:
}
if (e.altKey && sp.reinit) {
sp.active_move = true;
}
}
}
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