메뉴 건너뛰기

XE 에디터 '본문삽입'할 때 도메인주소 중복 회피

Average Rating:
 0명 참여
Rate this page:
평점 한줄평 글쓴이 작성날짜

xe 1.8.1의 ckeditor 사용시 첨부 파일을 본문에 삽입 할 때 생기는 일종의 버그입니다.


첨부파일이 외부파일일 경우에 도메인 주소가 불필요하게 붙게 되는 문제를 해결합니다.




,site_url = window.request_uri;if(/(http\:|https\:|ftp\:|telnet\#)/i.test(g.download_url)) site_url ='';




xe/common/js/main.min.js (수정본)


!function(a){"use strict";var b={autoUpload:!0,dataType:"json",replaceFileInput:!1,dropZone:".xefu-dropzone",fileList:".xefu-list",controll:".xefu-controll",filelist:".xefu-list-files ul",filelistImages:".xefu-list-images ul",progressbar:".xefu-progressbar",progressbarGraph:".xefu-progressbar div",progressStatus:".xefu-progress-status",progressPercent:".xefu-progress-percent",actSelectedInsertContent:".xefu-act-link-selected",actSelectedDeleteFile:".xefu-act-delete-selected",actDeleteFile:".xefu-act-delete",tmplXeUploaderFileitem:'<li class="xefu-file xe-clearfix" data-file-srl="{{file_srl}}"><span class="xefu-file-name">{{source_filename}}</span><span class="xefu-file-info"><span>{{disp_file_size}}</span><span><input type="checkbox" data-file-srl="{{file_srl}}"> 선택</span></span></li>',tmplXeUploaderFileitemImage:'<li class="xefu-file xefu-file-image" data-file-srl="{{file_srl}}"><strong class="xefu-file-name">{{source_filename}}</strong><span class="xefu-file-info"><span class="xefu-file-size">{{disp_file_size}}</span><span><img src="{{download_url}}" alt=""></span><span><input type="checkbox" data-file-srl="{{file_srl}}"></span></span></li>'},c=["fileList","actSelectedInsertContent","actSelectedDeleteFile","actDeleteFile","controll","dropZone","filelist","filelistImages","progressbar","progressbarGraph","progressPercent","progressStatus"],d=xe.createApp("XeUploader",{files:{},selected_files:{},settings:{},last_selected_file:null,editor_sequence:null,init:function(){},createInstance:function(d,e){var f=this,g=this.$container=d,h=g.data();this.editor_sequence=h.editorSequence;var i={url:request_uri.setQuery("module","file").setQuery("act","procFileUpload"),formData:{editor_sequence:h.editorSequence,upload_target_srl:h.uploadTargetSrl,mid:window.current_mid},dropZone:g,add:function(b,c){var d=jQuery.Deferred();a.each(c.files,function(a,b){return f.settings.maxFileSize<=b.size?(d.reject(),alert(window.xe.msg_exceeds_limit_size),!1):void d.resolve()}),d.done(function(){c.submit()})},done:function(a,b){var c=b.response().result;c&&(jQuery.isPlainObject(c)||(c=jQuery.parseJSON(c)),c&&(0==c.error||alert(c.message)))},stop:function(){f.loadFilelist()},start:function(){f.settings.progressbarGraph.width(0),f.settings.progressStatus.show(),f.settings.progressbar.show()},progressall:function(a,b){var c=parseInt(b.loaded/b.total*100,10);f.settings.progressbarGraph.width(c+"%"),f.settings.progressPercent.text(c+"%"),c>=100&&(f.settings.progressbar.delay(3e3).slideUp(),f.settings.progressStatus.delay(3e3).slideUp())}};this.settings=a.extend({},b,i,e||{}),a.each(c,function(a,b){"string"==typeof f.settings[b]&&(f.settings[b]=g.find(f.settings[b]))});g.fileupload(this.settings).prop("disabled",!a.support.fileInput).parent().addClass(a.support.fileInput?void 0:"disabled");g.data("xefu-instance",this),this.loadFilelist(),this.settings.actSelectedInsertContent.on("click",function(){f.insertToContent()}),this.settings.actSelectedDeleteFile.on("click",function(){f.deleteFile()});var j=this.settings.fileList.finderSelect({children:"li"});this.settings.fileList.on("mousedown","img",function(a){a.preventDefault()}),j.finderSelect("addHook","highlight:after",function(a){a.find("input").prop("checked",!0);var b=f.settings.fileList.find("input:checked");f.selected_files=b}),j.finderSelect("addHook","unHighlight:after",function(a){a.find("input").prop("checked",!1);var b=f.settings.fileList.find("input:checked");f.selected_files=b}),j.on("click",":checkbox",function(a){a.preventDefault()}),a(document).bind("dragover",function(a){var b=window.dropZoneTimeout;b?clearTimeout(b):f.settings.dropZone.addClass("in");var c=!1,d=a.target;do{if(d===dropZone[0]){c=!0;break}d=d.parentNode}while(null!=d);c?f.settings.dropZone.addClass("hover"):f.settings.dropZone.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,f.settings.dropZone.removeClass("in hover")},100)})},done:function(){},selectAllFiles:function(){},selectImageFiles:function(){},selectNonImageFiles:function(){},unselectAllFiles:function(){},unselectImageFiles:function(){},unselectNonImageFiles:function(){},insertToContent:function(){var b=this,c="";a.each(this.selected_files,function(d,e){var f=a(e).data().fileSrl,g=b.files[f],site_url = window.request_uri;if(/(http\:|https\:|ftp\:|telnet\#)/i.test(g.download_url)) site_url ='';g&&(/\.(jpe?g|png|gif)$/i.test(g.download_url)?(c+='<img src="'+site_url+g.download_url+'" alt="'+g.source_filename+'" editor_component="image_link" data-file-srl="'+g.file_srl+'" />',c+="\r\n<p><br></p>\r\n"):c+='<a href="'+site_url+g.download_url+'" data-file-srl="'+g.file_srl+'">'+g.source_filename+"</a>\n")}),_getCkeInstance(this.editor_sequence).insertHtml(c,"unfiltered_html")},deleteFile:function(b){var c=this,d=[];b?d.push(b):a.each(c.selected_files,function(b,c){if(c){var e=a(c).data().fileSrl;d.push(e)}}),d=d.join(","),exec_json("file.procFileDelete",{file_srls:d,editor_sequence:this.editor_sequence},function(){d=d.split(","),a.each(d,function(a,b){c.settings.fileList.find("ul").find("li[data-file-srl="+b+"]").remove()}),c.loadFilelist()})},loadFilelist:function(){var b=this,c=this.$container.data();a.exec_json("file.getFileList",{editor_sequence:b.$container.data("editor-sequence")},function(d){c.uploadTargetSrl=d.upload_target_srl,editorRelKeys[b.$container.data("editor-sequence")].primary.value=d.upload_target_srl,c.uploadTargetSrl=d.uploadTargetSrl,a(".allowed_filetypes").text(d.allowed_filetypes),a(".allowed_filesize").text(d.allowed_filesize),a(".allowed_attach_size").text(d.allowed_attach_size),a(".attached_size").text(d.attached_size),a(".file_count").text(d.files.length);var e=b.settings.tmplXeUploaderFileitem,f=b.settings.tmplXeUploaderFileitemImage,g=Handlebars.compile(e),h=Handlebars.compile(f),i=[],j=[];return d.files.length?(a.each(d.files,function(a,c){b.files[c.file_srl]||(b.files[c.file_srl]=c,/\.(jpe?g|png|gif)$/i.test(c.source_filename)?i.push(h(c)):j.push(g(c)))}),b.settings.filelistImages.append(i.join("")),b.settings.filelist.append(j.join("")),b.settings.controll.show(),void b.settings.fileList.show()):(b.settings.fileList.hide(),void b.settings.controll.hide())})}});a.fn.xeUploader=function(a){var b=new d;return b&&(xe.registerApp(b),b.createInstance(this.eq(0),a)),b}}(jQuery);



제목 날짜
Star Rating 별점 위젯 업데이트 정보   2014.03.09
xe 사용자정의 정렬 활용법   file
    9
xe Thumbnail wizard 모듈 참고 자료  
zend picasa ssl conection error   file
masonry 예제  
태그 목록