|
|
@ -13,21 +13,6 @@ |
|
|
|
<div id="editor" class="editor"> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div id="myModal" tabindex="-1" role="dialog" data-hasfoot="false" class="sui-modal hide fade"> |
|
|
|
<div class="modal-dialog"> |
|
|
|
<div class="modal-content"> |
|
|
|
<div class="modal-header"> |
|
|
|
<button type="button" data-dismiss="modal" aria-hidden="true" class="sui-close">×</button> |
|
|
|
<h4 id="myModalLabel" class="modal-title">Modal title</h4> |
|
|
|
</div> |
|
|
|
<div class="modal-body">我是内容body</div> |
|
|
|
<div class="modal-footer"> |
|
|
|
<button type="button" data-ok="modal" class="sui-btn btn-primary btn-large">可自定ok</button> |
|
|
|
<button type="button" data-dismiss="modal" class="sui-btn btn-default btn-large">可自定dismiss</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</body> |
|
|
|
<script> |
|
|
@ -35,8 +20,13 @@ |
|
|
|
var storage = window.localStorage |
|
|
|
var E = window.wangEditor |
|
|
|
var editor = new E('#editor') |
|
|
|
editor.customConfig.uploadImgServer = '/upload' |
|
|
|
editor.customConfig.uploadImgServer = '/file/upload' |
|
|
|
// 或者 var editor = new E( document.getElementById('editor') ) |
|
|
|
editor.customConfig.uploadImgHooks = { |
|
|
|
customInsert: function (insertImg, result, editor) { |
|
|
|
insertImg(result.Data); |
|
|
|
} |
|
|
|
} |
|
|
|
editor.create() |
|
|
|
document.onkeydown = keyDown; |
|
|
|
|
|
|
@ -44,7 +34,6 @@ |
|
|
|
var currKey = 0, e = e || event || window.event; |
|
|
|
currKey = e.keyCode || e.which || e.charCode; |
|
|
|
if (currKey == 83 && (e.ctrlKey || e.metaKey)) { |
|
|
|
layer.msg("ctrl+s") |
|
|
|
saveBlog() |
|
|
|
return |
|
|
|
} |
|
|
@ -59,7 +48,7 @@ |
|
|
|
return |
|
|
|
} |
|
|
|
tobj.title = $("#blog-title").val(); |
|
|
|
if (editor.txt.text().trim().length == 0) { |
|
|
|
if (editor.txt.html().trim().length == 0) { |
|
|
|
layer.msg('文章内容不能为空哦', function () { |
|
|
|
}); |
|
|
|
return |
|
|
|