added shift+click and ability to take different kinds of actions on selected nodes and edges

This commit is contained in:
Connor Turland 2013-01-07 00:17:39 -05:00
parent 9dabcb7fc1
commit ea54bacea3
153 changed files with 196 additions and 17 deletions

View file

@ -409,18 +409,18 @@ var nodeSettings = {
}
function selectEdgeOnClickHandler(adj, e) {
var showDesc = adj.getData("showDesc");
if (showDesc) {
deselectEdge(adj);
Mconsole.plot();
}
if (!e.shiftKey) {
for (var i = 0; i < selectedEdges.length; i += 1) {
var edge = selectedEdges[i];
deselectEdge(edge);
}
}
var showDesc = adj.getData("showDesc");
if (showDesc) {
deselectEdge(adj);
Mconsole.plot();
} else if (!showDesc) {
if (!showDesc) {
selectEdge(adj);
Mconsole.plot();
}
@ -703,7 +703,7 @@ function onCreateLabelHandler(domElement, node) {
var littleHTML = ' \
<div class="label">$_name_$</div> \
<div class="nodeOptions">';
if (userid == null && node.id != Mconsole.root) {
if ((userid == null || mapid == null) && node.id != Mconsole.root) {
littleHTML += ' \
<span class="removeFromCanvas" \
onclick="removeFromCanvas($_id_$)" \
@ -716,10 +716,10 @@ function onCreateLabelHandler(domElement, node) {
onclick="removeFromCanvas($_id_$)" \
title="Click to remove topic from canvas"> \
</span> \
<a href="/mappings/$_mapid_$/$_id_$/removefrommap" \
<a href="/topics/$_mapid_$/$_id_$/removefrommap" \
title="Click to remove topic from map" \
class="removeFromMap" \
data-method="get" \
data-method="post" \
data-remote="true" \
rel="nofollow"> \
</a>';
@ -903,7 +903,7 @@ function removeSelectedEdges() {
//delete mapping of id mapid
$.ajax({
type: "POST",
url: "/mappings/" + mapid + "/" + id + "/removefrommap",
url: "/synapses/" + mapid + "/" + id + "/removefrommap",
});
}
hideEdge(edge);
@ -966,3 +966,33 @@ function deselectEdge(edge) {
}
selectedEdges.splice(selectedEdges.indexOf(edge), 1);
}
function hideSelectedNodes() {
Mconsole.graph.eachNode( function (n) {
if (n.data.$onCanvas == true && n.id != Mconsole.root) {
removeFromCanvas(n.id);
}
});
}
function removeSelectedNodes() {
Mconsole.graph.eachNode( function (n) {
if (n.data.$onCanvas == true && n.id != Mconsole.root) {
$.ajax({
type: "POST",
url: "/topics/" + mapid + "/" + n.id + "/removefrommap",
});
}
});
}
function deleteSelectedNodes() {
Mconsole.graph.eachNode( function (n) {
if (n.data.$onCanvas == true && n.id != Mconsole.root) {
$.ajax({
type: "DELETE",
url: "/topics/" + n.id,
});
}
});
}

View file

@ -1,7 +1,7 @@
<div class="headertop">
<button onclick="hideSelectedEdges();">Hide Selected</button>
<button onclick="hideSelectedEdges();hideSelectedNodes();">Hide Selected</button>
<% if authenticated? %>
<button onclick="deleteSelectedEdges();">Permanently Delete Selected</button>
<button onclick="var r=confirm('Are you sure you want to permanently delete selected objects?!'); if (r == true) {deleteSelectedEdges();deleteSelectedNodes();}">Permanently Delete Selected</button>
<button onclick="saveToMap();">Save to Map</button>
<% end %>
<button onclick='clearCanvas();'>Clear Canvas</button>

View file

@ -24,10 +24,10 @@
<div class="headertop">
<button onclick="if (!goRealtime) { this.innerHTML = 'Stop Realtime'; $('#saveLayout').css('display','none');} else if (goRealtime) { this.innerHTML = 'Start Realtime'; $('#saveLayout').css('display','block');} goRealtime = !goRealtime;">Start Realtime</button>
<button onclick="hideSelectedEdges();">Hide Selected</button>
<button onclick="hideSelectedEdges();hideSelectedNodes();">Hide Selected</button>
<% if authenticated? %>
<button onclick="removeSelectedEdges();">Remove Selected From Map</button>
<button onclick="deleteSelectedEdges();">Permanently Delete Selected</button>
<button onclick="removeSelectedEdges();removeSelectedNodes();">Remove Selected From Map</button>
<button onclick="var r=confirm('Are you sure you want to permanently delete selected objects?!'); if (r == true) {deleteSelectedEdges();deleteSelectedNodes();}">Permanently Delete Selected</button>
<% if (@map.permission == "commons" && authenticated?) || @map.user == user %>
<%= form_for @map, :url => savelayout_path(@map), :html => { :class => "saveMapLayout", :id => "saveMapLayout"}, remote: true do |form| %>
<%= form.hidden_field "coordinates", :value => "" %>

View file

@ -10,8 +10,8 @@ ISSAD::Application.routes.draw do
match 'maps/:id/savelayout', to: 'maps#savelayout', via: :put, as: :savelayout
match 'maps/:id/realtime', to: 'maps#realtime', via: :get, as: :realtime
match 'mappings/:map_id/:topic_id/removefrommap', to: 'topics#removefrommap', via: :get, as: :removefrommap
match 'mappings/:map_id/:synapse_id/removefrommap', to: 'synapses#removefrommap', via: :post, as: :removefrommap
match 'topics/:map_id/:topic_id/removefrommap', to: 'topics#removefrommap', via: :post, as: :removefrommap
match 'synapses/:map_id/:synapse_id/removefrommap', to: 'synapses#removefrommap', via: :post, as: :removefrommap
resource :session

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
public/assets/action.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/activity.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/argument.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
public/assets/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/bizarre.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
public/assets/black_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
public/assets/catalyst.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/closed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
public/assets/con_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/decision.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/assets/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
public/assets/foresight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/futuredev.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
public/assets/go-arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/idea.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
public/assets/insight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/intention.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/assets/junto.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

BIN
public/assets/knowledge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/list.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
public/assets/location.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

View file

@ -0,0 +1,73 @@
---
action.png: action-02bd981b8466a7b2cb167afffc284703.png
activity.png: activity-27aedb9b5baea69ea88f1f2b5303862c.png
argument.png: argument-0b523f319bce9cc9f2f08b4e39429e6d.png
background.jpg: background-2fcc9f96ace4764a02278ada04bc0d9d.jpg
background2-for-repeating.jpg: background2-for-repeating-8d022369a362b364c9395039167f1ffd.jpg
background2.jpg: background2-c2b46d9ebc7d31aea8135e3c505aa1e9.jpg
bg.png: bg-eea3f1ec61623cbc3833f8fcbf114bf8.png
bizarre.png: bizarre-4154e4b7b2e0169cfc4af24c32119305.png
black_bg.png: black_bg-26d4542c5932f6c4ece93b0a27f9b8de.png
catalyst.png: catalyst-21e04cdb0f34140b3e00d0b98aca240c.png
closed.png: closed-11f6970ed42d52bc9352fa8860ab7479.png
con_icon.png: con_icon-f2f77ebe92f9ae974d01c8dacd6a070c.png
decision.png: decision-c6f539e7d36589c49f7c177b807ab186.png
delete.png: delete-8346a9c7cd774a4b59f20705e65fef93.png
example.png: example-ee8413ab6bfbd75e35f9dc44d1acd3a2.png
experience.png: experience-9b77160b960af96d7289e30bb6ddb2ce.png
foresight.png: foresight-cc773b1b576ae7ffa5563a6a67c8cf4c.png
futuredev.png: futuredev-e3c62458cfd457b0501dddc6d9b2d8d4.png
go-arrow-2.png: go-arrow-2-8764298d4f3bef64c1df86c12301a666.png
go-arrow.png: go-arrow-a6053323760f32056d368796d4411a61.png
goodpractice.png: goodpractice-f414477faf83067a6c120344db56563a.png
group.png: group-70155e13e72ec389d64a4f80a8d62d24.png
idea.png: idea-a829cd20fc47bba7cde2b67882924be3.png
implication.png: implication-652ece8bc0b1060dd5ca0756393cf21e.png
insight.png: insight-858ccca7357b37837a257e0202319b27.png
intention.png: intention-a487d116bfcf64c7ac559ef89ed61544.png
junto.png: junto-3bca283ec5fe80ef34d6a888b7c676b4.png
knowledge.png: knowledge-eb4b1dc4412b210c286b934737b04f80.png
list.png: list-2f03402c790901a3d999e8e4f66ad33c.png
location.png: location-e1642892214a5cb4b2891f3837f437de.png
map.png: map-d20581fb798f43034a243c27f153b88e.png
minus.png: minus-2b44e91f7c84730925351c83f32a784e.png
moviemap.png: moviemap-b65a3ef344dd7b8c2e28963ac85f17f7.png
note.png: note-7305031a3a47f3b6b8d80a497416a4ac.png
openissue.png: openissue-d9c50446b2dbd0587942ae298bda2a75.png
opinion.png: opinion-300b4a0cf37edf5c94d6681a906faf56.png
opportunity.png: opportunity-4fe7c2f4f5cbe678058c76924ec43a7f.png
person.png: person-2cb4eace780426c21c109ca6475431ce.png
platform.png: platform-29f4dc32fb5f2a9f369b92d2f51ba005.png
pro.png: pro-d20b7ab030f19747f17afbd7fa4fd891.png
problem.png: problem-d660aa3522f737dfd25487937bed6db1.png
question.png: question-bf730ef7455bc8027ea65e8a6d713f32.png
reference.png: reference-67c1f843f8a1ac1b6e23e80b29114bd7.png
removeFromCanvas.png: removeFromCanvas-9d4aea13df00df3dab36be4f7485af82.png
removeFromMap.png: removeFromMap-e976aad0b6b9297e2a673b51a242e07a.png
requirement.png: requirement-d200e129a41fff36f64111f554abea72.png
research.png: research-d01556b43c0c331aa60c17a3926e3a47.png
resource.png: resource-4017b1e9535d80d205ceff916930cf5d.png
role.png: role-c474b1fcb4b4f836e7ca0db67e744dc3.png
spinner.gif: spinner-3dc049c5763846dcf9ff6cab669b2b87.gif
task.png: task-0ac599d122a709a5e73990f1745019e0.png
tool.png: tool-99b35794f8ea7c858ee89c062555505a.png
topbg.png: topbg-eb18f5cf8dcfaf7dfd7e47f503956a5d.png
topbg2.png: topbg2-f9640f6cb183bb610d0954c7759ecc23.png
trajectory.png: trajectory-a7c520e746d4c1ffe401805b3d0cb6cd.png
ui-bg_flat_0_aaaaaa_40x100.png: ui-bg_flat_0_aaaaaa_40x100-a1eb3e0764573ed4b261ca742ed96ac3.png
ui-bg_flat_75_ffffff_40x100.png: ui-bg_flat_75_ffffff_40x100-841636c8f8d33987bb8d2f31e8ef92ca.png
ui-bg_glass_55_fbf9ee_1x400.png: ui-bg_glass_55_fbf9ee_1x400-bbb04adbe79f471d8c88a2bc691231b6.png
ui-bg_glass_65_ffffff_1x400.png: ui-bg_glass_65_ffffff_1x400-a30aa544902182c133dbb46ac40a08d2.png
ui-bg_glass_75_dadada_1x400.png: ui-bg_glass_75_dadada_1x400-38ed9f33e066d6bee977c567d4b03650.png
ui-bg_glass_75_e6e6e6_1x400.png: ui-bg_glass_75_e6e6e6_1x400-3e20bce1b7b2f5dd47ca6ac361805162.png
ui-bg_glass_95_fef1ec_1x400.png: ui-bg_glass_95_fef1ec_1x400-c723e9a2b50006c6054836a10b76bb84.png
ui-bg_highlight-soft_75_cccccc_1x100.png: ui-bg_highlight-soft_75_cccccc_1x100-081f36ef02c9233c6db45d2d566fbecd.png
ui-icons_222222_256x240.png: ui-icons_222222_256x240-4ffd13be9750b79d62db5d2f9670150c.png
ui-icons_2e83ff_256x240.png: ui-icons_2e83ff_256x240-94086d0ce953eb0887ab1b8140903af9.png
ui-icons_454545_256x240.png: ui-icons_454545_256x240-db2a5b254322e84a22f467b70714c5e8.png
ui-icons_888888_256x240.png: ui-icons_888888_256x240-6dd8599dbdeb6e2103570075622a8bd1.png
ui-icons_cd0a0a_256x240.png: ui-icons_cd0a0a_256x240-8b44e266bdc1f57f1393579591f89222.png
wildcard.png: wildcard-e70c8b4fbcb7419c2f7f6e7e1320848e.png
application.js: application-519550f7d7b79cffe8ecd76c440a8761.js
scroll/mCSB_buttons.png: scroll/mCSB_buttons-6eb1e766df3b6b28f5cb2a218697658f.png
application.css: application-2d5d1091563bf458973bf9166950b679.css

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/assets/minus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/moviemap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
public/assets/note.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/openissue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/opinion.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

BIN
public/assets/person.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
public/assets/platform.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
public/assets/pro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/problem.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/assets/question.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
public/assets/reference.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Some files were not shown because too many files have changed in this diff Show more