🔖 重构admin项目中编辑器的生成代码

上级 7272f734
/** /**
* MIT License
*
* Copyright (c) 2018 yadong.zhang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* *
* 图片预览 * 图片预览
* *
......
/** /**
* MIT License
*
* Copyright (c) 2018 yadong.zhang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* *
* bootstrap-table工具类 * bootstrap-table工具类
* *
...@@ -105,7 +84,7 @@ ...@@ -105,7 +84,7 @@
columns: options.columns columns: options.columns
}); });
$tablelist.on('load-success.bs.table', function (data) { $tablelist.on('load-success.bs.table', function (data) {
zhyd.initSwitchery(); gentelella.initSwitchery();
}); });
}, },
queryParams: function (params) { queryParams: function (params) {
......
/** /**
* MIT License
*
* Copyright (c) 2018 yadong.zhang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* *
* 项目工具类 * 项目工具类
* *
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<div class="custom-container"> <div class="custom-container">
<div class="item form-group"> <div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-2" for="title">文章类型 <span class="required">*</span></label> <label class="control-label col-md-2 col-sm-2 col-xs-2" for="title">文章类型 <span class="required">*</span></label>
<div class="col-md-2 col-sm-2 col-xs-2"> <div class="col-md-1 col-sm-1 col-xs-1">
<select class="form-control" name="original" required="required" id="original" style="width: 120px;"> <select class="form-control" name="original" required="required" id="original" style="width: 120px;">
<option value="1">原创</option> <option value="1">原创</option>
<option value="0">转载</option> <option value="0">转载</option>
...@@ -226,13 +226,11 @@ ...@@ -226,13 +226,11 @@
uniqueId: "mdEditor_1", uniqueId: "mdEditor_1",
uploadUrl: "/api/upload2QiniuForMd" uploadUrl: "/api/upload2QiniuForMd"
}; };
zhyd.initMdEditor(op); zhyd.simpleMDE.init(op);
articleId = '${id}'; articleId = '${id}';
</script> </script>
<script src="/assets/js/zhyd.publish-article.js"></script> <script src="/assets/js/zhyd.publish-article.js"></script>
<script> <script>
console.log('init_SmartWizard');
$('#wizard').smartWizard({ $('#wizard').smartWizard({
labelNext:'<i class="fa fa-angle-right"></i> 下一步', labelNext:'<i class="fa fa-angle-right"></i> 下一步',
labelPrevious:'<i class="fa fa-angle-left"></i> 上一步', labelPrevious:'<i class="fa fa-angle-left"></i> 上一步',
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
<label class="control-label col-md-1 col-sm-1 col-xs-12" for="password">内容 <span class="required">*</span></label> <label class="control-label col-md-1 col-sm-1 col-xs-12" for="password">内容 <span class="required">*</span></label>
<div class="col-md-11 col-sm-11 col-xs-12"> <div class="col-md-11 col-sm-11 col-xs-12">
<div id="editor" style="width: 100%;height: 150px;"></div> <div id="editor" style="width: 100%;height: 150px;"></div>
<textarea class="form-control col-md-7 col-xs-12" id="content" name="content" style="display: none" required="required"></textarea>
</div> </div>
</div> </div>
<div class="item form-group"> <div class="item form-group">
...@@ -160,19 +159,17 @@ ...@@ -160,19 +159,17 @@
<script> <script>
articleId = '${id}'; articleId = '${id}';
$(function () { $(function () {
/*if(!articleId) { zhyd.wangEditor.init({
$.alert.confirm("当前已支持markdown编辑器,去试试?", function () { container: "#editor",
window.location.href="/article/publishMd"; textareaName: "content",
}, function () {
});
}*/
zhyd.initWangEditor({
id: "editor",
contentId: "content",
uploadUrl: "/api/upload2Qiniu", uploadUrl: "/api/upload2Qiniu",
uploadFileName: "file" uploadFileName: "file",
}); uploadType: "article",
customCss: {
"height": "100%",
"max-height": "115px"
}
})
}); });
</script> </script>
<script src="/assets/js/zhyd.publish-article.js"></script> <script src="/assets/js/zhyd.publish-article.js"></script>
......
...@@ -45,5 +45,6 @@ ...@@ -45,5 +45,6 @@
<script src="/assets/js/jquery-form.js"></script> <script src="/assets/js/jquery-form.js"></script>
<script src="/assets/js/zyd.tool.js"></script> <script src="/assets/js/zyd.tool.js"></script>
<script src="/assets/js/zhyd.upload-preview.js"></script> <script src="/assets/js/zhyd.upload-preview.js"></script>
<script src="/assets/js/gentelella.core.js"></script>
<script src="/assets/js/zhyd.core.js"></script> <script src="/assets/js/zhyd.core.js"></script>
<script src="/assets/js/zyd.table.js"></script> <script src="/assets/js/zyd.table.js"></script>
\ No newline at end of file
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
- 修改: - 修改:
- web项目中,“更新记录”页面重构 - web项目中,“更新记录”页面重构
- admin项目中,“推送消息”页面重构,以后准备做个简单的聊天通讯工具 - admin项目中,“推送消息”页面重构,以后准备做个简单的聊天通讯工具
- admin项目中,重构wangEditor&simpleMDE编辑器的生成代码
- admin项目中,拆分gentelella模板的js代码和自定义的js代码
---- ----
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册