zoukankan      html  css  js  c++  java
  • 开发备忘录

    在家玩了几天,

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

    开始做小程序后台了,后台前端用的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);
                    }
                });
  • 相关阅读:
    为什么解析 array_column不可用,
    Android经常使用的布局类整理(一)
    C++ Coding Standard
    Kd-Tree算法原理和开源实现代码
    2013年10月5日国庆上班前一天
    2013年10月5日
    2013年10月3日合肥归来
    国庆第二天参加室友婚礼
    国庆随笔
    2013第40周日国庆放假前一天晚上
  • 原文地址:https://www.cnblogs.com/wu-xin/p/12248984.html
Copyright © 2011-2022 走看看