From 8601363d463a768df5ca80defa0f7b53fb2fe6a6 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 11 Jul 2013 07:41:31 +0100 Subject: [PATCH] Don't focus if we press space in replace field --- lib/ice-coder.js | 2 +- lib/ice-coder.min.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 9de2e8c..92de087 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -2283,7 +2283,7 @@ var ICEcoder = { return false; // Space outisde of editor (Focus on editor) - } else if(key==32 && area!="content" && document.activeElement.id!="find") { + } else if(key==32 && area!="content" && document.activeElement.id!="find" && document.activeElement.id!="replace") { if (top.ICEcoder.getcMInstance()) { top.ICEcoder.getcMInstance().focus(); } diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 190f322..040c246 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -104,6 +104,6 @@ if(b.altKey){if(b.ctrlKey&&"content"==a){if(68==c)return top.ICEcoder.tagWrapper !1;if(51==c)return top.ICEcoder.tagWrapper("h3"),!1;if(52==c)return top.ICEcoder.tagWrapper("h4"),!1;if(53==c)return top.ICEcoder.tagWrapper("h5"),!1;if(54==c)return top.ICEcoder.tagWrapper("h6"),!1;if(13==c)return top.ICEcoder.addLineBreakAtEnd(),!1}return c}return 70==c&&b.ctrlKey?(top.get("find").focus(),!1):71==c&&b.ctrlKey?(top.get("goToLineNo").focus(),!1):73==c&&b.ctrlKey&&"content"==a?(c=top.ICEcoder.caretLocType.toLowerCase()+" ","CSS"==top.ICEcoder.caretLocType||"PHP"==top.ICEcoder.caretLocType? window.open("http://voke.fm/"+c+top.ICEcoder.getcMInstance().getSelection()):("Content"==top.ICEcoder.caretLocType&&(c=""),window.open("http://www.google.com/#output=search&q="+c+top.ICEcoder.getcMInstance().getSelection())),!1):39==c&&b.ctrlKey&&"content"!=a?(top.ICEcoder.nextTab(),!1):37==c&&b.ctrlKey&&"content"!=a?(top.ICEcoder.previousTab(),!1):38==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.moveLine("up"),!1):40==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.moveLine("down"),!1):107==c&&b.ctrlKey?("content"== a?top.ICEcoder.duplicateLines():top.ICEcoder.newTab(),!1):109==c&&b.ctrlKey?("content"==a?top.ICEcoder.removeLines():top.ICEcoder.closeTab(top.ICEcoder.selectedTab),!1):83==c&&b.ctrlKey?(b.shiftKey?top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1):13==c&&b.ctrlKey&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]?(window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1):79==c&&b.ctrlKey?(top.ICEcoder.openPrompt(),!1):32==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.addSnippet(), -!1):32==c&&"content"!=a&&"find"!=document.activeElement.id?(top.ICEcoder.getcMInstance()&&top.ICEcoder.getcMInstance().focus(),!1):74==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):27==c&&"content"==a?(top.ICEcoder.lineCommentToggle(),!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c},resetKeys:function(a){},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=a.getCursor().line;c=a.getLine(b).length-a.getLine(b).replace(/^\s\s*/,"").length;a=a.getLine(b).slice(c); -"function"==a.slice(0,8)?top.ICEcoder.doSnippet("function","function VAR() {\nINDENT\tCURSOR\nINDENT}"):"if"==a.slice(0,2)?top.ICEcoder.doSnippet("if","if (CURSOR) {\nINDENT\t\nINDENT}"):"for"==a.slice(0,3)&&top.ICEcoder.doSnippet("for","for (var i=0; i