#460 글자 크기 조절 기능 조정안에 따른 처리
This commit is contained in:
@ -134,8 +134,8 @@ function imageview(id, w, h)
|
|||||||
|
|
||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="text_size">
|
<div id="text_size">
|
||||||
<button class="no_text_resize" onclick="font_resize('container', 'decrease');">작게</button>
|
<button class="no_text_resize" onclick="font_resize('container', 'default');">기본</button>
|
||||||
<button class="no_text_resize" onclick="font_default('container');">기본</button>
|
<button class="no_text_resize" onclick="font_resize('container', 'large');">크게</button>
|
||||||
<button class="no_text_resize" onclick="font_resize('container', 'increase');">크게</button>
|
<button class="no_text_resize" onclick="font_resize('container', 'larger');">더크게</button>
|
||||||
</div>
|
</div>
|
||||||
<h1><?php echo $g4['title'] ?></h1>
|
<h1><?php echo $g4['title'] ?></h1>
|
||||||
|
|||||||
@ -94,24 +94,17 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function submenu_hide() {
|
// 폰트 리사이즈 쿠키있으면 실행
|
||||||
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
|
var font_resize_act = get_cookie("ck_font_resize_act");
|
||||||
}
|
if(font_resize_act != "") {
|
||||||
|
font_resize("container", font_resize_act);
|
||||||
// 텍스트 리사이즈 카운트 쿠키있으면 실행
|
|
||||||
var resize_act;
|
|
||||||
var text_resize_count = parseInt(get_cookie("ck_font_resize_count"));
|
|
||||||
if(!isNaN(text_resize_count)) {
|
|
||||||
if(text_resize_count > 0)
|
|
||||||
resize_act = "increase";
|
|
||||||
else if(text_resize_count < 0)
|
|
||||||
resize_act = "decrease";
|
|
||||||
|
|
||||||
if(Math.abs(text_resize_count) > 0)
|
|
||||||
font_resize2("container", resize_act, Math.abs(text_resize_count));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function submenu_hide() {
|
||||||
|
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
|
||||||
|
}
|
||||||
|
|
||||||
function menu_rearrange(el)
|
function menu_rearrange(el)
|
||||||
{
|
{
|
||||||
var width = $("#gnb_1dul").width();
|
var width = $("#gnb_1dul").width();
|
||||||
|
|||||||
6
head.php
6
head.php
@ -165,7 +165,7 @@ if ($config['cf_include_head']) {
|
|||||||
<div id="container">
|
<div id="container">
|
||||||
<?php if ((!$bo_table || $w == 's' ) && !defined("_INDEX_")) { ?><div id="container_title"><?php echo $g4['title'] ?></div><?php } ?>
|
<?php if ((!$bo_table || $w == 's' ) && !defined("_INDEX_")) { ?><div id="container_title"><?php echo $g4['title'] ?></div><?php } ?>
|
||||||
<div id="text_size">
|
<div id="text_size">
|
||||||
<button id="text_size_down" class="no_text_resize" onclick="font_resize('container', 'decrease');">작게</button>
|
<button id="text_size_down" class="no_text_resize" onclick="font_resize('container', 'default');">기본</button>
|
||||||
<button id="text_size_def" class="no_text_resize" onclick="font_default('container');">기본</button>
|
<button id="text_size_def" class="no_text_resize" onclick="font_resize('container', 'large');">크게</button>
|
||||||
<button id="text_size_up" class="no_text_resize" onclick="font_resize('container', 'increase');">크게</button>
|
<button id="text_size_up" class="no_text_resize" onclick="font_resize('container', 'larger');">더크게</button>
|
||||||
</div>
|
</div>
|
||||||
90
js/common.js
90
js/common.js
@ -293,12 +293,6 @@ function doc_write(cont)
|
|||||||
document.write(cont);
|
document.write(cont);
|
||||||
}
|
}
|
||||||
|
|
||||||
// php chr() 대응
|
|
||||||
function chr(code)
|
|
||||||
{
|
|
||||||
return String.fromCharCode(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
var win_password_lost = function(href) {
|
var win_password_lost = function(href) {
|
||||||
window.open(href, "win_password_lost", "left=50, top=50, width=617, height=330, scrollbars=1");
|
window.open(href, "win_password_lost", "left=50, top=50, width=617, height=330, scrollbars=1");
|
||||||
}
|
}
|
||||||
@ -404,19 +398,11 @@ function font_resize(id, act)
|
|||||||
{
|
{
|
||||||
var $elements = $("#"+id+" *").not("select").not("option");
|
var $elements = $("#"+id+" *").not("select").not("option");
|
||||||
$elements.removeClass("applied");
|
$elements.removeClass("applied");
|
||||||
var count = parseInt(get_cookie("ck_font_resize_count"));
|
|
||||||
if(isNaN(count))
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
// 엘리먼트의 기본 폰트사이즈 저장
|
// 엘리먼트의 기본 폰트사이즈 저장
|
||||||
if(!default_font_size_saved) {
|
if(!default_font_size_saved) {
|
||||||
save_default_font_size($elements);
|
save_default_font_size($elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 크롬의 최소 폰트사이즈 버그로 작게는 한단계만 가능
|
|
||||||
if(act == "decrease" && count == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
$elements.each(function() {
|
$elements.each(function() {
|
||||||
if($(this).hasClass("no_text_resize"))
|
if($(this).hasClass("no_text_resize"))
|
||||||
return true;
|
return true;
|
||||||
@ -426,54 +412,7 @@ function font_resize(id, act)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 텍스트 리사이즈 회수 쿠키에 기록
|
set_cookie("ck_font_resize_act", act, 1, g4_cookie_domain);
|
||||||
if(act == "increase")
|
|
||||||
count++;
|
|
||||||
else
|
|
||||||
count--;
|
|
||||||
|
|
||||||
set_cookie("ck_font_resize_count", count, 1, g4_cookie_domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 텍스트 기본사이즈
|
|
||||||
**/
|
|
||||||
function font_default(id)
|
|
||||||
{
|
|
||||||
var act;
|
|
||||||
var count = parseInt(get_cookie("ck_font_resize_count"));
|
|
||||||
if(isNaN(count))
|
|
||||||
count = 0;
|
|
||||||
|
|
||||||
if(count > 0) {
|
|
||||||
act = "decrease";
|
|
||||||
} else {
|
|
||||||
act = "increase";
|
|
||||||
// 작게 후 기본 크기가 되지 않는 문제해결을 위해 추가
|
|
||||||
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i=0; i<Math.abs(count); i++) {
|
|
||||||
font_resize(id, act);
|
|
||||||
}
|
|
||||||
|
|
||||||
// font resize 카운트 초기화
|
|
||||||
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* font_resize 함수를 반복 할 때 사용
|
|
||||||
**/
|
|
||||||
function font_resize2(id, act, loop)
|
|
||||||
{
|
|
||||||
// font resize 카운트 초기화
|
|
||||||
set_cookie("ck_font_resize_count", 0, 1, g4_cookie_domain);
|
|
||||||
|
|
||||||
for(i=0; i<loop; i++) {
|
|
||||||
font_resize(id, act);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -497,16 +436,21 @@ function set_font_size($el, act)
|
|||||||
if(unit == "em")
|
if(unit == "em")
|
||||||
x = 1;
|
x = 1;
|
||||||
|
|
||||||
if(act == "increase") {
|
switch(act) {
|
||||||
nfsize = (fsize * 1.2);
|
case "large":
|
||||||
} else {
|
nfsize = fsize * 1.5;
|
||||||
nfsize = (fsize / 1.2);
|
break;
|
||||||
|
case "larger":
|
||||||
|
nfsize = fsize * 2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
nfsize = fsize;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nfsize = nfsize.toFixed(x);
|
nfsize = nfsize.toFixed(x);
|
||||||
|
|
||||||
$el.css("font-size", nfsize+unit).addClass("applied");
|
$el.css("font-size", nfsize+unit).addClass("applied");
|
||||||
$el.data("fs", nfsize+unit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -650,12 +594,12 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("textarea#wr_content[maxlength]").live("keyup change", function() {
|
$("textarea#wr_content[maxlength]").live("keyup change", function() {
|
||||||
var str = $(this).val()
|
var str = $(this).val()
|
||||||
var mx = parseInt($(this).attr("maxlength"))
|
var mx = parseInt($(this).attr("maxlength"))
|
||||||
if (str.length > mx) {
|
if (str.length > mx) {
|
||||||
$(this).val(str.substr(0, mx));
|
$(this).val(str.substr(0, mx));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -69,24 +69,17 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function submenu_hide() {
|
// 폰트 리사이즈 쿠키있으면 실행
|
||||||
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
|
var font_resize_act = get_cookie("ck_font_resize_act");
|
||||||
}
|
if(font_resize_act != "") {
|
||||||
|
font_resize("container", font_resize_act);
|
||||||
// 텍스트 리사이즈 카운트 쿠키있으면 실행
|
|
||||||
var resize_act;
|
|
||||||
var text_resize_count = parseInt(get_cookie("ck_font_resize_count"));
|
|
||||||
if(!isNaN(text_resize_count)) {
|
|
||||||
if(text_resize_count > 0)
|
|
||||||
resize_act = "increase";
|
|
||||||
else if(text_resize_count < 0)
|
|
||||||
resize_act = "decrease";
|
|
||||||
|
|
||||||
if(Math.abs(text_resize_count) > 0)
|
|
||||||
font_resize2("container", resize_act, Math.abs(text_resize_count));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function submenu_hide() {
|
||||||
|
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
|
||||||
|
}
|
||||||
|
|
||||||
function menu_rearrange(el)
|
function menu_rearrange(el)
|
||||||
{
|
{
|
||||||
var width = $("#gnb_1dul").width();
|
var width = $("#gnb_1dul").width();
|
||||||
|
|||||||
Reference in New Issue
Block a user