mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
adjust layout and menus for wangEditor
This commit is contained in:
@@ -342,4 +342,16 @@ $(function () {
|
||||
layer.msg("没有需要发布的文档")
|
||||
}
|
||||
};
|
||||
|
||||
$(window).resize(function(e) {
|
||||
var $container = $(editor.$textContainerElem.elems[0]);
|
||||
var $manual = $container.closest('.manual-wangEditor');
|
||||
var maxHeight = $manual.closest('.manual-editor-container').innerHeight();
|
||||
var statusHeight = $manual.siblings('.manual-editor-status').outerHeight(true);
|
||||
var manualHeihgt = maxHeight - statusHeight;
|
||||
$manual.height(manualHeihgt);
|
||||
var toolbarHeight = $container.siblings('.w-e-toolbar').outerHeight(true);
|
||||
$container.height($container.parent().innerHeight() - toolbarHeight);
|
||||
});
|
||||
$(window).trigger('resize');
|
||||
});
|
||||
42
static/js/wangEditor-plugins/attach-menu.js
Normal file
42
static/js/wangEditor-plugins/attach-menu.js
Normal file
@@ -0,0 +1,42 @@
|
||||
(function () {
|
||||
|
||||
// 获取 wangEditor 构造函数和 jquery
|
||||
var E = window.wangEditor;
|
||||
var $ = window.jQuery;
|
||||
|
||||
let AttachMenu = (function (_BtnMenu) {
|
||||
c2b_inherits(AttachMenu, _BtnMenu);
|
||||
|
||||
var _super = c2b_createSuper(AttachMenu);
|
||||
|
||||
function AttachMenu(editor) {
|
||||
c2b_classCallCheck(this, AttachMenu);
|
||||
|
||||
const $elem = E.$(`<div class="w-e-menu" data-title="附件">
|
||||
<i class="fa fa-paperclip" aria-hidden="true"></i>
|
||||
</div>`);
|
||||
return _super.call(this, $elem, editor);
|
||||
}
|
||||
|
||||
c2b_createClass(AttachMenu, [
|
||||
{
|
||||
key: "clickHandler",
|
||||
value: function clickHandler() {
|
||||
$("#uploadAttachModal").modal("show");
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "tryChangeActive",
|
||||
value: function tryChangeActive() {
|
||||
// this.active();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
return AttachMenu;
|
||||
})(E.BtnMenu);
|
||||
|
||||
|
||||
var menuKey = 'attach';
|
||||
E.registerMenu(menuKey, AttachMenu);
|
||||
})();
|
||||
42
static/js/wangEditor-plugins/history-menu.js
Normal file
42
static/js/wangEditor-plugins/history-menu.js
Normal file
@@ -0,0 +1,42 @@
|
||||
(function () {
|
||||
|
||||
// 获取 wangEditor 构造函数和 jquery
|
||||
var E = window.wangEditor;
|
||||
var $ = window.jQuery;
|
||||
|
||||
let HistoryMenu = (function (_BtnMenu) {
|
||||
c2b_inherits(HistoryMenu, _BtnMenu);
|
||||
|
||||
var _super = c2b_createSuper(HistoryMenu);
|
||||
|
||||
function HistoryMenu(editor) {
|
||||
c2b_classCallCheck(this, HistoryMenu);
|
||||
|
||||
const $elem = E.$(`<div class="w-e-menu" data-title="history">
|
||||
<i class="fa fa-history" aria-hidden="true"></i>
|
||||
</div>`);
|
||||
return _super.call(this, $elem, editor);
|
||||
}
|
||||
|
||||
c2b_createClass(HistoryMenu, [
|
||||
{
|
||||
key: "clickHandler",
|
||||
value: function clickHandler() {
|
||||
window.documentHistory();
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "tryChangeActive",
|
||||
value: function tryChangeActive() {
|
||||
// this.active();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
return HistoryMenu;
|
||||
})(E.BtnMenu);
|
||||
|
||||
|
||||
var menuKey = '历史';
|
||||
E.registerMenu(menuKey, HistoryMenu);
|
||||
})();
|
||||
42
static/js/wangEditor-plugins/release-menu.js
Normal file
42
static/js/wangEditor-plugins/release-menu.js
Normal file
@@ -0,0 +1,42 @@
|
||||
(function () {
|
||||
|
||||
// 获取 wangEditor 构造函数和 jquery
|
||||
var E = window.wangEditor;
|
||||
var $ = window.jQuery;
|
||||
|
||||
let ReleaseMenu = (function (_BtnMenu) {
|
||||
c2b_inherits(ReleaseMenu, _BtnMenu);
|
||||
|
||||
var _super = c2b_createSuper(ReleaseMenu);
|
||||
|
||||
function ReleaseMenu(editor) {
|
||||
c2b_classCallCheck(this, ReleaseMenu);
|
||||
|
||||
const $elem = E.$(`<div class="w-e-menu" data-title="发布">
|
||||
<i class="fa fa-cloud-upload" aria-hidden="true"></i>
|
||||
</div>`);
|
||||
return _super.call(this, $elem, editor);
|
||||
}
|
||||
|
||||
c2b_createClass(ReleaseMenu, [
|
||||
{
|
||||
key: "clickHandler",
|
||||
value: function clickHandler() {
|
||||
window.releaseBook();
|
||||
}
|
||||
},
|
||||
{
|
||||
key: "tryChangeActive",
|
||||
value: function tryChangeActive() {
|
||||
// this.active();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
||||
return ReleaseMenu;
|
||||
})(E.BtnMenu);
|
||||
|
||||
|
||||
var menuKey = 'release';
|
||||
E.registerMenu(menuKey, ReleaseMenu);
|
||||
})();
|
||||
Reference in New Issue
Block a user