Skip to content

Commit

Permalink
Syntax Highlighter CodeMirror Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sabagh committed Jul 22, 2017
1 parent 4e8225d commit a9ea7d4
Show file tree
Hide file tree
Showing 561 changed files with 109,470 additions and 0 deletions.
18 changes: 18 additions & 0 deletions codeMirror/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

<!DOCTYPE html>
<html>
<head>
<title>CodeMirror</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="plugin/codemirror/lib/codemirror.css">
</head>
<body>
<textarea class="codemirror-textarea">/* add css */</textarea>
<textarea name="custom_css" id="custom-css"></textarea>
<!-- javascript -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="plugin/codemirror/lib/codemirror.js"></script>
<script src="plugin/codemirror/mode/css/css.js"></script>
<script type="text/javascript" src="js/default.js"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions codeMirror/js/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$(document).ready(function(){
//code here...
var code = $(".codemirror-textarea")[0];
var editor = CodeMirror.fromTextArea(code, {
lineNumbers : true,
mode: "css"
});
default_value_editor = editor.getValue();
$("#custom-css").val(default_value_editor);
editor.on("change" , function(){
var custom_css = editor.getValue();
$("#custom-css").val(custom_css);
});
});
5 changes: 5 additions & 0 deletions codeMirror/js/jquery.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions codeMirror/plugin/codemirror/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
8 changes: 8 additions & 0 deletions codeMirror/plugin/codemirror/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.txt text eol=lf
*.js text eol=lf
*.html text eol=lf
*.md text eol=lf
*.json text eol=lf
*.yml text eol=lf
*.css text eol=lf
*.svg text eol=lf
11 changes: 11 additions & 0 deletions codeMirror/plugin/codemirror/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/node_modules
/demo
/doc
/test
/test*.html
/index.html
/mode/*/*test.js
/mode/*/*.html
/mode/index.html
.*
bin
4 changes: 4 additions & 0 deletions codeMirror/plugin/codemirror/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- stable
sudo: false
Loading

0 comments on commit a9ea7d4

Please sign in to comment.