diff --git a/app/assets/javascripts/bip.js b/app/assets/javascripts/bip.js index 2c270e1d..ee804884 100644 --- a/app/assets/javascripts/bip.js +++ b/app/assets/javascripts/bip.js @@ -531,6 +531,9 @@ BestInPlaceEditor.forms = { this.element.find("input[type='button']").bind('click', {editor: this}, BestInPlaceEditor.forms.textarea.cancelButtonHandler); } this.element.find("textarea").bind('blur', {editor: this}, BestInPlaceEditor.forms.textarea.blurHandler); + // START METAMAPS CODE + this.element.find("textarea").bind('keydown', {editor: this}, BestInPlaceEditor.forms.textarea.keydownHandler); + // END METAMAPS CODE this.element.find("textarea").bind('keyup', {editor: this}, BestInPlaceEditor.forms.textarea.keyupHandler); this.blurTimer = null; this.userClicked = false; @@ -573,14 +576,26 @@ BestInPlaceEditor.forms = { event.data.editor.abortIfConfirm(); event.stopPropagation(); // Without this, click isn't handled }, - + + // START METAMAPS CODE + keydownHandler : function(event) { + if (event.keyCode == 13 && !event.shiftKey) { + event.preventDefault(); + event.stopPropagation(); + return false; + } + }, + // END METAMAPS CODE + keyupHandler : function(event) { if (event.keyCode == 27) { event.data.editor.abortIfConfirm(); } + // START METAMAPS CODE else if (event.keyCode == 13 && !event.shiftKey) { event.data.editor.update(); } + // END METAMAPS CODE } } }; diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 8ae1e33d..136d86fe 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -2034,6 +2034,7 @@ div.mapInfoStat { /* Cheatsheet */ #cheatSheet { width: 100%; + height: 350px; font-family: LatoLight, Arial, Sans-Serif; font-size: 17px; line-height: 21px; diff --git a/app/views/layouts/_cheatsheet.html.erb b/app/views/layouts/_cheatsheet.html.erb index 2c48addc..7c400857 100644 --- a/app/views/layouts/_cheatsheet.html.erb +++ b/app/views/layouts/_cheatsheet.html.erb @@ -10,10 +10,16 @@ <% if controller_name == "topics" && action_name == "show" %> <li><a href="#csTopicView">Topic View</a></li> <% end %> - <% if authenticated? && (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %> + <% if authenticated? && controller_name == "maps" && action_name == "show" %> <li><a href="#csCreatingTopics">Creating Topics</a></li> + <% end %> + <% if authenticated? && (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %> <li><a href="#csEditingTopics">Editing Topics</a></li> + <% end %> + <% if authenticated? && controller_name == "maps" && action_name == "show" %> <li><a href="#csCreatingSynapses">Creating Synapses</a></li> + <% end %> + <% if authenticated? && (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %> <li><a href="#csEditingSynapses">Editing Synapses</a></li> <% end %> <% if (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %> @@ -32,7 +38,7 @@ </div> <% end %> - <% if authenticated? && (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %> + <% if authenticated? && controller_name == "maps" && action_name == "show" %> <div id="csCreatingTopics"> <p class="sectionTitle">Creating Topics</p> <div class="csItem"><span class="csTitle">Double-click on canvas:</span> Bring up the metacode spinner on the canvas.</div> @@ -43,7 +49,9 @@ <div class="csItem indented"><span class="csTitle">Enter:</span> create a new topic</div> <div class="csItem indented"><span class="csTitle">Gear Icon:</span> open up metacode settings</div> </div> - + <% end %> + + <% if authenticated? && (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %> <div id="csEditingTopics"> <p class="sectionTitle">Editing Topics</p> <div class="csItem"> @@ -75,7 +83,9 @@ </div> <div class="csItem indented">*Hide/Remove/Delete topic within context menu</div> </div> + <% end %> + <% if authenticated? && controller_name == "maps" && action_name == "show" %> <div id="csCreatingSynapses"> <p class="sectionTitle">Creating Synapses</p> <div class="csItem"><span class="csTitle">Right-click & drag from one topic to another:</span> open create synapse prompt</div> @@ -85,7 +95,9 @@ <div class="csItem indented"><span class="csTitle">Enter:</span> Create topic</div> <div class="csItem indented"><span class="csTitle">Enter:</span> Create synapse</div> </div> + <% end %> + <% if authenticated? && (controller_name == "maps" || controller_name == "topics" ) && action_name == "show" %> <div id="csEditingSynapses"> <p class="sectionTitle">Editing Synapses</p> <div class="csItem"><span class="csTitle">Double-click on synapse:</span> open synapse card</div>