From e2adcabc5b8e7640349ae71afbe3958666d45f2d Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 16 Mar 2013 12:54:04 +0000 Subject: [PATCH] Open file promp function added & help updated Prompt opens asking user to input relative file path, which on hitting OK will attempt to open. Triggered with CTRL+o shortcut, which is also added to help screen. Also clarified CTRL+g and noted it's anywhere, not elsewhere. --- lib/help.php | 5 +++-- lib/ice-coder.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/help.php b/lib/help.php index a83bad2..b73e871 100644 --- a/lib/help.php +++ b/lib/help.php @@ -48,13 +48,14 @@ Right click Options for selected
Delete Delete selected

-

Elsewhere

+

Anywhere

CTRL + Next tab
CTRL + Previous tab
CTRL + + New tab
CTRL + - Close current tab
+ CTRL + o Open file prompt
CTRL + f Find
- CTRL + g Go to line
+ CTRL + g Focus on Go to line input
CTRL + s Save
CTRL + Shift + s Save as...
CTRL + Enter View webpage
diff --git a/lib/ice-coder.js b/lib/ice-coder.js index cac23c2..2622053 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -584,6 +584,15 @@ var ICEcoder = { } }, + // Show file prompt to open file + openPrompt: function() { + var fileLink; + + if(fileLink = top.ICEcoder.getInput('Enter relative file path prefixed with /','')) { + top.ICEcoder.openFile(fileLink); + } + }, + // Save a file saveFile: function(saveAs) { var saveType; @@ -2037,6 +2046,12 @@ var ICEcoder = { top.ICEcoder.ctrlKeyDown = false; return false; + // CTRL+O (Open Prompt) + } else if(key==79 && top.ICEcoder.ctrlKeyDown==true) { + top.ICEcoder.openPrompt(); + top.ICEcoder.ctrlKeyDown = false; + return false; + // CTRL+Space (Show snippet) } else if(key==32 && top.ICEcoder.ctrlKeyDown==true && area=="content") { top.ICEcoder.addSnippet();