Add Zen Coding to HTML pane, addresses #285.

Using zen-coding for CodeMirror I've added Zen Coding support to
the HTML pane of JSBin.

It's on by default, with no way to switch it off. I'm not sure how
it's best to do that – from looking at the TODOs, are CodeMirror
options something that's planned?

In Opera, becuase 'tab' is the Zen Coding trigger, the line that
the user ends up on is also indented. This is not the case in
Firefox and Chrome.
This commit is contained in:
Tom Ashworth 2012-09-25 17:25:11 +01:00 committed by Remy Sharp
parent 9f5aafe636
commit 7d7b60532c
3 changed files with 5978 additions and 0 deletions

View File

@ -102,6 +102,17 @@ var Panel = function (name, settings) {
cmSettings.extraKeys = { 'Esc': 'autocomplete' };
}
// Add Zen Coding to html pane
if (name === 'html') {
$.extend(cmSettings, {
syntax: 'html', /* define Zen Coding syntax */
profile: 'html', /* define Zen Coding output profile */
onKeyEvent: function() { /* send all key events to Zen Coding */
return zen_editor.handleKeyEvent.apply(zen_editor, arguments);
}
});
}
panel.editor = CodeMirror.fromTextArea(panel.el, cmSettings);
panel._setupEditor(panel.editor, name);
}

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@
"/js/vendor/codemirror2/searchcursor.js",
"/js/vendor/codemirror2/simple-hint.js",
"/js/vendor/codemirror2/javascript-hint.js",
"/js/vendor/codemirror2/zen_codemirror.js",
"/js/vendor/json2.js",
"/js/vendor/prettyprint.js",
"/js/chrome/storage.js",