Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 45 additions and 20 deletions.
  1. +9 −9 priv/js_src/relatio.js
  2. +18 −11 priv/js_src/relatio.world.js
  3. +18 −0 src/relatio_data_handler.erl
View
18 priv/js_src/relatio.js
@@ -108,7 +108,7 @@ sigma.publicPrototype.zoomToNode = function(nid, ratio) {
ratio = 10;
}
- console.log("node {" + node.displayX + ", " + node.displayY + "}");
+//console.log("node {" + node.displayX + ", " + node.displayY + "}");
this.zoomToCoordinates(node.displayX, node.displayY, ratio);
}
@@ -120,7 +120,7 @@ sigma.publicPrototype.zoomToCoordinates = function(displayX, displayY, ratio) {
var m = this._core.mousecaptor;
var s = this._core;
if (!ratio) ratio = m.ratio;
- console.log("Zoom to: ", displayX, ", ", displayY, " with ", ratio);
+//console.log("Zoom to: ", displayX, ", ", displayY, " with ", ratio);
// Different formulas for diffenent cases
if (ratio == m.ratio)
{
@@ -171,7 +171,7 @@ sigma.publicPrototype.pickNode = function(nid) {
break;
default:
- console.error("Unknown type");
+ throw "Unknown type";
}
}
@@ -429,7 +429,7 @@ var Ring = function(size)
* Add an element at the end.
*/
this.add = function(e) {
- console.log("add " + e);
+// console.log("add " + e);
// Move the pointer on the next cell.
currentN++;
@@ -454,7 +454,7 @@ var Ring = function(size)
*/
this.check = function(e) {
// If e is a next element, than save history.
- console.log("check " + e + " " + this.next());
+// console.log("check " + e + " " + this.next());
show();
if ((newestN != currentN) && (e == this.next()))
@@ -462,11 +462,11 @@ var Ring = function(size)
else
this.add(e);
- console.dir(a);
+// console.dir(a);
}
this.go = function(stepCount) {
- console.log("GO TO " + stepCount);
+// console.log("GO TO " + stepCount);
show();
currentN += stepCount;
@@ -599,8 +599,8 @@ var Tip = function(si)
var canvasWidth = si.calculateCanvasWidth(),
canvasHeight = si.calculateCanvasHeight(),
- tipWidth = tip.outerWidth(),
- tipHeight = tip.outerHeight();
+ tipWidth = view.outerWidth(),
+ tipHeight = view.outerHeight();
// Calculate popup position.
// Set X and Y, if the selected node is not on the screen.
View
29 priv/js_src/relatio.world.js
@@ -657,6 +657,22 @@ relatio.initWorld = function() {
}
} // End of the `canvasKeyPressHandler` function.
+
+ $("#search-field").on("keypress.relatioSearchFieldHandler", function(e) {
+ e.stopPropagation();
+ var kc = e.keyCode;
+ var cc = e.charCode;
+
+ switch (kc) {
+ case keyCodes.ENTER:
+ if ($(":focus").attr("id") == "search-field")
+ {
+ $("#search-pane a:visible:first").focus();
+ return false;
+ }
+ break;
+ }
+ });
var panelKeyPressHandler = function(e) {
var m = si._core.mousecaptor;
@@ -679,18 +695,9 @@ relatio.initWorld = function() {
else if (isSearchingSidebarOpen())
closeSearchSidebar();
break;
-
- case keyCodes.ENTER:
- if ($(":focus").attr("id") == "search-field")
- {
- $("#search-pane a:visible:first").focus();
- return false;
- }
- break;
}
if ($("input[type=text]:focus").length)
return true;
-
switch (cc) {
case charCodes.WHITESPACE:
@@ -883,7 +890,7 @@ relatio.initWorld = function() {
default:
if (cc >= charCodes.ZERO && cc <= charCodes.NINE)
repeatCount = repeatCount * 10 + cc - charCodes.ZERO;
- console.log("Key pressed: " + e.keyCode, " Char entered: " + e.charCode);
+// console.log("Key pressed: " + e.keyCode, " Char entered: " + e.charCode);
}
};
@@ -1235,7 +1242,7 @@ relatio.initWorld = function() {
if (json.length != 0){
var data = JSON.parse(json);
var id = data.node_set_id;
- console.log("Save the node set under id = " + id);
+// console.log("Save the node set under id = " + id);
window.location.assign("detail.html?id=" + id);
}
}
View
18 src/relatio_data_handler.erl
@@ -58,13 +58,27 @@ generate_xml(Nodes) ->
Dir1 = "/home/user/erlang/esl/ejabberd/apps/ejabberd",
Dir2 = code:lib_dir(stdlib),
Dir3 = code:lib_dir(kernel),
+ Dir4 = code:lib_dir(mnesia),
+ Dir5 = code:lib_dir(snmp),
+ Dir2s = "/home/user/erlang/otp/lib/stdlib",
+ Dir3s = "/home/user/erlang/otp/lib/kernel",
+ Dir4s = "/home/user/erlang/otp/lib/mnesia",
+ Dir5s = "/home/user/erlang/otp/lib/snmp",
case whereis(inferno_server) of
undefined ->
{ok, Info} = inferno_server:start([]),
inferno_server:add_application(Info, ejabberd, Dir1),
+
+ inferno_server:add_application(Info, stdlib, Dir2s),
+ inferno_server:add_application(Info, kernel, Dir3s),
+ inferno_server:add_application(Info, mnesia, Dir4s),
+ inferno_server:add_application(Info, snmp, Dir5s),
+
inferno_server:add_application(Info, stdlib, Dir2),
inferno_server:add_application(Info, kernel, Dir3),
+ inferno_server:add_application(Info, mnesia, Dir4),
+ inferno_server:add_application(Info, snmp, Dir5),
erlang:register(inferno_server, self()),
Info;
Info ->
@@ -90,12 +104,16 @@ generate_world_xml() ->
Dir1 = "/home/user/erlang/esl/ejabberd/apps/ejabberd",
Dir2 = code:lib_dir(stdlib),
Dir3 = code:lib_dir(kernel),
+ Dir4 = code:lib_dir(mnesia),
+ Dir5 = code:lib_dir(snmp),
case whereis(relatio_world) of
undefined ->
{ok, Xref} = xref:start(relatio_world),
xref:add_application(Xref, Dir1),
xref:add_application(Xref, Dir2),
xref:add_application(Xref, Dir3),
+ xref:add_application(Xref, Dir4),
+ xref:add_application(Xref, Dir5),
Xref;
Xref ->
Xref

No commit comments for this range

Something went wrong with that request. Please try again.