빠지거나 보완 해야 할 코드 수정

This commit is contained in:
thisgun
2019-10-22 12:26:53 +09:00
parent e304651f11
commit 1a82914861
5 changed files with 63 additions and 33 deletions
+59 -29
View File
@@ -23,57 +23,87 @@ if(strpos($filename, G5_DATA_DIR.'/editor')) {
$filepath = G5_DATA_PATH.'/file/'.$bo_table.'/'.$filename;
}
if(is_file($filepath)) {
$size = @getimagesize($filepath);
$file_exists = (is_file($filepath) && file_exists($filepath)) ? 1 : 0;
if(run_replace('exists_view_image', $file_exists, $filepath, $editor_file)) {
$size = $file_exists ? run_replace('get_view_imagesize', @getimagesize($filepath), $filepath, $editor_file) : array();
if(empty($size))
alert_close('이미지 파일이 아닙니다.');
$width = $size[0];
$height = $size[1];
$width = (isset($size[0]) && $size[0]) ? (int) $size[0] : 0;
$height = (isset($size[1]) && $size[1]) ? (int) $size[1] : 0;
if($editor_file)
$fileurl = G5_DATA_URL.'/'.$editor_file;
else
$fileurl = G5_DATA_URL.'/file/'.$bo_table.'/'.$filename;
$img = '<img src="'.$fileurl.'" alt="" width="'.$width.'" height="'.$height.'" class="draggable" style="position:relative;top:0;left:0;cursor:move;">';
$img_attr = ($width && $height) ? 'width="'.$width.'" height="'.$height.'"' : '';
$img = '<img src="'.$fileurl.'" alt="" '.$img_attr.' class="draggable" style="position:relative;top:0;left:0;cursor:move;">';
} else {
alert_close('파일이 존재하지 않습니다.');
}
?>
<div><?php echo $img ?></div>
<div class="bbs-view-image"><?php echo $img ?></div>
<script>
var win_w = <?php echo $width ?>;
var win_h = <?php echo $height ?> + 70;
var win_l = (screen.width - win_w) / 2;
var win_t = (screen.height - win_h) / 2;
if(win_w > screen.width) {
win_l = 0;
win_w = screen.width - 20;
jQuery(function($){
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
}
}
$.fn.imgLoad = function(callback) {
return this.each(function() {
if (callback) {
if (this.complete || /*for IE 10-*/ $(this).height() > 0) {
callback.apply(this);
}
else {
$(this).on('load', function(){
callback.apply(this);
});
}
}
});
};
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
$(".bbs-view-image img").imgLoad(function(){
if(win_w > screen.width) {
win_w = screen.width - 20;
win_l = 0;
}
}
var win_w = <?php echo $width ?>;
var win_h = <?php echo $height ?> + 70;
window.moveTo(win_l, win_t);
window.resizeTo(win_w, win_h);
if( !win_w || !win_h ){
win_w = $(this).width();
win_h = $(this).height();
}
var win_l = (screen.width - win_w) / 2;
var win_t = (screen.height - win_h) / 2;
if(win_w > screen.width) {
win_l = 0;
win_w = screen.width - 20;
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
}
}
if(win_h > screen.height) {
win_t = 0;
win_h = screen.height - 40;
if(win_w > screen.width) {
win_w = screen.width - 20;
win_l = 0;
}
}
window.moveTo(win_l, win_t);
window.resizeTo(win_w, win_h);
});
$(function() {
var is_draggable = false;
var x = y = 0;
var pos_x = pos_y = 0;
+1 -1
View File
@@ -15,7 +15,7 @@
.lt .lt_date {color:#828282}
.lt .latest-sel{margin-top:1px}
.lt .lt_more {position:absolute;top:15px;right:15px;color:#3a8afd;background:#fff;border:1px solid #d1d7e5;font-size:0.925em;border-radius:3px;padding:4px 5px}
.lt .lt_more {position:absolute;top:15px;right:15px;color:#3a8afd;background:#fff;border:1px solid #d1d7e5;font-size:0.925em;border-radius:3px;padding:4px 5px;z-index:1}
.lt .lt_cmt {background:#e9eff5;color:#3a8afd;font-size:11px;height:16px;line-height:16px;padding:0 5px;border-radius:3px;vertical-align:middle}
.lt .profile_img img {border-radius:50%;vertical-align:top}
+1 -1
View File
@@ -103,7 +103,7 @@ box-shadow:inset 0 2px 5px rgb(33, 135, 202)}
#bo_gall #gall_ul {margin:10px -10px 0;padding:0;list-style:none;zoom:1}
#bo_gall #gall_ul:after {display:block;visibility:hidden;clear:both;content:""}
#bo_gall .gall_li {}
#bo_gall .gall_li .gall_chk {position:absolute;top:0;left:0;padding:5px}
#bo_gall .gall_li .gall_chk {position:absolute;top:0;left:0;padding:5px;z-index:1}
#bo_gall .gall_box {position:relative;margin:0 0 50px 0;border-radius:0 0 2px 2px}
#bo_gall .gall_con {position:relative}
@@ -15,7 +15,7 @@
.lt .lt_date {color:#828282}
.lt .latest-sel{margin-top:1px}
.lt .lt_more {position:absolute;top:15px;right:15px;color:#3a8afd;background:#fff;border:1px solid #d1d7e5;font-size:0.925em;border-radius:3px;padding:4px 5px}
.lt .lt_more {position:absolute;top:15px;right:15px;color:#3a8afd;background:#fff;border:1px solid #d1d7e5;font-size:0.925em;border-radius:3px;padding:4px 5px;z-index:1}
.lt .lt_cmt {background:#e9eff5;color:#3a8afd;font-size:11px;height:16px;line-height:16px;padding:0 5px;border-radius:3px;vertical-align:middle}
.lt .profile_img img {border-radius:50%;vertical-align:top}
+1 -1
View File
@@ -103,7 +103,7 @@ box-shadow:inset 0 2px 5px rgb(33, 135, 202)}
#bo_gall #gall_ul {margin:10px -10px 0;padding:0;list-style:none;zoom:1}
#bo_gall #gall_ul:after {display:block;visibility:hidden;clear:both;content:""}
#bo_gall .gall_li {}
#bo_gall .gall_li .gall_chk {position:absolute;top:0;left:0;padding:5px}
#bo_gall .gall_li .gall_chk {position:absolute;top:0;left:0;padding:5px;z-index:1}
#bo_gall .gall_box {position:relative;margin:0 0 50px 0;border-radius:0 0 2px 2px}
#bo_gall .gall_con {position:relative}