编辑器Summernote有问题.我想将图像上传到服务器上的目录中.我有一些脚本:
<script type="text/javascript">
$(function () {
$(\'.summernote\').summernote({
height: 200
});
$(\'.summernote\').summernote({
height:300,
onImageUpload: function(files, editor, welEditable) {
sendFile(files[0],editor,welEditable);
}
});
});
</script>
<script type="text/javascript">
function sendFile(file, editor, welEditable) {
data = new FormData();
data.append("file", file);
url = "http://localhost/spichlerz/uploads";
$.ajax({
data: data,
type: "POST",
url: url,
cache: false,
contentType: false,
processData: false,
success: function (url) {
editor.insertImage(welEditable, url);
}
});
}
</script>
<td><textarea class="summernote" rows="10" cols="100" name="tekst"></textarea></td>
Run Code Online (Sandbox Code Playgroud)
当然我有所有的js和css文件.我做错了什么?如果我单击图像上传并转到编辑器,则图像不在textarea中.
如果我删除sendFile函数和onImageUpload:图像保存在base64上.
链接到summernote:http://hackerwins.github.io/summernote/
我在laravel应用程序上使用npm安装了bootstrap 4.但我认为bootstrap 3在后面工作而不是bootstrap 4.
使用命令:
我有事要做吗?或者我是否需要手动导入bootstrap到assets/sass/app.scss文件?
我想在没有循环的情况下切换n次.
切换3次后的1(位)将为0,依此类推.为了切换1次,我使用bit ^ = 1.我实际上搜索了一些操作公式来这样做.
假设我们有 2 个 jstree 实例。这里的n1, n2节点来自第一棵树,n3, n4节点来自第二棵树。我想在 n4 中移动/拖动 n2 节点。但似乎该move_node方法在不同树实例上移动节点时不会触发。
$('#A').jstree({
"core" : {
"check_callback" : true,
"data" : [{"text":"Root 1","id":"n1"}, {"text":"Root 2","id":"n2"}]
},
plugins:['dnd'],
});
$('#B').jstree({
"core" : {
"check_callback" : true,
"data" : [{"text":"Root 3","id":"n3"}, {"text":"Root 4","id":"n4"}]
},
plugins:['dnd'],
});
//setTimeout(function () {
var a = $('#A').on('move_node.jstree', function(e, data) {
console.log('move success');
});
var b = $('#B').on('move_node.jstree', function(e, data) {
console.log('move success');
});
//}, 500);Run Code Online (Sandbox Code Playgroud)
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.1/themes/default/style.min.css">
</head>
<script …Run Code Online (Sandbox Code Playgroud)javascript ×3
antd ×1
c++ ×1
image ×1
jquery ×1
jstree ×1
laravel ×1
laravel-5.4 ×1
reactjs ×1
summernote ×1
tree ×1
upload ×1