diff --git a/pandora_console/images/maps/head_arrow.svg b/pandora_console/images/maps/head_arrow.svg index 1f4939c6fe..09fb56393f 100644 --- a/pandora_console/images/maps/head_arrow.svg +++ b/pandora_console/images/maps/head_arrow.svg @@ -8,19 +8,19 @@ xmlns:xlink="http://www.w3.org/1999/xlink"> - + diff --git a/pandora_console/images/maps/square_selection.svg b/pandora_console/images/maps/square_selection.svg new file mode 100644 index 0000000000..7970eaae64 --- /dev/null +++ b/pandora_console/images/maps/square_selection.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/pandora_console/include/class/Map.class.php b/pandora_console/include/class/Map.class.php index f0828d30bc..284cbfaf9f 100644 --- a/pandora_console/include/class/Map.class.php +++ b/pandora_console/include/class/Map.class.php @@ -100,197 +100,197 @@ abstract class Map { public function writeJSGraph() { -$this->nodes = json_decode('[ -{ - "graph_id": "165", - "id": "17", - "type": 0, - "x": 1033.4, - "y": 806.38 -}, -{ - "graph_id": "166", - "id": "198", - "type": 1, - "x": 1119.5, - "y": 847.85 -}, -{ - "graph_id": 208, - "type": 2 -}, -{ - "graph_id": "169", - "id": "207", - "type": 1, - "x": 947.33, - "y": 764.91 -}, -{ - "graph_id": 209, - "type": 2 -}, -{ - "graph_id": "179", - "id": "27", - "type": 0, - "x": 159.23, - "y": 1005.9 -}, -{ - "graph_id": "180", - "id": "223", - "type": 1, - "x": 218.82, - "y": 931.19 -}, -{ - "graph_id": "183", - "id": "89", - "type": 0, - "x": 516.77, - "y": 557.57 -}, -{ - "graph_id": "184", - "id": "418", - "type": 1, - "x": 430.66, - "y": 599.03 -}, -{ - "graph_id": "196", - "id": "412", - "type": 1, - "x": 602.88, - "y": 516.1 -}, -{ - "graph_id": 212, - "type": 2 -}, -{ - "graph_id": 213, - "type": 2 -}, - - - - - - -{ - "graph_id": 214, - "id": 666, - "type": 0, - "x": 300, - "y": 300 -}, -{ - "graph_id": 215, - "id": 999, - "type": 0, - "x": 300, - "y": 100 -}, -{ - "graph_id": 216, - "id": 999, - "type": 0, - "x": 300, - "y": 500 -}, -{ - "graph_id": 217, - "id": 666, - "type": 0, - "x": 100, - "y": 300 -}, -{ - "graph_id": 218, - "id": 666, - "type": 0, - "x": 500, - "y": 300 -}, -{ - "graph_id": 219, - "id": 666, - "type": 0, - "x": 500, - "y": 100 -}, -{ - "graph_id": 220, - "id": 666, - "type": 0, - "x": 500, - "y": 500 -}, -{ - "graph_id": 221, - "id": 666, - "type": 0, - "x": 100, - "y": 100 -}, -{ - "graph_id": 222, - "id": 666, - "type": 0, - "x": 100, - "y": 500 -}, -{ - "graph_id": 400, - "type": 2 -}, -{ - "graph_id": 401, - "type": 2 -}, -{ - "graph_id": 402, - "type": 2 -}, -{ - "graph_id": 403, - "type": 2 -}, -{ - "graph_id": 404, - "type": 2 -}, -{ - "graph_id": 405, - "type": 2 -}, -{ - "graph_id": 406, - "type": 2 -}, -{ - "graph_id": 407, - "type": 2 -} -]', true); - -$this->edges = json_decode( -'[ -{"to":"215","from":"214","graph_id":400}, -{"to":"216","from":"214","graph_id":401}, -{"to":"217","from":"214","graph_id":402}, -{"to":"218","from":"214","graph_id":403} -]', true); - -$this->edges = json_decode( -'[ -{"to":"219","from":"214","graph_id":404}, -{"to":"220","from":"214","graph_id":405}, -{"to":"221","from":"214","graph_id":406}, -{"to":"222","from":"214","graph_id":407} -]', true); +//~ $this->nodes = json_decode('[ +//~ { + //~ "graph_id": "165", + //~ "id": "17", + //~ "type": 0, + //~ "x": 1033.4, + //~ "y": 806.38 +//~ }, +//~ { + //~ "graph_id": "166", + //~ "id": "198", + //~ "type": 1, + //~ "x": 1119.5, + //~ "y": 847.85 +//~ }, +//~ { + //~ "graph_id": 208, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": "169", + //~ "id": "207", + //~ "type": 1, + //~ "x": 947.33, + //~ "y": 764.91 +//~ }, +//~ { + //~ "graph_id": 209, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": "179", + //~ "id": "27", + //~ "type": 0, + //~ "x": 159.23, + //~ "y": 1005.9 +//~ }, +//~ { + //~ "graph_id": "180", + //~ "id": "223", + //~ "type": 1, + //~ "x": 218.82, + //~ "y": 931.19 +//~ }, +//~ { + //~ "graph_id": "183", + //~ "id": "89", + //~ "type": 0, + //~ "x": 516.77, + //~ "y": 557.57 +//~ }, +//~ { + //~ "graph_id": "184", + //~ "id": "418", + //~ "type": 1, + //~ "x": 430.66, + //~ "y": 599.03 +//~ }, +//~ { + //~ "graph_id": "196", + //~ "id": "412", + //~ "type": 1, + //~ "x": 602.88, + //~ "y": 516.1 +//~ }, +//~ { + //~ "graph_id": 212, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 213, + //~ "type": 2 +//~ }, +//~ +//~ +//~ +//~ +//~ +//~ +//~ { + //~ "graph_id": 214, + //~ "id": 666, + //~ "type": 0, + //~ "x": 300, + //~ "y": 300 +//~ }, +//~ { + //~ "graph_id": 215, + //~ "id": 999, + //~ "type": 0, + //~ "x": 300, + //~ "y": 100 +//~ }, +//~ { + //~ "graph_id": 216, + //~ "id": 999, + //~ "type": 0, + //~ "x": 300, + //~ "y": 500 +//~ }, +//~ { + //~ "graph_id": 217, + //~ "id": 666, + //~ "type": 0, + //~ "x": 100, + //~ "y": 300 +//~ }, +//~ { + //~ "graph_id": 218, + //~ "id": 666, + //~ "type": 0, + //~ "x": 500, + //~ "y": 300 +//~ }, +//~ { + //~ "graph_id": 219, + //~ "id": 666, + //~ "type": 0, + //~ "x": 500, + //~ "y": 100 +//~ }, +//~ { + //~ "graph_id": 220, + //~ "id": 666, + //~ "type": 0, + //~ "x": 500, + //~ "y": 500 +//~ }, +//~ { + //~ "graph_id": 221, + //~ "id": 666, + //~ "type": 0, + //~ "x": 100, + //~ "y": 100 +//~ }, +//~ { + //~ "graph_id": 222, + //~ "id": 666, + //~ "type": 0, + //~ "x": 100, + //~ "y": 500 +//~ }, +//~ { + //~ "graph_id": 400, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 401, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 402, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 403, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 404, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 405, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 406, + //~ "type": 2 +//~ }, +//~ { + //~ "graph_id": 407, + //~ "type": 2 +//~ } +//~ ]', true); +//~ +//~ $this->edges = json_decode( +//~ '[ +//~ {"to":"215","from":"214","graph_id":400}, +//~ {"to":"216","from":"214","graph_id":401}, +//~ {"to":"217","from":"214","graph_id":402}, +//~ {"to":"218","from":"214","graph_id":403} +//~ ]', true); +//~ +//~ $this->edges = json_decode( +//~ '[ +//~ {"to":"219","from":"214","graph_id":404}, +//~ {"to":"220","from":"214","graph_id":405}, +//~ {"to":"221","from":"214","graph_id":406}, +//~ {"to":"222","from":"214","graph_id":407} +//~ ]', true); //~ $this->edges = json_decode( @@ -298,17 +298,17 @@ $this->edges = json_decode( //~ {"to":"215","from":"214","graph_id":400} //~ ]', true); -$this->edges = json_decode( -'[ -{"to":"215","from":"214","graph_id":400}, -{"to":"216","from":"214","graph_id":401}, -{"to":"217","from":"214","graph_id":402}, -{"to":"218","from":"214","graph_id":403}, -{"to":"219","from":"214","graph_id":404}, -{"to":"220","from":"214","graph_id":405}, -{"to":"221","from":"214","graph_id":406}, -{"to":"222","from":"214","graph_id":407} -]', true); +//~ $this->edges = json_decode( +//~ '[ +//~ {"to":"215","from":"214","graph_id":400}, +//~ {"to":"216","from":"214","graph_id":401}, +//~ {"to":"217","from":"214","graph_id":402}, +//~ {"to":"218","from":"214","graph_id":403}, +//~ {"to":"219","from":"214","graph_id":404}, +//~ {"to":"220","from":"214","graph_id":405}, +//~ {"to":"221","from":"214","graph_id":406}, +//~ {"to":"222","from":"214","graph_id":407} +//~ ]', true); //~ $this->edges = json_decode('[{"to":"165","from":"166","graph_id":208}]', true); diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index 8fc96cc29b..2af6f583a3 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -340,6 +340,34 @@ MapController.prototype.move_arrow = function (id_from_any_point_arrow) { }); } +MapController.prototype.paint_resize_square = function(item, wait) { + if (typeof(wait) === "undefined") + wait = 1; + + var count_files = 1; + function wait_load(callback) { + count_files--; + + if (count_files == 0) { + callback(); + } + } + + switch (wait) { + /*---------------------------------------------*/ + /*-------- Preload head and body arrow --------*/ + /*---------------------------------------------*/ + case 1: + arrow_layout = arrow_layout.append("g") + .attr("class", "arrow_position_rotation") + .append("g") + .attr("class", "arrow_translation") + .append("g") + .attr("class", "arrow_container"); + break; + } +} + /** * Function init_events * Return boolean @@ -355,6 +383,12 @@ MapController.prototype.init_events = function(principalObject) { self.openNodeDetais(self, elm); } }, + { + title: 'Resize', + action: function(elm, d, i) { + self.paint_resize_square(d); + } + }, { title: 'Edit', action: function(elm, d, i) { @@ -375,6 +409,12 @@ MapController.prototype.init_events = function(principalObject) { action: function(elm, d, i) { console.log('Edit map!!'); } + }, + { + title: 'Save map', + action: function(elm, d, i) { + console.log('Save map!!'); + } } ];