update keyboard shortcuts to Ctrl+E, Ctrl+R, and Ctrl+T, and update docs

This commit is contained in:
Devin Howard 2016-08-08 21:34:27 +08:00
parent 5e9e443729
commit fc3fc00821
3 changed files with 22 additions and 21 deletions

View file

@ -1316,7 +1316,7 @@ Metamaps.JIT = {
if (Metamaps.Active.Map && Metamaps.Active.Mapper) menustring += '<li class="rc-delete ' + disabled + '"><div class="rc-icon"></div>Delete<div class="rc-keyboard">Ctrl+D</div></li>' if (Metamaps.Active.Map && Metamaps.Active.Mapper) menustring += '<li class="rc-delete ' + disabled + '"><div class="rc-icon"></div>Delete<div class="rc-keyboard">Ctrl+D</div></li>'
if (Metamaps.Active.Topic) { if (Metamaps.Active.Topic) {
menustring += '<li class="rc-center"><div class="rc-icon"></div>Center this topic<div class="rc-keyboard">Ctrl+U</div></li>' menustring += '<li class="rc-center"><div class="rc-icon"></div>Center this topic<div class="rc-keyboard">Ctrl+E</div></li>'
} }
menustring += '<li class="rc-popout"><div class="rc-icon"></div>Open in new tab</li>' menustring += '<li class="rc-popout"><div class="rc-icon"></div>Open in new tab</li>'
if (Metamaps.Active.Mapper) { if (Metamaps.Active.Mapper) {
@ -1341,10 +1341,10 @@ Metamaps.JIT = {
// set up the get sibling menu as a "lazy load" // set up the get sibling menu as a "lazy load"
// only fill in the submenu when they hover over the get siblings list item // only fill in the submenu when they hover over the get siblings list item
var siblingMenu = '<ul id="fetchSiblingList"> \ var siblingMenu = '<ul id="fetchSiblingList"> \
<li class="fetchAll">All<div class="rc-keyboard">Ctrl+Y</div></li> \ <li class="fetchAll">All<div class="rc-keyboard">Ctrl+R</div></li> \
<li id="loadingSiblings"></li> \ <li id="loadingSiblings"></li> \
</ul>' </ul>'
menustring += '<li class="rc-siblings"><div class="rc-icon"></div>Get siblings' + siblingMenu + '<div class="expandLi"></div></li>' menustring += '<li class="rc-siblings"><div class="rc-icon"></div>Reveal siblings' + siblingMenu + '<div class="expandLi"></div></li>'
} }
menustring += '</ul>' menustring += '</ul>'

View file

@ -44,11 +44,11 @@ Metamaps.Listeners = {
} }
break break
case 69: // if e or E is pressed case 69: // if e or E is pressed
if (e.ctrlKey) { if (e.ctrlKey && Metamaps.Active.Topic) {
e.preventDefault() self.centerAndReveal(Metamaps.Selected.Nodes, {
if (Metamaps.Active.Map) { center: true,
Metamaps.JIT.zoomExtents(null, Metamaps.Visualize.mGraph.canvas) reveal: false
} })
} }
break break
case 72: // if h or H is pressed case 72: // if h or H is pressed
@ -65,7 +65,15 @@ Metamaps.Listeners = {
Metamaps.Control.removeSelectedEdges() Metamaps.Control.removeSelectedEdges()
} }
break break
case 84: // if t or T is pressed case 79: // if o or O is pressed
if (e.ctrlKey) {
e.preventDefault()
if (Metamaps.Active.Map) {
Metamaps.JIT.zoomExtents(null, Metamaps.Visualize.mGraph.canvas)
}
}
break
case 82: // if r or R is pressed
if (e.ctrlKey && Metamaps.Active.Topic) { if (e.ctrlKey && Metamaps.Active.Topic) {
self.centerAndReveal(Metamaps.Selected.Nodes, { self.centerAndReveal(Metamaps.Selected.Nodes, {
center: false, center: false,
@ -73,15 +81,7 @@ Metamaps.Listeners = {
}) })
} }
break break
case 85: // if u or U is pressed case 84: // if t or T is pressed
if (e.ctrlKey && Metamaps.Active.Topic) {
self.centerAndReveal(Metamaps.Selected.Nodes, {
center: true,
reveal: false
})
}
break
case 89: // if y or Y is pressed
if (e.ctrlKey && Metamaps.Active.Topic) { if (e.ctrlKey && Metamaps.Active.Topic) {
self.centerAndReveal(Metamaps.Selected.Nodes, { self.centerAndReveal(Metamaps.Selected.Nodes, {
center: true, center: true,

View file

@ -26,8 +26,9 @@
</ul> </ul>
<div id="csTopicView"> <div id="csTopicView">
<div class="csItem"><span class="csTitle">Recenter Topics around chosen Topic:</span> Alt + click on the topic OR Right-click + 'center this topic'</div> <div class="csItem"><span class="csTitle">Recenter Topics around chosen Topic:</span> Alt + click on the topic OR Ctrl + E</div>
<div class="csItem"><span class="csTitle">Reveal the siblings for a Topic:</span> Right-click and choose 'Reveal siblings' OR Ctrl + R</div>
<div class="csItem"><span class="csTitle">Center topic and reveal siblings:</span> Ctrl + T</div>
</div> </div>
<div id="csCreatingTopics"> <div id="csCreatingTopics">
@ -102,7 +103,7 @@
<div id="csNavigation"> <div id="csNavigation">
<div class="csItem"><span class="csTitle">Move around Canvas:</span> Click and drag</div> <div class="csItem"><span class="csTitle">Move around Canvas:</span> Click and drag</div>
<div class="csItem"><span class="csTitle">Zoom in/out:</span> Scroll OR click on <div id="zoomIn"> </div> & <div id="zoomOut"> </div></div> <div class="csItem"><span class="csTitle">Zoom in/out:</span> Scroll OR click on <div id="zoomIn"> </div> & <div id="zoomOut"> </div></div>
<div class="csItem"><span class="csTitle">Zoom to see all:</span> Click <div id="centerMap"></div> OR Ctrl + E</div> <div class="csItem"><span class="csTitle">Zoom to see all:</span> Click <div id="centerMap"></div> OR Ctrl + O</div>
<div class="csItem"><br><a href="http://metamapscc.uservoice.com/knowledgebase/articles/425784-viewing-existing-maps" target= "_blank">Learn More</a></div> <div class="csItem"><br><a href="http://metamapscc.uservoice.com/knowledgebase/articles/425784-viewing-existing-maps" target= "_blank">Learn More</a></div>
</div> </div>