mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-20 10:48:00 +08:00
Merge branch 'master' into dev
# Conflicts: # views/book/setting.tpl
This commit is contained in:
@@ -12,7 +12,7 @@ MinDoc 的前身是 SmartWiki 文档系统。SmartWiki 是基于 PHP 框架 lara
|
||||
|
||||
# 安装与使用
|
||||
|
||||
**如果你的服务器上没有安装golang程序请手动设置一个环境变量如下:键名为 ZONEINFO,值为MinDoc程序所在路径。**
|
||||
**如果你的服务器上没有安装golang程序请手动设置一个环境变量如下:键名为 ZONEINFO,值为MinDoc跟目录下的/lib/time/zoneinfo.zip 。**
|
||||
|
||||
**Windows 教程:** [https://github.com/lifei6671/godoc/blob/master/README_WIN.md](https://github.com/lifei6671/godoc/blob/master/README_WIN.md)
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
# Linux 下安装和配置 MinDoc
|
||||
|
||||
**如果你的服务器上没有安装golang程序请手动设置一个环境变量如下:键名为 ZONEINFO,值为MinDoc跟目录下的/lib/time/zoneinfo.zip 绝对路径。**
|
||||
|
||||
**第一步 下载可执行文件**
|
||||
|
||||
请从 [https://github.com/lifei6671/godoc/releases](https://github.com/lifei6671/godoc/releases) 下载最新版的可执行文件,一般文件名为 godoc_linux_amd.tar.gz .
|
||||
|
@@ -1,5 +1,7 @@
|
||||
# Windows 下安装和配置 MinDoc
|
||||
|
||||
**如果你的服务器上没有安装golang程序请手动设置一个环境变量如下:键名为 ZONEINFO,值为MinDoc跟目录下的/lib/time/zoneinfo.zip 绝对路径。**
|
||||
|
||||
**第一步 下载可执行文件**
|
||||
|
||||
请从 [https://github.com/lifei6671/godoc/releases](https://github.com/lifei6671/godoc/releases) 下载最新版的可执行文件,一般文件名为 godoc_windows_amd.zip .
|
||||
@@ -40,7 +42,9 @@ db_password=123456
|
||||
|
||||
**第五步 启动程序**
|
||||
|
||||
此时,双击 godoc_windows_amd64.exe 文件,该程序会自动在后台执行,打开任务管理器会看到运行中的程序。
|
||||
如果你设置了环境变量,但是没有重启电脑,请在cmd命令行启动 godoc_windows_amd64.exe 程序。
|
||||
|
||||
如果你设置了环境变量,并且重启了电脑,双击 godoc_windows_amd64.exe 即可。
|
||||
|
||||
稍等一分钟,程序会自动初始化数据库,并创建一个超级管理员账号:admin 密码:123456
|
||||
|
||||
|
@@ -78,6 +78,7 @@ func (c *AccountController) Login() {
|
||||
}
|
||||
}
|
||||
|
||||
//用户注册.
|
||||
func (c *AccountController) Register() {
|
||||
c.TplName = "account/register.tpl"
|
||||
|
||||
@@ -329,6 +330,7 @@ func (c *AccountController) Logout(){
|
||||
c.Redirect(beego.URLFor("AccountController.Login"),302)
|
||||
}
|
||||
|
||||
//验证码.
|
||||
func (c *AccountController) Captcha() {
|
||||
c.Prepare()
|
||||
|
||||
|
@@ -557,7 +557,7 @@ func (c *BookController) SaveSort() {
|
||||
beego.Error(err)
|
||||
c.JsonResult(6003,"数据错误")
|
||||
}
|
||||
fmt.Printf("%+v",docs)
|
||||
|
||||
for _,item := range docs {
|
||||
if doc_id,ok := item["id"].(float64);ok {
|
||||
doc,err := models.NewDocument().Find(int(doc_id));
|
||||
|
4
main.go
4
main.go
@@ -32,10 +32,8 @@ func main() {
|
||||
|
||||
beego.SetStaticPath("uploads","uploads")
|
||||
|
||||
|
||||
|
||||
|
||||
beego.ErrorController(&controllers.ErrorController{})
|
||||
|
||||
beego.Run()
|
||||
}
|
||||
|
||||
|
@@ -33,9 +33,12 @@ body{
|
||||
width: 280px;
|
||||
position: fixed;
|
||||
border-top: 1px solid #DDDDDD;
|
||||
bottom: 0;
|
||||
bottom: 15px;
|
||||
top: 40px;
|
||||
background-color: #FAFAFA;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow-y:auto;
|
||||
}
|
||||
.manual-category .manual-nav {
|
||||
font-size: 14px;
|
||||
|
@@ -187,7 +187,3 @@ function showSuccess($msg,$id) {
|
||||
$($id).addClass("success-message").removeClass("error-message").text($msg);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -10,6 +10,24 @@ $(function () {
|
||||
};
|
||||
wangEditor.config.menus.splice(0,0,"|");
|
||||
wangEditor.config.menus.splice(0,0,"save");
|
||||
wangEditor.config.menus.splice(0,0,"release");
|
||||
|
||||
//移除地图、背景色
|
||||
editor.config.menus = $.map(wangEditor.config.menus, function(item, key) {
|
||||
if (item === 'bgcolor') {
|
||||
return null;
|
||||
}
|
||||
if (item === 'fullscreen') {
|
||||
return null;
|
||||
}
|
||||
if (item === "undo"){
|
||||
return null;
|
||||
}
|
||||
if (item === "redo"){
|
||||
return null;
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
window.editor.ready(function () {
|
||||
if(window.documentCategory.length > 0){
|
||||
@@ -251,4 +269,24 @@ $(function () {
|
||||
}).on("move_node.jstree", jstree_save);
|
||||
|
||||
window.saveDocument = saveDocument;
|
||||
|
||||
window.releaseBook = function () {
|
||||
if(Object.prototype.toString.call(window.documentCategory) === '[object Array]' && window.documentCategory.length > 0){
|
||||
$.ajax({
|
||||
url : window.releaseURL,
|
||||
data :{"identify" : window.book.identify },
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function (res) {
|
||||
if(res.errcode === 0){
|
||||
layer.msg("发布任务已推送到任务队列,稍后将在后台执行。");
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg("没有需要发布的文档")
|
||||
}
|
||||
};
|
||||
});
|
47
static/wangEditor/plugins/release-menu.js
Normal file
47
static/wangEditor/plugins/release-menu.js
Normal file
@@ -0,0 +1,47 @@
|
||||
(function () {
|
||||
|
||||
// 获取 wangEditor 构造函数和 jquery
|
||||
var E = window.wangEditor;
|
||||
var $ = window.jQuery;
|
||||
|
||||
// 用 createMenu 方法创建菜单
|
||||
E.createMenu(function (check) {
|
||||
|
||||
// 定义菜单id,不要和其他菜单id重复。编辑器自带的所有菜单id,可通过『参数配置-自定义菜单』一节查看
|
||||
var menuId = 'release';
|
||||
|
||||
// check将检查菜单配置(『参数配置-自定义菜单』一节描述)中是否该菜单id,如果没有,则忽略下面的代码。
|
||||
if (!check(menuId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// this 指向 editor 对象自身
|
||||
var editor = this;
|
||||
|
||||
// 创建 menu 对象
|
||||
var menu = new E.Menu({
|
||||
editor: editor, // 编辑器对象
|
||||
id: menuId, // 菜单id
|
||||
title: '发布', // 菜单标题
|
||||
|
||||
// 正常状态和选中状态下的dom对象,样式需要自定义
|
||||
$domNormal: $('<a href="#" tabindex="-1"><i class="fa fa-cloud-upload" aria-hidden="true" name="release"></i></a>'),
|
||||
$domSelected: $('<a href="#" tabindex="-1" class="selected"><i class="fa fa-cloud-upload" aria-hidden="true" name="release"></i></a>')
|
||||
});
|
||||
|
||||
// 菜单正常状态下,点击将触发该事件
|
||||
menu.clickEvent = function (e) {
|
||||
window.releaseBook();
|
||||
};
|
||||
|
||||
// 菜单选中状态下,点击将触发该事件
|
||||
menu.clickEventSelected = function (e) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 增加到editor对象中
|
||||
editor.menus[menuId] = menu;
|
||||
});
|
||||
|
||||
})();
|
@@ -255,6 +255,7 @@
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<span id="form-error-message3" class="error-message"></span>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="submit" id="btnTransferBook" class="btn btn-primary">确定转让</button>
|
||||
</div>
|
||||
@@ -278,13 +279,13 @@
|
||||
});
|
||||
|
||||
$("#changePrivatelyOwnedForm").ajaxForm({
|
||||
beforeSumbit :function () {
|
||||
beforeSubmit :function () {
|
||||
$("#btnChangePrivatelyOwned").button("loading");
|
||||
},
|
||||
success :function (res) {
|
||||
|
||||
if(res.errcode === 0){
|
||||
window.location = window.location.href;
|
||||
return;
|
||||
}else{
|
||||
showError(res.message,"#form-error-message1");
|
||||
}
|
||||
@@ -363,7 +364,7 @@
|
||||
beforeSubmit : function () {
|
||||
var account = $.trim($("#receiveAccount").val());
|
||||
if (account === ""){
|
||||
return showError("接受者账号不能为空")
|
||||
return showError("接受者账号不能为空","#form-error-message3")
|
||||
}
|
||||
$("#btnTransferBook").button("loading");
|
||||
},
|
||||
@@ -371,7 +372,7 @@
|
||||
if(res.errcode === 0){
|
||||
window.location = window.location.href;
|
||||
}else{
|
||||
showError(res.message);
|
||||
showError(res.message,"#form-error-message3");
|
||||
}
|
||||
$("#btnTransferBook").button("reset");
|
||||
},
|
||||
|
@@ -126,6 +126,7 @@
|
||||
<script src="/static/jstree/3.3.4/jstree.min.js" type="text/javascript"></script>
|
||||
<script src="/static/wangEditor/js/wangEditor.min.js" type="text/javascript"></script>
|
||||
<script src="/static/wangEditor/plugins/save-menu.js" type="text/javascript"></script>
|
||||
<script src="/static/wangEditor/plugins/release-menu.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="/static/layer/layer.js"></script>
|
||||
<script src="/static/to-markdown/dist/to-markdown.js" type="text/javascript"></script>
|
||||
<script src="/static/js/jquery.form.js" type="text/javascript"></script>
|
||||
|
Reference in New Issue
Block a user