From b680af490b9736d16ed491c999af3f06d78a7d18 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 26 Apr 2012 12:26:31 -0700 Subject: IKNINJA-1551 - added editor support for other file types Signed-off-by: Ananya Sen --- js/controllers/code-editor-controller.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'js/controllers/code-editor-controller.js') diff --git a/js/controllers/code-editor-controller.js b/js/controllers/code-editor-controller.js index ab0521eb..d560e721 100644 --- a/js/controllers/code-editor-controller.js +++ b/js/controllers/code-editor-controller.js @@ -130,6 +130,10 @@ var CodeEditorController = exports.CodeEditorController = Montage.create(Compone _showAutoComplete : { enumerable:false, value:function(type, keyEvent){ + var status=false; + if(((keyEvent.keyCode === 83) && (keyEvent.ctrlKey || keyEvent.metaKey))){ + debugger; + } switch(type){ case "javascript": if((keyEvent.type === "keyup")//need seperate keycode set per mode @@ -145,15 +149,19 @@ var CodeEditorController = exports.CodeEditorController = Montage.create(Compone || (keyEvent.shiftKey && keyEvent.keyCode === 221)//close bracket } || (keyEvent.shiftKey && keyEvent.keyCode === 57)//open bracket ( || (keyEvent.shiftKey && keyEvent.keyCode === 48)//close bracket ) - || ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === 83)//ctrl+S - || ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === 90)//ctrl+z - || ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === 90)//ctrl+shift+z - || ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === 89)//ctrl+y + || ((keyEvent.keyCode === 83) && (keyEvent.ctrlKey || keyEvent.metaKey))//ctrl+S + || ((keyEvent.keyCode === 90) && (keyEvent.ctrlKey || keyEvent.metaKey))//ctrl+z + || ((keyEvent.keyCode === 89) && (keyEvent.ctrlKey || keyEvent.metaKey))//ctrl+y ) - ){return true;} + ){ + status = true; + break; + } default : - return false; + status = false; } + + return status; } }, -- cgit v1.2.3