-
Notifications
You must be signed in to change notification settings - Fork 0
PR: Merge Development branch into Master #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 11 commits
1ffa5d0
dda2b5f
431d72d
2db26bd
a91cf7b
78f915b
b501345
c1f06fe
3de6119
9dbb554
974d5f9
075c287
cb4eae0
2c6e1d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| </head> | ||
|
|
||
| <body> | ||
| <textarea class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> | ||
| <textarea id="inputText" class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> | ||
| ## CodeAssign Editor | ||
| Is a [SimpleMDE](https://simplemde.com/) Markdown editor powerd by [MarkJax](http://markjax.codeassign.com/) parser. | ||
|
|
||
|
|
@@ -32,16 +32,66 @@ | |
| previewRender: markjax | ||
| }); | ||
| ``` | ||
|
|
||
| And of course you can still write and use LaTeX: | ||
| $$\sum_{n=1}^{\infty} 2^{-n} = 1$$ | ||
| </textarea> | ||
|
|
||
| <script> | ||
| function insertAfterCursor(string) { | ||
| var cursorCh = simplemde.codemirror.getCursor()["ch"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing |
||
| var cursorLine = simplemde.codemirror.getCursor()["line"] | ||
| var anchor = {line: cursorLine, ch: cursorCh} | ||
|
|
||
| simplemde.codemirror.doc.replaceRange(string, anchor) | ||
| } | ||
|
|
||
| var simplemde = new SimpleMDE({ | ||
| previewRender: markjax, | ||
| previewRender: function(plainText, preview) { | ||
| setTimeout(function() { | ||
| markjax(plainText, preview); | ||
| }, 50); | ||
| return preview.innerHTML; | ||
| }, | ||
| spellChecker: false, | ||
| indentWithTabs: false | ||
| indentWithTabs: false, | ||
| toolbar: [ | ||
| "bold", | ||
| "italic", | ||
| "heading", | ||
| "|", | ||
| { | ||
| name: "latexExpr", | ||
| action: function latexExpr(editor) { | ||
| insertAfterCursor("$ $") | ||
| }, | ||
| className: "fa fa-bar-chart-o", | ||
| title: "Latex Expression" | ||
| }, | ||
| { | ||
| name: "latexEq", | ||
| action: function latexEq(editor) { | ||
| insertAfterCursor("$$ $$") | ||
| }, | ||
| className: "fa fa-area-chart", | ||
| title: "Latex Equation" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both |
||
| }, | ||
| "|", | ||
| "quote", | ||
| "unordered-list", | ||
| "ordered-list", | ||
| "|", | ||
| "link", | ||
| "image", | ||
| "|", | ||
| "preview", | ||
| "side-by-side", | ||
| "fullscreen", | ||
| "|", | ||
| "guide" | ||
| ], | ||
| "insertTexts": { | ||
| latexEq: ["", "%%"] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is not valid. We don't use |
||
| } | ||
| }); | ||
| SimpleMDE.toggleSideBySide(simplemde); | ||
| </script> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This textarea doesn't need
id, it is not used anywhere.