|
|
|
@ -25,18 +25,18 @@ module.exports = { |
|
|
|
if(!this.codeMirror) |
|
|
|
this.codeMirror = this.cm.getViewer('CodeMirror'); |
|
|
|
|
|
|
|
var $input = $('<textarea>'), |
|
|
|
var $input = $('<textarea>'), |
|
|
|
|
|
|
|
editor = this.codeMirror.clone().set({ |
|
|
|
editor = this.codeMirror.clone().set({ |
|
|
|
label, |
|
|
|
codeName, |
|
|
|
theme, |
|
|
|
input : $input[0], |
|
|
|
input: $input[0], |
|
|
|
}), |
|
|
|
|
|
|
|
$editor = new this.cm.EditorView({ |
|
|
|
model : editor, |
|
|
|
config : this.cm.getConfig() |
|
|
|
$editor = new this.cm.EditorView({ |
|
|
|
model: editor, |
|
|
|
config: this.cm.getConfig() |
|
|
|
}).render().$el; |
|
|
|
|
|
|
|
editor.init( $input[0] ); |
|
|
|
@ -46,11 +46,11 @@ module.exports = { |
|
|
|
|
|
|
|
enable() { |
|
|
|
if(!this.$editors){ |
|
|
|
var oHtmlEd = this.buildEditor('htmlmixed', 'hopscotch', 'HTML'), |
|
|
|
oCsslEd = this.buildEditor('css', 'hopscotch', 'CSS'); |
|
|
|
this.htmlEditor = oHtmlEd.el; |
|
|
|
this.cssEditor = oCsslEd.el; |
|
|
|
this.$editors = $('<div>', {class: this.pfx + 'export-dl'}); |
|
|
|
var oHtmlEd = this.buildEditor('htmlmixed', 'hopscotch', 'HTML'); |
|
|
|
var oCsslEd = this.buildEditor('css', 'hopscotch', 'CSS'); |
|
|
|
this.htmlEditor = oHtmlEd.el; |
|
|
|
this.cssEditor = oCsslEd.el; |
|
|
|
this.$editors = $('<div>', {class: this.pfx + 'export-dl'}); |
|
|
|
this.$editors.append(oHtmlEd.$el).append(oCsslEd.$el); |
|
|
|
} |
|
|
|
|
|
|
|
@ -59,10 +59,10 @@ module.exports = { |
|
|
|
this.modal.setContent(this.$editors); |
|
|
|
this.modal.open(); |
|
|
|
} |
|
|
|
const em = this.em; |
|
|
|
var addCss = this.protCss || ''; |
|
|
|
//this.htmlEditor.setContent(this.cm.getCode(this.components, 'html', this.cssc));
|
|
|
|
this.htmlEditor.setContent(this.em.getHtml()); |
|
|
|
this.cssEditor.setContent(addCss + this.cm.getCode(this.wrapper, 'css', this.cssc)); |
|
|
|
this.htmlEditor.setContent(em.getHtml()); |
|
|
|
this.cssEditor.setContent(em.getCss()); |
|
|
|
|
|
|
|
if(this.sender) |
|
|
|
this.sender.set('active',false); |
|
|
|
|