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

This commit is contained in:
whitedot
2013-06-28 17:08:27 +09:00
5 changed files with 39 additions and 109 deletions

View File

@ -134,8 +134,8 @@ function imageview(id, w, h)
<div id="container">
<div id="text_size">
<button class="no_text_resize" onclick="font_resize('container', 'decrease');">작게</button>
<button class="no_text_resize" onclick="font_default('container');">기본</button>
<button class="no_text_resize" onclick="font_resize('container', 'increase');">크게</button>
<button class="no_text_resize" onclick="font_resize('container', 'default');">기본</button>
<button class="no_text_resize" onclick="font_resize('container', 'large');">크게</button>
<button class="no_text_resize" onclick="font_resize('container', 'larger');">크게</button>
</div>
<h1><?php echo $g4['title'] ?></h1>

View File

@ -94,24 +94,17 @@ $(function(){
}
});
function submenu_hide() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
}
// 텍스트 리사이즈 카운트 쿠키있으면 실행
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));
// 폰트 리사이즈 쿠키있으면 실행
var font_resize_act = get_cookie("ck_font_resize_act");
if(font_resize_act != "") {
font_resize("container", font_resize_act);
}
});
function submenu_hide() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
}
function menu_rearrange(el)
{
var width = $("#gnb_1dul").width();

View File

@ -168,7 +168,7 @@ if ($config['cf_include_head']) {
<div id="container">
<?php if ((!$bo_table || $w == 's' ) && !defined("_INDEX_")) { ?><div id="container_title"><?php echo $g4['title'] ?></div><?php } ?>
<div id="text_size">
<button id="text_size_down" class="no_text_resize" onclick="font_resize('container', 'decrease');">작게</button>
<button id="text_size_def" class="no_text_resize" onclick="font_default('container');">기본</button>
<button id="text_size_up" class="no_text_resize" onclick="font_resize('container', 'increase');">크게</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_resize('container', 'large');">크게</button>
<button id="text_size_up" class="no_text_resize" onclick="font_resize('container', 'larger');">크게</button>
</div>

View File

@ -293,12 +293,6 @@ function doc_write(cont)
document.write(cont);
}
// php chr() 대응
function chr(code)
{
return String.fromCharCode(code);
}
var win_password_lost = function(href) {
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");
$elements.removeClass("applied");
var count = parseInt(get_cookie("ck_font_resize_count"));
if(isNaN(count))
count = 0;
// 엘리먼트의 기본 폰트사이즈 저장
if(!default_font_size_saved) {
save_default_font_size($elements);
}
// 크롬의 최소 폰트사이즈 버그로 작게는 한단계만 가능
if(act == "decrease" && count == -1)
return;
$elements.each(function() {
if($(this).hasClass("no_text_resize"))
return true;
@ -426,54 +412,7 @@ function font_resize(id, act)
}
});
// 텍스트 리사이즈 회수 쿠키에 기록
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);
}
set_cookie("ck_font_resize_act", act, 1, g4_cookie_domain);
}
@ -497,16 +436,21 @@ function set_font_size($el, act)
if(unit == "em")
x = 1;
if(act == "increase") {
nfsize = (fsize * 1.2);
} else {
nfsize = (fsize / 1.2);
switch(act) {
case "large":
nfsize = fsize * 1.5;
break;
case "larger":
nfsize = fsize * 2;
break;
default:
nfsize = fsize;
break;
}
nfsize = nfsize.toFixed(x);
$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() {
var str = $(this).val()
var mx = parseInt($(this).attr("maxlength"))
if (str.length > mx) {
$("textarea#wr_content[maxlength]").live("keyup change", function() {
var str = $(this).val()
var mx = parseInt($(this).attr("maxlength"))
if (str.length > mx) {
$(this).val(str.substr(0, mx));
return false;
}
return false;
}
});
});

View File

@ -69,24 +69,17 @@ $(function(){
}
});
function submenu_hide() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
}
// 텍스트 리사이즈 카운트 쿠키있으면 실행
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));
// 폰트 리사이즈 쿠키있으면 실행
var font_resize_act = get_cookie("ck_font_resize_act");
if(font_resize_act != "") {
font_resize("container", font_resize_act);
}
});
function submenu_hide() {
$(".gnb_1dli").removeClass("gnb_1dli_over gnb_1dli_over2 gnb_1dli_on");
}
function menu_rearrange(el)
{
var width = $("#gnb_1dul").width();