diff --git a/static/bootstrap/plugins/bootstrap-wysiwyg/bootstrap-wysiwyg.js b/static/bootstrap/plugins/bootstrap-wysiwyg/bootstrap-wysiwyg.js
index bdd2c0f9..ac13d9ad 100644
--- a/static/bootstrap/plugins/bootstrap-wysiwyg/bootstrap-wysiwyg.js
+++ b/static/bootstrap/plugins/bootstrap-wysiwyg/bootstrap-wysiwyg.js
@@ -89,7 +89,10 @@
var nodeName = selection.commonAncestorContainer.parentNode.nodeName;
if(nodeName === 'CODE' || nodeName === 'PRE'){
return insertEmpty(selection.parentNode);
- }
+ }else if(nodeName === "DIV" || nodeName === "P"){
+ return insertHtml('
');
+ }
+ console.log(nodeName);
}catch (e){
console.log(selection)
console.log("enterKeyHandle:" + e);
@@ -227,6 +230,7 @@
editor.change && editor.change();
}
}else{
+ console.log(html)
execCommand('insertHTML',html);
}
};
@@ -259,6 +263,7 @@
insertHtml(args);
saveSelection();
};
+ this.insertHtml = insertHtml;
return this;
};
$.fn.wysiwyg.defaults = {
@@ -274,7 +279,7 @@
'ctrl+j meta+j': 'justifyfull',
'shift+tab': 'outdent',
'tab': 'indent',
- 'return':'enterAction'
+ 'return':'enterAction'
},
toolbarSelector: '[data-role=editor-toolbar]',
commandRole: 'edit',
diff --git a/views/document/new_html_edit_template.tpl b/views/document/new_html_edit_template.tpl
index 9549e27e..5bb91341 100644
--- a/views/document/new_html_edit_template.tpl
+++ b/views/document/new_html_edit_template.tpl
@@ -41,6 +41,19 @@
#docEditor {overflow:auto;border: 1px solid #ddd; height: 100%;outline:none;padding: 5px;}
.btn-info{background-color: #ffffff !important;}
.btn-info>i{background-color: #cacbcd !important; color: #393939 !important; box-shadow: inset 0 0 0 1px transparent,inset 0 0 0 0 rgba(34,36,38,.15);}
+ .editor-wrapper>pre{padding: 0;}
+ .editor-wrapper .editor-code{
+ font-size: 13px;
+ line-height: 1.8em;
+ color: #dcdcdc;
+ border-radius: 3px;
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #3f3f3f;
+ }
+ .editor-wrapper-selected .editor-code{border: 1px solid #1e88e5;}
+
-
- f
-
-
+ f
' + code + '