mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-25 15:38:56 +00:00
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:
parent
9f5aafe636
commit
7d7b60532c
@ -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);
|
||||
}
|
||||
|
||||
5966
public/js/vendor/codemirror2/zen_codemirror.js
vendored
Normal file
5966
public/js/vendor/codemirror2/zen_codemirror.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user