diff options
author | Ananya Sen | 2012-04-03 15:07:33 -0700 |
---|---|---|
committer | Ananya Sen | 2012-04-03 15:07:33 -0700 |
commit | 4b1b72971567ea569a10c740e26aee33421e7bd5 (patch) | |
tree | 6c58a8383195ed931dfe4d1e8cf8c3df323dd453 | |
parent | 2c794eca1b01743b0221af4341835d3608185dd3 (diff) | |
download | ninja-4b1b72971567ea569a10c740e26aee33421e7bd5.tar.gz |
adding basic autocomplete
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
-rwxr-xr-x | index.html | 6 | ||||
-rwxr-xr-x | js/stage/stage-view.reel/stage-view.js | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Sans+Mono' rel='stylesheet' type='text/css'> | 22 | <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Sans+Mono' rel='stylesheet' type='text/css'> |
23 | <link href="imports/codemirror/lib/codemirror.css" rel="stylesheet" type="text/css"/> | 23 | <link href="imports/codemirror/lib/codemirror.css" rel="stylesheet" type="text/css"/> |
24 | <link rel="stylesheet" href="imports/codemirror/lib/util/simple-hint.css"> | ||
24 | 25 | ||
25 | <style type="text/css"> | 26 | <style type="text/css"> |
26 | html, body | 27 | html, body |
@@ -185,6 +186,9 @@ | |||
185 | <script type="text/javascript" src="imports/codemirror/mode/css/css.js"></script> | 186 | <script type="text/javascript" src="imports/codemirror/mode/css/css.js"></script> |
186 | <script type="text/javascript" src="imports/codemirror/lib/util/searchcursor.js"></script> | 187 | <script type="text/javascript" src="imports/codemirror/lib/util/searchcursor.js"></script> |
187 | <script type="text/javascript" src="imports/codemirror/lib/util/match-highlighter.js"></script> | 188 | <script type="text/javascript" src="imports/codemirror/lib/util/match-highlighter.js"></script> |
189 | <script type="text/javascript" src="imports/codemirror/lib/util/simple-hint.js"></script> | ||
190 | <script type="text/javascript" src="imports/codemirror/lib/util/javascript-hint.js"></script> | ||
191 | |||
188 | 192 | ||
189 | <script type="text/javascript" src="node_modules/montage/montage.js"></script> | 193 | <script type="text/javascript" src="node_modules/montage/montage.js"></script> |
190 | 194 | ||
@@ -203,10 +207,8 @@ | |||
203 | </script> | 207 | </script> |
204 | 208 | ||
205 | <style type="text/css"> | 209 | <style type="text/css"> |
206 | .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} | ||
207 | span.CodeMirror-matchhighlight { background: #e9e9e9 } | 210 | span.CodeMirror-matchhighlight { background: #e9e9e9 } |
208 | .CodeMirror-focused span.CodeMirror-matchhighlight { background: #e7e4ff; !important } | 211 | .CodeMirror-focused span.CodeMirror-matchhighlight { background: #e7e4ff; !important } |
209 | .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} | ||
210 | .activeline {background: #e8f2ff !important;} | 212 | .activeline {background: #e8f2ff !important;} |
211 | div.CodeMirror span.CodeMirror-matchingbracket {color: #000;background-color: #ffd500;} | 213 | div.CodeMirror span.CodeMirror-matchingbracket {color: #000;background-color: #ffd500;} |
212 | .CodeMirror-scroll {height: auto; overflow-y: hidden; overflow-x: auto; width: 100%;} | 214 | .CodeMirror-scroll {height: auto; overflow-y: hidden; overflow-x: auto; width: 100%;} |
diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index bee12838..28a66396 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js | |||
@@ -109,7 +109,11 @@ exports.StageView = Montage.create(Component, { | |||
109 | doc.editor.matchHighlight("CodeMirror-matchhighlight"); | 109 | doc.editor.matchHighlight("CodeMirror-matchhighlight"); |
110 | doc.editor.setLineClass(doc.editor.hline, null); | 110 | doc.editor.setLineClass(doc.editor.hline, null); |
111 | doc.editor.hline = doc.editor.setLineClass(doc.editor.getCursor().line, "activeline"); | 111 | doc.editor.hline = doc.editor.setLineClass(doc.editor.getCursor().line, "activeline"); |
112 | } | 112 | }, |
113 | extraKeys: {"Ctrl-Space": function(cm) { | ||
114 | CodeMirror.simpleHint(cm, CodeMirror.javascriptHint); | ||
115 | } | ||
116 | } | ||
113 | }); | 117 | }); |
114 | 118 | ||
115 | doc.editor.hline = doc.editor.setLineClass(0, "activeline"); | 119 | doc.editor.hline = doc.editor.setLineClass(0, "activeline"); |