1
0
Fork 0
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:
Harvey Kandola 2017-03-12 18:34:27 +00:00
parent 5235efdb34
commit b31c4d4850
6 changed files with 104 additions and 160 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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());