Merge branch 'master' of github.com:gnuboard/yc4s
This commit is contained in:
@ -3,25 +3,74 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// 리스트 타입 쿠키가 있을 경우 바로 적용
|
$.fn.listType = function(type)
|
||||||
if(itemlist_type = get_cookie("ck_itemlist_type")) {
|
{
|
||||||
if(itemlist_type == "gallery") {
|
var $el = this.find("li.sct_li");
|
||||||
$("ul.sct").removeClass("sct_40");
|
var count = $el.size();
|
||||||
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
|
if(count < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
$el.each(function() {
|
||||||
|
var st = $(this).attr("style");
|
||||||
|
if(st) {
|
||||||
|
$(this).data("style", st);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(type == "gallery") {
|
||||||
|
this.removeClass("sct_40");
|
||||||
|
$el.each(function() {
|
||||||
|
if($(this).data("style")) {
|
||||||
|
$(this).attr("style", $(this).data("style"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "gallery", 1, g4_cookie_domain);
|
||||||
} else {
|
} else {
|
||||||
$("ul.sct").addClass("sct_40");
|
this.addClass("sct_40");
|
||||||
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
$el.each(function() {
|
||||||
|
if($(this).data("style")) {
|
||||||
|
$(this).attr("style", "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "list", 1, g4_cookie_domain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 리스트 타입 쿠키가 있을 경우 바로 적용
|
||||||
|
if(itemlist_type = get_cookie("ck_itemlist<?php echo $ca_id; ?>_type")) {
|
||||||
|
$("ul.sct").listType(itemlist_type);
|
||||||
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$("button.sct_lst_view").on("click", function() {
|
$("button.sct_lst_view").on("click", function() {
|
||||||
|
var $el = $("ul.sct").find("li.sct_li");
|
||||||
|
var count = $el.size();
|
||||||
|
if(count < 1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$el.each(function() {
|
||||||
|
var st = $(this).attr("style");
|
||||||
|
if(st) {
|
||||||
|
$(this).data("style", st);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if($(this).hasClass("sct_lst_gallery")) {
|
if($(this).hasClass("sct_lst_gallery")) {
|
||||||
$("ul.sct").removeClass("sct_40");
|
$("ul.sct").removeClass("sct_40");
|
||||||
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
|
$el.each(function() {
|
||||||
|
if($(this).data("style")) {
|
||||||
|
$(this).attr("style", $(this).data("style"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "gallery", 1, g4_cookie_domain);
|
||||||
} else {
|
} else {
|
||||||
$("ul.sct").addClass("sct_40");
|
$("ul.sct").addClass("sct_40");
|
||||||
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
$el.each(function() {
|
||||||
|
if($(this).data("style")) {
|
||||||
|
$(this).attr("style", "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
set_cookie("ck_itemlist<?php echo $ca_id; ?>_type", "list", 1, g4_cookie_domain);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user