mirror of
https://github.com/documize/community.git
synced 2025-08-04 21:15:24 +02:00
Improved Markdown and Code section themes
This commit is contained in:
parent
5235efdb34
commit
b31c4d4850
6 changed files with 104 additions and 160 deletions
|
@ -71,7 +71,7 @@ export default Ember.Component.extend(TooltipMixin, {
|
|||
|
||||
didInsertElement() {
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), {
|
||||
theme: "solarized dark",
|
||||
theme: "material",
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
indentUnit: 4,
|
||||
|
|
|
@ -52,7 +52,7 @@ export default Ember.Component.extend({
|
|||
let elem = `page-${page.id}-code`;
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById(elem), {
|
||||
theme: "solarized dark",
|
||||
theme: "material",
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
indentUnit: 4,
|
||||
|
|
|
@ -79,6 +79,7 @@ export default Ember.Component.extend(TooltipMixin, {
|
|||
|
||||
didInsertElement() {
|
||||
this.attachEditor();
|
||||
this.addTooltip(document.getElementById(this.get('tooltipId')));
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
|
@ -90,14 +91,10 @@ export default Ember.Component.extend(TooltipMixin, {
|
|||
return this.get('codeEditor').getDoc().getValue();
|
||||
},
|
||||
|
||||
didRender() {
|
||||
this.addTooltip(document.getElementById(this.get('tooltipId')));
|
||||
},
|
||||
|
||||
attachEditor() {
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById(this.get('editorId')), {
|
||||
theme: "solarized light",
|
||||
lineNumbers: true,
|
||||
theme: "default",
|
||||
lineNumbers: false,
|
||||
lineWrapping: true,
|
||||
indentUnit: 4,
|
||||
tabSize: 4,
|
||||
|
@ -128,6 +125,7 @@ export default Ember.Component.extend(TooltipMixin, {
|
|||
if (this.get('editMode')) {
|
||||
this.attachEditor();
|
||||
} else {
|
||||
this.set('pageBody',this.getBody());
|
||||
let md = window.markdownit({ linkify: true });
|
||||
let result = md.render(this.getBody());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue