From 8f8cd8511d9ed38fd32ef262cdd9aa99140ebc5e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 9 Jul 2013 09:51:10 +0000 Subject: [PATCH] add soft tabs, show invisibles --- lib/client/edit.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index aeaadf03..43097f9a 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -33,7 +33,7 @@ var CloudCmd, Util, DOM, ace; }; this.show = function(pValue) { - var lMode; + var lMode, lSession; Images.showLoad({top:true}); @@ -49,9 +49,14 @@ var CloudCmd, Util, DOM, ace; not_append : true }); - Ace = ace.edit(Element); + Ace = ace.edit(Element); + lSession = Ace.getSession(); + Ace.setTheme('ace/theme/tomorrow_night_blue'); - Ace.getSession().setMode('ace/mode/javascript'); + lSession.setMode('ace/mode/javascript'); + Ace.setShowPrintMargin(false); + Ace.setShowInvisibles(true); + lSession.setUseSoftTabs(true); Ace.commands.addCommand({ name : 'hide', @@ -73,14 +78,12 @@ var CloudCmd, Util, DOM, ace; DOM.RESTfull.save( lPath, lValue ); } }); - - Ace.setShowPrintMargin(false); } if ( Util.isString(pValue) ) { Ace.setValue(pValue); CloudCmd.View.show(Element, function() { - Element.firstChild.focus(); + Ace.focus(); }); Key.unsetBind(); }