Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
gnuboard
2013-05-03 16:01:34 +09:00
3 changed files with 95 additions and 11 deletions

View File

@ -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);

View File

@ -217,6 +217,35 @@ $(window).load(function() {
view_image_resize();
});
var now = new Date();
var timeout = false;
var millisec = 200;
var tid;
$(window).resize(function() {
now = new Date();
if (timeout === false) {
timeout = true;
if(tid != null)
clearTimeout(tid);
tid = setTimeout(resize_check, millisec);
}
});
function resize_check() {
if (new Date() - now < millisec) {
if(tid != null)
clearTimeout(tid);
tid = setTimeout(resize_check, millisec);
} 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 +269,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);
}
});
}

View File

@ -215,6 +215,35 @@ $(window).load(function() {
view_image_resize();
});
var now = new Date();
var timeout = false;
var millisec = 200;
var tid;
$(window).resize(function() {
now = new Date();
if (timeout === false) {
timeout = true;
if(tid != null)
clearTimeout(tid);
tid = setTimeout(resize_check, millisec);
}
});
function resize_check() {
if (new Date() - now < millisec) {
if(tid != null)
clearTimeout(tid);
tid = setTimeout(resize_check, millisec);
} 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 +267,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);
}
});
}