Permalink
Browse files

Nicer codemirror object

  • Loading branch information...
1 parent de1f315 commit 46306ab3b327834a4b66a8c01d9330ae7cc580d6 @arian arian committed Jan 3, 2011
Showing with 30 additions and 28 deletions.
  1. +1 −1 assets/css/demos.css
  2. +1 −1 assets/css/main.css
  3. +28 −26 assets/js/demos.js
@@ -91,4 +91,4 @@ ul.doc_references {
border-top: none;
margin: -15px 0 0;
padding: 10px;
-}
+}
View
@@ -99,4 +99,4 @@ UL {
margin: 25px 0 0;
overflow: hidden;
width: 760px;
- }
+ }
View
@@ -1,32 +1,34 @@
-var editors = [];
+var editors = {
-editors['html'] = CodeMirror.fromTextArea('html_tab', {
- parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
- stylesheet: ["assets/codemirror/css/xmlcolors.css", "assets/codemirror/css/jscolors.css", "assets/codemirror/css/csscolors.css"],
- height: "dynamic",
- path: "assets/codemirror/js/",
- autoMatchParens: true,
- readOnly: true
-});
+ html: CodeMirror.fromTextArea('html_tab', {
+ parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
+ stylesheet: ["assets/codemirror/css/xmlcolors.css", "assets/codemirror/css/jscolors.css", "assets/codemirror/css/csscolors.css"],
+ height: "dynamic",
+ path: "assets/codemirror/js/",
+ autoMatchParens: true,
+ readOnly: true
+ }),
-editors['css'] = CodeMirror.fromTextArea('css_tab', {
- parserfile: "parsecss.js",
- stylesheet: "assets/codemirror/css/csscolors.css",
- height: "dynamic",
- path: "assets/codemirror/js/",
- autoMatchParens: true,
- readOnly: true
-});
+ js: CodeMirror.fromTextArea('js_tab', {
+ parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
+ stylesheet: "assets/codemirror/css/jscolors.css",
+ height: "dynamic",
+ path: "assets/codemirror/js/",
+ autoMatchParens: true,
+ readOnly: true
+ }),
-editors['js'] = CodeMirror.fromTextArea('js_tab', {
- parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
- stylesheet: "assets/codemirror/css/jscolors.css",
- height: "dynamic",
- path: "assets/codemirror/js/",
- autoMatchParens: true,
- readOnly: true
-});
+ css: CodeMirror.fromTextArea('css_tab', {
+ parserfile: "parsecss.js",
+ stylesheet: "assets/codemirror/css/csscolors.css",
+ height: "dynamic",
+ path: "assets/codemirror/js/",
+ autoMatchParens: true,
+ readOnly: true
+ })
+
+};
var tabs = $$('.tabs LI.tab'),
content = $$('.tabcontent');
@@ -39,4 +41,4 @@ tabs.each(function(tab, index){
content[index].addClass('selected');
for (var name in editors) if (editors.hasOwnProperty(name)) editors[name].setDynamicHeight();
});
-});
+});

0 comments on commit 46306ab

Please sign in to comment.