Code completion added for JS via simple hint

Simple hint .css, .js and the javascript hinter added
No need to have Ctrl-Up or Down to do nothing, handled in icecoder.js
Ctrl-Space triggers the autocomplete command
This is setup as a function which runs if the cursor is in a JS block
This commit is contained in:
Matt Pass
2013-01-23 19:37:51 +00:00
parent 5cdb08c35f
commit 826730e88b

View File

@@ -7,11 +7,12 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/hint/simple-hint.css">
<!--
codemirror-compressed.js
incls: codemirror.js
modes: clike, coffeescript, css, javascript, less, php, ruby & xml
utils: foldcode, searchcursor, match-highlighter
utils: foldcode, searchcursor, match-highlighter, simple-hint, javascript-hint
//-->
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
<?php
@@ -101,10 +102,14 @@ span.CodeMirror-matchhighlight {background: #555}
CodeMirror.keyMap.ICEcoder = {
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
"Shift-Tab": "indentLess",
"Ctrl-Up": function() {},
"Ctrl-Down": function() {},
"Ctrl-Space": "autocomplete",
fallthrough: ["default"]
};
CodeMirror.commands.autocomplete = function(cm) {
if (top.ICEcoder.caretLocType=="JavaScript") {
CodeMirror.simpleHint(cm, CodeMirror.javascriptHint);
}
}
function createNewCMInstance(num) {
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];