From 303fec0c1bfbb53d8c915ef0ea4d54fc4857ec74 Mon Sep 17 00:00:00 2001 From: ChanMyeong Date: Wed, 22 Dec 2010 05:06:57 +0000 Subject: [PATCH] thumbnail language update. git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7987 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../components/image_gallery/lang/ko.lang.php | 54 +-- .../image_gallery/tpl/list_gallery.js | 164 ++++---- .../image_gallery/tpl/slide_gallery.js | 392 +++++++++--------- 3 files changed, 305 insertions(+), 305 deletions(-) diff --git a/modules/editor/components/image_gallery/lang/ko.lang.php b/modules/editor/components/image_gallery/lang/ko.lang.php index 37e614c7e..1f0b7bbad 100644 --- a/modules/editor/components/image_gallery/lang/ko.lang.php +++ b/modules/editor/components/image_gallery/lang/ko.lang.php @@ -1,27 +1,27 @@ - 이미지갤러리(image_gallery) 컴포넌트의 언어팩 - **/ - - $lang->image_gallery = '이미지 갤러리 제작'; - $lang->width = '가로'; - $lang->height = '세로'; - $lang->image_list = '이미지 목록'; - $lang->gallery_style = '갤러리 형식 '; - $lang->gallery_slide_style = '슬라이드 형식'; - $lang->gallery_slide_align = '정렬방식'; - $lang->gallery_slide_center = '가운데'; - $lang->gallery_slide_left = '왼쪽'; - $lang->gallery_slide_right = '오른쪽'; - $lang->gallery_list_style = '모두 펼침'; - $lang->gallery_border_color = '테두리 색'; - $lang->gallery_border_thickness = '테두리 두께'; - $lang->gallery_bg_color = '배경색'; - $lang->about_image_list = '이미지 갤러리에 추가할 파일을 선택하세요. 선택 후 드래그 또는 shift+클릭(범위선택), ctrl+클릭(개별선택) 가능합니다.'; - - $lang->cmd_gallery_prev = '이전 그림 보기'; - $lang->cmd_gallery_next = '다음 그림 보기'; - $lang->cmd_gallery_thumbnail = '썸네일 보기'; -?> + 이미지갤러리(image_gallery) 컴포넌트의 언어팩 + **/ + + $lang->image_gallery = '이미지 갤러리 제작'; + $lang->width = '가로'; + $lang->height = '세로'; + $lang->image_list = '이미지 목록'; + $lang->gallery_style = '갤러리 형식 '; + $lang->gallery_slide_style = '슬라이드 형식'; + $lang->gallery_slide_align = '정렬방식'; + $lang->gallery_slide_center = '가운데'; + $lang->gallery_slide_left = '왼쪽'; + $lang->gallery_slide_right = '오른쪽'; + $lang->gallery_list_style = '모두 펼침'; + $lang->gallery_border_color = '테두리 색'; + $lang->gallery_border_thickness = '테두리 두께'; + $lang->gallery_bg_color = '배경색'; + $lang->about_image_list = '이미지 갤러리에 추가할 파일을 선택하세요. 선택 후 드래그 또는 shift+클릭(범위선택), ctrl+클릭(개별선택) 가능합니다.'; + + $lang->cmd_gallery_prev = '이전 그림 보기'; + $lang->cmd_gallery_next = '다음 그림 보기'; + $lang->cmd_gallery_thumbnail = '섬네일 보기'; +?> diff --git a/modules/editor/components/image_gallery/tpl/list_gallery.js b/modules/editor/components/image_gallery/tpl/list_gallery.js index 85d7c0e4d..90088eac6 100644 --- a/modules/editor/components/image_gallery/tpl/list_gallery.js +++ b/modules/editor/components/image_gallery/tpl/list_gallery.js @@ -1,82 +1,82 @@ -/** - * @file list_gallery.js - * @brief 이미지 이미지갤러리 쇼 스크립트 - * @author NHN (developers@xpressengine.com) - **/ - -// 이미지갤러리쇼를 하기 위한 변수 -var list_gallery_images = new Array(); - -// 이미지갤러리쇼 이미지 목록에 추가 -function list_gallery_add_image(srl, image_url) { - if(!image_url) return; - if(image_url.indexOf('files')==0) image_url = request_uri+image_url; - - // 객체 생성 - var obj = {"srl":0, "image_url":null, "image":null} - - // list_gallery_images에 이미지갤러리 쇼 고유번호에 해당하는 공간을 초기화 - if(typeof(list_gallery_images[srl])=="undefined") list_gallery_images[srl] = new Array(); - - // 이미지갤러리쇼 고유번호를 세팅 - obj.srl = srl; - obj.idx = list_gallery_images[srl].length; - - // 원본 이미지를 미리 로딩 - obj.image = new Image(); - obj.image.src = image_url; - obj.image.srl = obj.srl; - obj.image.idx = obj.idx; - - // 생성된 객체를 list_gallery_images[이미지갤러리쇼 고유번호]에 추가 - list_gallery_images[srl][list_gallery_images[srl].length] = obj; -} - -// 이미지갤러리쇼 시작 -function start_list_gallery() { - - // 등록된 모든 이미지 목록을 돌면서 목록을 만들어줌 - for(var srl in list_gallery_images) { - - // 등록된 이미지가 없으면 pass~ - if(!list_gallery_images[srl].length) continue; - - // 메인이미지가 나올 곳과 썸네일이 노출될 곳의 객체를 구함 - var zone = xGetElementById('zone_list_gallery_'+srl); - - // 갤러리 외부 박스보다 이미지가 클 경우 resizing시킴 - var borderTop = parseInt(zone.style.borderTopWidth.replace(/px$/,''),10); - var borderLeft = parseInt(zone.style.borderLeftWidth.replace(/px$/,''),10); - var borderRight = parseInt(zone.style.borderRightWidth.replace(/px$/,''),10); - var borderBottom = parseInt(zone.style.borderBottomWidth.replace(/px$/,''),10); - - var zone_width = xWidth(zone)-borderLeft-borderRight; - - // 이미지 출력 - for(var i=0; i(zone_width-25)) { - resize_scale = (zone_width-25)/image_width; - image_width = parseInt(image_width*resize_scale,10); - image_height = parseInt(image_height*resize_scale,10); - } - - obj.image.style.width = image_width+"px"; - obj.image.style.height = image_height+"px"; - obj.image.style.marginLeft = "10px"; - obj.image.style.marginBottom = "10px"; - obj.image.style.display = "block"; - - // 리사이즈 되었다면 resize_image 애드온의 slideshow() 기능 사용 - if(resize_scale != 1) obj.image.rel = 'xe_gallery'; - - zone.appendChild(obj.image); - } - zone.style.paddingTop = "10px"; - } -} +/** + * @file list_gallery.js + * @brief 이미지 이미지갤러리 쇼 스크립트 + * @author NHN (developers@xpressengine.com) + **/ + +// 이미지갤러리쇼를 하기 위한 변수 +var list_gallery_images = new Array(); + +// 이미지갤러리쇼 이미지 목록에 추가 +function list_gallery_add_image(srl, image_url) { + if(!image_url) return; + if(image_url.indexOf('files')==0) image_url = request_uri+image_url; + + // 객체 생성 + var obj = {"srl":0, "image_url":null, "image":null} + + // list_gallery_images에 이미지갤러리 쇼 고유번호에 해당하는 공간을 초기화 + if(typeof(list_gallery_images[srl])=="undefined") list_gallery_images[srl] = new Array(); + + // 이미지갤러리쇼 고유번호를 세팅 + obj.srl = srl; + obj.idx = list_gallery_images[srl].length; + + // 원본 이미지를 미리 로딩 + obj.image = new Image(); + obj.image.src = image_url; + obj.image.srl = obj.srl; + obj.image.idx = obj.idx; + + // 생성된 객체를 list_gallery_images[이미지갤러리쇼 고유번호]에 추가 + list_gallery_images[srl][list_gallery_images[srl].length] = obj; +} + +// 이미지갤러리쇼 시작 +function start_list_gallery() { + + // 등록된 모든 이미지 목록을 돌면서 목록을 만들어줌 + for(var srl in list_gallery_images) { + + // 등록된 이미지가 없으면 pass~ + if(!list_gallery_images[srl].length) continue; + + // 메인이미지가 나올 곳과 섬네일이 노출될 곳의 객체를 구함 + var zone = xGetElementById('zone_list_gallery_'+srl); + + // 갤러리 외부 박스보다 이미지가 클 경우 resizing시킴 + var borderTop = parseInt(zone.style.borderTopWidth.replace(/px$/,''),10); + var borderLeft = parseInt(zone.style.borderLeftWidth.replace(/px$/,''),10); + var borderRight = parseInt(zone.style.borderRightWidth.replace(/px$/,''),10); + var borderBottom = parseInt(zone.style.borderBottomWidth.replace(/px$/,''),10); + + var zone_width = xWidth(zone)-borderLeft-borderRight; + + // 이미지 출력 + for(var i=0; i(zone_width-25)) { + resize_scale = (zone_width-25)/image_width; + image_width = parseInt(image_width*resize_scale,10); + image_height = parseInt(image_height*resize_scale,10); + } + + obj.image.style.width = image_width+"px"; + obj.image.style.height = image_height+"px"; + obj.image.style.marginLeft = "10px"; + obj.image.style.marginBottom = "10px"; + obj.image.style.display = "block"; + + // 리사이즈 되었다면 resize_image 애드온의 slideshow() 기능 사용 + if(resize_scale != 1) obj.image.rel = 'xe_gallery'; + + zone.appendChild(obj.image); + } + zone.style.paddingTop = "10px"; + } +} diff --git a/modules/editor/components/image_gallery/tpl/slide_gallery.js b/modules/editor/components/image_gallery/tpl/slide_gallery.js index 8ecf8696a..08fe059a7 100644 --- a/modules/editor/components/image_gallery/tpl/slide_gallery.js +++ b/modules/editor/components/image_gallery/tpl/slide_gallery.js @@ -1,196 +1,196 @@ -/** - * @file slide_gallery.js - * @brief 이미지 이미지갤러리 쇼 스크립트 - * @author NHN (developers@xpressengine.com) - **/ - -// 이미지갤러리쇼를 하기 위한 변수 -var slide_gallery_images = new Array(); -var thumbnail_zone_height = new Array(); - -// 이미지갤러리쇼 이미지 목록에 추가 -function slide_gallery_add_image(srl, image_url) { - if(!image_url) return; - if(image_url.indexOf('files')==0) image_url = request_uri+image_url; - - // 객체 생성 - var obj = {"srl":0, "thumbnail_url":null, "thumbnail":null, "image_url":null, "image":null} - - // slide_gallery_images에 이미지갤러리 쇼 고유번호에 해당하는 공간을 초기화 - if(typeof(slide_gallery_images[srl])=="undefined") slide_gallery_images[srl] = new Array(); - - // 이미지갤러리쇼 고유번호를 세팅 - obj.srl = srl; - obj.idx = slide_gallery_images[srl].length; - obj.image_url = image_url; - - // 원본 이미지를 미리 로딩 - obj.image = new Image(); - obj.image.src = image_url; - //if(!obj.image.width) return; - - // 썸네일 이미지를 미리 로딩 - obj.thumbnail = new Image(); - obj.thumbnail.src = image_url; - obj.thumbnail.style.cursor = "pointer"; - obj.thumbnail.style.width = "60px"; - obj.thumbnail.style.height = "60px"; - obj.thumbnail.style.margin = "5px"; - obj.thumbnail.style.opacity = 0.5; - obj.thumbnail.style.filter = "alpha(opacity=50)"; - - // 썸네일 클릭시 메인 이미지로 바꾸어줌 - xAddEventListener(obj.thumbnail, "mousedown", function() { display_gallery_image(obj) }); - - // 생성된 객체를 slide_gallery_images[이미지갤러리쇼 고유번호]에 추가 - slide_gallery_images[srl][slide_gallery_images[srl].length] = obj; -} - -// 이미지갤러리쇼 시작 -function start_slide_gallery() { - - // 등록된 모든 이미지 목록을 돌면서 thumbnail 목록을 만들어줌 - for(var srl in slide_gallery_images) { - - // 등록된 이미지가 없으면 pass~ - if(!slide_gallery_images[srl].length) continue; - - // 메인이미지가 나올 곳과 썸네일이 노출될 곳의 객체를 구함 - var zone_thumbnail = xGetElementById('zone_thumbnail_'+srl); - - // 썸네일 출력 - for(var i=0; i(zone_width-20)) { - resize_scale = (zone_width-20)/image_width; - image_width = parseInt(image_width*resize_scale,10); - image_height = parseInt(image_height*resize_scale,10); - } - var x = parseInt((zone_width - image_width)/2,10); - - // 이미지 표시 - var target_image = xGetElementById("slide_gallery_main_image_"+obj.srl); - - target_image.style.marginLeft = x+"px"; - - target_image.srl = obj.srl; - target_image.idx = obj.idx; - target_image.style.opacity = 1; - target_image.style.filter = "alpha(opacity=100)"; - target_image.start_opacity = 0; - xWidth(target_image, image_width); - xHeight(target_image, image_height); - target_image.src = obj.image.src; - - if(image_height<200) { - target_image.style.marginTop = (100-image_height/2)+"px"; - target_image.style.marginBottom = (100-image_height/2)+"px"; - } else { - target_image.style.marginTop = "10px"; - target_image.style.marginBottom = "10px"; - } - - if(typeof(showOriginalImage)=='function') { - if(resize_scale!=1) { - xAddEventListener(target_image, 'click', showOriginalImage); - target_image.style.cursor = 'pointer'; - } else { - xRemoveEventListener(target_image, 'click', showOriginalImage); - target_image.style.cursor = 'default'; - } - } - - // resize_scale이 1이 아니면, 즉 리사이즈 되었다면 해당 이미지 클릭시 원본을 새창으로 띄워줌 - var next_idx = obj.idx+1; - if(slide_gallery_images[obj.srl].length<=next_idx) next_idx = 0; - - // srl의 모든 썸네일의 투명도 조절 - for(var i=0; i"+decodeURI(filename)+""); - - // 네이게이션 영역의 숫자 변경 - var zone_navigator = xGetElementById("zone_gallery_navigator_status_"+obj.srl); - var html = (obj.idx+1) + " / " + slide_gallery_images[obj.srl].length; - xInnerHtml(zone_navigator, html); -} - -// 이전 보기 -function gallery_view_prev(srl) { - var target_image = xGetElementById("slide_gallery_main_image_"+srl); - var idx = target_image.idx; - var max_length = slide_gallery_images[srl].length; - idx--; - if(idx<0) idx = max_length-1; - display_gallery_image(slide_gallery_images[srl][idx]); -} - -// 다음 보기 -function gallery_view_next(srl) { - var target_image = xGetElementById("slide_gallery_main_image_"+srl); - var idx = target_image.idx; - var max_length = slide_gallery_images[srl].length; - idx++; - if(idx>max_length-1) idx = 0; - display_gallery_image(slide_gallery_images[srl][idx]); -} - -// 썸네일 보기 -function gallery_view_thumbnail(srl) { - var thumbnail_zone = xGetElementById("zone_thumbnail_"+srl); - if(thumbnail_zone.style.display == "none") thumbnail_zone.style.display = "block"; - else thumbnail_zone.style.display = "none"; -} - +/** + * @file slide_gallery.js + * @brief 이미지 이미지갤러리 쇼 스크립트 + * @author NHN (developers@xpressengine.com) + **/ + +// 이미지갤러리쇼를 하기 위한 변수 +var slide_gallery_images = new Array(); +var thumbnail_zone_height = new Array(); + +// 이미지갤러리쇼 이미지 목록에 추가 +function slide_gallery_add_image(srl, image_url) { + if(!image_url) return; + if(image_url.indexOf('files')==0) image_url = request_uri+image_url; + + // 객체 생성 + var obj = {"srl":0, "thumbnail_url":null, "thumbnail":null, "image_url":null, "image":null} + + // slide_gallery_images에 이미지갤러리 쇼 고유번호에 해당하는 공간을 초기화 + if(typeof(slide_gallery_images[srl])=="undefined") slide_gallery_images[srl] = new Array(); + + // 이미지갤러리쇼 고유번호를 세팅 + obj.srl = srl; + obj.idx = slide_gallery_images[srl].length; + obj.image_url = image_url; + + // 원본 이미지를 미리 로딩 + obj.image = new Image(); + obj.image.src = image_url; + //if(!obj.image.width) return; + + // 섬네일 이미지를 미리 로딩 + obj.thumbnail = new Image(); + obj.thumbnail.src = image_url; + obj.thumbnail.style.cursor = "pointer"; + obj.thumbnail.style.width = "60px"; + obj.thumbnail.style.height = "60px"; + obj.thumbnail.style.margin = "5px"; + obj.thumbnail.style.opacity = 0.5; + obj.thumbnail.style.filter = "alpha(opacity=50)"; + + // 섬네일 클릭시 메인 이미지로 바꾸어줌 + xAddEventListener(obj.thumbnail, "mousedown", function() { display_gallery_image(obj) }); + + // 생성된 객체를 slide_gallery_images[이미지갤러리쇼 고유번호]에 추가 + slide_gallery_images[srl][slide_gallery_images[srl].length] = obj; +} + +// 이미지갤러리쇼 시작 +function start_slide_gallery() { + + // 등록된 모든 이미지 목록을 돌면서 thumbnail 목록을 만들어줌 + for(var srl in slide_gallery_images) { + + // 등록된 이미지가 없으면 pass~ + if(!slide_gallery_images[srl].length) continue; + + // 메인이미지가 나올 곳과 섬네일이 노출될 곳의 객체를 구함 + var zone_thumbnail = xGetElementById('zone_thumbnail_'+srl); + + // 섬네일 출력 + for(var i=0; i(zone_width-20)) { + resize_scale = (zone_width-20)/image_width; + image_width = parseInt(image_width*resize_scale,10); + image_height = parseInt(image_height*resize_scale,10); + } + var x = parseInt((zone_width - image_width)/2,10); + + // 이미지 표시 + var target_image = xGetElementById("slide_gallery_main_image_"+obj.srl); + + target_image.style.marginLeft = x+"px"; + + target_image.srl = obj.srl; + target_image.idx = obj.idx; + target_image.style.opacity = 1; + target_image.style.filter = "alpha(opacity=100)"; + target_image.start_opacity = 0; + xWidth(target_image, image_width); + xHeight(target_image, image_height); + target_image.src = obj.image.src; + + if(image_height<200) { + target_image.style.marginTop = (100-image_height/2)+"px"; + target_image.style.marginBottom = (100-image_height/2)+"px"; + } else { + target_image.style.marginTop = "10px"; + target_image.style.marginBottom = "10px"; + } + + if(typeof(showOriginalImage)=='function') { + if(resize_scale!=1) { + xAddEventListener(target_image, 'click', showOriginalImage); + target_image.style.cursor = 'pointer'; + } else { + xRemoveEventListener(target_image, 'click', showOriginalImage); + target_image.style.cursor = 'default'; + } + } + + // resize_scale이 1이 아니면, 즉 리사이즈 되었다면 해당 이미지 클릭시 원본을 새창으로 띄워줌 + var next_idx = obj.idx+1; + if(slide_gallery_images[obj.srl].length<=next_idx) next_idx = 0; + + // srl의 모든 섬네일의 투명도 조절 + for(var i=0; i"+decodeURI(filename)+""); + + // 네이게이션 영역의 숫자 변경 + var zone_navigator = xGetElementById("zone_gallery_navigator_status_"+obj.srl); + var html = (obj.idx+1) + " / " + slide_gallery_images[obj.srl].length; + xInnerHtml(zone_navigator, html); +} + +// 이전 보기 +function gallery_view_prev(srl) { + var target_image = xGetElementById("slide_gallery_main_image_"+srl); + var idx = target_image.idx; + var max_length = slide_gallery_images[srl].length; + idx--; + if(idx<0) idx = max_length-1; + display_gallery_image(slide_gallery_images[srl][idx]); +} + +// 다음 보기 +function gallery_view_next(srl) { + var target_image = xGetElementById("slide_gallery_main_image_"+srl); + var idx = target_image.idx; + var max_length = slide_gallery_images[srl].length; + idx++; + if(idx>max_length-1) idx = 0; + display_gallery_image(slide_gallery_images[srl][idx]); +} + +// 섬네일 보기 +function gallery_view_thumbnail(srl) { + var thumbnail_zone = xGetElementById("zone_thumbnail_"+srl); + if(thumbnail_zone.style.display == "none") thumbnail_zone.style.display = "block"; + else thumbnail_zone.style.display = "none"; +} +