Browse Source

v1.1.0 gulp tasks

v1.1.9
Pandao 10 years ago
parent
commit
1163ec3c41
  1. 2
      README.md
  2. 32
      dist/js/editormd.js
  3. 4
      dist/js/editormd.min.js

2
README.md

@ -9,7 +9,7 @@ A simple online markdown editor.
####主要特性
- 支持Markdown标准和Github风格;
- 支持实时预览、图片上传和多语言语法高亮;
- 支持实时预览、图片(跨域)上传和多语言语法高亮;
- 兼容主流的浏览器(IE8+),且支持iPad等平板设备;
- 支持[ToC(Table of Contents)](https://pandao.github.io/editor.md/examples/toc.html);
- 支持识别和解析HTML标签,具有几乎无限的扩展性;

32
dist/js/editormd.js

@ -82,6 +82,8 @@
imageUpload : false,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
imageUploadURL : "",
crossDomainUpload : false,
uploadCallbackURL : "",
saveHTMLToTextarea : false,
toc : true,
tocStartLevel : 1, // 表示从H1开始生成ToC
@ -861,9 +863,17 @@
imageDialog.show();
}
else
{
var imageDialogHTML = ( (settings.imageUpload) ? "<form action=\"" + settings.imageUploadURL + "\" target=\"" + iframeName + "\" method=\"post\" enctype=\"multipart/form-data\" class=\"" + classPrefix + "form\">" : "<div class=\"" + classPrefix + "form\">" ) +
( (settings.imageUpload) ? "<iframe name=\"" + iframeName + "\" id=\"" + iframeName + "\"></iframe>" : "" ) +
{
var guid = (new Date).getTime();
var action = settings.imageUploadURL + "?guid=" + guid;
if (settings.crossDomainUpload)
{
action += "&callback=" + settings.uploadCallbackURL + "&dialog_id=editormd-image-dialog-" + guid;
}
var imageDialogHTML = ( (settings.imageUpload) ? "<form action=\"" + action +"\" target=\"" + iframeName + "\" method=\"post\" enctype=\"multipart/form-data\" class=\"" + classPrefix + "form\">" : "<div class=\"" + classPrefix + "form\">" ) +
( (settings.imageUpload) ? "<iframe name=\"" + iframeName + "\" id=\"" + iframeName + "\" guid=\"" + guid + "\"></iframe>" : "" ) +
"<label>" + imageLang.url + "</label>" +
"<input type=\"text\" data-url />" + (function(){
return (settings.imageUpload) ? "<div class=\"" + classPrefix + "file-input\">" +
@ -931,9 +941,11 @@
}]
}
});
imageDialog.attr("id", classPrefix + "image-dialog-" + guid);
}
var fileInput = imageDialog.find("[name=\"" + classPrefix + "image-file\"]");
var fileInput = imageDialog.find("[name=\"" + classPrefix + "image-file\"]");
fileInput.bind("change", function() {
var fileName = fileInput.val();
@ -952,11 +964,16 @@
imageDialog.loading(true);
var submitHandler = function() {
if (settings.crossDomainUpload) {
imageDialog.loading(false);
return ;
}
var uploadIframe = document.getElementById(iframeName);
uploadIframe.onload = function() {
imageDialog.loading(false);
var json = uploadIframe.contentWindow.document.body.innerHTML;
json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")");
@ -974,6 +991,7 @@
};
imageDialog.find("[type=\"submit\"]").bind(editormd.mouseOrTouch("click", "touchend"), submitHandler).trigger("click");
}
return false;

4
dist/js/editormd.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save