Skip to content

Commit

Permalink
Releases v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pandao committed Mar 23, 2015
1 parent 464c05f commit 4ca9b47
Show file tree
Hide file tree
Showing 62 changed files with 11,685 additions and 6,465 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ node_modules/
research/
test/
backup/
examples/uploads/
examples/uploads/**/*
*.bat
*.sh
.project
Expand Down
73 changes: 72 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,75 @@ v1.2.0 主要更新:
- 新增配置项`atLink`,默认为`true`;
- 修复无法输入`/`的问题 [#42](https://github.com/pandao/editor.md/issues/42)
- 修改使用帮助说明的错误 [#43](https://github.com/pandao/editor.md/issues/43)
- 新增配置项`pluginPath`,默认为空时,等于`settings.path + "../plugins/"`
- 新增配置项`pluginPath`,默认为空时,等于`settings.path + "../plugins/"`

### v1.4

#### v1.4.0

主要更新:

- 新增延迟解析机制,预览更即时;
- 新增跳转到指定行的功能和对话框;
- 新增ToC下拉菜单、自定义ToC容器的功能;
- 新增跳转到行、搜索的工具栏按钮;
- 新增支持插入和解析(打印)分页符;
- 改进快捷键功能和自动高度模式等;
- 改进:将锚点链接改名为引用链接;
- 改进编辑器重建和重配置功能;
- 修复多个Bug;

具体更新:

- 新增延迟解析预览的机制,解决输入太多太快出现的 “延迟卡顿” 问题;
- 新增配置项`delay`,默认值为 `300`
- 修复当输入速度太快时,解析Flowchart会抛出错误的问题;
- 修改iPad等移动终端的浏览器无法上传图片的问题[#48](https://github.com/pandao/editor.md/issues/48)
- 修复单独引用`editormd.preview.css`时无法显示Font Awesome和Editor.md logo字体的问题;
- 更新和修改Gulp构建;
- 修改了`Gulpfile.js`,并且`gulp-ruby-sass`升级到最新版本`1.0.0-alpha.3`;
- 编辑SCSS时,不再生成CSS的Source map文件;
- 执行jshint和更正一些JS写法的不规范,精简了代码;
- 新增配置项`appendMarkdown``appendMarkdown()`方法,用于(初始化前后)追加Markdown到Textarea;
- 改进部分预设快捷键功能,包括F9(watch)、F10(preview)、F11(fullscreen)等;
- 修复自动高度模式下出现的几个问题;
- 全屏退出时高度不正确的问题:修改了`fullscreenExit()`方法的内部实现;
- 当解析预览后的HTML内容高度高于Markdown源码编辑器高度时,无法正确预览的问题[#49](https://github.com/pandao/editor.md/issues/49)
- 修改`onscroll``onpreviewscroll`无法访问`this`的问题;
- 修改`init()`方法,可以只设置一个参数;
- 新增插入TeX(KaTeX)公式的快捷键`Ctrl + Shift + K`和插入方法`tex()`
- 将锚点链接改为引用链接,引用的链接改为插入到页尾;
- 工具栏的名称`anchor`改为`reference-link`
- 工具栏的名称`htmlEntities`改名为`html-entities`
- 改进编辑器重建和重配置功能;
- 修改了`loadedDisplay()`方法;
- 修改了`config()``recreate()`方法;
- 新增跳转到指定行的功能;
- 新增方法`gotoLine()`
- 新增跳转到行对话框插件`goto-line-dialog`
- 新增快捷键`Ctrl + Alt + G`
- 改进`executePlugin()`方法;
- 修改了`help-dialog/help.md`
- 新增搜索工具栏按钮;
- 新增方法`search()``searchReplace()``searchReplaceAll()`
- 原全屏预览HTML按钮的图标改为`fa-desktop`
- 改为默认开启搜索替换功能;
- 更换了关于Editor.md的标语(slogan);
- 标题按钮`h`改为大写的`H`
- `saveToTextareas()`方法更名为`save()`
- 新增ToC下拉菜单、自定义ToC容器的功能;
- 新增Markdown扩展语法`[TOCM]`,自动生成ToC下拉菜单;
- 新增配置项`tocm`,默认为`true`,即可以使用`[TOCM]`
- 新增配置项`tocDropdown``tocTitle`
- 新增方法`editormd.tocDropdownMenu()`
- 新增配置项`tocContainer`,值为jQuery选择器,默认为空;
- 修改了配置项`placeholder`的默认值;
- 改进对IE8的兼容支持;
- 修复Firefox下因为`Object.watch()`而出现的问题;
- 新增支持插入和解析(打印)分页符;
- 新增配置项`pageBreak`,默认值为`true`
- 新增语法`[========]`,即括号内至少8个等号;
- 新增插入分页符的工具栏图标和方法`pagebreak()`
- 新增插入分页符的快捷键`Shift + Alt + P`
- 修复一些Bug,包括[#51](https://github.com/pandao/editor.md/issues/51)等;
- 新增和修改以上更新的相关示例;
49 changes: 24 additions & 25 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,23 @@ var scssTask = function(fileName, path) {

var distPath = "css";

return gulp.src(path + fileName + ".scss")
.pipe(sass({ style: "expanded" })) //nested,compact,expanded,compressed
.pipe(gulp.dest(distPath))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest(distPath))
.pipe(minifycss())
.pipe(gulp.dest(distPath))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(notify({ message: fileName + ".scss task completed!" }));
return sass(path + fileName + ".scss", { style: "expanded", sourcemap: false, noCache : true })
.pipe(gulp.dest(distPath))
.pipe(header(headerComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest(distPath))
.pipe(minifycss())
.pipe(gulp.dest(distPath))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base);
return name[1].replace("\\", "");
}}))
.pipe(gulp.dest(distPath))
.pipe(notify({ message: fileName + ".scss task completed!" }));
};

