Permalink
Browse files

Upgraded CodeMirror to version 2. Smaller file size.

  • Loading branch information...
1 parent ead4c34 commit a80b0932da117ba59c91b2de62281be1299f3a81 @cheeaun cheeaun committed May 2, 2011
Showing with 59 additions and 160 deletions.
  1. +5 −9 advanced-options.html
  2. +0 −89 codemirror-base.js
  3. +49 −38 codemirror.css
  4. +1 −23 codemirror.js
  5. +4 −1 options.css
View
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<link rel="stylesheet" href="options.css">
+<link rel="stylesheet" href="codemirror.css">
<script src="neatools.js"></script>
<script src="codemirror.js"></script>
<script>
@@ -62,16 +63,11 @@
var textareaUserstyle = $('userstyle');
if (localStorage.userstyle) textareaUserstyle.value = localStorage.userstyle;
-
- var codeArea = CodeMirror.fromTextArea('userstyle', {
- basefiles: 'codemirror-base.js',
- stylesheet: 'codemirror.css',
- width: '40em'
+ CodeMirror.fromTextArea(textareaUserstyle, {
+ onChange: function(c){
+ localStorage.userstyle = c.getValue();
+ }
});
- codeArea.frame.contentWindow.onblur = function(){
- var code = codeArea.editor.getCode();
- localStorage.userstyle = code;
- };
});
</script>
<h1><img src="icon32.png" width="32" height="32" alt=""> <script>__m('extName')</script> <small><script>__m('advancedOptions')</script></small></h1>
Oops, something went wrong.

0 comments on commit a80b093

Please sign in to comment.