| gallery | < % -- * CAS Team, LG ELECTRONICS INC., SEOUL, KOREA * Copyright(c) 2011 by LG Electronics Inc. * * All rights reserved.No part of this work may be reproduced, stored in a * retrieval system, or transmitted by any means without prior written * permission of LG Electronics Inc. * @Source: contact_list.jsp * @Description: 썸네일엘범리스트조회 * @Version: v1.0 * * === === === === === === === === === === === === === === === === === === === === === === == * No DATE Author Description * === === === === === === === === === === === === === === === === === === === === === === == * 1.0 2011 - 05 - 18김철Initial Coding * === === === === === === === === === === === === === === === === === === === === === === == -- % >
< % @page language = "java"
pageEncoding = "UTF-8"
contentType = "text/html; charset=UTF-8" % > < % @include file = "/jsp/sys/include/doctype.jspf" % > < % @include file = "/jsp/sys/include/common.jspf" % > < html xmlns = "http://www.w3.org/1999/xhtml"
xml: lang = "ko"
lang = "ko" > < jsp: useBean id = "data"
class = "devon.core.collection.LData"
scope = "request" / >
< head >
< % @include file = "/jsp/sys/include/head.jspf" % > < % @include file = "/jsp/sys/include/head_smart.jspf" % > < % @include file = "/jsp/sys/include/web_auto.jspf" % >
< meta http - equiv = "Content-Style-Type"
content = "text/css" / > < meta http - equiv = "Pragma"
content = "no-cache" / > < meta http - equiv = "Imagetoolbar"
content = "no" / >
< title > Link < LTag: message spec = 'dbmsg'
code = 'TITLE.GALLERY.GALLERY' / > < /title>
<script type="text/javascript" src=" < LTag: webPath kind = "js" > smart.js < /LTag:webPath>"></script > < script type = "text/javascript"
src = "<LTag:webPath kind="
js ">swfobject.js</LTag:webPath>" > < /script>
<%@ include file="/jsp / web / smt / com / RetrieveStorage.jspf " %>
<style type="
text / css ">
.btn_loading{ background:url(/images/smart/btn/btn_loading.gif) no-repeat; padding:0 0 0 31px;}
.btn_loading { width:76px; height:26px; overflow:hidden; border:0; text-align:left; line-height:26px; cursor:default; font-size:11px; font-weight:bold; }
#loading-mask {
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:30000;
filter:alpha(opacity:50);
opacity:0.50;
}
<%--
#loading-indicator {
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:30001;
background:transparent url(<LTag:webPath kind="
image ">/account/bg_body_login.gif</LTag:webPath>) repeat-x left top;
}
#loading-indicator div {
margin:0 auto 0 auto;
padding:0 40px 0 40px;
width:668px;
}
#loading-indicator.loading-guide {
height:395px;
}
#loading-indicator h1 {
padding:8px 0 0 0;
text-align:left;
}
#loading-indicator dl {
margin:48px 0 0 0;
padding:0px;
list-style:none;
}
#loading-indicator dl dt {
margin:0px;
padding:0px;
height:101px;
}
#loading-indicator h2 {
margin:0px;
padding:0px;
color:#343844;
font-size:32px;
}
#loading-indicator h3 {
margin:10px 0 0 0;
padding:0px;
color:#5e616b;
font-size:15px;
}
#loading-indicator dl dd {
margin:0px;
padding:0px;
height:297px;
}
--%>
#loading-indicator {
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:30001;
}
.x-loading-mask {
position:absolute;
left:0;
top:0;
z-index:20000;
filter:alpha(opacity:50);
opacity:0.50;
}
.x-loading-indicator {
position:absolute;
left:0;
top:0;
z-index:20001;
background:transparent url(/images/common/loading.gif) no-repeat center center;
}
.x-hidden {
display:none;
}
</style>
<script type="
text / javascript ">
var currentAlbum = " < c: out value = "${data.albumNm}" / > ";
var firstFlag = " < c: out value = "${data.firstFlag}" / > ";
// 초기 셋팅 정의
$jQ(document).ready(function() {
$jQ("#galleryForm ").submit(function(event) {
$jQ(this).ajaxSubmit(returnUploadPhoto);
return false;
});
$jQ("#file01 ").change(function(event) {
uploadPhoto();
});
$jQ(".btn_delete ").click(function(event) {
deletePhoto();
});
$jQ(".btn_down ").click(function() {
downloadPhoto();
});
// 전체선택 체크시 리스트 체크박스 show 체크해제시 hide..
$jQ(".btn - d: checkbox ").unbind("
click ");
$jQ(".btn - d ").delegate(':checkbox', 'click', function(){
//$jQ(".btn - d: checkbox ").click(function(){
$bChk = $jQ(this).is(':checked');
var gallery_table_checkbox = $jQ(".gallery_table: checkbox ");
if(this.checked){
$jQ(gallery_table_checkbox).attr("
checked ", $bChk).show();
//$jQ(gallery_table_checkbox).show();
$jQ("
table.gallery_table: checkbox ").parent().css({ "
background ":"#dfeff8 " });
} else {
$jQ(gallery_table_checkbox).attr("
checked ","").hide();
//$jQ(gallery_table_checkbox).hide();
//$jQ(".gallery_table: checkbox ").attr("
checked ","");
//$jQ(".gallery_table: checkbox ").hide();
$jQ("
table.gallery_table: checkbox ").parent().css({ "
background ":"
url('/images/smart/bg/bg_gallery_frame.gif')" });
}
});
//retrieveLastSync();
setTimeout(function(){
$jQ("#loading - indicator ").fadeOut("
slow ", function() {
$jQ("#loading - mask ").hide();
retrieveGalleryLeft('1');
$jQ(this).remove();
});
}, 400);
});
// 파일명의 확장자를 구분하여 허용된 확장자인지 리턴한다.
function chkFileType(filename) {
var returnFlag = false;
var splitData = filename.split(".");
var lastData = splitData[splitData.length-1].toUpperCase();
if(lastData=="
JPEG " || lastData=="
JPG " || lastData=="
GIF " || lastData=="
PNG "){
returnFlag = true;
}
return returnFlag;
}
/*
// 파일의 size 를 리턴한다. - Byte
function chkFileSize(fileObj) {
var fileBytes;
if ( $jQ.browser.msie ) {
if($jQ.browser.version < 7) {
var img = new Image();
img.src = fileObj.val();
$jQ('#fileSizeChk').attr('src',img.src);
fileBytes = document.getElementById('fileSizeChk').fileSize;
} else {
var activeXObj = new ActiveXObject("
Scripting.FileSystemObject ");
var img = activeXObj.GetFile(fileObj.val());
fileBytes = img.size;
}
} else {
fileBytes = fileObj[0].files[0].fileSize;
}
return fileBytes;
}
*/
// 업로드 파일이 선택되면 호출된다. 이미지 파일 여부 확인하여 서버로 전송.
function uploadPhoto() {
var data = $jQ("#file01 ").val();
if(data != ""){
if(!chkFileType(data)) {
alert(" < LTag: message spec = "dbmsg"
code = "INFO.PHOTO.UPLOAD_JPG" / > ");
return;
}
/*
if(chkFileSize($jQ("#file01 ")) > 1024*1024*10) {
//alert(" < LTag: message spec = "dbmsg"
code = "ERR.PHOTO.SELECT_NO_IMG" / > ");
alert("
Photo Upload는10M Byte이하만가능합니다.");
return;
}
*/
setAddBtnLock();
var form = $jQ("#galleryForm ");
form.attr("
action ", " < c: url value = "/web/smart/gallery/gallery/savePhotoGallery.ajax" / > ");
form.submit();
showLoadingMask(".col_join ");
}
}
// 업로드 완료시 호출된다.
function returnUploadPhoto(result,state) {
hideLoadingMask(".col_join ");
var rtnMsg = result.replace(/<[^>]*[>]/gi, ""); // fireFox 에서는 result 값이 <pre>~</pre>에 쌓여서 리턴됨.
try {
if (state == "
success " && rtnMsg.length > 0) {
var json = rtnMsg.evalJSON();
if(typeof(json.lv1_success) == "
undefined ") {
//alert("
ERROR::" + json.message[0].$text + " [" + json.code[0].$text + "]");
alert(" < LTag: message spec = "dbmsg"
code = "ERR.GALLERY.GALLERYUP" / > ");
} else {
retrieveGalleryLeft('1');
}
} else {
alert(" < LTag: message spec = "dbmsg"
code = "ERR.GALLERY.GALLERYUP" / > ");
}
} catch (e) {
alert(" < LTag: message spec = "dbmsg"
code = "ERR.GALLERY.GALLERYUP" / > ");
}
setAddBtnUnLock();
}
// Add 버튼을 막는다.
function setAddBtnLock() {
$jQ(".btn_image ").attr("
class ","
btn_loading ");
$jQ(".btn_loading ").removeAttr("
value ");
// $jQ(".btn_image ").css("
background ","
url( < LTag: webPath kind = "image" > /smart/btn / btn_loading.gif < /LTag:webPath>) no-repeat;");
}
/ / Add버튼풀기
function setAddBtnUnLock() {
$jQ(".btn_loading").attr("class", "btn_image");
$jQ(".btn_image").attr("value", "<LTag:message spec="
dbmsg " code="
LABEL.GALLERY.IMAGE " />");
// $jQ(".gallery_add_btn").attr("src","<LTag:webPath kind="image">/smart/btn/btn_add.gif</LTag:webPath>");
$jQ("#galleryForm")[0].reset();
}
// Delete 버튼을 막는다.
function setDeleteBtnLock() {
$jQ(".btn_delete").attr("src", "<LTag:webPath kind="
image ">/smart/btn/btn_loading.gif</LTag:webPath>");
$jQ(".btn_delete").css("cursor", "default");
$jQ(".btn_delete").unbind("click");
}
// Delete 버튼 풀기
function setDeleteBtnUnLock() {
$jQ(".btn_delete").attr("src", "<LTag:webPath kind="
image ">/smart/btn/btn_delete.gif</LTag:webPath>");
$jQ(".btn_delete").css("cursor", "pointer");
$jQ(".btn_delete").click(function(event) {
deletePhoto();
});
}
// Gallery목록 조회
function retrieveGalleryLeft(flag) {
if (!(flag != null && flag == '0')) {
showLoadingMask(".col_join");
}
var ajax = new devon.xSync("<c:url value=" / web / smart / gallery / gallery / retrieveGalleryLeft.ajax "/>");
ajax.addQuery("leftYn", 'Y');
ajax.fire();
}
// Requisite Callback
function retrieveGalleryLeftAfter(json) {
alert(json.errMsg);
returnGalleryLeft(json);
}
// Gallery목록 리턴
function returnGalleryLeft(json, instance, node, dom) {
$jQ('#albumPhone').empty();
$jQ('#albumPc').empty();
var TempStr = "?????";
var cnt = 1;
var pcCnt = 1;
var alCnt = 1;
var fisrtHtml = "";
var lastHtml = "";
var firstAlbumName = "";
var albumHtml = "";
var albumObj;
var Flag = false;
var isAlbum = false;
// Album 과 PC 에 데이터가 있을때
if (typeof(json.id) != "undefined") {
for (var i = 0; i < json.album.length; i++) {
albumName = json.album[i].$text;
if (currentAlbum == albumName) {
isAlbum = true;
}
// Album, PC목록 데이터 카운트
if (albumName == TempStr) {
cnt++;
if (albumName == "") {
pcCnt++;
} else {
alCnt++;
}
if ((i + 1) == json.album.length) {
if (TempStr == "") {
$jQ("#albumPc span:last").text(cnt);
} else {
$jQ("#albumPhone span:last").text(cnt);
}
}
} else {
if (i > 0) {
if (TempStr == "") {
$jQ("#albumPc span:last").text(cnt);
} else {
$jQ("#albumPhone span:last").text(cnt);
}
cnt = 1;
alCnt = 1;
}
if (albumName != "") {
fisrtHtml = '<dl> ' + ' <dt class="drop_area"><img src="<LTag:webPath kind="image">/smart/ico/ico_gallery_off.gif</LTag:webPath>" alt="" class="rollover" /> ' + ' <a href="#">' + albumName + ' (<span id="' + albumName + '"></span>)</a> ' + ' </dt> ' + '</dl> ';
$jQ('#albumPhone').append(fisrtHtml);
} else {
lastHtml = '<dl> ' + ' <dt class="drop_area"><img src="<LTag:webPath kind="image">/smart/ico/ico_gallery_off.gif</LTag:webPath>" alt="" class="rollover" /> ' + ' <a href="#">' + 'PC' + ' (<span id=""></span>)</a> ' + ' </dt> ' + '</dl> ';
Flag = true;
$jQ('#albumPc').append(lastHtml);
}
TempStr = albumName;
}
}
}
// PC 데이터가 0건일때
if (Flag == false) {
albumHtml = '<dl> ' + ' <dt class="drop_area"><img src="<LTag:webPath kind="image">/smart/ico/ico_gallery_off.gif</LTag:webPath>" alt="" class="rollover" /> ' + ' <a href="#">' + 'PC' + ' (<span id="">0</span>)</a> ' + ' </dt> ' + '</dl> ';
$jQ('#albumPc').append(albumHtml);
} else {
$jQ("#albumPc span:last").text(pcCnt);
}
// 앨범데이터가 한건으로 끝날 경우 카운트 처리
if ($jQ('#albumPhone').html() != "") {
$jQ("#albumPhone span:last").text(alCnt);
}
// 앨범명 선택시 색반전 효과
firstAlbumName = $jQ(".list-box_scroll span:first").attr("id");
if (firstFlag != "N") {
retrieveGalleryList(firstAlbumName, '0');
$jQ('.list-box_scroll dl dt:first').addClass("current");
} else {
if (currentAlbum == "PC^^^^") {
currentAlbum = "";
$jQ('.list-box_scroll dl dt:last').addClass("current");
retrieveGalleryList(currentAlbum, '0');
} else if (isAlbum) {
retrieveGalleryList(currentAlbum, '0');
$jQ('.list-box_scroll dl dt').delegate('a', 'click', function() {
//$jQ('.list-box_scroll dl dt a').each(function() {
if (currentAlbum == $jQ(this).children().attr("id")) {
$jQ(this).parent().addClass("current");
}
});
} else {
retrieveGalleryList(firstAlbumName, '0');
$jQ('.list-box_scroll dl dt:first').addClass("current");
}
}
var list_box_scroll_dl_dt = $jQ('#list-box_scroll_id dl dt');
// 앨범명 클릭시 선택되어진 앨범표시 효과
//$jQ('.list-box_scroll dl dt a').click(function() {
list_box_scroll_dl_dt.delegate('a', 'click', function() {
list_box_scroll_dl_dt.removeClass("current");
$jQ(this).parent().addClass("current");
$jQ(this).parent().find('img.rollover').attr('src', $jQ(this).parent().find('img.rollover').attr('src').replace('_on', '_off'));
retrieveGalleryList($jQ(this).children().attr("id"), "1");
});
// 나머지 앨범 마우스 오버시 색반전 효과
list_box_scroll_dl_dt.hover(function() {
if ($jQ(this).attr("class") == "drop_area") {
$jQ(this).addClass('over');
$jQ(this).find('img.rollover').attr('src', $jQ(this).find('img.rollover').attr('src').replace('_off', '_on'));
}
}, function() {
$jQ(this).removeClass('over');
$jQ(this).find('img.rollover').attr('src', $jQ(this).find('img.rollover').attr('src').replace('_on', '_off'));
});
}
// GalleryList 조회
function retrieveGalleryList(albumName, flag) {
$jQ(".vmiddle").attr("checked", "");
if (!(flag != null && flag == '0')) {
showLoadingMask(".col_join");
}
// PC일때만 Add버튼 노출
if (albumName == "") {
//$jQ('#addBtn').empty();
//$jQ("#addBtn").append("<input type=\"image\" src=\"<LTag:webPath kind='image'>/smart/btn/btn_add.gif</LTag:webPath>\" class=\"gallery_add_btn\" name=\"contacts_new\" alt=\"<LTag:message spec="dbmsg" code="LABEL.GALLERY.ADD" />\" />");
$jQ("#addBtn").css("display", "");
$jQ('.file_upload_gallery').css("display", "");
} else {
//$jQ('#addBtn').empty();
$jQ("#addBtn").css("display", "none");
$jQ('.file_upload_gallery').css("display", "none");
}
var ajax = new devon.xSync("<c:url value=" / web / smart / gallery / gallery / retrieveGallery.ajax "/>");
currentAlbum = albumName;
firstFlag = "N";
ajax.addQuery("albumNm", albumName);
ajax.fire();
}
// Requisite Callback
function retrieveGalleryAfter(json) {
alert(json.errMsg);
returnGalleryList(json);
}
// GalleryList 리턴
function returnGalleryList(json, instance, node, dom) {
$jQ('.gallery_scroll').empty();
var addHtml = "";
var thumbnails;
var portalurl;
var photoUrl;
var thumbnails_data;
var timeinfo = "";
var addCnt = 0;
var cnt = 0;
try {
if (typeof(json.id) != "undefined" && json.id.length > 0) {
// 총 사진 목록 수 만큼 생성
var json_id_length = json.id.length;
for (var i = 0; i < json_id_length; i++) {
thumbnails = json.thumbnails[i].$text;
portalurl = json.lv2_portalurl[i].$text;
thumbnails_data = thumbnails.evalJSON();
// timeinfo(오늘/최근한주/최근한달/이후년월) 별로 /Table 처리
if (timeinfo != "" && timeinfo != json.timeinfo[i].$text) {
var cnt = 4 - ((addCnt) % 4);
if (cnt < 4) {
for (var x = 0; x < cnt; x++) {
addHtml += '<td><p width="152px"></p></td>';
}
addHtml += '</tr>';
}
addHtml += '</table>';
}
// timeinfo(오늘/최근한주/최근한달/이후년월) 별로 Header, Table 처리
if (timeinfo != json.timeinfo[i].$text) {
var msgTime = json.timeinfo[i].$text;
if ("Today" == msgTime) {
msgTime = "<LTag:message spec="
dbmsg " code="
TEXT.GALLERY.TODAY " />";
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table">';
addCnt = 0;
} else if ("Weeks In Recent Times" == msgTime) {
//var msgTime = json.timeinfo[i].$text;
msgTime = "<LTag:message spec="
dbmsg " code="
TEXT.GALLERY.LASTWEEK " />";
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table" >';
addCnt = 0;
} else if ("Months In Recent Times" == msgTime) {
// var msgTime = json.timeinfo[i].$text;
msgTime = "<LTag:message spec="
dbmsg " code="
TEXT.GALLERY.LASTMONTH " />";
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table">';
addCnt = 0;
} else {
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table">';
addCnt = 0;
}
}
timeinfo = json.timeinfo[i].$text;
// 한줄에 4장씩 보여준다.
if ((addCnt) % 4 == 0) {
addHtml += '<tr>';
}
// 사진 목록당 176, 504 사이즈 2장씩의 url이 존재하므로 176사이즈 만 뽑아낸다.
var thumbnails_data_length = thumbnails_data.length;
for (var j = 0; j < thumbnails_data_length; j++) {
if (thumbnails_data[j].size == "176") {
photoUrl = thumbnails_data[j].url;
var text = json.id[i].$text;
addHtml += '' + '<td>' + '<p class="g_img">' + '<input type="checkbox" class="list_ck" id="chkFile" name="chkFile" value="' + text + '|' + portalurl + json.url[i].$text + '|' + json.name[i].$text + '"/>' + '<a href="#"><img src="' + portalurl + '' + photoUrl + '" alt="" style="cursor:pointer" onClick="retrieveGalleryDetail(\'' + text + '\', \'' + currentAlbum + '\')" /></a>' + '</p>' + '</td>' + '';
}
}
if (i > 0 && (addCnt + 1) % 4 == 0) {
addHtml += '</tr>';
}
// 마지막 건인 경우 /Table 처리.
if (json.id.length == (i + 1)) {
var cnt = 4 - ((addCnt + 1) % 4);
if (cnt < 4) {
for (var x = 0; x < cnt; x++) {
addHtml += '<td><p width="152px"></p></td>';
}
addHtml += '</tr>';
addHtml += '</table>';
}
}
addCnt++;
}
$jQ('.gallery_scroll').append(addHtml);
$jQ('.gallery_subj span').css("font-size", "11px");
// 0건이 아닐때 삭제,다운로드, 전체선택 활성화
$jQ(".btn_delete").removeAttr("disabled");
$jQ(".btn_down").removeAttr("disabled");
$jQ(".btn-d").removeAttr("disabled");
// $jQ(".file_upload_gallery").css("left", "-20px");
// $jQ(".file_upload_gallery").css("top", "-25px");
// $jQ(".file_upload_gallery div").css("top", "25px");
// $jQ(".file_upload_gallery div").css("left", "85px");
} else {
// 0건일때 삭제,다운로드, 전체선택 비활성화
$jQ(".btn_delete").attr("disabled", "disabled");
$jQ(".btn_down").attr("disabled", "disabled");
$jQ(".btn-d").attr("disabled", "disabled");
// $jQ(".file_upload_gallery").css("left", "85px");
// $jQ(".file_upload_gallery").css("top", "-25px");
// $jQ(".file_upload_gallery div").css("top", "25px");
// $jQ(".file_upload_gallery div").css("left", "85px");
}
} catch (e) {
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.RETRIEVE2 " />");
}
// 사진 리스트 사이즈 조절(타이머 사용안하는 걸로 변환) - 전탁공s
/* setTimeout(function() {
hideLoadingMask(".col_join");
}, 300);
*/
// 사진 리스트 사이즈 조절(img load 후 리사이즈) - 전탁공S - 11.09.15
var gallery_scroll_img = $jQ(".gallery_scroll img");
gallery_scroll_img.load(function() {
var image = $jQ(this);
var w = $jQ(image).attr("width");
var h = $jQ(image).attr("height");
if ((w - h) > 0) {
$jQ(image).attr("width", "136");
h = $jQ(image).attr("height");
// if((w-h) < 40) {
if (h > 104) {
$jQ(image).removeAttr("width");
$jQ(image).attr("height", "104");
}
} else {
$jQ(image).attr("height", "104");
}
});
// 이미지 resize 완료 후 마스크 해제 - 전탁공s - 11.09.15
hideLoadingMask(".col_join");
//사진에 마우스 오버시에만 체크박스 표시, 선택된 사진은 계속 체크박스 보이도록.
var gallery_table_tr_td = $jQ('.gallery_table tr td');
$jQ('.gallery_table tr td .list_ck').hide();
gallery_table_tr_td.delegate('p.g_img', 'hover', function(event) {
//jquery 1.4.2 mouseover -> 1.4.3 mouseenter
if (event.type === 'mouseover') {
$jQ(this).find('.list_ck').show();
} else {
var checkbox = $jQ(this).attr("name") == "chkFile" ? $jQ(this) : $jQ(this).find('.list_ck');
if (!checkbox.is(":checked")) {
checkbox.hide();
}
}
});
//선택한 사진의 배경 변경.
$jQ('.gallery_table tr td').delegate('.list_ck', 'click', function() {
//var gallery_table_tr_td_list_ck = $jQ('.gallery_table tr td .list_ck');
//gallery_table_tr_td_list_ck.click(function(){
if (this.checked) {
$jQ(this).parent().css({
"background": "#dfeff8"
});
} else {
$jQ(this).parent().css({
"background": "url('/images/smart/bg/bg_gallery_frame.gif')"
});
}
});
}
// 포토사진을 삭제한다.
function deletePhoto() {
var str = {
pictures: []
};
$jQ(".list_ck").filter(":checked").each(function(index, element) {
var photoId = $jQ(this).val();
photoId = photoId.substring(0, photoId.indexOf("|"));
str.pictures[str.pictures.length] = photoId;
});
if (str.pictures.length == 0) {
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.SELECT_NO_IMG " />");
return;
}
var json = Object.toJSON(str);
var ajax = new devon.xSync("<c:url value=" / web / smart / gallery / gallery / deletePhotoGallery.ajax " />");
ajax.addQuery("data", "{data:" + json + "}");
ajax.fire();
setDeleteBtnLock();
showLoadingMask(".col_join");
}
// Requisite Callback
function deletePhotoGalleryAfter(json) {
alert(json.errMsg);
returnDeletePhoto(json);
}
// 포토 삭제 완료시 호출된다.
function returnDeletePhoto(json, instance, node, dom) {
hideLoadingMask(".col_join");
if (typeof(json.lv1_success) == "undefined") {
//alert("ERROR :: " + json.lv2_message[0].$text + "[" + json.lv2_code[0].$text + "]");
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.DELETE2 " />");
} else {
//alert("Success");
retrieveGalleryLeft('1');
}
setDeleteBtnUnLock();
}
// 포토 다운로드
function downloadPhoto() {
if (currentAlbum == "") {
$jQ("#downAlbum").val("Link_Gallery_PC.zip");
} else {
$jQ("#downAlbum").val("Link_Gallery_" + currentAlbum + ".zip");
}
if ($jQ(".list_ck").is(":checked")) {
actSubmit($('downloadForm'), "<c:url value='/web/smart/gallery/gallery/galDown.dev'/>", "iframeFileDownload");
} else {
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.SELECT_NO_IMG " />");
}
}
// 상세페이지를 호출한다. Flash 설치여부를 판단하여 설치되있으면 Flash팝업화면을 호출.
function retrieveGalleryDetail(id, albumNm) {
$jQ("#id").val(id);
$jQ("#albumNm").val(albumNm);
document.forms.detailForm.albumNm.value = albumNm;
var playerVersion = swfobject.getFlashPlayerVersion();
var majorVersion = playerVersion.major;
if (majorVersion == 0) {
actSubmit($('detailForm'), "<c:url value='/web/smart/gallery/gallery/galDetail.dev'/>");
} else {
//window.open("<c:url value='/web/smart/gallery/gallery/galpop.dev'/>","detail", "width=640, height=680");
window.open("", "detail", "top=10, width=610, height=620, resizable=yes");
actSubmit($('detailForm'), "<c:url value='/web/smart/gallery/gallery/galpop.dev'/>", "detail");
}
}
// 최종 싱크 시간을 조회한다.
function retrieveLastSync() {
var ajax = new devon.xSync("<c:url value=" / web / smart / contact / contact / retrieveLastSync.ajax " />");
ajax.fire();
}
// 최종 싱크 시간 리턴
function retrieveLastSyncAfter(response, instance, node, dom) {
var json = response.$text;
try {
if (response.errMsg) {
// alert(response.errMsg);
return;
}
var data = json.evalJSON();
var error = data.error;
if (error) {
// alert((error.code ? error.code + ":\n\n" : "") + error.message);
// alert("<LTag:message spec="dbmsg" code="TEXT.ERR.RETRIEVE" />");
return;
}
if (data.data) {
var lastsynchronizations = data.data.lastsynchronizations;
if (lastsynchronizations) {
for (var i = 0; i < lastsynchronizations.length; i++) {
if (lastsynchronizations[i].status != 200) {
continue;
}
// if (lastsynchronizations[i].devicetype != "Phone") {
// continue;
// }
if (lastsynchronizations[i].syncsource != "cal") {
continue;
}
var time = new Date(lastsynchronizations[i].endsync);
var year = time.getFullYear();
var month = time.getMonth() + 1;
var date = time.getDate();
var hour = time.getHours();
var minute = time.getMinutes();
var stTime;
month = (month < 10 ? "0" : "") + month;
date = (date < 10 ? "0" : "") + date;
//hour = (hour < 10 ? "0" : "") + hour;
minute = (minute < 10 ? "0" : "") + minute;
// 시간이 12보다 작으면서 1~9일때 앞에 0을 붙임
if (hour < 12 && hour != "00" && hour != 0) {
hour = (hour < 10 ? "0" : "") + hour;
stTime = hour + ":" + minute + "AM";
}
// 시간이 00 이면 밤12시로 세팅
if (hour == "00") {
hour = "12";
stTime = hour + ":" + minute + "AM";
}
// 시간이 12보다 크면 13~24시 로 넘어오기때문에 12빼서 처리
if (hour > 12 && hour != "") {
hour = hour - 12;
hour = (hour < 10 ? "0" : "") + hour;
stTime = hour + ":" + minute + "PM";
}
// var format = month + "-" + date + "-" + year + " " + hour + ":" + minute;
var format = month + "-" + date + "-" + year + " " + stTime;
$jQ(".updated_date strong").text(format);
break;
}
}
}
} catch (e) {
// alert("retrieveLastSyncAfter:\n\n" + json);
// alert("<LTag:message spec="dbmsg" code="TEXT.ERR.RETRIEVE" />");
}
}
// 전역 함수를 정의한다.
function showLoadingMask(selector) {
var division = $jQ(selector);
var left = division.position().left;
var top = division.position().top;
var width = division.outerWidth();
var height = division.outerHeight();
left = 0;
top = 0;
top = top + $jQ(".col_join").scrollTop();
var style = {
"left": left + "px",
"top": top + "px",
"width": width + "px",
"height": height + "px"
};
division.append("<div class=\"x-loading-mask\"></div>");
division.append("<div class=\"x-loading-indicator\"></div>");
division.children(".x-loading-mask").css(style);
division.children(".x-loading-indicator").css(style);
}
function hideLoadingMask(selector) {
var division = $jQ(selector);
division.children(".x-loading-indicator").fadeOut("slow", function() {
division.children(".x-loading-mask").remove();
$jQ(this).remove();
});
}
< /script>
</head > < body > < div id = "loading-mask" > < /div>
<%--
<div id="loading-indicator">
<div class="loading-logo">
<h1><img src="<LTag:webPath kind="image">/account / login_logo.gif < /LTag:webPath>" alt="LG Link" / > < /h1>
</div > < div class = "loading-guide" > < dl > < dt > < h2 > < LTag: message spec = "dbmsg"
code = "LABEL.SIGNUP.TOP40" / > < /h2>
<h3><LTag:message spec="dbmsg" code="TEXT.SIGNUP.TOP40" / > < LTag: message spec = "dbmsg"
code = "TEXT.SIGNUP.TOP41" / > < /h3>
</dt > < dd > < img src = "<LTag:webPath kind="
image ">/account/login_visual_04.jpg</LTag:webPath>"
alt = "" / > < /dd>
</dl > < /div>
</div > -- % > < div id = "loading-indicator" > < /div>
<!-- wrapper -->
<div id="wrapper" class="top_gallery">
<div id="container">
<!-- body -->
<div id="body">
<!-- aside -->
<div id="aside" class="d-line">
<h1 id="header"><a href="#" onclick="javascript:goHomeUrl(); return false;"><img src="<LTag:webPath kind="image">/common / logo.gif < /LTag:webPath>" alt="LG Link" / > < /a></h1 > < div class = "inner" >
<!--
lnb -->
< div id = "lnb" > < div class = "list-box" > < h2 class = "title" > < LTag: message spec = "dbmsg"
code = "LABEL.LEFT.GALLERY" / > < /h2>
<div class="list-box_scroll" id="list-box_scroll_id">
<div id="albumPhone" name="albumPhone"></div > < div id = "albumPc"
name = "albumPc" > < /div>
</div > < /div>
</div > < /div>
<div class="sync_bottom">
<div class="sync_bar">
<div class="updated">
<!--
<p class="updated_date"><LTag:message spec="dbmsg" code="LABEL.CONTACT.LAST_SYNCED" / > < strong > 00 - 00 - 0000 00: 00 < /strong></p > -- > < p class = "updated_bar_small" > < span > & nbsp; < /span></p > < p class = "updated_mb" > < strong > < /strong></p > < /div>
</div > < /div>
</div >
<!--
contents -->
< div id = "contents"
class = "gallery_bg" > < % @include file = "/jsp/sys/include/topMenu_smart.jspf" % >
<!--
center -->
< div class = "col_join" > < div class = "guide_gallery" > < p class = "tit_gallery" > < LTag: message spec = "dbmsg"
code = "TITLE.GALLERY.GALLERY" / > < /p>
<div class="gallery_btn">
<span class="fl">
<label class="btn-d vmiddle" for="allcheck" >
<span><input type="checkbox" class="vmiddle" id="allcheck" name="allcheck" / > < LTag: message spec = "dbmsg"
code = "LABEL.GALLERY.SELECT_ALL" / > < /span>
</label > < input type = "button"
value = "<LTag:message spec="
dbmsg " code="
LABEL.CONTACT.DELETE " />"
class = "btn_delete"
alt = "" / > < span id = "addBtn"
style = "display:none" > < input type = "button"
value = "<LTag:message spec="
dbmsg " code="
LABEL.GALLERY.IMAGE " />"
class = "btn_image"
name = "contacts_new"
alt = "Add"
style = "width:76px; z-index:99;" / > < /span>
<input type="button" class="btn_down" value="<LTag:message spec="dbmsg" code="LABEL.GALLERY.DOWNLOAD" / > " />
</span>
<form id="
galleryForm " name="
galleryForm " enctype="
multipart / form - data " method="
post ">
<span class="
fr "></span>
<span class="
file_upload_gallery "><input type="
file " id="
file01 " name="
file01 " size="
10 " style="
width: 160px!important;
cursor: pointer;
cursor: hand;
"/></span>
</form>
</div>
</div>
<form id="
downloadForm " name="
downloadForm " method="
post ">
<input type="
hidden " name="
downAlbum " id="
downAlbum ">
<div class="
gallery_scroll ">
<!--
<div class="
gallery_more "><input type="
button " class="
btn_board_more " value="
More " /></div>
<ul class="
board_num ">
<li class="
np "><a href="#"><img src=" < LTag: webPath kind = "image" > /smart/btn / btn_first.gif < /LTag:webPath>" alt="first" / > < /a></li > < li class = "np" > < a href = "#" > < img src = "<LTag:webPath kind="
image ">/smart/btn/btn_prev.gif</LTag:webPath>"
alt = "prev" / > < /a></li > < li class = "bgnone" > < a href = "#"
class = "selected" > 1 < /a></li > < li > < a href = "#" > 2 < /a></li > < li > < a href = "#" > 3 < /a></li > < li > < a href = "#" > 4 < /a></li > < li class = "np" > < a href = "#" > < img src = "<LTag:webPath kind="
image ">/smart/btn/btn_next.gif</LTag:webPath>"
alt = "next" / > < /a></li > < li class = "np" > < a href = "#" > < img src = "<LTag:webPath kind="
image ">/smart/btn/btn_last.gif</LTag:webPath>"
alt = "last" / > < /a></li > < /ul>
-->
</div > < /form>
</div > < div class = "clear" > <!--
clear float -->
< /div>
<%@ include file="/jsp / sys / include / tail.jspf "%>
</div>
</div>
</div>
</div>
<form id="
detailForm " name="
detailForm " method="
post ">
<input type="
hidden " name="
id " id="
id " value="" />
<input type="
hidden " name="
albumNm " id="
albumNm " value="" />
</form>
<iframe id="
iframeFileDownload " name="
iframeFileDownload " src="" style="
display: none "></iframe>
<img id="
fileSizeChk " name="
fileSizeChk " src='' style="
display: none;
">
</body>
</html> < script type = \"text/javascript\"\nsrc = \"swfobject.js\" > < /script>\n<%@ include file=\"/jsp / web / smt / com / RetrieveStorage.jspf \" %>\n\n\n | ready |
| gallery | < % -- * CAS Team, LG ELECTRONICS INC., SEOUL, KOREA * Copyright(c) 2011 by LG Electronics Inc. * * All rights reserved.No part of this work may be reproduced, stored in a * retrieval system, or transmitted by any means without prior written * permission of LG Electronics Inc. * @Source: contact_list.jsp * @Description: 썸네일엘범리스트조회 * @Version: v1.0 * * === === === === === === === === === === === === === === === === === === === === === === == * No DATE Author Description * === === === === === === === === === === === === === === === === === === === === === === == * 1.0 2011 - 05 - 18김철Initial Coding * === === === === === === === === === === === === === === === === === === === === === === == -- % >
< % @page language = "java"
pageEncoding = "UTF-8"
contentType = "text/html; charset=UTF-8" % > < % @include file = "/jsp/sys/include/doctype.jspf" % > < % @include file = "/jsp/sys/include/common.jspf" % > < html xmlns = "http://www.w3.org/1999/xhtml"
xml: lang = "ko"
lang = "ko" > < jsp: useBean id = "data"
class = "devon.core.collection.LData"
scope = "request" / >
< head >
< % @include file = "/jsp/sys/include/head.jspf" % > < % @include file = "/jsp/sys/include/head_smart.jspf" % > < % @include file = "/jsp/sys/include/web_auto.jspf" % >
< meta http - equiv = "Content-Style-Type"
content = "text/css" / > < meta http - equiv = "Pragma"
content = "no-cache" / > < meta http - equiv = "Imagetoolbar"
content = "no" / >
< title > Link < LTag: message spec = 'dbmsg'
code = 'TITLE.GALLERY.GALLERY' / > < /title>
<script type="text/javascript" src=" < LTag: webPath kind = "js" > smart.js < /LTag:webPath>"></script > < script type = "text/javascript"
src = "<LTag:webPath kind="
js ">swfobject.js</LTag:webPath>" > < /script>
<%@ include file="/jsp / web / smt / com / RetrieveStorage.jspf " %>
<style type="
text / css ">
.btn_loading{ background:url(/images/smart/btn/btn_loading.gif) no-repeat; padding:0 0 0 31px;}
.btn_loading { width:76px; height:26px; overflow:hidden; border:0; text-align:left; line-height:26px; cursor:default; font-size:11px; font-weight:bold; }
#loading-mask {
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:30000;
filter:alpha(opacity:50);
opacity:0.50;
}
<%--
#loading-indicator {
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:30001;
background:transparent url(<LTag:webPath kind="
image ">/account/bg_body_login.gif</LTag:webPath>) repeat-x left top;
}
#loading-indicator div {
margin:0 auto 0 auto;
padding:0 40px 0 40px;
width:668px;
}
#loading-indicator.loading-guide {
height:395px;
}
#loading-indicator h1 {
padding:8px 0 0 0;
text-align:left;
}
#loading-indicator dl {
margin:48px 0 0 0;
padding:0px;
list-style:none;
}
#loading-indicator dl dt {
margin:0px;
padding:0px;
height:101px;
}
#loading-indicator h2 {
margin:0px;
padding:0px;
color:#343844;
font-size:32px;
}
#loading-indicator h3 {
margin:10px 0 0 0;
padding:0px;
color:#5e616b;
font-size:15px;
}
#loading-indicator dl dd {
margin:0px;
padding:0px;
height:297px;
}
--%>
#loading-indicator {
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
z-index:30001;
}
.x-loading-mask {
position:absolute;
left:0;
top:0;
z-index:20000;
filter:alpha(opacity:50);
opacity:0.50;
}
.x-loading-indicator {
position:absolute;
left:0;
top:0;
z-index:20001;
background:transparent url(/images/common/loading.gif) no-repeat center center;
}
.x-hidden {
display:none;
}
</style>
<script type="
text / javascript ">
var currentAlbum = " < c: out value = "${data.albumNm}" / > ";
var firstFlag = " < c: out value = "${data.firstFlag}" / > ";
// 초기 셋팅 정의
$jQ(document).ready(function() {
$jQ("#galleryForm ").submit(function(event) {
$jQ(this).ajaxSubmit(returnUploadPhoto);
return false;
});
$jQ("#file01 ").change(function(event) {
uploadPhoto();
});
$jQ(".btn_delete ").click(function(event) {
deletePhoto();
});
$jQ(".btn_down ").click(function() {
downloadPhoto();
});
// 전체선택 체크시 리스트 체크박스 show 체크해제시 hide..
$jQ(".btn - d: checkbox ").unbind("
click ");
$jQ(".btn - d ").delegate(':checkbox', 'click', function(){
//$jQ(".btn - d: checkbox ").click(function(){
$bChk = $jQ(this).is(':checked');
var gallery_table_checkbox = $jQ(".gallery_table: checkbox ");
if(this.checked){
$jQ(gallery_table_checkbox).attr("
checked ", $bChk).show();
//$jQ(gallery_table_checkbox).show();
$jQ("
table.gallery_table: checkbox ").parent().css({ "
background ":"#dfeff8 " });
} else {
$jQ(gallery_table_checkbox).attr("
checked ","").hide();
//$jQ(gallery_table_checkbox).hide();
//$jQ(".gallery_table: checkbox ").attr("
checked ","");
//$jQ(".gallery_table: checkbox ").hide();
$jQ("
table.gallery_table: checkbox ").parent().css({ "
background ":"
url('/images/smart/bg/bg_gallery_frame.gif')" });
}
});
//retrieveLastSync();
setTimeout(function(){
$jQ("#loading - indicator ").fadeOut("
slow ", function() {
$jQ("#loading - mask ").hide();
retrieveGalleryLeft('1');
$jQ(this).remove();
});
}, 400);
});
// 파일명의 확장자를 구분하여 허용된 확장자인지 리턴한다.
function chkFileType(filename) {
var returnFlag = false;
var splitData = filename.split(".");
var lastData = splitData[splitData.length-1].toUpperCase();
if(lastData=="
JPEG " || lastData=="
JPG " || lastData=="
GIF " || lastData=="
PNG "){
returnFlag = true;
}
return returnFlag;
}
/*
// 파일의 size 를 리턴한다. - Byte
function chkFileSize(fileObj) {
var fileBytes;
if ( $jQ.browser.msie ) {
if($jQ.browser.version < 7) {
var img = new Image();
img.src = fileObj.val();
$jQ('#fileSizeChk').attr('src',img.src);
fileBytes = document.getElementById('fileSizeChk').fileSize;
} else {
var activeXObj = new ActiveXObject("
Scripting.FileSystemObject ");
var img = activeXObj.GetFile(fileObj.val());
fileBytes = img.size;
}
} else {
fileBytes = fileObj[0].files[0].fileSize;
}
return fileBytes;
}
*/
// 업로드 파일이 선택되면 호출된다. 이미지 파일 여부 확인하여 서버로 전송.
function uploadPhoto() {
var data = $jQ("#file01 ").val();
if(data != ""){
if(!chkFileType(data)) {
alert(" < LTag: message spec = "dbmsg"
code = "INFO.PHOTO.UPLOAD_JPG" / > ");
return;
}
/*
if(chkFileSize($jQ("#file01 ")) > 1024*1024*10) {
//alert(" < LTag: message spec = "dbmsg"
code = "ERR.PHOTO.SELECT_NO_IMG" / > ");
alert("
Photo Upload는10M Byte이하만가능합니다.");
return;
}
*/
setAddBtnLock();
var form = $jQ("#galleryForm ");
form.attr("
action ", " < c: url value = "/web/smart/gallery/gallery/savePhotoGallery.ajax" / > ");
form.submit();
showLoadingMask(".col_join ");
}
}
// 업로드 완료시 호출된다.
function returnUploadPhoto(result,state) {
hideLoadingMask(".col_join ");
var rtnMsg = result.replace(/<[^>]*[>]/gi, ""); // fireFox 에서는 result 값이 <pre>~</pre>에 쌓여서 리턴됨.
try {
if (state == "
success " && rtnMsg.length > 0) {
var json = rtnMsg.evalJSON();
if(typeof(json.lv1_success) == "
undefined ") {
//alert("
ERROR::" + json.message[0].$text + " [" + json.code[0].$text + "]");
alert(" < LTag: message spec = "dbmsg"
code = "ERR.GALLERY.GALLERYUP" / > ");
} else {
retrieveGalleryLeft('1');
}
} else {
alert(" < LTag: message spec = "dbmsg"
code = "ERR.GALLERY.GALLERYUP" / > ");
}
} catch (e) {
alert(" < LTag: message spec = "dbmsg"
code = "ERR.GALLERY.GALLERYUP" / > ");
}
setAddBtnUnLock();
}
// Add 버튼을 막는다.
function setAddBtnLock() {
$jQ(".btn_image ").attr("
class ","
btn_loading ");
$jQ(".btn_loading ").removeAttr("
value ");
// $jQ(".btn_image ").css("
background ","
url( < LTag: webPath kind = "image" > /smart/btn / btn_loading.gif < /LTag:webPath>) no-repeat;");
}
/ / Add버튼풀기
function setAddBtnUnLock() {
$jQ(".btn_loading").attr("class", "btn_image");
$jQ(".btn_image").attr("value", "<LTag:message spec="
dbmsg " code="
LABEL.GALLERY.IMAGE " />");
// $jQ(".gallery_add_btn").attr("src","<LTag:webPath kind="image">/smart/btn/btn_add.gif</LTag:webPath>");
$jQ("#galleryForm")[0].reset();
}
// Delete 버튼을 막는다.
function setDeleteBtnLock() {
$jQ(".btn_delete").attr("src", "<LTag:webPath kind="
image ">/smart/btn/btn_loading.gif</LTag:webPath>");
$jQ(".btn_delete").css("cursor", "default");
$jQ(".btn_delete").unbind("click");
}
// Delete 버튼 풀기
function setDeleteBtnUnLock() {
$jQ(".btn_delete").attr("src", "<LTag:webPath kind="
image ">/smart/btn/btn_delete.gif</LTag:webPath>");
$jQ(".btn_delete").css("cursor", "pointer");
$jQ(".btn_delete").click(function(event) {
deletePhoto();
});
}
// Gallery목록 조회
function retrieveGalleryLeft(flag) {
if (!(flag != null && flag == '0')) {
showLoadingMask(".col_join");
}
var ajax = new devon.xSync("<c:url value=" / web / smart / gallery / gallery / retrieveGalleryLeft.ajax "/>");
ajax.addQuery("leftYn", 'Y');
ajax.fire();
}
// Requisite Callback
function retrieveGalleryLeftAfter(json) {
alert(json.errMsg);
returnGalleryLeft(json);
}
// Gallery목록 리턴
function returnGalleryLeft(json, instance, node, dom) {
$jQ('#albumPhone').empty();
$jQ('#albumPc').empty();
var TempStr = "?????";
var cnt = 1;
var pcCnt = 1;
var alCnt = 1;
var fisrtHtml = "";
var lastHtml = "";
var firstAlbumName = "";
var albumHtml = "";
var albumObj;
var Flag = false;
var isAlbum = false;
// Album 과 PC 에 데이터가 있을때
if (typeof(json.id) != "undefined") {
for (var i = 0; i < json.album.length; i++) {
albumName = json.album[i].$text;
if (currentAlbum == albumName) {
isAlbum = true;
}
// Album, PC목록 데이터 카운트
if (albumName == TempStr) {
cnt++;
if (albumName == "") {
pcCnt++;
} else {
alCnt++;
}
if ((i + 1) == json.album.length) {
if (TempStr == "") {
$jQ("#albumPc span:last").text(cnt);
} else {
$jQ("#albumPhone span:last").text(cnt);
}
}
} else {
if (i > 0) {
if (TempStr == "") {
$jQ("#albumPc span:last").text(cnt);
} else {
$jQ("#albumPhone span:last").text(cnt);
}
cnt = 1;
alCnt = 1;
}
if (albumName != "") {
fisrtHtml = '<dl> ' + ' <dt class="drop_area"><img src="<LTag:webPath kind="image">/smart/ico/ico_gallery_off.gif</LTag:webPath>" alt="" class="rollover" /> ' + ' <a href="#">' + albumName + ' (<span id="' + albumName + '"></span>)</a> ' + ' </dt> ' + '</dl> ';
$jQ('#albumPhone').append(fisrtHtml);
} else {
lastHtml = '<dl> ' + ' <dt class="drop_area"><img src="<LTag:webPath kind="image">/smart/ico/ico_gallery_off.gif</LTag:webPath>" alt="" class="rollover" /> ' + ' <a href="#">' + 'PC' + ' (<span id=""></span>)</a> ' + ' </dt> ' + '</dl> ';
Flag = true;
$jQ('#albumPc').append(lastHtml);
}
TempStr = albumName;
}
}
}
// PC 데이터가 0건일때
if (Flag == false) {
albumHtml = '<dl> ' + ' <dt class="drop_area"><img src="<LTag:webPath kind="image">/smart/ico/ico_gallery_off.gif</LTag:webPath>" alt="" class="rollover" /> ' + ' <a href="#">' + 'PC' + ' (<span id="">0</span>)</a> ' + ' </dt> ' + '</dl> ';
$jQ('#albumPc').append(albumHtml);
} else {
$jQ("#albumPc span:last").text(pcCnt);
}
// 앨범데이터가 한건으로 끝날 경우 카운트 처리
if ($jQ('#albumPhone').html() != "") {
$jQ("#albumPhone span:last").text(alCnt);
}
// 앨범명 선택시 색반전 효과
firstAlbumName = $jQ(".list-box_scroll span:first").attr("id");
if (firstFlag != "N") {
retrieveGalleryList(firstAlbumName, '0');
$jQ('.list-box_scroll dl dt:first').addClass("current");
} else {
if (currentAlbum == "PC^^^^") {
currentAlbum = "";
$jQ('.list-box_scroll dl dt:last').addClass("current");
retrieveGalleryList(currentAlbum, '0');
} else if (isAlbum) {
retrieveGalleryList(currentAlbum, '0');
$jQ('.list-box_scroll dl dt').delegate('a', 'click', function() {
//$jQ('.list-box_scroll dl dt a').each(function() {
if (currentAlbum == $jQ(this).children().attr("id")) {
$jQ(this).parent().addClass("current");
}
});
} else {
retrieveGalleryList(firstAlbumName, '0');
$jQ('.list-box_scroll dl dt:first').addClass("current");
}
}
var list_box_scroll_dl_dt = $jQ('#list-box_scroll_id dl dt');
// 앨범명 클릭시 선택되어진 앨범표시 효과
//$jQ('.list-box_scroll dl dt a').click(function() {
list_box_scroll_dl_dt.delegate('a', 'click', function() {
list_box_scroll_dl_dt.removeClass("current");
$jQ(this).parent().addClass("current");
$jQ(this).parent().find('img.rollover').attr('src', $jQ(this).parent().find('img.rollover').attr('src').replace('_on', '_off'));
retrieveGalleryList($jQ(this).children().attr("id"), "1");
});
// 나머지 앨범 마우스 오버시 색반전 효과
list_box_scroll_dl_dt.hover(function() {
if ($jQ(this).attr("class") == "drop_area") {
$jQ(this).addClass('over');
$jQ(this).find('img.rollover').attr('src', $jQ(this).find('img.rollover').attr('src').replace('_off', '_on'));
}
}, function() {
$jQ(this).removeClass('over');
$jQ(this).find('img.rollover').attr('src', $jQ(this).find('img.rollover').attr('src').replace('_on', '_off'));
});
}
// GalleryList 조회
function retrieveGalleryList(albumName, flag) {
$jQ(".vmiddle").attr("checked", "");
if (!(flag != null && flag == '0')) {
showLoadingMask(".col_join");
}
// PC일때만 Add버튼 노출
if (albumName == "") {
//$jQ('#addBtn').empty();
//$jQ("#addBtn").append("<input type=\"image\" src=\"<LTag:webPath kind='image'>/smart/btn/btn_add.gif</LTag:webPath>\" class=\"gallery_add_btn\" name=\"contacts_new\" alt=\"<LTag:message spec="dbmsg" code="LABEL.GALLERY.ADD" />\" />");
$jQ("#addBtn").css("display", "");
$jQ('.file_upload_gallery').css("display", "");
} else {
//$jQ('#addBtn').empty();
$jQ("#addBtn").css("display", "none");
$jQ('.file_upload_gallery').css("display", "none");
}
var ajax = new devon.xSync("<c:url value=" / web / smart / gallery / gallery / retrieveGallery.ajax "/>");
currentAlbum = albumName;
firstFlag = "N";
ajax.addQuery("albumNm", albumName);
ajax.fire();
}
// Requisite Callback
function retrieveGalleryAfter(json) {
alert(json.errMsg);
returnGalleryList(json);
}
// GalleryList 리턴
function returnGalleryList(json, instance, node, dom) {
$jQ('.gallery_scroll').empty();
var addHtml = "";
var thumbnails;
var portalurl;
var photoUrl;
var thumbnails_data;
var timeinfo = "";
var addCnt = 0;
var cnt = 0;
try {
if (typeof(json.id) != "undefined" && json.id.length > 0) {
// 총 사진 목록 수 만큼 생성
var json_id_length = json.id.length;
for (var i = 0; i < json_id_length; i++) {
thumbnails = json.thumbnails[i].$text;
portalurl = json.lv2_portalurl[i].$text;
thumbnails_data = thumbnails.evalJSON();
// timeinfo(오늘/최근한주/최근한달/이후년월) 별로 /Table 처리
if (timeinfo != "" && timeinfo != json.timeinfo[i].$text) {
var cnt = 4 - ((addCnt) % 4);
if (cnt < 4) {
for (var x = 0; x < cnt; x++) {
addHtml += '<td><p width="152px"></p></td>';
}
addHtml += '</tr>';
}
addHtml += '</table>';
}
// timeinfo(오늘/최근한주/최근한달/이후년월) 별로 Header, Table 처리
if (timeinfo != json.timeinfo[i].$text) {
var msgTime = json.timeinfo[i].$text;
if ("Today" == msgTime) {
msgTime = "<LTag:message spec="
dbmsg " code="
TEXT.GALLERY.TODAY " />";
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table">';
addCnt = 0;
} else if ("Weeks In Recent Times" == msgTime) {
//var msgTime = json.timeinfo[i].$text;
msgTime = "<LTag:message spec="
dbmsg " code="
TEXT.GALLERY.LASTWEEK " />";
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table" >';
addCnt = 0;
} else if ("Months In Recent Times" == msgTime) {
// var msgTime = json.timeinfo[i].$text;
msgTime = "<LTag:message spec="
dbmsg " code="
TEXT.GALLERY.LASTMONTH " />";
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table">';
addCnt = 0;
} else {
addHtml += '<div class="gallery_subj"><span>' + msgTime + '</span></div>' + '<table class="gallery_table">';
addCnt = 0;
}
}
timeinfo = json.timeinfo[i].$text;
// 한줄에 4장씩 보여준다.
if ((addCnt) % 4 == 0) {
addHtml += '<tr>';
}
// 사진 목록당 176, 504 사이즈 2장씩의 url이 존재하므로 176사이즈 만 뽑아낸다.
var thumbnails_data_length = thumbnails_data.length;
for (var j = 0; j < thumbnails_data_length; j++) {
if (thumbnails_data[j].size == "176") {
photoUrl = thumbnails_data[j].url;
var text = json.id[i].$text;
addHtml += '' + '<td>' + '<p class="g_img">' + '<input type="checkbox" class="list_ck" id="chkFile" name="chkFile" value="' + text + '|' + portalurl + json.url[i].$text + '|' + json.name[i].$text + '"/>' + '<a href="#"><img src="' + portalurl + '' + photoUrl + '" alt="" style="cursor:pointer" onClick="retrieveGalleryDetail(\'' + text + '\', \'' + currentAlbum + '\')" /></a>' + '</p>' + '</td>' + '';
}
}
if (i > 0 && (addCnt + 1) % 4 == 0) {
addHtml += '</tr>';
}
// 마지막 건인 경우 /Table 처리.
if (json.id.length == (i + 1)) {
var cnt = 4 - ((addCnt + 1) % 4);
if (cnt < 4) {
for (var x = 0; x < cnt; x++) {
addHtml += '<td><p width="152px"></p></td>';
}
addHtml += '</tr>';
addHtml += '</table>';
}
}
addCnt++;
}
$jQ('.gallery_scroll').append(addHtml);
$jQ('.gallery_subj span').css("font-size", "11px");
// 0건이 아닐때 삭제,다운로드, 전체선택 활성화
$jQ(".btn_delete").removeAttr("disabled");
$jQ(".btn_down").removeAttr("disabled");
$jQ(".btn-d").removeAttr("disabled");
// $jQ(".file_upload_gallery").css("left", "-20px");
// $jQ(".file_upload_gallery").css("top", "-25px");
// $jQ(".file_upload_gallery div").css("top", "25px");
// $jQ(".file_upload_gallery div").css("left", "85px");
} else {
// 0건일때 삭제,다운로드, 전체선택 비활성화
$jQ(".btn_delete").attr("disabled", "disabled");
$jQ(".btn_down").attr("disabled", "disabled");
$jQ(".btn-d").attr("disabled", "disabled");
// $jQ(".file_upload_gallery").css("left", "85px");
// $jQ(".file_upload_gallery").css("top", "-25px");
// $jQ(".file_upload_gallery div").css("top", "25px");
// $jQ(".file_upload_gallery div").css("left", "85px");
}
} catch (e) {
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.RETRIEVE2 " />");
}
// 사진 리스트 사이즈 조절(타이머 사용안하는 걸로 변환) - 전탁공s
/* setTimeout(function() {
hideLoadingMask(".col_join");
}, 300);
*/
// 사진 리스트 사이즈 조절(img load 후 리사이즈) - 전탁공S - 11.09.15
var gallery_scroll_img = $jQ(".gallery_scroll img");
gallery_scroll_img.load(function() {
var image = $jQ(this);
var w = $jQ(image).attr("width");
var h = $jQ(image).attr("height");
if ((w - h) > 0) {
$jQ(image).attr("width", "136");
h = $jQ(image).attr("height");
// if((w-h) < 40) {
if (h > 104) {
$jQ(image).removeAttr("width");
$jQ(image).attr("height", "104");
}
} else {
$jQ(image).attr("height", "104");
}
});
// 이미지 resize 완료 후 마스크 해제 - 전탁공s - 11.09.15
hideLoadingMask(".col_join");
//사진에 마우스 오버시에만 체크박스 표시, 선택된 사진은 계속 체크박스 보이도록.
var gallery_table_tr_td = $jQ('.gallery_table tr td');
$jQ('.gallery_table tr td .list_ck').hide();
gallery_table_tr_td.delegate('p.g_img', 'hover', function(event) {
//jquery 1.4.2 mouseover -> 1.4.3 mouseenter
if (event.type === 'mouseover') {
$jQ(this).find('.list_ck').show();
} else {
var checkbox = $jQ(this).attr("name") == "chkFile" ? $jQ(this) : $jQ(this).find('.list_ck');
if (!checkbox.is(":checked")) {
checkbox.hide();
}
}
});
//선택한 사진의 배경 변경.
$jQ('.gallery_table tr td').delegate('.list_ck', 'click', function() {
//var gallery_table_tr_td_list_ck = $jQ('.gallery_table tr td .list_ck');
//gallery_table_tr_td_list_ck.click(function(){
if (this.checked) {
$jQ(this).parent().css({
"background": "#dfeff8"
});
} else {
$jQ(this).parent().css({
"background": "url('/images/smart/bg/bg_gallery_frame.gif')"
});
}
});
}
// 포토사진을 삭제한다.
function deletePhoto() {
var str = {
pictures: []
};
$jQ(".list_ck").filter(":checked").each(function(index, element) {
var photoId = $jQ(this).val();
photoId = photoId.substring(0, photoId.indexOf("|"));
str.pictures[str.pictures.length] = photoId;
});
if (str.pictures.length == 0) {
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.SELECT_NO_IMG " />");
return;
}
var json = Object.toJSON(str);
var ajax = new devon.xSync("<c:url value=" / web / smart / gallery / gallery / deletePhotoGallery.ajax " />");
ajax.addQuery("data", "{data:" + json + "}");
ajax.fire();
setDeleteBtnLock();
showLoadingMask(".col_join");
}
// Requisite Callback
function deletePhotoGalleryAfter(json) {
alert(json.errMsg);
returnDeletePhoto(json);
}
// 포토 삭제 완료시 호출된다.
function returnDeletePhoto(json, instance, node, dom) {
hideLoadingMask(".col_join");
if (typeof(json.lv1_success) == "undefined") {
//alert("ERROR :: " + json.lv2_message[0].$text + "[" + json.lv2_code[0].$text + "]");
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.DELETE2 " />");
} else {
//alert("Success");
retrieveGalleryLeft('1');
}
setDeleteBtnUnLock();
}
// 포토 다운로드
function downloadPhoto() {
if (currentAlbum == "") {
$jQ("#downAlbum").val("Link_Gallery_PC.zip");
} else {
$jQ("#downAlbum").val("Link_Gallery_" + currentAlbum + ".zip");
}
if ($jQ(".list_ck").is(":checked")) {
actSubmit($('downloadForm'), "<c:url value='/web/smart/gallery/gallery/galDown.dev'/>", "iframeFileDownload");
} else {
alert("<LTag:message spec="
dbmsg " code="
ERR.PHOTO.SELECT_NO_IMG " />");
}
}
// 상세페이지를 호출한다. Flash 설치여부를 판단하여 설치되있으면 Flash팝업화면을 호출.
function retrieveGalleryDetail(id, albumNm) {
$jQ("#id").val(id);
$jQ("#albumNm").val(albumNm);
document.forms.detailForm.albumNm.value = albumNm;
var playerVersion = swfobject.getFlashPlayerVersion();
var majorVersion = playerVersion.major;
if (majorVersion == 0) {
actSubmit($('detailForm'), "<c:url value='/web/smart/gallery/gallery/galDetail.dev'/>");
} else {
//window.open("<c:url value='/web/smart/gallery/gallery/galpop.dev'/>","detail", "width=640, height=680");
window.open("", "detail", "top=10, width=610, height=620, resizable=yes");
actSubmit($('detailForm'), "<c:url value='/web/smart/gallery/gallery/galpop.dev'/>", "detail");
}
}
// 최종 싱크 시간을 조회한다.
function retrieveLastSync() {
var ajax = new devon.xSync("<c:url value=" / web / smart / contact / contact / retrieveLastSync.ajax " />");
ajax.fire();
}
// 최종 싱크 시간 리턴
function retrieveLastSyncAfter(response, instance, node, dom) {
var json = response.$text;
try {
if (response.errMsg) {
// alert(response.errMsg);
return;
}
var data = json.evalJSON();
var error = data.error;
if (error) {
// alert((error.code ? error.code + ":\n\n" : "") + error.message);
// alert("<LTag:message spec="dbmsg" code="TEXT.ERR.RETRIEVE" />");
return;
}
if (data.data) {
var lastsynchronizations = data.data.lastsynchronizations;
if (lastsynchronizations) {
for (var i = 0; i < lastsynchronizations.length; i++) {
if (lastsynchronizations[i].status != 200) {
continue;
}
// if (lastsynchronizations[i].devicetype != "Phone") {
// continue;
// }
if (lastsynchronizations[i].syncsource != "cal") {
continue;
}
var time = new Date(lastsynchronizations[i].endsync);
var year = time.getFullYear();
var month = time.getMonth() + 1;
var date = time.getDate();
var hour = time.getHours();
var minute = time.getMinutes();
var stTime;
month = (month < 10 ? "0" : "") + month;
date = (date < 10 ? "0" : "") + date;
//hour = (hour < 10 ? "0" : "") + hour;
minute = (minute < 10 ? "0" : "") + minute;
// 시간이 12보다 작으면서 1~9일때 앞에 0을 붙임
if (hour < 12 && hour != "00" && hour != 0) {
hour = (hour < 10 ? "0" : "") + hour;
stTime = hour + ":" + minute + "AM";
}
// 시간이 00 이면 밤12시로 세팅
if (hour == "00") {
hour = "12";
stTime = hour + ":" + minute + "AM";
}
// 시간이 12보다 크면 13~24시 로 넘어오기때문에 12빼서 처리
if (hour > 12 && hour != "") {
hour = hour - 12;
hour = (hour < 10 ? "0" : "") + hour;
stTime = hour + ":" + minute + "PM";
}
// var format = month + "-" + date + "-" + year + " " + hour + ":" + minute;
var format = month + "-" + date + "-" + year + " " + stTime;
$jQ(".updated_date strong").text(format);
break;
}
}
}
} catch (e) {
// alert("retrieveLastSyncAfter:\n\n" + json);
// alert("<LTag:message spec="dbmsg" code="TEXT.ERR.RETRIEVE" />");
}
}
// 전역 함수를 정의한다.
function showLoadingMask(selector) {
var division = $jQ(selector);
var left = division.position().left;
var top = division.position().top;
var width = division.outerWidth();
var height = division.outerHeight();
left = 0;
top = 0;
top = top + $jQ(".col_join").scrollTop();
var style = {
"left": left + "px",
"top": top + "px",
"width": width + "px",
"height": height + "px"
};
division.append("<div class=\"x-loading-mask\"></div>");
division.append("<div class=\"x-loading-indicator\"></div>");
division.children(".x-loading-mask").css(style);
division.children(".x-loading-indicator").css(style);
}
function hideLoadingMask(selector) {
var division = $jQ(selector);
division.children(".x-loading-indicator").fadeOut("slow", function() {
division.children(".x-loading-mask").remove();
$jQ(this).remove();
});
}
< /script>
</head > < body > < div id = "loading-mask" > < /div>
<%--
<div id="loading-indicator">
<div class="loading-logo">
<h1><img src="<LTag:webPath kind="image">/account / login_logo.gif < /LTag:webPath>" alt="LG Link" / > < /h1>
</div > < div class = "loading-guide" > < dl > < dt > < h2 > < LTag: message spec = "dbmsg"
code = "LABEL.SIGNUP.TOP40" / > < /h2>
<h3><LTag:message spec="dbmsg" code="TEXT.SIGNUP.TOP40" / > < LTag: message spec = "dbmsg"
code = "TEXT.SIGNUP.TOP41" / > < /h3>
</dt > < dd > < img src = "<LTag:webPath kind="
image ">/account/login_visual_04.jpg</LTag:webPath>"
alt = "" / > < /dd>
</dl > < /div>
</div > -- % > < div id = "loading-indicator" > < /div>
<!-- wrapper -->
<div id="wrapper" class="top_gallery">
<div id="container">
<!-- body -->
<div id="body">
<!-- aside -->
<div id="aside" class="d-line">
<h1 id="header"><a href="#" onclick="javascript:goHomeUrl(); return false;"><img src="<LTag:webPath kind="image">/common / logo.gif < /LTag:webPath>" alt="LG Link" / > < /a></h1 > < div class = "inner" >
<!--
lnb -->
< div id = "lnb" > < div class = "list-box" > < h2 class = "title" > < LTag: message spec = "dbmsg"
code = "LABEL.LEFT.GALLERY" / > < /h2>
<div class="list-box_scroll" id="list-box_scroll_id">
<div id="albumPhone" name="albumPhone"></div > < div id = "albumPc"
name = "albumPc" > < /div>
</div > < /div>
</div > < /div>
<div class="sync_bottom">
<div class="sync_bar">
<div class="updated">
<!--
<p class="updated_date"><LTag:message spec="dbmsg" code="LABEL.CONTACT.LAST_SYNCED" / > < strong > 00 - 00 - 0000 00: 00 < /strong></p > -- > < p class = "updated_bar_small" > < span > & nbsp; < /span></p > < p class = "updated_mb" > < strong > < /strong></p > < /div>
</div > < /div>
</div >
<!--
contents -->
< div id = "contents"
class = "gallery_bg" > < % @include file = "/jsp/sys/include/topMenu_smart.jspf" % >
<!--
center -->
< div class = "col_join" > < div class = "guide_gallery" > < p class = "tit_gallery" > < LTag: message spec = "dbmsg"
code = "TITLE.GALLERY.GALLERY" / > < /p>
<div class="gallery_btn">
<span class="fl">
<label class="btn-d vmiddle" for="allcheck" >
<span><input type="checkbox" class="vmiddle" id="allcheck" name="allcheck" / > < LTag: message spec = "dbmsg"
code = "LABEL.GALLERY.SELECT_ALL" / > < /span>
</label > < input type = "button"
value = "<LTag:message spec="
dbmsg " code="
LABEL.CONTACT.DELETE " />"
class = "btn_delete"
alt = "" / > < span id = "addBtn"
style = "display:none" > < input type = "button"
value = "<LTag:message spec="
dbmsg " code="
LABEL.GALLERY.IMAGE " />"
class = "btn_image"
name = "contacts_new"
alt = "Add"
style = "width:76px; z-index:99;" / > < /span>
<input type="button" class="btn_down" value="<LTag:message spec="dbmsg" code="LABEL.GALLERY.DOWNLOAD" / > " />
</span>
<form id="
galleryForm " name="
galleryForm " enctype="
multipart / form - data " method="
post ">
<span class="
fr "></span>
<span class="
file_upload_gallery "><input type="
file " id="
file01 " name="
file01 " size="
10 " style="
width: 160px!important;
cursor: pointer;
cursor: hand;
"/></span>
</form>
</div>
</div>
<form id="
downloadForm " name="
downloadForm " method="
post ">
<input type="
hidden " name="
downAlbum " id="
downAlbum ">
<div class="
gallery_scroll ">
<!--
<div class="
gallery_more "><input type="
button " class="
btn_board_more " value="
More " /></div>
<ul class="
board_num ">
<li class="
np "><a href="#"><img src=" < LTag: webPath kind = "image" > /smart/btn / btn_first.gif < /LTag:webPath>" alt="first" / > < /a></li > < li class = "np" > < a href = "#" > < img src = "<LTag:webPath kind="
image ">/smart/btn/btn_prev.gif</LTag:webPath>"
alt = "prev" / > < /a></li > < li class = "bgnone" > < a href = "#"
class = "selected" > 1 < /a></li > < li > < a href = "#" > 2 < /a></li > < li > < a href = "#" > 3 < /a></li > < li > < a href = "#" > 4 < /a></li > < li class = "np" > < a href = "#" > < img src = "<LTag:webPath kind="
image ">/smart/btn/btn_next.gif</LTag:webPath>"
alt = "next" / > < /a></li > < li class = "np" > < a href = "#" > < img src = "<LTag:webPath kind="
image ">/smart/btn/btn_last.gif</LTag:webPath>"
alt = "last" / > < /a></li > < /ul>
-->
</div > < /form>
</div > < div class = "clear" > <!--
clear float -->
< /div>
<%@ include file="/jsp / sys / include / tail.jspf "%>
</div>
</div>
</div>
</div>
<form id="
detailForm " name="
detailForm " method="
post ">
<input type="
hidden " name="
id " id="
id " value="" />
<input type="
hidden " name="
albumNm " id="
albumNm " value="" />
</form>
<iframe id="
iframeFileDownload " name="
iframeFileDownload " src="" style="
display: none "></iframe>
<img id="
fileSizeChk " name="
fileSizeChk " src='' style="
display: none;
">
</body>
</html> < script type = \"text/javascript\"\nsrc = \"swfobject.js\" > < /script>\n<%@ include file=\"/jsp / web / smt / com / RetrieveStorage.jspf \" %>\n\n\n | ready |