gulp.task("scss", function() {
Expand All @@ -83,7 +82,7 @@ gulp.task("js", function() {
}}))
.pipe(gulp.dest("./"))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify({outSourceMap: true, sourceRoot: './'}))
.pipe(uglify()) // {outSourceMap: true, sourceRoot: './'}
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
Expand Down Expand Up @@ -185,7 +184,7 @@ gulp.task("amd", function() {
.pipe(replace("/* Require.js assignment replace */", replaceText2))
.pipe(gulp.dest('./'))
.pipe(rename({ suffix: ".min" }))
.pipe(uglify({outSourceMap: true, sourceRoot: './'}))
.pipe(uglify()) //{outSourceMap: true, sourceRoot: './'}
.pipe(gulp.dest("./"))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + ( (os.platform() === "win32") ? "\\" : "/") );
Expand Down Expand Up @@ -275,11 +274,11 @@ gulp.task("cm-mode", function() {
return gulp.src(modes)
.pipe(concat("modes.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify({outSourceMap: true, sourceRoot: codeMirror.path.dist}))
.pipe(uglify()) // {outSourceMap: true, sourceRoot: codeMirror.path.dist}
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
return name[1].replace("\\", "");
var name = file.path.split(file.base + "\\");
return (name[1]?name[1]:name[0]).replace(/\\/g, "");
}}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(notify({ message: "codemirror-mode task complete!" }));
Expand All @@ -297,11 +296,11 @@ gulp.task("cm-addon", function() {
return gulp.src(addons)
.pipe(concat("addons.min.js"))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(uglify({outSourceMap: true, sourceRoot: codeMirror.path.dist}))
.pipe(uglify()) //{outSourceMap: true, sourceRoot: codeMirror.path.dist}
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(header(headerMiniComment, {pkg : pkg, fileName : function(file) {
var name = file.path.split(file.base + "\\");
return name[1].replace("\\", "");
return (name[1]?name[1]:name[0]).replace(/\\/g, "");
}}))
.pipe(gulp.dest(codeMirror.path.dist))
.pipe(notify({ message: "codemirror-addon.js task complete" }));
Expand Down
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
![](https://img.shields.io/github/issues/pandao/editor.md.svg)
![](https://img.shields.io/bower/v/editor.md.svg)

**Editor.md** is an online markdown editor, based on CodeMirror & jQuery & Marked.
**Editor.md** is the open source online markdown editor, based on CodeMirror & jQuery & Marked.

###Features
### Features

- Support Standard Markdown and GFM(GitHub Flavored Markdown);
- Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Code fold, Search replace, Read only, Themes, Multi-languages, L18n, HTML entities, Code syntax highlighting...;
Expand All @@ -22,14 +22,16 @@
- Support AMD/CMD (Require.js & Sea.js) Module Loader, and Custom/define editor plugins;

[README & Examples (English)](https://pandao.github.io/editor.md/en.html)


--------


**Editor.md** 是一个基于CodeMirror、jQuery 和 Marked 构建的 Markdown 在线编辑器。

![editormd-screenshot](https://pandao.github.io/editor.md/examples/images/editormd-screenshot.png "editormd-screenshot")

####主要特性
#### 主要特性

- 支持“标准”Markdown和Github风格的语法,也可[变身为代码编辑器](https://pandao.github.io/editor.md/examples/change-mode.html)
- 支持实时预览、图片(跨域)上传、预格式文本/代码/表格插入、代码折叠、搜索替换、只读模式、自定义样式主题和多语言语法高亮等功能;
Expand All @@ -39,44 +41,52 @@
- 支持 AMD / CMD 模块化加载(支持 [Require.js](https://pandao.github.io/editor.md/examples/use-requirejs.html) & [Sea.js](https://pandao.github.io/editor.md/examples/use-seajs.html)),并且支持[自定义扩展插件](https://pandao.github.io/editor.md/examples/define-plugin.html)
- 兼容主流的浏览器(IE8+)和[Zepto.js](https://pandao.github.io/editor.md/examples/use-zepto.html),且支持iPad等平板设备;

####在线演示 (Examples)
#### 在线演示 (Examples)

[https://pandao.github.io/editor.md/examples/index.html](https://pandao.github.io/editor.md/examples/index.html)

####下载和安装 (Download & install)
#### 下载和安装 (Download & install)

通过 [Github下载安装](https://github.com/pandao/editor.md/archive/master.zip),或者通过 Bower 安装:

bower install editor.md

####使用方法 (Usage)
#### 使用方法 (Usage)

HTML:

<link rel="stylesheet" href="../dist/css/editormd.css" />
<div id="test-editormd">
<textarea style="display:none;">###Hello world!</textarea>
<link rel="stylesheet" href="editormd.min.css" />
<div id="editormd">
<textarea style="display:none;">### Hello world!</textarea>
</div>

> 提示1:如果没有Markdown源内容或者通过Ajax异步加载Markdown源文档等,可以不添加`<textarea>`,会自动添加;
javascript:

<script src="../lib/jquery.min.js"></script>
<script src="../src/js/editormd.js"></script>
<script src="jquery.min.js"></script>
<script src="editormd.min.js"></script>
<script type="text/javascript">
$(function() {
var testEditor = editormd("test-editormd", {
path : '../lib/' // codemirrormarked等依赖的库的路径
var editor = editormd("editormd", {
path : "../lib/" // codemirror, marked等依赖的库的路径
});

/*
// or
var editor = editormd({
id : "editormd",
path : "../lib/"
});
*/
});
</script>

> Require.js的使用方法:[https://github.com/pandao/editor.md/tree/master/examples/use-requirejs.html](https://github.com/pandao/editor.md/tree/master/examples/use-requirejs.html)
> Sea.js的使用方法:[https://github.com/pandao/editor.md/tree/master/examples/use-seajs.html](https://github.com/pandao/editor.md/tree/master/examples/use-seajs.html)
####依赖项目及感谢 (Dependents)
#### 依赖项目及感谢 (Dependents)

- [CodeMirror](http://codemirror.net/ "CodeMirror")
- [marked](https://github.com/chjj/marked "marked")
Expand All @@ -90,11 +100,11 @@ javascript:
- [sequence-diagram.js](http://bramp.github.io/js-sequence-diagrams/ "sequence-diagram.js")
- [Prefixes.scss](https://github.com/pandao/prefixes.scss "Prefixes.scss")

####Changes
#### Changes

[更新日志 Change logs](https://github.com/pandao/editor.md/blob/master/CHANGE.md)

####License
#### License

The MIT License.

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "editor.md",
"version": "1.3.0",
"version": "1.4.0",
"homepage": "https://github.com/pandao/editor.md",
"authors": [
"Pandao <[email protected]>"
],
"description": "A simple online markdown editor.",
"description": "Open source online markdown editor.",
"keywords": [
"editor.md",
"markdown",
Expand Down
Loading

0 comments on commit 4ca9b47

Please sign in to comment.