• 开发备忘录


    在家玩了几天,

    完全忘记上班的时候写的代码了,但是也怪我基本上都是百度了,感觉可以了也没有记下来

    开始做小程序后台了,后台前端用的AceAdmin

    这次用了好半天总算搜到了,哎又是搜到的

    一个表格插件

    Bootstrap Table 挺好看的,感觉配置起来也不复杂

    富文本编辑器

    TinyMCE

    把我的配置记下来,做个备忘

     tinymce.init({
                    selector: '#ArticleContent',
                    language: 'zh_CN',
                    height: 650,
                    min_height: 500,
                    object_resizing: false,
                    setup: function (editor) {
                        editor.on('change', function () {
                            editor.save();
                        });
                    },
                    convert_urls: false, // 图片路径 ,设置成false后可以防止生成相对路径
    
    
                    plugins: ' preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template importcss code codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave   autoresize  axupimgs',
                    toolbar: 'styleselect code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | 
                                                             styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | 
                                                             table image media charmap emoticons hr pagebreak insertdatetime  preview | fullscreen |  axupimgs',
                    //content_css: "../Content/tinymce/global.css",
                    images_upload_handler: function (blobInfo, succFun, failFun) {
                        var xhr, formData;
                        var file = blobInfo.blob();//转化为易于理解的file对象
                        xhr = new XMLHttpRequest();
                        xhr.withCredentials = false;
                        xhr.open('POST', '/Article/Upload');
                        xhr.onload = function () {
                            var json;
                            if (xhr.status != 200) {
                                console.log('HTTP Error: ' + xhr.status);
                                return;
                            }
                            json = JSON.parse(xhr.responseText);
                            //if (!json || typeof json.location != 'string') {
                            //    console.log('Invalid JSON: ' + xhr.responseText);
                            //    return;
                            //}
                            if (json.status == false) {
                                console.log('Invalid JSON: ' + xhr.responseText);
                                return;
                            }
                            succFun(json.url);
                        };
                        formData = new FormData();
                        formData.append('file', file, file.name);
                        xhr.send(formData);
                    }
                });
  • 相关阅读:
    sql常用语句
    java学习(东软睿道)2019-09-06(预课)《随堂笔记》
    Servlet和JSP学习总结
    由字符集的转换想到的问题
    mysql主从搭建
    CentOS 源码安装MySQL5.7
    Linux搭建FTP服务器
    连接MySQL报错误代码 ERROR 1045时的解决方案
    [js]使用百度编辑器uediter时遇到的一些问题(span,div等被过滤)
    [css]将textarea前的文字设置在左上角
  • 原文地址:https://www.cnblogs.com/wu-xin/p/12248984.html
Copyright © 2020-2023  润新知