From 40eb9c776e1ef7a1c0628429798cd87a0881f8be Mon Sep 17 00:00:00 2001 From: bnu Date: Thu, 13 May 2010 00:34:42 +0000 Subject: [PATCH] =?UTF-8?q?=EC=8B=A4=EC=88=98;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7453 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../editor/tpl/js/app.thumbnail_selector.js | 107 ------------------ 1 file changed, 107 deletions(-) delete mode 100644 modules/editor/tpl/js/app.thumbnail_selector.js diff --git a/modules/editor/tpl/js/app.thumbnail_selector.js b/modules/editor/tpl/js/app.thumbnail_selector.js deleted file mode 100644 index c056f012e..000000000 --- a/modules/editor/tpl/js/app.thumbnail_selector.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * @author BNU - * @brief 썸네일 선택 및 크롭 - **/ - -;(function($) { - var thumbnailSelector = xe.createApp('thumbnailSelector', { - 'configs' : [], - 'init' : function(editor_sequence) { -console.log('init', arguments); - }, - 'setConfig' : function(editor_sequence, settings) { -console.log('setConfig', arguments); - var self = this; - this.container = $('#thumbnail_selector'); - this.editor_sequence = editor_sequence; - this.selectedImage = {}; - this.elObj = { - 'container' : this.container.find('.container'), - 'cropArea' : this.container.find('.cropArea .image'), - 'description' : this.container.find('p.description'), - 'btnSaveThumbnail' : this.container.find('button#btn_save_thumbnail') - }; - this.elObj.btnSaveThumbnail.click(function() { - self.cast('SAVE_THUMBNAIL_SETUP', []); - }); - $.extend(this.configs[editor_sequence], settings || {}); - }, - 'getConfig' : function(editor_sequence) { -console.log('setConfig', arguments); - if(!this.configs[editor_sequence]) return {'asdf':'asdefseaff'}; - return this.configs[editor_sequence]; - }, - 'setImage' : function(editor_sequence, settings) { -console.log('setImage', arguments); - var self = this; - var settings = uploaderSettings[editor_sequence]; - var fileListAreaID = settings["fileListAreaID"]; - var selected = $('#'+fileListAreaID+' option:selected'); - var file_srl = selected.val(); - if(!file_srl) return; - - var text = ''; - - this.selectedImage = uploadedFiles[file_srl]; - console.log(this.selectedImage); - - this.elObj.description.text('선택된 이미지 : '+this.selectedImage.source_filename); - - if(this.selectedImage.direct_download == 'Y' && /\.(jpg|jpeg|png|gif)$/i.test(this.selectedImage.download_url)) { - if(loaded_images[file_srl]) { - var obj = loaded_images[file_srl]; - } else { - var obj = new Image(); - obj.src = this.selectedImage.download_url; - } - temp_code = ''; - temp_code += "\""+this.selectedImage.source_filename+"\"";").css({'width':100, 'height':100, 'overflow':'hidden'}); - this.imageObj = $('img', this.elObj.cropArea).imgAreaSelect({ - instance: true, - aspectRatio: '4:3', - handles: true, - onSelectChange : function(img, selection) { - self.cast('IMG_AREA_SELECTCHANGE', [img, selection]); - } - }); - }, - API_IMG_AREA_SELECTCHANGE : function(self, info) { -console.log('API_IMG_AREA_SELECTCHANGE'); - var selection = info[1]; - if(!selection.width || !selection.height) return; - }, - API_SAVE_THUMBNAIL_SETUP : function() { -console.log('API_SAVE_THUMBNAIL_SETUP', arguments); - var thumbnailData = $.extend({}, this.imageObj.getSelection(), { - 'article_srl': editorRelKeys[this.editor_sequence]['primary'].value, - 'file_srl' : this.selectedImage.file_srl - }); - - if(!thumbnailData.width || !thumbnailData.height) { - if(!confirm('지정된 영역이 없습니다. 이미지 전체 크기를 사용하시겠습니까?')) return; - thumbnailData.fullsize = true; - } - - $.exec_json('media.procMediaSetThumbnail', thumbnailData, function(ret) { - alert(ret.message); - }); - - } - }); - - var oThumbnailSelector = new thumbnailSelector; - xe.registerApp(oThumbnailSelector); -}) (jQuery); \ No newline at end of file