Commit e84d17b0 authored by Jeremy Fischer's avatar Jeremy Fischer
Browse files

Add input jmcjs

First changes for #47
parent 48876eca
commons @ 8f9b905c
Subproject commit 1431a1fe884cd03681bf4e492850c8fe0681dcf8
Subproject commit 8f9b905c50e41983d1af21a0efeec465e54dda00
......@@ -25,6 +25,7 @@ function init(){
document.getElementById("overview").style.visibility = "visible";
document.getElementById("details").style.visibility = "visible";
//Load organise module
jmcjs.core.module_load("input");
jmcjs.core.module_load("organise", function() {
//Populate shortcut commands
_xhr = jmcjs.core.xhr;
......
......@@ -6,7 +6,15 @@ var teamData = {};
var current_view = "dashboard";
var sessionManagerURL = "";
window.addEventListener('onhashchange', function(e) {
e.preventDefault();
e.returnValue = '';
jmcjs.events.triggerEvent("nav", window.location.hash.substring(1, window.location.hash.length));
});
//Setup views
overview_init();
details_init();
//Timers and routines, legacy
updateTeamData();
......@@ -15,9 +23,7 @@ setTimeout(updates_check, 10000);
setInterval(sessionKeepAlive, 20000);
setInterval(update_dashboard, 5000);
setInterval(validateSession, 50000);
setInterval(updateNotificationBadge, 10000);
setTimeout(overview_init(), 10);
setTimeout(details_init(), 10);
//setInterval(updateNotificationBadge, 10000);
if (window.location.hash.substring(1, 6) == "graph") {
setTimeout(nav_graph(), 10);
} else if (window.location.hash.substring(1, 12) == "leaderboard") {
......@@ -29,6 +35,7 @@ if (window.location.hash.substring(1, 6) == "graph") {
} else {
setTimeout(nav_dashboard(), 10);
}
jmcjs.events.triggerEvent("nav", window.location.hash.substring(1, window.location.hash.length));
setTimeout(loadGraph, 5);
setInterval(getNews, 3000);
//setTimeout("log_message('Workspace Loading...')",10);
......
......@@ -11,7 +11,7 @@ var draggingNodeOffsetY = 0;
function node_start_drag(event) {
draggingNodeOffsetX = 0;
draggingNodeOffsetY = 0;
if (event.buttons != 1)
if (!(event.buttons == 3 || event.buttons == 4 || (event.buttons == 1 && jmcjs.input.getKeyCodeState(18) == true)))
return;
currentDragNode = "";
if (event.target.id.substring(0, 5) == "node_")
......
......@@ -107,7 +107,7 @@ function initGraph() {
graph.style.left = "-" + (graph.offsetWidth - graphView.offsetWidth) / 2;
graph.style.top = "-" + (graph.offsetHeight - graphView.offsetHeight) / 2;
graphView.onmousedown = function(event) {
if ((event.target == graph || event.target == graphView) && (event.buttons == 3 || event.buttons == 4))
if ((event.target == graph || event.target == graphView) && (event.buttons == 1))
graphMousePressed = true;
document.getElementById("dynamicStyle").innerHTML = '#graph{transition: none;}';
};
......@@ -208,4 +208,20 @@ function initGraph() {
if ( node = window.location.hash.split("/")[1]) {
nodeDetail("node_" + node);
}
}
\ No newline at end of file
}
/*
* MouseMoveEvent->
* are we dragging a node?
* -> nodeDragEvent
* are we moving the graph?
* -> view move event
*/
/*
* MouseWheelEvent
* //check view
* -> zoom event
*/
\ No newline at end of file
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