KindEditor 4.X 以上版本取消远程图片上传功能(3.x版本的请往官网论坛找答案)

来源:互联网 发布:内地网络女歌手排行榜 编辑:程序博客网 时间:2024/05/16 00:05

找到包里KindEditor\Editor\plugins\image\image.js文件


一: 找到:

 if (allowImageUpload) {            tabs = K.tabs({                src: K('.tabs', div),                afterSelect: function (i) { }            });            //            tabs.add({            //            title : lang.remoteImage,            //            panel : K('.tab1', div)            //            });            tabs.add({                title: lang.localImage,                panel: K('.tab2', div)            });            tabs.select(tabIndex);        } else {            K('.tab1', div).show();        }

将增加远程图片的这个tab注释掉

tabs.add({title : lang.remoteImage,panel : K('.tab1', div)});


2:  找到:

 yesBtn: {                name: self.lang('yes'),                click: function (e) {                    // Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319                    if (dialog.isLoading) {                        return;                    }                    // insert local image                    if (tabs && tabs.selectedIndex === 0) {                //--原来这里是1,改成0                        if (uploadbutton.fileBox.val() == '') {                            alert(self.lang('pleaseSelectFile'));                            return;                        }                        dialog.showLoading(self.lang('uploadLoading'));                        uploadbutton.submit();                        localUrlBox.val('');                        return;                    }

  if (tabs && tabs.selectedIndex === 1) {
 
改成  

  if (tabs && tabs.selectedIndex === 0) {   


因为远程图片的tab被注释掉了,所以原来索引是1的本地图片tab索引变为0


原创粉丝点击