{"action":"created","issue":{"url":"https://api.github.com/repos/wangfupeng1988/wangEditor/issues/374","repository_url":"https://api.github.com/repos/wangfupeng1988/wangEditor","labels_url":"https://api.github.com/repos/wangfupeng1988/wangEditor/issues/374/labels{/name}","comments_url":"https://api.github.com/repos/wangfupeng1988/wangEditor/issues/374/comments","events_url":"https://api.github.com/repos/wangfupeng1988/wangEditor/issues/374/events","html_url":"https://github.com/wangfupeng1988/wangEditor/issues/374","id":170689393,"number":374,"title":"chrome下点击上传图标无效","user":{"login":"falstack","id":16357724,"avatar_url":"https://avatars.githubusercontent.com/u/16357724?v=3","gravatar_id":"","url":"https://api.github.com/users/falstack","html_url":"https://github.com/falstack","followers_url":"https://api.github.com/users/falstack/followers","following_url":"https://api.github.com/users/falstack/following{/other_user}","gists_url":"https://api.github.com/users/falstack/gists{/gist_id}","starred_url":"https://api.github.com/users/falstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falstack/subscriptions","organizations_url":"https://api.github.com/users/falstack/orgs","repos_url":"https://api.github.com/users/falstack/repos","events_url":"https://api.github.com/users/falstack/events{/privacy}","received_events_url":"https://api.github.com/users/falstack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-11T16:32:59Z","updated_at":"2016-08-13T00:06:37Z","closed_at":null,"body":"当我设置customUpload = true，customUploadInit = uploadInit时，点击上传图片，无法弹出文件选择框，而当我设置成uploadImgUrl = '/upload';时，就可以弹出文件选择框，这该如何解决？\r\n\r\nwangEditor版本：2.1.10\r\n浏览器，chrome，Safari，firefox都是这样。"},"comment":{"url":"https://api.github.com/repos/wangfupeng1988/wangEditor/issues/comments/239587568","html_url":"https://github.com/wangfupeng1988/wangEditor/issues/374#issuecomment-239587568","issue_url":"https://api.github.com/repos/wangfupeng1988/wangEditor/issues/374","id":239587568,"user":{"login":"falstack","id":16357724,"avatar_url":"https://avatars.githubusercontent.com/u/16357724?v=3","gravatar_id":"","url":"https://api.github.com/users/falstack","html_url":"https://github.com/falstack","followers_url":"https://api.github.com/users/falstack/followers","following_url":"https://api.github.com/users/falstack/following{/other_user}","gists_url":"https://api.github.com/users/falstack/gists{/gist_id}","starred_url":"https://api.github.com/users/falstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falstack/subscriptions","organizations_url":"https://api.github.com/users/falstack/orgs","repos_url":"https://api.github.com/users/falstack/repos","events_url":"https://api.github.com/users/falstack/events{/privacy}","received_events_url":"https://api.github.com/users/falstack/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T00:06:36Z","updated_at":"2016-08-13T00:06:36Z","body":"你好，我在本地开了一个demo页面，尝试后仍然是是问题描述的情况，我贴一下代码，麻烦帮忙看一下是哪里的问题，谢谢。\r\n\r\n```javascript\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>wangEditor</title>\r\n    <link href=\"http://cdn.bootcss.com/wangeditor/2.1.10/css/wangEditor.min.css\" rel=\"stylesheet\">\r\n    <style type=\"text/css\">\r\n        #div1 {\r\n            width: 100%;\r\n            height: 500px;\r\n        }\r\n    </style>\r\n</head>\r\n<body>\r\n<div id=\"div1\">\r\n    <p>请输入内容...</p>\r\n</div>\r\n\r\n<script src=\"http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js\"></script>\r\n<script src=\"http://cdn.bootcss.com/plupload/2.1.9/plupload.full.min.js\"></script>\r\n<script src=\"http://cdn.bootcss.com/qiniu-js/1.0.15-beta/qiniu.min.js\"></script>\r\n<script src=\"http://cdn.bootcss.com/wangeditor/2.1.10/js/wangEditor.min.js\"></script>\r\n<script type=\"text/javascript\">\r\n    $(function () {\r\n        function printLog(title, info) {\r\n            window.console && console.log(title, info);\r\n        }\r\n\r\n        // 初始化七牛上传\r\n        function uploadInit() {\r\n            // this 即 editor 对象\r\n            var editor = this;\r\n            // 触发选择文件的按钮的id\r\n            var btnId = editor.customUploadBtnId;\r\n            // 触发选择文件的按钮的父容器的id\r\n            var containerId = editor.customUploadContainerId;\r\n\r\n            // 创建上传对象\r\n            var uploader = Qiniu.uploader({\r\n                runtimes: 'html5,flash,html4',    //上传模式,依次退化\r\n                browse_button: btnId,       //上传选择的点选按钮，**必需**\r\n                uptoken_url: '/uptoken',\r\n                //Ajax请求upToken的Url，**强烈建议设置**（服务端提供）\r\n                // uptoken : '<Your upload token>',\r\n                //若未指定uptoken_url,则必须指定 uptoken ,uptoken由其他程序生成\r\n                // unique_names: true,\r\n                // 默认 false，key为文件名。若开启该选项，SDK会为每个文件自动生成key（文件名）\r\n                // save_key: true,\r\n                // 默认 false。若在服务端生成uptoken的上传策略中指定了 `sava_key`，则开启，SDK在前端将不对key进行任何处理\r\n                domain: 'http://cdn.xxx.com/',\r\n                //bucket 域名，下载资源时用到，**必需**\r\n                container: containerId,           //上传区域DOM ID，默认是browser_button的父元素，\r\n                max_file_size: '100mb',           //最大文件体积限制\r\n                flash_swf_url: '../js/plupload/Moxie.swf',  //引入flash,相对路径\r\n                filters: {\r\n                    mime_types: [\r\n                        //只允许上传图片文件 （注意，extensions中，逗号后面不要加空格）\r\n                        { title: \"图片文件\", extensions: \"jpg,gif,png,bmp\" }\r\n                    ]\r\n                },\r\n                max_retries: 3,                   //上传失败最大重试次数\r\n                dragdrop: true,                   //开启可拖曳上传\r\n                drop_element: 'editor-container',        //拖曳上传区域元素的ID，拖曳文件或文件夹后可触发上传\r\n                chunk_size: '4mb',                //分块上传时，每片的体积\r\n                auto_start: true,                 //选择文件后自动上传，若关闭需要自己绑定事件触发上传\r\n                init: {\r\n                    'FilesAdded': function(up, files) {\r\n                        plupload.each(files, function(file) {\r\n                            // 文件添加进队列后,处理相关的事情\r\n                            printLog('on FilesAdded');\r\n                        });\r\n                    },\r\n                    'BeforeUpload': function(up, file) {\r\n                        // 每个文件上传前,处理相关的事情\r\n                        printLog('on BeforeUpload');\r\n                    },\r\n                    'UploadProgress': function(up, file) {\r\n                        // 显示进度条\r\n                        editor.showUploadProgress(file.percent);\r\n                    },\r\n                    'FileUploaded': function(up, file, info) {\r\n                        // 每个文件上传成功后,处理相关的事情\r\n                        // 其中 info 是文件上传成功后，服务端返回的json，形式如\r\n                        // {\r\n                        //    \"hash\": \"Fh8xVqod2MQ1mocfI4S4KpRL6D98\",\r\n                        //    \"key\": \"gogopher.jpg\"\r\n                        //  }\r\n                        printLog(info);\r\n                        // 参考http://developer.qiniu.com/docs/v6/api/overview/up/response/simple-response.html\r\n\r\n                        var domain = up.getOption('domain');\r\n                        var res = $.parseJSON(info);\r\n                        var sourceLink = domain + res.key; //获取上传成功后的文件的Url\r\n\r\n                        printLog(sourceLink);\r\n\r\n                        // 插入图片到editor\r\n                        editor.command(null, 'insertHtml', '<img src=\"' + sourceLink + '\" style=\"max-width:100%;\"/>')\r\n                    },\r\n                    'Error': function(up, err, errTip) {\r\n                        //上传出错时,处理相关的事情\r\n                        printLog('on Error');\r\n                    },\r\n                    'UploadComplete': function() {\r\n                        //队列文件处理完毕后,处理相关的事情\r\n                        printLog('on UploadComplete');\r\n\r\n                        // 隐藏进度条\r\n                        editor.hideUploadProgress();\r\n                    }\r\n                }\r\n            });\r\n        }\r\n\r\n        var editor = new wangEditor('div1');\r\n        editor.config.menus = [\r\n\r\n//                'source',\r\n//                '|',\r\n            'bold',\r\n            'underline',\r\n            'italic',\r\n            'strikethrough',\r\n            'eraser',\r\n//                'forecolor',\r\n//                'bgcolor',\r\n            '|',\r\n            'quote',\r\n//                'fontfamily',\r\n//                'fontsize',\r\n//                'head',\r\n//                'unorderlist',\r\n//                'orderlist',\r\n//                'alignleft',\r\n//                'aligncenter',\r\n//                'alignright',\r\n//                '|',\r\n            'link',\r\n//                'unlink',\r\n            'table',\r\n//                'emotion',\r\n//                '|',\r\n            'img',\r\n//                'video',\r\n//                'location',\r\n//                'insertcode',\r\n            '|',\r\n            'undo',\r\n//                'redo',\r\n            'fullscreen'\r\n        ];\r\n\r\n        editor.config.customUpload = true;  // 设置自定义上传的开关\r\n        editor.config.customUploadInit = uploadInit;\r\n//        editor.config.uploadImgUrl = '/upload';\r\n\r\n        editor.create();\r\n    });\r\n</script>\r\n</body>\r\n</html>\r\n```"}}
{"actor":{"display_login":"falstack"}}