From 414de38f1f0eb1fdec57a670da74f3e089377020 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 3 May 2013 14:04:23 +0900 Subject: [PATCH 1/3] =?UTF-8?q?#448=20=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A6=AC=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=EC=A6=88=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skin/board/basic/view.skin.php | 43 ++++++++++++++++++++++++++++---- skin/board/gallery/view.skin.php | 43 ++++++++++++++++++++++++++++---- 2 files changed, 76 insertions(+), 10 deletions(-) diff --git a/skin/board/basic/view.skin.php b/skin/board/basic/view.skin.php index 3a8859118..7909e1dc7 100644 --- a/skin/board/basic/view.skin.php +++ b/skin/board/basic/view.skin.php @@ -217,6 +217,26 @@ $(window).load(function() { view_image_resize(); }); +var rtime = new Date(); +var timeout = false; +var delta = 200; +$(window).resize(function() { + rtime = new Date(); + if (timeout === false) { + timeout = true; + setTimeout(resizeend, delta); + } +}); + +function resizeend() { + if (new Date() - rtime < delta) { + setTimeout(resizeend, delta); + } else { + timeout = false; + view_image_resize(); + } +} + $(function() { $("a.view_image").click(function() { window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no"); @@ -240,14 +260,27 @@ function view_image_resize() { var $img = $("#bo_v_atc img"); var img_wrap = $("#bo_v_atc").width(); + var win_width = $(window).width() - 35; + var res_width = 0; + + if(img_wrap < win_width) + res_width = img_wrap; + else + res_width = win_width; $img.each(function() { var img_width = $(this).width(); - $(this).data("width", img_width); // 원래 이미지 사이즈 - if (img_width > img_wrap) { - $(this).addClass("img_fix"); - } else if (img_width <= img_wrap && img_width >= $(this).data("width")) { - $(this).removeClass("img_fix"); + var this_width = $(this).data("width"); + + if(this_width == undefined) { + $(this).data("width", img_width); // 원래 이미지 사이즈 + this_width = img_width; + } + + if(this_width > res_width) { + $(this).width(res_width); + } else { + $(this).width(this_width); } }); } diff --git a/skin/board/gallery/view.skin.php b/skin/board/gallery/view.skin.php index a889e4a88..4c44a6e3c 100644 --- a/skin/board/gallery/view.skin.php +++ b/skin/board/gallery/view.skin.php @@ -215,6 +215,26 @@ $(window).load(function() { view_image_resize(); }); +var rtime = new Date(); +var timeout = false; +var delta = 200; +$(window).resize(function() { + rtime = new Date(); + if (timeout === false) { + timeout = true; + setTimeout(resizeend, delta); + } +}); + +function resizeend() { + if (new Date() - rtime < delta) { + setTimeout(resizeend, delta); + } else { + timeout = false; + view_image_resize(); + } +} + $(function() { $("a.view_image").click(function() { window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no"); @@ -238,14 +258,27 @@ function view_image_resize() { var $img = $("#bo_v_atc img"); var img_wrap = $("#bo_v_atc").width(); + var win_width = $(window).width() - 35; + var res_width = 0; + + if(img_wrap < win_width) + res_width = img_wrap; + else + res_width = win_width; $img.each(function() { var img_width = $(this).width(); - $(this).data("width", img_width); // 원래 이미지 사이즈 - if (img_width > img_wrap) { - $(this).addClass("img_fix"); - } else if (img_width <= img_wrap && img_width >= $(this).data("width")) { - $(this).removeClass("img_fix"); + var this_width = $(this).data("width"); + + if(this_width == undefined) { + $(this).data("width", img_width); // 원래 이미지 사이즈 + this_width = img_width; + } + + if(this_width > res_width) { + $(this).width(res_width); + } else { + $(this).width(this_width); } }); } From e2bbf126250fc37a5e9d0b4eb2cc5734aebb56cd Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 3 May 2013 14:36:42 +0900 Subject: [PATCH 2/3] =?UTF-8?q?#448=20=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A6=AC=EC=82=AC=EC=9D=B4?= =?UTF-8?q?=EC=A6=88=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=9E=AC?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- skin/board/basic/view.skin.php | 23 ++++++++++++++++------- skin/board/gallery/view.skin.php | 23 ++++++++++++++++------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/skin/board/basic/view.skin.php b/skin/board/basic/view.skin.php index 7909e1dc7..316767c06 100644 --- a/skin/board/basic/view.skin.php +++ b/skin/board/basic/view.skin.php @@ -217,20 +217,29 @@ $(window).load(function() { view_image_resize(); }); -var rtime = new Date(); +var now = new Date(); var timeout = false; -var delta = 200; +var millisec = 200; +var tid; + $(window).resize(function() { - rtime = new Date(); + now = new Date(); if (timeout === false) { timeout = true; - setTimeout(resizeend, delta); + + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } }); -function resizeend() { - if (new Date() - rtime < delta) { - setTimeout(resizeend, delta); +function resize_check() { + if (new Date() - now < millisec) { + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } else { timeout = false; view_image_resize(); diff --git a/skin/board/gallery/view.skin.php b/skin/board/gallery/view.skin.php index 4c44a6e3c..19ecc715b 100644 --- a/skin/board/gallery/view.skin.php +++ b/skin/board/gallery/view.skin.php @@ -215,20 +215,29 @@ $(window).load(function() { view_image_resize(); }); -var rtime = new Date(); +var now = new Date(); var timeout = false; -var delta = 200; +var millisec = 200; +var tid; + $(window).resize(function() { - rtime = new Date(); + now = new Date(); if (timeout === false) { timeout = true; - setTimeout(resizeend, delta); + + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } }); -function resizeend() { - if (new Date() - rtime < delta) { - setTimeout(resizeend, delta); +function resize_check() { + if (new Date() - now < millisec) { + if(tid != null) + clearTimeout(tid); + + tid = setTimeout(resize_check, millisec); } else { timeout = false; view_image_resize(); From 1e9ffe3901c8a19daf3be030b81ec4a70158691f Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 3 May 2013 14:54:38 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=EC=97=90?= =?UTF-8?q?=EC=84=9C=20Animated=20GIF=20=EB=85=B8=EC=B6=9C=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8D=98=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/thumbnail.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/thumbnail.lib.php b/lib/thumbnail.lib.php index b395e0734..c7991dbef 100644 --- a/lib/thumbnail.lib.php +++ b/lib/thumbnail.lib.php @@ -184,7 +184,7 @@ function thumbnail($filename, $source_path, $target_path, $thumb_width, $thumb_h // Animated GIF는 썸네일 생성하지 않음 if($size[2] == 1) { if(is_animated_gif($source_file)) - return; + return basename($source_file); } $thumb_time = @filemtime($thumb_file);