diff --git a/README.md b/README.md index 11934ded89858c017e0cb37cd6c7927622d1f970..f9e97ddc06c3f5561713bc94c127e2244300ee92 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ au run build --env prod - https://github.com/kpdecker/jsdiff - https://github.com/myliang/x-spreadsheet - https://github.com/ssshooter/mind-elixir-core +- http://www.sortablejs.com/index.html ## 优秀产品 diff --git a/blog.html b/blog.html index 5a71129abfb3e0a565a49445246a730b521e5376..79bab4afd3a661496d79e039800a8ea833edfce1 100644 --- a/blog.html +++ b/blog.html @@ -626,6 +626,7 @@ var content = $('#edit').froalaEditor('html.get', true); var spaceId = url('?spaceId'); var dirId = url('?dirId'); + var pid = url('?pid'); if (!title || !$.trim(title)) { toastr && toastr.error('博文标题不能为空!'); @@ -639,8 +640,8 @@ if (blog == null) { - if (spaceId) { // 基于空间或者目录创建博文场景 - createBlog(spaceId, dirId); + if (spaceId || pid) { // 基于空间或者目录创建博文场景 + createBlog(spaceId, dirId, pid); } else { $.get('/admin/space/listMy', function (data) { if (data.success) { @@ -727,7 +728,7 @@ } }); - function createBlog(spaceId, dirId) { + function createBlog(spaceId, dirId, pid) { var title = $('#title').val(); var content = $('#edit').froalaEditor('html.get', true); @@ -744,7 +745,7 @@ if (blog == null) { - if (!spaceId) { + if (!spaceId && !pid) { $.modal.close(); @@ -766,6 +767,7 @@ spaceId: spaceId ? spaceId : $('#saveFrm select[name="space"]').val(), dirId: dirId ? dirId : (spaceId ? '' : $('#saveFrm select[name="dir"]') .val()), // 如果只是基于空间,目录设置为空 + pid: pid ? pid : '', title: title, content: content, editor: 'Html', diff --git a/excel.html b/excel.html index 4b8c28dc8607b655c10d8edb04d6316bf10699b5..bc5f8d6bc70ec339a5fad99b133daf88fad30245 100644 --- a/excel.html +++ b/excel.html @@ -276,6 +276,7 @@ var cid = url('?cid'); var spaceId = url('?spaceId'); var dirId = url('?dirId'); + var pid = url('?pid'); var readonly = typeof url('?readonly') !== 'undefined'; !readonly && $('#editor').removeClass('readonly'); @@ -578,8 +579,8 @@ if (blog == null) { - if (spaceId) { - createBlog(spaceId, dirId); + if (spaceId || pid) { + createBlog(spaceId, dirId, pid); } else { $.get('/admin/space/listMy', function (data) { if (data.success) { @@ -657,7 +658,7 @@ }); } - function createBlog(spaceId, dirId) { + function createBlog(spaceId, dirId, pid) { var title = $('#title').val(); var content = JSON.stringify(excel.getData()); @@ -673,7 +674,7 @@ if (blog == null) { - if (!spaceId) { + if (!spaceId && !pid) { $.modal.close(); localStorage && localStorage.setItem('tms-blog-html-space', $( @@ -690,6 +691,7 @@ '/page/index.html', spaceId: spaceId ? spaceId : $('#saveFrm select[name="space"]').val(), dirId: dirId ? dirId : (spaceId ? '' : $('#saveFrm select[name="dir"]').val()), + pid: pid ? pid : '', title: title, content: content, editor: 'Excel', diff --git a/mind.html b/mind.html index afd6881c6af8e40609b9bac28bd25da3aa687dda..c50700c76e5e67942a0aac8ac6a6a8311a71c827 100644 --- a/mind.html +++ b/mind.html @@ -251,6 +251,7 @@ var cid = url('?cid'); var spaceId = url('?spaceId'); var dirId = url('?dirId'); + var pid = url('?pid'); var readonly = typeof url('?readonly') !== 'undefined'; !readonly && $('#editor').removeClass('readonly'); @@ -569,8 +570,8 @@ if (blog == null) { - if (spaceId) { - createBlog(spaceId, dirId) + if (spaceId || pid) { + createBlog(spaceId, dirId, pid) } else { $.get('/admin/space/listMy', function (data) { if (data.success) { @@ -648,7 +649,7 @@ }); } - function createBlog(spaceId, dirId) { + function createBlog(spaceId, dirId, pid) { var title = $('#title').val(); mind.cancelFocus(); @@ -666,7 +667,7 @@ if (blog == null) { - if (!spaceId) { + if (!spaceId && !pid) { $.modal.close(); localStorage && localStorage.setItem('tms-blog-html-space', $( @@ -683,6 +684,7 @@ '/page/index.html', spaceId: spaceId ? spaceId : $('#saveFrm select[name="space"]').val(), dirId: dirId ? dirId : (spaceId ? '' : $('#saveFrm select[name="dir"]').val()), + pid: pid ? pid : '', title: title, content: content, editor: 'Mind', diff --git a/src/environment.js b/src/environment.js index da32a4b8736ba562799dc386e9e61a586c197be4..3495e9a9d2dc8567e56c399ed05f43c4a8ae2bec 100644 --- a/src/environment.js +++ b/src/environment.js @@ -1,4 +1,4 @@ export default { - debug: false, - testing: false + debug: true, + testing: true }; diff --git a/src/resources/elements/em-blog-left-sidebar.html b/src/resources/elements/em-blog-left-sidebar.html index 2bc3b1f27a7533acf8b0363d671e66e0b6251dc7..c5bf43dd4f66fb87dc6ea6de7002f73ce0a20220 100644 --- a/src/resources/elements/em-blog-left-sidebar.html +++ b/src/resources/elements/em-blog-left-sidebar.html @@ -16,7 +16,8 @@