|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
import $ from 'jquery'
|
|
|
|
|
import 'jquery-contextmenu'
|
|
|
|
|
import copy from 'copy-text-to-clipboard'
|
|
|
|
|
import axios from "axios";
|
|
|
|
|
import qs from "querystring";
|
|
|
|
|
|
|
|
|
|
function renderTree(tree) {
|
|
|
|
|
if (!tree) return []
|
|
|
|
@ -22,7 +24,17 @@ function connectContextMenu(editor) {
|
|
|
|
|
createNewPage: {
|
|
|
|
|
name: 'Create page from item',
|
|
|
|
|
callback: function (key, opt) {
|
|
|
|
|
console.log('Create page from item', key, opt)
|
|
|
|
|
console.log('Create page from item')
|
|
|
|
|
editor.flat(this, {base: true}).then(result => {
|
|
|
|
|
let data = {
|
|
|
|
|
'json': 1,
|
|
|
|
|
'p': result.title,
|
|
|
|
|
'summary': "",
|
|
|
|
|
'content': JSON.stringify(result.children),
|
|
|
|
|
};
|
|
|
|
|
console.log(data)
|
|
|
|
|
return axios.post('/save/', qs.encode(data))
|
|
|
|
|
}).then()
|
|
|
|
|
},
|
|
|
|
|
className: 'action-new-page'
|
|
|
|
|
},
|
|
|
|
|